Lecture 05: Multi-stage Stochastic Programming
2
Scan me:
Quizzes
Anonymous Questions (during or after the lecture)
The Lecture will be recorded
vevox.app�176-006-553
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Course Plan
3
without�Uncertainty
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Agenda for today
4
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Agenda for today
5
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Policies: The story so far
Expected Cost
Deterministic Lookahead policy
Optimal in Hindsight
Dummy policy
Optimal Policy
2-stage Stochastic Lookahead policy
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Lookahead Policy
Optimal Policy:
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Rolling Horizon Optimization
8
L
1 2 ... 22 23 24
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Scenario Generation
Data
Model
Not in this course
Given to you
We assume the probability distribution of the uncertainty (given the state) is available.
Then, we can sample scenarios from that.
We need at least 100 samples to capture the statistical properties of the uncertainty.
�The challenge is that
more scenarios 🡪 more variables 🡪 higher computational time
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Dinner Party problem: More than one uncertainties
10
First stage problem
To capture the statistical properties of the uncertainty, we now need at least 1000 scenarios (samples).
But we still can only afford 33.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Scenario Reduction
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
2-stage Stochastic Lookahead Policy
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
2-stage Stochastic Lookahead Policy
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
2-stage Stochastic Lookahead Policy
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Effective vs Prospective Decisions
Let’s say we are in stage 3. We observe the current state and make predictions for the state at stage 4, to inform the here-and-now decision
When stage 4 comes, we observe the new state and do the same to calculate the here-and-now decision for stage 4.
So, we solve an optimization problem again, and do not use the previously made prospective decisions.
1 2 3 4 5 6 � stages
1 2 3 4 5 6 � stages
Uncertainty Realization
Uncertainty Realization
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Multi-stage Stochastic Programming
16
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Extending the 2-stage Stochastic Program
2-stage Stochastic Lookahead Optimization
DTU Compute
24 May 2023
Extending the 2-stage Stochastic Program
2-stage Stochastic Lookahead Optimization
?-stage Stochastic Lookahead Optimization
“This is a [?]-stage Lookahead”
DTU Compute
24 May 2023
Extending the 2-stage Stochastic Program
2-stage Stochastic Lookahead Optimization
?-stage Stochastic Lookahead Optimization
“This is a [?]-stage Lookahead”
Looks like a 4-stage lookahead, but actually there is no new information after stage 2.
DTU Compute
24 May 2023
Extending the 2-stage Stochastic Program
4-stage Stochastic Lookahead Optimization
DTU Compute
24 May 2023
Extending the 2-stage Stochastic Program
4-stage Stochastic Lookahead Optimization
DTU Compute
24 May 2023
Extending the 2-stage Stochastic Program
4-stage Stochastic Lookahead Optimization
But what should change in the actual optimization problem?
DTU Compute
24 May 2023
Extending the 2-stage Stochastic Program
4-stage Stochastic Lookahead Optimization
Non-anticipativity�Sets
DTU Compute
24 May 2023
Intuition for non-anticipativity
When should you sell your asset?
Full Recourse vs Binding Decisions
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
25
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Multi-Stage SP policy: summary
26
New state revealed
Construct the non-anticipativity sets
Beginning from the new state, create scenario tree for the lookahead horizon
Solve the multi-stage �stochastic program
Implement the optimal here-and-now decision
DTU Compute
24 May 2023
Repeated Branch-out & Cluster
27
DTU Compute
24 May 2023
28
DTU Compute
24 May 2023
Cluster
29
DTU Compute
24 May 2023
Allocate Probability to each Centroid
30
DTU Compute
24 May 2023
Ready to Move on…
31
0.3
0.3
0.4
DTU Compute
24 May 2023
32
DTU Compute
24 May 2023
Cluster
33
DTU Compute
24 May 2023
Repeat…
34
DTU Compute
24 May 2023
Repeat…
35
0.3
0.3
0.4
0.3
0.3
0.4
0.3
0.6
0.1
0.2
0.3
0.5
DTU Compute
24 May 2023
Create Scenarios
36
1
2
3
4
5
6
9
7
8
0.3
0.3
0.4
0.3
0.3
0.4
0.3
0.6
0.1
0.2
0.3
0.5
Each path (ending up to a leaf node) is one scenario.
Calculate the probability of each scenario, by multiplying the probabilities across the path.
DTU Compute
24 May 2023
Multi-Stage Stochastic Programming policy
DTU Compute
24 May 2023
Multi-Stage Stochastic Programming policy
DTU Compute
24 May 2023
Multi-Stage Stochastic Programming policy
DTU Compute
24 May 2023
Multi-Stage Stochastic Programming policy
DTU Compute
24 May 2023
Multi-Stage Stochastic Programming policy
DTU Compute
24 May 2023
Multi-Stage Stochastic Programming policy
DTU Compute
24 May 2023
Multi-Stage Stochastic Programming policy
Iterative Branch & Cluster
DTU Compute
24 May 2023
Multi-Stage Stochastic Programming policy
Populating non-anticipativity sets
DTU Compute
24 May 2023
Multi-Stage Stochastic Programming policy
Iterative Branch & Cluster
Populating non-anticipativity sets
DTU Compute
24 May 2023
How many Scenarios?
46
1
2
3
4
5
6
9
7
8
0.3
0.3
0.4
0.3
0.3
0.4
0.3
0.6
0.1
0.2
0.3
0.5
DTU Compute
24 May 2023
How to build a Multi-Stage SP Policy
47
DTU Compute
24 May 2023
Student’s problem Example
48
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Multi-stage Stochastic Lookahead Policy
The student’s problem: Multi-stage Stochastic Lookahead
Sequential Decision Problem
Let’s consider that the fatigue threshold is also uncertain
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
Sequential Decision Problem
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
Sequential Decision Problem
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
Sequential Decision Problem
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
Sequential Decision Problem
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
1
2
3
4
5
6
9
7
8
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
1
2
3
4
5
6
9
7
8
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
1
2
3
4
5
6
9
7
8
The student’s problem: Multi-stage Stochastic Lookahead
DTU Compute
24 May 2023
Multi-stage Stochastic Lookahead Policy
2
3
4
5
6
7
8
9
The student’s problem: Node-based formulation
10
11
12
13
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
62
5-stage simulation horizon
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
63
5-stage problem
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
64
5-stage problem
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
65
5-stage problem
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
66
5-stage problem
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
67
5-stage problem
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
68
5-stage problem
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
69
5-stage problem
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
70
5-stage problem
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
DTU Compute
24 May 2023
Stochastic Lookahead Policy Evaluation
71
5-stage problem
Policy: Lookahead horizon of 3 stages with 6 scenarios
Stages: 1 2 3 4 5
To Evaluate the policy:
I evaluate the cost of the effective decisions
DTU Compute
24 May 2023
Multi-Stage SP policy: summary
72
New state revealed
Construct the non-anticipativity sets
Beginning from the new state, create scenario tree for the lookahead horizon
Solve the multi-stage �stochastic program
Implement the optimal here-and-now decision
DTU Compute
24 May 2023
Lead Example
73
Exercise:
Implement a multi-stage stochastic programming policy for the Energy Hub problem and compare it with the previous policies, using the evaluation environment of Week 2.
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Questions
74
vevox.app
176-006-553
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Quiz
75
vevox.app
188-803-352
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty