Lecture 01: Introduction & �Recap on Mathematical Optimization
2
Scan me:
Quizzes
Anonymous Questions (during or after the lecture)
vevox.app
ID:
148-282-057
The Lecture will be recorded
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Cheesy Introductory Statement
3
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Cheesy Introductory Statement
4
What do all the following things have in common?
Climate change
Disease spreading
Global economy
Energy and Transportation systems
Logistics and supply chains
Your own health
Your relationships
Your grades
The taste of your coffee today
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Cheesy Introductory Statement
5
What do all the following things have in common?
Climate change
Disease spreading
Global economy
Energy and Transportation systems
Logistics and supply chains
Your own health
Your relationships
Your grades
The taste of your coffee today
The fate of each is linked to good decision-making!
Actually, on a sequence of decisions.
…under uncertainty.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Cheesy Introductory Statement
6
What do all the following things have in common?
Climate change
Disease spreading
Global economy
Energy and Transportation systems
Logistics and supply chains
Your own health
Your relationships
Your grades
The taste of your coffee today
The fate of each is linked to good decision-making!
Actually, on a sequence of decisions.
…under uncertainty.
…ah, and complexity.
In this course, we will learn about designing good decision-making algorithms.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Scope
7
Decision 🡪 Information 🡪 Decision 🡪 Information 🡪 …
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Scope
8
Decision 🡪 Information 🡪 Decision 🡪 Information 🡪 …
The fact that you get to act again in the future, �changes the way you act right now.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Scope
9
Stochastic Optimization
Optimal Control
Model Predictive Control
Approximate Dynamic Programming
Reinforcement Learning
Decision 🡪 Information 🡪 Decision 🡪 Information 🡪 …
The fact that you get to act again in the future, �changes the way you act right now.
Simulation Optimization
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Scope
10
Stochastic Optimization
…and (hopefully) make it to the other end wiser
Optimal Control
Model Predictive Control
Approximate Dynamic Programming
Reinforcement Learning
We will surf our way across these areas…
…borrowing concepts each time from where it seems more useful…
Decision 🡪 Information 🡪 Decision 🡪 Information 🡪 …
The fact that you get to act again in the future, �changes the way you act right now.
Simulation Optimization
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Agenda for today
11
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Agenda for today
12
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Agenda for today
13
Hour 1
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Agenda for today
14
Hour 1
Hour 2
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Agenda for today
15
Hour 1
Hour 2
Hours 3 and 4
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Agenda for today
16
Hour 1
Hour 2
Hours 3 and 4
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Format
17
Learning by Doing: No final exam. Only one big Assignment, given upfront.
The Assignment tries to simulate the situation where you are hired to design an algorithm for a real-world-like decision-making problem.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Format
18
Learning by Doing: No final exam. Only one big Assignment, given upfront.
The Assignment tries to simulate the situation where you are hired to design an algorithm for a real-world-like decision-making problem.
Your solutions (codes) will be evaluated by simulating their performance in the “real” (read: simulated) system.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Format
19
Learning by Doing: No final exam. Only one big Assignment, given upfront.
The Assignment tries to simulate the situation where you are hired to design an algorithm for a real-world-like decision-making problem.
Your solutions (codes) will be evaluated by simulating their performance in the “real” (read: simulated) system.
Assignment Task
Concept
Small Examples
Lead Example
Application to Assignment Task
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Format
20
Learning by Doing: No final exam. Only one big Assignment, given upfront.
The Assignment tries to simulate the situation where you are hired to design an algorithm for a real-world-like decision-making problem.
Your solutions (codes) will be evaluated by simulating their performance in the “real” (read: simulated) system.
Us
You
Assignment Task
Concept
Small Examples
Lead Example
Application to Assignment Task
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Lead Example: The Energy Hub
21
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Lead Example: The Energy Hub
22
"We need to operate this Energy Hub in a smart way i.e. make good decisions under uncertainty"
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Lead Example: The Energy Hub
23
How would you approach this problem?
What would be the first thing you would do?
"We need to operate this Energy Hub in a smart way i.e. make good decisions under uncertainty"
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The process of designing �“Decision-making” frameworks
24
Define
Design
Evaluate
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The process of designing �“Decision-making” frameworks
25
Define
Design
Evaluate
Extracting this information from the stakeholder is often the biggest part of the job.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Energy Hub Problem
26
"We need to operate this Energy Hub in a smart way i.e. make good decisions under uncertainty"
Electrolyzer
H2�Storage
Fuel�Cell
Industry
Grid
Wind
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The process of designing �“Decision-making” frameworks
27
Define
Design
Evaluate
Markov Decision Process
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The process of designing �“Decision-making” frameworks
28
Define
Design
Evaluate
Begin with the simplest (dummy) strategy.
e.g. electrolyzer always OFF & just use your wind power and draw the rest from the grid.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The process of designing �“Decision-making” frameworks
29
Define
Design
Evaluate
Begin with the simplest (dummy) strategy.
Often leads to revisiting the problem definition.�
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The process of designing �“Decision-making” frameworks
30
Define
Design
Evaluate
Begin with the simplest (dummy) strategy.
�How do you know how good/bad it is?
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The process of designing �“Decision-making” frameworks
31
Define
Design
Evaluate
Begin with the simplest (dummy) strategy.
�How do you know how good/bad it is?
Build a simulation environment on which any strategy can be evaluated.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The process of designing �“Decision-making” frameworks
32
Define
Design
Evaluate
Begin with the simplest (dummy) strategy.
Build a simulation environment on which any strategy can be evaluated.
Now we design algorithms.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The process of designing �“Decision-making” frameworks
33
Define
Design
Evaluate
Begin with the simplest (dummy) strategy.
Build a simulation environment on which any strategy can be evaluated.
The evaluation environment is related to the problem definition and independent of the designed strategy
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The Method is not The Problem Definition
34
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The Method is not The Problem Definition
35
“So, your leg hurts huh?
Classic ice-and-rest problem…”
“Let’s apply ice and rest!”
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Always
36
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Define
37
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The Problem
38
DTU Compute
Welcome to 02435�Decision-making under uncertainty
First.
39
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Plan
40
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Plan
41
+ Code a Simulation Environment
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Plan
42
+ Code a Simulation Environment
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Plan
43
+ Code a Simulation Environment
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Plan
44
+ Code a Simulation Environment
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Plan
45
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Plan
46
without�Uncertainty
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Course Plan
without�Uncertainty
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Resources
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Recap on Mathematical Optimization
49
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Let’s model your current decision-making problem: How much effort to invest in this course
50
Write some keywords �(decisions, objectives, uncertain factors)
vevox.app
ID:
148-282-057
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Let’s model your another student’s decision-making problem: How much effort to invest in this course
51
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Let’s model your another student’s decision-making problem: How much effort to invest in this course
52
This is a LP
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Mathematical Optimization
53
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Types of Optimization Problems
54
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Elements of an Optimization Problem
55
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Elements of an Optimization Problem
56
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Elements of an Optimization Problem
57
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Linear Programming (LP)
58
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Feasible and Optimal Solutions
59
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Possible Outcomes
60
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Possible Outcomes
61
Perform a sanity check for this problem
vevox.app
ID:
148-282-057
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Possible Outcomes
62
And now for this problem
vevox.app
ID:
148-282-057
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The student’s problem
63
but indices still italic
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The student’s problem extended
64
This is a MILP
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The student’s problem extended
65
This is a MILP
Is the optimal solution of this problem better or worse than the one of the previous student’s problem?
vevox.app ID: 148-282-057
DTU Compute
Welcome to 02435�Decision-making under uncertainty
The student’s problem extended further
66
DTU Compute
Welcome to 02435�Decision-making under uncertainty
67
67
The student’s problem extended further
DTU Compute
Welcome to 02435�Decision-making under uncertainty
68
68
The student’s problem extended further
DTU Compute
Welcome to 02435�Decision-making under uncertainty
69
69
The student’s problem extended further
If stressed, need rest
DTU Compute
Welcome to 02435�Decision-making under uncertainty
70
70
The student’s problem extended further
DTU Compute
Welcome to 02435�Decision-making under uncertainty
71
71
The student’s problem extended further
DTU Compute
Welcome to 02435�Decision-making under uncertainty
72
72
The student’s problem extended further
Here, M=1 is a good choice (can you see why?)
DTU Compute
Welcome to 02435�Decision-making under uncertainty
73
73
The student’s problem: StudentProblem.py
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Pyomo Code
74
You can play with StudentProblem.py – available on Learn
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Pyomo Code
75
Why did I include 15 weeks instead of 13?
What if you want a grade 95, 75, or 45?
How does Lecture Quality (0.3 instead of 0.35) affect things?
You can play with StudentProblem.py – available on Learn
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Questions & Group Enrollment
76
vevox.app ID: 148-282-057
2. Go on Learn and enroll in a Group.
3. Contact your group and sit together for the Exercise session.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Assignment
77
DTU Compute
2 February 2021
Welcome to 02435�Decision-making under uncertainty
Assignment
78
DTU Compute
Welcome to 02435�Decision-making under uncertainty
Assignment
79
DTU Compute
Welcome to 02435�Decision-making under uncertainty
On LLMs
80
Exercises
Use them and also use the TAs.
LLMs are very helpful if you know what you are doing.
If you don’t, they can “chaos” you.
Assignment
Do not ask TAs.
Use of LLMs is up to you.
“The LLM said so” is not a valid justification for something you did.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
What’s next
81
Us
You
Assignment Task
Concept
Small Examples
Lead Example
Application to Assignment Task
It is tempting to skip the Exercise and jump directly to the Assignment. �Don’t.
DTU Compute
Welcome to 02435�Decision-making under uncertainty
What to do now
82
A) Go to
Content 🡪 Exercise - Lead Example
and do Exercise 1.
B) After 16.30:
Go to
Assignment
Get together with your Group and start working on the Assignment – Task 1
DTU Compute
Welcome to 02435�Decision-making under uncertainty