# EnergyLab Introduction to PyPSA

Welcome to the introductory course on PyPSA for EnergyLab! This course provides hands-on training and practical examples for energy system modelling using PyPSA (Python for Power System Analysis).

## About This Course

Through interactive lessons and examples, you will learn how to:

- Build and analyze energy system models
- Work with network components (buses, generators, loads, lines, links)
- Import and export network data
- Optimize power system operations
- Visualize and interpret results

## Course Materials

The course includes interactive Jupyter notebooks that you can run in Google Colab or locally on your computer. Each lesson builds on previous concepts and includes practical examples.

Access the accompanying presentation at this link. 


[![Download PDF from GitHub](https://img.shields.io/badge/Download%20PDF-GitHub-black?logo=github)](https://priyeshgosai.github.io/energylab-intro-pypsa/intro.html)

## Contact

<div style="display: flex; align-items: center; justify-content: space-between; gap: 30px;">
  <div>
    <h3 style="margin-top: 0;">Instructor</h3>
    <p style="margin: 5px 0; font-size: 20px;"><strong>Priyesh Gosai</strong></p>
    <hr style="margin: 12px 0; border: none; border-top: 1px solid #ccc;">
    <p style="margin: 6px 0; font-size: 13px;"><a href="mailto:priyesh@innovateimpact.com">priyesh@innovateimpact.com</a></p>
    <p style="margin: 6px 0; font-size: 13px;"><a href="https://www.linkedin.com/in/gosaip/">LinkedIn</a> | <a href="https://github.com/PriyeshGosai">GitHub</a></p>
  </div>
  <div style="display: flex; align-items: center; gap: 20px;">
    <img src="img/ccg_logo.png" height="60" alt="CCG">
    <img src="img/energy-lab-logo.png" height="60" alt="Energy Lab">
    <img src="img/I4I%20Logo%202%20narrow%20(PNG).png" height="60" alt="I4I">
  </div>
</div>



## Getting Started

### Option 1: Google Colab (Recommended for Beginners)

You can run the notebooks directly in your browser using Google Colab. Click the rocket icon at the top of any lesson page and select "Colab" to get started. This requires a Google account but no local installation.

### Option 2: Local Installation

To run the notebooks locally:

1. **Clone this repository:**
   ```bash
   git clone https://github.com/PriyeshGosai/energylab-intro-pypsa.git
   cd energylab-intro-pypsa
   ```

2. **Install dependencies:**
   ```bash
   pip install -r requirements.txt
   ```

3. **Launch Jupyter Lab:**
   ```bash
   jupyter lab
   ```

## Course Contents

This course consists of multiple lessons covering different aspects of PyPSA:

- **Exercise 1:** Getting started with PyPSA
- **Exercise 2:** Capacity Expansion Planning 
- **Exercise 3:** Hydro, Scheduling and Dispatch

Each lesson includes:
- Conceptual explanations
- Code examples
- Hands-on exercises
- Visualization tools

## Resources

- **PyPSA Documentation:** [https://pypsa.org](https://pypsa.org)
- **PyPSA-Earth:** [https://github.com/pypsa-meets-earth](https://github.com/pypsa-meets-earth)
- **Course Repository:** [https://github.com/PriyeshGosai/energylab-intro-pypsa](https://github.com/PriyeshGosai/energylab-intro-pypsa)


## Further Learning
- [Post by Dr. Max Parzen on OpenMod](https://forum.openmod.org/t/getting-started-with-energy-system-modelling-free-courses-tips/5360)
- [Data Science for Energy System Modelling](https://fneum.github.io/data-science-for-esm/intro.html)
- [Integrated Energy Grids course](https://martavp.github.io/integrated-energy-grids/intro.html)


## License

This course material is open source and available for educational purposes.

---

Ready to get started? Navigate to Lesson 1 using the sidebar or the links above!
