Presentation is loading. Please wait.

Presentation is loading. Please wait.

4th April 2005 Colloquium on Predictive Control, Sheffield 1 Nonlinear Model Predictive Control using Automatic Differentiation Yi Cao Cranfield University,

Similar presentations


Presentation on theme: "4th April 2005 Colloquium on Predictive Control, Sheffield 1 Nonlinear Model Predictive Control using Automatic Differentiation Yi Cao Cranfield University,"— Presentation transcript:

1 4th April 2005 Colloquium on Predictive Control, Sheffield 1 Nonlinear Model Predictive Control using Automatic Differentiation Yi Cao Cranfield University, UK

2 4th April 2005Colloquium on Predictive Control, Sheffield2 Outline  Computation in MPC  Dynamic Sensitivity using AD  Nonlinear Least Square MPC  Error Analysis and Control  Evaporator Case Study  Performance Comparison  Conclusions

3 4th April 2005Colloquium on Predictive Control, Sheffield3 Computation in Predictive Control  Predictive control: at t k, calculate OC for t k · t· t k+P, apply only u(t k ), repeat at t k+1  Prediction: online solving ODE  Optimization: repeat prediction, sensitivity required.  Typically, over 80% time spend on solving ODE + sensitivity

4 4th April 2005Colloquium on Predictive Control, Sheffield4 Current Status  Linear MPC successfully used in industry  Most systems are nonlinear. NMPC desired.  Computation: solving ODE and NLP online.  Difficult to get gradient for large ODE systems.  Finite difference: inefficient and inaccurate  Sensitivity equation: n×m ODE’s  Adjoint system: TPB problem  Other methods: sequential linearization and orthogonal collocation

5 4th April 2005Colloquium on Predictive Control, Sheffield5 Automatic Differentiation  Limitation of finite and symbolic difference  Function = sequence of fundamental OP  Derivatives of fundamental OP are known  Numerically apply chain rules  Basic modes: forward and reverse  Implementation:  operating overloading  Source translation

6 4th April 2005Colloquium on Predictive Control, Sheffield6 ODE and Automatic Differentiation  z(t)=f(x), x(t)=x 0 +x 1 t+x 2 t 2 +…+x d t d  z(t)=z 0 +z 1 t+z 2 t 2 +…+z d t d  AD forward: z k = z k (x 0,x 1,…,x k )  AD reverse:  z k /  x j =  z k-j /  x 0 = A k-j  f’(x)=A 0 +A 1 t+  +A d t d  ODE: dx/dt=f(x), dx/dt=z(t), x k+1 =z k /(k+1).  x 0 =x(t 0 ), x 1 =z 0 (x 0 ), x 2 =z 1 (x 0,x 1 ), …  Sensitivity: B k =dx k /dx 0 =1/k  k i=0 A k-i-1 B i, B 0 =I  dB/dt=f’(x), B=B 0 +B 1 t+  +B d t d  x(t 0 +1)=  d i=0 x i, dx(t 0 +1)/dx 0 =  d i=0 B i

7 4th April 2005Colloquium on Predictive Control, Sheffield7 Non-autonomous Systems I  For control systems: dx/dt=f(x,u)  u(t)=u 0 +u 1 t+u 2 t 2 +…+u d t d  (x 0, u(t)) → x(t), dx(t)/du k =?  Method I: Augmented system:  dv 1 /dt=v 2, …, dv d+1 /dt=0, v k+1 (t 0 )=u k, u=v 1  X=[x T v T ] T, dX/dt=F(X) (autonomous)  High dimension system, n+md  Not suitable for systems with large m

8 4th April 2005Colloquium on Predictive Control, Sheffield8 Non-autonomous Systems II  Method II: nonsquare AD  Let v=[u 0 T, u 1 T, …, u d T ] T  x k+1 = z k (x 0,x 1,…,x k,v)/(k+1)  A k =[A kx | A kv ] := [  z k /  x 0 |  z k /  v]  B k =[B kx | B kv ] := [dx k /dx 0 | dx k /dv]  B k = A k-1 +  k-1 j=1 A (k-j-1)x B j, B 0 =[I | 0]  x(t 0 +1)=  d k=0 x k,  dx(t 0 +1)/dv=  d k=0 B kv, dx(t 0 +1)/dx(t 0 )=  d k=0 B kx

9 4th April 2005Colloquium on Predictive Control, Sheffield9 Nonlinear Least Square MPC  Φ=½∑ P k=0 (x(t k )-r k ) T W k (x(t k )-r k ) s.t. dx/dt=f(x,u,d), t  [t 0, t P ], x(t 0 ) given, u j =u(t j )=u(t), t  [t j, t j+1 ], u j =u M-1, j  [M, P-1], L≤u≤V, scale  t=t j+1 -t j =1.  Nonlinear LS: min L≤U≤V Φ=½E(U) T E(U)  Jacobian: J(U)=∂E/∂U  Gradient: G(U)=J T (U)E(U)  Hessian: H(U)=J T (U)J(U)+Q(U)≈J T (U)J(U)

10 4th April 2005Colloquium on Predictive Control, Sheffield10 ODE and Jacobian using AD  Efficient algorithm requires efficient J(U)  Difficult: E(U) is nonlinear dynamic  J i,j =W i ½ dx(t i )/du j-1 for i≥j, otherwise, J i,j =0  Algorithm: for k=0:P-1, x 0 =x(t k )  Forward AD: x i, i=1,…,d, → x(t k+1 )  Reverse AD: A ix, A iu  Accumulate: B ix, B iu, → B u (k)=  B iu, B x (k)=  B ix  J (k+1)j =W k+1 ½ B x (k)…B x (j)B u (j-1), j=1,…,k+1  K=k+1

11 4th April 2005Colloquium on Predictive Control, Sheffield11 NLS MPC using AD  Collect information: x, d, r, etc.  Nonlinear LS to give a guess u  Solve ODE and calculate J  Update u and check convergence  Implement the first move

12 4th April 2005Colloquium on Predictive Control, Sheffield12 Error Analysis  Taylor coefficients by AD is accurate.  x(t k )=  x k has truncation error, e k (local).  e k will propagated to k+1, …, P (global).  Local error controllable by order and step  Global error depend on sensitivity dx k1 /dx k  Remainder:  k ≈C(h/r) k+1  Convergence radius: r ≈ r k =|x k-1 |/|x k |   k-1 =  k (r/h)=  k +|x k | →  k =|x k |/(r/h-1)

13 4th April 2005Colloquium on Predictive Control, Sheffield13 Error Control  Tolerance  <  d  Increase order, d or decrease step, h?  Decrease h by h/c (c>1):  =  d (1/c) d+1  c=(  d /  ) 1/(d+1), increase op by factor c  Increase d to d+p (p>0):  =  d (h/r) p  p=ln(  /  )/ln(h/r), increase op by (1+p/d) 2  c<(1+p/d) 2 decrease h,  otherwise increase d

14 4th April 2005Colloquium on Predictive Control, Sheffield14 Case Study  Evaporator process Evaporator process Evaporator process  3 measurable states: L2, X2 and P2  3 manipulates: 0≤F2≤4, 0≤P100,F200≤400  Set point change:X2 from 25% to 15% P2 from 50.5 kPa to 70 kPa  Disturbance: F1, X1, T1 and T200  20%  All disturbance unmeasured.  T=1 min, M=5 min, P=10 min, W=[100,1,1]

15 4th April 2005Colloquium on Predictive Control, Sheffield15 Evaporation Process

16 4th April 2005Colloquium on Predictive Control, Sheffield16 Simulation Results

17 4th April 2005Colloquium on Predictive Control, Sheffield17 Performance Comparison  CVODES, a state-of-the-art solver for dynamic sensitivity.  Simultaneously solves ODE and sensitivity  Two approaches: full & partial integration.  Three approaches programmed in C  Tested on Windows XP P-IV 2.5GHz  Solve evaporator ODE + sensitivity using input generated by NMPC.

18 4th April 2005Colloquium on Predictive Control, Sheffield18 Accuracy and Efficiency Taylor AD CVODES P CVODES F ToldtimeerrortimeerrortimeError 1e-44.0087e-5.0224e-4.8124e-3 1e-66.0097e-8.0429e-51.648e-5 1e-88.0114e-11.0632e-62.362e-6 1e-1111.0135e-13.1146e-94.563e-11

19 4th April 2005Colloquium on Predictive Control, Sheffield19 Conclusions  AD can play an important role to improve nonlinear model predictive control  Efficient algorithm to integrate ODE at the same time to calculate sensitivity  Error analysis and control algorithm  Efficiency validated via comparison with state-of-the-art software.  Satisfactory performance with Evaporator study


Download ppt "4th April 2005 Colloquium on Predictive Control, Sheffield 1 Nonlinear Model Predictive Control using Automatic Differentiation Yi Cao Cranfield University,"

Similar presentations


Ads by Google