The disk provided with CLID contains a file democlid.m. This file corresponds to a simulation example in closed loop. The data have been generated as follows :
The plant model is :
A (q-1) y (t) = B (q-1) u (t) + C (q-1) e (t),
with
A = 1 - 1.5 q-1
+ 0.7 q-2
B (q-1) = q-1 + 0.5 q-2,
C (q-1) of degree 2,
e (t) white noise.
The controller is stored in the file democlid.m. It has the following coefficients:
R (q-1) = 0.8659 - 1.2763 q-1 + 0.5204 q-2
S (q-1) = 1 - 0.6283 q-1 - 0.3717 q-2
T (q-1) = 0.11
The external excitation signal is a PRBS applied on the reference. The PRBS is generated by a shift register with 7 cells and a frequency divider of 2.
Once you have run democlid.m in Matlab window, you can identify a plant model using four different algorithms as follows :
[B1,A1]=cloe(y,r,2,2,0,R,S,T,Fin,lam1,lam0)
B1 =
0 0.9527 0.4900
A1 =
1.0000 -1.4808 0.6716
For fcloe algorithm we can use the identified model by cloe algorithm as an initial model.
[B2,A2]=fcloe(y,r,2,2,0,R,S,T,B1,A1,Fin,lam1,lam0)
B2
= 0 0.9532 0.5074
A2
= 1.0000 -1.4750 0.6744
Using afcloe algorithm we obtaine :
[B3,A3]=afcloe(y,r,2,2,0,R,S,T,Fin,lam1,lam0)
B3
= 0 0.9684 0.4722
A3
= 1.0000 -1.4844 0.6821
Using xcloe algorithm we identify an ARMAX model for noise, so we need to choose the order of the H polynomial (nh=4).
[B4,A4,H4] =xcloe(y,r,2,2,4,0,R,S,T,Fin,lam1,lam0)
B4
= 0
0.9461 0.4856
A4
= 1.0000
-1.4524 0.6465
H4
= 1.0000 1.1532
-0.6807 -0.5082 -0.1238
The following table summarizes the coefficients of the various identified models as well as those of the simulated model.
|
Method |
A(1) |
A(2) |
B(1) |
B(2) |
|
cloe |
-1.4808 |
0.6716 |
0.9527 |
0.4900 |
|
fcloe |
-1.4750 |
0.6744 |
0.9532 |
0.5074 |
|
afcloe |
-1.4844 |
0.6821 |
0.9684 |
0.4722 |
|
xcloe |
-1.4524 |
0.6465 |
0.9461 |
0.4856 |
|
Simulated model |
-1.5 |
0.7 |
1 |
0.5 |
The results of the statistical validation test for the model identified using the “closed loop error with adaptive filter are given below. (for details see chapter 3 of this manual section clvalid function).
[yhat,lossf,Pcal,Piden]=clvalid(B3,A3,R,S,T,y,r,1);
r0=3.7055 e-004
rni= 0.0042 0.0061 0.0125 0.0169 0.0150
It can be observed (see also the figure) that all the cross-corelations are below the validation level for 97% (2.136/(N)1/2 - where N is the number of data)
The computed closed loop poles based on the identified model are :
Pcal = 1.0000 -1.2742 0.4160 0.0245 -0.0078
The identified closed loop poles are :
Piden = 1.0000 -1.3773 0.6312 -0.1607 0.0589
As it can
be observed in the next figure, the computed poles
and the identified poles are very close.
