Lecture 2 – Linear Systems
This lecture: EE263 material recap + some controls motivation
• Continuous time (physics)
• Linear state space model
• Transfer functions
• Black-box models; frequency domain analysis
• Linearization
EE392m - Spring 2005 Control Engineering 2-1
Gorinevsky
Modeling and Analysis
Input signal System Model Output signal
(control) [internal states] (observation)
state
evolution
This lecture considers
• Linear models. More detail on modeling in Lecture 7
• Simulation: computing state evolution and output signal
• Stability: does the solution diverge after some time?
• Approximate linear models
EE392m - Spring 2005 Control Engineering 2-2
Gorinevsky
Linear Models
• Model is a mathematical representations of a system
– Models allow simulating the system
– Models can be used for conceptual analysis
– Models are never exact
• Linear models
– Have simple structure
– Can be analyzed using powerful mathematical tools
– Can be matched against real data using known procedures
– Many simple physics models are linear
– They are just models, not the real systems
EE392m - Spring 2005 Control Engineering 2-3
Gorinevsky
State space model
• Generic state space model Example: F16 Longitudinal Model
– is described by ODEs from Aircraft Control and Simulation
– e.g., physics-based system by Stevens and Lewis
model
θ α u = δe
– state vector x
V
– observation vector y x
– control vector u
dx y = 57.3θ z δe
= f ( x, u, t ) state evolution
dt
y = g ( x, t ) observation V& = -1.93 ⋅ 10 - 2 V + 8.82α − 32.2θ − 0.58q + 0.17δe
x1 - velocity V [ft/sec] α& = -2.54 ⋅ 10 - 4 V − 1.02α + 0.91q − 2.15 ⋅ 10 - 3 δ e
x2 - angle of attack α [rad] θ& = q
x3 - pitch angle θ [rad]
x4 - pitch rate q [rad/sec] q& = 2.95 ⋅ 10 -12 V + 0.82α − 1.08q − 0.18δ e
δe - elevator deflection [deg]
EE392m - Spring 2005 Control Engineering 2-4
Gorinevsky
Linear state space model
• Linear Time Invariant (LTI) state space model:
dx
= Ax + Bu state evolution
dt
y = Cx observations
• Can be integrated analytically or numerically (simulation)
• Can be well analyzed: stability, response
Example: F16 Longitudinal Model
⎡ − 1.93 ⋅ 10 −2 8.82 − 32.2 − 0.48⎤ ⎡ 0.17 ⎤
⎢ ⎥ ⎢ − 2.15 ⋅ 10 −3 ⎥
dx ⎢ − 2.54 ⋅ 10 −4 − 1.02 0 0.91 ⎥
= ⋅x+⎢ ⎥⋅u
dt ⎢ 0 0 0 1 ⎥ ⎢ 0 ⎥
⎢ ⎥ ⎢ ⎥
⎣ 2 . 95 ⋅ 10 −12
0 . 82 0 − 1 . 08 ⎦ ⎣ − 0 . 18 ⎦
y = [0 0 57.3 0] ⋅ x
EE392m - Spring 2005 Control Engineering 2-5
Gorinevsky
Integrating linear autonomous system
dx Example:
= Ax >>A = [-1.93e-2 8.82 -32.2 -0.58;
dt -2.54e-4 -1.02 0 0.91;
0 0 0 1;
• Matrix exponential 2.95e-12 0.82 0 -1.08];
– Can be computed in Matlab >> expm(A)
ans =
as expm(A) 0.9802 3.1208 -31.8830 -10.2849
– The definition corresponds -0.0002 0.5004 0.0031 0.3604
-0.0000 0.2216 1.0002 0.6709
to integrating the ODE by -0.0001 0.3239 0.0007 0.4773
Euler method
x (T + ∆ t ) ≈ x (T ) + ∆ tAx ( t ) = (I + ∆ tA )x (T )
x (T + n ∆ t ) = (I + ∆ tA ) x (T ) → exp( An ∆ t ) x (T )
n
exp( At ) = lim (I + ∆ tA )
t / ∆t
∆t → 0
EE392m - Spring 2005 Control Engineering 2-6
Gorinevsky
Integrating linear autonomous system
3
dx
= Ax , x (0) = x 0 2
dt 1
0 5 10 15 20
• Initial condition response
0.02
x ( t ) = exp( At ) x 0 0
-0.02
-0.04
0 5 10 15 20
0.02
Example: 0
%Take A, B, C from the F16 example -0.02
-0.04
>> k = 0.02 -0.06
>> G = A + k*B*C; -0.08
>> x0 = [0.1700; 0 5 10 15 20
-0.0022;
0.05
0; 0
-0.1800]; -0.05
>> -0.1
for j = 1:length(t); -0.15
x(:,j)=expm(G*t(j))*x0; end; 0 5 10 15 20
TIME
EE392m - Spring 2005 Control Engineering 2-7
Gorinevsky
Eigenvalues and Stability Example:
% take A from
• Consider eigenvalues of the matrix A % the F16 example
>> eig(A)
ans =
{λ j } = eig( A); det( Iλ − A) = 0 -1.9125
-0.1519 + 0.1143i
-0.1519 - 0.1143i
0.0970
• Suppose A has all different and nonzero eigenvalues, then
A = V ⋅ diag{ λ j } ⋅ V −1
λ t
exp( At ) = V ⋅ diag{ e j } ⋅ V −1
• The system solution is exponentially stable if Re λ j < 0
• If A has eigenvalues with multiplicity more than 1, things are
a bit more complicated: Jordan blocks, polynomials in t
• Still the condition of exponentially stability is Re λ j < 0
EE392m - Spring 2005 Control Engineering 2-8
Gorinevsky
Input-output models
• Black-box models – describe system P as an operator
u
input signal
P y
output signal
x
internal state
(hidden)
• Historically (50 years ago)
– Black-box models EE
– State-space models ME, AA
EE392m - Spring 2005 Control Engineering 2-9
Gorinevsky
Linear System (input-output)
• Linearity
P P
u1 (⋅) ⎯
⎯→ y1 (⋅) u2 (⋅) ⎯
⎯→ y2 (⋅)
P
au1 (⋅) + bu2 (⋅) ⎯
⎯→ ay1 (⋅) + by2 (⋅)
• Linear Time-Invariant systems - LTI
P
u(⋅ − T ) ⎯
⎯→ y (⋅ − T )
u y
P
t
⎯
⎯→ t
EE392m - Spring 2005 Control Engineering 2-10
Gorinevsky
Convolution representation
• Convolution integral
t signal
y = h*u
y (t ) = ∫ h(t − τ )u(τ )dτ processing
−∞ notation
• Impulse response
u(t ) = δ (t ) ⇒ y (t ) = h(t )
• Step response: u = 1 for t > 0
t t
d
g (t ) = ∫ h(t − τ )dτ = ∫ h(τ )dτ h (t ) = g (t )
0 0
dt
EE392m - Spring 2005 Control Engineering 2-11
Gorinevsky
Impulse Response for State Space Model
dx Example:
= Ax + Bu state evolution >> A = [-0.3130 56.7000 0;
dt -0.0139 -0.4260 0;
y = Cx observation 0 56.7000 0];
>> B = [0.232; 0.0203; 0];
>> C = [0, 0, 1];
• Impulse response for the state x 1
x ( ∆ t ) ≈ ∆ tAx ( 0 ) + B ∆
{ tu 0.5
0
1
-0.5
x ( ∆ t ) ≈ B ∆ tu = B 0.04
0 10 20
x ( t ) = exp( At ) B 0.02
0
-0.02
0 10 20
• System impulse response 1
h ( t ) = C exp( At ) B 0.5
0
0 10 20
TIME
EE392m - Spring 2005 Control Engineering 2-12
Gorinevsky
Formal transfer function
• Rational transfer function
= IIR (Infinite Impulse Response) model
– Broad class of input-output linear models
dmy d m −1 y d nu d n −1u
a1 m + a 2 m −1 + K + a m +1 y = b1 n + b2 n −1 + K + bn +1u
dt dt dt dt
d
• Differentiation operator →s
dt
• Formal transfer function – rational function of s
N (s) N ( s ) = a1 s m + K + a m s + a m +1
y = H (s) ⋅ u = ⋅u
D(s) D ( s ) = b1 s n + K + bn s + bn +1
• For a causal system m ≤ n
EE392m - Spring 2005 Control Engineering 2-13
Gorinevsky
Poles, Impulse Response
N (s) N (s) = 0 - zeros
y= ⋅u
D(s) D(s) = 0 - poles
• Expand D ( s ) = ( s − p1 ) M 1 ⋅ K ⋅ ( s − p K ) M K
N1 (s) N K (s)
Then y= M1
⋅ u + K + MK
⋅u
( s − p1 ) (s − pK )
• Quasi-polynomial impulse response – see a textbook
( ) ( )
h ( t ) = c1,1t M 1 −1 + K + c1, M 1 +1 e p1t + K + c K ,1t M K −1 + K + c K , M K +1 e p K t
d 2
y 1
• Example: =u Transfer function: y = 2 ⋅ u
dt 2 s
Impulse response: h (t ) = v0 t + x0
EE392m - Spring 2005 Control Engineering 2-14
Gorinevsky
Transfer Function for State Space
• Formal transfer function for a state space model
y = (sI − A ) B ⋅ u
−1
d sx = Ax + Bu
→s
= H ( s ) = C (sI − A ) B
−1
dt y Cx
• Characteristic polynomial
N ( s ) = det (sI − A ) = 0
Poles det (sI − A ) = 0 eigenvalues
• Poles are the same as eigenvalues of the state-space matrix A
• For stability we need Re pk = Re λk < 0
EE392m - Spring 2005 Control Engineering 2-15
Gorinevsky
Laplace transform
∞
∫
st
• Laplace integral transform: x ( t ) → xˆ ( s ) = x ( t ) e dt
0
• Laplace transform of the convolution integral yields
∞
Imag s
yˆ ( s ) = H ( s )uˆ ( s ) H ( s ) = ∫ h (t )e st dt
0
• Transfer function: H (s )
Re s
– function of complex variable s
– analytical in a right half-plane Re s ≥ a
– for a stable system a≤0
N ( s) dx
– for an IIR model H ( s) = → sxˆ ( s )
D( s ) dt
EE392m - Spring 2005 Control Engineering 2-16
Gorinevsky
Frequency decomposition
• Sinusoids are eigenfunctions of an LTI system: y = H ( s )u
LTI
Plant
e iωt H (iω )e iωt
s (e iωt ) →
d iωt
e = iωe iωt
dt
• Frequency domain analysis
∑ k
u e iωk t
→ y = ∑ k
u H ( iω k ) e iωk t
EE392m - Spring 2005 Control Engineering 2-17
Gorinevsky
Frequency domain description
• Frequency domain analysis
1 ~ 1 ~(ω )e −iωt dω
∫ ∫ 14243
−iωt
u= u (ω )e dω ⇒ y = H ( iω ) u
2π 2π ~
y (ω )
iωt
Packet e Packet eiωt
u of u~(ω ) H (iω ) of ~y (ω ) y
sinusoids sinusoids
• Fourier transform – numerical analysis
u(t) = 0, for t < 0
• Laplace transform – complex analysis
u (ω ) = ∫ u(t )e dω = ⎜ ∫ u(t )e st dω ⎞⎟
⎛
∞ ∞
~ iωt
= uˆ (iω )
−∞ ⎝ −∞ ⎠ s =iω
EE392m - Spring 2005 Control Engineering 2-18
Gorinevsky
Continuous systems in frequency domain
∞
~
∫
iωt
x (ω ) = x ( t ) e dt • Fourier transform
−∞ [ −∞, ∞ ] → [ −∞, ∞ ]
∞
1 ~
∫ • Inverse Fourier transform
−iωt
x (t ) = x (ω ) e dω
2π −∞
t
• I/O impulse response model
y (t ) = ∫ h(t − τ )u(τ )dt
−∞
∞
H ( s ) = ∫ h(t )e st dt • Transfer function
0
~
y (ω ) = H (iω )u~(ω ) • System frequency response
EE392m - Spring 2005 Control Engineering 2-19
Gorinevsky
Frequency domain description
M (ω ) = H (iω )
• Bode plots:
ϕ (ω ) = arg H (iω )
u = eiωt
15
Bode Diagram
y = H (iω )eiωt
Magnitude (dB)
10
• Example:
5
1
0
H ( s) = -5
s − 0.7 0
-45
• |H| is often measured
Phase (deg)
-90
in dB -135
– [dB] = 20 log10 M -180
-2 -1 0
10 10 10
Frequency (rad/sec)
EE392m - Spring 2005 Control Engineering 2-20
Gorinevsky
Model Approximation
• Model structure – physics, computational
• Determine parameters from data
• Step/impulse responses are close the input/output
models are close
• Example – fit step response
• Linearization of nonlinear model
EE392m - Spring 2005 Control Engineering 2-21
Gorinevsky
Black-box model from data
• Linear black-box model can be determined from the data,
e.g., step response data, or frequency response
STEP RESPONSE
1
0.8
HEAT FLUX
0.6
0.4
0.2
0
0 20 40 60 80 100
TIME
• Example problem: fit an IIR model of a given order
• This is called model identification
• Considered in more detail in Lecture 8
EE392m - Spring 2005 Control Engineering 2-22
Gorinevsky
Linear PDE models
• Include functions of spatial variables
– electromagnetic fields
– mass and heat transfer
– fluid dynamics
– structural deformations
• Example: sideways heat equation x
∂T ∂ 2T
=k 2 Tinside=u Toutside=0
∂t ∂x
T ( 0 ) = u; T (1) = 0
∂T y
y= heat flux
∂x x =1
EE392m - Spring 2005 Control Engineering 2-23
Gorinevsky
Linear PDE System Example
• Heat transfer equation, ∂T ∂ 2T
=k 2
– boundary temperature input u ∂t ∂x
– heat flux output y u = T ( 0) T (1) = 0
• Impulse response and step response ∂T
y=
• Transfer function is not rational TEMPERATURE ∂x x =1
-2
x 10 PULSE RESPONSE
6
1
HEAT FLUX
4
0.8
2
0.6
0 0.4
0 20 40 60 80 100
TIME
STEP RESPONSE 0.2
1
0.8 0
HEAT FLUX
0 15
0.6
10
0.4 0.5
5
heat
0.2 0
1 TIME flux
COORDINATE
0
0 20 40 60 80 100
EE392m - Spring 2005 TIME Control Engineering 2-24
Gorinevsky
Impulse response approximation
• Approximating impulse 0.08s 2 − 0.4 s + 2.8
H ( s ) = 0.01 2
and step responses by a s + 0.34 s + 0.03
low order rational
transfer function model 0.06
• Higher order model can 0.04
provide very accurate 0.02
approximation
• Methods: 0
0 20 40 60 80 100
– trial and error
1
– sampled time response fit,
e.g., Matlab’s prony
– identification, Lecture 8 0.5
– formal model reduction
approaches - advanced 0
0 20 40 60 80 100
TIME
EE392m - Spring 2005 Control Engineering 2-25
Gorinevsky
Validity of Model Approximation
• Why can we use an approximate model instead of the ‘real’
model?
• Will the analysis hold?
• The input-output maps of two systems are ‘close’ if the
convolution kernels (impulse responses) are ‘close’
t
y (t ) = ∫ h(t − τ )u(τ )τ
−∞
• The closed-loop stability impact of the modeling error
– Control robustness
– Will be discussed in Lecture 9
EE392m - Spring 2005 Control Engineering 2-26
Gorinevsky
Nonlinear map linearization
• Nonlinear - detailed model
• Linear - conceptual design model
• Differentiation, secant method
• Example:
static map linearization
∆f
y = f (u ) ≈ (u − u0 )
∆u
EE392m - Spring 2005 Control Engineering 2-27
Gorinevsky
Linearization Example: RTP
• RTP – Rapid Thermal dT
= bu − c1 (T 4 − TF4 ) − c2 (T − TF )
Processing dt
• Major semiconductor T – part temperature
manufacturing process u – IR heater power
TF – furnace temperature
• Stefan-Boltzmann law nonlinearity
• TF is assumed to be constant
u
heaters
input
heated part
T
output
furnace
EE392m - Spring 2005 Control Engineering 2-28
Gorinevsky
RTP, cont’d
dT
= f (T ) + bu f (T ) = −c1 (T 4 − TF4 ) − c2 (T − TF )
dt
Linearize around a steady state point
dT
= f L (T ) + bu f L (T ) = a (T − T* ) + d
dt f (T* + ∆ ) − f (T* )
d = f (T* ) a = f ′(T* ) ≈
0
∆
b = 1000, -200
c1 = 1.1⋅10-10, -400
c2 = 0.8, -600
f(T)
TF = 300 -800
-1000
-1200
300 400 500 600 700 800 900 1000 1100 1200 1300
TEMPERATURE
EE392m - Spring 2005 Control Engineering 2-29
Gorinevsky
RTP, cont’d
x& = ax + bu + d x = T − T* Linear system with a pole
u = −kx p = −( a + bk )
T* = 1000, a = -1.7425, b = 1000, k = 0.01 p = −11.7425
Simulate performance:
1
1000
900
p
800
700
Linear
Non-
T
600 model,
500 linear d=0
400
model
300
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
TIME
EE392m - Spring 2005 Control Engineering 2-30
Gorinevsky
Nonlinear state space model
linearization
• Linearize the r.h.s. map ∆f ∆f
x& = f ( x, u ) ≈ ( x − x0 ) + (u − u0 )
in a state-space model ∆x 1424 3 ∆u 1 424 3
q v
q& = Aq + Bv
• Linearize around an equilibrium 0 = f ( x0 , u0 )
• Secant method ∆
j
f ( x0 + s j , u0 ) − f ( x0 , u0 )
⎡ ⎤ f
⎢⎣ ∆x ⎥⎦ = dj
s j = [0 ... d j ... 0]
{
#j
• This is how Simulink computes linearization
EE392m - Spring 2005 Control Engineering 2-31
Gorinevsky
Example: F16 Longitudinal
x
Model
dx θ α u = δe
= f ( x, u )
dt V
x’
• State vector x y = 57.3θ z z’ δe
1
x1 - velocity V [ft/sec] V& = ( Fx cos α + Fz sin α )
m
x2 - angle of attack α [rad] ⎡V ⎤ 1
⎢α ⎥ α& = ( − Fx sin α + Fz cos α ) + q
x3 - pitch angle θ [rad] x=⎢ ⎥ mV
⎢q⎥ My
x4 - pitch rate q [rad/sec] ⎢ ⎥ q& =
⎣θ ⎦ Iy
Fx = rC x ,t (α ) − mg sin θ + T
• Control input &
θ =q
Fz = rC z ,t (α , δ e ) + mg cos θ
u - elevator deflection δe [deg]. M y = RC m ,t (α , δ e )
For more detail see: Aircraft Control and Simulation by Stevens and Lewis
EE392m - Spring 2005 Control Engineering 2-32
Gorinevsky
Nonlinear Model of F16
dx
= f ( x, u ) state evolution
dt
y = g ( x) observation
• Aircraft models are understood by groups
of people
• Could take many man-years worth of
effort
• Aerodynamics model is based on
empirical data
• f(x,u) available as a computational
function can be used without a deep
understanding of the model
• The nonlinear model can be used for
simulation, or linearized for analysis
EE392m - Spring 2005 Control Engineering 2-33
Gorinevsky
Linearized Longitudinal Model of F16
• Assume trim condition
⎡V0 ⎤ ⎡ 500 ⎤ - velocity V [ft/sec]
⎢α ⎥ ⎢0.0393⎥ - angle of attack α [rad]
x0 = ⎢ 0 ⎥ = ⎢ ⎥
⎢ q0 ⎥ ⎢ 0 ⎥ - pitch rate q [rad/sec]
⎢ ⎥ ⎢ ⎥
θ
⎣ 0⎦ ⎣ 0 . 0393⎦ - pitch angle θ [rad
• Linearize the nonlinear function f(x,u) by a finite difference
method (secant method). Step = [1 0.001 0.01 0.001]
⎡ − 1.93 ⋅ 10 −2 8.82 − 32.2 − 0.48⎤ ⎡ 0.17 ⎤
⎢ ⎥ ⎢ −3 ⎥
∆f ⎢ − 2.54 ⋅ 10 −4 − 1.02 0 0.91 ⎥ ∆f ⎢ − 2.15 ⋅ 10 ⎥
A= = B= =
∆x ⎢ 0 0 0 1 ⎥ ∆u ⎢ 0 ⎥
⎢ ⎥ ⎢ ⎥
⎣ 2.95 ⋅ 10
−12
0.82 0 1.08 ⎦ ⎣ − 0 .18 ⎦
• These are the matrices we considered in the linear F16
model example
EE392m - Spring 2005 Control Engineering 2-34
Gorinevsky
Simulation-based validation
• Simulate with nonlinear model, compare with linear model
results
• Doublet
response
EE392m - Spring 2005 Control Engineering 2-35
Gorinevsky
LTI models - summary
• ODE model
• State space linear model
• Linear system can be described by impulse response or
step response
• Linear system can be described by frequency response =
Fourier transform of the impulse response
• Linear model approximations can be obtained from more
complex models
– Approximation of a linear model response
– Linearization of a nonlinear model
EE392m - Spring 2005 Control Engineering 2-36
Gorinevsky