Components

eDisGo represents a distribution grid as a set of typed components. This page lists the component types and points to where each is described in detail.

Grid components

The physical grid elements are stored as pandas.DataFrames in the Topology container — one frame per type (see The data model for how to access them):

Component

Data (in edisgo.topology)

Component object

Bus

buses_df

Line

lines_df

Transformer (MV/LV)

transformers_df

Transformer (HV/MV)

transformers_hvmv_df

Switch

switches_df

Switch

Generator

generators_df

Generator

Load (incl. heat pumps and charging points)

loads_df

Load

Storage unit

storage_units_df

Storage

To add, remove or integrate components, see Adding and modifying components.

Switches

What they are. A switch is a disconnecting point in the grid — above all the point where a ring is left open. Medium-voltage grids are built as rings (for redundancy / n-1) but operated radially, open at one point; the switch marks that open point. eDisGo so far only models switch disconnectors. They are held in switches_df, which is defined for the MV grid and its underlying LV grids; in the ding0 grids eDisGo uses they are the MV ring disconnectors, sitting at MV/LV stations.

How they are represented. A switch is a branch (a line in lines_df) with two candidate end buses and a state:

  • open (normal operation) — the branch is attached to a dedicated virtual bus bus_open, so the ring is broken and the grid is radial;

  • closed — the branch is attached to bus_closed instead, closing the ring.

switches_df therefore records, per switch, the branch it controls and the two candidate buses; opening or closing a switch just rewires that branch’s bus in lines_df.

What they are used for. Switches are not decorative — several parts of eDisGo depend on them:

  • The operating point of every power flow. Because the state is baked into lines_df, analyze() and the optimisation run on the current (normally radial) configuration. Closing a switch makes the grid meshed and changes the result.

  • Ring detection. rings finds the grid’s rings by temporarily closing all switches and looking for cycles — so it knows which buses form which ring.

  • Grid reinforcement. When reinforce() fixes MV voltage problems by splitting a feeder (Grid reinforcement), the feeder can only be split at an LV station, because that is where a switch disconnector can be operated to run the line as two half-rings. LV stations thus decide where MV line reinforcement can act, and the resulting half-ring structure feeds the voltage-level cost allocation (Grid-expansion costs).

    Note

    The feeder is split at the LV station and connected directly back to the MV station busbar; a switch disconnector is not yet inserted at the new split point (TODO in reinforce_lines_voltage_issues()), so the half-rings created by reinforcement are not switchable in the model.

  • Plotting. The MV topology plots mark the switch disconnectors.

Working with switches. Each switch is a Switch object:

# all switches, and the switch disconnectors of the MV grid
edisgo.topology.switches_df
list(edisgo.topology.mv_grid.switch_disconnectors)   # Switch objects

sw = next(edisgo.topology.mv_grid.switch_disconnectors)
sw.state          # "open" or "closed"
sw.branch         # the line in lines_df that represents the switch
sw.bus_open, sw.bus_closed
sw.close()        # close the ring (rewires sw.branch in lines_df)
sw.open()         # re-open it

Switches are imported from the ding0 switches.csv file, carried over through spatial_complexity_reduction() (buses and branches are remapped; switches that become unused or duplicated by the aggregation are dropped/merged), and — being expressed as ordinary branches — carried into the PyPSA network by to_pypsa() without any special switch element (see Relationship to the PyPSA format).

Flexibility components

Some loads and storage units can act as flexibilities. Their additional data lives in dedicated containers; the modelling is described in Flexibility & optimisation:

Flexibility

Container

Methodology

Electric vehicles (charging points)

Electromobility

Electromobility

Heat pumps (+ thermal storage)

HeatPump

Heat pumps

Demand side management

DSM

Demand side management

Battery / home storage

topology.storage_units_df

Battery storage

Overlying-grid requirements

OverlyingGrid

Overlying-grid requirements

See also

The data model for the data structure and how to access component data, and Adding and modifying components for adding and modifying components.