lecture 2 – linear systems - web.stanford.edu · lecture 2 – linear systems ... – broad class...
TRANSCRIPT
EE392m - Spring 2005Gorinevsky
Control Engineering 2-1
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 2005Gorinevsky
Control Engineering 2-2
Modeling and Analysis
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
System Model
[internal states]Input signal(control)
Output signal(observation)
state evolution
EE392m - Spring 2005Gorinevsky
Control Engineering 2-3
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 2005Gorinevsky
Control Engineering 2-4
State space model • Generic state space model
– is described by ODEs– e.g., physics-based system
model– state vector x– observation vector y– control vector u
),(
),,(
txgy
tuxfdtdx
=
= state evolution
observation
Example: F16 Longitudinal Model
e-
e--
e-
.q..V.qq
.q..V.-
δ.q...V.-V
δαθ
δααθα
180081 82010952
1015291002110542
17058023282810931
12
34
2
−−+⋅==
⋅−+−⋅=
+−−+⋅=
&
&
&
&
z
x
δe
αθV
eu δ=
θ3.57=y
from Aircraft Control and Simulationby Stevens and Lewis
x1 - velocity V [ft/sec] x2 - angle of attack α [rad] x3 - pitch angle θ [rad] x4 - pitch rate q [rad/sec]δe - elevator deflection [deg]
EE392m - Spring 2005Gorinevsky
Control Engineering 2-5
Linear state space model • Linear Time Invariant (LTI) state space model:
• Can be integrated analytically or numerically (simulation) • Can be well analyzed: stability, response
Cxy
BuAxdtdx
=
+= state evolution
observations
Example: F16 Longitudinal Model
[ ] xy
uxdtdx
⋅=
⋅
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
−
⋅−+⋅
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
−⋅
−⋅−−−⋅−
=−
−
−
−
03.5700
18.00
1015.217.0
08.1082.01095.2100091.0002.11054.248.02.3282.81093.1
3
12
4
2
EE392m - Spring 2005Gorinevsky
Control Engineering 2-6
Integrating linear autonomous system
• Matrix exponential– Can be computed in Matlab
as expm(A)– The definition corresponds
to integrating the ODE by Euler method
Axdtdx =
( ) tt
ttAIAt ∆
→∆∆+= /
0lim)exp(
( ) )()()()( TxtAIttAxTxtTx ∆+=∆+≈∆+
Example: >>A = [-1.93e-2 8.82 -32.2 -0.58;
-2.54e-4 -1.02 0 0.91;0 0 0 1;
2.95e-12 0.82 0 -1.08];
>> expm(A)ans =
0.9802 3.1208 -31.8830 -10.2849-0.0002 0.5004 0.0031 0.3604-0.0000 0.2216 1.0002 0.6709-0.0001 0.3239 0.0007 0.4773
( ) )()exp()()( TxtAnTxtAItnTx n ∆→∆+=∆+
EE392m - Spring 2005Gorinevsky
Control Engineering 2-7
Integrating linear autonomous system
• Initial condition response
0)0(, xxAxdtdx ==
0)exp()( xAttx =
Example: %Take A, B, C from the F16 example>> k = 0.02>> G = A + k*B*C;>> x0 = [0.1700;
-0.0022;0;-0.1800];
>> for j = 1:length(t);
x(:,j)=expm(G*t(j))*x0; end;
0 5 10 15 20
1
2
3
0 5 10 15 20-0.04-0.02
00.02
0 5 10 15 20-0.08-0.06-0.04-0.02
00.02
0 5 10 15 20-0.15-0.1
-0.050
0.05
TIME
EE392m - Spring 2005Gorinevsky
Control Engineering 2-8
Eigenvalues and Stability• Consider eigenvalues of the matrix A
• Suppose A has all different and nonzero eigenvalues, then
• The system solution is exponentially stable if• 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
0)det();eig(}{ =−= AIAj λλ
1}diag{ −⋅⋅= VVA jλ
0Re <jλ
1}diag{)exp( −⋅⋅= VeVAt tjλ
Example: % take A from % the F16 example>> eig(A)ans =-1.9125 -0.1519 + 0.1143i-0.1519 - 0.1143i0.0970
0Re <jλ
EE392m - Spring 2005Gorinevsky
Control Engineering 2-9
Input-output models
• Black-box models – describe system P as an operator
Px
uinput signal
youtput signal
internal state (hidden)
• Historically (50 years ago)– Black-box models EE– State-space models ME, AA
EE392m - Spring 2005Gorinevsky
Control Engineering 2-10
Linear System (input-output)
• Linearity
• Linear Time-Invariant systems - LTI
)()( 11 ⋅⎯→⎯⋅ yu P
)()( TyTu P −⋅⎯→⎯−⋅
)()()()( 2121 ⋅+⋅⎯→⎯⋅+⋅ byaybuau P
)()( 22 ⋅⎯→⎯⋅ yu P
⎯→⎯Pu
t
y
t
EE392m - Spring 2005Gorinevsky
Control Engineering 2-11
Convolution representation
• Convolution integral
• Impulse response
• Step response: u = 1 for t > 0
∫∞−
−=t
duthty τττ )()()(
)()()()( thtyttu =⇒= δ
∫∫ =−=tt
dhdthtg00
)()()( ττττ )()( tgdtdth =
uhy *=signal processing notation
EE392m - Spring 2005Gorinevsky
Control Engineering 2-12
Impulse Response for State Space Model
• Impulse response for the state x
• System impulse response
{1
)0()( tuBtAxtx ∆+∆≈∆
BtuBtx =∆≈∆ )(
BAttx )exp()( =
Cxy
BuAxdtdx
=
+= state evolution
observation
Example: >> A = [-0.3130 56.7000 0;
-0.0139 -0.4260 0;0 56.7000 0];
>> B = [0.232; 0.0203; 0];>> C = [0, 0, 1];
0 10 20-0.5
00.5
1
0 10 20-0.020
0.020.04
0 10 200
0.5
1
TIME
BAtCth )exp()( =
EE392m - Spring 2005Gorinevsky
Control Engineering 2-13
Formal transfer function• Rational transfer function
= IIR (Infinite Impulse Response) model– Broad class of input-output linear models
• Differentiation operator
• Formal transfer function – rational function of s
• For a causal system m ≤ n
sdtd →
ubdt
udbdt
udbyadt
ydadt
yda nn
n
n
n
mm
m
m
m
11
1
2111
1
21 +−
−
+−
−
+++=+++ KK
usDsNusHy ⋅=⋅=)()()( 11)( ++++= mm
m asasasN K
11)( ++++= nnn bsbsbsD K
EE392m - Spring 2005Gorinevsky
Control Engineering 2-14
Poles, Impulse Response
• Expand
Then
• Quasi-polynomial impulse response – see a textbook
• Example:
usDsNy ⋅=)()( 0)( =sN
0)( =sD- zeros- poles
KMK
M pspssD )()()( 11 −⋅⋅−= K
ups
sNups
sNyKM
K
KM ⋅
−++⋅
−=
)()(
)()(
11
1 K
( ) ( ) tpMK
MK
tpM
M K
K
K ectcectcth 1,1
1,1,11
1,11
1
1)( +−
+− ++++++= KKK
udt
yd =2
2u
sy ⋅= 2
1
00)( xtvth +=
Transfer function:
Impulse response:
EE392m - Spring 2005Gorinevsky
Control Engineering 2-15
Transfer Function for State Space
• Characteristic polynomial
• Poles are the same as eigenvalues of the state-space matrix A• For stability we need Re pk = Re λk < 0
( )( ) BAsICsH
uBAsIy1
1
)( −
−
−=
⋅−=
Poles eigenvalues( ) 0det =− AsI
( ) 0det)( =−= AsIsN
CxyBuAxsx
=+=
• Formal transfer function for a state space model
sdtd →
EE392m - Spring 2005Gorinevsky
Control Engineering 2-16
Laplace transform• Laplace integral transform:
• Laplace transform of the convolution integral yields
• Transfer function:– function of complex variable s– analytical in a right half-plane Re s ≥ a– for a stable system a ≤ 0– for an IIR model
∫∞
=0
)()( dtethsH st)(ˆ)()(ˆ susHsy =
)(ˆ sxsdtdx →
dtetxsxtx st∫∞
=→0
)()(ˆ)(
Re s
Imag s
)(sH
)()()(
sDsNsH =
EE392m - Spring 2005Gorinevsky
Control Engineering 2-17
Frequency decomposition• Sinusoids are eigenfunctions of an LTI system:
LTIPlant
• Frequency domain analysis
usHy )(=
∑∑ =→ tikk
tik
kk eiHuyeu ωω ω )(
tie ω tieiH ωω)(
( ) tititi eiedtdes ωωω ω=→
EE392m - Spring 2005Gorinevsky
Control Engineering 2-18
Frequency domain description
∫∫ −− =⇒= ωωωπ
ωωπ
ω
ω
ω deuiHydeuu ti
y
ti43421)(~
)(~)(21)(~
21
)(~ ω
ω
ue ti
uPacket of sinusoids
)(~ ω
ω
ye tiPacket
of sinusoids
)( ωiH y
• Frequency domain analysis
)(ˆ)()()(~ ωωωωω
ω iudetudetuuis
stti =⎟⎠⎞⎜
⎝⎛==
=
∞
∞−
∞
∞− ∫∫
• Fourier transform – numerical analysis• Laplace transform – complex analysis u(t) = 0, for t < 0
EE392m - Spring 2005Gorinevsky
Control Engineering 2-19
Continuous systems in frequency domain
• Fourier transform
• Inverse Fourier transform
• I/O impulse response model
• Transfer function
• System frequency response)(~)()(~
)()(
)()()(
)(~21)(
)()(~
0
ωωω
ττ
ωωπ
ω
ω
ω
uiHy
dtethsH
dtuthty
dextx
dtetxx
st
t
ti
ti
=
=
−=
=
=
∫
∫
∫
∫
∞∞−
∞
∞−
−
∞
∞− ],[],[ ∞−∞→∞−∞
EE392m - Spring 2005Gorinevsky
Control Engineering 2-20
Frequency domain description• Bode plots:
ti
ti
eiHyeu
ω
ω
ω )(==
• Example:
7.01)(
−=
ssH
Bode Diagram
Frequency (rad/sec)
Phas
e (d
eg)
Mag
nitu
de (d
B)
-5
0
5
10
15
10-2 10-1 100-180
-135
-90
-45
0
• |H| is often measured in dB– [dB] = 20 log10 M
)(arg)()()(ωωϕ
ωωiH
iHM==
EE392m - Spring 2005Gorinevsky
Control Engineering 2-21
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 2005Gorinevsky
Control Engineering 2-22
Black-box model from data• Linear black-box model can be determined from the data,
e.g., step response data, or frequency response
• Example problem: fit an IIR model of a given order• This is called model identification • Considered in more detail in Lecture 8
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1
TIME
HEA
T FL
UX
STEP RESPONSE
EE392m - Spring 2005Gorinevsky
Control Engineering 2-23
Linear PDE models • Include functions of spatial variables
– electromagnetic fields – mass and heat transfer– fluid dynamics – structural deformations
• Example: sideways heat equation
1
2
2
0)1(;)0(
=∂∂=
==∂∂=
∂∂
xxTy
TuTxTk
tT
yheat flux
x
Toutside=0Tinside=u
EE392m - Spring 2005Gorinevsky
Control Engineering 2-24
Linear PDE System Example • Heat transfer equation,
– boundary temperature input u– heat flux output y
• Impulse response and step response• Transfer function is not rational
0)1()0(
2
2
==∂∂=
∂∂
TTuxTk
tT
1=∂∂=
xxTy
0 20 40 60 80 1000
2
4
6x 10
-2
TIME
HEA
T FL
UX
PULSE RESPONSE
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1
TIME
HEA
T FL
UX
STEP RESPONSE
0
0.5
105
1015
0
0.2
0.4
0.6
0.8
1
TIME
TEMPERATURE
COORDINATE
heat flux
EE392m - Spring 2005Gorinevsky
Control Engineering 2-25
Impulse response approximation• Approximating impulse
and step responses by a low order rational transfer function model
• Higher order model can provide very accurate approximation
• Methods:– trial and error– sampled time response fit,
e.g., Matlab’s prony
– identification, Lecture 8– formal model reduction
approaches - advanced
03.034.08.24.008.001.0)( 2
2
+++−=
sssssH
0 20 40 60 80 1000
0.02
0.04
0.06
0 20 40 60 80 1000
0.5
1
TIME
EE392m - Spring 2005Gorinevsky
Control Engineering 2-26
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’
• The closed-loop stability impact of the modeling error– Control robustness– Will be discussed in Lecture 9
∫∞−
−=t
uthty τττ )()()(
EE392m - Spring 2005Gorinevsky
Control Engineering 2-27
Nonlinear map linearization• Nonlinear - detailed model • Linear - conceptual design model • Differentiation, secant method
• Example: static map linearization
)()( 0uuufufy −
∆∆≈=
EE392m - Spring 2005Gorinevsky
Control Engineering 2-28
Linearization Example: RTP• RTP – Rapid Thermal
Processing• Major semiconductor
manufacturing process
uinput heaters
heated partT
output furnace
)()( 244
1 FF TTcTTcbudtdT −−−−=
T – part temperatureu – IR heater powerTF – furnace temperature
• Stefan-Boltzmann law nonlinearity• TF is assumed to be constant
EE392m - Spring 2005Gorinevsky
Control Engineering 2-29
RTP, cont’d
Linearize around a steady state point
b = 1000, c1 = 1.1⋅10-10, c2 = 0.8, TF = 300
buTfdtdT += )(
300 400 500 600 700 800 900 1000 1100 1200 1300-1200
-1000
-800
-600
-400
-200
0
TEMPERATURE
f(T)
)()()( 244
1 FF TTcTTcTf −−−−=
∆−∆+≈′= )()()( **
*TfTfTfa
dTTaTfL +−= )()( *
)( *Tfd =buTf
dtdT
L += )(
EE392m - Spring 2005Gorinevsky
Control Engineering 2-30
RTP, cont’d
Simulate performance:
kxudbuaxx
−=++=&
)( bkap +−=Linear system with a pole
T* = 1000, a = -1.7425, b = 1000, k = 0.01
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5300
400
500
600
700
800
900
1000
TIME
T
Linear model, d = 0
Non-linear model
*TTx −=
7425.11−=p
p1
EE392m - Spring 2005Gorinevsky
Control Engineering 2-31
Nonlinear state space model linearization
• Linearize the r.h.s. map in a state-space model
BvAqq
uuufxx
xfuxfx
vq
+=
−∆∆+−
∆∆≈=
&
4342143421& )()(),( 00
{]0......0[
),(),(
#
0000
j
jj
j
jj
dsd
uxfusxfxf
=
−+=⎥⎦
⎤⎢⎣⎡
∆∆
),(0 00 uxf=• Linearize around an equilibrium• Secant method
• This is how Simulink computes linearization
EE392m - Spring 2005Gorinevsky
Control Engineering 2-32
• State vector xx1 - velocity V [ft/sec] x2 - angle of attack α [rad] x3 - pitch angle θ [rad] x4 - pitch rate q [rad/sec]• Control input
u - elevator deflection δe [deg].
z’
x’
δe
α θV
z
x
eu δ=
θ3.57=y
q
IM
q
qFFmV
FFm
V
y
y
zx
zx
=
=
++−=
+=
θ
ααα
αα
&
&
&
&
)cossin(1
)sincos(1
),(cos),(
sin)(
,
,
,
etmy
etzz
txx
RCMmgrCF
TmgrCF
δαθδα
θα
=+=
+−=⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
=
θ
αq
V
x
),( uxfdtdx =
Example: F16 Longitudinal Model
For more detail see: Aircraft Control and Simulation by Stevens and Lewis
EE392m - Spring 2005Gorinevsky
Control Engineering 2-33
Nonlinear Model of F16
• 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
)(
),(
xgy
uxfdtdx
=
= state evolution
observation
EE392m - Spring 2005Gorinevsky
Control Engineering 2-34
Linearized Longitudinal Model of F16• Assume trim condition
• Linearize the nonlinear function f(x,u) by a finite difference method (secant method). Step = [1 0.001 0.01 0.001]
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
−
⋅−=
∆∆=
−
18.00
1015.217.0
3
ufB
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
⋅
−⋅−−−⋅−
=∆∆=
−
−
−
08.1082.01095.2100091.0002.11054.248.02.3282.81093.1
12
4
2
xfA
- velocity V [ft/sec] - angle of attack α [rad] - pitch rate q [rad/sec]- pitch angle θ [rad⎥
⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
=
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
=
0393.00
0393.0500
0
0
0
0
0
θ
αq
V
x
• These are the matrices we considered in the linear F16 model example
EE392m - Spring 2005Gorinevsky
Control Engineering 2-35
Simulation-based validation• Simulate with nonlinear model, compare with linear model
results
• Doublet response
EE392m - Spring 2005Gorinevsky
Control Engineering 2-36
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