PyPSA workflow on SciGrid-DE: rolling linear OPF, plots (dispatch, loading, LMPs, curtailment), then AC power flow after fix_optimal_dispatch. Follows the official example with inline comments; maps use geomap=False (no Cartopy).
Reference: SciGRID LOPF then PF
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtFirst run downloads the SciGrid example network (~tens of MB) into PyPSA’s cache.
| File | Purpose |
|---|---|
scigrid.py |
Full pipeline + figures (scigrid_*.png). Full day can take several minutes. |
toy_network.py |
Small 3-bus congestion / LMP example. |
git init
git add .
git commit -m "Initial commit: SciGrid LOPF + AC PF workflow"
git remote add origin https://github.com/mohamedkhalifa9/scigrid-optimization-powerflow.git
git branch -M main
git push -u origin main