Skip to content

Commit f6e1153

Browse files
maguileracdietmarw
andauthored
Updated Tutorial - Example 4 (OpenIPSL#351)
* Copy SMIB_Tutorial repo contents to Resources folder Files from the external repository https://github.com/ALSETLab/SMIB_Tutorial have been copied to the Resources folder. This will allow us to manage the scripts to create power flow records directly within the OpenIPSL repository. * Update names inside create_pf_records module The following changes have been applied to create_pf_records.py: - Modelica object names have been updated to be upperCamelCase. - Replace variable 'V' with variable 'v' in Bus records. * Update regex expression in generate_component_list A new more explicit way of finding generators in the Modelica Network model has been introduced. A for loop is now used to iterate over several regex patterns to detect generator objects. * Update names inside gridcal2rec module The following changes have been applied to gridcal2rec.py: - Modelica object names have been updated to be upperCamelCase. - Variable 'V' has been replaced with variable 'v' in Bus records. * Update link inside main Instructions documentation Link to python scripts to create and populate records with PF results has been updated. The scripts are now available within the OpenIPSL repository. * Update steps defined in PFRecordCreation documentation * Update steps defined in InstallingGridCal doc Steps have been updated to ensure a working installation of GridCal 4.5.1 under a conda environment. * Fix HTML issue with li tags * Update steps defined in PopulatingRecords doc * Revert changes to tutorial 4 images * Update GridCal installation instructions - Instructions have been updated to install the latest version of GridCal. - Miniconda is no longer used. - GridCal installation is recommended on a python 3.12.7 virtual env. * Fix HTML issue with li tags * Clean up pf record generation utils - All python files are now located in the pf2rec folder below Resources/pf2rec. - Modelica, csv and PSS/E files have been removed from Resources. * Update python pf record creation scripts - Logic associated to OpenIPSL old versions has been removed to keep code simpler. - A list of regex patterns is used to identify generating units in OpenIPSL network models. * Update python pf record population scripts - Code has been updated to reflect changes in GridCal API and data model (reference version = GridCal v5.1.52). - Support for old versions of OpenIPSL has been removed to make the code simpler. * Fix invalid escape sequence issue in regex * Fix issue in transformer pf record generation Tail of the pf record was missing, leading to syntax errors. * Update PFRecordCreation doc - python scripts The instructions have been updated to properly use the pf record generation scripts. * Correct the unit * Update PopulatingRecords doc - PSSE Files PSS/E Files folder is no longer kept within the Resources folder. The instruction have been modified to guide the user in the process of creating the raw file that is used as an input to populate the pf records with GridCal. * Escape \ chars inside paths in documentation * Whitespace fix. * Fix case of Python --------- Co-authored-by: Dietmar Winkler <dietmar.winkler@dwe.no>
1 parent 80fb1b4 commit f6e1153

12 files changed

Lines changed: 1249 additions & 258 deletions

File tree

OpenIPSL/Examples/Tutorial/Example_4/Instructions/InstallingGridCal.mo

Lines changed: 105 additions & 126 deletions
Large diffs are not rendered by default.

OpenIPSL/Examples/Tutorial/Example_4/Instructions/PFRecordCreation.mo

Lines changed: 20 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3,108 +3,63 @@ model PFRecordCreation "Creating the PF Structure"
33
extends Modelica.Icons.Information;
44
annotation (DocumentationClass=true, Documentation(info="<html>
55
<h5>Creating and Integrating the Power Flow Structure</h5>
6+
<p>After completing the instructions in <a href=\"modelica://OpenIPSL.Examples.Tutorial.Example_4.Instructions.SMIBSystemAssembly\">Assembling a SMIB System</a>, you should have a <font color=\"blue\"><code>SMIB</code></font> folder inside your working directory. </p>
67
<ol>
7-
<li>Create a directory called <font color=\"blue\"><code>models</code></font> above your model current folder. </li>
8-
<li>Move your model folder to the directory created in <strong>step 2</strong>. For example, let&apos;s assume you are using the new version of OpenIPSL, then if your model is saved in a folder called <font color=\"blue\"><code>SMIB</code></font>, the new path of your folder should be <font color=\"blue\"><code>models/SMIB</code></font>. </li>
9-
<li>Make sure the directory <font color=\"blue\"><code>pf2rec</code></font> downloaded from the <font color=\"blue\"><code>SMIB_Tutorial</code></font> repository is in the same directory. The tree below shows how your folder structure should look like:
8+
<li>Create a directory called <font color=\"blue\"><code>SMIB_Example</code></font> at the same level where the <font color=\"blue\"><code>SMIB</code></font> folder is located. </li>
9+
<li>Create a directory called <font color=\"blue\"><code>models</code></font> below your new <font color=\"blue\"><code>SMIB_Example</code></font> folder. </li>
10+
<li>Move the <font color=\"blue\"><code>SMIB</code></font> folder below the previously added <font color=\"blue\"><code>models</code></font> folder. </li>
11+
<li>Copy the <font color=\"blue\"><code>pf2rec</code></font> folder from <a href=\"modelica://OpenIPSL/Resources/utils\">Resources</a> to the <font color=\"blue\"><code>SMIB_Example</code></font> folder. </li>
12+
<li>Move the <font color=\"blue\"><code>create_records.py</code></font> and <font color=\"blue\"><code>run_pf.py</code></font> Python files one level up (i.e., to the <font color=\"blue\"><code>SMIB_Example</code></font> folder). The tree below shows how your folder structure should look like:
1013
<blockquote><pre>
11-
C:\\Users\\...>tree /f /a SMIB
14+
C:\\Users\\...>tree /f /a SMIB_Example
1215
Folder PATH listing
1316
Volume serial number is ...
14-
C:\\USERS\\...\\SMIB
17+
C:\\USERS\\...\\SMIB_Example
1518
| create_records.py
1619
| run_pf.py
17-
|
1820
+---models
1921
| \\---SMIB
2022
| | ...
2123
|
2224
\\---pf2rec
25+
| create_pf_records.py
26+
| generate_component_list.py
27+
| gridcal2rec.py
28+
| __init__.py
2329
| ...
24-
</pre></blockquote>
25-
</li>
26-
<li>In the same location where you have your <font color=\"blue\"><code>models</code></font> and <font color=\"blue\"><code>pf2rec</code></font> folders, create a new python file called <font color=\"blue\"><code>create_records.py</code></font>. Copy and paste the following code in the file. <em>Be careful with indentation!</em>
27-
<blockquote><pre>
28-
<strong>from</strong> pf2rec <strong>import</strong> *
29-
30-
<strong>import</strong> argparse
31-
<strong>import</strong> os
32-
<strong>import</strong> re
33-
34-
parser = argparse.ArgumentParser()
35-
36-
parser.add_argument(<em>\"--model\"</em>, help = <em>\"Name of the package containing the target OpenIPSL model. Defaults to 'SMIB'\"</em>)
37-
38-
args = parser.parse_args()
39-
40-
<strong>if</strong> __name__ == <em>'__main__'</em>:
41-
42-
<strong>if</strong> args.model:
43-
_model = args.model
44-
<strong>else</strong>:
45-
_model = <em>'SMIB'</em>
46-
47-
<em># Absolute path to the '.mo' file of the model (total model)</em>
48-
data_path = os.path.abspath(os.path.join(os.getcwd(), <em>\"models\"</em>, _model))
49-
50-
path_mo_file = os.path.abspath(os.path.join(data_path, <em>f\"</em>{_model}<em>Total.mo\"</em>))
51-
52-
<em># Remove Modelica code lines from the '.mo' file that alter the expected input for</em>
53-
<em># pf2rec functions (the GenerationUnits package section of Modelica code should </em>
54-
<em># be excluded)</em>
55-
includeCodeLine = False <em># True if line of code should be included</em>
56-
new_lines = list()
57-
<strong>with</strong> open(path_mo_file, <em>\"r\"</em>) <strong>as</strong> mo_file:
58-
lines = mo_file.readlines()
59-
60-
<strong>for</strong> l <strong>in</strong> lines:
61-
<strong>if</strong> re.search(<em>\"^package\\sSMIB\"</em>, l):
62-
includeCodeLine = True
63-
<strong>if</strong> re.search(<em>\"^\\s+package\\sGenerationUnits\"</em>, l):
64-
includeCodeLine = False
65-
<strong>if</strong> re.search(<em>\"^\\s+package\\sBaseNetwork\"</em>, l):
66-
includeCodeLine = True
67-
<strong>if</strong> includeCodeLine:
68-
new_lines.append(l);
69-
70-
<strong>with</strong> open(path_mo_file, <em>\"w\"</em>) <strong>as</strong> mo_file:
71-
<strong>for</strong> l <strong>in</strong> new_lines:
72-
mo_file.write(<em>\"{}\"</em>.format(l))
73-
74-
create_pf_records(_model,
75-
path_mo_file,
76-
data_path,
77-
openipsl_version = _version)
78-
7930
</pre></blockquote>
8031
</li>
8132
<li>Reload your model or run Dymola, depending on what you did at the end of the previous section. Create a package inside the root package <font color=\"blue\"><code>SMIB</code></font> and name it <font color=\"blue\"><code>Utilities</code></font>. </li>
8233
<li>Add a new function inside <font color=\"blue\"><code>Utilities</code></font> called <font color=\"blue\"><code>saveTotalSMIBModel</code></font>. Remember that the procedure for creating functions is the same as for other kinds of classes such as <font color=\"blue\"><code>Package</code></font>, <font color=\"blue\"><code>Model</code></font> or <font color=\"blue\"><code>Record</code></font>. </li>
8334
<li>Go to the Modelica text of the function and type the following code:
8435
<blockquote><pre>
8536
<strong>function</strong> saveTotalSMIBModel \"Save the SMIB package as a total model\"
86-
<strong>output</strong> <em>Boolean</em> ok \"True if succesful\";
37+
<strong>extends</strong> <em>Modelica.Icons.Function</em>;
38+
<strong>output</strong> <em>Boolean</em> ok \"= true if succesful\";
39+
<strong>protected</strong>
40+
<em>String</em> targetDir = \"C:/Users/Miguel/SMIB_Example/models/SMIB\";
8741
<strong>algorithm</strong>
88-
ok := <em>saveTotalModel</em>(\"SMIBTotal.mo\", \"SMIB\", <strong>true</strong>);
42+
ok := <em>saveTotalModel</em>(targetDir + \"/\" + \"SMIBTotal.mo\", \"SMIB\", <strong>true</strong>);
8943
<strong>end</strong> saveTotalSMIBModel;
9044
</pre></blockquote>
9145
<hr>
46+
<p>&#x1f528; <strong>Update</strong> the <em>targetDir</em> variable value with the appropriate path to reach the <font color=\"blue\"><code>SMIB</code></font> folder. </p>
9247
<p>&#x1F4CC; This function has no inputs and only one boolean output. The modelica standard function <em><font color=\"blue\"><code>saveTotalModel</code></font></em> is called inside the algorithm section with predefined arguments. You can check the information view of <em><font color=\"blue\"><code>saveTotalModel</code></font></em> to get to know the proper use of each of its parameters. To do that, make sure the <font color=\"blue\"><code>DymolaCommands</code></font> library is loaded within the Package Browser. Then navigate as shown in the picture below </p>
9348
<p>
9449
<img src=\"modelica://OpenIPSL/Resources/images/example_4/PFRecordCreation/SaveTotalModelFunction.png\" alt=\"SaveTotalModelFunction\" />
9550
</p>
9651
<hr>
9752
</li>
9853
<li>Right-click the <font color=\"blue\"><code>saveTotalSMIBModel</code></font> function from the Package Browser. Select the &quot; <em>Call Function...</em>&quot; option and then click the <font color=\"blue\"><code>OK</code></font> button. As a result, you should be able to see a new file called <em><font color=\"blue\"><code>SMIBTotal.mo</code></font></em> in the same folder where your model files are being stored. </li>
99-
<li>Go to the system terminal, change the current directory to the location where the <font color=\"blue\"><code>create_records</code></font> python script is placed and execute it as indicated below.
54+
<li>Go to the system terminal, change the current directory to the location where the <font color=\"blue\"><code>create_records</code></font> Python script is placed and execute it as indicated below.
10055
<blockquote><pre>
10156
<strong>python</strong> create_records.py
10257
</pre></blockquote>
10358
</li>
10459
<li>Go back to Dymola and refresh ( <img src=\"modelica://OpenIPSL/Resources/images/example_4/PFRecordCreation/RefreshButton.png\" alt=\"RefreshButton\" />) the SMIB package.
10560
<hr>
10661
<p>
107-
&#x1F4CC; The python script <font color=\"blue\"><code>create_records</code></font> should have created a new package inside your model that looks like this
62+
&#x1F4CC; The Python script <font color=\"blue\"><code>create_records</code></font> should have created a new package inside your model that looks like this
10863
</p>
10964
<p>
11065
<img src=\"modelica://OpenIPSL/Resources/images/example_4/PFRecordCreation/PFDataPackageStructure.png\" alt=\"PFDataPackageStructure\" />

OpenIPSL/Examples/Tutorial/Example_4/Instructions/PopulatingRecords.mo

Lines changed: 71 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,80 +5,74 @@ model PopulatingRecords "Populating PF Records"
55
<h5>Populating Power Flows with GridCal</h5>
66
<p>The next step is to populate our model with power flow results generated from GridCal. For simplicity, we will create a power flow model from an accompanying PSS/E <font color=\"blue\"><code>.raw</code></font>. However, it is possible to run the power flows from a native GridCal model. </p>
77
<ol>
8-
<li><a href=\"https://github.com/ALSETLab/SMIB_Tutorial/tree/master/models/_old/SMIB/PSSE_Files\">Download</a> the accompanying PSS/E <font color=\"blue\"><code>.raw</code></font> file (<font color=\"blue\"><code>SMIB_Base_Case.raw</code></font>) and save it in your model directory under <font color=\"blue\"><code>PSSE_Files</code></font>. The <font color=\"blue\"><code>.dyr</code></font> file is not required for power flow computations.
8+
<li>Create a new <a href=\"modelica://OpenIPSL/Resources/utils/pfRecordCreator/models/_new/SMIB\">PSSE_Files</a> folder within <font color=\"blue\"><code>SMIB_Example/models/SMIB</code></font> folder.
99
<p>
1010
<img src=\"modelica://OpenIPSL/Resources/images/example_4/PopulatingRecords/PSSEFilesFolder.png\" alt=\"PSSEFilesFolder\" />
1111
</p>
1212
</li>
13-
<li>Create a new Python script called <font color=\"blue\"><code>run_pf.py</code></font>. Copy and paste the following code inside it.
13+
<li>Create a new PSS/E raw file called <font color=\"blue\"><code>SMIB_Base_Case.raw</code></font> within the <font color=\"blue\"><code>PSSE_Files</code></font> folder. Copy and paste the following text inside the file and save it:
1414
<blockquote><pre>
15-
<strong>from</strong> pf2rec <strong>import</strong> *
16-
17-
<strong>import</strong> numpy <strong>as</strong> np
18-
<strong>import</strong> pandas <strong>as</strong> pd
19-
<strong>import</strong> matplotlib.pyplot <strong>as</strong> plt
20-
<strong>import</strong> datetime
21-
<strong>import</strong> random
22-
23-
<strong>from</strong> GridCal.Engine <strong>import</strong> *
24-
<strong>from</strong> GridCal.Engine.IO.file_handler <strong>import</strong> FileOpen
25-
<strong>from</strong> GridCal.Engine.Devices.shunt <strong>import</strong> Shunt
26-
<strong>from</strong> GridCal.Engine.Simulations.PowerFlow.time_series_driver <strong>import</strong> TimeSeries
27-
<strong>from</strong> GridCal.Engine.Simulations.PowerFlow.power_flow_driver <strong>import</strong> PowerFlowDriver
28-
29-
LIST_OF_MODELS = [<em>'AVRI'</em>, <em>'IEEE9'</em>, <em>'IEEE14'</em>, <em>'SMIB'</em>, <em>'TwoAreas'</em>]
30-
31-
<strong>import</strong> argparse
32-
<strong>import</strong> os
33-
34-
parser = argparse.ArgumentParser()
35-
36-
parser.add_argument(<em>\"model\"</em>, help = <em>\"Model for which the power flow structure will be created\"</em>)
37-
parser.add_argument(<em>\"--version\"</em>, help = <em>\"OpenIPSL version for which the model has been created. Defaults to '1.5.0'\"</em>)
38-
39-
args = parser.parse_args()
40-
41-
<strong>if</strong> __name__ == <em>'__main__'</em>:
42-
43-
_model = args.model
44-
<strong>if</strong> _model <strong>not in</strong> LIST_OF_MODELS:
45-
<strong>raise</strong> ValueError(<em>'Model not available'</em>)
46-
47-
# Absolute path to the data directory of the model
48-
data_path = os.path.abspath(os.path.join(os.getcwd(), <em>\"models\"</em>, _model))
49-
50-
grid = None
51-
52-
# Grid model in GridCal
53-
file_handler = FileOpen(os.path.abspath(os.path.join(data_path,
54-
<em>\"PSSE_Files\"</em>,
55-
<em>f\"</em>{_model}<em>_Base_Case.raw\"</em>)))
56-
57-
# Creating grid object
58-
grid = file_handler.open()
59-
60-
# Power flow options
61-
options = PowerFlowOptions(SolverType.NR,
62-
verbose = True,
63-
initialize_with_existing_solution = False,
64-
multi_core = False,
65-
tolerance = 1e-12,
66-
max_iter = 99,
67-
control_q = ReactivePowerControlMode.Direct)
68-
69-
pf = PowerFlowDriver(grid, options)
70-
71-
pf.run()
72-
73-
gridcal2rec(grid = grid, pf = pf, model_name = _model,
74-
data_path = data_path,
75-
pf_num = 0, export_pf_results = False,
76-
is_time_series = False, openipsl_version = '2.0.0')
77-
</pre></blockquote>
15+
0, 100.00, 33, 0, 1, 50.00 / PSS(R)E-33.4 FRI, FEB 26 2021 16:31
16+
SMIB
17+
18+
1,'B01 ', 100.0000,2, 1, 1, 1,1.00000, 4.0463,1.10000,0.90000,1.10000,0.90000
19+
2,'B02 ', 100.0000,3, 1, 1, 1,1.00000, 0.0000,1.10000,0.90000,1.10000,0.90000
20+
3,'B03 ', 100.0000,1, 1, 1, 1,0.99598, -0.2870,1.10000,0.90000,1.10000,0.90000
21+
4,'B04 ', 100.0000,1, 1, 1, 1,0.99199, -0.5763,1.10000,0.90000,1.10000,0.90000
22+
0 / END OF BUS DATA, BEGIN LOAD DATA
23+
4,'1 ',1, 1, 1, 50.000, 10.000, 0.000, 0.000, 0.000, 0.000, 1,1,0
24+
0 / END OF LOAD DATA, BEGIN FIXED SHUNT DATA
25+
0 / END OF FIXED SHUNT DATA, BEGIN GENERATOR DATA
26+
1,'1 ', 40.000, 5.417, 60.000, 0.000,1.00000, 0, 100.000, 0.00000E+0, 2.00000E-1, 0.00000E+0, 0.00000E+0,1.00000,1, 100.0, 80.000, 0.000, 1,1.0000
27+
2,'1 ', 10.017, 8.007, 60.000, 0.000,1.00000, 0, 100.000, 0.00000E+0, 2.00000E-1, 0.00000E+0, 0.00000E+0,1.00000,1, 100.0, 80.000, 0.000, 1,1.0000
28+
0 / END OF GENERATOR DATA, BEGIN BRANCH DATA
29+
1, 4,'1 ', 1.00000E-3, 2.00000E-1, 0.00000, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000, 0.00000,1,1, 0.00, 1,1.0000
30+
2, 3,'1 ', 5.00000E-4, 1.00000E-1, 0.00000, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000, 0.00000,1,2, 0.00, 1,1.0000
31+
2, 4,'1 ', 1.00000E-3, 2.00000E-1, 0.00000, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000, 0.00000,1,2, 0.00, 1,1.0000
32+
3, 4,'1 ', 5.00000E-4, 1.00000E-1, 0.00000, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000, 0.00000,1,2, 0.00, 1,1.0000
33+
0 / END OF BRANCH DATA, BEGIN TRANSFORMER DATA
34+
0 / END OF TRANSFORMER DATA, BEGIN AREA DATA
35+
0 / END OF AREA DATA, BEGIN TWO-TERMINAL DC DATA
36+
0 / END OF TWO-TERMINAL DC DATA, BEGIN VSC DC LINE DATA
37+
0 / END OF VSC DC LINE DATA, BEGIN IMPEDANCE CORRECTION DATA
38+
0 / END OF IMPEDANCE CORRECTION DATA, BEGIN MULTI-TERMINAL DC DATA
39+
0 / END OF MULTI-TERMINAL DC DATA, BEGIN MULTI-SECTION LINE DATA
40+
0 / END OF MULTI-SECTION LINE DATA, BEGIN ZONE DATA
41+
0 / END OF ZONE DATA, BEGIN INTER-AREA TRANSFER DATA
42+
0 / END OF INTER-AREA TRANSFER DATA, BEGIN OWNER DATA
43+
0 / END OF OWNER DATA, BEGIN FACTS DEVICE DATA
44+
0 / END OF FACTS DEVICE DATA, BEGIN SWITCHED SHUNT DATA
45+
0 / END OF SWITCHED SHUNT DATA, BEGIN GNE DATA
46+
0 / END OF GNE DATA, BEGIN INDUCTION MACHINE DATA
47+
0 / END OF INDUCTION MACHINE DATA
48+
Q
49+
</pre></blockquote>
7850
</li>
7951
<li>Execute <font color=\"blue\"><code>run_pf.py</code></font> from a terminal.
8052
<blockquote><pre>
81-
<strong>python</strong> run_pf.py SMIB --version 2.0.0
53+
<strong>python</strong> run_pf.py SMIB
54+
55+
(openipsl_tutorial) c:\\Users\\Miguel\\SMIB_Example><strong>python</strong> run_pf.py SMIB
56+
It 0, error 0.5, converged False, x [0. 0. 0. 1. 1.], dx not computed yet
57+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
58+
Iter: 1
59+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
60+
It 1, error 0.016918884074426793, converged False, x [ 0.07000175 -0.00498304 -0.00996608 0.99658333 0.99316667], dx [ 0.07000175 -0.00498304 -0.00996608 -0.00341667 -0.00683333]
61+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
62+
Iter: 2
63+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
64+
It 2, error 2.1358057256101737e-05, converged False, x [ 0.07061997 -0.00500866 -0.01005764 0.99598493 0.99199502], dx [ 0.00061822 -0.00002562 -0.00009156 -0.00059841 -0.00117164]
65+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
66+
Iter: 3
67+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
68+
It 3, error 3.453681785003937e-11, converged False, x [ 0.0706208 -0.00500868 -0.01005778 0.99598418 0.99199354], dx [ 0.00000083 -0.00000002 -0.00000014 -0.00000075 -0.00000148]
69+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
70+
Iter: 4
71+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
72+
It 4, error 3.802513859341161e-15, converged True, x [ 0.0706208 -0.00500868 -0.01005778 0.99598418 0.99199354], dx [ 0. -0. -0. -0. -0.]
73+
74+
(openipsl_tutorial) c:\\Users\\Miguel\\SMIB_Example>
75+
8276
</pre></blockquote>
8377
<hr>
8478
<p>&#x1F4CC; A new power flow record called <font color=\"blue\"><code>PF00000</code></font> should be generated inside the <font color=\"blue\"><code>PFData</code></font> subfolder. </p>
@@ -90,6 +84,17 @@ gridcal2rec(grid = grid, pf = pf, model_name = _model,
9084
</p>
9185
</li>
9286
<li>In the diagram layer of your SMIB model, double click the power flow component <font color=\"blue\"><code>pf</code></font>. Select the newly created power flow <font color=\"blue\"><code>PF00000</code></font> as the value for the <font color=\"blue\"><code>PowerFlow</code></font> field. By doing so, we are specifying that the model will initialize using the power flow results in that specific container.
87+
<p>&#x1F4CC; You can alternatively modify the <strong>Modelica Text</strong> of the <font color=\"blue\"><code>SMIB</code></font> Experiment model as follows: </p>
88+
<blockquote><pre>
89+
model SMIB
90+
extends Modelica.Icons.Example;
91+
<strong>extends BaseModels.BaseNetwork.SMIBPartial(pf(redeclare record PowerFlow = PFData.PF00000));</strong>
92+
replaceable BaseModels.GeneratingUnits.GeneratorOnly genunit...
93+
equation
94+
...
95+
annotation ...
96+
end SMIB;
97+
</pre></blockquote>
9398
<p>
9499
<img src=\"modelica://OpenIPSL/Resources/images/example_4/PopulatingRecords/ChoosePopulatedPFRecord.png\" alt=\"ChoosePopulatedPFRecord\" />
95100
</p>

0 commit comments

Comments
 (0)