Professional Documents
Culture Documents
DSSI 5 Identification of Dynamic Systems PDF
DSSI 5 Identification of Dynamic Systems PDF
There are two important estimation algorithms often used for system identification,
For example, let’s consider a second order linear time invariant system which is
described as below:
where u(t) is the input, y(t) is the output and all the coefficients a1, a0, b1 and b0 are
unknown. In general, the input u(t) is given by ourselves, so both u(t) and u t are
exactly known. As for the output, we assume that only y(t) is measurable, but y t
and yt are not obtainable. Based on the above statement, now let’s find a way to
determine the unknown coefficients a1, a0, b1 and b0 by applying the data related to
If the sampling time to measure the output y(t) is T, then the data available for
the determination of a1, a0, b1 and b0 are u(kT), u kT and y(kT) where k=0,1,2,…,n.
Since there are four unknown coefficients, we need to adopt at least four equations
formed by (7-1) at t=kiT, i=1,2,…,n and n>4. For simplicity, we arbitrarily choose five
data, i.e., n=5, at k1=100, k2=140, k3=200, k4=250 and k5=310. Then, we can write five
5-1
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen
1
v AT A AT p (5-8)
Actually, (7-8) is referred to the least squares method which is introduced in the end
Unfortunately, (7-8) is not available yet because we still need to get the data of
y t and yt at t=100T, 140T, 200T, 250T and 310T. Here, let’s adopt the data of
y t and yt at t=100T to explain how to estimate them from the data y(t) based on
by the definition:
y100T y100T h y100T y100T mT
y 100T lim (5-9)
h0 h mT
where m is an integer but not necessary to be 1. As for the estimation of yt at
y 100T mT y 100T mT h
y 100T mT lim
h0 h
(5-10)
y 100T mT y 100T 2mT
mT
then
5-2
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen
Althogh (5-9) and (5-11) is simple, they often lead to undesirable estimation errors. In
instead, we add two other data y(100TmT) and y(100TmT), i.e., we use five data of
5
t t t t j
5 5
yt yi j i (5-12)
i 1 j 1, j i j 1, j i
or
yt y1
t t2 t t3 t t4 t t5 (5-13)
t1 t2 t1 t3 t1 t4 t1 t5
y2
t t1 t t3 t t 4 t t5 y t t1 t t 2 t t 4 t t5
t 2 t1 t 2 t3 t 2 t 4 t 2 t5 3 t3 t1 t3 t 2 t3 t 4 t3 t5
y4
t t1 t t 2 t t3 t t5 y t t1 t t 2 t t3 t t 4
t 4 t1 t 4 t 2 t 4 t3 t 4 t5 5 t5 t1 t5 t 2 t5 t3 t5 t 4
which is called the Lagrange’s polynomial. Hence, after directly taking derivative
250T and 310T. Then, with all these estimated data, the vector v in (5-8) can be
implemented to get the unknown parameters a1, a0, b1 and b0 in (5-1) which describes
5-3
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen
y a1 x1 a2 x2 an xn (A-1)
where the values of y, x1, x2,…, xn are measured up to m times, where m>n. Assume yk,
xk1, xk2,…and xkn are the values obtained at the k-th measurement. Unfortunately,
coefficients ai, i=1,2,…,n, to fit (A-1) best. Now, let’s introduce how to apply the least
squares method to determine the best coefficients for (A-1). First, define the k-th error
function as
It is required to determine the coefficients ai, i=1,2,…,n, such that the performance
index is minimal, i.e., reaches the smallest value. Since the index is the sum of error
Further rewrite the set of m error functions defined in (A-3) as the following
matrix form
e1 y1 x11 x12 x1n a1
e y x
2 2 21 x 22 x 2 n a 2 (A-5)
em y m x m1 x m 2 x mn a n
e y X a
5-4
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen
where y m and X mn are fixed and known since both of them contain all
Let’s define
1 x11 x12 x1n a1 x11 x12 x1n
x
2 21 x 22 x 2 n a 2 a x 21 a x 22 a x 2 n (A-6)
1
2
n
m x m1 x m 2 x mn a n
x m1 xm 2
x mn
X a x1 x2 xn
which implies the vector n is in the space formed by the column vectors of X,
denoted as xi, i=1,2,…,n, i.e., is in the column space of X. Now, (A-5) can be
expressed as
e y (A-7)
depicted in Figure A-1. Without loss of generality, the column vectors xi, i=1,2,…,n,
are all assumed to be independent, i.e., X is of full rank or rank(X)=n for m>n. Under
the condition rank(X)=n, it has been proved that the square matrix X T X nn is
y
e
e0
0
reduced as small as possible based on the performance index (A-4), given as below:
m
E ek2 e T e e y
2 2 2
y Xa (A-8)
k 1
5-5
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen
E m
e 2 m
e m
k 2 ek k 2 ek xki 0 , i=1,2,…,n (A-9)
ai k 1 ai k 1 ai k 1
perpendicular to all the column vectors of X, which implies the error vector e must be
orthogonal to the column space of X. It can be seen from Figure A-1 that the error
e 0 y Xa 0 (A-13)
then
X T e0 X T y Xa 0 0 (A-14)
i.e.,
X T Xa 0 X T y (A-15)
Due to the fact that X T X 1
exists, the coefficient vector is attained as
5-6
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen
a0 X T X
1
XT y (A-16)
which is the solution of the least squares problem. In addition, it can be found that the
e0 y Xa 0 y X X T X 1
X T y I X X T X
1
X T y (A-17)
E e 0T e 0 y T I X X T X 1
XT I X X
T
T
X
1
XT y
I X X X
(A-18)
1
yT T
X T y y T e0
i.e.,
y e0 T e0 0 (A-19)
0 Xa 0 (A-20)
y e0 0 (A-21)
y e0 T e0 0T e0 0 (A-22)
which demonstrates the truth shown in Figure 3-1 that 0 is perpendicular to e0.
Let’s take an example concerning an object with circular boundary where all the
x cx 2 y c y 2=r 2 (A-23)
The center (cx,cy) and radius r are unknown and will be determined by measuring 12
5-7
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen
i-th points xi yi
1 4.0 0.95
2 3.0 1.26
3 2.0 1.81
4 1.0 2.01
5 0.0 3.80
6 1.0 3.23
7 2.0 0.97
8 1.0 1.21
9 0.0 1.83
10 1.0 4.00
11 2.0 3.78
12 3.0 3.26
As expected, due to the measurement error, the boundary points (xi,yi), i=1,2,…,12,
are a little deviated from the circle, i.e., xi c x 2 yi c y 2 r 2 . Let the error be
defined as
ei xi c x yi c y r 2
2 2
xi2 yi2 2c x xi 2c y yi r 2 c x2 c y2 (A-24)
x 2
i yi2 2c xx i 2c y yi c r
where
cr r 2 c x2 c y2 (A-25)
It is required to determine cx, cy and cr in (A-24). Once cx, cy and cr are solved, the
circle is then obtained with the center (cx,cy) and the radius
r cr c x2 c y2 (A-26)
Follow the process of least squares method, first let’s rewrite (A-24) as
c x
ei x y 2 xi
2
i
2
i 2 yi 1 c y (A-27)
c r
5-8
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen
c x
a 0 c y X T X
1
XTz (A-29)
c r
X=
>> z=z(:,1)
z=
16.9025
10.5876
7.2761
5.0401
14.4400
11.4329
4.9409
2.4641
3.3489
17.0000
18.2884
19.6276
5-9
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen
ans=
3
>> a=inv(X'*X)*X'*z
a=
1.0065
-0.9934
6.9675
r=
2.9946
From the numeric results, we obtain the circle with the center (1.0065,-0.9934) and
the radius r=2.9946.
5-10