Dr. Simulation & Optimization Team Interdisciplinary Center for Scientific Computing (IWR) University of Heidelberg Short course Nonlinear Parameter Estimation and Optimum Experimental Design June 22 & 23, 2006 Heidelberg
Overview Ordinary Differential Equations (ODE) Boundary Conditions Measurement Functions Differential-Algebraic Equations (DAE) Multi Stage Processes Partial Differential Equations (PDE) and Method of Lines (MOL) Models with Switches
Dynamic Systems Nonlinear Parameter Estimation = find parameters of a nonlinear dynamic system What type of dynamic system? Stochastic or deterministic? Discrete or continuous time? Discrete or continuous states?
Dynamic Systems Nonlinear Parameter Estimation = find parameters of a nonlinear dynamic system What type of dynamic system? Stochastic or deterministic? Discrete or continuous time? Discrete or continuous states? In this workshop, treat deterministic differential equation models (ODE/DAE/PDE)
Ordinary Differential Equations (ODE) System dynamics are influenced by manipulated controls and unknown parameters: ẋ(t) = f(t, x(t), u(t), p) simulation interval: [t 0, t end ] time t [t 0, t end ] state x(t) R n x controls u(t) R n u manipulated parameters p R n p unknown
ODE Example: Harmonic Oscillator Mass m with spring constant k and unknown friction coefficient β: ẋ 1 (t) = x 2 (t) ẋ 2 (t) = k m (x 2(t) u(t)) βx 1 (t) state x(t) R 2 position of mass x 1 (t) velocity of mass x 2 (t) control: spring position u(t) R 1 manipulated parameter: friction β R 1 unknown
Initial Value Problems (IVP) THEOREM [Picard 1890, Lindelöf 1894]: Initial value problem in ODE ẋ(t) = f(t, x(t), u(t), p), t [t 0, t end ], ẋ(t 0 ) = x 0 with given initial state x 0, parameters p, and controls u(t), and Lipschitz continuous f(t, x, u(t), p) has unique solution x(t), t [t 0, t end ] NOTE: Existence but not uniqueness guaranteed if f(t, x, u(t), p) only continuous [G. Peano, 1858-1932].
Boundary Conditions Constraints on initial or intermediate values are important part of dynamic model. STANDARD FORM: r(x(t 0 ), x(t 1 ),..., x(t end ), p) = 0, r R n r E.g. fixed or parameter dependent initial value x 0 : x(t 0 ) x 0 (p) = 0 (n r = n x ) or periodicity: x(t 0 ) x(t end ) = 0 (n r = n x ) NOTE: Initial values x(t 0 ) need not always be fixed!
Measurement Functions We can measure functions of states and parameters: b i (t i, x(t i ), p), i = 1,..., M b i R altogether M measurements measurement times t 1,..., t M [t 0, t end ]
Example: Photosynthesis Baake, Schlöder, 1992 three experiments with different light intensities: (Laboratorium Strasser, Stuttgart)
Photosynthesis: ODE electron transport chain in photosynthesis: mathematical model: nonlinear ODE with 6 states and 6 parameters ẋ 1 = (k a + k 3 (p tot x 6 ))x 1 + k 3 x 5 x 6 ẋ 2 = k a x 1 (k 1 + k 3 (p tot x 6 ))x 2 + k 1 x 3 + k 3 x 6 (1 P ẋ 3 = k 1 x 2 (k a + k 1 )x 3 ẋ 4 = k a x 3 k 2 x 4 + k 2 x 5 ẋ 5 = k 3 x 1 (p tot x 6 ) + k 2 x 4 (k a + k 2 + k 3 x 6 )x 5 ẋ 6 = k 3 (1 4X x i )x 6 + k 3 (x 1 + x 2 )(p tot x 6 ) + (p tot i=1 with k a = I 2 (1 p 2T ) 1 p 22 p 2T + p 22 p 2T x 1 + x 3 + x 5 )
Photosynthesis: boundary conditions Initial values are given (partly depending on parameters): r(x(0), p) = x 1 (0) c 1 x 2 (0) c 2 x 3 (0) c 3 x 4 (0) c 4 x 5 (0) c 5 = 0 x 6 (0) p tot
Photosynthesis: measurement function fluorescence is nonlinear function of states and parameters: b i (x(t i ), p) = { } 1 p 2T p 22 + 1 (x 1(t i ) + x 3 (t i ) + x 5 (t i )) p 2T 1 + p 22p 2T (x 1 (t i )+x 3 (t i )+x 5 (t i )) 1 p 2T p 22 S I 2 extra parameter (S) in measurement function (unknown gauge of apparatus) Fluorescence measured at 96 time points t 1,..., t 96. Aim: Estimate model parameters from fluorescence measurements of living tobacco leaf
Photosynthesis: multiple experiment structure Data: 3 experiments with different light intensities ( 96 fluorescence measurements) to estimate: 4 system parameter p tot, p 2T, p 22, k 3 + 1 measurement parameter S + 3 x 2 parameter depending on experiment k lim, I 2
Overview Ordinary Differential Equations (ODE) Boundary Conditions Measurement Functions Differential-Algebraic Equations (DAE) Multi Stage Processes Partial Differential Equations (PDE) and Method of Lines (MOL) Models with Switches
Differential-Algebraic Equations (DAE) Augment ODE by algebraic equations g and algebraic states z ẋ(t) = f(t, x(t), z(t), u(t), p) 0 = g(t, x(t), z(t), u(t), p) differential states algebraic states algebraic equations x(t) R n x z(t) R n z g( ) R n z Standard case: index one matrix g z Rn z n z invertible. Existence and uniqueness of initial value problems similar as for ODE.
DAE Example: Distillation Column 40 trays 2 controls u(t): reflux L vol, heating power Q (Diehl, Uslu, 2001) 10 parameters to be estimated, e.g. tray efficiency, heat losses temperature sensors on all 40 trays: tray number 40 35 30 25 20 15 10 5 0 60 70 80 90 100 temperature [ o C]
Distillation Column: DAE model n v l = V m (X l, T l ) n l for l = 0,..., N + 1, L vol = V m (X N+1, T C )L N+1, V m (X, T ) := XV m 1 V m k m (T ) + (1 X)V2 (T ). (T ) := 1 a k exp bk (1+exp (1 T /ck ) (d k)). Ẋ 0 n 0 + X 0 ṅ 0 = V 0 Y 0 + L 1 X 1 BX 0, Ẋ l n l +X l ṅ l = V l 1 Y l 1 V l Y l +L l+1 X l+1 L l X l P l = P l+1 + P l l = N, N 1,..., 2, 1, 0. l = 1, 2,..., N F 1, N F + 1,..., N P l P s 1 (T l)x l P s 2 (T l)(1 X l ) = 0, Ẋ NF n NF + X NF ṅ NF = V NF 1Y NF 1 V NF Y N P s k (T ) := exp A k B k T + C k «k = 1, 2. +L NF +1X NF +1 L NF Ẋ N+1 n N+1 +X N+1 ṅ N+1 = V N Y N DX N+1 L N+1 X After elimination 82 differential and 122 algebraic equations remain, implemented in C
Distillation column: boundary conditions Scenario: Start in Steady State for fixed inputs u(t) = u start, then step in u(t) initial values y(0), z(0) unknown, but satisfy Steady State equation [ ] f(y(0), z(0), p, u start ) g(y(0), z(0), p, u start ) = 0. two of 40 measured temperatures, and controls L vol, Q: T 28 [ o C] T 14 [ o C] 71 70 69 68 0 1000 2000 3000 4000 5000 89 88 87 86 0 1000 2000 3000 4000 5000 5 L vol [l/h] Q [kw] 4.5 4 0 1000 2000 3000 4000 5000 3 2.5 2 0 1000 2000 3000 4000 5000 time [s]
Multi Stage Processes Two dynamic stages can be connected by a discontinuous transition. E.g. Intermediate Fill Up in Batch Distillation Volume transition x 1 (t 1 ) = f tr (x 0 (t 1 ), p) x 0 (t) dynamic stage 0 x 1 (t) t 1 dynamic stage 1 time
Multi Stage Processes II Also different dynamic systems can be coupled. E.g. batch reactor followed by distillation (different state dimensions) A + B C x 0 (t) transition x 1 (t 1 ) = f tr (x 0 (t 1 ), p) x 1 (t) dynamic stage 0 t 1 dynamic stage 1 time
Overview Ordinary Differential Equations (ODE) Boundary Conditions Measurement Functions Differential-Algebraic Equations (DAE) Multi Stage Processes Partial Differential Equations (PDE) and Method of Lines (MOL) Models with Switches
Partial Differential Equations Instationary partial differential equations (PDE) arise e.g in transport processes, wave propagation,... Also called distributed parameter systems Often PDE of subsystems are coupled with each other (e.g. flow connections) Method of Lines (MOL): discretize PDE in space to yield ODE or DAE system. Often MOL can be interpreted in terms of compartment models. Best seen at example.
Simulated Moving Bed (SMB) Process Work with A. Toumi, S. Engell (Dortmund) Chromatographic separation of fine chemicals.
Method of Lines (MOL) E.g. transport equations in each SMB column: c b t = K(c 2 c b b c p ) + D ax x 2 + u c b x, introduce spatial grid points x 0,..., x N approximate spatial derivatives, e.g. by finite differences c b x c b(x i+1 ) c b (x i ) x i+1 x i, etc. define state vector x col := (c b (x 0 ),..., c b (x N )), obtain ODE ẋ col (t) = f col (x col (t), u(t), p)
Simulated Moving Bed Principle Columns coupled in loop, plus in- and outlet ports. Desorbent (D) Zone I... Extrakt (A+D) A B Zone IV... Direction of port switching... Zone II... Raffinate (B+D) Zone III Feed (A+B+D) Periodic switching simulates countercurrent, leads to cyclic steady state.
SMB: Cyclic Steady State Zone I: REGENERATION OF ADSORBENT Zones II-III: SEPARATION ZONES Zone IV: RECYCLING OF ELUENT Concentration [g/l] 1 2 3 4 5 6 t=0 Eluent Extract Feed Raffinate Eluent Extract Feed Raffinate After one cycle system state is simply shifted in space. Continuous and discrete dynamics of one cycle can be summarized in a map Γ.
SMB: Measurements of average cycle before measurements start, cycle is repeated until cyclic steady state (CSS)is reached measurements obtained during many identical cycles, averaged values are much less noisy, want to use for parameter estimation But how to simulate this process? Find CSS for given parameters!
SMB: How to compute Cyclic Steady State? Conventional approach: Successive simulation until (CSS) is reached: x css smb = Γ(Γ(Γ (Γ(x 0 }{{} smb)))). n css Disadvantage: many cycles needed, periodicity only approximated. Boundary value problem approach: Formulate multi stage problem, leave initial value free, impose periodic boundary conditions: x css smb Γ(x css smb) = 0
Models with Switches: Overflow Example overflow non-smooth function of filling level h: { 0 if h h max f(h) = C(h h max ) 3 2 else 20 15 10 5 0 5 0 2 4 6 8 10 Weir overflow if filled over given level (e.g. on distillation tray) sign of switching function s := h h max determines which model is taken. state dependent switches must be treated efficiently (C. Kirches)
Summary Dynamic models for parameter estimation consist of differential equations (ODE/DAE/PDE) boundary conditions, e.g. initial/final values, periodicity measurement functions DAE standard form: ẋ(t) = f(t, x(t), z(t), u(t), p) 0 = g(t, x(t), z(t), u(t), p)