Efficient Symbolical and Numerical Algorithms for nonlinear model - - PowerPoint PPT Presentation

efficient symbolical and numerical algorithms for
SMART_READER_LITE
LIVE PREVIEW

Efficient Symbolical and Numerical Algorithms for nonlinear model - - PowerPoint PPT Presentation

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann Department of Engineering and Mathematics University of Applied Sciences Bielefeld A Modelica-based Tool Chain (Johan


slide-1
SLIDE 1

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica

Bernhard Bachmann Department of Engineering and Mathematics University of Applied Sciences Bielefeld

slide-2
SLIDE 2

A Modelica-based Tool Chain

(Johan Åkesson)

Symbolic maniulation Index reduction Analytic solution of simple equations Code generation Residual equations Analytic Jacobians Numerical solvers NLP algorithms Integrators Result Post processing Visualization Flattening of Modelica source code Compiler front-end Unstructured Flat DAE Transformed flat ODE (index 1 system) C code Solution profiles

slide-3
SLIDE 3

3

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Outline

  • 1. Excerpt of OpenModelica’s symbolic machinery
  • 2. Symbolically derived Jacobians

i. Directional derivatives ii. Sparsity pattern iii. Coloring of the Jacobian

  • 3. Nonlinear Optimal Control Problem

i. General Discretization Scheme ii. Multiple Shooting/Collocation iii. Total Collocation iv. Applications

  • 4. Lessons learned & Outlook
slide-4
SLIDE 4

4

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Symbolic Machinery of OpenModelica

 

, ( ), ( ), ( ), ( ), time ( ) vector of differentiated state variables ( ) vector of state variables ( ) vector of algebraic variables (t) vector of input variables v f t x t x t y t u t p t x t x t y t u p  ector of parameters and/or constants General representation of DAEs (continuous signals):

slide-5
SLIDE 5

5

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Basic Transformation Steps

 

, ( ), ( ), ( ), ( ), f t x t x t y t u t p 

Transformation to explicit state-space representation: Implicit function theorem: Necessary condition for the existence of the transformation is that the following matrix is regular at the point of interest:

 

det , ( ), ( ), ( ), f t z t x t u t p z         

 

( ) , ( ), ( ), ( ), , ( ) ( ) x t f t z t x t u t p z t y t        

 

( ) ( ) , ( ), ( ), ( ) x t z t g t x t u t p y t        

   

( ) , ( ), ( ), ( ) , ( ), ( ), x t h t x t u t p y t k t x t u t p  

slide-6
SLIDE 6

6

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Symbolic Transformation Algorithmic Steps

  • DAEs and bipartite graph representation

– Structural representation of the equation system

  • The matching problem

– Assign to each variable exact one equation – Same number of equations and unknowns

  • Construct a directed graph

– Find sinks, sources and strong components – Sorting the equation system

  • Adjacence Matrix and structural regularity

– Block-lower triangular form (BLT-Transformation)

 

, ( ), ( ), ( ), ( ), f t x t x t y t u t p 

 

( ) , ( ), ( ), ( ), , ( ) ( ) x t f t z t x t u t p z t y t        

 

( ) ( ) , ( ), ( ), ( ) x t z t g t x t u t p y t        

   

( ) , ( ), ( ), ( ) , ( ), ( ), x t h t x t u t p y t k t x t u t p  

slide-7
SLIDE 7

7

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

DAEs and Bipartite Graph Representation

f1(z3,z4) = 0 f2(z2) = 0 f3(z2,z3,z5) = 0 f4(z1,z2) = 0 f5(z1,z3,z5) = 0 Example of a regular DAE:

f1 f3 f2 f4 f5 z1 z3 z2 z4 z5

Bipartite graph Adjacence matrix

0 0 1 1 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 0 1 0 1 z1 z2 z3 z4 z5 f1 f2 f3 f4 f5

 

( ) , ( ), ( ), ( ), , ( ) ( ) x t f t z t x t u t p z t y t        

slide-8
SLIDE 8

8

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

f1(z3,z4) = 0 f2(z2) = 0 f3(z2,z3,z5) = 0 f4(z1,z2) = 0 f5(z1,z3,z5) = 0 Example of a regular DAE: Bipartite graph

f1 f3 f2 f4 f5 z1 z3 z2 z4 z5

Solve the Matching Problem

slide-9
SLIDE 9

9

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

f1 f3 f2 f4 f5 z1 z3 z2 z4 z5

Construct a Directed Graph

slide-10
SLIDE 10

10

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

f1 f3 f2 f4 f5 z1 z3 z2 z4 z5

Construct a Directed Graph

slide-11
SLIDE 11

11

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

f1|z4 f3 f2 f4 f5 z1 z3 z2 z5

Construct a Directed Graph

slide-12
SLIDE 12

12

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

f1|z4 f3 f2 f4 z1 z2 z5 f5|z3

Construct a Directed Graph

slide-13
SLIDE 13

13

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

f1|z4 f3 f2 z2 z5 f5|z3 f4|z1

Construct a Directed Graph

slide-14
SLIDE 14

14

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

f1|z4 f2 z2 f5|z3 f4|z1 f3|z5

Construct a Directed Graph

slide-15
SLIDE 15

15

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

f1|z4 f5|z3 f4|z1 f3|z5 f2|z2

source sink strong component Tarjan’s algorithm f2(z2) f4(z1,z2) f3(z2,z3,z5) f5(z1,z3,z5) f1(z3,z4)

= 0 = 0 = 0 = 0 = 0 1 0 0 0 0 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 1

z2 z1 z3 z5 z4

f2 f4 f3 f5 f1

Construct a Directed Graph

slide-16
SLIDE 16

16

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Further Efficiency Issues - Dummy-Derivative Method

  • Matching algorithm fails

– System is structurally singular – Find minimal subset of equations

  • more equations than unknown variables

– Singularity is due to equations, constraining states

  • Differentiate subset of equations

– Static state selection during compile time

  • choose one state and corresponding derivative as purely

algebraic variable

  • so-called dummy state and dummy derivative
  • by differentiation introduced variables are algebraic
  • continue matching algorithm
  • check initial conditions

– Dynamic state selection during simulation time

  • store information on constrained states
  • make selection dynamically based on stability criteria
  • new state selection triggers an event (re-initialize states)
slide-17
SLIDE 17

17

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Further Efficiency Issues – Algebraic Loops

  • Solution of linear equation systems

– Advanced solver packages (e.g. LAPACK) are used – Calculate LU-Decomposition for constant matrices

  • Small systems are inverted symbolically
  • Solution of nonlinear systems

– Advanced solver packages are used

  • Performance is depending on good starting values

– Analytical Jacobian is provided symbolically

  • Tearing systems of equations

– Reducing the iteration variables dramatically

  • Analytical Jacobians of the overall system

– Minimize simulation/integration time needed

slide-18
SLIDE 18

18

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Outline

  • 1. Excerpt of OpenModelica’s symbolic machinery
  • 2. Symbolically derived Jacobians

i. Directional derivatives ii. Sparsity pattern iii. Coloring of the Jacobian

  • 3. Nonlinear Optimal Control Problem

i. General Discretization Scheme ii. Multiple Shooting/Collocation iii. Total Collocation iv. Applications

  • 4. Lessons learned & Outlook
slide-19
SLIDE 19

19

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Fast Simulation of Fluid Models with Colored Jacobians

Willi Braun, Bernhard Bachmann Department of Engineering and Mathematics University of Applied Sciences Bielefeld Stephanie Gallardo Yances, Kilian Link Siemens AG, Energy Section Erlangen (see 9th International Modelica Conference)

slide-20
SLIDE 20

20

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Symbolically Generation of Jacobians

slide-21
SLIDE 21

21

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Symbolically Generation of Jacobians

slide-22
SLIDE 22

22

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Symbolically Generation of Jacobians

slide-23
SLIDE 23

23

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Symbolically Generation of Jacobians

slide-24
SLIDE 24

24

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Symbolically Generation of Jacobians

slide-25
SLIDE 25

25

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Symbolically Generation of Jacobians

slide-26
SLIDE 26

26

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Compute sparsity pattern of the Jacobians

slide-27
SLIDE 27

27

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Compute sparsity pattern of the Jacobians

slide-28
SLIDE 28

28

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Utilize sparsity pattern of the Jacobians

slide-29
SLIDE 29

29

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Utilize sparsity pattern of the Jacobians

slide-30
SLIDE 30

30

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Performance gain of implementation

slide-31
SLIDE 31

31

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Outline

  • 1. Excerpt of OpenModelica’s symbolic machinery
  • 2. Symbolically derived Jacobians

i. Directional derivatives ii. Sparsity pattern iii. Coloring of the Jacobian

  • 3. Nonlinear Optimal Control Problem

i. General Discretization Scheme ii. Multiple Shooting/Collocation iii. Total Collocation iv. Applications

  • 4. Lessons learned & Outlook
slide-32
SLIDE 32

32

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Parallel Multiple-Shooting and Collocation Optimization with OpenModelica

Bernhard Bachmann, Lennart Ochel, Vitalij Ruge Mathematics and Engineering University of Applied Sciences Bielefeld Mahder Gebremedhin, Peter Fritzson, PELAB – Programming Environment Lab Vaheed Nezhadali, Lars Eriksson, Martin Sivertsson Vehicular Systems Linköping University (see 9th International Modelica Conference)

slide-33
SLIDE 33

33

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Mathematical problem formulation

– objective function min

𝑣 𝑢 𝐾 𝑦 𝑢 , 𝑣 𝑢 , 𝑢 = 𝐹 𝑦 𝑢𝑔

+ 𝑀 𝑦 𝑢 , 𝑣 𝑢 , 𝑢 𝑒𝑢

𝑢𝑔 𝑢0

– subject to 𝑦 𝑢0 = ℎ0 initial conditions 𝑦 𝑢 = 𝑔 𝑦 𝑢 , 𝑣 𝑢 , 𝑢 DAEs, Modelica 𝑕 𝑦 𝑢 , 𝑧 𝑢 , 𝑣 𝑢 , 𝑢 ≥ path constraints 𝑠 𝑦 𝑢𝑔 , 𝑧(𝑢𝑔) = terminal constraints

Nonlinear Optimal Control Problem (NOCP)

slide-34
SLIDE 34

34

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

General discretization scheme Theoretical Background

𝑢0 𝑢1 𝑢2 𝑢3 ℎ1 ℎ2 ℎ3 𝑦𝑗 𝑢𝑗+1 = ℎ𝑗 + 𝑔 𝑦𝑗 𝑢 , 𝑣 𝑢 , 𝑢 𝑒𝑢

𝑢𝑗+1 𝑢𝑗

𝑦𝑗 𝑢𝑗 = ℎ𝑗

slide-35
SLIDE 35

35

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

𝑦𝑗 𝑢𝑗+1 = ℎ𝑗 + 𝑔 𝑦𝑗 𝑢 , 𝑣 𝑢 , 𝑢 𝑒𝑢

𝑢𝑗+1 𝑢𝑗

≈ 𝐺 𝑢𝑗, 𝑢𝑗+1, ℎ𝑗, 𝑣𝑗 , 𝑦𝑗 𝑢𝑗 = ℎ𝑗

Multiple Shooting/Collocation

  • Solve sub-problem in each sub-interval

Theoretical Background

𝑢0 𝑢1 𝑢2 𝑢3 ℎ1 ℎ2 ℎ3

slide-36
SLIDE 36

36

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Multiple Shooting / Collocation Optimization

  • Discretized Nonlinear Optimal Control Problem

– objective function (integral approximation by trapezoidal rule) min

𝑣 𝑢 𝐾 𝑦 𝑢 , 𝑣 𝑢 , 𝑢 = 𝐹 ℎ𝑜 + Δ𝑢

2 𝑀 ℎ𝑗, 𝑣𝑗, 𝑢𝑗 + 𝑀 ℎ𝑗+1, 𝑣𝑗, 𝑢𝑗+1

𝑜−1 𝑗=0

– subject to 𝑦 𝑢0 = ℎ0 𝐺 𝑢𝑗, 𝑢𝑗+1, ℎ𝑗, 𝑣𝑗 = ℎ𝑗+1 𝑕 ℎ𝑗, 𝑣𝑗, 𝑢𝑗 ≥ 𝑕 ℎ𝑗+1, 𝑣𝑗, 𝑢𝑗+1 ≥

Theoretical Background

slide-37
SLIDE 37

37

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Multiple Shooting / Collocation Optimization Theoretical Background

Local Discretization Problem Shooting Optimization Optimizer solve evaluate new value

Optimum

slide-38
SLIDE 38

38

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Total Collocation Optimization Theoretical Background

Total conditions Optimizer evaluate new value

  • ptimum
slide-39
SLIDE 39

39

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Total Collocation Optimization

  • Discretized Nonlinear Optimal Control Problem

– objective function (integral approximation by Gauß quadrature)

min

𝑣 𝑢 𝐾 𝑦 𝑢 , 𝑣 𝑢 , 𝑢 = 𝐹 ℎ𝑜 + Δ𝑢 𝑥 𝑘 ⋅ 𝑀 ℎ𝑗 (𝑘), 𝑣𝑗, 𝑢𝑗 + 𝑡 𝑘 𝑜−1 𝑗=0 𝑛 𝑘=0

– subject to

𝑦 𝑢0 = ℎ0 𝑕 ℎ𝑗, 𝑣𝑗, 𝑢𝑗 ≥ 𝑕 ℎ𝑗+1, 𝑣𝑗, 𝑢𝑗+1 ≥ additional collocation conditions Theoretical Background

slide-40
SLIDE 40

40

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Collocation Condition – Approximation of States

  • Assumption:

States are locally polynomial

𝑦𝑗 𝑢𝑗 + 𝑡 ⋅ Δ𝑢 = 𝑞0 𝑡 ⋅ ℎ𝑗−1

(𝑛) + 𝑞𝑘 𝑡 𝑛 𝑘=1

⋅ ℎ𝑗

(𝑘)

where 𝑦𝑗 𝑢𝑗 + 𝑡 𝑙 ⋅ Δ𝑢 = 𝜀𝑙,0 ⋅ ℎ𝑗−1

𝑛 +

𝜀𝑙,𝑘

𝑛 𝑘=1

⋅ ℎ𝑗

𝑘 = ℎ𝑗 𝑙

𝑡 𝑙 are the Radau points

𝑞𝑘 𝑡 are the Lagrange Basis polynomial to the nodes 𝑡 𝑙

  • Collocation conditions

Δ𝑢 ⋅ 𝑔 ℎ𝑗

𝑘 , 𝑣𝑗, 𝑢𝑗 + 𝑡 𝑙 ⋅ Δ𝑢 = 𝑞0 ′ 𝑡 𝑙 ⋅ ℎ𝑗−1 (𝑛) + 𝑞𝑘 ′ 𝑡 𝑙 𝑛 𝑘=1

⋅ ℎ𝑗

(𝑘)

Theoretical Background

slide-41
SLIDE 41

41

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Collocation Condition – Approximation of State Derivatives

  • Assumption:

State derivatives are locally polynomial

Δ𝑢 ⋅ 𝑔 𝑦𝑗 𝑢𝑗 + 𝑡 ⋅ Δ𝑢 , 𝑣𝑗, 𝑢𝑗 + 𝑡 ⋅ Δ𝑢 = 𝑞𝑘 𝑡

𝑛 𝑘=0

⋅ 𝑔

𝑗 (𝑘)

where Δ𝑢 ⋅ 𝑔 ℎ𝑗

𝑙 , 𝑣𝑗, 𝑢𝑗 + 𝑡 𝑙 ⋅ Δ𝑢 =

𝜀𝑙,𝑘

𝑛 𝑘=0

⋅ 𝑔

𝑗 𝑘 = 𝑔 𝑗 (𝑙)

𝑡 𝑘 are the Lobatto points

𝑞𝑘 𝑡 are the Lagrange Basis polynomial to the nodes 𝑡 𝑘

  • Collocation conditions

ℎ𝑗

𝑙 = ∫ 𝑞𝑘 𝑡 𝑙 𝑛 𝑘=0

⋅ 𝑔

𝑗 (𝑘) + ℎ𝑗−1 (𝑛)

Theoretical Background

slide-42
SLIDE 42

42

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

  • Find fuel optimal control and state

trajectories from idling condition to a certain power level

  • Nonlinear mean value engine model
  • Only diesel operating condition
  • Mathematical problem formulation:

– 2 inputs (𝑣𝑔, 𝑣𝑥𝑕) – 4 states (𝜕𝑗𝑑𝑓, 𝑞𝑗𝑛, 𝑞𝑓𝑛, 𝜕𝑢𝑑) – 32 algebraic equations

Applications – Diesel Electric Powertrain

slide-43
SLIDE 43

43

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

  • Mathematical problem formulation

– Object function min

𝑣 𝑢 𝑦𝑗 𝑢𝑔 − 𝑦𝑗 𝑠𝑓𝑔 2 + 𝑛

𝑔

𝑈

𝑒𝑢

4 𝑗=1

– subject to 𝑦 1 = 𝑔

1 𝑦2, 𝑦3, 𝑣1

𝑦 2 = 𝑔

2 𝑦1, 𝑦2, 𝑦4

𝑦 3 = 𝑔

3 𝑦1, 𝑦2, 𝑦3, 𝑣1, 𝑣2

𝑦 4 = 𝑔

4 𝑦2, 𝑦3, 𝑦4, 𝑣2

𝑦𝑚𝑐𝑗 ≤ 𝑦𝑗 ≤ 𝑦𝑣𝑐𝑗, 𝑗 = 1, … , 4 0 ≤ 𝑣1, 𝑣2 ≤ 1

Applications – Diesel Electric Powertrain

Engine is accelerated only near the end

  • f the time interval to meet the end

constraints while minimizing the fuel consumption

slide-44
SLIDE 44

44

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

  • Realization with OpenModelica Environment
  • Optimica prototype implementation is available
  • Using Ipopt for solution process
  • Necessary derivatives are numerically calculated

– Gradients, Jacobians, Hessians, …

  • But: Complete tool chain not yet implemented

Implementation Details – Current Status

Test Environment

  • Processor:
  • 2xIntel Xeon CPU E5-2650

16 cores @ 2.00GHz

  • OpenMP
slide-45
SLIDE 45

45

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

  • Schematic view of the required components of Ipopt

Implementation Details – Ipopt & Parallelization

Ipopt constraints Jacobian

  • bject

function gradient Hessian of the Lagrangian

slide-46
SLIDE 46

46

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

  • Enormous speed-up when utilizing sparse Jacobian matrix
  • Speed-up for the over-all optimization
  • Sparse-structure model independent

Implementation Details - Numerical Optimization

0s 20s 40s 60s 80s 100s 120s DENSE SPARSE

ipopt

TOTAL COLLOCATION TOTAL COLLOCATION 2 0s 2s 4s 6s 8s 10s 12s 14s 16s 18s DENSE SPARSE

jac_g

TOTAL COLLOCATION TOTAL COLLOCATION 2

slide-47
SLIDE 47

47

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Results - Diesel Electric Powertrain

Diesel

MULTIPLE SHOOTING

921,6s

MULTIPLE COLLOCATION

29519,8s

TOTAL COLLOCATION

9,5s

TOTAL COLLOCATION 2

15,6s

slide-48
SLIDE 48

48

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

  • Ipopt runs in serial mode
  • Most execution time is elapsed in Jacobian calculation and

solution process of the local discretization problem

  • Reasonable speed-up
  • Factors are non-optimal due to memory handling

– Further investigations will be performed

Results - Diesel Electric Powertrain

0,0 2,0 4,0 6,0 8,0 10,0 12,0 14,0 16,0 1 2 4 8 16

MULTIPLE_SHOOTING

ipopt [scaled] jac_g [scaled] 0,0 2,0 4,0 6,0 8,0 10,0 12,0 14,0 16,0 1 2 4 8 16

MULTIPLE_COLLOCATION

ipopt [scaled] jac_g [scaled]

slide-49
SLIDE 49

49

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

0,0 2,0 4,0 6,0 8,0 10,0 12,0 14,0 16,0 1 2 4 8 16

TOTAL COLLOCATION

ipopt [scaled] jac_g [scaled] 0,0 2,0 4,0 6,0 8,0 10,0 12,0 14,0 16,0 1 2 4 8 16

TOTAL COLLOCATION 2

ipopt [scaled] jac_g [scaled]

  • Ipopt runs in serial mode
  • Less execution time is elapsed in Jacobian calculation
  • Reasonable speed-up for Jacobian calculation
  • Factors are non-optimal due to memory handling
  • Overall Speed-up increases with model complexity

– Parallelizing of Ipopt necessary

Results - Diesel Electric Powertrain

slide-50
SLIDE 50

50

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

  • Symbolic calculation of derivatives improve performance

– Jacobian, Gradient, …

  • Utilizing sparsity pattern is crucial
  • In serial mode total collocation methods are superior to

multiple shooting/collocation methods

  • Parallelizing the algorithms performs better on multiple

shooting/collocation methods

  • Symbolic transformation to ODE form is a key issue for the

realization of an automatic tool chain Lessons learned

slide-51
SLIDE 51

51

Example 1 – From the dark side (Francesco Casella)

  • ptimization Example1A(
  • bjective = a1/b1*(x1 – x10)^2 +

a2/b2*(x2 – x20)^2 + a3/b3*(x3 – x30)^2, ... end Example1A;

  • ptimization Example1B(
  • bjective = f1 + f2 + f3,

... equation f1 = a1/b1*(x1 – x10)^2; f2 = a2/b2*(x2 – x20)^2; f3 = a3/b3*(x3 – x30)^2; ... end Example1B;

slide-52
SLIDE 52

52

Example 2 – From the dark side (Francesco Casella)

  • ptimization Example2A(

parameter Real PR = 10; ... equation p_in/p_out = PR “Turbine pressure ratio”; ... end Example1A;

  • ptimization Example2A(

parameter Real PR = 10; ... equation p_in = PR*p_out “Turbine pressure ratio”; ... end Example1A;

slide-53
SLIDE 53

53

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

  • Implement complete tool chain in OpenModelica
  • Automatic generation of simulation code based on Optimica
  • Utilizing symbolically derived derivative information

– Gradient, Jacobian, Hessian, …

  • Further improvements with appropriate scaling
  • Exploiting parallel evaluation of the optimization method
  • Advanced use of OMC symbolic machinery

– Efficient handling of model dependent algebraic loops

  • Generalization of NOCP problem formulation

– e.g. time minimal optimization, parameter estimation

  • Further testing on industrial-relevant problems

Future work

slide-54
SLIDE 54

54

Efficient Symbolical and Numerical Algorithms for nonlinear model predictive control with OpenModelica Bernhard Bachmann, et. al.

Thank you Questions?