Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
gplessm committed Jul 5, 2018
2 parents 60f1fb1 + dbcea6e commit a4d27e5
Show file tree
Hide file tree
Showing 24 changed files with 1,712 additions and 397 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*.pyc
*.ttf
*.woff
*.png
*.css
*.pkl

Expand All @@ -29,4 +28,4 @@ eDisGo.egg-info/

# exclude check scripts
/edisgo/examples/compare_graphs.py
/edisgo/examples/compare_pypsa_network.py
/edisgo/examples/compare_pypsa_network.py
8 changes: 8 additions & 0 deletions doc/api/edisgo.data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ edisgo.data package
Submodules
----------

edisgo.data.export\_data module
-------------------------------

.. automodule:: edisgo.data.export_data
:members:
:undoc-members:
:show-inheritance:

edisgo.data.import\_data module
-------------------------------

Expand Down
6 changes: 1 addition & 5 deletions doc/api/edisgo.flex_opt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@ edisgo.flex\_opt.costs module
edisgo.flex\_opt.curtailment module
-----------------------------------


.. automodule:: edisgo.flex_opt.curtailment
:members:
:undoc-members:
:show-inheritance:


edisgo.flex\_opt.exceptions module
----------------------------------


.. automodule:: edisgo.flex_opt.exceptions
:members:
:undoc-members:
Expand Down Expand Up @@ -63,10 +60,9 @@ edisgo.flex\_opt.storage\_integration module
:undoc-members:
:show-inheritance:


edisgo.flex\_opt.storage\_operation module
------------------------------------------


.. automodule:: edisgo.flex_opt.storage_operation
:members:
:undoc-members:
Expand Down
10 changes: 10 additions & 0 deletions doc/api/edisgo.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
edisgo package
==============

Subpackages
-----------

.. toctree::

edisgo.data
edisgo.flex_opt
edisgo.grid
edisgo.tools

Module contents
---------------

Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@
# built documents.
#
# The short X.Y version.
version = '0.0.1'
version = '0.0.3'
# The full version, including alpha/beta/rc tags.
release = '0.0.1dev'
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
100 changes: 98 additions & 2 deletions doc/features_in_detail.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ Reinforce lines due to over-voltage
or until the maximum number of allowed iterations is reached.




Grid expansion costs
^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -129,6 +127,104 @@ The population density is calculated by the population and area of the grid dist
Costs for lines of aggregated loads and generators are not considered in the costs calculation since grids of
aggregated areas are not modeled but aggregated loads and generators are directly connected to the MV busbar.

Curtailment
-----------

Implementation
^^^^^^^^^^^^^^
The Curtailment methodology is conducted in :py:mod:`~edisgo.flex_opt.curtailment`.

The curtailment function is essentially used to spatially distribute the power required to be curtailed (henceforth
referred to as 'curtailed power') to the various generating units inside the grid. This provides a simple interface
to curtailing the power of generators of either a certain type (eg. solar or wind) or generators in a give weather
cell or both.

The current implementations of this are:

* `curtail_all`
* `curtail_voltage`

with other more complex and finer methodologies in development. The focus of these methods is to try and reduce the
requirement for network reinforcement by alleviating either node over-voltage or line loading issues or both. While
it is possible to curtail specific generators internally, a user friendly implementation is still in the works.

Concept
^^^^^^^

.. _curtailment-basic-label:

Basic curtailment
"""""""""""""""""""""""
In each of the curtailment methods, first the feedin of each of the individual fluctuating generators are
calculated based on the normalized feedin time series per technology and weather cell id from the OpenEnergy
database and the individual generators' nominal capacities.

.. math::
feedin = feedin_{\text{normalized per type or weather cell}} \times \\
nominal\_power_{\text{single generators}}
Once the feedin is calculated, both the feedin per generator and curtailed power are normalized and multiplied to get
the curtailed power per generator.

.. math::
curtailment =
\frac{feedin}{\sum feedin} \times total\_curtailment_{\text{normalized per type or weather cell}}
This curtailment is subtracted from the feedin of the generator to obtain the power output of the generator after
curtailment.
_{\text{single generators}}

Feedin factor
"""""""""""""
The case discussed in :ref:`curtailment-basic-label` is for equally curtailing all generators
of a given type or weather cell. To induce a bias in the curtailment of the generators based on a parameter
of our choosing like voltage or line loading, we use a feedin factor, which is essentially a scalar value which
is used to modify the feedin based on this parameter.

.. math::
modified\_feedin = feedin \times feedin\_factor
and the resulting curtailment is:

.. math::
curtailment = \frac{modified\_feedin}{\sum modified\_feedin} \times
total\_curtailment_{\text{normalized per type or weather cell}}
The way this influences the curtailment is that when the the feedin for a particular generator is increased by
multiplication, it results in a higher curtailment of power in this specific generator. Similarly the converse,
where when the feedin for a particular generator is reduced the curtailment for this specific generator is also
reduced. The modified feedin also allows the total curtailed power to remain the same even with the inclusion of
the biasing due to the feedin factor.

The feedin factor is only used as a weighing factor to increase or decrease the curtailment and this in no way
affects the base feedin of the generator.

Spatially biased curtailment methods
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Curtailment biased by node voltage
""""""""""""""""""""""""""""""""""

This is implemented in the methodology using the keyword argument :py:mod:`edisgo.flex_opt.curtailment.curtail_voltage`.
Here the feedin factor is used to bias the curtailment such that there more power is curtailed at nodes with higher
voltages and lesser power is curtailed at nodes with lower voltages. This essentially is a linear characteristic
between curtailed power and voltage, the higher the voltage, the higher the curtailed power. The characteristic is
as shown in :numref:`curtailment_voltage_characteristic_label`

A lower voltage threshold is defined, where no curtailment is assigned if the voltage at the node is lower than this
threshold voltage. The assigned curtailment to the other nodes is directly proportional to the difference of the
voltage at the node to the lower voltage threshold.


.. _curtailment_voltage_characteristic_label:
.. figure:: images/curtailment_voltage_characteristic.png

Per unit curtailment versus per unit node voltage characteristic used under the method
:py:mod:`edisgo.flex_opt.curtailment.curtail_voltage`




References
----------

Expand Down
Binary file added doc/images/curtailment_voltage_characteristic.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions doc/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,9 @@ If you want to provide eTraGo specifications:
# Determine cost for each line/transformer that was reinforced
costs = edisgo.network.results.grid_expansion_costs
Parallelization
---------------

Try :func:`~.edisgo.tools.edisgo_run.run_edisgo_pool_flexible` for
parallelization of your custom function.
4 changes: 2 additions & 2 deletions doc/start_page.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ The toolbox currently includes
* Data import from data sources of the open_eGo project
* Power flow analysis for grid issue identification (enabled by `PyPSA <https://pypsa.org>`_)
* Automatic grid reinforcement solving overloading and overvoltage issues
* Grid operation optimized curtailment

Features to be included

* Battery storage integration
* Grid operation optimized curtailment
* Cluster based analyses

See :ref:`quickstart` for the first steps. A deeper guide is provided in :ref:`usage-details`.
Expand All @@ -30,7 +30,7 @@ For those of you who want to contribute see :ref:`dev-notes` and the
LICENSE
-------

Copyright (C) 2017 Reiner Lemoine Institut gGmbH
Copyright (C) 2018 Reiner Lemoine Institut gGmbH

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Expand Down
46 changes: 37 additions & 9 deletions doc/usage_details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,22 @@ above you can do the following:
Curtailment
-----------

At the moment curtailment cannot be applied to single generators but only to all generators or
all generators of a given type and, if provided, weather cell ID equally.
Therefore, a curtailment time series as shown in the following examples needs to be provided.
The curtailment function is used to spatially distribute the power that is to be curtailed.
There are currently two options for doing this distribution:

* `curtail_all`
Distributes the curtailed power to all the fluctuating generators depending upon
their nominal capacity of the unit. The input to the curtailment function can be modified to
curtail certain technologies differently or even further through the weather cell id's.
* `curtail_voltage`
Distributes the curtailed power depending upon the voltage at the terminals
of the fluctuating generators

At the moment further methods for curtailment are being developed (eg. `curtail_loading`) and also
possibilities for the curtailment of single generators but these are still being developed.
Curtailment at the moment can be input as a pandas DataFrames with time series indexes and columns
either providing the type of generation to curtail, the weather cell id's for curtailment or both.
The curtailment time series as shown in the following examples needs to be provided.

.. code-block:: python
Expand All @@ -193,23 +206,38 @@ Therefore, a curtailment time series as shown in the following examples needs to
# curtailment time series for 'wind' is equally allocated to all wind generators, etc.
curtailment = pd.DataFrame(data={'wind': [0.0, 5.0, 3.0],
'solar': [5.0, 5.0, 3.0]},
index=timeindex)
'solar': [5.0, 5.0, 3.0]},
index=timeindex)
# curtailment time series for ('wind', 1) is equally allocated to all wind generators
# in weather cell 1, etc.
curtailment = pd.DataFrame(data={('wind', 1): [0.0, 5.0, 3.0],
('wind', 2): [1.0, 2.0, 3.0]
('solar', 1): [5.0, 5.0, 3.0]},
index=timeindex)
('wind', 2): [1.0, 2.0, 3.0],
('solar', 1): [5.0, 5.0, 3.0]},
index=timeindex)
Set curtailment by calling the method :meth:`~.grid.network.EDisGo.curtail()`:
Set curtailment by calling the method :meth:`~.grid.network.EDisGo.curtail()` with either the
`curtail_all` method:

.. code-block:: python
# curtail all
edisgo.curtail(curtailment_methodology='curtail_all',
timeseries_curtailment=curtailment)
or with `curtail_voltage` method:

.. code-block:: python
# curtailment based on voltage
edisgo.curtail(curtailment_methodology='curtail_voltage',
timeseries_curtailment=curtailment)
The `curtail_voltage` method also allows the changing of the lower voltage threshold,
the generator node voltage below which no curtailment will be assigned to the generator,
using the `voltage_threshold_lower` keyword argument. By default, this voltage is set to 1.0.

You can also define curtailment directly upon defining your scenario. Assuming
you have the load and feed-in time series as well as the curtailment defined
above you can do the following:
Expand Down
1 change: 1 addition & 0 deletions doc/whatsnew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Changelog for each release.
:local:
:backlinks: top

.. include:: whatsnew/v0-0-3.rst
.. include:: whatsnew/v0-0-2.rst
28 changes: 28 additions & 0 deletions doc/whatsnew/v0-0-3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Release v0.0.3
==============

Release date: July 6 2018

New features have been included in this release. Major changes being the use of the weather_cell_id and
the inclusion of new methods for distributing the curtailment to be more suitable to network operations.

Changes
-------

* As part of the solution to github issues `#86 <https://github.com/openego/eDisGo/issues/86>`_,
`#98 <https://github.com/openego/eDisGo/issues/98>`_, Weather cell information was of importance due to the changes
in the source of data. The table `ego_renewable_feedin_v031` is now used to provide this feedin time series indexed
using the weather cell id's. Changes were made to ego.io and ding0 to correspondingly allow the use of this table
by eDisGo.

* A new curtailment method have been included based on the voltages at the nodes with `GeneratorFluctuating` objects.
The method is called `curtail_voltage` and its objective is to increase curtailment at locations where voltages
are very high, thereby alleviating over-voltage issues and also reducing the need for network reinforcement.

* Add parallelization for custon functions
`#130 <https://github.com/openego/eDisGo/issues/130>`_

* Update `ding0 version to v0.1.6 <https://github.com/openego/ding0/releases/tag/v0.1.6>`_ and include
`data processing v.4.2 data <https://github.com/openego/data_processing/releases/tag/v0.4.2>`_

* Bug Fixes
6 changes: 3 additions & 3 deletions edisgo/config/config_db_tables_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ conv_generators_prefix = t_ego_supply_conv_powerplant_
conv_generators_suffix = _mview
re_generators_prefix = t_ego_supply_res_powerplant_
re_generators_suffix = _mview
res_feedin_data = EgoSimpleFeedinFull
res_feedin_data = EgoRenewableFeedin
load_data = EgoDemandHvmvDemand
load_areas = EgoDemandLoadarea

Expand All @@ -35,8 +35,8 @@ conv_generators_prefix = t_ego_dp_conv_powerplant_
conv_generators_suffix = _mview
re_generators_prefix = t_ego_dp_res_powerplant_
re_generators_suffix = _mview
res_feedin_data = EgoSimpleFeedinFull
res_feedin_data = EgoRenewableFeedin
load_data = EgoDemandHvmvDemand
load_areas = EgoDemandLoadarea

version = v0.3.0
version = v0.4.2

0 comments on commit a4d27e5

Please sign in to comment.