Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  ·...

66
Fast Nonlinear Model Predictive Control Algorithms and Applications in Process Engineering Moritz Diehl, Optimization in Engineering Center (OPTEC) & Electrical Engineering Department (ESAT) K.U. Leuven, Belgium INRIA-Rocquencourt, May 30, 2007

Transcript of Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  ·...

Page 1: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Fast Nonlinear Model Predictive Control Algorithms and Applications in

Process EngineeringMoritz Diehl,

Optimization in Engineering Center (OPTEC) &Electrical Engineering Department (ESAT)

K.U. Leuven, Belgium

INRIA-Rocquencourt, May 30, 2007

Page 2: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Outline of the Talk

�K.U.Leuven‘s Optimization in Engineering Center OPTEC

�Nonlinear Model Predictive Control (NMPC)

�How to solve dynamic optimization problems?

�Four crucial features for fast NMPC algorithms

�Application to a Distillation Column

Page 3: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

OPTEC Aim: Connect Optimization Methods & Applications

Methods: New developments are inspired and driven by application needs

Applications: Smart problem formulations allow efficient solution (e.g. convexity)

Page 4: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Optimization in Engineering Center OPTEC

Five year project, from 2005 to 2010, 500.000 Euro per year, about 20 professors, 10 pos tdocs, and 60 PhD

students involved in OPTEC research

Promoted by four departments:� Electrical Engineering� Mechanical Engineering � Chemical Engineering � Computer Science

Many real world applications at OPTEC...

Page 5: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Quarterly Stevin Lecture: Everyone Invited!

�Quarterly „Simon Stevin Lecture on Optimization in Engineering“:• Dec 6: Larry Biegler , CMU Pittsburgh• Apr 18: Stephen Boyd , Stanford• July 9: Steve Wright , Madison, Wisconsin• Oct 24: Manfred Morari , ETH Zurich• Dec X: David Mayne , Imperial, London

�„K.U. Leuven Seminar on Optimization in Engineering “ :• Jan. 31: Mario Milanese (Torino): MPC of semi-active damping• Feb. 8: Philippe Toint (Namur): large scale optimization methods• Feb. 22: Peter Kuehl (Heidelberg): Robust optimal feedback control• March 1: Yurii Nesterov (UCL)/ Florian Jarre (Duesseldorf): new

optimization algorithms

Simon Stevin, 1548-1620)

Lecture and following Reception in Arenberg Castle, Leuven

Page 6: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Outline of the Talk

�K.U.Leuven‘s Optimization in Engineering Center OPTEC

�Nonlinear Model Predictive Control (NMPC)

�How to solve dynamic optimization problems?

�Four crucial features for fast NMPC algorithms

�Online MPC of a combustion engine

Page 7: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

First Principle Dynamic System Models

E.g. some equations modelling a distillation column (in Stuttgart)

� Nonlinear differential algebraic equations (DAE)

� often in modeling languages like gPROMS, SIMULINK, Modelica

� typical order of magnitude: some hundreds to thousands variables

� difficulties: stiffness, discontinuities, high index

Can we use these models directly for optimization and feedback control?

Page 8: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

x0

u0

u0

Principle of Optimal Feedback Control / Nonlinear MPC:

Page 9: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Brain predicts and optimizes:e.g. slow down before curve

Nonlinear Model Predictive Control When We Drive a Car

Always look a bit into the future!

Main challenge for NMPC: fast and reliable real-time optimization!

Page 10: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Distillationcolumn (withUniv. Stuttgart)

Polymeri-sation reactor (withBASF)

ChromatographicSeparation (withUniv. Dortmund)

Combined CyclePower Plant (withUniv. Pavia)

PET plant: Plant wide control project with Politecnico di Milano

Car Engines: EU Project with Univ. Linz, Stuttgart, Politecnico di Milano

NMPC applications, with decreasing timescales

Looping kites for power generation, with TU Delft, Politecnico di Torino

Robot arms (with Columbia Univ. & INRIA Grenoble)

Page 11: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Outline of the Talk

�K.U.Leuven‘s Optimization in Engineering Center OPTEC

�Nonlinear Model Predictive Control (NMPC)

�How to solve dynamic optimization problems?

�Four crucial features for fast NMPC algorithms

�Application to a Distillation Column

Page 12: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Optimal Control Family Tree

Page 13: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Optimal Control Family Tree

Page 14: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Optimal Control Family Tree

Page 15: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Optimal Control Problem in Simplest Form

Page 16: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Simplest Approach: Single Shooting

Page 17: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Nonlinear Program (NLP) in Single Shooting

�After control discretization, obtain NLP:

�Solve with NLP solver, e.g. Sequential Quadratic

Programming (SQP)

Page 18: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Sequential Quadratic Programming (SQP)

Page 19: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Toy Problem with One ODE for Illustration

Mildly nonlinear and unstable system.

Page 20: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Single Shooting

Page 21: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Single Shooting: First Iteration

Page 22: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Single Shooting: Second Iteration

Page 23: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Single Shooting: Third Iteration

Page 24: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Single Shooting: 4th Iteration

Page 25: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Single Shooting: 5th Iteration

Page 26: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Single Shooting: 6th Iteration

Page 27: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Single Shooting: 7th Iteration (Solution)

Page 28: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Single Shooting: Pros and Cons

Page 29: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Alternative: Direct Multiple Shooting [Bock, Plitt 1981]

Page 30: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Nonlinear Program in Multiple Shooting

Page 31: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

SQP for Multiple Shooting

Summarize NLP:

Page 32: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Toy Example: Multiple Shooting Initialization

Page 33: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Multiple Shooting: First Iteration

Page 34: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Multiple Shooting: Second Iteration

Page 35: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Multiple Shooting: 3rd Iteration (already solution!)

Page 36: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Multiple Shooting: 3rd Iteration (already solution!)

Single shooting converged much slower!

Page 37: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)
Page 38: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

The MUSCOD-II Developer Team [Heidelberg, Leuven, Madrid]

Page 39: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Outline of the Talk

�K.U.Leuven‘s Optimization in Engineering Center OPTEC

�Nonlinear Model Predictive Control (NMPC)

�How to solve dynamic optimization problems?

�Four crucial features for fast NMPC algorithms

�Online MPC of a combustion engine

Page 40: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

NMPC Computation from 1998 to 2006

�1998: 5th order distillation model allows sampling times of only 5 minutes [Allgower, Findeisen, 1998]

�2001: 206th order distillation model, sampling times of 20 seconds [D. et al. ‚01]

�2006: 5th order engine model, sampling times of 10-20 milliseconds [Ferreau et al. ‘06]

5*60*1000 / 20 = 15 000 times faster , due toMoore‘s law + Algorithm Development

Page 41: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

NMPC Computation from 1998 to 2006

�1998: 5th order distillation model allows sampling times of only 5 minutes [Allgower, Findeisen, 1998]

�2001: 206th order distillation model, sampling times of 20 seconds [D. et al. ‚01] cf. [Biegler]

�2006: 5th order engine model, sampling times of 10-20 milliseconds [Ferreau et al. ‘06], [Albersmeyer, Findeisen `06]

5*60*1000 / 20 = 15 000 times faster , due toMoore‘s law + Algorithm Development

Page 42: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Four Crucial Features for Fast NMPC

�Direct, simultaneous optimal control: Multiple Shooting

�Efficient derivative generation for ODE/DAE solvers

� Initialization by „Initial Value Embedding “

�Real-Time Iterations for fast tracking of optimal solutions

Page 43: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)
Page 44: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

Page 45: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

Page 46: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

Page 47: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

Page 48: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

Page 49: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

Page 50: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

Page 51: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

ConventionalConventional::Initial Initial Value Value Embedding:Embedding:

Never simulate a nonlinear system open-loop!

Page 52: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

x0

Page 53: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

x0

Page 54: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

x0

Page 55: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0

u0

Page 56: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Real-Time Iterations minimize feedback delay

Page 57: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

x0 u0

Page 58: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Outline of the Talk

�K.U.Leuven‘s Optimization in Engineering Center OPTEC

�Nonlinear Model Predictive Control (NMPC)

�How to solve dynamic optimization problems?

�Four crucial features for fast NMPC algorithms

�Application to a Distillation Column

Page 59: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)
Page 60: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)
Page 61: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Transient in 15 minutes instead of 2 hours!

Page 62: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)
Page 63: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)
Page 64: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

Conclusions

�Recent progress makes Nonlinear MPC with first principles models in millisecond range possible (now 15 000 x faster than1998)

�Emerging consensus for NMPC algorithms:• employ direct, simultaneous methods• use Initial Value Embedding (first order predictor)• perform Real-Time Iterations to trace NMPC problem

solution while data change• Use SQP type method to track active set changes

Page 65: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

An Invitation

�13th Czech-French-German Conference onOptimization (CFG07), Heidelberg, Germany, September 17-21, 2007. (inv. speakers: Fletcher, Scherer, Trelat, Waechter,...) Traditionally strong in optimal control.

Page 66: Fast Nonlinear Model Predictive Control Algorithms and Applications …bonnans/… ·  · 2007-06-20Fast Nonlinear Model Predictive Control Algorithms and Applications in ... (DAE)

4 PhD Positions in Numerical Optimization:

• Sequential Convex Programming Algorithms for Nonlinear SDP

• Large Scale & PDE Constrained Real-Time Optimization Algorithms

• Fast Model Predictive Control Applications in Mechatronic Systems

• Shape Optimization of Mechanical Parts under Inertia Loading

(deadline: June 21, 2007)