Professional Documents
Culture Documents
Linear models
Part II
Step and Impulse Response
Graphical Models
Linear models
Classification
Step and impulse responses are graph models; they belong to the
second category.
Linear models
Recall example
A hard drive read-write head, with input = motor voltage, and output =
head position.
Linear models
Classification (continued)
Linear models
Table of contents
Linear models
Linear models
Y (s)
bm sm + bm1 sm1 + . . . + b1 s + b0
=
,
U(s)
an sn + an1 sn1 + . . . + a1 s + a0
mn
where U(s) and Y (s) are, respectively, the Laplace transforms of the
input and output signals u(t) and y(t).
(Note: in zero initial conditions.)
The Laplace transform of a signal f (t) is:
Z
F (s) = L[f (t)] =
f (t)est dt
0
Linear models
Linear models
Table of contents
1
Linear models
2 (t) 1 (t)
R
2 (s) 1 (s)
R
1 (s)
=
2 (s)
1
+1
C
Rs
Linear models
H(s) =
K
Ts + 1
where:
K is the gain (= 1 in the example)
T is the time constant (= C
R in the example)
Linear models
Table of contents
1
Linear models
(
0 t 0
uS (t) =
1 t >0
Linear models
Solving the differential equation for y(t) (or easier: solve for Y (s) and
then apply inverse Laplace transform L1 ), we get:
y (t) = K (1 et/T )
from where:
K
K
K t/T
e
, y(0)
= e0 =
T
T
T
y(T ) = K (1 e1 ) 0.632K
y (t) =
Linear models
Sys. Theory,
Process Modeling.
Algorithm
1
2
Linear models
Linear models
Linear models
Table of contents
1
Linear models
Consider the thermal system in the figure. The input is the voltage V
applied to the lamp, the output is the temperature read by a
thermocouple at the back of the steel plate.
Linear models
Linear models
yss y0
192 129
21
uss u0
96
Linear models
b = 21
K
b = 60
T
b
H(s)
=
b
K
bs + 1
T
21
60s + 1
Linear models
The simulation does not take into account the non-zero initial
condition of the system, hence the first part is different.
The fit is not great the cooling dynamics are quite slower than the
heating dynamics, for example, so in reality this is not a simple
first-order system.
Nevertheless, the transfer function is sufficient for a rough initial
model: this is the typical use of transient analysis.
Linear models
Mean squared error (MSE) on the validation data (second and further
steps):
J=
N
N
1 X 2
1 X
e (k ) =
(yb(k) y (k ))2 62.21
N
N
k=1
k=1
Linear models
Table of contents
1
Linear models
X (s)
1
=
F (s)
ms2 + k
Linear models
H(s) =
K n2
s2 + 2n s + n2
where:
K is the gain (= k1 in the example)
is the damping (= 0 in the example)
p
n is the natural frequency (= k /m in the example)
Linear models
Table of contents
1
Linear models
Linear models
> 1, overdamped
Linear models
y (t) = K 1 p
en t sin(n
1 2
#
p
1 2 t + arccos )
Linear models
Response characteristics
Steady-state value K
To get the peaks and valleys, we solve for zero derivative, y (t) = 0:
p
K n
en t sin(n 1 2 t) = 0
y (t) = p
1 2
m
tm = p
n 1 2
y(tm ) = K [1 + (1)m M m ], where overshoot M = e
12
Linear models
Nonparametric model
Linear models
Algorithm
1
2
Solve M = e
12
yss y (t2 )
y(t1 )yss .
+log M
Linear models
Similar to 1st order case: new input u(t) = u0 + (uss u0 )uS (t), so
the new output is again just a shifted and scaled version of the ideal
step response yS (t): y (t) = y0 + (uss u0 )yS (t).
The modified formulas are:
yss y0
uss u0 .
Gain K =
Overshoot (a) M =
M=
3
4
yss y(t2 )
y (t1 )yss
y(t1 )yss
yss y0
: same as before.
T0 : same as before, the time axis is unchanged.
Linear models
Table of contents
1
Linear models
Note again the measurement noise. Also, while the experiment has
zero initial condition (u0 = y0 = 0), the steps still have nonstandard
values (different from 1).
We will use step 1 for identification, steps 3-5 for validation (using the
fact that step 2 returns the system to zero initial condition).
Linear models
Linear models
yss y0
uss u0
0.25.
Gain K =
Overshoot M =
y(t1 )yss
yss y0
+log M
0.36.
0.31.
Linear models
b = 0.25
K
b = 0.31
cn = 5.05
b
H(s)
=
b
K
bn2
6.38
= 2
2
2
b
s + 3.09s + 25.51
s + 2b
n s +
bn
Linear models
N
N
1 X 2
1 X
e (k ) =
(yb(k) y (k ))2 9.66 105
N
N
k=1
k=1
Linear models
Table of contents
1
Linear models
Linear models
Time delay
The response of a 1st or 2nd order system with a time delay of has
the same shape as before, but after the input changes, there is a
delay of before the output responds.
K
es ,
Ts + 1
H(s) =
K n2
es
s2 + 2n s + n2
Linear models
Table of contents
1
Linear models
uI (t)dt = 1.
(In fact, the ideal impulse is not a function and requires the notion of
distributions to be formally defined.)
Linear models
(
uIR (t) =
t [0, )
otherwise
Linear models
1
,
s
YS (s) =
Linear models
Table of contents
1
Linear models
H(s) =
where:
K is the gain
T is the time constant
K
Ts + 1
Linear models
Using the relation to the step response, and the derivative of the step
response we already computed, we have the impulse response:
yI (t) =
from where:
K t/T
e
,
T
t 0
yI (0) =
= ymax
T
y (T ) = K e1 = y e1 0.368y
I
max
max
T
Note: yI (4T ) = 0.0183ymax , so like for the step response, the output
is roughly in steady state after 4T .
Linear models
K
y
max = y0 +
T
So the behavior is:
y (T ) = y0 + 0.368(ymax y0 )
Note u0 = uss , y0 = yss .
Linear models
Linear models
We can estimate the gain by using ymax = KT , but in practice this will
not be as accurate (e.g. because the impulse is not ideal).
Algorithm
1
Read ymax and determine the time where the output decreases to
0.368 of the difference ymax y0 . That is the time constant T .
Find K = ymax T .
Linear models
Table of contents
1
Linear models
Linear models
130
1 X
y(k) 0.13
11
k=120
Linear models
Linear models
b = 0.25
K
b = 3.92
T
b
K
0.25
b
H(s)
=
=
b
3.92s
+1
Ts + 1
Linear models
The simulation does not take into account the non-zero initial
condition of the system, hence the first part has large differences.
We will present a method to take into account initial conditions.
Linear models
x(t)
= Ax(t) + Bu(t)
y(t) = Cx(t) + Du(t)
where:
x state vector, x Rn with n the order of the system
u and y are the usual input and output. They can be vectors if
the system has several inputs or outputs, but for us here, a scalar
input and output are enough.
A state matrix, B input matrix, C output matrix, and D
feedthrough matrix. They have appropriate dimensions:
A Rnn , B Rn1 (a vector, due to scalar input), C R1n (a
vector, due to scalar output), D R (a scalar).
Linear models
Y (s)
K
=
Ts + 1
U(s)
y(t)
=
1
K
y (t) + u(t)
T
T
x(t)
= x(t) + u(t)
T
T
y (t) = x(t)
so our state space model has A = T1 , B =
K
T
, C = 1, D = 0.
Linear models
x(t)
= x(t) +
b
T
y (t) = x(t)
b
K
u(t) = 0.26x(t) + 0.06u(t)
b
T
Linear models
Linear models
Table of contents
1
Linear models
Table of contents
1
Linear models
H(s) =
K n2
s2 + 2n s + n2
where:
K is the gain
is the damping factor
n is the natural frequency
Linear models
Linear models
> 1, overdamped
Linear models
Linear models
Rt
Since yS (t) = 0 yI ( )d , and remembering the sizes of the first peak
and valley in the step response as a function of the overshoot M:
Z t0,1
Z t0,2
A+ =
yI ( )d = K + KM, A =
yI ( )d = KM + KM 2
0
t0,1
Linear models
Therefore:
A
KM + KM 2
=
=M
A+
K + KM
Linear models
t0,2
(y0 y( ))d
A =
t0,1
= KM + KM 2
Linear models
A
A+ .
T0
1 2
, or n =
2
T0
2 + log2 M.
Linear models
We solve y (t) = 0 to get t1 for the first peak, and replace it in y (t) to
get the value at the peak. After some calculation we obtain:
y(t1 ) = K n e
arccos2
1
y(t1 )
arccos
n e
. This
12
Linear models
Table of contents
1
Linear models
Linear models
130
1 X
y (k ) 0.5
11
k =120
Linear models
We read t0,0 1.6, t0,1 2.3, t0,3 2.99. Note the impulse is applied
at time t0,0 6= 0, so we need to take this into account.
The areas are estimated numerically:
Z
t0,1
(y ( ) y0 )d Ts
A+ =
t0,0
(y0 y ( ))d Ts
t0,1
(y(k) y0 ) 0.34
k =k0,0
t0,2
A =
k0,1
X
k0,2
X
(y0 y (k )) 0.12
k =k0,1
with k0,0 , k0,1 , k0,2 sample indices corresponding to t0,0 , t0,1 , t0,2 .
Linear models
A
A+
+log M
0.31.
Linear models
Linear models
b = 0.25
K
b = 0.31
cn = 5.16
b
H(s)
=
b
K
bn2
6.64
= 2
2
2
b
s + 3.21s + 26.68
s + 2b
n s +
bn
Linear models
Linear models
0
1
0
x(t)
=
x(t) +
u(t)
26.68 3.22
6.64
y (t) = 1 0 x(t) + 0u(t)
x1 (t)
where x is now the whole state vector, x(t) =
.
x2 (t)
Linear models
Example: Validation
To take the initial condition into account, we set x1 (0) = y0 , x2 (0) = 0
when starting the simulation.