Scenario Trees and Chance Constraints

A dam and reservoir above a river town, with spillway gates and turbines

Open the Reservoir Operation and Flood Control app

Advanced Control Exercise 26 of 30 in Uncertainty and Machine Learning · All exercises · Time: 15 minutes

A reservoir protects a town downstream and makes power through its turbines. Its forecast is not one number but an ensemble of seven possible inflows. Chasing the wettest member wastes water; ignoring it risks the town. This exercise compares a rule curve, a scenario-tree MPC that plans for every member, and a chance-constrained MPC that may let the wettest one go.

Learning Outcomes

  • Formulate a scenario-tree MPC with non-anticipativity constraints.
  • State a chance constraint and its deterministic form for a Gaussian error.
  • Compare a rule curve, a scenario tree and a chance-constrained tree by flood pool used, town peak and energy.

Book Chapter

Model Predictive Control and Economic Optimization (Volume 9), Chapter 7, Reservoir Flood Control on an Ensemble Forecast With Scenario Trees. Read the chapter, open the PDF, or watch the lecture slides.

Theory in Brief

Each forecast member `s`, with probability `\pi_s`, has its own inflow and its own future decisions. The scenario-tree MPC minimizes the expected cost over all members:

$$\begin{gathered} \min \sum_{s} \pi_s \sum_k \ell\left(x_k^s, u_k^s\right) \\ \mathrm{s.t.}\quad x_{k+1}^s = f\left(x_k^s, u_k^s, w_k^s\right),\;\; Q_{town,k}^s \le Q_{max} \end{gathered}$$

Non-anticipativity requires that decisions made before members can be told apart are the same in every member:

$$u_k^s = u_k^{s'} \quad \text{for all } k \text{ before members } s \text{ and } s' \text{ branch}$$

so the committed first days are one plan that is safe for every member it holds. A chance constraint asks the town's limit to hold with probability at least `1 - \alpha` instead of always:

$$\begin{gathered} \Pr\left(Q_{town,k} \le Q_{max}\right) \ge 1 - \alpha, \\ \text{for Gaussian error:}\;\; \hat Q_{town,k} + z_{1-\alpha}\,\sigma_k \le Q_{max} \end{gathered}$$

On an ensemble it becomes: hold the `m` least severe of the `n` members, weighting the rest at a small price. The back-off `z_{1-\alpha}\sigma_k` is what a probability costs in operating room.

Model: Physics-based reservoir mass balance and channel routing, driven by an ensemble of seven inflow forecasts.
Decision: Gate and turbine releases each day, committed for the trunk and branched for each member after it.
Learning: The ensemble forecast is the learned part; the tree turns its spread into decisions.

Exercise

Read 2 min · Predict 1 min · Run 7 min · Explain 3 min · Check your AI 2 min.

Predict. Planning for every ensemble member, will the tree use more or less of the flood pool than a rule curve that waits for the storm? Will letting the wettest member go buy energy, and will the town notice?

Run the Reservoir Operation and Flood Control app. Use the fastest speed, 30 d/s, and press Run again to pause at the times in each step.

  1. Open 4 · The forecast bust: what chasing the forecast costs. Run to day 12 with Forecast member set to Wettest, then set Forecast member to Median, press Reset, and run to day 12 again. Read Town peak and Energy · supply · exceedance days.
  2. Open 6 · Scenario-tree MPC on the ensemble: committed days and branches (Scenario MPC) and run to day 40. Read Flood pool, Town peak and the energy. Then set Strategy (Auto) to Rule curve, press Reset, and run to day 40.
  3. Open 7 · The chance constraint: letting the wettest member go, run it with Strategy (Auto) set to Scenario MPC to day 30, then set Strategy (Auto) to Chance-constrained MPC, press Reset, and run to day 30.

Explain.

  1. Why does the tree use less of the flood pool than the rule curve and still make more energy?
  2. What does the chance-constrained tree give up to make more energy, and who bears that risk?

Generative AI Learning

"Explain scenario-tree MPC with non-anticipativity for reservoir operation on an ensemble forecast, and how a chance constraint changes it. What is the cost of holding every member?"

Check the answer against your run: A good answer has one committed trunk shared by all members, branches after, and a chance constraint that drops the most severe members at a price. Your step 3 tiles show the energy it frees. The assistant is your tutor and reviewer; you answer for every claim you turn in.

What to Turn In

A table with town peak, flood pool and energy for the rule, the tree and the chance-constrained tree, your written prediction, and three sentences that answer the two questions.

Chasing the wettest member through day 12 reads 18.0 GWh · supply 100.0 % of 6 hm³ · 0 days over the limit with a town peak of 314 m³/s; hedging on the median reads 14.3 GWh · supply 100.0 % of 6 hm³ · 0 days over the limit and 185 m³/s. The wettest member released water for a storm that did not come: the cost of chasing is the water.

Over 40 days the scenario tree reads Flood pool 115 hm³ at most, Town peak 434 m³/s and 123.7 GWh · supply 100.0 % of 21 hm³ · 0 days over the limit; the rule curve 285 hm³ at most, 442 m³/s and 93.6 GWh · supply 100.0 % of 21 hm³ · 0 days over the limit. The tree's committed trunk starts releasing through the turbines before the storm, because every member it holds says the room will be needed, so it makes power with water the rule later spills through the gates.

Holding every member through day 30 reads 66.5 GWh · supply 100.0 % of 24 hm³ · 0 days over the limit with a town peak of 412 m³/s; the chance-constrained tree, holding six of seven, reads 78.0 GWh · supply 100.0 % of 24 hm³ · 0 days over the limit and 340 m³/s. It weighs the wettest member's excess at a small price instead of the full damage, which frees water for power. The storm that came was no wetter than the six it held, so the town was safe, and its peak was even lower, because holding every member had forced earlier, larger releases. Had it been the seventh, the town would have paid: that is the risk `\alpha` names, and the town bears it.

Measured with the app build of December 3, 2026 by a scripted replay of the steps above. Numbers that no tile shows come from the replay's record; your readings from the trends will be close. A later app release may move the last digit.

Stochastic MPC solves a scenario problem in GEKKO. Build a two-stage reservoir problem with three inflow scenarios, one first-day release shared by all, and separate later releases. Compare its first-day decision with the decision for the median scenario alone.

Related

References

  1. Hedengren, J. D. (ed.), Model Predictive Control and Economic Optimization, Volume 9 of Interactive Control Engineering, Chapter 7, "Reservoir Flood Control on an Ensemble Forecast With Scenario Trees", pp. 149–171, Advanced Process Solutions, 2026. PDF (CC BY 4.0).
  2. Schwarm, A. T., Nikolaou, M., Chance-constrained model predictive control, AIChE Journal 45(8), 1743–1752, 1999.
  3. Raso, L., van de Giesen, N., Stive, P., Schwanenberg, D., van Overloop, P. J., Tree structure generation from ensemble forecasts for real time control, Hydrological Processes 27(1), 75–82, 2013.

Course Information

TCLab

Project

Applications

Advanced Control Exercises

Exams

Modeling

Machine Learning

Estimation

Control

Reinforcement Learning

Related Courses

Admin