Welcome to the ESM Python Nairobi repository! This repository contains resources, and documentation related to Energy System Modelling (ESM) using Python, with a focus on the PyPSA (Python for Power System Analysis) library. These materials were used for the ESM Python Nairobi session.
docs/- Detailed write-ups, slides, and additional resources.notebooks/- Jupyter Notebooks with live examples and tutorials.tutorials/- Step-by-step guides covering PyPSA fundamentals and applications.
images/- Screenshots, event photos, and diagrams used in documentation or notebooks.
The notebooks/tutorials/ directory contains the following guides:
01_getting_started.ipynb: Introduces PyPSA, basic network creation, components, power flow, and visualization.02_components_basics.ipynb: Covers the core PyPSA components (Bus, Generator, Load, Line, Store, etc.) and their configuration.03_network_visualization.ipynb: Demonstrates static and interactive network plotting, including geographic maps withcartopy.04_basic_optimization.ipynb: Explains different optimization types: Power Flow (PF), Linear Optimal Power Flow (LOPF), and Investment Optimization.05_investment_planning.ipynb: Details multi-period investment planning, costs, discount rates, and capacity expansion.06_storage_and_balancing.ipynb: Focuses on modelling various storage types (electrical, thermal, hydrogen) and demand-side management.07_sector_coupling.ipynb: Covers integrating power, heat, transport demand, and hydrogen sectors using coupling technologies.08_diy_solar_simulation.ipynb: A practical example modelling a small Solar Home System (SHS) with PV and battery.
-
Clone the repository:
git clone https://github.com/tinegachris/ESM-Python-Nairobi.git cd ESM-Python-Nairobi -
Install dependencies: Ensure you have Python installed. Then, install the required packages using pip:
pip install -r requirements.txt
-
Run the notebooks: Navigate to the
notebooks/tutorials/directory and launch Jupyter Lab or Jupyter Notebook:jupyter notebook
Then open the desired
.ipynbfile to start exploring.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit pull requests or open issues.
If you have questions about the materials, feel free to raise an issue in this repository.
