Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
π‘€π‘Žπ‘”π‘‘π‘Žπ‘™π‘’π‘›π‘Ž 𝐴π‘₯π‘’π‘™π‘ π‘ π‘œπ‘›1
, πΉπ‘Ÿπ‘’π‘‘π‘Ÿπ‘–π‘˜ π‘€π‘Žπ‘”π‘›π‘’π‘ π‘ π‘œπ‘›2
, π‘‡π‘œπ‘–π‘£π‘œ π»π‘’π‘›π‘›π‘–π‘›π‘”π‘ π‘ π‘œπ‘›1
A FRAMEWORK FOR NONLINEAR MODEL PREDICTIVE
CONTROL IN JMODEL...
β€’ Background
 Model Predictive Control
Optimal control problem
Example
 JModelica.org
Reason for new framework
Optimica
...
β€’ Optimization-based control strategy
β€’ Repeated on-line solution of an open-loop Optimal Control Problem (OCP)
β€’ Feedback...
β€’ Objective function min
π‘₯,𝑦,𝑒,𝑀 𝑑0
𝑑 𝑓
𝑀𝑠𝑒𝑑 βˆ’ 𝑀 𝑇
𝑄 𝑀𝑠𝑒𝑑 βˆ’ 𝑀 𝑑𝑑
𝑀 = (π‘₯ π‘π‘œπ‘›π‘‘π‘Ÿπ‘œπ‘™π‘™π‘’π‘‘, π‘¦π‘π‘œπ‘›π‘‘π‘Ÿπ‘œπ‘™π‘™π‘’π‘‘, 𝑒 π‘π‘œπ‘›π‘‘π‘Ÿπ‘œπ‘™π‘™π‘’π‘‘)
𝑠. 𝑑.
β€’ Mod...
MODEL PREDICTIVE CONTROL
Sample period = 10s
At each sample point
β€’ Measure state
β€’ Optimize
β€’ Apply first input
Open-source platform for simulation and optimization of Modelica models
Optimization problem formulated in Optimica
 Exte...
optimization CSTR_opt(objectiveIntegrand=(c_ref-cstr.c)^2 +
(T_ref-cstr.T)^2 + (Tc_ref-cstr.Tc)^2,
startTime=0.0,
finalTim...
β€’ JModelica.org uses direct collocation to transcribe the OCP to a
NonLinear Program (NLP)
 Optimization problem is consi...
OL framework
β€’ Pre-processing
 OCP transcribed to NLP
 Initial guess extracted
 Scaling
 Solver object created
β€’ Solut...
β€’ Developed by F. Casella
β€’ Objective
 𝑝𝑠𝑒𝑑 = 8.35 π‘€π‘ƒπ‘Ž
 π‘™π‘œπ‘Žπ‘‘ 𝑠𝑒𝑑 = 1
𝑑0
𝑑 𝑓
8.35 βˆ’ 𝑝 2
+ 1 βˆ’ π‘™π‘œπ‘Žπ‘‘ 2
𝑑𝑑
β€’ Constraints
 𝜎...
BENCHMARK RESULTS
Sample period = 100s
β€’ Soften constraints
 OCP may become infeasible if hard constraints are applied
π‘₯0 > π‘₯ π‘ˆ, π‘₯ 𝑑0 = π‘₯0, π‘₯ 𝑑 ≀ π‘₯ π‘ˆ
 Hard con...
β€’ We obtain the same solution using the MPC framework as using the
OL framework
β€’ The MPC framework is significantly faste...
β€’ Some optimization options are incompatible with the MPC
framework
β€’ More functionality
 Different ways of softening var...
magdalena. axelsson@modelon. com
Upcoming SlideShare
Loading in …5
×

A framework for nonlinear model predictive control

6,979 views

Published on

Presentation at Modelica Conference 2015

Published in: Technology
  • Be the first to comment

  • Be the first to like this

A framework for nonlinear model predictive control

  1. 1. π‘€π‘Žπ‘”π‘‘π‘Žπ‘™π‘’π‘›π‘Ž 𝐴π‘₯π‘’π‘™π‘ π‘ π‘œπ‘›1 , πΉπ‘Ÿπ‘’π‘‘π‘Ÿπ‘–π‘˜ π‘€π‘Žπ‘”π‘›π‘’π‘ π‘ π‘œπ‘›2 , π‘‡π‘œπ‘–π‘£π‘œ π»π‘’π‘›π‘›π‘–π‘›π‘”π‘ π‘ π‘œπ‘›1 A FRAMEWORK FOR NONLINEAR MODEL PREDICTIVE CONTROL IN JMODELICA.ORG 11. π‘€π‘œπ‘‘π‘’π‘™π‘œπ‘›, 𝐿𝑒𝑛𝑑, 𝑆𝑀𝑒𝑑𝑒𝑛 2. π·π‘’π‘π‘Žπ‘Ÿπ‘‘π‘šπ‘’π‘›π‘‘ π‘œπ‘“ π΄π‘’π‘‘π‘œπ‘šπ‘Žπ‘‘π‘–π‘ πΆπ‘œπ‘›π‘‘π‘Ÿπ‘œπ‘™, 𝐿𝑒𝑛𝑑 π‘ˆπ‘›π‘–π‘£π‘’π‘Ÿπ‘ π‘–π‘‘π‘¦, 𝑆𝑀𝑒𝑑𝑒𝑛
  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. 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
  4. 4. β€’ Objective function min π‘₯,𝑦,𝑒,𝑀 𝑑0 𝑑 𝑓 𝑀𝑠𝑒𝑑 βˆ’ 𝑀 𝑇 𝑄 𝑀𝑠𝑒𝑑 βˆ’ 𝑀 𝑑𝑑 𝑀 = (π‘₯ π‘π‘œπ‘›π‘‘π‘Ÿπ‘œπ‘™π‘™π‘’π‘‘, π‘¦π‘π‘œπ‘›π‘‘π‘Ÿπ‘œπ‘™π‘™π‘’π‘‘, 𝑒 π‘π‘œπ‘›π‘‘π‘Ÿπ‘œπ‘™π‘™π‘’π‘‘) 𝑠. 𝑑. β€’ Model 𝐹 π‘₯ 𝑑 , π‘₯ 𝑑 , 𝑦 𝑑 , 𝑒 𝑑 = 0 β€’ Initial condition π‘₯ 𝑑0 = π‘₯0 π‘₯ 𝐿 ≀ π‘₯ 𝑑 ≀ π‘₯ π‘ˆ β€’ Constraints 𝑔 π‘₯ 𝑑 , π‘₯ 𝑑 , 𝑦 𝑑 , 𝑒 𝑑 ≀ 0 βˆ€π‘‘ ∈ [𝑑0, 𝑑𝑓] OPTIMAL CONTROL PROBLEM
  5. 5. MODEL PREDICTIVE CONTROL Sample period = 10s At each sample point β€’ Measure state β€’ Optimize β€’ Apply first input
  6. 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. 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. 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. 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
  10. 10. β€’ Developed by F. Casella β€’ Objective  𝑝𝑠𝑒𝑑 = 8.35 π‘€π‘ƒπ‘Ž  π‘™π‘œπ‘Žπ‘‘ 𝑠𝑒𝑑 = 1 𝑑0 𝑑 𝑓 8.35 βˆ’ 𝑝 2 + 1 βˆ’ π‘™π‘œπ‘Žπ‘‘ 2 𝑑𝑑 β€’ Constraints  𝜎 ≀ 260 π‘€π‘ƒπ‘Ž  0 ≀ 𝑒 ≀ 1  0 ≀ 𝑒 ≀ 0.1 60 BENCHMARK MODEL Combined-Cycle Power Plant (CCPP)
  11. 11. BENCHMARK RESULTS Sample period = 100s
  12. 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. 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. 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
  15. 15. magdalena. axelsson@modelon. com

Γ—