10
PyPSA: Python for Power System Analysis Tom Brown, Jonas H¨ orsch, David Schlachtberger Frankfurt Institute for Advanced Studies, Ruth-Moufang-Straße 1, 60438 Frankfurt am Main, Germany Email: brown@fias.uni-frankfurt.de AbstractPython for Power System Analysis (PyPSA) is a free software toolbox for simulating and optimising modern electrical power systems over multiple periods. PyPSA includes models for con- ventional generators with unit commitment, variable renewable generation, storage units, coupling to other energy sectors, and mixed alternating and direct current networks. It is designed to be easily extensible and to scale well with large networks and long time series. In this paper the basic functionality of PyPSA is described, including the formulation of the full power flow equations and the multi-period optimisation of operation and investment with linear power flow equations. PyPSA is positioned in the existing free software landscape as a bridge between traditional power flow analysis tools for steady- state analysis and full multi-period energy system models. The functionality is demonstrated on two open datasets of the transmission system in Germany (based on SciGRID) and Europe (based on GridKit). I. I NTRODUCTION Power system tools model the interactions between the electrical grid and the consumers and generators which use the grid. The importance of software modelling of the grid has risen in recent years given the increase in distributed and fluctuating wind and solar generation, and the increasing electrification of all energy demand. On the generation side, variable renewable generation causes loading in parts of the grid where it was never expected, and introduces new stochastic influences on the flow patterns. On the demand side, the need to decarbonise the transport and heating sectors is leading to the electrification of these sectors and hence higher electrical demand, replacing internal combus- tion engines with electric motors in the transport sector, and replacing fossil fuel boilers with heat pumps, resistive heaters and cogeneration for low-temperature space and water heating. In addition, the increasing deployment of storage technologies introduces many network users which are both consumers and generators of energy. The increasing complexity of the electricity system re- quires new tools for power system modelling. Many of the tools currently used for power system modelling were written in the era before widespread integration of renew- able energy and the electrification of transport and heating. They therefore typically focus on network flows in single time periods. Examples of such tools include commercial products like DIgSILENT PowerFactory [1], NEPLAN [2], PowerWorld [3], PSS/E [4] and PSS/SINCAL [5], and open tools such as MATPOWER [6], PSAT [7], PYPOWER [8] and pandapower [9] (see [10] for a full list of power system analysis tools). The consideration of multiple time periods is important on the operational side for unit commitment of conventional generators and the optimisation of storage and demand side management, and on the investment side for optimising infrastructure capacities over representative load and weather situations. Several tools have subsets of these capabilities, such as calliope [11], minpower [12], MOST [13], oemof [14], OSeMOSYS [15], PLEXOS [16], PowerGAMA [17], PRIMES [18], TIMES [19] and urbs [20], but their repre- sentations of electrical grids are often simplified. Python for Power System Analysis (PyPSA), the tool presented in this paper, was developed at the Frankfurt Institute for Advanced Studies to bridge the gap between power system analysis software and general energy system modelling tools. PyPSA can model the operation and optimal investment of the energy system over multiple periods. It has models for the unit commitment of conventional generators, time-varying renewable generators, storage units, all combinations of direct and alternating current electricity networks, and the coupling of electricity to other energy sectors, such as gas, heating and transport. It can perform full load flow calculations and linearised optimal load flow, including under consideration of security constraints. It was written from the start with variable renewables, storage and sector-coupling in mind, so that it performs well with large networks and long time series. Given the complexity of power system tools and the different needs of different users, it is crucial that such tools are both transparent in what they do and easily extendable by the user. To this end, PyPSA was released as free software under the GNU General Public Licence Version 3 (GPLv3) [21]. This means that the user is free to inspect, use and modify the code, provided that if they redistribute the software, they also provide the source code. Free software and open data also guarantee that research results can be reproduced by any third party, which is important given the large investment decisions that will need to be made on the basis of energy system modelling to reduce greenhouse gas emissions and combat global warming [22], [23]. PyPSA is available online in the Python Package Index (PyPI), on GitHub [24] and is archived on Zenodo [25]. Doc- umentation and examples are available on PyPSA’s website [26]. PyPSA is already used by more than a dozen research institutes and companies worldwide, 70 people are registered on the forum [27] and the website [26] has been visited by people from over 160 countries. As of October 2017 it has been used in six research papers [28], [29], [30], [31], [32], [33]. Users have already extended PyPSA for integer transmission expansion [28], [34] and in the grid planning tool open eGo [35]. This paper describes version 0.11.0 of PyPSA [25]. In Section II the mathematical functionality of PyPSA is de- scribed, while in Section III the focus shifts to the imple- mentation in software. Quality control is discussed in Section IV; the computational performance of PyPSA is described arXiv:1707.09913v3 [physics.soc-ph] 17 Jan 2018

PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

Embed Size (px)

Citation preview

Page 1: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

PyPSA: Python for Power System AnalysisTom Brown, Jonas Horsch, David Schlachtberger

Frankfurt Institute for Advanced Studies, Ruth-Moufang-Straße 1, 60438 Frankfurt am Main, GermanyEmail: [email protected]

Abstract—Python for Power System Analysis (PyPSA) is a free software

toolbox for simulating and optimising modern electrical powersystems over multiple periods. PyPSA includes models for con-ventional generators with unit commitment, variable renewablegeneration, storage units, coupling to other energy sectors, andmixed alternating and direct current networks. It is designedto be easily extensible and to scale well with large networksand long time series. In this paper the basic functionalityof PyPSA is described, including the formulation of the fullpower flow equations and the multi-period optimisation ofoperation and investment with linear power flow equations.PyPSA is positioned in the existing free software landscape as abridge between traditional power flow analysis tools for steady-state analysis and full multi-period energy system models.The functionality is demonstrated on two open datasets ofthe transmission system in Germany (based on SciGRID) andEurope (based on GridKit).

I. INTRODUCTION

Power system tools model the interactions between theelectrical grid and the consumers and generators which usethe grid. The importance of software modelling of the gridhas risen in recent years given the increase in distributedand fluctuating wind and solar generation, and the increasingelectrification of all energy demand. On the generation side,variable renewable generation causes loading in parts ofthe grid where it was never expected, and introduces newstochastic influences on the flow patterns. On the demandside, the need to decarbonise the transport and heatingsectors is leading to the electrification of these sectors andhence higher electrical demand, replacing internal combus-tion engines with electric motors in the transport sector,and replacing fossil fuel boilers with heat pumps, resistiveheaters and cogeneration for low-temperature space andwater heating. In addition, the increasing deployment ofstorage technologies introduces many network users whichare both consumers and generators of energy.

The increasing complexity of the electricity system re-quires new tools for power system modelling. Many ofthe tools currently used for power system modelling werewritten in the era before widespread integration of renew-able energy and the electrification of transport and heating.They therefore typically focus on network flows in singletime periods. Examples of such tools include commercialproducts like DIgSILENT PowerFactory [1], NEPLAN [2],PowerWorld [3], PSS/E [4] and PSS/SINCAL [5], and opentools such as MATPOWER [6], PSAT [7], PYPOWER [8]and pandapower [9] (see [10] for a full list of power systemanalysis tools).

The consideration of multiple time periods is importanton the operational side for unit commitment of conventionalgenerators and the optimisation of storage and demand sidemanagement, and on the investment side for optimising

infrastructure capacities over representative load and weathersituations. Several tools have subsets of these capabilities,such as calliope [11], minpower [12], MOST [13], oemof[14], OSeMOSYS [15], PLEXOS [16], PowerGAMA [17],PRIMES [18], TIMES [19] and urbs [20], but their repre-sentations of electrical grids are often simplified.

Python for Power System Analysis (PyPSA), the toolpresented in this paper, was developed at the FrankfurtInstitute for Advanced Studies to bridge the gap betweenpower system analysis software and general energy systemmodelling tools. PyPSA can model the operation and optimalinvestment of the energy system over multiple periods.It has models for the unit commitment of conventionalgenerators, time-varying renewable generators, storage units,all combinations of direct and alternating current electricitynetworks, and the coupling of electricity to other energysectors, such as gas, heating and transport. It can performfull load flow calculations and linearised optimal load flow,including under consideration of security constraints. It waswritten from the start with variable renewables, storage andsector-coupling in mind, so that it performs well with largenetworks and long time series.

Given the complexity of power system tools and thedifferent needs of different users, it is crucial that such toolsare both transparent in what they do and easily extendableby the user. To this end, PyPSA was released as freesoftware under the GNU General Public Licence Version 3(GPLv3) [21]. This means that the user is free to inspect, useand modify the code, provided that if they redistribute thesoftware, they also provide the source code. Free softwareand open data also guarantee that research results can bereproduced by any third party, which is important given thelarge investment decisions that will need to be made on thebasis of energy system modelling to reduce greenhouse gasemissions and combat global warming [22], [23].

PyPSA is available online in the Python Package Index(PyPI), on GitHub [24] and is archived on Zenodo [25]. Doc-umentation and examples are available on PyPSA’s website[26]. PyPSA is already used by more than a dozen researchinstitutes and companies worldwide, 70 people are registeredon the forum [27] and the website [26] has been visitedby people from over 160 countries. As of October 2017 ithas been used in six research papers [28], [29], [30], [31],[32], [33]. Users have already extended PyPSA for integertransmission expansion [28], [34] and in the grid planningtool open eGo [35].

This paper describes version 0.11.0 of PyPSA [25]. InSection II the mathematical functionality of PyPSA is de-scribed, while in Section III the focus shifts to the imple-mentation in software. Quality control is discussed in SectionIV; the computational performance of PyPSA is described

arX

iv:1

707.

0991

3v3

[ph

ysic

s.so

c-ph

] 1

7 Ja

n 20

18

Page 2: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

in Section V; and then its functionality is compared withother software in Section VI. Several example applicationsare given in VII before conclusions are drawn in VIII.

II. FUNCTIONALITY

In this section the basic components, power flow, linearoptimal power flow, energy system optimisation, unit com-mitment, contingency modelling and other functionality ofPyPSA are described. The definitions of the main variablesused in this section can be found in Table I, along with unitswhere applicable.

A. Components

PyPSA’s representation of the power system is built byconnecting the components listed in Table II.

Buses are the fundamental nodes to which all other com-ponents attach. Their mathematical role is to enforce energyconservation at the bus at all times (essentially Kirchhoff’sCurrent Law).

Loads, generators, storage units, stores and shuntimpedances attach to a single bus and determine the powerbalance at the bus. Loads represent a fixed power demand;a generator’s dispatch can be optimised within its poweravailaiblity; stores can shift power from one time to anotherwith a standing loss efficiency for energy leakage; storageunits behave like stores, but they can also have efficiencylosses and power limits upon charging and discharging;finally shunt impedances have a voltage-dependent powerconsumption.

Lines and transformers connect two buses with a givenimpedance. Power flows through lines and transformersaccording to the power imbalances at the buses and theimpedances in the network. Lines and transformers arereferred to collectively as ‘passive branches’ to distinguishthem from controllable link branches. The impedances of thepassive branches are modelled internally using the equiva-lent PI model. The relation between the series impedancez = r+jx, the shunt admittance y = g+jb, the transformertap ratio τ , the transformer phase shift θshift, and the complexcurrents I0, I1 and complex voltages V0, V1 at the buseslabelled 0 and 1 is given by(

I0I1

)=

(1z + y

2 − 1z

1

τe−jθshift

− 1z

1

τejθshift

(1z + y

2

)1τ2

)(V0V1

)(1)

(For lines, for which neither the tap ratio or the phase shiftare relevant, set τ = 1 and θshift = 0 in this equation.)The equivalent circuit is shown in Figure 1. This circuitis for the case where the tap-changer is on the primaryside; a similar equation and figure for the case wherethe tap-changer is on the secondary side is given in thedocumentation [26]. The line model defaults to the PI model,while the transformer model defaults to the more accurate Tmodel, which is converted to the PI model using the standarddelta-wye transformation. For convenience standard types forlines and transformers in networks at 50 Hz are providedfollowing the conversion formula from nameplate parame-ters to impedances and the typical parameters provided inpandapower [9], so that the user does not have to input theimpedances manually. The typical parameters in pandapowerare based on [36], [37], [38].

TABLE INOMENCLATURE

Variable Units Definition

n,m Bus labelsr Generator energy carrier labels (e.g.

wind, solar, gas, etc.)s Storage energy carrier labels (e.g. bat-

tery, hydrogen, etc.)k, ` Branch labelsc Cycle labelst Snapshot / time point labelser/s tCO2eq/MWhth CO2-equivalent emissions of energy

carrier r or swt h Weighting of snapshot in objective

functiongn,r,t MW Dispatch of generator at bus n with

carrier r at time tGn,r MW Power capacity of generator n, rgn,r,t MW/MW Power availability per unit of generator

capacityηn,r MWel/MWth Efficiency of generatorun,r,t On/off binary status for generator unit

commitmentTmin downn,r h Generator minimum down timeT

min upn,r h Generator minimum up timerun,r (MW/MW)/h Generator ramp up limit per unit of

capacityrdn,r (MW/MW)/h Generator ramp down limit per unit of

capacitycn,r e/MW Generator capital (fixed) coston,r e/MWh Generator operating (variable) costsucn,r(,t) e Generator start up cost (in time t)sdcn,r(,t) e Generator shut down cost (in time t)hn,s,t MW Dispatch of storage at bus n with car-

rier s at time tHn,s MW Power capacity of storage n, sen,s,t MWh Storage state of charge (energy level)En,s MWh Storage energy capacitycn,s e/MW Storage power capacity costcn,s e/MWh Storage energy capacity coston,s e/MWh Storage dispatch costdn,t MW Electrical load at bus n at time tλn,t e/MWh Marginal price at bus n at time tVn kV Complex voltage at bus nθn rad Voltage angle at bus nIn kA Complex current at bus nPn MW Total active power injection at bus nQn MVAr Total reactive power injection at bus nSn MVA Total apparent power injection at bus nf`,t MW Branch active power flowF` MW Branch active power ratingc` e/MW Branch capital costx` Ω Branch series reactancer` Ω Branch series resistancez` Ω Branch series impedancey` S Branch shunt admittanceτ` Transformer tap ratioθshift` rad Transformer phase shiftη`,t MW/MW Efficiency loss of a linkKn` N × L incidence matrixC`c L× (L−N + 1) cycle matrixYnm S Bus admittance matrixB`k S Diagonal L× L matrix of branch sus-

ceptancesBODF`k Branch Outage Distribution Factor

Links connect two buses with a controllable active powerdispatch that can be set by the user or optimised by PyPSA.Links can be used to represent point-to-point high volt-age direct current (HVDC) lines, import-export capacitiesin transport models such as Net-Transfer-Capacity (NTC)

Page 3: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

TABLE IIPYPSA COMPONENTS

Network Container for all other network components.Bus Fundamental nodes to which all other components

attach.Carrier Energy carrier (e.g. wind, solar, gas, etc.).Load A consumer of energy.Generator Generator whose feed-in can be flexible subject to

minimum loading or minimum down and up times,or variable according to a given time series of poweravailability.

Storage Unit A device which can shift energy from one time toanother, subject to efficiency losses.

Store A more fundamental storage object with no restric-tions on charging or discharging power.

Shunt Impedance An impedance in shunt to a bus.Line A branch which connects two buses of the same

voltage.Transformer A branch which connects two buses of different

voltages.Link A branch with a controllable power flow between

two buses.

V0

I0

τejθshift

= N : 1

V ′0 = V0

N

I ′0 = N∗I0

y2

z

y2 V1

I1

Fig. 1. Electrical property definitions for passive branches (lines andtransformers).

models, or general energy conversion processes with a givenefficiency, such as resistive heaters or heat pumps (fromelectricity to heat) or gas boilers (from gas to heat). Theirefficiency can also be time-varying (e.g. to represent theambient temperature dependence of a heat pump’s coefficientof performance). Networks of links implement Kirchoff’sCurrent Law (energy conservation at each bus), but notKirchoff’s Voltage Law, which is obeyed by networks ofpassive branches.

A generator can also be represented in terms of more basiccomponents: a bus is added for the fuel source with a store torepresent the amount of fuel available. It is then connectedto the electricity bus with a link to represent the energyconversion loss. Similarly a storage unit can be representedwith an additional bus for the storage medium with a storeattached, and then two links connected to the electricity busto represent charging and discharging.

Energy enters the model in generators; in storage unitsor stores with higher energy levels before than after thesimulation; and in any components with efficiency greaterthan 1 (such as heat pumps). Energy leaves the model inloads; in storage units or stores with higher energy levelsafter than before the simulation; and in lines, links or storageunits with efficiency less than 1.

B. Power flow without optimisation

In a power flow calculation, the user specifies the powerdispatch of all dispatchable components (loads, generators,storage units, stores and links) and then PyPSA computesthe resulting voltages in the network and hence the powerflows in passive branches (lines and transformers) based ontheir impedances.

1) Power flow equations for AC networks: A power flowcalculation for an alternating current (AC) network ensuresthat for all buses labelled by n we have

Sn = VnI∗n =

∑m

VnY∗nmV

∗m (2)

where Sn = Pn + jQn is the apparent power injected atthe bus, In is the complex current and Vn = |Vn|ejθnis the complex voltage, whose rotating angle is measuredrelative to a chosen slack bus. Ynm is the bus admittancematrix, which is constructed for all buses based on thecontributions from the individual branch admittance matricesfrom equation (1) and any shunt impedances at the nodes,following the example of MATPOWER [6].

The inputs and outputs for the buses are given as follows:• For the chosen slack bus n = 0, it is assumed that the

voltage magnitude |V0| and the voltage angle θ0 aregiven. PyPSA must find the powers P0 and Q0.

• For PQ buses, Pn and Qn are given; |Vn| and θn areto be found.

• For PV buses, Pn and |Vn| are given; Qn and θn areto be found.

The non-linear equation system (2) is then solved usingthe Newton-Raphson algorithm [39] and, by default, aninitial ‘flat’ guess of θn = θ0 and |Vn| = 1 (per unit). Theinitial guess can also be specified (‘seeded’) by the user,using for example the linearised power flow solution.

2) Power flow equations for DC networks: A power flowcalculation for a direct current (DC) network ensures thatfor all buses labelled by n we have

Pn = VnIn =∑m

VnGnmVm (3)

where Pn is the active power injected at the bus and thevoltage, current and the conductance matrix Gij are now allreal quantities. This non-linear equation is also solved withthe Newton-Raphson algorithm.

3) Linearised power flow equations for AC networks: Insome circumstances a linearisation of the AC power flowequations (2) can provide a good approximation to the fullnon-linear solution [40], [41]. The linearisation is restrictedto calculating active power flows based on voltage angledifferences and branch series reactances. It assumes thatreactive power flow decouples from active power flow, thatthere are no voltage magnitude variations, voltage anglesdifferences across branches are small enough that sin θ ∼ θand branch resistances are negligible compared to branchreactances. This makes it suitable for short overhead trans-mission lines close to their natural loading.

In this case it can be shown [6] that the voltage anglesare related to the active power injections by a matrix

Pn =∑m

(KBKT )nmθm −∑`

Kn`b`θshift` (4)

Page 4: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

where K is the incidence matrix of the network, B isthe diagonal matrix of inverse branch series reactances x`multiplied by the tap ratio τ`, i.e. B`` = b` = 1

x`τ`, and

θshift` is the phase shift for a transformer. The matrix KBKT

is singular with a single zero eigenvalue for a connectednetwork and can be inverted by first deleting the row andcolumn corresponding to the slack bus.

4) Linearised power flow equations for DC networks:For DC networks the equation (3) is linearised by positingVn = 1+δVn and assuming that δVn is small. The resultingequations mirror the linearised AC approximation with thesubstitutions θn → δVn and x` → r`.

C. Optimisation with linear power flow equations

PyPSA is a partial equilibrium model that can optimiseboth short-term operation and long-term investment in theenergy system as a linear problem using the linear powerflow equations.

PyPSA minimises total system costs, which include thevariable and fixed costs of generation, storage and transmis-sion, given technical and physical constraints. The objectivefunction is given by

minF`,Gn,r,Hn,s,En,s

f`,t,gn,r,t,hn,s,t,sucn,r,t,sdcn,r,t

[∑`

c` · F` +∑n,r

cn,r ·Gn,r

+∑n,r,t

(wt · on,r · gn,r,t + sucn,r,t + sdcn,r,t) (5)

+∑n,s

cn,s ·Hn,s +∑n,s

cn,s · En,s +∑n,r,t

wt · on,s · [hn,s,t]+]

It consists of the branch capacities F` for each branch ` andtheir annuitised fixed costs per capacity c`, the generatorcapacities Gn,r at each bus n for technology r and theirannuitised fixed costs per capacity cn,r, the dispatch gn,r,tof the unit at time t and the associated variable costson,r, the start up and shut down costs sucn,r,t and sdcn,r,twhen unit commitment is activated, the storage unit powercapacities Hn,s and store energy capacities En,s at each busn for storage technology s and their associated fixed costscn,s and cn,s, and finally the positive part of the storagedispatch [hn,s,t]

+ and the associated variable costs on,s.The branch flows f`,t are optimisation variables but do notappear in the objective function. The optimisation is run overmultiple time periods t representing different weather anddemand conditions. Each period can have a weighting wt;the investment costs must then be annuitised for the totalperiod

∑t wt (typically a full year).

The dispatch of generators gn,r,t is constrained by theircapacities Gn,r and time-dependent availabilities gn,r,t andgn,r,t, which are given per unit of the capacities Gn,r:

gn,r,t ·Gn,r ≤ gn,r,t ≤ gn,r,t ·Gn,r ∀n, r, t (6)

For conventional generators the availabilities are usuallyconstant; a fully flexible generator would have gn,r,t = 0and gn,r,t = 1. For variable renewable generators suchas wind and solar, gn,r,t represents the weather-dependentpower availability, while curtailment may also be limited byintroducing a lower bound on the dispatch gn,r,t.

The dispatch can also be limited by ramp rate constraintsrun,r and rdn,r per unit of the generator nominal power:

−rdn,r·Gn,r ≤ (gn,r,t−gn,r,t−1) ≤ run,r·Gn,r ∀n, r, t > 0(7)

Unit commitment for conventional generators is described inSection II-E.

The power capacity Gn,r can also be optimised withinminimum Gn,r and maximum Gn,r installable potentials:

Gn,r ≤ Gn,r ≤ Gn,r ∀n, r (8)

The dispatch of storage units hn,s,t, whose energy carriersare labelled by s, is constrained by a similar equation to thatfor generators in equation (6):

hn,s,t ·Hn,s ≤ hn,s,t ≤ hn,s,t ·Hn,s ∀n, s, t (9)

except hn,s,t is now negative, since the dispatch of storageunits can be both positive when discharging into the gridand negative when absorbing power from the grid. Thepower capacity Hn,s can also be optimised within installablepotentials.

The energy levels en,s,t of all storage units have to beconsistent between all hours and are limited by the storageenergy capacity En,s

en,s,t = ηwtn,s,0en,s,t−1

+ηn,s,+ · wt [hn,s,t]+ − η−1n,s,− · wt [hn,s,t]

+wt · hn,s,t,inflow − wt · hn,s,t,spillage

en,s,t · En,s ≤ en,s,t ≤ en,s,t · En,s ∀n, s, t (10)

Positive and negative parts of a value are denoted as[·]+ = max(·, 0), [·]− = −min(·, 0). The storage units canhave a standing loss (self-discharging leakage rate) ηn,s,0, acharging efficiency ηn,s,+, a discharging efficiency ηn,s,−,inflow (e.g. river inflow in a reservoir) and spillage. Theinitial energy level can be set by the user, or it is assumedto be cyclic, i.e. en,s,t=0 = en,s,t=T .

The store component is a more basic version of thestorage unit: its charging and discharging power cannot belimited and there are no charging and discharging efficienciesηn,s,+, ηn,s,−. The energy levels of the store can also berestricted by time series en,s,t, en,s,t given per unit of theenergy capacity En,s; this allows the demand-side man-agement model of [42] to be implemented in PyPSA. Theenergy capacity En,s can also be optimised within installablepotentials.

Global constraints related to primary energy consumption,such as emission limits, can also be implemented. Forexample, CO2 emissions can be limited by a cap CAPCO2,implemented using the specific emissions er in CO2-tonne-per-MWhthof the fuel r and the efficiency ηn,r of thegenerator:∑

n,r,t

1

ηn,rwt · gn,r,t · er ≤ CAPCO2 ↔ µCO2 (11)

µCO2 is the shadow price of this constraint.

Page 5: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

The (inelastic) electricity demand dn,t at each bus n mustbe met at each time t by either local generators and storageor by the flows f`,t from the branches `∑r

gn,r,t +∑s

hn,s,t +∑`

α`,n,t · f`,t = dn,t (12)

↔ wt · λn,t ∀n, t

where α`,n,t = −1 if ` starts at n, α`,n,t = 1 if ` is aline or transformer and ends at n, and α`,n,t = η`,t if ` isa link and ends at n (note that for lines and transformers,α`,n,t is the incidence matrix of the network, α`,n,t = Kn`).η`,t represents an efficiency loss for a link (it can betime-dependent for efficiency that, for example, dependson the outside temperature, like for a heat pump). λn,t isthe marginal price at the bus. This equation implementsKirchhoff’s Current Law (KCL), which guarantees energyconservation at each node.

The flows in all passive branches are constrained by theircapacities F`

|f`,t| ≤ F` ∀ `, t (13)

For links, the flows can be more finely controlled with time-dependent per unit availabilities f`,t, f`,t

f`,t · F` ≤ f`,t ≤ f`,t · F` ∀ `, t (14)

which allows, for example, time-dependent demand-sidemanagement schemes to be modelled [42]. For both passivebranches and links, the upper and lower limits are associatedwith KKT multipliers µ`,t and µ

¯ `,t.

The flows in links are fully controllable.Power flows in networks of passive branches (lines and

transformers) according to the linear power flow equations.It is assumed that the network is lossless, so that η`,t = 1 forpassive branches. To guarantee the physicality of the networkflows, in addition to KCL, Kirchhoff’s Voltage Law (KVL)must be enforced in each connected network. KVL statesthat the voltage differences around any closed cycle in thenetwork must sum to zero. If each independent cycle c isexpressed as a directed combination of passive branches `by a matrix C`c then KVL becomes the constraint∑

`

C`c · x` · f`,t = 0 ∀c, t (15)

where x` is the series inductive reactance of branch `. In arecent paper it is demonstrated that this formulation of thelinear load flow using cycles solves up to 20 times fasterthan standard formulations using the voltage angles [30];voltage angle and PTDF formulations are also implementedin PyPSA and deliver identical results.

Since branch capacities F` can be continuously expandedto represent the addition of new circuits to an aggregatedtransmission corridor `, the impedances x` of the brancheswould also decrease. In principle this would introduce abilinear coupling in equation (15) between the x` and thef`,t. To keep the optimisation problem linear and thereforecomputationally fast, x` can be left fixed in each optimi-sation problem, updated and then the optimisation problemrerun, in up to 5 iterations to ensure convergence, followingthe methodology of [43]. Another author has implemented aninteger transmission expansion in PyPSA [34] that bypasses

grid connectionelectric bus

generators

storage

transport

disc

harg

e

char

ge

battery

heat

solar thermal

heat pump;

resistive heater

hot water tank

hydrogen

elec

trol

ysis

fuel

cell

store

methane

store

Saba

tier

gene

rato

r/C

HP

boile

r/C

HP

Fig. 2. Example of the coupling in PyPSA between electricity (at top) andother energy sectors: transport, hydrogen, natural gas and heating. There isa bus for each energy carrier, to which different loads, energy sources andconverters are attached.

the bilinearity with a disjunctive big-M relaxation [44]; thiswill be incorporated into the main code base of PyPSA soon.

D. Coupling to other energy sectors

PyPSA can also optimise operation and investment inother energy sectors, such as natural gas, heating andtransport. These sectors can be modelled using a networkof links with efficiencies for energy conversion losses; anexample from a recent paper [29] is shown in Figure 2. Forexample, links from electricity to heat buses can representresistive heaters and/or heat pumps (the latter can also bemodelled with a time-dependent coefficient of performance,given the importance of capturing the dependence of heatpump performance on outside temperature [45]). CombinedHeat and Power plants (CHPs) can also be modelled byadding additional constraints for the back pressure and fuelconsumption (see the PyPSA examples [26]). Depletableresources such as natural gas are modelled with stores.

E. Unit Commitment

Unit commitment can be turned on for any generator.This introduces a times series of new binary status variablesun,r,t ∈ 0, 1, which indicates whether the generator isrunning (1) or not (0) in period t. The restrictions ongenerator output now become:

un,r,t · gn,r,t ·Gn,r ≤ gn,r,t ≤ un,r,t · gn,r,t ·Gn,r ∀n, r, t(16)

so that if un,r,t = 0 then also gn,r,t = 0.If Tmin up

n,r is the minimum up time then we have

t+Tmin upn,r∑

t′=t

un,r,t′ ≥ Tmin upn,r (un,r,t−un,r,t−1) ∀n, r, t (17)

(i.e. if the generator has just started up (un,r,t−un,r,t−1 = 1)then it has to run for at least Tmin up

n,r periods). Similarly fora minimum down time of Tmin down

n,r

t+Tmin downn,r∑t′=t

(1−un,r,t′) ≥ Tmin downn,r (un,r,t−1−un,r,t) ∀n, r, t

(18)

Page 6: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

For non-zero start up costs sucn,r a new variablesucn,r,t ≥ 0 is introduced for each time period t and addedto the objective function. The variable satisfies

sucn,r,t ≥ sucn,r(un,r,t − un,r,t−1) ∀n, r, t (19)

so that it is only non-zero if un,r,t − un,r,t−1 = 1, i.e. thegenerator has just started, in which case the inequality issaturated sucn,r,t = sucn,r. Similarly for the shut downcosts sdcn,r,t ≥ 0 we have

sdcn,r,t ≥ sdcn,r(un,r,t−1 − un,r,t) ∀n, r, t (20)

The ramp-rate limits in equation (7) can also be suplementedby ramping limits at start-up and shut-down.

F. Security-Constrained LOPF

PyPSA has functionality to examine the steady state ofthe power system after outages of passive branches, basedon an analysis of the linear power flow.

PyPSA calculates the Branch Outage Distribution Fac-tor (BODF) from the Power Transfer Distribution Factors(PTDF) (see [46]). The BODF gives the change in linearisedpower flow on passive branch ` given the outage of passivebranch k

f(k)` = f` +BODF`k · fk (21)

Here f` is the flow before the outage and f(k)` is the flow

after the outage of branch k.The BODF can then be used in Security-Constrained

Linear Optimal Power Flow (SCLOPF). SCLOPF builds onthe LOPF by including additional constraints that branchesmay not become overloaded after the outage of a selectionof branches. For each potential outage of a branch k, a set ofconstraints for all other branches ` is included, guaranteeingthat they do not become overloaded beyond their capacityF`

|f (k)`,t | = |f`,t +BODF`k · fk,t| ≤ |F`| ∀`, t (22)

G. Network clustering

PyPSA also implements a variety of network clusteringalgorithms to reduce the number of buses in a network whilepreserving important transmission lines. For example, thek-means clustering algorithm was recently used in [32] toexamine the effect of clustering on investment optimisationresults.

H. Planned new features

PyPSA is currently in version 0.11.0. PyPSA has beendesigned to be modular, so that it is possible to develop thecode for many other types of calculations. Currently featuresbeing considered by the development team include, in roughorder of priority:• Integer transmission expansion, following an existing

implementation in PyPSA [34] using the disjunctivebig-M relaxation [44];

• Multi-horizon dynamic investment optimisation overseveral years, following for example the implementationin OSeMOSYS [15];

• Transient analysis using the Root-Mean-Square (RMS)values of phasor quantities, following the implementa-tion in PSAT [7];

• An implementation of the non-linear power flow solu-tion using analytic continuation in the complex plane[47], following the implementation in GridCal [48];

• Short-circuit analysis, following the implementation inpandapower [9];

• OPF with the full non-linear network equations, fol-lowing the implementations in PYPOWER and MAT-POWER;

• An interactive web-based GUI for analysing and ma-nipulating the network topology.

III. IMPLEMENTATION AND ARCHITECTURE

PyPSA was written in the Python programming language[49] because it is widely used in the modelling community,it is easy to learn and its implementation is also free. Itis available for every major operating system, includingGNU/Linux, Mac OSX and Windows. PyPSA has beentested with versions 2.7 and 3.5 of Python.

PyPSA stores all data about network components inthe DataFrame objects of the Python library pandas [50].This enables easy and efficient indexing of the data, whilemantaining the fast calculation speeds of the underlyingarray objects of the Python library NumPy [51]. For eachof the components listed in Table II (except the overallNetwork container component) there is a DataFrame listingthe static attributes (such as line impedance or capital cost)and a dictionary of DataFrames containing the time-varyingattributes (such as wind power availability or consumerdemand) that are in addition indexed by the list of snapshots.The specification of some attributes (such as generatormaximum output) can be either static or time-varying; if thetime series is not specified, then the static value is taken.

All matrix calculations and solutions of linear equationsystems are carried out either with NumPy [51] or, in thecase of sparse matrices, with SciPy [52]. These Pythonlibraries interface with lower-level programming language li-braries to benefit from the speed of strongly-typed languages.

Optimisation problems are formulated using the Python-based optimization modeling language Pyomo [53], [54],which is solver agnostic and intuitive to extend. The use ofPyomo also allows inter-operability with other energy systemframeworks that use Pyomo, such as calliope [11], oemof[14] and urbs [20]. In PyPSA lower-level functions in Pyomohave been exploited to improve computational performance.

PyPSA has no graphical user interface, but integratesclosely with the IPython [55] interactive notebooks, wherenetworks and their properties can be visualised using thePython library Matplotlib [56] (see Figures 4 and 5) or theinteractive JavaScript-based library plotly [57].

Internally PyPSA converts all power system quantities(voltage, power, current, impedances) to per unit values. Setpoints for loads and generation are stored separately fromthe power values which are actually dispatched.

IV. QUALITY CONTROL

PyPSA comes with a large test suite that covers all of itsmajor functionality. Tests are implemented using the Pythonlibrary pytest [58]. Tests are also included that comparePyPSA’s results with other software such as PYPOWER [8]and pandapower [9]. Users can and do report bugs by raisingissues in the GitHub repository [24] or on the forum [27].

Page 7: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

case89pegasecase118

case300

case1354pegase

case2383wp

case2869pegase

case9241pegase0.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4C

alcu

latio

n tim

e [s

]MATPOWERPyPSA

Fig. 3. Calculation times for performing a full load flow on the MAT-POWER [6] standard cases using MATPOWER versus PyPSA.

V. PERFORMANCE

In this section some examples of PyPSA’s computationalperformance are given.

In Figure 3 computation times are given for a full powerflow on the MATPOWER [6] test cases (the IEEE standardcases as well as snapshots from the French TSO RTE andEuropean networks [59]) using MATPOWER and PyPSA. Inboth cases the complete execution of the load flow function(‘runpf’ for MATPOWER and ‘network.pf’ for PyPSA) wastimed on a computer with Intel Core i5-2520M processorsat 2.50GHz each with a tolerance of 10−8 for the summederror in the apparent power S from equation (2). The timingswere averaged over 10 attempts for each network. Thecomputation times are similar, thanks to the fact that bothMATPOWER and PyPSA (via the SciPy library [52]) usethe same C library umfpack [60] for solving sparse linearequation systems, but PyPSA is in all cases slightly slowerdue to the overhead of preparing the admittance matricesin pure Python code. If the admittance matrix remains thesame for several calculations, PyPSA has the option toavoid recalculating it, which can save some of this time;further acceleration is possible by using the just-in-time (jit)compiler numba [61], as has been done in the pandapowerproject [9] with success for larger networks.

For the linear optimal power flow (LOPF) the computationperformance depends strongly on the choice of linear solver.To give an indication of typical calculation times, if dispatchin the SciGRID model of the German transmission networkdescribed in Section VII (585 buses, 1423 generators in-cluding curtailable wind and solar at each node, 38 pumpstorage units, 852 lines, 96 transformers) is optimised over4 snapshots, it takes 5 seconds using the COIN-OR Clp freesolver on the computer described above. Extensive timingsfor different formulations of the LOPF problem can be foundin [30].

VI. COMPARISON TO OTHER POWER SYSTEM TOOLS

Given the proliferation of software tools available formodelling power systems, a guide is provided here thatbriefly compares PyPSA to other power system tools, with aparticular focus on free software in the Python programminglanguage. The advantages of Python are discussed above inSection III.

Selected features for a selection of different software toolsare compared in Table III. Many of the tools have specialisedfeatures that are not shown in the table, so this table shouldonly be treated as an indicative overview of their features inrelation to PyPSA’s features.

Many power system tools concentrate on steady-state,dynamic (i.e. short-term transient) and single-period OPFanalysis of power networks. They neglect the multi-periodunit commitment, investment optimisation and energy sys-tem coupling which PyPSA offers. In Python we focus ourcomparison on two tools: PYPOWER and pandapower.

PYPOWER [8] is a port of an older version of MAT-POWER [6] from Matlab to Python. It does not make stronguse of Python’s object-oriented interface and structures datausing NumPy arrays, which makes it difficult to track com-ponent attributes. It has no functionality to deal with multi-period OPF, which makes it unsuitable for unit commitment,storage optimisation or investment optimisation. This reflectsthe functionality of older versions of MATPOWER, but thelatest version 6.0 of MATPOWER includes the MATPOWEROptimal Scheduling Tool (MOST) [13], which does multi-period OPF, but no investment optimisation. Unlike PyPSA,PYPOWER has the ability to do full non-linear OPF forsingle snapshots.

pandapower [9] provides a pandas [50] interface to PY-POWER [8], which makes it easier to use, and adds usefulfunctionality such as standard types (on which PyPSA’sstandard types are based), short circuit calculations, stateestimation, and modelling of switches and three-windingtransformers. The last four functions are currently missingin PyPSA, along with non-linear OPF, but like PYPOWER,pandapower does not have multi-period OPF functionality.pandapower is under active development and the PyPSAteam stays in contact with the pandpower team to exchangetips and features, which is a clear benefit for both developersand users of free software.

PyPSA differs from more general energy system modelssuch as calliope [11], oemof [14], OSeMOSYS [15] andurbs [20] by offering more detailed modelling of powernetworks, in particular the physics of power flow accordingto the impedances in the network. PyPSA can model amore general energy network using link components (seeSection II-D), but cannot, for example, yet do the multi-year dynamic investment that OSeMOSYS does. The non-free PLEXOS software [16] comes the closest to matchingPyPSA’s functionality, but PLEXOS is missing non-linearpower flow.

These differences with other software tools are the reasonthat it was decided to develop a new tool rather than toextend an existing one. Existing tools for power flow such asPYPOWER did not have the internal code and data structuresfor economic optimisation over multiple time periods withmany inter-temporal actors, whereas the energy system toolswere missing the tight integration with power flow analysisthat we believe is necessary for future research.

VII. DEMONSTRATION OF FEATURES ON THE SCIGRIDAND GRIDKIT DATASETS

On the PyPSA website [26] a large number of examplesof code using PyPSA is linked for reference and to help

Page 8: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

Grid Analysis Economic Analysis

Software Ver

sion

Cita

tion

Free

Soft

war

e

Pow

erFl

ow

Con

tinua

tion

Pow

erFl

ow

Dyn

amic

Ana

lysi

s

Tran

spor

tM

odel

Lin

ear

OPF

SCL

OPF

Non

linea

rO

PF

Mul

ti-Pe

riod

Opt

imis

atio

n

Uni

tC

omm

itmen

t

Inve

stm

ent

Opt

imis

atio

n

Oth

erE

nerg

ySe

ctor

s

MATPOWER 6.0 [6] 3 3 3 3 3 3NEPLAN 5.5.8 [2] 3 3 3 3 3 3 3pandapower 1.4.0 [9] 3 3 3 3 3PowerFactory 2017 [1] 3 3 3 3 3PowerWorld 19 [3] 3 3 3 3 3 3PSAT 2.1.10 [7] 3 3 3 3 3 3 3 3PSS/E 33.10 [4] 3 3 3 3 3PSS/SINCAL 13.5 [5] 3 3 3 3

Pow

ersy

stem

tool

s

PYPOWER 5.1.2 [8] 3 3 3 3 3

PyPSA 0.11.0 3 3 3 3 3 3 3 3 3

calliope 0.5.2 [11] 3 3 3 3 3minpower 4.3.10 [12] 3 3 3 3 3MOST 6.0 [13] 3 3 3 3 3 3 3 3 3oemof 0.1.4 [14] 3 3 3 3 3 3OSeMOSYS 2017 [15] 3 3 3 3 3PLEXOS 7.400 [16] 3 3 3 3 3 3 3PowerGAMA 1.1 [17] 3 3 3 3PRIMES 2017 [18] 3 3 3 3 3 3TIMES 2017 [19] 3 3 3 3 3 3

Ene

rgy

syst

emto

ols

urbs 0.7 [20] 3 3 3 3 3 3

TABLE IIIA COMPARISON OF SELECTED FEATURES OF SELECTED SOFTWARE TOOLS THAT ARE SIMILAR TO PYPSA.

0

10

20

30

40

50

60

70

Loca

tional M

arg

inal Pri

ce (

EU

R/M

Wh)

0

15

30

45

60

75

90Li

ne loadin

g [

%]

+ve Q

−ve Q

Fig. 4. Left: Locational marginal prices (λn,t from equation (12)) for Germany in an hour with high wind and low load; Middle: Line loading duringthis hour: highly loaded lines in the middle of Germany prevent the transport of cheap wind energy to consumers in the South; Right: Reactive powerfeed-in (positive in red, negative in blue) necessary to keep all buses at unit nominal voltage.

users just starting out with the software. These range frombasic small-scale networks demonstrating the features ofPyPSA, to a one-node-per-country model of the Europeanpower system with high shares of renewables [62], to fulltransmission network models available as open data fromthe SciGRID [63] and GridKit projects [64], [65] which wedemonstrate here.

The SciGRID model of Germany provides geo-referenceddata for substations and transmission lines (220 kV andabove). In one code example, data from openly-availablesources on power plant locations and capacities, load dis-tribution and time series are added to the SciGRID data sothat load flow calculations can be carried out. The resultsof one such simulation for Germany with nodal pricingis shown in Figure 4. In this snapshot there was a largeamount of zero-marginal-cost wind feed-in suppressing thelocational marginal prices (λn,t from equation (12)) in the

North of Germany. Transmission bottlenecks in the middle ofGermany prevent the transportation of this cheap electricityto the South, where more expensive conventional generatorsset the price. The linearly-optimised dispatch was then fedinto a full non-linear power flow calculation where each buswas set to maintain nominal voltage; the resulting reactivepower feed-in is also shown in Figure 4.

The data quality for the transmission grid in Open-StreetMap outside Germany is not of uniform quality, so forthe European grid, an extract of the ENTSO-E interactivemap [66] was made [64] using GridKit [65]. The detailsof how load, conventional power plants and renewablegeneration time series and expansion potentials were addedto the grid data are provided in a forthcoming paper [67].The result of generation and storage investment optimisationfor a clustering of the network from 5000 buses down to256 buses, allowing no grid expansion and assuming a CO2

Page 9: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

offshore windonshore wind

solarrun of river

battery storagehydrogen storage

gas

Fig. 5. Results of optimisation of generation and storage capacities inEurope to reduce CO2 emissions in the European electricity sector by 95%compared to 1990 levels [32]. The grid topology is based on the GridKitnetwork for Europe, clustered from 5000 buses to 256 buses.

reduction of 95% compared to 1990 levels, is shown inFigure 5. The lack of grid expansion forces some balancingof renewable variability locally with storage. Short-termbattery storage (grey) combines with solar power (yellow)in Southern Europe, while longer-term hydrogen storage(purple) pairs with wind power (blue) in Northern Europe.This system has an average cost of e 82/MWh. If the grid isoptimally expanded, much of the storage can be eliminatedand costs are as low as e 65/MWh [32].

VIII. CONCLUSIONS

In this paper a new toolbox has been presented forsimulating and optimising power systems. Python for PowerSystem Analysis (PyPSA) provides components to modelvariable renewable generation, conventional power plants,storage units, coupling to other energy sectors and multiply-connected AC and DC networks over multiple periods forthe optimisation of both operation and investment. Tools arealso provided for steady-state analysis with the full load flowequations. PyPSA’s performance for large datasets, com-parisons with other software packages and several exampleapplications are demonstrated.

As free software, the code of PyPSA can easily beinspected and extended by users, thereby contributing tofurther research and also transparency in power system mod-elling. Given that public acceptance of new infrastructureis often low, it is hoped that transparent modelling cancontribute to public understanding of the various options weface when designing a sustainable energy system.

ACKNOWLEDGMENTS

We thank Stefan Schramm for supporting the developmentof PyPSA. We thank the community of PyPSA users for bugreports, improvement suggestions and their general friendlysupport and encouragement for the further developmentof PyPSA. This research was conducted as part of the

CoNDyNet project, which is supported by the GermanFederal Ministry of Education and Research under grant no.03SF0472C. The responsibility for the contents lies solelywith the authors.

REFERENCES

[1] DIgSILENT GmbH, “PowerFactory,” http://digsilent.de/, 2017.[2] NEPLAN AG, “PowerFactory,” http://www.neplan.ch/, 2017.[3] PowerWorld Corporation, “PowerWorld,” https://www.powerworld.

com/, 2017.[4] Siemens AG, “PSS/E,” http://w3.siemens.com/smartgrid/

global/en/products-systems-solutions/software-solutions/planning-data-management-software/planning-simulation/Pages/PSS-E.aspx, 2017.

[5] ——, “PSS/SINCAL,” http://w3.siemens.com/smartgrid/global/en/products-systems-solutions/software-solutions/planning-data-management-software/planning-simulation/pss-sincal/pages/pss-sincal.aspx, 2017.

[6] R. D. Zimmerman, C. E. Murillo-Sanchez, and R. J. Thomas,“MATPOWER: Steady-state operations, planning and analysistools for power systems research and education,” IEEE Trans.Power Syst., vol. 26, p. 12, 2011. [Online]. Available: https://doi.org/10.1109/TPWRS.2010.2051168

[7] F. Milano, “An open source power system analysis toolbox,” IEEETransactions on Power Systems, vol. 20, no. 3, pp. 1199–1206,Aug 2005. [Online]. Available: https://doi.org/10.1109/TPWRS.2005.851911

[8] Richard Lincoln, “PYPOWER,” https://github.com/rwl/PYPOWER,2017.

[9] L. Thurner, A. Scheidler, F. Schafer, J.-H. Menke, J. Dollichon,F. Meier, S. Meinecke, and M. Braun. (2017) pandapower -an Open Source Python Tool for Convenient Modeling, Analysisand Optimization of Electric Power Systems. Preprint. [Online].Available: https://arxiv.org/abs/1709.06743

[10] Open Electrical Wiki, “Power Systems Analysis Software,”http://www.openelectrical.org/wiki/index.php?title=Power SystemsAnalysis Software, 2017.

[11] S. Pfenninger, “Dealing with multiple decades of hourly wind andPV time series in energy models: A comparison of methods toreduce time resolution and the planning implications of inter-annualvariability,” Applied Energy, vol. 197, pp. 1 – 13, 2017. [Online].Available: https://doi.org/10.1016/j.apenergy.2017.03.051

[12] A. Greenhall and R. Christie, “Minpower: A power systemsoptimization toolkit,” in 2012 IEEE Power and Energy SocietyGeneral Meeting, July 2012, pp. 1–6. [Online]. Available: https://doi.org/10.1109/PESGM.2012.6344667

[13] C. E. Murillo-Sanchez, R. D. Zimmerman, C. L. Anderson, and R. J.Thomas, “Secure planning and operations of systems with stochasticsources, energy storage and active demand,” IEEE Transactionson Smart Grid, vol. 4, pp. 2220–2229, 2013. [Online]. Available:https://doi.org/10.1109/TSG.2013.2281001

[14] S. Hilpert, S. Gunther, C. Kaldemeyer, U. Krien, G. Plessmann,F. Wiese, and C. Wingenbach, “Addressing energy system modellingchallenges: The contribution of the open energy modellingframework (oemof),” Preprints, 2017. [Online]. Available: https://doi.org/10.20944/preprints201702.0055.v1

[15] M. Howells, H. Rogner, N. Strachan, C. Heaps, H. Huntington,S. Kypreos, A. Hughes, S. Silveira, J. DeCarolis, M. Bazillian, andA. Roehrl, “Osemosys: The open source energy modeling system: Anintroduction to its ethos, structure and development,” Energy Policy,vol. 39, no. 10, pp. 5850 – 5870, 2011, sustainability of biofuels.[Online]. Available: https://doi.org/10.1016/j.enpol.2011.06.033

[16] Energy Exemplar, “PLEXOS,” http://energyexemplar.com/, 2017.[17] H. G. Svendsen and O. C. Spro, “PowerGAMA: A new simplified

modelling approach for analyses of large interconnected powersystems, applied to a 2030 Western Mediterranean case study,”Journal of Renewable and Sustainable Energy, vol. 8, no. 5,p. 055501, 2016. [Online]. Available: http://dx.doi.org/10.1063/1.4962415

[18] “The PRIMES Model,” http://www.e3mlab.ntua.gr/, NTUA, Tech.Rep., 2009.

[19] R. Loulou, U. Remne, A. Kanudia, A. Lehtila, and G. Goldstein,“Documentation for the TIMES Model - PART I 1–78,” ETSAP,Tech. Rep., 2005. [Online]. Available: http://iea-etsap.org/index.php/documentation

[20] J. Dorfner, M. Dorfner, S. Candas, S. Muller, Y. Ozsahin, T. Zipperle,S. Herzog, Icedkk, and WYAUDI, “urbs: v0.6,” Aug. 2016. [Online].Available: https://doi.org/10.5281/zenodo.60484

Page 10: PyPSA: Python for Power System Analysis · PDF filePyPSA: Python for Power System Analysis Tom Brown, Jonas Horsch, David Schlachtberger¨ Frankfurt Institute for Advanced Studies,

[21] “GNU General Public Licence,” Free Software Foundation. [Online].Available: http://www.gnu.org/licenses/gpl.html

[22] S. Pfenninger, J. DeCarolis, L. Hirth, S. Quoilin, and I. Staffell, “Theimportance of open data and software: Is energy research laggingbehind?” Energy Policy, vol. 101, pp. 211 – 215, 2017. [Online].Available: https://doi.org/10.1016/j.enpol.2016.11.046

[23] S. Pfenninger, “Energy scientists must show their workings,”Nature, vol. 542, p. 393, 2017. [Online]. Available: https://doi.org/10.1038/542393a

[24] “Python for Power System Analysis (PyPSA) GitHub Repository.”[Online]. Available: https://github.com/PyPSA/PyPSA

[25] T. Brown, J. Horsch, and D. Schlachtberger, “Python for PowerSystem Analysis (PyPSA) Version 0.11.0,” Oct. 2017. [Online].Available: https://doi.org/10.5281/zenodo.1034551

[26] ——, “Python for Power System Analysis (PyPSA) Website.”[Online]. Available: https://pypsa.org/

[27] “Python for Power System Analysis (PyPSA) Forum.” [Online].Available: https://groups.google.com/forum/#!forum/pypsa

[28] J. G. Dedecca, R. A. Hakvoort, and P. M. Herder, “Transmissionexpansion simulation for the European Northern Seas offshoregrid,” Energy, vol. 125, pp. 805 – 824, 2017. [Online]. Available:https://doi.org/10.1016/j.energy.2017.02.111

[29] T. Brown, D. Schlachtberger, A. Kies, and M. Greiner, “Sectorcoupling in a simplified model of a highly renewable European energysystem,” in Proceedings of 15th Wind Integration Workshop, 2016.

[30] J. Horsch, H. Ronellenfitsch, D. Witthaut, and T. Brown, “LinearOptimal Power Flow Using Cycle Flows,” ArXiv e-prints, Apr. 2017.[Online]. Available: https://arxiv.org/abs/1704.01881

[31] D. Schlachtberger, T. Brown, S. Schramm, and M. Greiner, “Thebenefits of cooperation in a highly renewable European electricitynetwork,” Energy, vol. 134, pp. 469 – 481, 2017. [Online]. Available:https://doi.org/10.1016/j.energy.2017.06.004

[32] J. Horsch and T. Brown, “The role of spatial scale in jointoptimisations of generation and transmission for European highlyrenewable scenarios,” in Proceedings of 14th International Conferenceon the European Energy Market (EEM 2017), 2017. [Online].Available: https://arxiv.org/abs/1705.07617

[33] M. Groissbock and A. Gusmao, “Impact of high renewablepenetration scenarios on system reliability: two case studies in theKingdom of Saudi Arabia,” ArXiv e-prints, Sep. 2017. [Online].Available: https://arxiv.org/abs/1709.03761

[34] J. G. Dedecca, “Mixed integer modification of the PyPSA package,”2017, https://github.com/jdedecca/MILP PyPSA.

[35] “open eGo GitHub Repository,” 2017. [Online]. Available: https://github.com/openego

[36] K. Heuck, K.-D. Dettmann, and D. Schulz, Elektrische Energiever-sorgung, 9th ed. Berlin Heidelberg New York: Springer-Verlag, 2013.

[37] B. Oswald and D. Oeding, Elektrische Kraftwerke und Netze., 6th ed.Berlin Heidelberg New York: Springer-Verlag, 2004.

[38] B. Oswald, “Vorlesung Elektrische Energiever-sorgung I: Skript Transformatoren,” 2005. [On-line]. Available: http://antriebstechnik.fh-stralsund.de/1024x768/Dokumentenframe/Versuchsanleitungen/EMA/Trafo.pdf

[39] J. J. Grainger and W. D. Stevenson Jr., Power System Analysis. NewYork: McGraw-Hill, 1994.

[40] K. Purchala, L. Meeus, D. V. Dommelen, and R. Belmans, “Usefulnessof DC power flow for active power flow analysis,” in IEEE PowerEngineering Society General Meeting, June 2005, pp. 454–459 Vol.1. [Online]. Available: https://doi.org/10.1109/PES.2005.1489581

[41] B. Stott, J. Jardim, and O. Alsac, “Dc power flow revisited,” IEEETrans. Power Syst., vol. 24, no. 3, p. 1290, 2009. [Online]. Available:https://doi.org/10.1109/TPWRS.2009.2021235

[42] D. Kleinhans, “Towards a systematic characterization of the potentialof demand side management,” ArXiv e-prints, Jan. 2014. [Online].Available: https://arxiv.org/abs/1401.4121

[43] S. Hagspiel, C. Jagemann, D. Lindenburger, T. Brown, S. Chere-vatskiy, and E. Troster, “Cost-optimal power system extension underflow-based market coupling,” Energy, vol. 66, pp. 654–666, 2014.[Online]. Available: https://doi.org/10.1016/j.energy.2014.01.025

[44] L. Bahiense, G. C. Oliveira, M. Pereira, and S. Granville, “A mixedinteger disjunctive model for transmission network expansion,” IEEETransactions on Power Systems, vol. 16, no. 3, pp. 560–565, Aug2001. [Online]. Available: https://doi.org/10.1109/59.932295

[45] S. N. Petrovic and K. B. Karlsson, “Residential heat pumps in thefuture Danish energy system,” Energy, vol. 114, pp. 787 – 797, 2016.[Online]. Available: https://doi.org/10.1016/j.energy.2016.08.007

[46] B. Wollenberg and A. Wood, Power Generation, Operation, andControl. John Wiley & Sons, 1996.

[47] A. Trias, “The holomorphic embedding load flow method,” in Powerand Energy Society General Meeting, 2012 IEEE, July 2012, pp. 1–8.

[48] S. P. Vera, “Gridcal,” 2017, https://github.com/SanPen/GridCal.[49] “Python programming language, version 3.5,” https://www.python.

org/, 2017.[50] W. McKinney, “Data structures for statistical computing in Python,”

in Proceedings of the 9th Python in Science Conference, 2010, pp.51–56. [Online]. Available: http://conference.scipy.org/proceedings/scipy2010/mckinney.html

[51] S. van der Walt, S. C. Colbert, and G. Varoquaux, “The NumPyarray: A structure for efficient numerical computation,” Computingin Science & Engineering, vol. 13, pp. 22–30, 2011. [Online].Available: https://doi.org/10.1109/MCSE.2011.37

[52] E. Jones, T. Oliphant, P. Peterson et al., “SciPy: Open source scientifictools for Python,” 2001–. [Online]. Available: http://www.scipy.org/

[53] W. E. Hart, J.-P. Watson, and D. L. Woodruff, “Pyomo: modelingand solving mathematical programs in Python,” MathematicalProgramming Computation, vol. 3, no. 3, pp. 219–260, 2011.[Online]. Available: https://doi.org/10.1007/s12532-011-0026-8

[54] W. E. Hart, C. Laird, J.-P. Watson, and D. L. Woodruff, Pyomo–optimization modeling in python. Springer Science & BusinessMedia, 2012, vol. 67. [Online]. Available: https://doi.org/10.1007/978-1-4614-3226-5

[55] F. Perez and B. E. Granger, “IPython: A System for InteractiveScientific Computing,” Computing in Science & Engineering, vol. 9,pp. 21–29, 2007. [Online]. Available: https://doi.org/10.1109/MCSE.2007.53

[56] J. D. Hunter, “Matplotlib: A 2d graphics environment,” Computing inScience & Engineering, vol. 9, pp. 90–95, 2007. [Online]. Available:https://doi.org/10.1109/MCSE.2007.55

[57] P. T. Inc. (2015) Collaborative data science. Montreal, QC. [Online].Available: https://plot.ly

[58] H. Krekel et al., “pytest,” 2017. [Online]. Available: https://pytest.org/[59] C. Josz, S. Fliscounakis, J. Maeght, , and P. Panciatici, “Data

in MATPOWER and QCQP Format: iTesla, RTE Snapshots,and PEGASE,” ArXiv e-prints, Mar. 2016. [Online]. Available:https://arxiv.org/abs/1603.01533

[60] T. A. Davis, “Algorithm 832: Umfpack v4.3—an unsymmetric-patternmultifrontal method,” ACM Trans. Math. Softw., vol. 30, no. 2, pp.196–199, Jun. 2004. [Online]. Available: http://doi.acm.org/10.1145/992200.992206

[61] S. K. Lam, A. Pitrou, and S. Seibert, “Numba: A llvm-basedpython jit compiler,” in Proceedings of the Second Workshop onthe LLVM Compiler Infrastructure in HPC, ser. LLVM ’15. NewYork, NY, USA: ACM, 2015, pp. 7:1–7:6. [Online]. Available:http://doi.acm.org/10.1145/2833157.2833162

[62] D. Schlachtberger, T. Brown, S. Schramm, and M. Greiner,“Supplementary Data: The Benefits of Cooperation in a HighlyRenewable European Electricity Network,” Jun. 2017. [Online].Available: https://doi.org/10.5281/zenodo.804338

[63] C. Matke, W. Medjroubi, and D. Kleinhans, “SciGRID - An OpenSource Reference Model for the European Transmission Network(v0.2),” Jul. 2016. [Online]. Available: http://www.scigrid.de

[64] B. Wiegmans, “GridKit extract of ENTSO-E interactive map,” Jun.2016. [Online]. Available: https://doi.org/10.5281/zenodo.55853

[65] ——, “Improving the topology of an electric networkmodel based on open data,” Master’s thesis, Energy andSustainability Research Institute, University of Groningen,2015. [Online]. Available: https://www.scigrid.de/publications/161 BWiegmans Master Thesis 2015.pdf

[66] “ENTSO-E Interactive Transmission System Map,” Jan. 2016.[Online]. Available: https://www.entsoe.eu/map/Pages/default.aspx

[67] J. Horsch, F. Hofmann, D. Schlachtberger, and T. Brown, PyPSA-Eur:An open optimization model of the European transmission system,

2017, in preparation.