Skip to content

chalg/pypsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

High‑Level NEM PyPSA Model

A concise, five‑node PyPSA model of the Australian National Electricity Market (NEM), designed for learners and stakeholders exploring energy transition scenarios.


Table of Contents


Overview

The High‑Level NEM model provides a baseline representation of the NEM’s five regions (one bus per region) at 30-minute resolution, using actual 2024 generation and demand data. It enables:

  • Analysis of current dispatch and grid topology
  • Exploration of high‑renewable scenarios with storage
  • Visualisation of network topology, generation mix, dispatch and curtailment
  • Streamlit web app for interactive scenario analysis
Scenario dispatch
Scenario dispatch example

Intended Audience:

  • Students and professionals learning power system modelling
  • Energy analysts and policy researchers interested in the Australian grid
  • Anyone curious about the electricity transition and renewable integration

Features

  • 5‑bus network representing NSW, QLD, SA, TAS, VIC
  • 30-min time series for loads and generator availability
  • Baseline vs. Future Scenarios: easily swap in higher VRE/storage capacities
  • Optimisation via linear programming (HiGHS/Gurobi)
  • Interactive & static plots of dispatch, imports/exports, and curtailment
  • Exportable to NetCDF for external tools

Directory Structure

.
├───data
│   ├───inputs                          # Assumption tables
│   └───nemweb                          # NEMWeb extracts
│       ├───clean
│       └───raw
│   
├───docs                                # Built site & assets for html report
│   ├───High-level_NEM_files
│   │   ├───figure-html
│   │   └───libs
│   │       ├───bootstrap
│   │       ├───clipboard
│   │       └───quarto-html
│   └───images
├───gifs
├───results                             # Output results from generate_scenarios()
│   └───scenarios                       # Scenario netCDF + summaries 
│       └───hydro_marginal_price_8.58   # Scenario with non-zero hydro
└───scripts                             # Data prep & rendering helper
   


Prerequisites

  • Python 3.10+
  • PyPSA
  • pypsa, pandas, numpy, matplotlib, cartopy, datetime, great_tables
  • (Optional) Gurobi solver (requires license)

  1. Input Data

    • Components: generators.csv, buses.csv, loads.csv, lines.csv, links.csv, storage_units.csv
    • Time series: loads_t.p_set.csv, generators_t.p_max_pu.csv

Usage

  1. Run the Quarto document

    Open High-level_NEM.qmd in Quarto and run cells, or render to HTML by running quarto_to_html_render.py, or:

  2. Walk through sections

    • Data Import & Preprocessing
    • Network Construction (buses, loads, generators, storage, lines/links)
    • Optimisation (Solve the network)
    • Visualisation (senario analysis) (plot_dispatch examples for static & interactive plots (plotly) and the great_tables package for variable renewable curtailment analysis)

Customization & Scenarios

  • Adjust capacities: edit generators.csv or use the scenario function to scale VRE/storage.
  • Temporal window: call plot_dispatch(n, time="YYYY-MM-DD", days=N, regions=[…]).
  • Solver choice: switch between HiGHS (default) and Gurobi in the optimisation cell.

Key References:

View Quarto rendered HTML

A High-level Open Source Model for the Australian National Electricity Market (NEM)

Note: I'm rendering a single html file (with asssociated assets), which I'm renaming and moving to the docs/ directory via the qaurto_to_html_render.py script. I'm not creating a full website and my project type is not Website Project. Quarto website and web app are best viewed on a larger screen (not mobile phone).

Using quarto render High-level_NEM.qmd --to html will render the Quarto document to HTML in the root directory - however I need it to be in the docs/ directory so that it can be served by GitHub Pages.

About

A concise, five‑node PyPSA model of the Australian National Electricity Market (NEM), designed for learners and stakeholders exploring energy transition scenarios.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages