ding0.flexopt package¶
Submodules¶
ding0.flexopt.check_tech_constraints module¶
-
ding0.flexopt.check_tech_constraints.
check_load
(grid, mode)[source]¶ Checks for over-loading of branches and transformers for MV or LV grid.
Parameters: - grid (
GridDing0
) – Grid identifier. - mode (
str
) – Kind of grid (‘MV’ or ‘LV’).
Returns: dict
– Dict of critical branches with max. relative overloading, and the following format:{ branch_1: rel_overloading_1, ..., branch_n: rel_overloading_n }
list
ofTransformerDing0
objects –List of critical transformers with the following format:
[trafo_1, ..., trafo_m]
Note
Lines’/cables’ max. capacity (load case and feed-in case) are taken from [1].
References
[1] dena VNS - grid (
-
ding0.flexopt.check_tech_constraints.
check_voltage
(grid, mode)[source]¶ Checks for voltage stability issues at all nodes for MV or LV grid
Parameters: - grid (
GridDing0
) – Grid identifier. - mode (
str
) – Kind of grid (‘MV’ or ‘LV’).
Returns: list
of Ding0 node object (member of graph) either –GeneratorDing0
orGeneratorFluctuatingDing0
orLoadDing0
orStationDing0
orCircuitBreakerDing0
orCableDistributorDing0
List of critical nodes, sorted descending by voltage difference.
Note
The examination is done in two steps, according to [2] :
- It is checked #TODO: what?
- #TODO: what’s next?
References
[2] dena VNS - grid (
-
ding0.flexopt.check_tech_constraints.
get_critical_line_loading
(grid)[source]¶ Assign line loading to each branch determined by peak load and peak generation of descendant branches
The attribute s_res is a list of two elements 1. apparent power in load case 2. apparent power in feed-in case
Parameters: grid ( LVGridDing0
) – Ding0 LV grid objectReturns:
-
ding0.flexopt.check_tech_constraints.
get_critical_voltage_at_nodes
(grid)[source]¶ Estimate voltage drop/increase induced by loads/generators connected to the grid.
Based on voltage level at each node of the grid critical nodes in terms of exceed tolerable voltage drop/increase are determined. The tolerable voltage drop/increase is defined by [3] a adds up to 3 % of nominal voltage. The longitudinal voltage drop at each line segment is estimated by a simplified approach (neglecting the transverse voltage drop) described in [3].
Two equations are available for assessing voltage drop/ voltage increase.
The first is used to assess a voltage drop in the load case
The second equation can be used to assess the voltage increase in case of feedin. The only difference is the negative sign before X. This is related to consider a voltage drop due to inductive operation of generators.
Symbol Description Voltage drop/increase at node Apparent power Short-circuit resistance Short-circuit reactance Power factor Nominal voltage Parameters: grid ( LVGridDing0
) – Ding0 LV grid objectNote
The implementation highly depends on topology of LV grid. This must not change its topology from radial grid with stubs branching from radial branches. In general, the approach of [3] is only applicable to grids of radial topology.
We consider the transverse voltage drop/increase by applying the same methodology successively on results of main branch. The voltage drop/increase at each house connection branch (aka. stub branch or grid connection point) is estimated by superposition based on voltage level in the main branch cable distributor.
References
[3] (1, 2, 3) VDE Anwenderrichtlinie: Erzeugungsanlagen am Niederspannungsnetz – Technische Mindestanforderungen für Anschluss und Parallelbetrieb von Erzeugungsanlagen am Niederspannungsnetz, 2011
-
ding0.flexopt.check_tech_constraints.
get_cumulated_conn_gen_load
(graph, node)[source]¶ Get generation capacity/ peak load of all descending nodes
Parameters: - graph (NetworkX Graph Obj) – Directed graph
- node (graph node) – Node of the main branch of LV grid
Returns: list
– A list containing two items# cumulated peak load of connected loads at descending nodes of node # cumulated generation capacity of connected generators at descending nodes of node
-
ding0.flexopt.check_tech_constraints.
get_delta_voltage_preceding_line
(grid, tree, node)[source]¶ Parameters: - grid (
LVGridDing0
) – Ding0 grid object - tree (NetworkX Graph Obj) – Tree of grid topology
- node (graph node) – Node at end of line
Returns: float
– Voltage drop over preceding line of node- grid (
-
ding0.flexopt.check_tech_constraints.
get_mv_impedance_at_voltage_level
(grid, voltage_level)[source]¶ Determine MV grid impedance (resistance and reactance separately)
Parameters: - grid (
LVGridDing0
) – - voltage_level (float) – voltage level to which impedance is rescaled (normally 0.4 kV for LV)
Returns: list
– List containing resistance and reactance of MV grid- grid (
-
ding0.flexopt.check_tech_constraints.
get_voltage_at_bus_bar
(grid, tree)[source]¶ Determine voltage level at bus bar of MV-LV substation
Parameters: - grid (
LVGridDing0
) – Ding0 grid object - tree (NetworkX Graph Obj) – Tree of grid topology:
Returns: list
– Voltage at bus bar. First item refers to load case, second item refers to voltage in feedin (generation) case- grid (
-
ding0.flexopt.check_tech_constraints.
get_voltage_delta_branch
(tree, node, r, x)[source]¶ Determine voltage for a branch with impedance r + jx
Parameters: - tree (NetworkX Graph Obj) – Tree of grid topology
- node (graph node) – Node to determine voltage level at
- r (float) – Resistance of preceeding branch
- x (float) – Reactance of preceeding branch
Returns: float
– Delta voltage for branch
-
ding0.flexopt.check_tech_constraints.
peak_load_generation_at_node
(nodes)[source]¶ Get maximum occuring load and generation at a certain node
Summarizes peak loads and nominal generation power of descendant nodes of a branch
Parameters: nodes ( list
) – Any LV grid Ding0 node object that is part of the grid topologyReturns:
-
ding0.flexopt.check_tech_constraints.
voltage_delta_vde
(v_nom, s_max, r, x, cos_phi)[source]¶ Estimate voltrage drop/increase
The VDE [4] proposes a simplified method to estimate voltage drop or increase in radial grids.
Parameters: - v_nom (
int
) – Nominal voltage - s_max (
float
) – Apparent power - r (
float
) – Short-circuit resistance from node to HV/MV substation (in ohm) - x (
float
) – Short-circuit reactance from node to HV/MV substation (in ohm). Must be a signed number indicating (+) inductive reactive consumer (load case) or (-) inductive reactive supplier (generation case) - cos_phi (
float
) – The cosine phi of the connected generator or load that induces the voltage change
Returns: float
– Voltage drop or increaseReferences
[4] VDE Anwenderrichtlinie: Erzeugungsanlagen am Niederspannungsnetz – Technische Mindestanforderungen für Anschluss und Parallelbetrieb von Erzeugungsanlagen am Niederspannungsnetz, 2011 - v_nom (
ding0.flexopt.reinforce_grid module¶
-
ding0.flexopt.reinforce_grid.
reinforce_grid
(grid, mode)[source]¶ Evaluates grid reinforcement needs and performs measures
Grid reinforcement according to methods described in [VNSRP] supplemented by [DENA].
Parameters: - grid (
GridDing0
) – Grid instance - mode (
str
) – Choose of: ‘MV’ or ‘LV’
Note
Currently only MV branch reinforcement is implemented. HV-MV stations are not reinforced since not required for status-quo scenario.
References
[DENA] Deutsche Energie-Agentur GmbH (dena), “dena-Verteilnetzstudie. Ausbau- und Innovationsbedarf der Stromverteilnetze in Deutschland bis 2030.”, 2012 [VNSRP] Ackermann, T., Untsch, S., Koch, M., & Rothfuchs, H. (2014). Verteilnetzstudie Rheinland-Pfalz. Hg. v. Ministerium für Wirtschaft, Klimaschutz, Energie und Landesplanung Rheinland-Pfalz (MWKEL). energynautics GmbH. - grid (
ding0.flexopt.reinforce_measures module¶
-
ding0.flexopt.reinforce_measures.
extend_substation
(grid, critical_stations, grid_level)[source]¶ Reinforce MV or LV substation by exchanging the existing trafo and installing a parallel one if necessary.
First, all available transformers in a critical_stations are extended to maximum power. If this does not solve all present issues, additional transformers are build.
Parameters: Note
Curently straight forward implemented for LV stations
Returns: type – #TODO: Description of return. Change type in the previous line accordingly
-
ding0.flexopt.reinforce_measures.
extend_substation_voltage
(crit_stations, grid_level='LV')[source]¶ Extend substation if voltage issues at the substation occur
Follows a two-step procedure:
- Existing transformers are extended by replacement with large nominal apparent power
- New additional transformers added to substation (see ‘Note’)
Parameters: Note
At maximum 2 new of largest (currently 630 kVA) transformer are additionally built to resolve voltage issues at MV-LV substation bus bar.
-
ding0.flexopt.reinforce_measures.
extend_trafo_power
(extendable_trafos, trafo_params)[source]¶ Extend power of first trafo in list of extendable trafos
Parameters: - extendable_trafos (
list
) – Trafos with rated power below maximum size available trafo - trafo_params (pandas.DataFrame) – Transformer parameters
- extendable_trafos (
-
ding0.flexopt.reinforce_measures.
new_substation
(grid)[source]¶ Reinforce MV grid by installing a new primary substation opposite to the existing one
Parameters: grid ( MVGridDing0
) – MV Grid identifier.
-
ding0.flexopt.reinforce_measures.
reinforce_branches_current
(grid, crit_branches)[source]¶ Reinforce MV or LV grid by installing a new branch/line type
Parameters: - grid (
GridDing0
) – Grid identifier. - crit_branches (dict) – Dict of critical branches with max. relative overloading.
Note
The branch type to be installed is determined per branch using the rel. overloading. According to [5] only cables are installed.
References
[5] Ackermann et al. (RP VNS) - grid (
-
ding0.flexopt.reinforce_measures.
reinforce_branches_voltage
(grid, crit_branches, grid_level='MV')[source]¶ Reinforce MV or LV grid by installing a new branch/line type
Parameters: Note
The branch type to be installed is determined per branch - the next larger cable available is used. According to Ackermann only cables are installed.
-
ding0.flexopt.reinforce_measures.
reinforce_lv_branches_overloading
(grid, crit_branches)[source]¶ Choose appropriate cable type for branches with line overloading
Parameters: - grid (
LVGridDing0
) – Ding0 LV grid object - crit_branches (
list
) – List of critical branches incl. its line loading
Note
If maximum size cable is not capable to resolve issue due to line overloading largest available cable type is assigned to branch.
Returns: list
– unsolved_branches : List of braches no suitable cable could be found- grid (
ding0.flexopt.reinforce_measures_dena module¶
-
ding0.flexopt.reinforce_measures_dena.
extend_substation
(grid)[source]¶ Reinforce MV or LV substation by exchanging the existing trafo and installing a parallel one if necessary with according to dena
Parameters: grid ( GridDing0
) – Grid identifier.Returns: type – #TODO: Description of return. Change type in the previous line accordingly
-
ding0.flexopt.reinforce_measures_dena.
new_substation
(grid)[source]¶ Reinforce MV grid by installing a new primary substation opposite to the existing one according to dena
Parameters: grid ( MVGridDing0
) – Grid identifier.Returns: type – #TODO: Description of return. Change type in the previous line accordingly
-
ding0.flexopt.reinforce_measures_dena.
parallel_branch
(grid, node_target)[source]¶ Reinforce MV or LV grid by installing a new parallel branch according to dena
Parameters: - grid (
GridDing0
) – Grid identifier. - node_target (
int
) – node where the parallel cable (starting from HV/MV substation) is connected to (used when grid is a MV grid)
Returns: type – #TODO: Description of return. Change type in the previous line accordingly
- grid (