EL 625 Lecture 2 EL 625 Lecture 2 State equations of finite dimensional linear systems Continuous-time: ẋ(t) = A(t)x(t) + B(t)u(t) y(t) = C(t)x(t) + D(t)u(t) Discrete-time: x(t k+ ) = A(t k )x(t k ) + B(t k )u(t k ) y(t k ) = C(t k )x(t k ) + D(t k )u(t k ) state x(t) - vector of length n input u(t) - r output y(t) - m A,B,C and D are matrices of sizes n n, n r, m n and m r respectively If A,B,C,D are functions of time timevarying If these matrices are constant with time time-invariant
EL 625 Lecture 2 2 State Differential equations of circuits basic elements resistor, capacitor, inductor Resistor: v R (t) = R(t)i R (t) v R (t) : the voltage across the resistor i R (t) : the current through the resistor R(t) : the resistance A resistor is a zero-memory element i R R h h + v R Any circuit with only resistors (a purely resistive network) has zero-memory and is of zero order (needs no states to describe it)
EL 625 Lecture 2 3 Capacitor: i C (t) = q C (t), q C (t) = C(t)v C (t) where: i C (t) : the current through the capacitor q C (t) : the electrical charge in the capacitor v C (t) : the voltage across the capacitor C(t) C(t) dv C(t) dt : the capacitance = i C (t) dc(t) dt v C (t) If the capacitance does not change with time, C dv C(t) dt = i C (t) i C C h h + v C
EL 625 Lecture 2 4 Inductor: v L (t) = φ(t), φ(t) = L(t)i L (t) where: i L (t) : the current through the inductor v L (t) : the voltage across the inductor φ(t) : the flux stored in the inductor L(t) L(t) di L(t) dt : the inductance = v L (t) dl(t) dt i L (t) If the inductance does not change with time, L di L(t) dt = v L (t) i L L h h + v L
EL 625 Lecture 2 5 Example: '$ + &% e (t) + v L (t) v 2 (t) + L i L (t) + v (t) C R i (t) C 2 R 2 i 2 (t) '$ + &% e 2 (t) Applying Kirchoff s current and voltage laws, i L = i + i 2 e = v L + i R + v e = v L + v 2 + i 2 R 2 + e 2 From the terminal relationships of the capacitors and the inductor, v = C i v 2 = C 2 i 2 i L = L v L
EL 625 Lecture 2 6 The inputs are e and e 2 The output is the voltage across the inductor, v L Choosing as our states, i L, v and v 2, x = i L v v 2, u = e e 2, y = [v L ] Need to express ẋ in terms of x and the inputs, e and e 2, i L = L v L But, v L is not a state variable we need to express v L in terms of the state variables and the inputs v L = i R R 2 L +v R 2 +v R 2 +e +e R 2 R + R 2 R + R 2 R + R 2 R + R 2 i L R R 2 R 2 R = i L + v + v 2 L(R + R 2 ) L(R + R 2 ) L(R + R 2 ) +e R + e 2 L L(R + R 2 )
EL 625 Lecture 2 7 Similarly, i = i L R 2 R + R 2 + v R + R 2 + v 2 R + R 2 + e 2 R + R 2 v = C i R 2 = i L + v + v 2 C (R + R 2 ) C (R + R 2 ) C (R + R 2 ) +e 2 C (R + R 2 ) i 2 = i L R R + R 2 + v R + R 2 + v 2 R + R 2 + e 2 R + R 2 v 2 = C 2 i 2 R = i L + v C 2 (R + R 2 ) +e 2 C 2 (R + R 2 ) C 2 (R + R 2 ) + v 2 C 2 (R + R 2 )
EL 625 Lecture 2 8 ẋ = Ax + Bu y = Cx + Du where A = B = R R 2 L(R +R 2 ) R 2 C (R +R 2 ) R C 2 (R +R 2 ) L R L(R +R 2 ) C (R +R 2 ) C 2 (R +R 2 ) R 2 L(R +R 2 ) C (R +R 2 ) C 2 (R +R 2 ) R L(R +R 2 ) C (R +R 2 ) C 2 (R +R 2 ) C = [ R R 2 R 2 R R +R 2 R +R 2 R +R 2 ] D = [ R R +R 2 ]
EL 625 Lecture 2 9 State Differential Equations of Mechanical Systems Spring: f K (t) = K(t)[z 2 (t) z (t)] Hooke s Law where: z (t) and z 2 (t) : the displacements of the two ends of the spring f K (t) : the force applied K(t) : the spring constant K z z 2 f K Damping Element: f D (t) = D(t)[v 2 (t) v (t)] where: v (t) and v 2 (t) : the velocities of the two ends of the damping element f D (t) D(t) : the force applied : the damping coefficient v v 2 f D D
EL 625 Lecture 2 Mass: M(t) dv(t) dt = f M (t) dm(t) dt v(t) where: v(t) : the velocity of the mass f M (t) : the force applied M(t) : the mass If mass does not change with time, M dv(t) dt = f M (t) M v f M
EL 625 Lecture 2 Example: D M x x 2 K M 2 f(t) f(t) is the input and x 2 (t) is the output u = [f(t)],y = [x 2 ] Choose as the state variables x, x 2, v and v 2 where v = ẋ and v 2 = ẋ 2 = x = x x 2 v v 2 M 2 v 2 = f(t) + K(x x 2 ) M v = K(x 2 x ) + D( v )
EL 625 Lecture 2 2 ẋ = Ax + Bu y = Cx + Du where A = B = C = [ K M K M 2 M 2 K M D M K M 2 ] D = []
EL 625 Lecture 2 3 Choice of state variables is not unique Let x a (t) be a valid set of state variables with ẋ a = A a x a + B a u y = C a x a + D a u () Consider x b (t) = T x a (t) where T is an n n nonsingular matrix ẋ b = T ẋ a = T A a T x b + T B a u y = C a T x b + D a u (2) x b (t) is also a valid set of state variables! where: ẋ b = A b ẋ b + B b u y = C b x b + D b u (3) A b = T A a T B b C b = T B b = C a T D b = D a (4) Similarity Transformation: x b = T x a
EL 625 Lecture 2 4 Convenient choice of state variables : inductor currents and capacitor voltages for fixed networks inductor fluxes and capacitor charges for time-varying networks differences in displacements of the ends of springs from their equilibrium positions and velocities of masses for mechanical systems Simulation Diagrams: Basic Simulator Elements: Dynamic element (a) integrator : for analog systems t u(t) y(t) = y(t ) + t u(τ) dτ y = D u (b) delay : for discrete-time systems u(t k ) y(t k ) = u(t k ) y = E u
EL 625 Lecture 2 5 2 Summing element - adder u (t) u 2 (t) u r (t) + + + '$ &% y(t) = r u i (t) i= 3 Scaling Element (Amplifier or Attenuator) u(t) K(t) y(t) = K(t) u(t) Minimal Realization: Fewest possible number of dynamic elements Convenient choice of state variables Outputs of integrators and delay elements Example: y + 3tÿ + 2ẏ + α(t)y = ü + e t u + u D 3 y + 3tD 2 y + 2Dy + α(t)y = D 2 u + e t Du + u (D is the derivative operator) y = D 3 { D 2 u 3tD 2 y + e t Du 2Dy + u α(t)y } y = D { D 2 (D 2 u 3tD 2 y) + D { D (e t Du 2Dy)
EL 625 Lecture 2 6 +D {u α(t)y} }} = D { u D 2 (3tD 2 y) + D { D (e t Du) 2y +D {u α(t)y} }} Using integration by parts, D 2 (3tD 2 y) = D (3tDy D (3Dy)) = D (3tDy 3y) = 3ty D (3y) D (3y) = 3ty D (6y) D (e t Du) = e t u + D (ue t ) Thus, y = D { u 3ty + D 6y + D { e t u + D (ue t ) 2y +D {u α(t)y} }} = D { u 3ty + D { e t u + +4y + D {u + ue t α(t)y} }}
EL 625 Lecture 2 7 Simulation Diagram: u + e t α(t) 4 3t + + + + x 3 x + 2 + x y e t Choosing the outputs of the integrators as the states, we have ẋ = u 3tx + x 2 ẋ 2 = 4x + x 3 + e t u A(t) = x = 3t 4 α(t) x x 2 x 3 ẋ 3 = u( + e t ) α(t)x y = x ; B(t) = e t + e t ẋ = A(t)x + B(t)u ; C(t) = y = C(t)x + D(t)u T ; D(t) = []
EL 625 Lecture 2 8 Example: y(k + 3) + 3ky(k + 2) + 2y(k + ) + α(k)y(k) = u(k + 2) + e k u(k + ) +u(k) E 3 y(k) + 3kE 2 y(k) + 2Ey(k) + α(k)y(k) = E 2 u(k) + e k Eu(k) +u(k) where E is the delay operator y(k) = E 3{ E 2 u(k) 3kE 2 y(k) + e k Eu(k) 2Ey(k) + u(k) α(k)y(k) } = E { E 2 (E 2 u(k) 3kE 2 y(k)) + E { E (e k Eu(k) 2Ey(k)) +E {u(k) α(k)y(k)} }} E 2 (3kE 2 y(k)) = 3(k 2)y(k) E (e k Eu(k)) = e k u(k) Thus, y(k) = E { u(k) 3(k 2)y(k) + E { e (k ) u(k) 2y(k) +E {u(k) α(k)y(k)} }}
EL 625 Lecture 2 9 Simulation Diagram: u(k) α(k) 2 3(k 2) + + + x 3 x + 2 + x y(k) e (k ) Choosing the outputs of the delay elements as the states, we have x (k + ) = u(k) 3(k 2)x (k) + x 2 (k) x 2 (k + ) = e (k ) u(k) 2x (k) + x 3 (k) x 3 (k + ) = u(k) α(k)x (k) y(k) = x (k) x(k) = x (k) x 2 (k) x 3 (k) x(k + ) = A(k)x(k) + B(k)u(k) y(k) = C(k)x(k) + D(k)u(k)
EL 625 Lecture 2 2 A(k) = 3(k 2) 2 α(k) B(k) = e (k ) C(k) = [ ] D(k) = []
EL 625 Lecture 2 2 Simpler method if no derivatives of the input are in the equation: y (n) +α n (t)y (n ) +α n 2 (t)y (n 2) + +α (t)y () +α (t)y = β(t)u(t) (y (i) i th derivative of y(t)) Choose, x = y x 2 = y () x 3 = y (2) x n = y (n ) x = x x 2 x 3 x n ẋ = x 2 ẋ 2 = x 3 ẋ n = x n ẋ n = α n (t)x n α n 2 (t)x n α (t)x y = x +β(t)u(t)
EL 625 Lecture 2 22 ẋ = α α α n 2 α n } {{ } A A is in companion matrix form y = [ ] } {{ } C x + x + [] u }{{} D β } {{ } B Another method: Let α, α,, α n and β be constants D n y + α n D n y + α n 2 D n 2 y + + α Dy + α y = βu u D n y = α n D n y α n 2 D n 2 y α Dy α y + βu y = D n { α n D n y α n 2 D n 2 y α Dy α y + βu } = D { α n y + D { α n 2 y + D { +D ( α y + βu ) } }} }{{} n
EL 625 Lecture 2 23 ż = α n z + z 2 ż 2 = α n 2 z + z 3 z = ż n ż n = α z + x n = α z + βu z z 2 z n z n y = z z = α n α n 2 α 2 α α } {{ } A [ y = z + β } {{ } B z + [] }{{} C ] }{{} u D u This method gave different A and B matrices - z and x are related through a similarity transformation
EL 625 Lecture 2 24 where T = z = T x α n α 2 α n α α n It can be checked that A = T AT, B = T B, C = CT and D = D The D matrix does not change under a similarity transformation A non-singular D matrix = the impulse response has an impulse
EL 625 Lecture 2 25 MIMO systems: ÿ + t 2 ẏ 2 + ẏ + ty + y 2 = tu + u 2 ÿ 2 + tẏ + y 2 y = t u + u 2 From the first equation, D 2 y + t 2 Dy 2 + Dy + ty + y 2 = tu + Du 2 y = D 2{ t 2 Dy 2 Dy + Du 2 + tu ty y 2 } = D { D ( t 2 Dy 2 Dy + Du 2 ) + D {tu ty y 2 } } D (t 2 Dy 2 ) = t 2 y 2 D (2ty 2 ) Thus, y = D { u 2 y t 2 y 2 + D {2ty 2 + tu ty y 2 } } Similarly, from second equation, D 2 y 2 + tdy + y 2 y = tdu + u 2 y 2 = D 2{ tdu tdy + u 2 + y y 2 } = D { D (tdu tdy ) + D {u 2 + y y 2 } }
EL 625 Lecture 2 26 D (tdu ) = tu D u D (tdy ) = ty D y y 2 = D { tu ty + D {2y y 2 u + u 2 } } State-space realization: ẋ = x +x 2 t 2 x 3 +u 2 ẋ 2 = tx +(2t )x 3 +tu ẋ 3 = tx +x 4 +tu ẋ 4 = 2x x 3 u +u 2 y = x y 2 = x 2
EL 625 Lecture 2 27 Simulation Diagram u 2 u t t + + + x 2 + x y 2t t 2 + 2 + t x 4 + + x 3 y 2 t