Anda di halaman 1dari 59

Conlinuous-lime Syslems

A system is a device, process, algorithm etc which


operates on an input signal, u(t), to produce an
output signal, y(t)
A system with memory is called a dynamic system
Memory is associated with initial conditions
More soon! the idea of state

If the input and output signals are defined in
continuous time then the system is continuous-time
Our aim in this part of the course is to understand
how to describe and to analyze continuous-time
systems
MAE143A Signals & Systems Winter 2014 1
The IIan for lhis Seclion
Examples of continuous-time systems
RC electrical circuit, mass-spring-damper system
pendulum, motor
Description in terms of ordinary differential equations (odes)
Properties: causality, linearity, stability, dimension
Input-output solution of odes
Numerical, Math 20D, Laplace, Convolution
Initial condition dependent parts of the solution
Representations of linear systems
Impulse response, step response, transfer function, state
MAE143A Signals & Systems Winter 2014 2
The RC circuil as a syslem
The input signal is current u(t)
The output signal is voltage y(t)
Initial condition is y(0)
The capacitor is the only element with memory

Instead of looking at the circuit as an experimental
object to be analyzed, we are looking at it as a
system which transforms the input signal into the
output signal

Indeed, this particular circuit is very useful in
electronics - a low-pass filter circuit

MAE143A Signals & Systems Winter 2014 3
R
u(t)=i(t) C v
C
(t)=y(t)
i
R
(t)
i
C
(t)
+
-
RC circuil as a syslem
Circuit element relations




Kirchhoff's current law




A first-order linear dynamic system
Input, output, memory
MAE143A Signals & Systems Winter 2014 4
R
u(t)=i(t) C v
C
(t)=y(t)
i
R
(t)
i
C
(t)
+
-
dy(t)
dt
+
1
RC
y(t) =
1
C
u(t), y(0)
i
C
(t) = C
dv
C
(t)
dt
= C
dy(t)
dt
i
R
(t) =
1
R
v
C
(t) =
1
R
y(t)
u(t) = i(t) = i
R
(t) + i
C
(t)
C
dy
dt
(t) +
1
R
y(t) = u(t)
RC circuil as a syslem
ODE and I.C.

Solve this ODE using the integrating factor method for 1
st
order odes
The integrating factor is
MAE143A Signals & Systems Winter 2014 5
dy(t)
dt
+
1
RC
y(t) =
1
C
u(t), y(0)
e
R
t
0
1
RC
dz
= e
t/RC
y(t) = e
t/RC
y(0) +
1
C
Z
t
0
e
(t)/RC
u() d
d
dt
h
e
t/RC
y(t)
i
=

d
dt
e
t/RC

y(t) + e
t/RC

d
dt
y(t)
= e
t/RC

dy(t)
dt
+
1
RC
y(t)

=
1
C
e
t/RC
u(t)
e
t/RC
y(t) y(0) =
1
C
Z
t
0
e
/RC
u() d
RC Circuil as a Syslem
The RC circuit response to the input and i.c.
MAE143A Signals & Systems Winter 2014 6
R
u(t)=i(t) C v
C
(t)=y(t)
i
R
(t)
i
C
(t)
+
-
0 0.5 1 1.5 2 2.5 3 3.5
x 10
!4
!0.5
0
0.5
1
1.5
Voltage response [blue] to input current [green] with initial condition !2
Time (sec)
S
i
g
n
a
l

v
a
l
u
e
s

v
o
l
t
s
/
b
l
u
e

m
i
l
l
i
a
m
p
s
/
g
r
e
e
n
R 100 O
C 1 I
y(0) -0.5 V

u(l) is a 20s 100mA uIse


y(t) = e
t/RC
y(0) +
1
C
Z
t
0
e
(t)/RC
u() d
RC Circuil as a Syslem
Time constant of 100 sec
Output is the sum of two parts
Due to i.c. the zero input response
Due to input the zero state response




MAE143A Signals & Systems Winter 2014 7
y(t) = e
t/RC
y(0) +
1
C
Z
t
0
e
(t)/RC
u() d
R 100 O
C 1 I
y(0) -0.5 V

u(l) is a 20s
100mA uIse
1
C
Z
t
0
e
/RC
d =
RC
C
e
/RC

t
0
= R
h
e
t/RC
1
i
!"#$%!&
'
( !"$%!&
*

y(t) = 0.5e
10
4
t
+
(
0.1

1 e
10
4
t

for 0 t < 2 10
5
0.1

e
0.2
1

e
10
4
t
for 2 10
5
t
Syslem roerlies demonslraled by RC
Causal or nonanticipatory system
The output at any time t does not depend on the
input values for time greater than t
All natural systems are causal
ODEs solved forwards in time are causal

Stable system
The response to the initial condition and zero input
tends to zero as time tends to !
The response to a bounded input is bounded

Stability is a refined technical concept discussed in
many branches of engineering
MAE143A Signals & Systems Winter 2014 8
Syslems roerlies demonslraled by RC
Linearity
The response y(t) to input a
1
u
1
(t)+a
2
u
2
(t)is given by
a
1
y
1
(t)+a
2
y
2
(t) where y
1
(t) and y
2
(t) are the
responses to any u
1
(t) and u
2
(t) alone respectively
Linearity can be checked on the ODE itself
Time-invariance
Given that the response to input u(t) is y(t), the
response to input u(t-) is y(t-) for any value of
Finite dimension n
The number of initial condition data required to
define the solution is finite, n
is not finite-dimensional
MAE143A Signals & Systems Winter 2014 9
dy(t)
dt
= y(t 1)
Time-domain descrilion of syslems
Many continuous-time systems are described by ODEs
RC circuit



Forced mass-spring-damper system
Input u(t) is force
Output y(t) is position
MAE143A Signals & Systems Winter 2014 10
R
u(t)=i(t) C v
C
(t)=y(
t)
i
R
(t)
i
C
(t)
+
-
dy(t)
dt
+
1
RC
y(t) =
1
C
u(t), y(0)
M
D
K
,-./
0-./
M
d
2
y
dt
2
(t) + D
dy
dt
(t) + Ky(t) = u(t), y(t
0
), y
0
(t
0
)
d
2
y
dt
2
(t) +
D
M
dy
dt
(t) +
K
M
y(t) =
1
M
u(t), y(t
0
), y
0
(t
0
)
More examIes of syslems
Newtonian motion
Input force
Output position
Initial conditions; position, speed



Linear, time-invariant, causal, unstable, second-
order system
MAE143A Signals & Systems Winter 2014 11
drag
force
d
2
y
dt
(t) +
k
f
M
dy
dt
(t) =
1
M
u(t), y(t
0
), y
0
(t
0
)
More examIes of syslems
Simple pendulum
Input u(t) is force
Output (t) is angle
Initial conditions angle and
angular velocity




A nonlinear, unstable, second-order system
Linearization for small (t)
MAE143A Signals & Systems Winter 2014 12
L
,-./
!(l)
M
Mg sin !(l)
d
2
(t)
dt
2
+
g
L
sin (t) =
1
M
u(t), (t
0
),
0
(t
0
)
d
2

dt
(t) +
g
L
(t) =
1
M
u(t), (t
0
),
0
(t
0
)
One more examIe of a syslem
Electric motor
Input load torque T(t)
Output shaft angle (t)
Initial angle and angular velocity


I is the moment of inertia of motor and load
k
d
is the viscous damping
Load torque here is an external disturbance
applied by the outside world on the motor
The systems question is how well the motor can
cope with such changes
MAE143A Signals & Systems Winter 2014 13
I
d
2

dt
2
(t) + k
d
d
dt
(t) = T(t), (t
0
),
0
(t
0
)
SoIving Ordinary DierenliaI Iqualions
Be really very knowledgeable and clever
As we were in knowing about integrating factors

Have really very knowledgeable and clever software



Use numerical integration like Runge-Kutta methods
This is done in matlab using the general-purpose
numerical integration routine ode45
MAE143A Signals & Systems Winter 2014 14
>> dsoIve('Dy -y + sin(5l)','y(i/3)0')

ans sin(5l)/26 - (5cos(5l))/26 + (ex(i/3)(3^(1/2)/52 + 5/52))/ex(l)

NumericaI soIulion of RC ODI


Derivative function






Call to ode45
MAE143A Signals & Systems Winter 2014 15
|lo,yojode45(+RC_func,|0 31e-4j,-0.5),

Iol(lo,yo)
lilIe('VoIlage resonse by ode45 vilh iniliaI condilion -0.5')
xIabeI('Time (sec)'),yIabeI('SignaI vaIue voIls'), shg
funclion dy RC_func(l,y),
R100, C1e-6,

if l>0 && l<21e-5, u0.1,
eIse u0, end

dy -1/R/Cy+1/Cu,
relurn

0 0.5 1 1.5 2 2.5 3 3.5


x 10
!4
!0.5
0
0.5
1
1.5
Voltage response by ode45 with initial condition !0.5
SoIulion of Linear ODIs
Variation of parameters method (Lagrange)
Focus on fundamental and particular solutions
Solve the homogenous equation

This is usually done by factoring the characteristic
polynomial

This defines exponential modes in the solution
Then look for a particular solution
Then match the initial conditions to determine
multipliers
MAE143A Signals & Systems Winter 2014 16
y
(n)
(t) + a
1
y
(n1)
(t) + + a
n1
y
0
(t) + a
n
y(t) = b
1
u
(n1)
(t) + b
2
u
(n2)
(t) + + b
n1
u
0
(t) + b
n
u(t)
y
(n)
(t) + a
1
y
(n1)
(t) + + a
n1
y
0
(t) + a
n
y(t) = 0

n
+a
1

n1
+ +a
n1
+a
n
= 0
Varialion of aramelers
MAE143A Signals & Systems Winter 2014 17

2
+ 5 + 6 = ( + 2)( + 3)
Characlerislic equalion
y
f
(t) = Ae
2t
+ Be
3t
IundamenlaI soIulion
ODI y
00
+ 5y
0
p
+ 6y = cos 5t, y(0) = 0, y
0
(0) = 1
ComIele soIulion 1 and 2 chosen lo salisfy iniliaI condilions
y(t) =
27
29
e
2t

31
34
e
3t

19
986
cos 5t +
25
986
sin 5t
y
p
(t) = C cos 5t + Dsin5t
6y
p
(t) = 6C cos 5t + 6Dsin5t
5y
0
p
(t) = 25C sin5t + 25Dcos 5t
y
00
(t) = 25C cos 5t 25Dsin5t
y
00
p
+ 5y
0
p
+ 6y
p
= (19C + 25D) cos 5t + (25C 19D) sin5t

19 25
25 19

C
D

1
0

C
D

19
986
25
986

Smarl machines, smarler eoIe


>> dsolve('D2y = -5*Dy -6*y + cos(5*t)','Dy(0)=1','y(0)=0')

ans =

27/(29*exp(2*t)) - (19*cos(5*t))/986 - 31/(34*exp(3*t)) + (25*sin(5*t))/986

MAE143A Signals & Systems Winter 2014 18
MalIab can soIve symboIicaIIy generaI ODIs of recognizabIe
lyes
These formuIas are comIicaled lo aIy and lhe soIulions
are vaIid onIy for lhal inul funclion

Ior syslems, ve vanl lo consider soIulions for many


dierenl ossibIe inul funclions

We need more
ImuIse and Sle Resonses
Consider the solution for a linear time-invariant system
with impulse input and zero ics


This is known as the impulse response of the system
It is often denoted h(t)
Consider the solution to a step input and zero ics


This is known as the step response
Because

MAE143A Signals & Systems Winter 2014 19
y
(n)
(t) + a
1
y
(n1)
(t) + + a
n
y(t) = b
n1

(n1)
(t) + b
n2

(n2)
(t) + + b
n
(t)
y
(n1)
(0) = y
(n2)
(0) = = y(0) = 0
y
(n)
(t) + a
1
y
(n1)
(t) + + a
n
y(t) = b
n1
1
(n1)
(t) + b
n2
1
(n2)
(t) + + b
n
1(t)
y
(n1)
(0) = y
(n2)
(0) = = y(0) = 0
1(t) =
Z
t

() d
y
step
(t) =
Z
t

h() d
ConvoIulion SoIulions
Remember the -function sampling property


Rewrite the input function as

Treats the function as a weighted sum of shifted impulses
If h(t) is the impulse response then the response to u(t) is



This is the convolution integral for zero-state response
y
u
(t)=h(t)*u(t)
MAE143A Signals & Systems Winter 2014 20
Z
b
a
f(z)(z) dz = f(0) if 0 (a, b)
y
u
(t) =
Z

h(t )u() d
u(t) =
Z

u()(t ) d
ConvoIulion and lhe RC circuil
The solution for y(t) in terms
of u(t)


Impulse response response with zero i.c.s and input (t)



Solution for zero i.c. and arbitrary u(t)
MAE143A Signals & Systems Winter 2014 21
R
u(t)=i(t) C v
C
(t)=y(t)
i
R
(t)
i
C
(t)
+
-
y(t) = e
t/RC
y(0) +
1
C
Z
t
0
e
(t)/RC
u() d
h(t) = y

(t) =
1
C
Z
t
0

e
(t)/RC
() d
=
1
C
e
t/RC
1(t)
y(t) =
1
C
Z
t
0

e
(t)/RC
u() d = h(t) u(t) =
Z

h(t )u() d
Nole lhe imorlance of
,-./ and 3-./ being zero
for l<0
A convoIulion hov-lo examIe
Find the convolution of these two functions
MAE143A Signals & Systems Winter 2014 22
!1 0 1 2 3 4 5
0
0.5
1
1.5
2
2.5
3
3.5
4
function x(t)
time (s)
f
u
n
c
t
i
o
n

v
a
l
u
e

(
u
n
i
t
s
)
!1 0 1 2 3 4 5
0
0.5
1
1.5
2
2.5
3
3.5
4
function v(t)
time (s)
f
u
n
c
t
i
o
n

v
a
l
u
e

(
u
n
i
t
s
)
x(t) =

0, t < 2
8 2t, 2 t < 4
0, 4 t
v(t) =

0, t < 0
2t, 0 t < 2
0, 2 t
ConvoIulion hov-lo conlinued
MAE143A Signals & Systems Winter 2014 23
x(t) v(t) =
Z

x()u(t ) d
. is hxed
+ is lhe variabIe of inlegralion
!1 0 1 2 3 4 5
0
0.5
1
1.5
2
2.5
3
3.5
4
function x(t)
time (s)
f
u
n
c
t
io
n

v
a
lu
e

(
u
n
it
s
)
1. Skelch x(+) lhis hgure is hxed
2. Skelch v(l-+) lhis hgure moves vilh +
a. IIied in + and shifled righl by .
3. Line u lhe +-axes on each
4. Delermine vhere lhe inlegrand is zero
a. .<2, everyvhere
b. 6<., everyvhere
c. 2<.<4, oulside + in |2,.)
d. 4<.<6, oulside + in |.-2,4)
5. Do lhe inlegraIs
+
v(3-+)
!2 !1 0 1 2 3 4
0
0.5
1
1.5
2
2.5
3
3.5
4
function v(3!!)
! (s)
f
u
n
c
t
io
n

v
a
lu
e

(
u
n
it
s
)
+
.
Z
t
2
(8 2)2(t ) d
Z
4
t2
(8 2)2(t ) d
ConvoIulion hov-lo conlinued
Compute the integrals

MAE143A Signals & Systems Winter 2014 24
Z
4
t2
(8 2)2(t ) d = 16 2(4 + t)
2
+
4
3

4
t2
= 16t(6 t) 2(4 + t)(16 (t 2)
2
) +
4
3
(64 (t 2)
3
)
=
2
3
t
3
8t
2
+ 24t
Z
t
2
(8 2)2(t ) d =
Z
t
2
[16t 4(4 + t) + 4
2
] d
=

16t 2(4 + t)
2
+
4
3

t
2
= 16t(t 2) 2(4 + t)(t
2
4) +
4
3
(t
3
8)
=
2
3
t
3
+ 8t
2
24t +
64
3
ConvoIulion hov-lo conlinued
MAE143A Signals & Systems Winter 2014 25
[x v](t) =

0 , t < 2

2
3
t
3
+ 8t
2
24t +
64
3
, 2 t < 4
2
3
t
3
8t
2
+ 24t , 4 t < 6
0 , 6 t
!2 0 2 4 6 8 10
0
2
4
6
8
10
12
x(t)*v(t) convolution demonstration
time (s)
s
i
g
n
a
l

v
a
l
u
e

(
u
n
i
t
s
)


by hand
matlab
ConvoIulion hov-lo malIab
MAE143A Signals & Systems Winter 2014 26
>> l|-1:.01:5j',
>> xzeros(size(l)),
>> vzeros(size(l)),
>> for i1:601, if l(i)>2 && l(i)<4, x(i)8-2l(i), end, end
>> for i1:601, if l(i)>0 && l(i)<2, v(i)2l(i), end, end
>> u |-2:.01:10j',
>> xcvzeros(size(u)),
>> for i1:1201,
if u(i)>2 && u(i)<4, xcv(i)-u(i)^32/3+8u(i)^2-24u(i)+32-32/3,
end, end
>> for i1:1201, if u(i)>4 && u(i)<6, xcv(i)u(i)^32/3-8u(i)^2+24u(i),end,end
>> vcxconv(x,v),
>> Iol(u,xcv,u,vcx/100),shg
Things to note
the conv function extends the time-base to the sum
of the constituent intervals
the matlab function needs normalizing by dt, which
is 0.01 here
Summary of lime-domain soIulions so far
For linear systems the output consists of two additive parts
The zero input response due to ics and zero input
This consists of natural modes of the system
Exponentials at the roots of the characteristic equation
The zero state response due to input and zero ics
This consists of the natural and forced modes
Includes exponential modes from the input signal

For linear time-invariant system (LTI)
The zero state response is the convolution of the input
signal and the systems impulse response

MAE143A Signals & Systems Winter 2014 27
MalIab and lhe soIulion of ODIs
Plan [Kamen & Heck 3
rd
Ed Ch 11, 2
nd
Ed Ch 13]
Moving on to nonlinear systems
Higher-order ODEs
Numerical solution using ode45
The state vector of a system or ODE
Replace an nth-order scalar ODE by a first-order n-vector ODE
This vector is called the state
It is equivalent to the set of n initial conditions evolving over t
We can rewrite the original ODE in a state-space
representation
This is how matlab (in general) keeps track of systems
This course is, in part, about understanding different
representations of systems
MAE143A Signals & Systems Winter 2014 28
NumericaI soIulion of RC ODI
Derivative function






Call to ode45
MAE143A Signals & Systems Winter 2014 29
|lo,yojode45(+RC_func,|0 31e-4j,-0.5),

Iol(lo,yo)
lilIe('VoIlage resonse by ode45 vilh iniliaI condilion -0.5')
xIabeI('Time (sec)'),yIabeI('SignaI vaIue voIls'), shg
funclion dy RC_func(l,y),
R100, C1e-6,

if l>0 && l<21e-5, u0.1,
eIse u0, end

dy -1/R/Cy+1/Cu,
relurn

0 0.5 1 1.5 2 2.5 3 3.5


x 10
!4
!0.5
0
0.5
1
1.5
Voltage response by ode45 with initial condition !0.5
Running ode45
Derivative function
function dy = RC_func(t,y);
dy = -1/R/C*y+1/C*u;
Calling solver ode45 (Runge-Kutta integration)
[to,yo]=ode45(@RC_func,[0 3*1e-4],-0.5);
What about a nonlinear right-hand-side?
No problem. The derivative function can be nonlinear
dy = -1/R/C*y^2+1/C*u;
What about higher-order ODEs?
We need more i.c.s for a start


MAE143A Signals & Systems Winter 2014 30
y
00
=
L
g
sin y + u
Dehnilion of slale
Definition
The state of a system or ODE at time t is a sufficient set
of information so that, given all the inputs for !t, we
can uniquely determine the output for all >t

We already know that, for an nth-order ODE, we need
exactly n initial conditions in order to solve the ODE
uniquely into the future given all future inputs

This must be a state!
This is a natural choice, but not the only choice
The state is an n-vector. We will call the state 4-./
Lets rewrite the ODE in terms of the state
MAE143A Signals & Systems Winter 2014 31
y
(n1)
(t), y
(n2)
(t), . . . , y
0
(t), y(t)
Dierenlialing malrices & veclors
The derivative of an nxm matrix A is the nxm matrix
composed of the derivative of each element




A consequence is that


Where the ordering is important and is preserved
MAE143A Signals & Systems Winter 2014 32
d
dt

t e
2t
sin 5t cos 6t

t 45

1 2e
2t
5 cos 5t 6 sin 6t
1
2

t
0

d
dt
A(t)B(t) =
dA
dt
B + A
dB
dt
Slale ODI
Start with a linear homogeneous ODE

Define the state and consider its derivative





This is a first-order ODE in n-vector x(t)
There is a single n-vector initial condition
MAE143A Signals & Systems Winter 2014 33
d
dt
x(t) =
d
dt

y
y
0
y
00
.
.
.
y
(n2)
y
(n1)

y
0
y
00
y
000
.
.
.
y
(n1)
y
(n)

0 1 0 . . . 0 0
0 0 1 . . . 0 0
0 0 0 . . . 0 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0 0 0 . . . 0 1
a
n
a
n1
a
n2
. . . a
2
a
1

y
y
0
y
00
.
.
.
y
(n2)
y
(n1)

x(t) = Ax(t), x(0)


y
(n)
+a
1
y
(n1)
+a
2
y
(n2)
+. . . a
n1
y
0
+a
n
y = 0
Slale equalion vilh inul & oulul
Original system ODE


State-space version of same system ODE
MAE143A Signals & Systems Winter 2014 34
x(t) R
n
A n n
B n 1
C 1 n
x(t) =

y
0
y
00
y
000
.
.
.
y
(n1)
y
(n)

0 1 0 . . . 0 0
0 0 1 . . . 0 0
0 0 0 . . . 0 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0 0 0 . . . 0 1
a
n
a
n1
a
n2
. . . a
2
a
1

y
y
0
y
00
.
.
.
y
(n2)
y
(n1)

0
0
0
.
.
.
0
1

u(t)
y(t) =

1 0 0 . . . 0 0

x(t)
x(t) = Ax(t) + Bu(t), x(0)
y(t) = Cx(t)
y
(n)
+ a
1
y
(n1)
+ a
2
y
(n2)
+ + a
n1
y
0
+ a
n
y = u(t)
Slale-sace syslem reresenlalion
Use an n-vector state satisfying a first-order ODE
in place of a scalar nth-order ODE
Then we can see how to use ode45 again
It now has a vector argument

The Van der Pol oscillator - nonlinear second-order

State vector derivative

MAE143A Signals & Systems Winter 2014 35
z
00
(1 z
2
)z
0
+ z = 0
x(t) =

z(t)
z
0
(t)

x
0
(t) =

z
0
(t)
z
00
(t)

Van der IoI meels malIab


MAE143A Signals & Systems Winter 2014 36
!"#!"!# $%$# '( ")*+,*"-.-"/01**"21+!$31"#444"5167+,'.042 ! .8 !
896/:;.6 <=<: > 5167+,'.0?:@=AB

C 896/:;.6 <=<: > 5167+,'.0?:@=A
C
C D96/:;.6 <+E+0.F+< :. <+2.6*:,1:+ :G+ *.09:;.6 .8 :G+ 516 <+, '.0
C .*/;001:., 9*;6H :G+ .<+$I 896/:;.6 ;6 21:01-
C
C JG+ *:1:+ ;6F9: ?=A 16< <+,;E1:;E+ .9:F9: ?<=<:A E+/:.,* 1,+ #E+/:.,*
C JG+ 8;,*: +0+2+6: .8 = ;* 1**92+< :. -+ :G+ *.09:;.6 896/:;.6 ;:*+08
C JG+ *+/.6< +0+2+6: .8 = ;* :G+ <+,;E1:;E+ .8 :G+ *.09:;.6 896/:;.6
C
C JG+ <K612;/ +L91:;.6 .8 :G+ 516 <+, '.0 .*/;001:., ;*
C MNN29?!MO#AMNPM>Q
C R+ *G100 :1S+ 29>34Q
C
C R,;::+6 -K T.- T;:2+1<@ U1691,K #!@ #Q!#
C R.,S+< 8;,*: :;2+V

29 > 3B

< > W=?#AB C :G;* ;* :G+ <+,;E1:;E+ :+,2
29X?!=?!AX=?!AAX=?#A=?!AYB C :G;* ;* :G+ *+/.6< <+,;E1:;E+

<=<: > <B
,+:9,6

>> x0|0,1j,
>> |l0,y0jode45(+VanDerIoI,|0 10j,x0),

Van der IoI osciIIalor


MAE143A Signals & Systems Winter 2014 37
>> x0|0,1j,
>> |l0,y0jode45(+VanDerIoI,|0 10j,x0),
>> Iol(l0,y0),shg
0 1 2 3 4 5 6 7 8 9 10
!6
!4
!2
0
2
4
6
Van der Pol oscillator state solution over time
Time (sec)
S
t
a
t
e

e
l
e
m
e
n
t
s

(
v
o
l
t
s
)

(
v
o
l
t
s
/
s
e
c
)


voltage
derivative of voltage
Van der IoI osciIIalor hase orlrail
MAE143A Signals & Systems Winter 2014 38
>> Iol(y0(:,1),y0(:,2)),shg
!2.5 !2 !1.5 !1 !0.5 0 0.5 1 1.5 2 2.5
!6
!4
!2
0
2
4
6
Van der Pol oscillator phase portrait; =3, x0=[0;1];
First state (volts)
S
e
c
o
n
d

s
t
a
t
e

(
v
o
l
t
s
/
s
e
c
)
Van der IoI zoomed
At t=3.999
x
1
=-1.743
x
2
=-2.767
Let us restart
from these
values
MAE143A Signals & Systems Winter 2014 39
3.999 3.9992 3.9994 3.9996 3.9998 4 4.0002 4.0004 4.0006 4.0008 4.001
!3
!2.8
!2.6
!2.4
!2.2
!2
!1.8
!1.6
!1.4


X: 3.999
Y: !1.743
Van der Pol oscillator phase portrait; =3, x0=[0;1];
Time (sec)
F
i
r
s
t

s
t
a
t
e

(
v
o
l
t
s
)
;

S
e
c
o
n
d

s
t
a
t
e

(
v
o
l
t
s
/
s
e
c
)
voltage
derivative of voltage
Van der IoI reslarled al lime .4
MAE143A Signals & Systems Winter 2014 40
0 1 2 3 4 5 6 7 8 9 10
!6
!4
!2
0
2
4
6
Van der Pol oscillator phase portrait; =3, t0=0 and t0=4
Time (sec)
F
i
r
s
t

s
t
a
t
e

(
v
o
l
t
s
)
;

S
e
c
o
n
d

s
t
a
t
e

(
v
o
l
t
s
/
s
e
c
)


state 1: start time 0
state 2: start time 0
state 1: restart time 4
state 2: restart time 4
Van der IoI reslarled & slale
Restarting the Van der Pol oscillator
from the state at time t=4 yields
precisely the same solution


This is tied to the definition of state
The state at time t is a sufficient set of information
so that, given all future inputs for !t we can
uniquely determine the future outputs for!t
The state at time t contains precisely all the information
attributable to the history up to time t
There is nothing else to know
MAE143A Signals & Systems Winter 2014 41
0 1 2 3 4 5 6 7 8 9 10
!6
!4
!2
0
2
4
6
Van der Pol oscillator phase portrait; =3, t0=0 and t0=4
Time (sec)
F
i
r
s
t

s
t
a
t
e

(
v
o
l
t
s
)
;

S
e
c
o
n
d

s
t
a
t
e

(
v
o
l
t
s
/
s
e
c
)


state 1: start time 0
state 2: start time 0
state 1: restart time 4
state 2: restart time 4
Slale reresenlalions of LTI syslems
General 2nd-order LTI system

State-variable realization



x(t) is no longer the derivatives of y(t)

MAE143A Signals & Systems Winter 2014 42
y(t) + a
1
y(t) + a
2
y(t) = b
1
u(t) + b
2
u(t), y(0), y(0)

x
1
(t)
x
2
(t)

0 1
a
2
a
1

x
1
(t)
x
2
(t)

0
1

u(t), x(0)
y(t) =

b
1
b
2

x(t)
x
1
(t) = x
2
(t)
x
2
(t) = x
1
(t)
x
1
(t) = a
2
x
1
(t) a
1
x
1
(t) + u(t)
Slale variabIe LTI syslem reaIizalion
State equation



Unraveled



So


and
MAE143A Signals & Systems Winter 2014 43

x
1
(t)
x
2
(t)

0 1
a
2
a
1

x
1
(t)
x
2
(t)

0
1

u(t), x(0)
y(t) =

b
1
b
2

x(t)
x
1
(t) = x
2
(t)
x
2
(t) = x
1
(t)
x
1
(t) = a
2
x
1
(t) a
1
x
1
(t) + u(t)
x
2
(t) = x
1
(t), satises
x
2
(t) = a
2
x
2
(t) a
1
x
2
(t) + u(t)
y(t) + a
1
y(t) + a
2
y(t) = b
1
u(t) + b
2
u(t), y(0), y(0)
Slale-variabIe LTI syslem reresenlalion
State-variable realization
MAE143A Signals & Systems Winter 2014 44
y
(n)
+ a
1
y
(n1)
+ a
2
y
(n2)
+ + a
n1
y
0
+ a
n
y =
b
1
u
(n1)
u + b
2
u
(n2)
+ + b
n1
u
0
+ b
n
u(t)
x(t) =

0 1 0 . . . 0 0
0 0 1 . . . 0 0
0 0 0 . . . 0 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0 0 0 . . . 0 1
a
n
a
n1
a
n2
. . . a
2
a
1

x(t) +

0
0
0
.
.
.
0
1

u(t)
y(t) =

b
n
b
n1
b
n2
. . . b
2
b
1

x(t)
x(t) = Ax(t) + Bu(t), x(0)
y(t) = Cx(t)
Slale-variabIe reaIizalions
We can replace an n-order system ODE by a first-order
n-vector system ODE
For LTI systems, this involves creating matrices [A,B,C]
from the ODE coefficients


Some work needs to be done in constructing the
appropriate initial conditions
MAE143A Signals & Systems Winter 2014 45
x(t) = Ax(t) +Bu(t), x(0)
y(t) = Cx(t)

y(0)
y(0)
y(0)
.
.
.
y
(n1)
(0)

C
CA
CA
2
.
.
.
CA
n1

x(0)
SoIulion of LTI slale-variabIe syslems
For nxn matrix A define
This is called the matrix exponential and is nxn too
Clearly (just try it)
Not so obvious but not hard
So
is the solution for x(t) and

This is a matrix convolution
MAE143A Signals & Systems Winter 2014 46
x(t) = Ax(t) +Bu(t), x(0)
y(t) = Cx(t)
e
At
= I + tA +
t
2
2!
A
2
+
t
3
3!
A
3
+ . . .
de
At
dt
= Ae
At
e
At
e
A
= e
A(t+)
x(t) = e
At
x(0) +
Z
t
0
e
A(t)
Bu() d
y(t) = Ce
At
x(0) +
Z
t
0
Ce
A(t)
Bu() d
Iirsl-order veclor ODIs
Claim has the solution



Differentiate using the matrix product rule





Our integrating factor solution works fine so far
Variation of parameters can go take a hike
MAE143A Signals & Systems Winter 2014 47
x(t) = Ax(t) +Bu(t)
|nx1j |nxnj |nx1j |nxnj |nx1j|1x1j
x(t) = exp(At)x(0) +
Z
t
0
exp[A(t )]Bu() d
x(t) = Aexp(At)x(0) +Aexp(At)
Z
t
0
exp(A)Bu() d + exp(At) exp(At)Bu(t)
= A

exp(At)x(0) + exp(At)
Z
t
0
exp(A)Bu() d

+Bu(t)
= Ax(t) +Bu(t)
LTI hrsl-order veclor ODIs


This is still a convolution formula but a useful one
Impulse response
MAE143A Signals & Systems Winter 2014 48
x(t) = Ax(t) +Bu(t)
x(t) = exp(At)x(0) +
Z
t
0
exp[A(t )]Bu() d
x(t) = exp(At)0 +
Z
t
0
exp[A(t )]B() d
= exp(At)B
h(t) = C exp(At)B
y(t) = Cx(t)
y(t) = C exp(At)x(0) +
Z
t
0
C exp[A(t )]Bu() d
y(t) = h(t) u(t)
MalIab and slale-sace syslems - ss
MAE143A Signals & Systems Winter 2014 49
>> A |0 1,-6 -5j, |0,1j, C|1 0j, D0,
>> sys ss(A,,C,D)
a
x1 x2
x1 0 1
x2 -6 -5
b
u1
x1 0
x2 1
c
x1 x2
y1 1 0
d
u1
y1 0

Conlinuous-lime slale-sace modeI.
>>
Matlabs internal
representation of a
continuous-time system
in state-space form
x(t) = Ax(t) +Bu(t)
y(t) = Cx(t) +Du(t)
MalIab and slale-sace syslems
>> [y,t] = impulse(sys);
>> ys = step(sys,t);
>> plot(t,y,t,ys);shg

MAE143A Signals & Systems Winter 2014 50
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
Impulse and step response of second!order system
time (s)
o
u
t
p
u
t

s
i
g
n
a
l

(
u
n
i
t
s
)


impulse response
step response
h(t) = C exp(At)B
s(t) =
Z
t
0
h() d
MalIab and slale-sace syslems
What happened to my convolution?
MAE143A Signals & Systems Winter 2014 51
>> l|0:.01:5j',
>> uzeros(size(l)),
>> for i1:501, if l(i)<0.2 ++ (l(i)<3.0 && l(i)>2.8), u(i)1, eIse u(i)0, end, end
>> y Isim(sys,u,l,|0,0j),
>> Iol(l,y),shg
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0
0.005
0.01
0.015
0.02
0.025
0.03
0.035
Response to pulse
time (s)
o
u
t
p
u
t

s
i
g
n
a
l

(
u
n
i
t
s
)
MalIab and slale-sace syslems
There are many tools
Impulse and step responses
lsim in place of convolution
Initial conditions need to be encoded into the
state-space vector format
Linear versus nonlinear
both can be solved numerically ode45
There are more tools for linear analysis
Variation of parameters and convolution have
been replaced by the explicit vector (convolution)
integral
MAE143A Signals & Systems Winter 2014 52
y(t) = C exp(At)x(0) +
Z
t
0
C exp[A(t )]Bu() d
More on slale-sace
Consider our original second-order ODE system



State-space A matrix

Characteristic equation


The natural modes of the system are the eigenvalues
of the A matrix
MAE143A Signals & Systems Winter 2014 53
y
00
(t) + 5y
0
(t) + 6y(t) = u(t)

2
+ 5 + 6 = ( + 2)( + 3) Characteristic equation
A =

0 1
6 5

det(I A) =

1
6 + 5

=
2
+ 5 + 6
A IiuIe more on malrix exonenliaIs
For square A


If A is diagonalizable




The matrix exponential contains the
natural system modes
MAE143A Signals & Systems Winter 2014 54
e
At
= I + tA +
t
2
2!
A
2
+
t
3
3!
A
3
+ . . .
>> A
A
0 1
-6 -5

>> |V,Djeig(A)
V
0.4472 -0.3162
-0.8944 0.9487

D
-2.0000 0
0 -3.0000

>> inv(V)AV
ans
-2.0000 0.0000
-0.0000 -3.0000

V
1
AV = D, diagonal
V
1
A
2
V = V
1
AV V
1
AV = D
2
V
1
exp(At)V = exp(Dt) = diag[
i
]
MAI143A and slale variabIes
The description of systems described by ODEs can be
achieved using vector state variables
This works for linear or nonlinear systems
The state evolves over time in response to the initial
conditions and the input signal
The output signal is a function of the state
State-variable realizations are useful for numerical
integration
They are useful for many other system operations too
For MAE143A, the importance of state variable
realizations is that they allow us to access much of the
functionality of matlab
There are many more things to learn, just not here & now
MAE143A Signals & Systems Winter 2014 55
MAI143A and slale variabIes
MAE143A endeavors to give a brief introduction to the
methods and tools of state variable representations
In practice, these are important tools for representing
and analyzing systems
These tools extend to the consideration of multi-
input/multi-output (MIMO) system
The B, C and D matrices have larger dimension
The tools are applicable to the interconnection of
systems
The companion program to matlab is simulink which
simulates systems linked together
We are digging into this territory
MAE143A Signals & Systems Winter 2014 56
Things lo knov
Convolution is a symmetric and linear operator



Proof of symmetry
change of variables

MAE143A Signals & Systems Winter 2014 57
x(t) v(t) = v(t) x(t)
[x
1
(t) + x
2
(t)] [v
1
(t) + v
2
(t)]
= x
1
(t) v
1
(t) + x
1
(t) v
2
(t) + x
2
(t) v
1
(t) + x
2
(t) v
2
(t)
x(t) v(t) =
Z

x()v(t ) d
= t , d = d
= , =
= , =
x(t) v(t) =
Z

x()v(t ) d
=
Z

x(t )v() (d)


=
Z

x(t )v() d
= v(t) x(t)
Things lo knov
The convolution describes how to get the output to a
general input signal with zero initial conditions
Given the impulse response of the system h(t) the
output to input u(t) is given by h(t)*u(t)

Apart from the additive zero input response due to the
initial conditions, a system is fully characterized by its
impulse response

The state of a system separates the past (including
initial conditions) of the system from its future
If I know the state and future inputs, then I know
the future outputs
MAE143A Signals & Systems Winter 2014 58
Whal is nexl`
Laplace transforms
We are going to (re)introduce Laplace transforms
into the solution of ODEs
But now we will have a systems viewpoint
Impulse response and transfer function
Response to any input
Handling initial conditions
State-variable realizations
Restarting, capturing the past
Matlab tools to help us look at Laplace transforms
MAE143A Signals & Systems Winter 2014 59