Repository navigation
Conversation
…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
…_conversion_units): the input on bus0 with power - p0, an output on each further bus with power efficiency * p0 by equality rows of the operating region, the costs, the commitment, the ramps and the start-up and shut-down ranges of PyPSA; tested against PyPSA on four xlsx cases of the sweep, which are left out where the solver does not know the ConversionUnitBlock
…versionUnitBlock of one MW that the design scales; the ConversionUnitBlock is tested in the TSSB sweep against the optima of the scenarios solved by PyPSA, in an MSSB against those of the leaves, and in the InvestmentBlock sweep against the continuous relaxation of the commitment that the InvestmentFunction solves
…Block in every leaf is tested against the value of its design, the leaves being solved by PyPSA one by one with the commitment relaxed, and against the wait-and-see value, a lower bound, since PyPSA does not build a stochastic network with a committable component
…no line, is tested in the UCBlock sweep and in an MSSB; it is left out where the solver does not solve a network of several nodes with no line, which it does since UCBlock 4892479b
…hat changes over time (an OperatingMatrix over the instants, evaluated at the instant of the delivery as PyPSA does), with delays (in instants of the snapshot weighting, cyclic or not), with modules (p_nom_mod) and, in the UCBlock form, with the design of its extendable capacity (modules built, or MW with the big-M rows); a unit off before the horizon with no down_time_before is off since long enough, as in PyPSA; tested against PyPSA on six xlsx cases, which are left out where the solver does not read these data
…r does not know it, as the xlsx cases are
…ps and start-up and shut-down limits (its continuous design in the big-M form of PyPSA) and on before the horizon (its capacity covering p_init, one module on if it is modular), and in the InvestmentBlock form also if modular (an integer design scaling the unit of one module); tested against PyPSA on four xlsx cases, the InvestmentBlock form of the modular one against the networks with a given number of modules, PyPSA not relaxing a modular commitment
… of a carrier of the UCBlock, a link between two carriers a unit with an output on the carrier of each port (an IntermittentUnitBlock, or the ConversionUnitBlock of a committable link with each generator on the carrier of its bus), the lines and links within a carrier the network of that carrier, with a DesignNetworkBlock if extendable, in the UCBlock, InvestmentBlock, TSSB and MSSB forms; tested against PyPSA in both forms of the buses
…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
…es' into feature/conversion-unit-block
…it-block # Conflicts: # pypsa2smspp/transformation.py # test/conftest.py # test/test_investmentblock.py # test/test_mssb.py
…the same carrier (a pump, a compressor) or with a delay, which a unit with one generator per carrier cannot express, is a ConversionUnitBlock with a generator per port on the node of its bus; a non-committable link is a ConversionUnitBlock always on, with no start-up, shut-down or stand-by cost, and a modular non-committable link is refused; tested against PyPSA on a pump between two nodes of the water carrier, with and without a minimum flow
…it-block The optimizations of PyPSA in the tests of this branch state include_objective_constant, whose default PyPSA warns about, the FutureWarnings being errors since SPSUnipi#78.
…it-block test_tssb: with a committable component the reference stays the sum of the scenarios solved by PyPSA, which builds no stochastic network with one, and otherwise it is the stochastic network solved by PyPSA, as in SPSUnipi#73.
dmeoli
marked this pull request as ready for review
October 30, 2026 12:17
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On main with #73. With the SMS++ of develop of 2026-10-30 (smspp_ucblock_solver, smspp_investmentblock_solver, smspp_tssb_solver, smspp_mssb_solver), PyPSA 1.2.3 and pySMSpp 0.1.0, the whole suite gives 141 passed, 103 skipped (the cases the InvestmentBlock sweep leaves out, and the carrier form of the networks whose buses are all electric), 0 failed.
With the new option
enable_conversion_unitsofTransformation(off by default), a committable Link becomes aConversionUnitBlockof UCBlock: one commitment, one generator per port, each on the node of its bus. The input is a generator on bus0 with power -p0, each output k a generator on bus k with power efficiency_k p0, tied by the rows efficiency_k p_0 + p_k = 0. All the other links, multi-links included, remain (hyper)arcs as before. Time-varying efficiencies (written at the arrival instant), delays (in snapshots, cyclic or not) and modules (p_nom_mod: the commitment counts the modules on) are translated as well. An extendable committable link has a design variable in the UCBlock form (modules built if modular, else a continuous capacity with big-M rows), read back as p_nom_opt; in the InvestmentBlock form it is a 1 MW unit scaled by its design, as a ThermalUnitBlock.The solution is read back as Link-p.
Tests (skipped if the installed SMS++ lacks
ConversionUnitBlock, or for_0lthe network with no line, UCBlock 4892479b):Notes:
intRelaxIntVars 1in the template), hence the linearized UC of PyPSA as reference.Difference: an extendable committable link on before the horizon has, in SMS++, a capacity that covers p_init; PyPSA does not impose it (p_init 380, no ramps: PyPSA builds 300 at 39930.68, SMS++ builds 380 at 62330.68).
Not covered:
Carriers
With the option
multi_carrierofTransformation(off by default), the buses of each carrier of the network are the nodes of a carrier of the UCBlock (UCBlock a84a90a7: "NumberCarriers", "CarrierName", a group "Carrier_c" per carrier, "GeneratorNode" over the generators and the carriers). The AC, DC and carrier-less buses are the electricity, carrier 0; the others are one carrier per bus carrier, H2 being "hydrogen".enable_conversion_units)enable_conversion_units)enable_conversion_unitsboth are refused as beforeThe solution is read back as before, a link between carriers as Link-p, the flows of the lines of every carrier included.
Tests, each against the same reference as the network form (skipped if the installed SMS++ does not read the carriers):
-carriersvariant of the existing testsThe instances of the SMS++ batteries are written in this form too (pypsa-eur-instances
--carriers): the PyPSA-Eur network of the stochastic instances, with 10 carriers and its extendable CO2 pipeline, gives the optimum of PyPSA as MSSB, TSSB and InvestmentBlock over them.Refused with
multi_carrier: a link with two ports on the same carrier, a link between carriers that delays its output and is not committable, andmerge_links.