MultiLoadflow Module¶
To run a Multi-Loadflow study you must create two CSV files. A Study Parameters CSV file for defining each study, and a Results Selection CSV file for defining the output. Unlike MultiFault Module, Multi-Loadflow does not provide methods for adding studies and result selection programmatically, and must be defined in CSV files. Below, the expected file structures are documented.
File Structure¶
There are two input files and one output file, each with specific structures.
Inputs:
Study Parameters CSV file
Result Selection CSV file
Outputs:
Result Output CSV file
Study Parameters CSV file¶
The following table demonstrates an example Study Parameters CSV file structure for Multi-Loadflow. CSV files can be worked with like tables in Excel and similar spreadsheet tools.
numloadflow |
2 |
||
---|---|---|---|
Element Type |
BusSection |
Switch |
LoadflowParam |
Element ID |
BS_PH2 |
CB_TxLE1 |
PMult |
Item ID |
swstate |
swstate |
PMult |
Parameter Values |
1 |
1 |
1 |
Parameter Values |
0 |
1 |
0.5 |
Parameter Values |
0 |
0 |
1 |
The CSV file looks like this in a text format:
numloadflow,2,,
Element Type,BusSection,Switch,LoadflowParam
Element ID,BS_PH2,CB_TxLE1,PMult
Item ID,swstate,swstate,PMult
Parameter Values,1,1,1
Parameter Values,0,1,0.5
Parameter Values,0,0,1
From the example above we can observe a number of things about the Study Parameters definition.
The first row defines the number of Loadflow studies to perform. In our example we’ve implied that we want 3 studies to be performed (by providing 3
Parameter Values
rows), but only 2 studies are going to be performed (becausenumloadflow
is set to 2), meaning the lastParameter Values
row will be ignored.The file will grow horizontally when adding more parameters to each study, and will grow vertically with each new study we define. The first column acts as the heading.
The second row defines which type of element to change the parameters for. If specified as “LoadflowParam” then it will set a Loadflow parameter rather than a specific element value. This makes Parameter definitions very flexible since Loadflow and Element data can be modified before each study. See the Glossary for a list of element types.
The third row defines the element ID we want to act upon. For the
BusSection
column we’re defining that we want to change data for bus section with ID BS_PH2. ForLoadflowParam
we’ve specified thePMult
parameter, since Loadflow isn’t tied to network elements.The fourth row defines what data we want to change. For bus section BS_Ph2 this is switch state. For the Loadflow Parameter, it’s still PMult, since Loadflow Parameters aren’t specific to an element. See the Glossary for possible item IDs for Loadflow Parameters.
From the fifth row onwards we will be specifying all data to use for each study. In our example, we close both switches (allowing power to run through them) and set the P Multiplier to 1. On the second study, we open the bus section switch to cut off power flow, and halve the P Multiplier.
Result Selection CSV file¶
The following table is an example of the Result Selection CSV structure for Multi-Loadflow.
Element Type |
Busbar |
SummaryRes |
---|---|---|
Element ID |
SB_PH1b |
pg |
Item ID |
posdrvz |
pg |
The CSV file looks like this in text format:
Element Type,Busbar,SummaryRes
Element ID,SB_PH1b,pg
Item ID,posdrvz,pg
The Result Selection structure is very simple, and is identical to that of the
MultiFault Module. In our example, we’re grabbing the Positive Sequence
Driving-Point Impedance for the SB_PH1b
busbar, and the Total Real Power
Generated from the overall summary results. Like with Study Parameter selection,
the first column is treated as a heading and therefore ignored by Multi-Loadflow.
See the Glossary for lists of element types and result item IDs.
Result Output CSV file¶
Using the example above for result selection, the following results will be outputted in the same structure.
Element Type |
Busbar |
SummaryRes |
---|---|---|
Element ID |
SB_PH1b |
pg |
Item ID |
posdrvz |
pg |
Study 1 |
1.699686289 |
2.077662945 |
Study 2 |
1.700982451 |
1.800819635 |
The CSV file will look like this in text format:
Element Type,Busbar,SummaryRes
Element ID,SB_PH1b,pg
Item ID,posdrvz,pg
Study 1,1.6996862888336182,2.077662944793701
Study 2,1.7009824514389038,1.8008196353912354
Loadflow studies don’t have names, so a default name of “Study X” is used. The structure is identical to result selection apart from the actual results are listed below the headings. Being in an easy-to-read CSV format split by rows makes it easy to parse the results using any programming language (preferably Python).
API¶
Module for running multiple loadflow studies easily using CSV definition files.
-
class
TEracsMultiLoadflow
¶ This is the main class for running multiple Loadflow studies. This class instantiates an object of type data manager and another of type results manager. This class is instantiated directly by importing this module. Commence the multiple Loadflow studies using RunStudies.
-
Silent
¶ If MultiLoadflow is silent, it will not output anything (no progress reports), but it will still generate result files. Also, if exceptions are raised and unhandled they will also output to the stderr pipe.
- Type
Boolean.
- Writable
True.
-
ConvergenceTolerance
¶ The convergence tolerance for Loadflow in the loaded network.
- Type
Float.
- Writable
True.
-
NumberOfIterations
¶ The number of iterations for Loadflow in the loaded network.
- Type
Integer.
- Writable
True.
-
OverloadThreshold
¶ The overload threshold (pu) for Loadflow in the loaded network.
- Type
Float.
- Writable
True.
-
PMultiplier
¶ The real power multiplier for Loadflow in the loaded network.
- Type
Float.
- Writable
True.
-
QMultiplier
¶ The reactive power multiplier for Loadflow in the loaded network.
- Type
Float.
- Writable
True.
-
TapSelector
¶ The tap changer selector for Loadflow in the loaded network.
- Type
Integer.
- Writable
True.
-
BusLowVoltLimit
¶ The busbar lower voltage limit for Loadflow in the loaded network.
- Type
Float.
- Writable
True.
-
BusHighVoltLimit
¶ The busbar upper voltage limit for Loadflow in the loaded network.
- Type
Float.
- Writable
True.
-
ResultsFilename
¶
-
RunStudies
(ADataFile, AParamListFile, AResultsListFile, AOutputFileDir=None)¶ Start the multiple Loadflow studies, passing in paths to data, study parameter, results and output files.
- Parameters
ADataFile (str) – The location of the ERACS data file containing the network which will be used in the studies.
AParamListFile (str) – The location of the CSV file containing Loadflow parameters for each study to be performed.
AResultsListFile (str) – The location of the CSV file containing all target results to output.
AOutputFileDir (str) – (Optional) The location of the output file which will contain all results. If empty, current working directory will be used.
-