Skip to content

gincrement/PyPSA-X

Repository files navigation

PyPSA-X - PyPSA for PtX and micro-grid (µ-grid) projects

PyPSA-X is an open-source Python framework for optimizing and simulating power-to-anything (PtX) projects as well as micro-grid projects. It builds on top of PyPSA which comes with the following main features:

  • Economic Dispatch (ED, production cost modelling),
  • Linear Optimal Power Flow (LOPF),
  • Security-Constrained LOPF (SCLOPF),
  • Capacity Expansion Planning (CEP),
  • Pathway Planning,
  • Stochastic Optimisation,
  • Modelling-to-Generate-Alternatives (MGA),
  • Static Power Flow Analysis, and
  • Sector-Coupling.

Especially the sector-coupling feature is of interest for PyPSA-X which is made for project developers, and industry needing an easy-to-use and transparent tool for power-to-X power and energy system analysis.

For further information about PyPSA please check its extensive documentation with tutorials, user guides, examples and an API reference.

Features

  • marginal background cost: add marginal costs of operation towards the objective function without having them as part of the overall investment and operational costs;
  • link technology operation: link technology operation to ensure proper operation of e.g., electrolyzers on green electricity only;
  • limit hourly operation: limit the hourly operation of several technology options compared with another technology size (e.g., green and grey power purchase and a transformer station);
  • link of technology capacity: link the capacity of technologies (e.g., storage charger is equal to storage discharger);
  • shared technology potential: limit the expansion of technologies based on a joined limitation (e.g., different wind turbines with a land limitation);
  • forced technology capacity: force the capacity built to be above or below a certain value (e.g., at least 100 MW of any wind turbine technology);
  • strict un-simultaneous operation: make sure that 2 technology options can’t operate at the same time (e.g., dis-/charging);
  • minimum load if in operation: limits the operation of a technology to a given value as minimum operation, but no operation is allowed;
  • investment if installed: consider an investment if a technology option is selected (e.g, cost for ground preparation);
  • minimum capacity if installed: limits new installed capacity with a lower value, but does not force the installation of this capacity;
  • modular representation: represents each technology option as individual module instead of collection of multiple units;
  • time series aggregation: determines typical operation periods or decreases the temporal resolution to accelerate model optimization or experiment runs.
  • run scenarios: adjust individual settings between different optimization runs (e.g,. different investment costs, different technology options);
  • simulation after optimization: runs a rolling horizon optimization after an successful optimization for a more accurate operational behavior.
  • consider retirement gains: allow retirement of technology which decreases the annual maintenance cost;
  • reserve margin: adds a preliminary version of operational reserve considerations;
  • limit operation: option to limit the operation of e.g., emergency technology towards a predefined number of hours (e.g., 3 h/a);

Installation

Clone the Repository

First of all, clone the PyPSA-X repository using the version control system git in the command line or download the ZIP file from the GitHub server manually.

git clone https://github.com/gincrement/PyPSA-X

Install Python Dependencies

PyPSA-X relies on a set of other Python packages to function. We manage these using pixi. Once pixi is installed, you can activate the project environment for your operating system and have access to all the PyPSA-X dependencies from the command line:

pixi shell

Usage

python pypsa-x.py AB_rev1.xls

This executes the PyPSA-X script and reads the assumption book 'AB_rev1.xls' and follows the configuration within the worksheets opt_params, and scen_params. The sheet opt_params contains options to guide the PyPSA-X script (e.g., target folder to store the results; OETC settings). The sheet scen_params contains options of which variables to change between the optimization of different scenarios.

Dependencies

PyPSA-X relies heavily on other open-source Python packages. The most important once are:

  • PyPSA for optimizing and simulating modern power and energy systems;
  • linopy for preparing linear optimization problems;
  • pandas for storing data about components and time series.

PyPSA-X can be used with different solvers. For instance, the free solvers such as

or commercial solvers like

Contributing and Support

We strongly welcome anyone interested in contributing to this project. If you have any ideas, suggestions or encounter problems, feel invited to file issues or make pull requests on GitHub.

Licence

Copyright [PyPSA-X Contributors]

PyPSA-X is licensed under the open source MIT License

About

PyPSA used for PtX and Microgrid projects

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages