Skip to content

Store and hydro turbine written as PyPSA states them - #70

Open
dmeoli wants to merge 16 commits into
SPSUnipi:mainfrom
dmeoli:feature/store-and-hydro-as-pypsa
Open

dmeoli wants to merge 16 commits into
SPSUnipi:mainfrom
dmeoli:feature/store-and-hydro-as-pypsa

Conversation

@dmeoli

@dmeoli dmeoli commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

This PR makes the linear program that SMS++ solves for a PyPSA network the same as the one PyPSA gives Gurobi, by writing two components as PyPSA states them. It builds on #62 and needs SMS++ develop (UCBlock 390e5605 and ff5c1706, pySMSpp #116 6696b4a), hence it is to be merged after the next release of SMS++ reaches conda-forge.

A Store has no power limit of its own in PyPSA, its power being bounded by its levels and by the Links around it. pypsa2smspp wrote it as a BatteryUnitBlock with MaxPower = 1 and MinPower = -1 per unit of the design (i.e., |p| <= e_nom), which the levels already imply, and with ConverterInvestmentCost = 1e-12, i.e., a converter design that PyPSA does not have, together with its rows and its path in the first stage. A Store is now written with MaxPower = +inf, MinPower = -inf, no converter design and ConverterMaxPower = 0 (no converter limit); with UCBlock ff5c1706 an infinite power bound gives no row in the design, as an infinite level already did.

The turbine of a hydro StorageUnit produces exactly efficiency_dispatch times its flow in PyPSA, the water released without producing being the spillage, a flow of its own. Since UCBlock 297d41b4 HydroUnitBlock writes such a turbine as the inequality p <= rho f unless its spillway can take all the water of the turbine, which is not the case here (the spillage of PyPSA is bounded by the inflow), so that SMS++ solved a relaxation of the model of PyPSA. The turbine is now written with ExactFlowToPower = 1 (UCBlock 390e5605), which keeps the equality; smspp_parameters.xlsx has the new variable.

On th_24c24_demand_{3,20} of power-IT-noUC (20 nodes, stochastic demand, linear program, Gurobi 13 with the barrier options of PyPSA-Eur), the model after the presolve of Gurobi and its work units are

scenarios rows columns nonzeros work units value
3 PyPSA 594348 604972 1.897M 20.60 1.68604e10
3 SMS++ before 837996 701740 2.379M 29.33 1.68604e10
3 SMS++ with this PR 594348 604972 1.901M 20.78 1.68604e10
20 PyPSA 4192720 4722896 13.80M 263.96 1.68024e10
20 SMS++ with this PR 3962320 4722896 13.36M 263.79 1.68025e10

i.e., the model of SMS++ is now that of PyPSA after the presolve (a little smaller on 20 scenarios), with the same value. The tests pass (53 passed, 16 skipped) with SMS++ develop.

…ber of its modules, tested as an xlsx case of the sweep
…teger design too, the number of its modules, and solves it with the BundleSolver of InvestmentBlock/BSPar-int.txt
…AC network into a transport model without Kirchhoff's voltage law
… no capital cost, was fixed at a large capacity before the merge, accepts a preset or a list of presets, and the merged links are read back also per scenario
…ltage law since the lines have their susceptance, is left out where the solver is a released SMS++, whose DCNetworkBlock finds it infeasible
…e scenarios are in the InnerSolution of the InvestmentBlock, and its design goes to every scenario of the asset; tested against PyPSA on a TSSB and an MSSB
…arginal_cost, Cost being a price on the net injection
…ing bounded by its levels and by the Links around it, and the turbine of a StorageUnit with ExactFlowToPower, so that the model of SMS++ is the one of PyPSA
…tive_constant, whose default PyPSA warns about, the FutureWarnings being errors since SPSUnipi#67
…build of SMS++ has not the Solver of its configuration, which asks for GUROBI
…ro-as-pypsa

# Conflicts:
#	pypsa2smspp/data/smspp_parameters.xlsx

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant