Repository navigation
Conversation
…uture cost of their water, as the UCBlock of a stage of an SDDPBlock wants them (hydro_system, off by default)
…ydro_inflow, reach its HydroUnitBlock inside the HydroSystemUnitBlock when hydro_system is set
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.
The UCBlock of a stage of an SDDPBlock has its hydro units inside a HydroSystemUnitBlock, whose PolyhedralFunctionBlock is the future cost of their water, i.e., the function whose cuts SDDP builds (
UnitBlock_0oftools/sddp_solver/examples/Block_0.nc4in SMS++); pypsa2smspp wrote each hydro StorageUnit as a HydroUnitBlock of its own in the UCBlock, so that a stage could not be written from a PyPSA network.With$-\infty$ and the problem is unbounded (as is the SDDP example, solved alone); 0 is a valid bound only where the costs of the later stages are nonnegative. The option refuses an extendable hydro unit and a non-hydro StorageUnit placed after the hydro ones.
Transformation(..., hydro_system=True)(off by default, asnuclear_units) all the hydro units go into a single HydroSystemUnitBlock, together with an empty PolyhedralFunctionBlock: a single one for all, since the future value of the water depends on the volumes of all the reservoirs together, and one per unit would make it separable. The HydroSystemUnitBlock is the last unit of the UCBlock rather than the first, so that the indices of the other units, and the paths into them, stay those of today. The DataMappings of a stochastic parameter of a hydro unit (e.g.,hydro_inflow) reach its HydroUnitBlock inside the HydroSystemUnitBlock, through the pathOBBBof the SDDP example, and the solution of the hydro units is read back from it. The PolyhedralFunctionBlock has the lower boundPolyFunction_lb = 0(HydroSystemUnitBlock_parametersintransformation_config.py), since without cuts and without a bound it isWith the option off the files written are byte for byte those of
main. On the two test networks with a hydro unit the optimum with the option on is the one of PyPSA and of the option off, within 1e-6 relative, deterministic and as a TSSB with stochastic inflows:A MILPSolver needs the PolyhedralFunctionBlock in its linearized form, which the BlockConfig
InnerBCfg.txtasks for: for a UCBlock, SPSUnipi/pySMSpp#126 ships it in theUCBlocktemplates, read bysmspp_ucblock_solverby default; for a TSSB, theTSSBlock/InnerBCfg.txtof SPSUnipi/pySMSpp#116 has the entry, given withpysmspp_options={"B": "InnerBCfg.txt"}. Until then the tests take the configuration installed with the tool, and are skipped where there is none. A stage written with the option has not been run insmspp_sddp_solveryet, nor the option inside a MultiStageStochasticBlock.