Two models, the same inputs: how PyPSA and cGrid compare
The study’s results come from cGrid, Quantified Carbon’s model, which is proprietary and closed source. As an independent check of its methodology, the study built a second model in PyPSA, an open-source framework for optimising power systems, and made it open source too.
The two models perform very similarly. That is to be expected in part, as they share the same input, but they work fundamentally differently: cGrid’s non-linear approach with rolling short-term price forecasts is entirely different from the perfect-foresight linear optimisation performed in PyPSA.
Where the two models differ
| cGrid | PyPSA | Report | |
|---|---|---|---|
| Code | Proprietary, closed source | Open source | p.24 |
| How capacity is set | Brownfield adjustment: capacities adjusted iteratively, by each generator’s profitability | Greenfield expansion, then marginal-cost bidding and iterative adjustment | p.119–121 |
| How dispatch is decided | Non-linear; flexible demand and supply follow rolling short-term price forecasts | Linear optimisation with perfect foresight over the year | p.111, 121 |
| Fleets of plants | Respond to price along an s-curve | Respond linearly (quadratic marginal cost) | p.25, 118 |
| Lowest price | −30 €/MWh floor | −500 €/MWh, the curtailment link’s price signal | p.111 |
| Solving | Iterates fast, even on a modest laptop | The study’s runs used Gurobi, a commercial solver | p.120 |
| Shared by both | Demand in every zone, transmission and storage capacities, and capacities outside Denmark are the same exogenous inputs. Only Denmark’s generating capacity and the dispatch of the whole model are optimised. | p.114, 117 | |
Prices
For most hours of the year, prices in the Balanced scenario are very similar in the two models. A few hours in PyPSA drop to −500 €/MWh, the price signal of its curtailment link, while cGrid has a floor of −30 €/MWh. PyPSA spends less time at its lower limit, as its perfect foresight lets it time battery charging around the negative-price hours. In the highest-price hours PyPSA has slightly more, largely due to stronger price signals from neighbouring countries, because of the slack generators there.
Capacity
In the Balanced scenario PyPSA installs 5.6% and 2.7% less capacity than cGrid in DK1 and DK2 (1.3 GW and 0.24 GW), or 4.8% (1.6 GW) for Denmark as a whole. The difference holds across the scenarios: Offshore Balanced shows the largest reduction, 8.0%, and Solar is the one scenario where PyPSA installs more, 5.4%.
The absolute differences are small. That is not unexpected, as capacities outside Denmark, transmission capacities and demand everywhere, Denmark included, are set outside the models.
Data as printed in the report’s Figure 54. Switch between three and seven scenarios at the top of the page.
A pattern shows in the capacity mix: in every scenario cGrid builds about 1–4 GW more wind than PyPSA, and what PyPSA builds instead changes from scenario to scenario. In Balanced almost 3 GW of wind is replaced by just over 1 GW of nuclear. Offshore, Solar and Solar Balanced build mainly solar instead of wind. Offshore Balanced builds less offshore and more nearshore wind; Nuclear Balanced does the opposite on a smaller scale. Nuclear builds less wind than cGrid and nothing in its place.
Positive: more capacity in PyPSA; negative: more in cGrid.
Generation
PyPSA generates between 3.6% and 11.2% less over the year than cGrid, 4.3 to 13.5 TWh depending on the scenario.
Positive: more generation in PyPSA; negative: more in cGrid.
Trade and storage
Both models meet the same demand; PyPSA does it with less capacity and less generation. Crucially, PyPSA has perfect foresight and cGrid does not. Germany, the Netherlands and Great Britain are the largest importers of Danish power in both models, but they import significantly more in cGrid: PyPSA exports 5.5 to 14.9 TWh less, depending on the scenario.
Batteries in Germany, the largest importer of Danish power, cycle more in PyPSA in every scenario. That lowers Germany’s need for imports and, as Denmark is the only zone where capacity can change, leads to less capacity built in Denmark.
Positive: net export from Denmark; negative: net import.
Charging is shown as negative, discharging as positive.
- Despite fundamentally different approaches, cGrid and PyPSA produce broadly similar system configurations, providing a cross-model check of the capacity-expansion results.
- PyPSA exports less power from Denmark than cGrid across all scenarios. This is primarily due to perfect foresight enabling more optimal battery dispatch in neighbouring zones, reducing their need to import Danish-generated power. The residual discrepancy in total generation is sufficiently small to confirm the results are robust to methodology choice.
Insights from the PyPSA cross-model comparison done in this work has illuminated considerable differences with and without profitability requirement and perfect-foresight assumption exemplified through battery storage dispatch model differences.