esc

↑↓ navigate↵ open

Multistage planning · SDDP · Network formulations

HydroPowerModels.jl

Long-horizon hydrothermal planning is solved with stochastic dual dynamic programming, which needs convex stage problems, while the network that is operated is not convex. HydroPowerModels.jl builds the multistage model from network and reservoir data with any PowerModels.jl formulation, and lets the formulation that computes the cuts differ from the formulation that is operated, so the cost of a simplification is measured on the system it simplifies.

Andrew W. Rosemberg · Author, with Alexandre Street, Joaquim Dias Garcia, Thuener Silva, Davi M. Valladão, Oscar Dowson

01 · DesignThe network formulation is an argument, twice

Any network formulation in one multistage model

The package builds an SDDP.jl policy graph whose stage problems are instantiated by PowerModels.jl inside each subproblem, with the network formulation and the problem builder passed as arguments (model_constructor_grid, post_method). The hydro layer is written once on top of whatever network PowerModels returns: reservoir volumes with bounds and violation penalties, turbined outflow and spillage along cascades, sampled inflows, hydro generation tied to the network's generator variables, and load shedding at a deficit cost. The formulations are those of PowerModels.jl, from polar AC power flow and its semidefinite, second-order-cone and quadratic-convex relaxations to the DC approximation, with or without losses, and the network-flow model.

A study of network models then becomes a sweep over one argument: The data, the inflow scenarios, the hydro constraints and the SDDP configuration stay fixed while only the network changes. The policy graph and the network builder are themselves arguments (build_graph, build_opf_model), so discounting, cyclic graphs or a custom grid model enter the same way.

Nested regions: a copper plate region contains a network-flow region, which contains an SOC relaxation, which contains an SDP relaxation, which contains the nonconvex AC feasible set.
Network models ordered by their feasible sets. The AC power-flow set lies inside its semidefinite and second-order-cone relaxations, which lie inside the network-flow and copper-plate models. Approximations such as DC power flow sit outside this order. Any of the PowerModels formulations can be the planning model and any can be the operating model. Schematic.

Cuts on one formulation, operation on another

The planning and operating formulations, and their solvers, are separate parameters: model_constructor_grid_backward and model_constructor_grid_forward, optimizer_backward and optimizer_forward. When they differ, the package builds two policy graphs over the same data. Training runs SDDP with the backward pass on the planning graph, where the cuts are computed, and the forward pass on the operating graph, where the visited states are generated; after each iteration the cuts are copied to the operating graph. Simulation operates the operating graph with those cuts. In the notation of Planning and Realization Mismatch, each operated stage solves

\[\begin{gathered}\min_{\mathbf x_t,\mathbf y_t}\ f(\mathbf x_t,\mathbf y_t)+\widehat{\mathcal V}_{t+1}(\mathbf x_t)\\ \text{s.t.}\quad\mathbf y_t\in\mathcal Y_t^{\mathrm{op}}(\mathbf x_{t-1},\mathbf x_t;w_t),\end{gathered}\]

with the cuts of \(\widehat{\mathcal V}_{t+1}\) computed on \(\mathcal Y^{\mathrm{plan}}\) at the states that operation visits.

The quality of a simplified planning model is the cost it induces on the system that is operated. Measuring that cost requires exactly this pairing, and making it a parameter turns the assessment of any planning model against any operating model into one run.

For each planning network model on a 3-bus loop and a 28-bus system, an open marker for the expected cost under the planning model and a filled marker for the expected cost when the same cuts are operated under AC power flow. The planned costs follow the inclusion order of the relaxations; the operated costs do not.
Planned and operated cost of the policies induced by each planning model, computed with the package. Open marker: expected cost under the planning model; filled marker: expected cost when the same cuts operate the system under AC power flow. Data: Rosemberg et al. (2022), Tables I and II, as on Planning and Realization Mismatch. The order of the planned costs does not survive operation under AC.

A baseline for learned policies

The same pairing is the stochastic dual dynamic programming baseline against which Policies for Multistage Decisions compares trained policies: cuts computed on the second-order-cone relaxation or on the DC approximation, with forward passes and evaluation under AC power flow. The hydro case of DecisionRules.jl reads the package's input format, a PowerModels network file, a reservoir file and an inflow table, so the learned policy and SDDP see identical data.

Solutions in PowerModels' terms

Inputs are a PowerModels network file and a reservoir file, validated against JSON schemas. Each simulated stage returns the PowerModels solution, with generation, flows, voltages and nodal multipliers, together with the reservoir trajectories, so prices and flows are compared across formulations directly. A statistical stopping rule, SimulationStalling, ends training when a t-test cannot distinguish the simulated costs of successive policies.

02 · ExamplePlan on DC power flow, operate under AC

The example below follows the package's three-bus inconsistency example: cuts are computed on the DC approximation with a linear solver, while forward passes and the final simulation run the polar AC model with a nonlinear solver.

using HydroPowerModels, HiGHS, Ipopt

data = HydroPowerModels.parse_folder("testcases/case3")   # PowerModels.json, hydro.json, inflows.csv

params = create_param(;
    stages = 12,
    model_constructor_grid = DCPPowerModel,           # planning: computes the cuts
    model_constructor_grid_forward = ACPPowerModel,   # operation: visits states, realizes costs
    post_method = PowerModels.build_opf,
    optimizer = HiGHS.Optimizer,
    optimizer_forward = optimizer_with_attributes(Ipopt.Optimizer, "tol" => 1e-6),
    stage_hours = 24 * 30,
)

m = hydro_thermal_operation(data, params)
HydroPowerModels.train(m; iteration_limit = 100)
results = HydroPowerModels.simulate(m, 100)              # 100 scenarios operated under AC

results[:simulations][1][1][:objective]                  # stage-1 cost of the first scenario

Dropping the forward arguments plans and operates on the same model. Changing model_constructor_grid to another formulation, such as SOCWRPowerModel with a conic solver, while keeping the AC forward model, gives the next point of the comparison.

03 · ResearchWhere the package carries the theory

  • Planning and Realization Mismatch. The comparison of planning network models under AC operation is a sweep over the planning formulation with the operating formulation held at AC power flow.
  • Policies for Multistage Decisions. The SDDP baselines of the hydrothermal comparison compute cuts on the conic relaxation or the DC approximation and operate under AC power flow, the paired configuration of this package.

04 · CitationHow to cite

The package was developed as part of the author's master's thesis. Its repository asks users to cite the package paper:

@article{rosemberg2019hydropowermodels,
  title   = {HydroPowerModels.jl: A Julia/JuMP Package for Hydrothermal Economic Dispatch Optimization},
  author  = {Rosemberg, Andrew and Street, Alexandre and Garcia, Joaquim Dias and Silva, Thuener and Vallad{\~a}o, Davi and Dowson, Oscar},
  journal = {JuliaCon Proceedings},
  volume  = {1},
  number  = {1},
  pages   = {35},
  year    = {2019},
  doi     = {10.21105/jcon.00035}
}

For the assessment of planning network models under AC operation:

@article{rosemberg2021assessing,
  title   = {Assessing the Cost of Network Simplifications in Long-Term Hydrothermal Dispatch Planning Models},
  author  = {Rosemberg, Andrew W. and Street, Alexandre and Dias Garcia, Joaquim and Vallad{\~a}o, Davi M. and Silva, Thuener and Dowson, Oscar},
  journal = {IEEE Transactions on Sustainable Energy},
  volume  = {13},
  number  = {1},
  pages   = {196--206},
  year    = {2022},
  doi     = {10.1109/TSTE.2021.3106810}
}