pypowsybl.flowdecomposition.FlowDecomposition.run#
- FlowDecomposition.run(network, flow_decomposition_parameters=None, load_flow_parameters=None)[source]#
Runs a flow decomposition.
- Parameters:
network (Network) – Network on which the flow decomposition will be computed
flow_decomposition_parameters (Parameters | None) – Flow decomposition parameters
load_flow_parameters (Parameters | None) – Load flow parameters
- Returns:
A dataframe with decomposed flow for each relevant line
- Return type:
Notes
The resulting dataframe, depending on the number of countries, will include the following columns:
branch_id: the id of the branch
contingency_id: the id of the contingency
country1: the country id of terminal 1
country2: the country id of terminal 2
ac_reference_flow: the ac reference flow on the line (in MW)
dc_reference_flow: the dc reference flow on the line (in MW)
commercial_flow: the commercial (or allocated) flow on the line (in MW)
x_node_flow: the flow created by unmerged xnodes (in MW)
pst_flow: the PST flow on the line (in MW)
internal_flow: the internal flow on the line (in MW)
loop_flow_from_XX: the loop flow from zone XX on the line (in MW). One column per country
This dataframe is indexed on the xnec ID xnec_id.
Example
>>> network = pp.network.create_eurostag_tutorial_example1_network() >>> flow_decomposition_parameters = pp.flowdecomposition.Parameters() >>> load_flow_parameters = pp.loadflow.Parameters() >>> branch_ids = ['NHV1_NHV2_1', 'NHV1_NHV2_2'] >>> flowdecomposition = pp.flowdecomposition.create_decomposition() ... .add_single_element_contingencies(branch_ids) ... .add_monitored_elements(branch_ids, branch_ids) >>> flowdecomposition.run(network, flow_decomposition_parameters=flow_decomposition_parameters, load_flow_parameters=load_flow_parameters)
It outputs something like:
/
branch_id
contingency_id
country1
country2
ac_reference_flow
dc_reference_flow
commercial_flow
x_node_flow
pst_flow
internal_flow
loop_flow_from_be
loop_flow_from_fr
xnec_id
NHV1_NHV2_1
NHV1_NHV2_1
FR
BE
302.444049
300.0
0.0
0.0
0.0
0.0
300.0
0.0
NHV1_NHV2_1_NHV1_NHV2_2
NHV1_NHV2_1
NHV1_NHV2_2
FR
BE
610.562161
600.0
0.0
0.0
0.0
0.0
600.0
0.0
NHV1_NHV2_2
NHV1_NHV2_2
FR
BE
302.444049
300.0
0.0
0.0
0.0
0.0
300.0
0.0
NHV1_NHV2_2_NHV1_NHV2_1
NHV1_NHV2_2
NHV1_NHV2_1
FR
BE
610.562161
600.0
0.0
0.0
0.0
0.0
600.0
0.0