edisgo.io.pypsa_io

This module provides tools to convert eDisGo representation of the network topology to PyPSA data model. Call to_pypsa() to retrieve the PyPSA network container.

Functions

to_pypsa(edisgo_object[, mode, timesteps])

Convert grid to PyPSA.Network representation.

set_seed(edisgo_obj, pypsa_network)

Set initial guess for the Newton-Raphson algorithm.

process_pfa_results(edisgo, pypsa, timesteps[, dtype])

Passing power flow results from PyPSA to Results.

Module Contents

edisgo.io.pypsa_io.to_pypsa(edisgo_object, mode=None, timesteps=None, **kwargs)

Convert grid to PyPSA.Network representation.

You can choose between translation of the MV and all underlying LV grids (mode=None (default)), the MV network only (mode=’mv’ or mode=’mvlv’) or a single LV network (mode=’lv’).

Parameters:

:param See other parameters in to_pypsa for more: :param information.:

Returns:

PyPSA.Network representation.

Return type:

PyPSA.Network

edisgo.io.pypsa_io.set_seed(edisgo_obj, pypsa_network)

Set initial guess for the Newton-Raphson algorithm.

In PyPSA an initial guess for the Newton-Raphson algorithm used in the power flow analysis can be provided to speed up calculations. For PQ buses, which besides the slack bus, is the only bus type in edisgo, voltage magnitude and angle need to be guessed. If the power flow was already conducted for the required time steps and buses, the voltage magnitude and angle results from previously conducted power flows stored in pfa_v_mag_pu_seed and pfa_v_ang_seed are used as the initial guess. Always the latest power flow calculation is used and only results from power flow analyses including the MV level are considered, as analysing single LV grids is currently not in the focus of edisgo and does not require as much speeding up, as analysing single LV grids is usually already quite quick. If for some buses or time steps no power flow results are available, default values are used. For the voltage magnitude the default value is 1 and for the voltage angle 0.

Parameters:
edisgo.io.pypsa_io.process_pfa_results(edisgo, pypsa, timesteps, dtype='float')

Passing power flow results from PyPSA to Results.

Parameters:

Notes

P and Q are returned from the line ending/transformer side with highest apparent power S, exemplary written as

S_{max} = max(\sqrt{P_0^2 + Q_0^2}, \sqrt{P_1^2 + Q_1^2}) \
P = P_0 P_1(S_{max}) \
Q = Q_0 Q_1(S_{max})

See also

Results, analysis