You are on page 1of 8

EECE 360

Lecture 9
Review: Canonical Forms
!  Transfer
...()...function
1211120110 nnn to state-space
nnnnbsbsbsbGssasasa
!!! !!!++++=++++

State Equation Representation of


Dynamic Systems (cont’d)

Dr. Oishi
Electrical and Computer Engineering
University of British Columbia
http://courses.ece.ubc.ca/360
eece.360@gmail.com Control canonical form Observer canonical form
Chapter 3.3-3.5
EECE 360 v2.4 1 EECE 360 v2.4 2

State-space equations The State Transition Matrix


!  Last week !  Consider the homogenous (i.e. zero-input) dynamics:
!  State-space to transfer function
!  Transfer function to state-space
!  Control canonical form
!  Observer canonical form !  The solution to this equation represents the
evolution of the system’s free response to non-zero
initial conditions:
!  Today State
!  Solution to state-space: x(t) = … transition
matrix
!  More examples

EECE 360 v2.4 3 EECE 360 v2.4 4


The State Transition Matrix The State Transition Matrix
!  Given an initial value, the state transition !  Consider the homogenous (i.e. zero-input) dynamics:
matrix predicts the state at any other time

!  A Taylor’s series approximation taken about t=0


provides the solution

!  In which the matrix exponential is defined as


"
tk tk tk
e At = I + At + A 2 + ...+ A k + ... = # A k
!  So what is the state transition matrix? 2! k! k!
k=1
EECE 360 v2.4 5 EECE 360 v2.4 6

The Matrix Exponential State Transition Matrix


!  Useful matrix exponential properties !  Instead of solving in the time domain, consider
x˙ (t) = Ax(t)
sX(s) " x(0) = AX(s)
(sI " A)X(s) = x(0)
In MATLAB:
X(s) = (sI " A)"1 x(0) = #(s)x(0)

!  In the Laplace domain, the state transition matrix is


"(s) = (sI # A)#1
!  Makes computation of eAt easier for A with certain !
structure (e.g., diagonal, upper triangular, !  therefore "(t) = L#1 ("(s)) = L#1 ((sI # A)#1 )
symmetric, otherse)
!
EECE 360 v2.4 7 EECE 360 v2.4 8
!
Example 2 Example 2
!  Recall from last lecture !  Again consider the system
#"1 0 & #"1 0 &
x˙ = Ax, A = % x˙ = Ax, A = %
$ 0 "3(' $ 0 "3('
!  Since A is diagonal, the matrix exponential is
with initial condition x(0) = [1 1]T.
#e"t 0&
! Previously: Solved directly in time domain.
At
! e = %$ 0 e"3t ('
! 

!  Now: Solve in s-domain, then take inverse


!  The solution to x ˙ = Ax with x(0) = [1 1]T is Laplace transform
#e"t 0 & #1& # e"t &
x(t) = e At x(0) = % "3t ( % ( = % "3t (
x(t) = "(t)x(0) = L#1 ((sI # A)#1 ) x(0)
! $ 0 e ' $1' $e '
EECE 360 v2.4 ! 9 EECE 360 v2.4 10

!
!
#"1 0 & #"1 0 &
A =% A =%
Example 2 $ 0 "3(' Example 2 $ 0 "3('

!  Find the inverse matrix !  Using Laplace transform tables (App. D.1)
"1
)#s 0& #"1 !0 &, x(t) = L"1 ((sI " A)"1 ) x(0)! 1 t n#1e#at
(sI " A)"1 = +% ("% (. n "
*$0 s' $ 0 "3'- #e"t 0 & #1& (s + a) (n #1)!
#s + 1 0 &
"1 =% "3t ( % (
=% $ 0 e ' $1'
$ 0 s + 3(' # e"t &
= % "3t ( !
1 #s + 3 0 &
= $e '
(s + 1)(s + 3) %$ 0 s + 1('
# 1 & This is the same result as we got from
! 
%s + 1 0 (
! solving directly for e .
=% At
1 (
%$ 0 s + 3('
EECE 360 v2.4 11 EECE 360 v2.4 12

!
State Transition Matrix Example 3
!  The matrix exponential can be easily solved for some !  Given
forms of A (diagonal, upper triangular, and others)
!  The state transition matrix is
!  **But for general A, an easier way to solve for the
state transition matrix is to find its Laplace
transform.

!  Can be computed in Matlab using ‘expm’ for specific


A and t

!  The time-domain state transition matrix can be


obtained using the inverse Laplace transform

EECE 360 v2.4 13 EECE 360 v2.4 14

Example 3 Example 3
!  Find !  State transition matrix (time domain)

!  And using known Inverse Laplace Transforms (Table


D.1, Dorf and Bishop), !  With initial conditions x0 = [1 1]T, the free (unforced)
response is

EECE 360 v2.4 15 EECE 360 v2.4 16


State Transition Matrix State Transition Matrix
!  For the homogeneous system x˙ (t) = Ax(t) !  In the time-domain:
we examined two ways to solve for x(t):
x˙ = Ax + Bu
At
x(t) = "(t)x(0), "(t) = e e ( x˙ " Ax) = e " AtBu
" At

"1
!
x(t) = L (#(s)) x(0), #(s) = (sI " A)"1 d " At
(e x) = e " AtBu
dt
t t
!!  Now, for the inhomogeneous system d " A#
$ d# (e x)d# = $ e " A#Bu(# )d#
! x˙ (t) = Ax(t) + Bu(t) 0 0
t
(e.g. with a non-zero input (forcing
function)), what is the solution x(t)?
" At
e x(t) " e " A%0
x(0) = $e " A#
Bu(# )d#
0
EECE 360 v2.4 17 EECE 360 v2.4 18
!

State Transition Matrix State Transition Matrix


Now examine in the Laplace domain
!  Rearranging, ! 

t x˙ (t) = Ax(t) + Bu(t)


x(t) = eAtx(0) + $ e " A ( t "# ) Bu(# )d# sX(s) " x(0) = AX(s) + BU(s)
0 "1 "1
At X(s) = (sI " A) x(0) + (sI " A) BU(s)
!  Recall that "(t) = e
Recall that
!  Therefore the solution is ! 
#1
! t
"(s) = (sI # A)
x(t) = "(t)x(0) + % "(t # $ )Bu($ )d$ ! !  Therefore the solution in the Laplace domain is
! 0

Natural Forced
X(s) = "(s)x(0) + "(s)BU(s)
!
response response
!
EECE 360 v2.4 EECE 360 v2.4
19 20

!
State Transition Matrix State Transition Matrix
!  This solution matches the time-domain solution !  Note that the system response has two
components:
X(s) = "(s)x(0) + "(s)BU(s)
!  Natural response – “zero input response” due to
t initial conditions
x(t) = "(t)x(0) + % "(t # $ )Bu($ )d$ !  Forced response – “zero state response” due to
0
input
!
Natural Forced !  Overall response is the sum of the two
response response t
! x(t) = "(t)x(0) + % "(t # $ )Bu($ )d$
!  To solve for x(t) it is often easier to use the Laplace 0

domain, then take the inverse Laplace transform of "(t) = eAt Natural Forced
the result. response response
EECE 360 v2.4 21 EECE 360 v2.4 22

#"1 0 & #1&


Example 1B Example 1B
A =% (, B =% (
$ 0 "3' $2'

!  Consider the system !  Solve by using the Laplace domain representation


#"1 0 & #1& ! + "(s)BU(s)
X(s) = "(s)x(0)
x˙ (t) = Ax(t) + Bu(t), A = % (, B =% (
$ 0 "3' $2' "(s) = (sI # A)
#1

with initial condition x(0) = [1 1]T and input u(t)=1(t).


!  From Example 2, Lecture 9, we know
! 1 #s + 3 0 &
!  What is the state at t=1 ? At t=5 ?
! (sI " A)"1 =
! (s + 1)(s + 3) %$ 0 s + 1('
!  Solution: Find
t !  Therefore
x(t) = "(t)x(0) + % "(t # $ )Bu($ )d$ ! "(s)x(0) =
1 #s + 3 0 & #1&
0 (s + 1)(s + 3) %$ 0 s + 1(' %$1('

EECE 360 v2.4 23 EECE 360 v2.4 24

! !
#"1 0 & #1& #"1 0 & #1&
Example 1B Example 1B
A =% (, B =% ( A =% (, B =% (
$ 0 "3' $2' $ 0 "3' $2'

X(s) = "(s)x(0) + "(s)BU(s)


!  Natural response: !  Total response (Laplace domain)
# 1
s+1
& ! X(s) = "(s)x(0) + "(s)BU(s)
! Laplace
"(s)x(0) = % 1 ( 1 & # 1 & # 1 & transform pairs
$ s+3 ' # s+1
! = % 1 ( + % s(s+1) s
2 ( = % s+2 (
1 t n#1e#at
$ s+3 ' $ s(s+3)' $ s(s+3)' n "
(s + a) (n #1)!
!  Forced response: 1 e#at # e#bt
1 #s + 3 0 & #1& (s + a)(s + b)
"
b#a
"(s)BU(s) = U(s)
! (s + 1)(s + 3) %$ 0 s + 1(' %$2(' !  Total response (time-domain)
#1& 1 !
= % s+1
2 ( U(s), U(s) =
x(t) = L"1 (#(s)x(0)) + L"1 (#(s)BU(s)
! )
$ s+3 ' s
$ e"t ' $ 1" e"t ' $ 1 '
# 1 & = & "3t ) + & 2 "3t ) = & 1 "3t )
= % s(s+1)
2 ( %e ( % 3 (1" e )( % 3 (2 + e )(
$ s(s+3)'
EECE 360 v2.4 25 EECE 360 v2.4 26

! !

# e"t & # 1" e"t & # 1 & # e"t & # 1" e"t & # 1 &
Ex. 1B x(t) = % "3t ( + % 2 "3t ( = % 1 "3t (
$e ' $ 3 (1" e )' $ 3 (2 + e )' Ex. 1B x(t) = % "3t ( + % 2 "3t ( = % 1 "3t (
$e ' $ 3 (1" e )' $ 3 (2 + e )'

!  In Matlab, we can plot this result ! Defining the variables!


>> t = 0:.1:5;! >> title('Time Response to
! !
>> x = [ones(size(t)); 1/3* Initial Conditions and
Step Input')!
(2+exp(-3*t))];!
>> xN = [exp(-t); ! Plotting the middle graph
!exp(-3*t)];! >> subplot(312);!
>> xF = [1-exp(-t); >> plot(t,xN);!
!2/3*(1-exp(-3*t))];! >> ylabel('Natural');!
!  Plotting the bottom graph!
!  Plotting the top graph! >> subplot(313);!
>> subplot(311);! >> plot(t,xF);!
>> plot(t,x);! >> xlabel('t')!
>> ylabel('Cumulative');! >> ylabel('Forced');
>> legend('x_1','x_2');!

EECE 360 v2.4 27 EECE 360 v2.4 28


# e"t & # 1" e"t & # 1 &
Ex. 1B x(t) = % "3t ( + % 2 "3t ( = % 1 "3t (
$e ' $ 3 (1" e )' $ 3 (2 + e )' Using Matlab: ‘lsim’
!  Can also obtain the cumulative response with ‘lsim’!
!
>> A = [-1 0; 0 -3];!
>> B = [1 2]';!
>> C = eye(2,2);!
>> D = 0;!
>> sys = ss(A,B,C,D);!
>> t = 0:.1:5;!
>> u = ones(size(t));!
>> x0 = [1 1]';!
>> [y,t,x]=lsim(sys,u,t,x0);!
>> plot(t,x);!

EECE 360 v2.4 29 EECE 360 v2.4 30

Summary
!  Canonical forms
!  Control canonical
!  Observer canonical
!  State transition matrix "(t)
At
!  Matrix exponential e
!  State transition equation
x(t) = "(t)x(0), "(t) = e At
!
x(t) = L#1 ("(s)) x(0), "(s) = (sI # A)#1
!
EECE 360 v2.4 31

You might also like