A framework for nonlinear model predictive control
1. πππππππππ π΄π₯πππ π ππ1
, πΉππππππ πππππ’π π ππ2
, ππππ£π π»πππππππ π ππ1
A FRAMEWORK FOR NONLINEAR MODEL PREDICTIVE
CONTROL IN JMODELICA.ORG
11. πππππππ, πΏπ’ππ, ππ€ππππ
2. π·πππππ‘ππππ‘ ππ π΄π’π‘ππππ‘ππ πΆπππ‘πππ, πΏπ’ππ ππππ£πππ ππ‘π¦, ππ€ππππ
2. β’ Background
ο§ Model Predictive Control
Optimal control problem
Example
ο§ JModelica.org
Reason for new framework
Optimica
Discretization
β’ Comparison between frameworks
ο§ Theory
ο§ Benchmark
β’ Features
β’ Conclusions and further work
OVERVIEW
3. β’ Optimization-based control strategy
β’ Repeated on-line solution of an open-loop Optimal Control Problem (OCP)
β’ Feedback by measuring the state prior to each optimization
β’ Main advantages
ο§ Easily extends to multivariable processes
ο§ Instrinscally handles constraints
β’ Main limitations
ο§ Computationally demanding
ο§ Solution not guaranteed
MODEL PREDICTIVE CONTROL
6. Open-source platform for simulation and optimization of Modelica models
Optimization problem formulated in Optimica
ο§ Extension of the Modelica language which enables formulation of
objective functions and constraints
β’ JModelica.org has a framework for optimization -> Open-Loop framework
β’ Main goals of MPC framework
ο§ Decrease the total computation time for each optimization
Utilize the fact that the structure of the discretized OCP does not change between
optimizations
ο§ Make JModelica.org easier to use for MPC schemes
Streamline the setup
Provide relevant features
JMODELICA.ORG
7. optimization CSTR_opt(objectiveIntegrand=(c_ref-cstr.c)^2 +
(T_ref-cstr.T)^2 + (Tc_ref-cstr.Tc)^2,
startTime=0.0,
finalTime=150)
CSTR cstr(T(max=350));
input Real u(start = 350,min=230,max=370)=cstr.Tc;
parameter Real c_ref = 500;
parameter Real T_ref = 320;
parameter Real Tc_ref = 300;
constraint
cstr.c <= 1000;
end CSTR_opt;
OPTIMICA CODE
8. β’ JModelica.org uses direct collocation to transcribe the OCP to a
NonLinear Program (NLP)
ο§ Optimization problem is considered at a number of collocation
points π‘ = {π‘ π1, π‘ π2, β¦ , π‘ ππ}, rather than βπ‘ β π‘0, π‘π
β’ Underlying NLP solver is IPOPT
ο§ Solution not guaranteed
ο§ Important with good initial guess
DISCRETIZATION
9. OL framework
β’ Pre-processing
ο§ OCP transcribed to NLP
ο§ Initial guess extracted
ο§ Scaling
ο§ Solver object created
β’ Solution
ο§ NLP sent to solver
β’ Post-processing
ο§ Result is processed
ο§ Result object created and
returned
COMPARISON BETWEEN FRAMEWORKS
MPC framework
β’ Initialization β Only done once
ο§ OCP transcribed to NLP
ο§ Initial guess extracted
ο§ Scaling
ο§ Solver object created
β’ Pre-processing
ο§ Initial condition updated
ο§ Initial guess updated
ο§ Prediction horizon shifted
β’ Solution
ο§ NLP sent to solver (warm started)
β’ Post-processing
ο§ Result is processed
ο§ First input in optimal control sequence
returned
12. β’ Soften constraints
ο§ OCP may become infeasible if hard constraints are applied
π₯0 > π₯ π, π₯ π‘0 = π₯0, π₯ π‘ β€ π₯ π
ο§ Hard constraints need to be softened
β’ Initial guess
ο§ MPC framework automatically uses the solution to one optimization as
the initial guess for the next
β’ Unsuccessful optimization
ο§ If an optimization is unsuccessful the MPC framework returns the
second input in the last sucessful optimization
FEATURES
+ π(π‘)
13. β’ We obtain the same solution using the MPC framework as using the
OL framework
β’ The MPC framework is significantly faster than the OL framework
ο§ CCPP: ππ‘ππ‘ β β70%
ο§ Mainly due to time-consuming discretization only done once
β’ The MPC framework handles a lot of things internally, making
scripting easier
CONCLUSIONS
14. β’ Some optimization options are incompatible with the MPC
framework
β’ More functionality
ο§ Different ways of softening variable bounds and constraints
ο§ Shifting of dual variables
ο§ Method to obtain the value of the objective function
FURTHER WORK