Advanced Mechatronics Engineering German University in Cairo 21 December, 2013
Outline Necessary conditions for optimal input Example Linear regulator problem Example
Necessary conditions for optimal input The problem is to find an optimal input (u ) that causes the system ẋ(t) = f(x(t), u(t), t), (1) to follow a trajectory (x ) that minimizes the performance measure tf J(x(t), t) = h(x(t f ), t f ) + g(x(τ), u(τ), τ)dτ. (2) t 0
Necessary conditions for optimal input The Hamiltonian is given by H(x(t), u(t), p(t), t) g(x(t), u(t), t) + p T (t) [f(x(t), u(t), t)]. (3) The necessary conditions of optimality are ẋ (t) = H p (x (t), u (t), p (t), t), (4) ṗ (t) = H x (x (t), u (t), p (t), t), (5) 0 = H u (x (t), u (t), p (t), t). (6)
Example The system ẋ 1 (t) = x 2 (t) (7) ẋ 2 (t) = x 2 (t) + u(t) (8) is to be controlled so that its input is conserved. Therefore, the performance measure is given by J(u) = tf The Hamiltonian (36) is given by t 0 1 2 u2 (t)dt. (9) H(x(t), u(t), p(t), t) = 1 2 u2 (t)+p 1 (t)x 2 (t) p 2 (t)x 2 (t)+p 2 (t)u(t). (10)
Example H(x(t), u(t), p(t), t) = 1 2 u2 (t)+p 1 (t)x 2 (t) p 2 (t)x 2 (t)+p 2 (t)u(t). The necessary conditions for optimality are (11) ṗ 1(t) = H x 1 = 0 (12) ṗ 2(t) = H x 2 = p 1(t) + p 2(t), (13) and 0 = H u = u (t) + p 2(t). (14)
Linear Regulator Problems The plant is described by the linear state equations ẋ(t) = A(t)x(t) + B(t)u(t) (15) which may have time-varying coefficients. The performance measure to be minimized is J = 1 2 xt (t f )Hx(t f ) + tf t 0 1 2 [ x T Qx + u T Ru ] dt, (16) where the final time t f is fixed. Further, H and Q are real symmetric positive semi-definite matrices. Finally, R is a real symmetric positive definite matrix. The Hamiltonian is H(x(t), u(t), p(t), t) g(x(t), u(t), t) + p T (t) [f(x(t), u(t), t)]. (17)
Linear Regulator Problems H(x(t), u(t), p(t), t) = 1 2 xt Qx+ 1 2 ut Ru+p T A(t)x(t)+p T B(t)u(t), (18) and the necessary conditions for optimality are ẋ (t) = A(t)x (t) + B(t)u (t), (19) ṗ (t) = Q(t)x (t) A T (t)p (t), (20) 0 = R(t)u (t) + B T (t)p (t). (21) Solving (54) for u (t) yields u (t) = R 1 (t)b T (t)p (t). (22) Substitution of (55) into (52) yields ẋ (t) = A(t)x (t) B(t)R 1 (t)b T (t)p (t). (23)
Linear Regulator Problems Putting (53) and (56) into the following matrix format ẋ (t) A(t) B(t)R 1 (t)b T (t) x (t) =. (24) ṗ (t) Q(t) p (t) p (t) The solution of these equations has the following form x (t f ) x (t) = ϕ(t f, t), (25) p (t f ) p (t) where ϕ(t f, t) is the state-transition matrix of the system (57). x (t f ) ϕ 11 (t f, t) ϕ 12 (t f, t) x (t) =, (26) p (t f ) ϕ 21 (t f, t) ϕ 22 (t f, t) p (t)
Linear Regulator Problems From the boundary condition, the final co-states are related to the final states using p (t f ) = Hx (t f ). (27) Solving for p (t f ), we obtain p (t) = [ϕ 22 (t f, t) Hϕ 12 (t f, t)] 1 [Hϕ 11 (t f, t) ϕ 21 (t f, t)] x (t). (28) p (t) = K(t)x (t). (29) The optimal input is given by u (t) = R 1 (t)b T (t)k(t)x (t). (30)
Example It is desired to determine the input (using the principle of optimality and the Hamilton-Jacobi-Bellman equation) that causes the plant ẋ 1 = x 2 (t) (31) ẋ 2 = x 1 (t) 2x 2 (t) + u(t) (32) to minimize the performance measure J = 10x 2 1 (T ) + 1 2 T 0 [ x 2 1 (t) + 2x 2 2 (t) + u 2 (t) ]. (33)
State Transition Matrix Consider the scalar case ẋ(t) = ax(t). (34) Taking the Laplace transform of (34), we obtain sx (s) x(0) = ax (s), (35) X (s) = x(0) s a = (s a) 1 x(0). (36) Finally, inverse Laplace transform of (36) yields x(t) = e at x(0). (37)
State Transition Matrix Now consider the following homogenous state equation ẋ(t) = Ax(t). (38) sx(s) x(0) = AX(s), (39) X(s) = (si A) 1 x(0). (40) The inverse Laplace transform yields x(t) = L 1 [ (si A) 1] x(0) = e At x(0). (41) Therefore, the state transition matrix (e At ) is given by e At = L 1 [ (si A) 1]. (42)
State Transition Matrix Calculate the state transition matrix of the following system ] [ẋ1 = ẋ 2 [si A] = [si A] 1 = [ 1 0 2 3 ] [ ] x1 x 2 [ ] (s + 1) 0 2 (s + 3) (43) (44) [ (s+3) (s+1)(s+3) 0 2 (s+1) (s+1)(s+3) (s+1)(s+3) ] = [ 1 (s+1) 0 ( 1 (s+1) 1 (s+1) ) 1 (s+3) e At = L 1 [ (si A) 1], (45) [ e At e = t ] 0 (e t e 3t ) e 3t. ]
State Transition Matrix Calculate the state transition matrix of the following system ] [ ] [ ] [ẋ1 0 1 x1 = 2 3 ẋ 2 [si A] = x 2 [ ] s 1 2 (s + 3) (46) (47) e At = L 1 [ (si A) 1], (48) [ 2e = t e 2t e t e 2t ] 2e t + 2e 2t e t + 2e 2t. [si A] 1 = [ (s+3) (s+1)(s+2) 2 (s+1)(s+2) 1 (s+1)(s+2) s (s+1)(s+2) ]
State Transition Matrix If the matrix A can be transformed into a diagonal form, then the state transition matrix e At is given by e λ 1t 0... 0 e At = Pe Dt P 1 0 e λ 2t... 0 = P....... 0 P 1, (49) 0... 0 e λnt where P is a digonalizing matrix for A. Further, λ i is the ith eigenvalue of the matrix A, for i = 1,..., n.
State Transition Matrix Derivation: Consider the following homogenous state equation ẋ = Ax, (50) and the following similarity transformation: x = Pξ, ẋ = P ξ. (51) Substituting (51) in (50) yields ξ = P 1 APξ = Dξ. (52) Solution of (52) is using (51) ξ(t) = e Dt ξ(0), (53) x(t) = Pξ(t) = Pe Dt ξ(0), x(0) = Pξ(0). (54) Therefore x(t) = Pe Dt P 1 x(0) = e At x(0). (55)
State Transition Matrix Calculate the state transition matrix of the following system ] [ẋ1 = ẋ 2 [ 0 1 0 2 ] [ ] x1 x 2 (56) The eigenvalues of A are λ 1 = 0 and λ 2 = 2. A similarity transformation matrix P is [ ] 1 1 P =. (57) 0 2 Using (49) to calculate the state transition matrix e At = Pe Dt P 1 (58) [ ] [ ] [ ] 1 1 e 0 0 1 1 = 0 2 0 e 2t 2 0 1 2 [ e At 1 1 = 2 (1 ] e 2t ) 0 e 2t. (59)
Thanks Questions please