PyPSA-VGR
VGR
Renewable capacity planner for VΓ€stra GΓΆtaland. Uses PyPSA optimization to determine the solar, wind, and storage mix needed to meet future demand.
What do we need to build? PyPSA-based optimization to plan renewable capacity (solar, wind, storage) with weather-informed modeling.
A reusable framework for the Generation tool is on the roadmap but not yet funded. PyPSA-VGR currently exists as a full implementation. The code is open source and can be cloned directly.
A reusable framework for the Generation tool is not yet funded. PyPSA-VGR currently exists as a standalone implementation. Contact us if you are interested in funding a framework extraction.
config (JSON) β Scenarios, financial assumptions, geography
β
βΌ
Generator (PyPSA) β Weather data + demand + optimization model
β
βΌ
Output (CSV/NetCDF) β Capacity plans, costs, generation profiles
β
βΌ
API (file-based) β Local filesystem or HTTP server
β
βΌ
Dashboard (Streamlit) β Scenario exploration, capacity mix, LCOE analysisThe generator uses PyPSA (Python for Power System Analysis) to find the optimal renewable capacity mix. Given a demand profile, weather data, and technology cost assumptions, it determines how much solar, wind, battery storage, and hydrogen capacity is needed to meet demand under different self-sufficiency targets.
Builds a power system network with buses for load, renewables, battery, hydrogen, and turbines. Links model charge/discharge, electrolysis, and gas turbines. Optimizes for minimum cost subject to self-sufficiency and biogas constraints.
Uses ERA5 reanalysis data at 3-hour resolution to compute solar and wind capacity factors. Atlite handles land-cover exclusions using CORINE classification for realistic available area estimates.
Configuration defines a scenario space across self-sufficiency targets (50β100%), energy demand variations (-20% to +20%), hydrogen options, offshore wind toggles, and biogas limits. The generator validates and runs all combinations.
Comprehensive cost assumptions from 2020β2050 with multi-currency support (EUR, USD, SEK), present value calculations, and technology learning curves. Covers solar, onshore/offshore wind, battery, hydrogen electrolysis, nuclear, and biogas.
The API layer abstracts over the storage backend through a unified interface. The same dashboard code reads scenario data from the local filesystem during development or from any HTTP-accessible store in production.
A Streamlit application with interactive scenario controls and energy system visualizations. Designed for three audience levels.
Slider controls for self-sufficiency targets and energy scenarios. Toggle hydrogen, offshore wind, and biogas limits. Bookmarkable URLs preserve parameter state.
Energy metric cards showing capacity per technology. Stacked bar charts for generation mix at weekly resolution. LCOE breakdown by energy source. Performance metrics showing met/unmet demand.
Interactive map with Folium for regional selection. Land use comparison showing physical footprint of renewable installations relative to municipal areas.
Technical reference for implementers. Expand the section below for model internals, scenario configuration, input data structure, and deployment details.
/pypsa-vgr/
βββ model/ # Core PyPSA modeling (network, constraints, assumptions)
βββ generator/ # Scenario execution pipeline
βββ input/ # All input data
β βββ assumptions.csv # Technology costs 2020-2050
β βββ demand/ # Historical demand data (3h resolution)
β βββ weather/ # ERA5 weather data and capacity factors
β βββ renewables/ # Renewable resource assessment
β βββ geo/ # Geographic boundaries and land use
βββ api/ # Output data directory
βββ dashboard/ # Streamlit frontend
βββ workspace/ # Analysis Jupyter notebooks
βββ paths.py # Central path configuration
βββ environment.yaml # Conda environment specification The generator runs a sequential pipeline for each scenario combination:
Scenarios are defined in JSON configuration files with these parameters:
| Parameter | Range | Description |
|---|---|---|
| Self-sufficiency | 50β100% (11 levels) | Target for local generation vs imports |
| Energy scenario | -20% to +20% (3 levels) | Demand variation from base projection |
| Hydrogen | on/off | Include hydrogen electrolysis and storage |
| Offshore wind | on/off | Include offshore wind capacity |
| Biogas limit | 0%, 25%, 50%, 100% | Maximum biogas share of total demand |
The generator validates scenario counts (warns >10,000, blocks >50,000) before execution.
Comprehensive cost and performance data from 2020β2050 in input/assumptions.csv. Key technologies and their 2020 costs:
| Technology | Capital Cost (2020) | Lifetime |
|---|---|---|
| Solar PV | β¬560k/MW | 25β40 years |
| Onshore Wind | β¬1.1β1.2M/MW | 25β30 years |
| Offshore Wind | β¬2.12M/MW | 25β30 years |
| Battery Storage | β¬246k/MWh | 20β30 years |
| H2 Electrolysis | β¬1.3M/MWe | 25 years |
| Page | Content |
|---|---|
| Explorer | Main scenario exploration with charts, cards, and maps |
| About | Project description (Markdown, bilingual) |
| Assumptions | Technology costs and land use data tables |
The dashboard's library/api.py abstracts over the storage backend behind a unified interface. The local filesystem backend is used for development; the HTTP-server backend lets the dashboard read scenario data from any HTTP-accessible store in production.
Live applications built with the Generation tool.
VGR
Renewable capacity planner for VΓ€stra GΓΆtaland. Uses PyPSA optimization to determine the solar, wind, and storage mix needed to meet future demand.
The Generation tool deploys as a Docker container running the Streamlit dashboard. Run it on any container platform; scenario data can be served from the local filesystem or any HTTP-accessible store.
# Build and run locally
docker build -t pypsa-vgr .
docker run -p 8501:8501 pypsa-vgr
# Or run directly
streamlit run dashboard/app.py