njit-etd2003-081 - New Jersey Institute of Technology

njit-etd2003-081 - New Jersey Institute of Technology njit-etd2003-081 - New Jersey Institute of Technology

archives.njit.edu
from archives.njit.edu More from this publisher
20.01.2015 Views

283 B.2.5 System Identification Procedure Make sure that there is an "ident" MATLAB toolbox (Version 4.0 or later) exist in the toolbox directory of MATLAB. The procedure described here is essentially the same as demo #2 in iddemo. It shows an example of a typical session with the System Identification Toolbox. First, invoke MATLAB and follow along. 1. Data have been collected from a COPD or a normal subject during one of the experimental session. Sixty thousand data points (5 minutes) were collected. The sampling interval is 5 ms (0.005 sec, 200sps). The data were loaded into MATLAB in ASCII form and are now stored as the vectors hr2 (Heart Rate: output) and rp 2 (Respiration: input) in the file agul.asc. First load the data: load agul.asc; 2. This example selects the first 25,000 data points for building a model. For convenience, the input-output vectors are merged into a matrix: z2 =Ihr2 (1:25000) rp 2 (1:25000)]; Take a look at the data, idplot(z2) The toolbox makes frequent use of default arguments. Default values are used when trailing arguments are omitted. In the case above, by default, all data points are graphed and the sampling interval is one time unit. 3. One can select the values between sample numbers 10,000 and 20,000 for a closeup, and at the same time obtain correct time scales, with idplot(z2,10000:20000,0.005)

284 4. Remove the constant levels and make the data zero mean with z2 = dtrend(z2); 5. Now, fit to the data a model of the form: where T is the sampling interval (here 0.005 seconds). This model, known as an ARX model, tries to explain or compute the value of the output at time t, given previous values of y and u. The best values of the coefficients a l , a 2 , b 1 and b2 can be computed with th = arx(z2,[10 10 31); 6. The numbers in the second argument tell arx to find a model (B.1) with ten a- parameters, ten b-parameters, and three delays. The result is stored in the matrix th in a somewhat coded form. To specify the actual sampling interval, enter th = sett(th,0.005); 7. There are several ways to display and illustrate the computed model. With present(th); the coefficient values of (B.1) and their estimated standard deviations are presented on the screen. 8. Next, one might ask how to evaluate how well the model fits the data. A simple test is to run a simulation whereby real input data is fed into the model, and compare the simulated output with the actual measured output. For this, select a portion of the data that was not used to build the model. for example, from sample 25.101 to in NM.

283<br />

B.2.5 System Identification Procedure<br />

Make sure that there is an "ident" MATLAB toolbox (Version 4.0 or later) exist in the<br />

toolbox directory <strong>of</strong> MATLAB. The procedure described here is essentially the same as<br />

demo #2 in iddemo. It shows an example <strong>of</strong> a typical session with the System<br />

Identification Toolbox. First, invoke MATLAB and follow along.<br />

1. Data have been collected from a COPD or a normal subject during one <strong>of</strong> the<br />

experimental session. Sixty thousand data points (5 minutes) were collected. The<br />

sampling interval is 5 ms (0.005 sec, 200sps). The data were loaded into MATLAB in<br />

ASCII form and are now stored as the vectors hr2 (Heart Rate: output) and<br />

rp 2 (Respiration: input) in the file agul.asc. First load the data:<br />

load agul.asc;<br />

2. This example selects the first 25,000 data points for building a model. For<br />

convenience, the input-output vectors are merged into a matrix:<br />

z2 =Ihr2 (1:25000) rp 2 (1:25000)];<br />

Take a look at the data,<br />

idplot(z2)<br />

The toolbox makes frequent use <strong>of</strong> default arguments. Default values are used<br />

when trailing arguments are omitted. In the case above, by default, all data points are<br />

graphed and the sampling interval is one time unit.<br />

3. One can select the values between sample numbers 10,000 and 20,000 for a closeup,<br />

and at the same time obtain correct time scales, with<br />

idplot(z2,10000:20000,0.005)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!