![Page 1: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/1.jpg)
E�ective Classroom Teaching of Optimal Control andOptimization using MATLAB
Saket Adhau, Sayli Patil, Dayaram Sonawane
College of Engineering, Pune, India
MATLAB EXPO 2019
March 23, 2019
Saket Adhau (COEP) March 23, 2019 1 / 25
![Page 2: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/2.jpg)
Optimal Control
• Finding values of the variables that optimize (minimize or maximize)the objective function while satisfying the constraints
Saket Adhau (COEP) Optimal Control March 23, 2019 2 / 25
![Page 3: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/3.jpg)
Ingredients of Optimal Control Problem
Saket Adhau (COEP) Optimal Control March 23, 2019 3 / 25
![Page 4: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/4.jpg)
Methods to Solve OCP
AnalyticalMethods –Pontryagins
maximum principle
Numerical Methods
Saket Adhau (COEP) Optimal Control March 23, 2019 4 / 25
![Page 5: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/5.jpg)
Numerical Methods to Solve OCP
Optimal Con-trol Problem
Indirect MethodsPontryagin:Solves BVP
Direct MethodsTransformsinto NLP
Hamilton-JacobiBellman Equation:
Multiple Shooting:Controls and
node Start valuesin NLP (Simul-taneous/hybrid)
Collocation:Discretized
Controls andstate in NLP
(Simultaneous)
Single Shooting:Only discretizedControls in NLP
(Sequential)
Saket Adhau (COEP) Optimal Control March 23, 2019 5 / 25
![Page 6: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/6.jpg)
Optimal Control Problem Flow Chart
DAEs/ODEsz′(t) = f(t, z, y, u)0 = g(t, z, y, u)
Algebraic EquationsFk(zk+1, zk, yk, uk)
Gk(zk, yk, uk)
Large Non-Linear Programs
Path Constraints andObjective Function
umin ≤ u(k) ≤ umax ,ymin ≤ y(k) ≤ ymax,zmin ≤ z(k) ≤ zmax
Non-LinearProgram
(NLP) SolverOptimal Solution
Temporal Discretization
Saket Adhau (COEP) Optimal Control March 23, 2019 6 / 25
![Page 7: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/7.jpg)
Example Problem: Time Optimal Rocket Problem (TimeOptimization Problem)
minU
tf
Subject to
˙s(t) = v(t) ; ˙v(t) =(u(t)− 0.02 ∗ v(t)2)
m(t)
˙m(t) = −0.01 ∗ u(t)2 ; t ∈[0 t
]s(0) = 0; v(0) = 0; m(0) = 1;
s(tf ) = 10; v(tf ) = 0
Bounds
− 0.1 ≤ v ≤ 1.7; −1.1 ≤ u ≤ 1.1; 5 ≤ T ≤ 15
Saket Adhau (COEP) Optimal Control March 23, 2019 7 / 25
![Page 8: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/8.jpg)
Approach: MATLAB and Simulink Onramp
To provide a brief introduction to the MATLAB language and to give students hands-on MATLAB experience via the use of an integrated,
web-based version of MATLAB, as shown below.
Saket Adhau (COEP) Optimal Control March 23, 2019 8 / 25
![Page 9: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/9.jpg)
Approach: MATLAB and Simulink Onramp Report
Saket Adhau (COEP) Optimal Control March 23, 2019 9 / 25
![Page 10: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/10.jpg)
Classroom teaching approach: MATLAB Live Script:Interactive approach
Saket Adhau (COEP) Optimal Control March 23, 2019 10 / 25
![Page 11: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/11.jpg)
Teaching Optimal Control using Live Script
Saket Adhau (COEP) Optimal Control March 23, 2019 11 / 25
![Page 12: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/12.jpg)
Teaching Optimal Control using Live Script
Saket Adhau (COEP) Optimal Control March 23, 2019 12 / 25
![Page 13: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/13.jpg)
Assessing the students using MATLAB Grader
Saket Adhau (COEP) Optimal Control March 23, 2019 13 / 25
![Page 14: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/14.jpg)
Assessing the students using MATLAB Grader
Saket Adhau (COEP) Optimal Control March 23, 2019 14 / 25
![Page 15: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/15.jpg)
Assessing the students using MATLAB Grader: Report
Saket Adhau (COEP) Optimal Control March 23, 2019 15 / 25
![Page 16: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/16.jpg)
Case Study:
• We have a class of 20 students opting for Process Modeling andOptimization.• As an instructor, it is one challenging task to teach students MATLAB
based coding interactively and assessing them individually.• MATLAB has made this task easier than ever, by introducing MATLAB
Live script and MATLAB Grader.
Saket Adhau (COEP) Optimal Control March 23, 2019 16 / 25
![Page 17: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/17.jpg)
Optimal Control Problem leads to Model PredictiveControl (MPC)
inputreference
measurement
rt ut yt
xt
processoptimization
output
min
st
Use a dynamical model of the process to predict its future evolution andchoose the “best” control action
Saket Adhau (COEP) Optimal Control March 23, 2019 17 / 25
![Page 18: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/18.jpg)
Receding Horizon Implementation
PAST FUTURE
Measured output
Predicted output
Reference trajectory Implemented inputs
Predicted inputs
Current input
t1 t2 t3 dots tN 1
PredictionHorizon
t0
Sample
LEGEND
Saket Adhau (COEP) Optimal Control March 23, 2019 18 / 25
![Page 19: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/19.jpg)
Teaching students MPC using Live Editor
Saket Adhau (COEP) Optimal Control March 23, 2019 19 / 25
![Page 20: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/20.jpg)
Teaching students MPC using Live Editor
Saket Adhau (COEP) Optimal Control March 23, 2019 20 / 25
![Page 21: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/21.jpg)
Teaching students MPC using Live Editor
Saket Adhau (COEP) Optimal Control March 23, 2019 21 / 25
![Page 22: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/22.jpg)
Teaching students MPC using Live Editor
Saket Adhau (COEP) Optimal Control March 23, 2019 22 / 25
![Page 23: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/23.jpg)
Live Demo using Simulink and Arduino
Saket Adhau (COEP) Optimal Control March 23, 2019 23 / 25
![Page 24: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/24.jpg)
Live Demo using Simulink and Arduino
Saket Adhau (COEP) Optimal Control March 23, 2019 24 / 25
![Page 25: Effective Classroom Teaching of Optimal Control and ...€¦ · E˙ective Classroom Teaching of Optimal Control and Optimization using MATLAB Saket Adhau, Sayli Patil, Dayaram Sonawane](https://reader033.vdocument.in/reader033/viewer/2022041502/5e225aecffd5a76cbc5a1c7f/html5/thumbnails/25.jpg)
Live Demo using Simulink and Arduino
The END
Saket Adhau (COEP) Optimal Control March 23, 2019 25 / 25