exercises chapter 2 ”system identification - umu. · pdf fileexercises chapter 2...
TRANSCRIPT
Exercises Chapter 2
”System Identification”
The solutions presented here are for the exercises:
• 2G.2
• 2G.4
• 2E.2
• 2E.4
• 2E.6
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 1
2G.2 Let Φs(ω) be the (power ) spectrum of a scalar signal defined as in
(2.63). Show that
i Φs(ω) is real
ii Φs(ω) ≥ 0∀ω
iii Φs(−ω) = Φs(ω)
(2.63)
Φs(ω) =
∞∑
τ=−∞
Rs(τ )e−iτω
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 2
2G.2 Solution
The expression (2.63) represents the Fourier transform of the Autocorrelation
function. This Expression can be divided as:
Φs(ω) =
0∑
τ=−∞
Rs(τ )e−iτω +
∞∑
τ=0
Rs(τ )e−iτω − Rs(0)
rewriting this expression we get
Φs(ω) =
∞∑
τ=0
Rs(−τ )eiτω +
∞∑
τ=0
Rs(τ )e−iτω − Rs(0)
According to the properties of the Autocorrelation Function we know that it
is an even function which tell us:
Rs(τ ) = Rs(−τ )
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 3
We can rewrite the expression in the next form
Φs(ω) =
∞∑
τ=0
Rs(τ )eiτω +
∞∑
τ=0
Rs(τ )e−iτω − Rs(0)
=
∞∑
τ=0
Rs(τ )(eiτω + e−iτω
)− Rs(0)
by definition
cos(θ) =
(eiθ + e−iθ
)
2
Constructing this expression in our function we get:
Φs(ω) = 2∞∑
τ=0
Rs(τ )
(eiτω + e−iτω
)
2) − Rs(0)
Φs(ω) = 2∞∑
τ=0
Rs(τ )cos(τω) − Rs(0)
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 4
which can be also written as
Φs(ω) = Rs(0) + 2
∞∑
τ=1
Rs(τ )cos(τω)
By definition Rs(τ ) and cos(τω) are real functions, therefore using this
expression we can conclude that:
Φs(ω) is real
ii. By theory any matrix M is said to be positive-semidefinite if it has the
following equivalent property:
M = LL∗
s∗LL∗s ≥ 0
(L∗s)∗(L∗s) = ||L∗s||2 ≥ 0
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 5
The expression for the spectral density is defined as
Φs(ω) =
∞∑
τ=−∞
Rs(τ )e−iτω
where
Rs(τ ) = Es(t)s(t − τ ) =∞∑
t=−∞
s(t)s∗(t − τ )
Replacing in the expression for the spectral density
Φs(ω) =
∞∑
τ=−∞
Es(t)s(t − τ )e−iτω
=
∞∑
τ=−∞
∞∑
t=−∞
s(t)s∗(t − τ )e−iτω
=
∞∑
τ=−∞
∞∑
t=−∞
s(t)s∗(t − τ )e−iωteiω(t−τ)
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 6
if we make t − τ ∼= ξ then we can rewrite the last expression as
Φs(ω) =
∞∑
t=−∞
s(t)e−iωt
∞∑
ξ=−∞
sT (ξ)eiωξ
=
[∞∑
t=−∞
s(t)e−iωt
]
︸ ︷︷ ︸
L
∞∑
ξ=−∞
s(ξ)e−iωξ
∗
︸ ︷︷ ︸
L∗
if we apply the positive semi-definite theorem to this expression
z∗Φ(ω)z = z∗
[∞∑
t=−∞
s(t)e−iωt
] [∞∑
t=−∞
s(t)e−iωt
]∗
z
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 7
z∗Φ(ω)z =
([∞∑
t=−∞
s(t)e−iωt
]∗
z
)∗ ([∞∑
t=−∞
s(t)e−iωt
]∗
z
)
=
∣∣∣∣∣
∣∣∣∣∣
[∞∑
t=−∞
s(t)e−iωt
]∗
z
∣∣∣∣∣
∣∣∣∣∣
2
≥ 0
this last term tell us that the expression for ω will be always larger or equal
than zero due to the square exponent in the final expression
Φs(ω) ≥ 0 ∀ ω
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 8
iii. If we use the relation
Φs(ω) = 2
∞∑
τ=0
Rs(τ )cos(τω) − Rs(0)
instead of (2.63), we see that ω only affects the term cos(τω). By definition
of the cosine function we know that:
cos(ω) = cos(−ω)
This relations implies that
Φs(ω) = Φs(−ω)
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 9
2G.4. Let a continuous time system representation be given by
y(t) = Gc(p)u(t)
The input is constant over the sampling interval T . Show that the sampled
input-output data are related by
y(t) = GT (q)u(t)
where
GT (q) =1
2πi
∫ i∞
s=−i∞
Gc(s)esT − 1
s
1
q − esTds
note: correction for the exercise can be found at:http://www.control.isy.liu.se/ ljung/sysid/errata/
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 10
2G.4. Solution
If we express the system in terms of the Laplace transform we have
Y (s) = G(s)U(s)
where U(s) will be the Laplace transform of the constant step signal over the
period T
U(s) =
∫ T
0
u(t)e−st dt
which will lead to the solution
U(s) =1
se−st|(0,T )
=1 − e−sT
s
rewriting the expression for Y (s) we will have
Y (s) = Gc(s)1 − e−sT
s
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 11
To be able to use the discrete transform GT (q) it is needed first to take this
expression back into time domain
y(t) =1
2πi
∫ i∞
s=−i∞
Y (s)est ds
y(t) =1
2πi
∫ i∞
s=−i∞
Gc(s)1 − e−sT
sest ds
From this expression we can calculate GT (q) applying the definition of the
discrete transform
GT (q) =T∑
k=1
gT (k)q−k
=
T∑
k=1
1
2πi
∫ i∞
s=−i∞
Gc(s)1 − e−sT
seskT q−k ds
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 12
The expression only affects the last exponential term
GT (q) =1
2πi
∫ i∞
s=−i∞
Gc(s)1 − e−sT
s
T∑
k=1
eskT q−k ds
Analyzing the sumatory
T∑
k=1
eskT q−k =
T∑
k=1
(esT q−1
)k
If we apply the known expression
T∑
k=0
(aq−1
)k=
q
q − a
in the equation above
T∑
k=0
(esT q−1
)k= 1 +
T∑
k=1
(esT q−1
)k
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 13
As a result we will have that
T∑
k=1
(esT q−1
)k=
T∑
k=0
(esT q−1
)k − 1
=q
q − esT− 1
=esT
q − esT
Plugging the last expression in the general formula
GT (q) =1
2πi
∫ i∞
s=−i∞
Gc(s)1 − e−sT
s
esT
q − esTds
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 14
GT (q) =1
2πi
∫ i∞
s=−i∞
Gc(s)1 − 1
esT
s
esT
q − esTds
GT (q) =1
2πi
∫ i∞
s=−i∞
Gc(s)esT
−1esT
s
esT
q − esTds
which finally leads to the expression
GT (q) =1
2πi
∫ i∞
s=−i∞
Gc(s)esT − 1
s
1
q − esTds
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 15
2E.2. Suppose that {η(t)} and {ξ(t)} are two mutually independent
sequences of independent random variables with
Eη(t) = Eξ(t) = 0, Eη2(t) = λη, Eξ2(t) = λξ
Consider
ω(t) = η(t) + ξ(t) + γξ(t − 1)
Determine a MA(1) process
v(t) = e(t) + ce(t − 1)
where {e(t)} is white noise with
Ee(t) = 0, Ee2(t) = λe
such that {ω(t)} and {v(t)} have the same spectra; that is, find c and λe so
that Φv(ω) ≡ Φω(ω)
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 16
2E.2. Solution
If we want to achieve
Φv(ω) ≡ Φω(ω)
then the Fourier transform of both autocorrelation functions should be the
same∞∑
τ=−∞
Rv(τ )e−iτω =
∞∑
τ=−∞
Rω(τ )e−iτω
this reasoning leads to the fact that both autocorrelation functions should be
the same
Rv(τ ) ≡ Rω(τ )
or
Ev(t)v(t − τ ) ≡ Eω(t)ω(t − τ )
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 17
Separating the problem in two parts
Ev(t)v(t − τ ) = E {(e(t) + ce(t − 1)) (e(t − τ ) + ce(t − 1 − τ ))}
= E{
e(t)e(t − τ ) + ce(t)e(t − 1 − τ ) + ...
... + ce(t − 1)e(t − τ ) + c2e(t − 1)e(t − 1 − τ )}= Ee(t)e(t − τ ) + 2cEe(t)e(t − 1 − τ ) + ...
... + c2Ee(t − 1)e(t − 1 − τ )}
As we can see the expressions above represent only the Autocorrelation
functions of the white noise e(t) shifted or multiplied by a scalar
Ev(t)v(t − τ ) = Re(τ ) + 2cRe(τ ) + c2Re(τ )
= Re(τ )(1 + c)2
Under certain conditions we could conclude that
Re(τ ) = Ee2(t) = λe
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 18
Then the final expression for Rv(τ ) will be
Rv(τ ) = Ev(t)v(t − τ ) = λe(1 + c)2
to obtain a expression for Rω(τ ) we follow the same procedure
Eω(t)ω(t − τ ) = E{(η(t) + ξ(t) + γξ(t − 1))(η(t − τ ) + ...
... + ξ(t − τ ) + γξ(t − 1 − τ ))}
= E{
η(t)η(t − τ ) + η(t)ξ(t − τ ) + ...
... + γη(t)ξ(t − 1 − τ ) + ξ(t)η(t − τ ) + ...
... + ξ(t)ξ(t − τ ) + γξ(t)ξ(t − 1 − τ ) + ...
... + γξ(t − 1)η(t − τ ) + γξ(t − 1)ξ(t − τ ) + ...
... + γ2ξ(t − 1)ξ(t − 1 − τ ))}
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 19
Separating the function we will get
Eω(t)ω(t − τ ) = Eη(t)η(t − τ ) + Eη(t)ξ(t − τ ) + ...
... + γEη(t)ξ(t − 1 − τ ) + Eξ(t)η(t − τ ) + ...
... + Eξ(t)ξ(t − τ ) + γEξ(t)ξ(t − 1 − τ ) + ...
... + γEξ(t − 1)η(t − τ ) + γEξ(t − 1)ξ(t − τ ) + ...
... + γ2Eξ(t − 1)ξ(t − 1 − τ )
applying the data given we can reduce the system to
Eω(t)ω(t − τ ) = Eη(t)η(t − τ ) + Eξ(t)ξ(t − τ ) + ...
... + γEξ(t)ξ(t − 1 − τ ) + γEξ(t − 1)ξ(t − τ ) + ...
... + γ2Eξ(t − 1)ξ(t − 1 − τ )
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 20
Applying the same reasoning as before, the terms in the last expression
represent only the Autocorrelation functions of Rη(τ ) and Rξ(τ ), therefore
we can rewrite as
Eω(t)ω(t − τ ) = Rη(τ ) + Rξ(τ ) + 2γRξ(τ ) + γ2Rξ(τ )
= Rη(τ ) + Rξ(τ )(1 + γ)2
Under certain conditions we could conclude that
Rξ(τ ) = γξ
Rη(τ ) = γη
Then the final expression for Rω(τ ) will be
Rω(τ ) = Eω(t)ω(t − τ ) = γη + γξ(1 + γ)2
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 21
By the equivalence
Rv(τ ) ≡ Rω(τ )
we obtain
λe(1 + c)2 = γη + γξ(1 + γ)2
λe + 2cλe + cλ2e = λη + λξ + 2γλξ + γ2λξ
we can form the equalities
λe = λη + λξ
cλe = γλξ
And finally we can conclude that
λe = λη + λξ
c =λξ
λη + λξ
γ
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 22
2E.4. Consider the ”state space description”
x(t + 1) = fx(t) + ω(t)
y(t) = hx(t) + v(t)
where x, f , h, ω and v are scalars. {ω(t)} and {v(t)} are mutually
independent white Gaussian noises with variances R1 and R2, respectively.
Show that y(t) can be represented as an ARMA process:
y(t)+a1y(t−1)+· · ·+any(t−n) = e(t)+c1e(t−1)+· · ·+cne(t−n)
Determine n, ai, ci and the variance of e(t) in terms of f , h, R1 and R2.
What is the relationship between e(t), ω(t) and v(t)?
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 23
Taking the discrete transform of the state space model:
qX(q) = fX(q) + ω(q)
Y (q) = hX(q) + v(q)
X(q) =ω(q)
q − f
Y (q) =hω(q)
q − f+ v(q)
Y (q)(q − f) = hω(q) + (q − f)v(q)
yk+1 − fyk = hωk + vk+1 − fvk
what we want to do now is to make valid the next equivalence
hωk + vk+1 − fvk∼= αek+1 + βek
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 24
as we see in the ARMA process, we are missing the values of α and β, but
one fact that we have is that the ARMA process is monic, which means that
the term for α = 1, thus
yk+1 − fyk∼= ek+1 + βek
if we name the expression as follow:
ξk = hωk + vk+1 − fvk
ζ = ek+1 + βek
To fulfill the equivalence of the process we will find the next equivalences:
Eξk = Eζk = 0
Eξkξk = Eζkζk
Eξkξk−1 = Eζkζk−1
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 25
replacing the expression
E{hωk + vk+1 − fvk}{hωk + vk+1 − fvk} =
= E{ek+1 + βek}{ek+1 + βek}E{hωk + vk+1 − fvk}{hωk−1 + vk − fvk−1} =
= E{ek+1 + βek}{ek + βek−1}
making the internal operations for Eξkξk = Eζkζk we end up in
h2Eω2k + Ev2
k+1 + f2Ev2k = Ee2
k+1 + β2Ee2k
h2R1 + R2 + f2R2 = Re + β2Re
the expression for Eξkξk−1 = Eζkζk−1
−fEv2k = βEe2
k
−fR2 = βRe
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 26
We need to solve the next system of equations for β and Re
h2R1 + R2 + f2R2 = Re(1 + β2)
−fR2 = βRe
getting Re from the second equation
Re =−fR2
β
Replacing into the first equation
1 + β2
β= −h2R1 + R2 + f2R2
fR2
as we see the numerator of the right hand side will be always positive and
equal to some constant value, for simplicity we can rewrite the expression like:
1 + β2
β= −2C
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 27
where
2C =h2R1 + R2 + f2R2
fR2
the solution for β will be then
β = C ±√
C2 − 1
So finally we can write the ARMA process in the form
yk+1 − fyk = ek+1 + (C ±√
C2 − 1)ek
now we need to check the stability of the ARMA process, to do that we
analyze first the square root in the expression for β:
C2 − 1 > 0
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 28
which tell us that C has to be always −1 < C < 1 in order to avoid complex
values. As we see in the expression for 2C this requirement is going to be
fulfilled whit a good choice of the value f . Another requisite will be
|C ±√
C2 − 1| < 1
and again this decision can be taken with a good choice of the parameter f .
Clearly it can be seen in the process transfer function:
Y (q)
E(q)=
q + β
q − f
if the parameter f in the denominator is chosen in a way that |f | > 1 then
we will have an unstable system. This means that nothing can be said about
the sign that we must choose for the expression β in order to make the system
stable. The value for the variance of e(t) will be
Re =−fR2
C ±√
C2 − 1
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 29
2E.6. Consider the system
d
dty(t) + ay(t) = u(t)
Suppose that the input u(t) is piecewise constant over the sampling interval
u(t) = uk, kT ≤ t < (k + 1)T
(a) Derive a sample data system description for uk, y(kT ).
(b) Assume that there is a time delay of T seconds so that u(t) in the
expression is replaced by u(t − T ). Derive a sample data system
description for this case.
(c) Assume that the time delay is 1.5T so that u(t) is replaced by
u(t − 1.5T ). Then give the sampled data description.
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 30
2E.6. Solution
a). The solution to the differential equation which includes the effects of the
input and initial conditions is given by:
y(t) = e−a(t−t0)y(t0) +
∫ t
t0
e−a(t−τ)u(τ )dτ
where y(t0) is the initial condition on the state variables. Based on this
solution the sampled state response is given by
y[(k + 1)T ] = e−aT y[kT ] +
∫ T
τ=0
e−a(T −τ)u(τ + kT )dτ
we can write
y[(k + 1)T ] = Ay[kT ] + Bu[kT ]
where
A = e−aT , B =
∫ T
τ=0
e−a(T −τ)dτ =1 − e−aT
a
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 31
if we use Z transform
z(Y (z) − y[0]) = AY (z) + BU(z)
Y (z)(z − A) = BU(z) + zy[0]
Y (z) =B
z − AU(z) +
z
z − Ay[0]
or expressed in geometric series
y(t) =B
A
∞∑
k=0
Ak+1u(t − k) +∞∑
k=0
Akq−ky[0]
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 32
(b). Introducing the time delay into the system
d
dty(t) + ay(t) = u(t − T )
The solution to the differential equation after applying the delay in the
equation including the effects of the input and the initial conditions is given
by:
y(t) = e−a(t−t0)y(t0) +
∫ t
t0
e−a(t−τ)u(τ − T )dτ
where y(t0) is the initial condition on the state variables. Based on this
solution the sampled state response is given by
y[(k + 1)T ] = e−aT y[kT ] +
∫ T
τ=0
e−a(T −τ)u(τ + kT − T )dτ
we can write
y[(k + 1)T ] = Ay[kT ] + Bu[kT − T ]
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 33
where
A = e−aT , B =
∫ T
τ=0
e−a(T −τ)dτ =1 − e−aT
a
if we use the Z transform
z(Y (z) − y[0]) = AY (z) + Bz−1U(z) + Bu[−1]
Y (z)(z − A) = Bz−1U(z) + Bu[−1] + zy[0]
Y (z) =Bz−1
z − AU(z) +
B
z − Au[−1] +
z
z − Ay[0]
Y (z) =B
z(z − A)U(z) +
B
z − Au[−1] +
z
z − Ay[0]
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 34
(c). Introducing the time delay into the system
d
dty(t) + ay(t) = u(t − 1.5T )
The solution to the differential equation after applying the delay in the
equation including the effects of the input and the initial conditions is given
by:
y(t) = e−a(t−t0)y(t0) +
∫ t
t0
e−a(t−τ)u(τ − 1.5T )dτ
where y(t0) is the initial condition on the state variables. Based on this
solution the sampled state response is given by
y[(k + 1)T ] = e−aT y[kT ] +
∫ T
τ=0
e−a(T −τ)u(τ + kT − T )dτ
where
T = 1.5T
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 35
The sampled state response will be given by:
y[(k + 1)T ] = Ay[kT ] + Bu[kT − T ]
where the parameters A and B will be:
A = e−1.5aT
B =
∫ 1.5T
τ=0
e−a(1.5T −τ)dτ =1 − e−1.5aT
a
if we use the Z transform
z(Y (z) − y[0]) = AY (z) + Bz−1U(z) − Bu[−1]
Y (z)(z − A) = U(z)(Bz−1) + zy[0] − Bu[−1]
Y (z) =Bz−1
z − AU(z) +
z
z − Ay[0] − B
z − Au[−1]
Y (z) =B
z(z − A)U(z) +
z
z − Ay[0] − B
z − Au[−1]
Pedro Xavier Miranda La Hera. Solutions. Chapter 2 Book: ”System Identification” (Umea, January, 2005) 36