Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python for Power Systems Analysis

Project Description

1   About

PyPSA stands for “Python for Power System Analysis”. It is pronounced “pipes-ah”.

PyPSA is a free software toolbox for simulating and optimising modern power systems that include features such as conventional generators with unit commitment, variable wind and solar generation, storage units, sector coupling and mixed alternating and direct current networks. PyPSA is designed to scale well with large networks and long time series.

As of 2017 PyPSA is under heavy development and therefore it is recommended to use caution when using it in a production environment. Some APIs may change - the changes in each PyPSA version are listed in the doc/release_notes.rst.

PyPSA was initially developed by the Renewable Energy Group at FIAS to carry out simulations for the CoNDyNet project, financed by the German Federal Ministry for Education and Research (BMBF) as part of the Stromnetze Research Initiative.

3   What PyPSA does and does not do (yet)

PyPSA can calculate:

  • static power flow (using both the full non-linear network equations and the linearised network equations)
  • linear optimal power flow (optimisation of power plant and storage dispatch within network constraints, using the linear network equations, over several snapshots)
  • security-constrained linear optimal power flow
  • total electricity system investment optimisation (using linear network equations, over several snapshots simultaneously for optimisation of generation and storage dispatch and investment in the capacities of generation, storage and transmission)

It has models for:

  • meshed multiply-connected AC and DC networks, with controllable converters between AC and DC networks
  • standard types for lines and transformers following the implementation in pandapower
  • conventional dispatchable generators with unit commitment
  • generators with time-varying power availability, such as wind and solar generators
  • storage units with efficiency losses
  • simple hydroelectricity with inflow and spillage
  • coupling with other energy carriers
  • basic components out of which more complicated assets can be built, such as Combined Heat and Power (CHP) units, heat pumps, resistive Power-to-Heat (P2H), Power-to-Gas (P2G), battery electric vehicles (BEVs), etc.; each of these is demonstrated in the examples

Functionality that will definitely be added soon:

  • Multi-year investment optimisation
  • Simple RMS simulations with the swing equation
  • Distributed active power slack
  • Non-linear power flow solution using analytic continuation in the complex plane following GridCal

Functionality that may be added in the future:

  • Short-circuit current calculations
  • Dynamic RMS simulations
  • Small signal stability analysis
  • Interactive web-based GUI with SVG
  • OPF with the full non-linear network equations
  • Dynamic EMT simulations
  • Unbalanced load flow
  • Port to Julia

4   Example scripts as Jupyter/iPython notebooks

There are extensive examples available as Jupyter/iPython notebooks. They are also described in the doc/examples.rst and are available as Python scripts in examples/.

5   Screenshots

Optimised capacities of generation and storage for a 95% reduction in CO2 emissions in Europe compare to 1990 levels:

6   What PyPSA uses under the hood

PyPSA is written and tested to be compatible with both Python 2.7 and Python 3.5.

It leans heavily on the following Python packages:

  • pandas for storing data about components and time series
  • numpy and scipy for calculations, such as linear algebra and sparse matrix calculations
  • pyomo for preparing optimisation problems (currently only linear)
  • networkx for some network calculations
  • py.test for unit testing
  • logging for managing messages

The optimisation uses pyomo so that it is independent of the preferred solver (you can use e.g. the free software GLPK or the commercial software Gurobi).

The time-expensive calculations, such as solving sparse linear equations, are carried out using the scipy.sparse libraries.

7   Mailing list

PyPSA has a Google Group forum / mailing list.

8   Citing PyPSA

If you use PyPSA for your research, we would appreciate it if you would cite the following preprint paper (which has not yet been through peer review):

If you want to cite a specific PyPSA version, you can cite the Zenodo DOI for each release, e.g. for the latest release:

9   Licence

Copyright 2015-2017 Tom Brown (FIAS), Jonas Hörsch (FIAS), David Schlachtberger (FIAS)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Release History

Release History

This version
History Node

0.10.0

History Node

0.9.0

History Node

0.8.0

History Node

0.7.1

History Node

0.7.0

History Node

0.6.2

History Node

0.6.1

History Node

0.6.0

History Node

0.5.0

History Node

0.4.2

History Node

0.4.1

History Node

0.4.0

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pypsa-0.10.0.tar.gz (67.5 kB) Copy SHA256 Checksum SHA256 Source Aug 7, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting