fast model predictive control for magnetic plasma control mpc … · 2016. 2. 29. · for magnetic...

100
Fast Model Predictive Control for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan Institute AWP15-ENR- 01/JSI-02

Upload: others

Post on 31-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Fast Model Predictive Control for Magnetic Plasma Control MPC using fast online 1st-order QP methods

Matija Perne Jožef Stefan Institute

AWP15-ENR-01/JSI-02

Page 2: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Linear dynamic system, optimum

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 2

● Discrete-time model:

Page 3: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Linear dynamic system, optimum

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 3

● Discrete-time model:

Page 4: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Linear dynamic system, optimum

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 4

● Discrete-time model:

● Cost minimization:

Page 5: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Linear dynamic system, optimum

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 5

● Discrete-time model:

● Cost minimization:

● Constraints:

Page 6: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Linear dynamic system, optimum

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 6

● Discrete-time model:

● Cost minimization:

● Constraints:

Page 7: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Planning the future

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 7

Page 8: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Planning the future

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 8

Page 9: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Planning the future

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 9

Page 10: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Quadratic program

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 10

Page 11: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Quadratic program

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 11

Hessian

Page 12: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Quadratic program

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 12

HessianGradient

Page 13: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Quadratic program

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 13

Hessian

Affine setGradient

Page 14: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Quadratic program

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 14

Hessian

Affine set

Polyhedron

Gradient

Page 15: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Quadratic program

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 15

Hessian

Affine set

Polyhedron

Gradient

Dual method

Page 16: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 16

Page 17: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 17

● Explicit MPC: solving the problem in advance

Page 18: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 18

● Explicit MPC: solving the problem in advance

– Solution piecewise linear

Page 19: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 19

● Explicit MPC: solving the problem in advance

– Solution piecewise linear

(http://www.seas.upenn.edu/~ese680/papers/explicit_linear_mpc.pdf)

Page 20: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 20

● Explicit MPC: solving the problem in advance

– Solution piecewise linear

– Active and inactive constraints:

(http://www.seas.upenn.edu/~ese680/papers/explicit_linear_mpc.pdf)

Page 21: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 21

● Explicit MPC: solving the problem in advance

– Solution piecewise linear

– Active and inactive constraints:

(http://www.seas.upenn.edu/~ese680/papers/explicit_linear_mpc.pdf)

Page 22: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 22

● Explicit MPC: solving the problem in advance

– Solution piecewise linear

– Active and inactive constraints:

(http://www.seas.upenn.edu/~ese680/papers/explicit_linear_mpc.pdf)

Page 23: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 23

● Explicit MPC: solving the problem in advance

– Solution piecewise linear

– Active and inactive constraints:

● Active set methods

Page 24: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 24

● Explicit MPC: solving the problem in advance

– Solution piecewise linear

– Active and inactive constraints:

● Active set methods

– Online search for active constraints

Page 25: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 25

● Explicit MPC: solving the problem in advance

– Solution piecewise linear

– Active and inactive constraints:

● Active set methods

– Online search for active constraints

– Iterative

Page 26: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 26

• Interior point methods

Page 27: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 27

• Interior point methods– Cost is modified with a steep smooth function

close to polyhedral constraints

Page 28: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 28

• Interior point methods– Cost is modified with a steep smooth function

close to polyhedral constraints

– Modified problem solved with unconstrained optimization method

Page 29: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 29

• Interior point methods– Cost is modified with a steep smooth function

close to polyhedral constraints

– Modified problem solved with unconstrained optimization method

– Modification decreased iteratively

Page 30: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 30

• Interior point methods– Cost is modified with a steep smooth function

close to polyhedral constraints

– Modified problem solved with unconstrained optimization method

– Modification decreased iteratively

• First order methods

Page 31: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 31

• Interior point methods– Cost is modified with a steep smooth function

close to polyhedral constraints

– Modified problem solved with unconstrained optimization method

– Modification decreased iteratively

• First order methods

– Inspired by gradient method

Page 32: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Solving the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 32

• Interior point methods– Cost is modified with a steep smooth function

close to polyhedral constraints

– Modified problem solved with unconstrained optimization method

– Modification decreased iteratively

• First order methods

– Inspired by gradient method

– Simple, low order of convergence

Page 33: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Existence of a solution

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 33

Page 34: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Existence of a solution

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 34

Page 35: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Existence of a solution

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 35

Page 36: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Existence of a solution

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 36

Soft constraints

Page 37: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Making the QP convenient

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 37

Page 38: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Simplifying the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 38

Move blocking, constraint reduction

Page 39: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Simplifying the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 39

Move blocking, constraint reduction

Page 40: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Simplifying the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 40

Move blocking, constraint reduction

Page 41: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Simplifying the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 41

Move blocking, constraint reduction

Page 42: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Simplifying the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 42

Move blocking, constraint reduction

Page 43: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Simplifying the QP

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 43

Move blocking, constraint reduction

Page 44: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

(http://animalswalls.blogspot.si/2011/08/cat-wallpapers.html)

Cat

Page 45: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Gradient method (ordinary)

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 45

(F. Borrelli, A. Bemporad, M. Morari, Predictive Control for linear and hybrid systems, 2015.)

unconstrained

constrained

Page 46: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lipschitz constant

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 46

Page 47: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Gradient method (ordinary)

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 47

(F. Borrelli, A. Bemporad, M. Morari, Predictive Control for linear and hybrid systems, 2015.)

unconstrained

constrained

Page 48: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Gradient method (fast)

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 48

(F. Borrelli, A. Bemporad, M. Morari, Predictive Control for linear and hybrid systems, 2015.)

unconstrained

constrained

Page 49: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lagrange multipliers

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 49

("Lagrange multiplier." Wikipedia, The Free Encyclopedia, 2015.)

Page 50: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lagrange multipliers

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 50

("Lagrange multiplier." Wikipedia, The Free Encyclopedia, 2015.)

Page 51: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lagrange multipliers

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 51

("Lagrange multiplier." Wikipedia, The Free Encyclopedia, 2015.)

Page 52: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lagrange and dual functions

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 52

(Stephen Boyd & Lieven Vandenberghe, Convex Optimization, Cambridge University Press 2004)

Page 53: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lagrange and dual functions

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 53

Page 54: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lagrange and dual functions

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 54

Page 55: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lagrange and dual functions

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 55

Page 56: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lagrange and dual functions

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 56

Page 57: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Lagrange and dual functions

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 57

Page 58: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

FGMdual

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 58

(generalized fast dual gradient method)

Page 59: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

FGMdual

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 59

(generalized fast dual gradient method)

Page 60: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

FGMdual

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 60

(generalized fast dual gradient method)

Page 61: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 61

Page 62: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 62

● Code generator:

Page 63: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 63

● Code generator:– Problem described in MATLAB

Page 64: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 64

● Code generator:– Problem described in MATLAB

– MATLAB does the offline calculations

Page 65: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 65

● Code generator:– Problem described in MATLAB

– MATLAB does the offline calculations

– MATLAB outputs the algorithm code in C

Page 66: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 66

● Code generator:– Problem described in MATLAB

– MATLAB does the offline calculations

– MATLAB outputs the algorithm code in C

– Code compiled, ran, result returned to MATLAB

Page 67: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 67

● Code generator:– Problem described in MATLAB

– MATLAB does the offline calculations

– MATLAB outputs the algorithm code in C

– Code compiled, ran, result returned to MATLAB

– FGMdual one of the supported algorithms

Page 68: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 68

● Code generator:– Problem described in MATLAB

– MATLAB does the offline calculations

– MATLAB outputs the algorithm code in C

– Code compiled, ran, result returned to MATLAB

– FGMdual one of the supported algorithms

● Knowing the code:

Page 69: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 69

● Code generator:– Problem described in MATLAB

– MATLAB does the offline calculations

– MATLAB outputs the algorithm code in C

– Code compiled, ran, result returned to MATLAB

– FGMdual one of the supported algorithms

● Knowing the code:– MATLAB code is long

Page 70: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

QPgen

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 70

● Code generator:– Problem described in MATLAB

– MATLAB does the offline calculations

– MATLAB outputs the algorithm code in C

– Code compiled, ran, result returned to MATLAB

– FGMdual one of the supported algorithms

● Knowing the code:– MATLAB code is long

– Generated code is confusing

Page 71: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan
Page 72: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan
Page 73: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan
Page 74: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan
Page 75: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan
Page 76: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Restart

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 76

(B. O’Donoghue, E. Candès, Adaptive Restart for Accelerated Gradient Schemes, Found Comput Math 2013.)

Page 77: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 77

• Upper bound on the required number of floating point operations that in turn stems from an upper bound on the iteration count

(S. Richter, Computational Complexity Certification of Gradient Methods for Real-Time Model Predictive Control, ETH Zurich 2012)

Page 78: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 78

• Upper bound on the required number of floating point operations that in turn stems from an upper bound on the iteration count

• accuracy => no. of iterations => no. of operations => computing time

Page 79: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 79

• Explicit: fixed complexity

Page 80: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 80

• Explicit: fixed complexity• Active set:

Page 81: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 81

• Explicit: fixed complexity• Active set:

– Finite termination

Page 82: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 82

• Explicit: fixed complexity• Active set:

– Finite termination

– Worst case number of iterations huge

Page 83: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 83

• Explicit: fixed complexity• Active set:

– Finite termination

– Worst case number of iterations huge

– Early termination unexplored

Page 84: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 84

• Explicit: fixed complexity• Active set:

– Finite termination

– Worst case number of iterations huge

– Early termination unexplored

• Interior point:

Page 85: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 85

• Explicit: fixed complexity• Active set:

– Finite termination

– Worst case number of iterations huge

– Early termination unexplored

• Interior point:– Certificates very conservative

Page 86: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 86

• Explicit: fixed complexity• Active set:

– Finite termination

– Worst case number of iterations huge

– Early termination unexplored

• Interior point:– Certificates very conservative

• First order:

Page 87: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 87

• Explicit: fixed complexity• Active set:

– Finite termination

– Worst case number of iterations huge

– Early termination unexplored

• Interior point:– Certificates very conservative

• First order:– Certificates within few orders of magnitude

Page 88: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 88

• State of the art for first order methods:

Page 89: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 89

• State of the art for first order methods:– Derived for certain (simpler) algorithms

Page 90: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 90

• State of the art for first order methods:– Derived for certain (simpler) algorithms

(not generalized, no restarting)

Page 91: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 91

• State of the art for first order methods:– Derived for certain (simpler) algorithms

(not generalized, no restarting)– Derived for certain (simpler) constraints

Page 92: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Complexity certification

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 92

• State of the art for first order methods:– Derived for certain (simpler) algorithms

(not generalized, no restarting)– Derived for certain (simpler) constraints

Page 93: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Nesterov

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 93

• Convex optimization

(Y. Nesterov, Introductory lectures on convex optimization : a basic course, Springer 2004)

Page 94: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Nesterov

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 94

• Convex optimization• Does not mention duality

(Y. Nesterov, Introductory lectures on convex optimization : a basic course, Springer 2004)

Page 95: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Richter

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 95

• MPC with some QP

(S. Richter, Computational Complexity Certification of Gradient Methods for Real-Time Model Predictive Control, ETH Zurich 2012)

Page 96: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Richter

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 96

• MPC with some QP• Duality: partial Lagrange relaxation

(simple state constraints), shows that complete is worse, but complete is what we need

(S. Richter, Computational Complexity Certification of Gradient Methods for Real-Time Model Predictive Control, ETH Zurich 2012)

Page 97: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Richter

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 97

• MPC with some QP• Duality: partial Lagrange relaxation

(simple state constraints), shows that complete is worse, but complete is what we need

• Duality: dual problem not strongly concave

(S. Richter, Computational Complexity Certification of Gradient Methods for Real-Time Model Predictive Control, ETH Zurich 2012)

Page 98: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Temporary conclusion

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 98

• What to do? Transform the MPC-obtained QP into dual space

Page 99: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Temporary conclusion

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 99

• What to do? Transform the MPC-obtained QP into dual space

• Follow either Richter or Nesterov with dual QP

Page 100: Fast Model Predictive Control for Magnetic Plasma Control MPC … · 2016. 2. 29. · for Magnetic Plasma Control MPC using fast online 1st-order QP methods Matija Perne Jožef Stefan

Temporary conclusion

Matija Perne | FMPCFMPC PM | Ljubljana | 25.02.2016 | Page 100

• What to do? Transform the MPC-obtained QP into dual space

• Follow either Richter or Nesterov with dual QP

• Preconditioning?• Restarting?