Skip to content

Commit

Permalink
Merge branch 'develop' of gitlab:pp/pandapower into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	pandapower/opf/make_objective.py
#	pandapower/test/opf/test_basic.py
  • Loading branch information
friederikemeier committed May 3, 2018
2 parents a339e13 + af5194d commit 9b50cdd
Show file tree
Hide file tree
Showing 34 changed files with 489 additions and 215 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.pyc
*~
build/
.pytest_cache/
dist/
.cache/
.idea
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Change Log
=============

[develop]
[1.5.0] - 2018-04-25
----------------------
- [FIXED] plotly hover function for edges (only if use_line_geodata == False)
- [FIXED] from_ppc trafo parameter calculation now also considers baseMVA != 100
Expand All @@ -10,6 +10,10 @@ Change Log
- [ADDED] pp_elements() toolbox function
- [ADDED] new parameter g_us_per_km to model dielectric losses in lines
- [ADDED] single phase short-circuit calculation with negative sequence models
- [ADDED] generic storage model (sgen/load like element with negative / positive power allowed)
- [ADDED] modelling of the complex (voltage magnitude and angle) tap changer for cross control
- [ADDED] modelling of the tap changer of a 3-winding transformer at star point or terminals
- [ADDED] losses of 3W transformers can be modeled at star point, HV, MV or LV side

[1.4.3] - 2018-02-06
----------------------
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include LICENSE AUTHORS README.rst requirements.txt CHANGELOG.rst
global-include *.p
global-include *.mat
global-include *.json

27 changes: 16 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pandapower
=============

.. image:: https://readthedocs.org/projects/pandapower/badge/?version=v1.4.3
:target: http://pandapower.readthedocs.io/en/v1.4.3
.. image:: https://readthedocs.org/projects/pandapower/badge/
:target: http://pandapower.readthedocs.io/
:alt: Documentation Status

.. image:: https://img.shields.io/pypi/v/pandapower.svg
Expand Down Expand Up @@ -79,16 +79,21 @@ There is a project to develop a GUI for pandapower: https://github.com/johaack/p
Citing pandapower
==================

We are currently working on publishing a paper about pandapower, which is available as a `preprint on arxiv <https://arxiv.org/abs/1709.06743>`_.
Until the paper has passed peer-review, please acknowledge the usage of pandapower in your paper as follows: ::
A paper describing pandapower has been accepted for publication in IEEE Transaction on Power Systems, a preprint of this paper is available on `arXiv <https://arxiv.org/abs/1709.06743>`_. Please acknowledge the usage of pandapower by citing the Paper as follows:

@online{pandapower,
author = {{Thurner}, L. and {Scheidler}, A. and {Sch{\"a}fer}, F. and {Menke}, J.-H. and {Dollichon}, J. and {Meier}, F. and {Meinecke}, S. and {Braun}, M.},
title = "{pandapower - an Open Source Python Tool for Convenient Modeling, Analysis and Optimization of Electric Power Systems}",
year = 2017,
url = {https://arxiv.org/abs/1709.06743},
note = {preprint}
}
- **L. Thurner, A. Scheidler, F. Schäfer et al**, `pandapower - an Open Source Python Tool for Convenient Modeling, Analysis and Optimization of Electric Power Systems <https://arxiv.org/abs/1709.06743>`_, IEEE Transactions on Power Systems, `DOI:10.1109/TPWRS.2018.2829021 <https://doi.org/10.1109/TPWRS.2018.2829021>`_, 2018.

You can use the following BibTex entry: ::

@ARTICLE{pandapower.2018,
author={L. Thurner and A. Scheidler and F. Schafer and J. H. Menke and J. Dollichon and F. Meier and S. Meinecke and M. Braun},
journal={IEEE Transactions on Power Systems},
title={pandapower - an Open Source Python Tool for Convenient Modeling, Analysis and Optimization of Electric Power Systems},
year={2018},
doi={10.1109/TPWRS.2018.2829021},
url={https://arxiv.org/abs/1709.06743},
ISSN={0885-8950}
}

Minimal Example
===============
Expand Down
2 changes: 1 addition & 1 deletion doc/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aimed at automation of analysis and optimization in power systems.
pandapower is a joint development of the research group Energy Management and Power System Operation, University of Kassel and the Department for Distribution System
Operation at the Fraunhofer Institute for Energy Economics and Energy System Technology (IEE), Kassel.

.. image:: /pics/iwes.png
.. image:: /pics/iee.png
:width: 18em
:align: left

Expand Down
25 changes: 15 additions & 10 deletions doc/about/citing.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
Citing pandapower
==================

We are currently working on publishing a paper about pandapower, which is available as a `preprint on arxiv <https://arxiv.org/abs/1709.06743>`_.
Until the paper has passed peer-review, please acknowledge the usage of pandapower in your paper as follows: ::

@online{pandapower,
author = {{Thurner}, L. and {Scheidler}, A. and {Sch{\"a}fer}, F. and {Menke}, J.-H. and {Dollichon}, J. and {Meier}, F. and {Meinecke}, S. and {Braun}, M.},
title = "{pandapower - an Open Source Python Tool for Convenient Modeling, Analysis and Optimization of Electric Power Systems}",
year = 2017,
url = {https://arxiv.org/abs/1709.06743},
note = {preprint}
}
A paper describing pandapower has been accepted for publication in IEEE Transaction on Power Systems, a preprint of this paper is available on `arXiv <https://arxiv.org/abs/1709.06743>`_. Please acknowledge the usage of pandapower by citing the Paper as follows:

- **L. Thurner, A. Scheidler, F. Schäfer et al**, `pandapower - an Open Source Python Tool for Convenient Modeling, Analysis and Optimization of Electric Power Systems <https://arxiv.org/abs/1709.06743>`_, IEEE Transactions on Power Systems, `DOI:10.1109/TPWRS.2018.2829021 <https://doi.org/10.1109/TPWRS.2018.2829021>`_, 2018.

You can use the following BibTex entry: ::

@ARTICLE{pandapower.2018,
author={L. Thurner and A. Scheidler and F. Schafer and J. H. Menke and J. Dollichon and F. Meier and S. Meinecke and M. Braun},
journal={IEEE Transactions on Power Systems},
title={pandapower - an Open Source Python Tool for Convenient Modeling, Analysis and Optimization of Electric Power Systems},
year={2018},
doi={10.1109/TPWRS.2018.2829021},
url={https://arxiv.org/abs/1709.06743},
ISSN={0885-8950}
}
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
# built documents.
#
# The short X.Y version.
version = "1.4"
version = "1.5"
# The full version, including alpha/beta/rc tags.
release = "1.4.3"
release = "1.5.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1 change: 1 addition & 0 deletions doc/elements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ information about the definition and interpretation of the parameters in the fol
elements/xward
elements/dcline
elements/measurement
elements/storage

Binary file added doc/elements/storage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/elements/storage.psd
Binary file not shown.
69 changes: 69 additions & 0 deletions doc/elements/storage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
==================
Storage
==================

.. seealso::
:ref:`Unit Systems and Conventions <conventions>`

Create Function
=====================

.. autofunction:: pandapower.create_storage

Input Parameters
=====================

*net.storage*

.. tabularcolumns:: |p{0.10\linewidth}|p{0.10\linewidth}|p{0.25\linewidth}|p{0.40\linewidth}|
.. csv-table::
:file: storage_par.csv
:delim: ;
:widths: 10, 10, 25, 40

.. |br| raw:: html

<br />

\*necessary for executing a power flow calculation |br| \*\*optimal power flow parameter


Electric Model
=================

Storages are modelled as PQ-buses in the power flow calculation:

.. image:: storage.png
:width: 8em
:alt: alternate Text
:align: center

The PQ-Values are calculated from the parameter table values as:

.. math::
:nowrap:
\begin{align*}
P_{storage} &= p\_kw \cdot scaling \\
Q_{storage} &= q\_kvar \cdot scaling \\
\end{align*}
.. note::

Since all power values are given in the consumer system, negative power models charging and positive activee power models discharging.

.. note::

The apparent power value sn_kva, state of charge soc and storage capacity max_e_kwh are provided as additional information for usage in controller or other applications based on panadapower. It is not considered in the power flow!

Result Parameters
==========================
*net.res_storage*

.. tabularcolumns:: |p{0.10\linewidth}|p{0.10\linewidth}|p{0.50\linewidth}|
.. csv-table::
:file: storage_res.csv
:delim: ;
:widths: 10, 10, 50

The power values in the net.res_storage table are equivalent to :math:`P_{storage}` and :math:`Q_{storage}`.
15 changes: 15 additions & 0 deletions doc/elements/storage_par.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**Parameter**;**Datatype**;**Value Range**;**Explanation**
name;string;;name of the storage unit
bus*;integer;;index of connected bus
p_kw*;float;:math:`\leq` 0;Momentary real power of the storage (positive for charging, negative for discharging)
q_kvar*;float;;Reactive power of the storage [kVar]
sn_kva;float;:math:`>` 0;Nominal power ot the storage [kVA]
scaling*;float;:math:`\geq` 0;scaling factor for the active and reactive power
max_e_kwh ;float;;The maximum energy content of the storage (maximum charge level)
min_e_kwh ;float;;The minimum energy content of the storage (minimum charge level)
max_p_kw**;float;;Maximum active power
min_p_kw**;float;;Minimum active power
max_q_kvar**;float;;Maximum reactive power
min_q_kvar**;float;;Minimum reactive power
controllable**;bool;;States if sgen is controllable or not, sgen will not be used as a flexibilty if it is not controllable
in_service*;boolean;True / False;specifies if the generator is in service.
3 changes: 3 additions & 0 deletions doc/elements/storage_res.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Parameter**;**Datatype**;**Explanation**
p_kw;float;resulting active power after scaling [kW]
q_kvar;float;resulting reactive power after scaling [kVar]
5 changes: 5 additions & 0 deletions doc/elements/trafo3w_par.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**Parameter**;**Datatype**;**Value Range**;**Explanation**
name;string;;name of the transformer
std_type;string;;transformer standard type name
hv_bus*;integer;;high voltage bus index of the transformer
mv_bus;integer;;medium voltage bus index of the transformer
lv_bus*;integer;;low voltage bus index of the transformer
Expand All @@ -17,10 +18,14 @@ vscr_mv_percent*;float;:math:`\geq` 0;real part of short circuit voltage from m
vscr_lv_percent*;float;:math:`\geq` 0;real part of short circuit voltage from high to low voltage [%]
pfe_kw*;float;:math:`\geq` 0;iron losses [kW]
i0_percent*;float;:math:`\geq` 0;open loop losses [%]
shift_mv_degree;float;;transformer phase shift angle at the MV side
shift_lv_degree;float;;transformer phase shift angle at the LV side
tp_side;string;"""hv"", ""mv"", ""lv""";defines if tap changer is positioned on high- medium- or low voltage side
tp_mid;integer;;
tp_min;integer;;minimum tap position
tp_max;integer;;maximum tap position
tp_st_percent;float;:math:`>` 0;tap step size [%]
tp_st_degree;float;;tap step size for voltage angle
tp_at_star_point;bool;;whether the tap changer is modelled at terminal or at star point
tp_pos;integer;;current position of tap changer
in_service*;boolean;True/False;specifies if the transformer is in service.
4 changes: 3 additions & 1 deletion doc/elements/trafo_par.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sn_kva*;float;:math:`>` 0;rated apparent power of the transformer [kVA]
vn_hv_kv*;float;:math:`>` 0;rated voltage at high voltage bus [kV]
vn_lv_kv*;float;:math:`>` 0;rated voltage at low voltage bus [kV]
vsc_percent*;float;:math:`>` 0;short circuit voltage [%]
vscr_percent*;float;:math:`\geq` 0;"real component of
vscr_percent*;float;:math:`\geq` 0;"real component of
short circuit voltage [%]"
pfe_kw*;float;:math:`\geq` 0;iron losses [kW]
i0_percent*;float;:math:`\geq` 0;open loop losses in [%]
Expand All @@ -19,6 +19,8 @@ tp_max;integer;;maximum tap position
tp_st_percent;float;:math:`>` 0;tap step size for voltage magnitude [%]
tp_st_degree;float;:math:`\geq` 0;tap step size for voltage angle
tp_pos;integer;;current position of tap changer
tp_phase_shifter;bool;;defines whether the transformer is an ideal phase shifter
parallel;int;:math:`>` 0;number of parallel transformers
max_loading_percent**;float;:math:`>` 0;Maximum loading of the transformer with respect to sn_kva and its corresponding current at 1.0 p.u.
df;float;1 :math:`\geq` df :math:`>`0;derating factor: maximal current of transformer in relation to nominal current of transformer (from 0 to 1)
in_service*;boolean;True / False;specifies if the transformer is in service.
14 changes: 7 additions & 7 deletions doc/getting_started/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ We now create the branch elements. First, we create the transformer from the typ
i0_percent=0.3375, pfe_kw=1.35,
name="Trafo")

Note that you do not have to calculate any impedances or tap ratio for the equivalent circuit, this is handled internally by pandapower according to the pandapower `transformer model <http://www.uni-kassel.de/eecs/fileadmin/datas/fb16/Fachgebiete/energiemanagement/Software/pandapower-doc/elements/trafo.html#electric-model>`_.
The transformer model and all other pandapower electric elements are `validated against commercial software <http://www.uni-kassel.de/eecs/fileadmin/datas/fb16/Fachgebiete/energiemanagement/Software/pandapower-doc/about/tests.html#model-and-loadflow-validation>`_.
Note that you do not have to calculate any impedances or tap ratio for the equivalent circuit, this is handled internally by pandapower according to the pandapower `transformer model <../elements/trafo.html#electric-model>`_.
The transformer model and all other pandapower electric elements are `validated against commercial software <../about/tests.html#model-and-loadflow-validation>`_.

The `standard type library <http://www.uni-kassel.de/eecs/fileadmin/datas/fb16/Fachgebiete/energiemanagement/Software/pandapower-doc/std_types.html>`_ allows even easier creation of the transformer.
The parameters given above are the parameters of the transformer "0.4 MVA 20/0.4 kV" from the pandapower `basic standard types <http://www.uni-kassel.de/eecs/fileadmin/datas/fb16/Fachgebiete/energiemanagement/Software/pandapower-doc/std_types/basic.html>`_. The transformer can be created from the standard type library like this: ::
The `standard type library <../std_types.html>`_ allows even easier creation of the transformer.
The parameters given above are the parameters of the transformer "0.4 MVA 20/0.4 kV" from the pandapower `basic standard types <../std_types/basic.html>`_. The transformer can be created from the standard type library like this: ::

tid = pp.create_transformer(net, hv_bus=b1, lv_bus=b2, std_type="0.4 MVA 20/0.4 kV",
name="Trafo")
Expand All @@ -70,11 +70,11 @@ the pandapower representation now looks like this:
:align: center

This is the version where transformer and line have been created through the standard type libraries, which is why the line has a specified type (cs for cable system) and the transformer has a tap changer, both of
which are defined in the `type data <http://www.uni-kassel.de/eecs/fileadmin/datas/fb16/Fachgebiete/energiemanagement/Software/pandapower-doc/std_types/basic.html>`_.
which are defined in the `type data <../std_types/basic.html>`_.

**Running a Power Flow**

A powerflow can be carried out with the `runpp function <http://www.uni-kassel.de/eecs/fileadmin/datas/fb16/Fachgebiete/energiemanagement/Software/pandapower-doc/powerflow/ac.html>`_: ::
A powerflow can be carried out with the `runpp function <../powerflow/ac.html>`_: ::
pp.runpp(net)
Expand All @@ -95,5 +95,5 @@ For the 3-bus example network, the result tables look like this:

You can download the python script that creates this 3-bus system :download:`here <pandapower_3bus_system.py>`.

For a more in depth introduction into pandapower modeling and analysis functionality, see the `pandapower tutorials <http://www.uni-kassel.de/eecs/fileadmin/datas/fb16/Fachgebiete/energiemanagement/Software/pandapower-doc/getting_started/tutorials.html>`_
For a more in depth introduction into pandapower modeling and analysis functionality, see the `pandapower tutorials <../getting_started/tutorials.html>`_
about network creation, standard type libraries, power flow, topological searches, plotting and more.
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aimed at automation of analysis and optimization in power systems.
pandapower is a joint development of the research group Energy Management and Power System Operation, University of Kassel and the Department for Distribution System
Operation at the Fraunhofer Institute for Energy Economics and Energy System Technology (IEE), Kassel.

.. image:: /pics/iwes.png
.. image:: /pics/iee.png
:width: 18em
:align: left

Expand Down
Binary file added doc/pics/iee.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/pics/iwes.png
Binary file not shown.
2 changes: 1 addition & 1 deletion pandapower/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.4.3"
__version__ = "1.5.0"

from pandapower.auxiliary import *
from pandapower.create import *
Expand Down
9 changes: 5 additions & 4 deletions pandapower/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def _select_is_elements_numba(net, isolated_nodes=None):

def _add_ppc_options(net, calculate_voltage_angles, trafo_model, check_connectivity, mode,
copy_constraints_to_ppc, r_switch, init, enforce_q_lims, recycle, delta=1e-10,
voltage_depend_loads=False):
voltage_depend_loads=False, trafo3w_losses="hv"):
"""
creates dictionary for pf, opf and short circuit calculations from input parameters.
"""
Expand All @@ -386,7 +386,8 @@ def _add_ppc_options(net, calculate_voltage_angles, trafo_model, check_connectiv
"enforce_q_lims": enforce_q_lims,
"recycle": recycle,
"voltage_depend_loads": voltage_depend_loads,
"delta": delta
"delta": delta,
"trafo3w_losses": trafo3w_losses
}
_add_options(net, options)

Expand Down Expand Up @@ -514,8 +515,8 @@ def _set_isolated_buses_out_of_service(net, ppc):
ppc["branch"][ppc["branch"][:, 10] == 1, :2].real.astype(int).flatten())

# but also check if they may be the only connection to an ext_grid
disco = np.setdiff1d(disco, ppc['bus'][ppc['bus'][:, 1] == 3, :1].real.astype(int))
ppc["bus"][disco, 1] = 4.
net._isolated_buses = np.setdiff1d(disco, ppc['bus'][ppc['bus'][:, 1] == 3, :1].real.astype(int))
ppc["bus"][net._isolated_buses, 1] = 4.


def _write_lookup_to_net(net, element, element_lookup):
Expand Down
Loading

0 comments on commit 9b50cdd

Please sign in to comment.