• No se han encontrado resultados

EL Enfoque Comunicativo Textual

In document UNIVERSIDAD CÉSAR VALLEJO (página 44-50)

2.3 Los cuentos como estrategia

2.3.4 EL Enfoque Comunicativo Textual

A typical discrete-time transfer function is usually given by G

 z−1

= b1+ b2z−1+ · · · + bmz−m+1

1+ a1z−1+ a2z−2+ · · · + anz−nz−d (2.36) and it corresponds to the difference equation

y(t )+ a1y(t− 1) + a2y(t− 2) + · · · + any(t− n)

= b1u(t− d) + b2u(t− d − 1) + · · · + bmu(t− d − m + 1) + ε(t) (2.37) where ε(t ) can be regarded as the identification residuals. Here the shorthand notation y(t) is used for the output signal y(kT ), and y(t− 1) can then be used to describe the output at the previous sample, i.e., y[(k − 1)T ]. Suppose that a set of input and output signals has been measured and written as u= [u(1), u(2), . . . , u(M)]T, y= [y(1), y(2), . . . , y(M)]T. From (2.37), it can be found that

y(1)= −a1y(0)− · · · − any(1−n) + b1u(1−d) + · · · + bmu(2−m−d) + ε(1) y(2)= −a1y(1)− · · · − any(2−n) + b1u(2−d) + · · · + bmu(3−m−d) + ε(2)

... ... ... ...

y(M)= −a1y(M−1) − · · · − any(M−n) + b1u(M−d)

+ · · · + bmu(M+ 1 − m − d) + ε(M)

where y(t ) and u(t) are assumed to be zero when t ≤ 0. The matrix form of the above equations can be written as

y= θ + ε, (2.38)

where

=





y(0) · · · y(1 − n) u(1− d) · · · u(2− m − d) y(1) · · · y(2 − n) u(2− d) · · · u(3− m − d)

... ... ... ...

y(M−1) · · · y(M − n) u(M − d) · · · u(M +1−m−d)



 (2.39)

θT= [−a1,−a2, . . . ,−an, b1, . . . , bm], εT= [ε(1), . . . , ε(M)]. (2.40) To minimize the sum of squared residuals, i.e.,

min

θ

M i=1

ε2(i),

the optimum estimation to the undetermined elements in θ can be written as

θ= [T]−1Ty. (2.41)

Since the sum of squared residuals is minimized, the method is also known as the least squares algorithm [31]. Note that T might be ill-conditioned if the input excitation signal u(t ) is not properly designed for the identification experiments. This input signal design issue will be discussed and illustrated in Sec. 2.7.3.

A functionarx()is provided in the System Identification Toolbox to identify the discrete-time model from measured input and output data. If the measured input and output signals are expressed by column vectors u and y, and the orders of the numerator and denominator are assumed to be m− 1 and n, respectively, and the delay term is d, the following statement can be used: H=arx([y, u], [n,m,d]).

The returned variable H is anidpolyobject, where H.A and H.B represent the numerator and denominator polynomials of the identified system, respectively.

Example 2.26. Assume that the measured input and output data are given as in Table 2.1.

One may assume that the order of the numerator and denominator is selected as 4, with a delay of 1; then the following statements can be used to identify the system model:

>> u=[1.4601,0.8849,1.1854,1.0887,1.413,1.3096,1.0651,0.7148,...

1.3571,1.0557,1.1923,1.3335,1.4374,1.2905,0.841,1.0245,...

1.4483,1.4335,1.0282,1.4149,0.7463,0.9822,1.3505,0.7078,...

0.8111,0.8622,0.8589,1.183,0.9177,0.859,0.7122,1.2974,...

1.056,1.4454,1.0727,1.0349,1.3769,1.1201,0.8621,1.2377,...

1.3704,0.7157,1.245,1.0035,1.3654,1.1022,1.2675,1.0431]’;

Table 2.1. Measured input and output data.

t u(t ) y(t ) t u(t ) y(t ) t u(t ) y(t )

0 1.4601 0 1.6 1.4483 16.411 3.2 1.056 11.871

0.1 0.8849 0 1.7 1.4335 14.336 3.3 1.4454 13.857

0.2 1.1854 8.7606 1.8 1.0282 15.746 3.4 1.0727 14.694

0.3 1.0887 13.194 1.9 1.4149 18.118 3.5 1.0349 17.866

0.4 1.413 17.41 2 0.7463 17.784 3.6 1.3769 17.654

0.5 1.3096 17.636 2.1 0.9822 18.81 3.7 1.1201 16.639

0.6 1.0651 18.763 2.2 1.3505 15.309 3.8 0.8621 17.107

0.7 0.7148 18.53 2.3 0.7078 13.7 3.9 1.2377 16.537

0.8 1.3571 17.041 2.4 0.8111 14.818 4 1.3704 14.643

0.9 1.0557 13.415 2.5 0.8622 13.235 4.1 0.7157 15.086

1 1.1923 14.454 2.6 0.8589 12.299 4.2 1.245 16.806

1.1 1.3335 14.59 2.7 1.183 11.6 4.3 1.0035 14.764

1.2 1.4374 16.11 2.8 0.9177 11.607 4.4 1.3654 15.498

1.3 1.2905 17.685 2.9 0.859 13.766 4.5 1.1022 14.679

1.4 0.841 19.498 3 0.7122 14.195 4.6 1.2675 16.655

1.5 1.0245 19.593 3.1 1.2974 13.763 4.7 1.0431 16.63

y=[0,0,8.7606,13.1939,17.41,17.6361,18.7627,18.5296,17.0414,...

13.4154,14.4539,14.59,16.1104,17.6853,19.4981,19.5935,...

16.4106,14.3359,15.7463,18.1179,17.784,18.8104,15.3086,...

13.7004,14.8178,13.2354,12.2993,11.6001,11.6074,13.7662,...

14.195,13.763,11.8713,13.8566,14.6944,17.8659,17.6543,...

16.6386,17.1071,16.5373,14.643,15.0862,16.8058,14.7641,...

15.4976,14.679,16.6552,16.6301]’;

t1=arx([y,u],[4,4,1])

The following results are obtained and displayed:

1 Discrete-time IDPOLY model: A(q)y(t) = B(q)u(t) + e(t) 2 A(q) = 1 - qˆ-1 + 0.25 qˆ-2 + 0.25 qˆ-3 - 0.125 qˆ-4 3 B(q) = 4.83e-008 qˆ-1 + 6 qˆ-2 - 0.5999 qˆ-3 - 0.1196 qˆ-4 4 Estimated using ARX

5 Loss function 7.09262e-010 and FPE 9.92966e-010 6 Sampling interval: 1

From the displayed information, the identified model can be written as

G

 z−1

=4.83× 10−8z−1+ 6z−2− 0.5999z−3− 0.1196z−4 1− z−1+ 0.25z−2+ 0.25z−3− 0.125z−4 , i.e.,

G(z)= 4.83× 10−8z3+ 6z2− 0.5999z − 0.1196 z4− z3+ 0.25z2+ 0.25z − 0.125 .

In fact, the data were generated from the system in Example 2.5. It can be seen that the model identified is rather close to the original model. Also, the sampling interval can be found from Table 2.1, where T = 0.1 second. A formal identification method is to establish the data object U with U=iddata(y,u,T). Then the following statements can be used to identify the system model:

>> U=iddata(y,u,0.1); T=arx(U,[4,4,1]); H=tf(T); G=H(1)

0 1 2 3 4 5

Figure 2.7. Comparisons of identification results.

It can then be found that

G(z)= 4.83× 10−8z3+ 6z2− 0.5999z − 0.1196 z4− z3+ 0.25z2+ 0.25z − 0.125 .

The transfer function model converted from thetf()function is in fact a double input transfer function matrix. The first one is the expected transfer function model, and the second is the transfer function from error signal ε(k) to the output signal. This model is discarded in the example.

To verify the identified model, the MATLAB functionlsim()can be used to simulate the system driven by the given u sequence. Details of the function will be given later in Sec. 3.3.3. The response is shown in Figure 2.7(a), superimposed as open circles by the measured output sequence y. It can be seen that the identified model is very accurate:

>> t=0:0.1:4.7; lsim(G,u,t); hold on, plot(t,y,’o’,t,u,’o’)

If the orders are improperly selected as m= 3, n = 3, d = 1, the identified model is then obtained as

G1(z)= 0.04886z2+ 6.017z + 2.806 z3− 0.4362z2− 0.214z + 0.2828,

and the verification shown in Figure 2.7(b) illustrates that the fitting of the model is not so good. Thus, the selection of the orders is also very crucial in the identification process:

>> T=arx(U,[3,3,1]); H=tf(T); G1=H(1)

lsim(G1,u,t); hold on, plot(t,y,’o’,t,u,’o’)

The identification can be completed from (2.39) and (2.41) without the use of the arx()function. The following statements can be used to solve the same problem:

>> Phi=[[0;y(1:end-1)] [0;0;y(1:end-2)],...

[0;0;0; y(1:end-3)] [0;0;0;0;y(1:end-4)],...

[0;u(1:end-1)] [0;0;u(1:end-2)],...

[0;0;0; u(1:end-3)] [0;0;0;0;u(1:end-4)]]

T=Phi\y; Gd=tf(ans(5:8),[1,-ans(1:4)],’Ts’,0.1)

Figure 2.8. GUI for system identification.

The identified model is

G(z)=−5.824 × 10−7z3+ 6z2− 0.5999z − 0.1196 z4− z3+ 0.25z2+ 0.25z − 0.125 .

A GUI ident is provided in the System Identification Toolbox, which can be used to identify discrete-time models in a visual way. If one typesidentcommand, an interface, as shown in Figure 2.8, can be displayed.

To identify a system model, one should first provide the relevant data to the interface.

This can be done by clicking the upper leftImport Data list box. Select menu item Time-Domain Data. Then, a dialog box pops up, as shown in Figure 2.9(a), and the input and output data can be entered into the interface by filling them into the Input and Output columns, respectively. Thesampling interval should also be filled in. Click the Import button to complete data input.

If one wants to identify the autoregressive exogenous (ARX) model, theParametric Models item in the Estimate list box should be selected, and the dialog box shown in Figure 2.9(b) will be displayed. The expected orders of the system can be specified. Then, click the Estimate button to initiate the identification process. When the identification process is completed, the dialog box shown in Figure 2.10(a) will show the identification results. It can be seen that the identification results obtained in the interface are exactly the same as the result obtained usingarx()function.

The final interface is shown in Figure 2.10(b). The user may further select other tasks for the analysis of the identified model.

(a) data input dialog box (b) order selection dialog box

Figure 2.9. Dialog boxes for system identification.

(a) identification results (b) identification solutions

Figure 2.10. Dialog boxes for system identification.

In document UNIVERSIDAD CÉSAR VALLEJO (página 44-50)

Documento similar