Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/e2nIEE/pandapower into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
SteffenMeinecke committed Aug 10, 2021
2 parents c540819 + 5303caf commit e2375bb
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 58 deletions.
2 changes: 1 addition & 1 deletion doc/about/units.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The power equation in the balanced three phase system is therefore given as :mat
**Three Phase System (Unbalanced Load Flow)**

For unbalanced three phase systems, the following conventions apply:
- voltage values are entered as phase-to-phase voltages
- voltage values are entered as phase-to-phase voltages
- current values are entered as phase currents
- But, Phase power values can be entered seperately in the new element **asymmetric_load**

Expand Down
3 changes: 2 additions & 1 deletion doc/control/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The basic controller is the base controller class that should be subclassed when
ConstControl
==============
.. _ConstControl:

This controller is made for the use with the time series module to read data from a DataSource and write it to the net.
The controller can write the values either to a column of an element table (e.g. net.load.p_mw) or an attribute of another object that is
stored in an element table (e.g. another controller, net.controller.object). To change a controller attribute, the variable must be defined
Expand Down Expand Up @@ -49,7 +50,7 @@ Discrete Tap Control
:members:

CharacteristicControl
===============
=====================

The following controllers that use characteristics are predefined within the pandapower control module.

Expand Down
1 change: 1 addition & 0 deletions doc/elements/asymmetric_load.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Loads are modelled as PQ-buses in the power flow calculation.
:width: 40em
:alt: alternate Text
:align: center

*Delta Load*

.. image:: asym_del_load.png
Expand Down
1 change: 0 additions & 1 deletion doc/networks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ You can find documentation for the individual network modules of pandapower here
.. toctree::
:maxdepth: 2

networks/simbench
networks/example
networks/test
networks/cigre
Expand Down
4 changes: 2 additions & 2 deletions doc/powerflow/run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ pandapower provides AC (Balanced/Unbalanced) and linearized (DC) powerflow.
.. toctree::
:maxdepth: 3

ac_3ph
ac
dc
dc
ac_3ph
4 changes: 2 additions & 2 deletions doc/timeseries/data_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Data Sources
#############################

DataSource Base Class
=================
=====================
A ``DataSource`` object must be given to :ref:`const controllers <ConstControl>` in order to run time series simulations.
The data source contains the values to be set in each time step by the controller. It has the function
:code:`get_time_step_value(time_step)` which reads these values.
Expand All @@ -12,7 +12,7 @@ The data source contains the values to be set in each time step by the controlle
:members:

DataFrame Data Source
=================
=====================
A ``DFData`` object is inherited from ``DataSource`` and contains a DataFrame which stores the time series values.

.. autoclass:: pandapower.timeseries.data_sources.frame_data.DFData
Expand Down
2 changes: 1 addition & 1 deletion doc/toolbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Result Information

.. autofunction:: pandapower.nets_equal

.. autofunction:: pandapower.clear_result_table
.. autofunction:: pandapower.clear_result_tables

====================================
Simulation Setup and Preparation
Expand Down
4 changes: 2 additions & 2 deletions pandapower/control/controller/const_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class ConstControl(Controller):
dropped
.. note:: If multiple elements are represented with one controller, the data source must have
integer columns. At the moment, only the DFData format is tested for the multiple const
control.
integer columns. At the moment, only the DFData format is tested for the multiple const
control.
"""

def __init__(self, net, element, variable, element_index, profile_name=None, data_source=None,
Expand Down
17 changes: 10 additions & 7 deletions pandapower/control/run_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,20 @@ def run_control(net, ctrl_variables=None, max_iter=30, **kwargs):
Function is running control loops for the controllers specified in net.controller
INPUT:
**net** - pandapower network with controllers included in net.controller
**net** - pandapower network with controllers included in net.controller
OPTIONAL:
**ctrl_variables** (dict, None) - variables needed internally to calculate the power flow. See prepare_run_ctrl()
**max_iter** (int, 30) - The maximum number of iterations for controller to converge
**ctrl_variables** (dict, None) - variables needed internally to calculate the power flow. See prepare_run_ctrl()
**max_iter** (int, 30) - The maximum number of iterations for controller to converge
KWARGS:
**continue_on_divergence** (bool, False) - if run_funct is not converging control_repair is fired
(only relevant if ctrl_varibales is None, otherwise it needs
**continue_on_divergence** (bool, False) - if run_funct is not converging control_repair is fired \
(only relevant if ctrl_varibales is None, otherwise it needs \
to be defined in ctrl_variables anyway)
**check_each_level** (bool, True) - if each level shall be checked if the controllers are converged or not
(only relevant if ctrl_varibales is None, otherwise it needs
**check_each_level** (bool, True) - if each level shall be checked if the controllers are converged or not \
(only relevant if ctrl_varibales is None, otherwise it needs \
to be defined in ctrl_variables anyway)
Runs controller until each one converged or max_iter is hit.
Expand All @@ -272,6 +274,7 @@ def run_control(net, ctrl_variables=None, max_iter=30, **kwargs):
2. Calculate an inital power flow (if it is enabled, i.e. setting the initial_run veriable to True)
3. Repeats the following steps in ascending order of controller_order until total convergence of all
controllers for each level:
a) Evaluate individual convergence for all controllers in the level
b) Call control_step() for all controllers in the level on diverged controllers
c) Calculate power flow (or optionally another function like runopf or whatever you defined)
Expand Down
22 changes: 10 additions & 12 deletions pandapower/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,7 @@ def create_load(net, bus, p_mw, q_mvar=0, const_z_percent=0, const_i_percent=0,
controllable loads in OPF
**controllable** (boolean, default NaN) - States, whether a load is controllable or not. \
Only respected for OPF
Defaults to False if "controllable" column exists in DataFrame
Only respected for OPF; defaults to False if "controllable" column exists in DataFrame
OUTPUT:
**index** (int) - The unique ID of the created element
Expand Down Expand Up @@ -947,7 +946,8 @@ def create_load_from_cosphi(net, bus, sn_mva, cos_phi, mode, **kwargs):
**mode** (str) - "underexcited" (Q absorption, decreases voltage) or "overexcited" (Q injection, increases voltage)
**kwargs are passed on to the create_load function
OPTIONAL:
same as in create_load, keyword arguments are passed to the create_load function
OUTPUT:
**index** (int) - The unique ID of the created load
Expand Down Expand Up @@ -985,7 +985,6 @@ def create_sgen(net, bus, p_mw, q_mvar=0, sn_mva=nan, name=None, index=None,
**p_mw** (float) - The active power of the static generator (positive for generation!)
OPTIONAL:
**q_mvar** (float, 0) - The reactive power of the sgen
**sn_mva** (float, None) - Nominal power of the sgen
Expand Down Expand Up @@ -1013,9 +1012,8 @@ def create_sgen(net, bus, p_mw, q_mvar=0, sn_mva=nan, name=None, index=None,
**min_q_mvar** (float, NaN) - Minimum reactive power injection - necessary for \
controllable sgens in OPF
**controllable** (bool, NaN) - Whether this generator is controllable by the optimal
powerflow
Defaults to False if "controllable" column exists in DataFrame
**controllable** (bool, NaN) - Whether this generator is controllable by the optimal \
powerflow; defaults to False if "controllable" column exists in DataFrame
**k** (float, NaN) - Ratio of nominal current to short circuit current
Expand Down Expand Up @@ -1306,9 +1304,8 @@ def create_storage(net, bus, p_mw, max_e_mwh, q_mvar=0, sn_mva=nan, soc_percent=
**min_q_mvar** (float, NaN) - Minimum reactive power injection - necessary for a \
controllable storage in OPF
**controllable** (bool, NaN) - Whether this storage is controllable by the optimal
powerflow
Defaults to False if "controllable" column exists in DataFrame
**controllable** (bool, NaN) - Whether this storage is controllable by the optimal \
powerflow; defaults to False if "controllable" column exists in DataFrame
OUTPUT:
**index** (int) - The unique ID of the created storage
Expand Down Expand Up @@ -3147,7 +3144,8 @@ def create_shunt_as_capacitor(net, bus, q_mvar, loss_factor, **kwargs):
**loss_factor** (float) - loss factor tan(delta) of the capacitor bank
**kwargs are passed to the create_shunt function
OPTIONAL:
same as in create_shunt, keyword arguments are passed to the create_shunt function
OUTPUT:
Expand Down Expand Up @@ -3347,7 +3345,7 @@ def create_dcline(net, from_bus, to_bus, p_mw, loss_percent, loss_mw, vm_from_pu
**max_q_from_mvar** - Maximum reactive power at from bus. Necessary for OPF
**max_q_to_mvar ** - Maximum reactive power at to bus. Necessary for OPF
**max_q_to_mvar** - Maximum reactive power at to bus. Necessary for OPF
OUTPUT:
**index** (int) - The unique ID of the created element
Expand Down
61 changes: 33 additions & 28 deletions pandapower/estimation/state_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,46 @@ def estimate(net, algorithm='wls',
**opt_vars):
"""
Wrapper function for WLS state estimation.
INPUT:
**net** - The net within this line should be created
**net** (pandapowerNet) - The net within this line should be created
**init** (string) - Initial voltage for the estimation. 'flat' sets 1.0 p.u. / 0° for all \
buses, 'results' uses the values from *res_bus* if available and 'slack' considers the \
slack bus voltage (and optionally, angle) as the initial values. Default is 'flat'
**init** - (string) Initial voltage for the estimation. 'flat' sets 1.0 p.u. / 0° for all
buses, 'results' uses the values from *res_bus* if available and 'slack' considers the
slack bus voltage (and optionally, angle) as the initial values. Default is 'flat'
OPTIONAL:
**tolerance** - (float) - When the maximum state change between iterations is less than
tolerance, the process stops. Default is 1e-6
**tolerance** (float) - When the maximum state change between iterations is less than \
tolerance, the process stops. Default is 1e-6
**maximum_iterations** - (integer) - Maximum number of iterations. Default is 10
**maximum_iterations** (integer) - Maximum number of iterations. Default is 10
**calculate_voltage_angles** - (boolean) - Take into account absolute voltage angles and phase
shifts in transformers, if init is 'slack'. Default is True
**calculate_voltage_angles** (boolean) - Take into account absolute voltage angles and phase \
shifts in transformers, if init is 'slack'. Default is True
**zero_injection** - (str, iterable, None) - Defines which buses are zero injection bus or the method
to identify zero injection bus, with 'wls_estimator' virtual measurements will be added, with
'wls_estimator with zero constraints' the buses will be handled as constraints
"auto": all bus without p,q measurement, without p, q value (load, sgen...) and aux buses will be
identified as zero injection bus
"aux_bus": only aux bus will be identified as zero injection bus
None: no bus will be identified as zero injection bus
iterable: the iterable should contain index of the zero injection bus and also aux bus will be identified
as zero-injection bus
**zero_injection** (str, iterable, None) - Defines which buses are zero injection bus or the method \
to identify zero injection bus, with 'wls_estimator' virtual measurements will be added, with \
'wls_estimator with zero constraints' the buses will be handled as constraints
- "auto": all bus without p,q measurement, without p, q value (load, sgen...) and aux buses will be \
identified as zero injection bus
- "aux_bus": only aux bus will be identified as zero injection bus
- None: no bus will be identified as zero injection bus
- iterable: the iterable should contain index of the zero injection bus and also aux bus will be identified \
as zero-injection bus
**fuse_buses_with_bb_switch** (str, iterable, None) - Defines how buses with closed bb switches should \
be handled, if fuse buses will only fused to one for calculation, if not fuse, an auxiliary bus and \
auxiliary line will be automatically added to the network to make the buses with different p,q injection \
measurements identifieble
- "all": all buses with bb-switches will be fused, the same as the default behaviour in load flow
- None: buses with bb-switches and individual p,q measurements will be reconfigurated \
by auxiliary elements
- iterable: the iterable should contain the index of buses to be fused, the behaviour is contigous e.g. \
if one of the bus among the buses connected through bb switch is given, then all of them will still \
be fused
**fuse_buses_with_bb_switch** - (str, iterable, None) - Defines how buses with closed bb switches should
be handled, if fuse buses will only fused to one for calculation, if not fuse, an auxiliary bus and
auxiliary line will be automatically added to the network to make the buses with different p,q injection
measurements identifieble
"all": all buses with bb-switches will be fused, the same as the default behaviour in load flow
None: buses with bb-switches and individual p,q measurements will be reconfigurated
by auxiliary elements
iterable: the iterable should contain the index of buses to be fused, the behaviour is contigous e.g.
if one of the bus among the buses connected through bb switch is given, then all of them will still
be fused
OUTPUT:
**successful** (boolean) - Was the state estimation successful?
"""
Expand Down
3 changes: 3 additions & 0 deletions pandapower/opf/run_powermodels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function run_powermodels(json_path)
setting = Dict("output" => Dict("branch_flows" => true)))
end

result["termination_status"] = string(result["termination_status"])
result["dual_status"] = string(result["dual_status"])
result["primal_status"] = string(result["primal_status"])

return result
end
Expand Down
2 changes: 1 addition & 1 deletion pandapower/timeseries/output_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class OutputWriter(JSONSerializableClass):
**output_path** (string, None) - Path to a folder where the output is written to.
**output_file_type** (string, ".p") - output filetype to use.
Allowed file extensions: [*.xls, *.xlsx, *.csv, *.p, *.json]
Allowed file extensions: [.xls, .xlsx, .csv, .p, .json]
Note: XLS has a maximum number of 256 rows.
**csv_separator** (string, ";") - The separator used when writing to a csv file
Expand Down

0 comments on commit e2375bb

Please sign in to comment.