Skip to Main Content Skip to Search
Product Documentation

Preparing Data for System Identification

Loading Data into the MATLAB Workspace

Load the data in dryer2.mat by typing the following command in the MATLAB Command Window:

load dryer2

This command loads the data into the MATLAB workspace as two column vectors, u2 and y2, respectively. The variable u2 is the input data and y2 is the output data.

Opening the System Identification Tool GUI

To open the System Identification Tool GUI, type the following command in the MATLAB Command Window:

ident

The default session name, Untitled, appears in the title bar.

Importing Data Arrays into the System Identification Tool

You can import the single-input/single-output (SISO) data from a sample data file dryer2.mat into the GUI from the MATLAB workspace.

You must have already loaded the sample data into MATLAB, as described in Loading Data into the MATLAB Workspace, and opened the System Identification Tool GUI, as described in Opening the System Identification Tool GUI.

If you have not performed these steps, click here to complete them.

To import data arrays into the System Identification Tool GUI:

  1. In the System Identification Tool GUI, select Import data > Time domain data. This action opens the Import Data dialog box.

  2. Specify the following options:

    • Input — Enter u2 as the name of the input variable.

    • Output — Enter y2 as the name of the output variable.

    • Data name — Change the default name to data. This name labels the data in the System Identification Tool GUI after the import operation is completed.

    • Starting time — Enter 0 as the starting time. This value designates the starting value of the time axis on time plots.

    • Sampling interval — Enter 0.08 as the time between successive samples in seconds. This value is the actual sampling interval in the experiment.

    The Import Data dialog box now resembles the following figure.

  3. In the Data Information area, click More to expand the dialog box. Enter the settings shown in the following figure.

    Input Properties

    • InterSample — Accept the default zoh (zero-order hold) to indicate that the input signal was piecewise-constant between samples during data acquisition. This setting specifies the behavior of the input signals between samples when you transform the resulting models between discrete-time and continuous-time representations.

    • Period — Accept the default inf to specify a nonperiodic input.

        Note   For a periodic input, enter the whole number of periods of the input signal in your experiment.

    Channel Names

    • Input — Enter power.

        Tip   Naming channels helps you to identify data in plots. For multivariable input and output signals, you can specify the names of individual Input and Output channels, separated by commas.

    • Output — Enter temperature.

    Physical Units of Variables

    • Input — Enter W for power units.

        Tip   When you have multiple inputs and outputs, enter a comma-separated list of Input and Output units corresponding to each channel.

    • Output — Enter ^oC for temperature units.

    Notes — Enter comments about the experiment or the data. For example, you might enter the experiment name, date, and a description of experimental conditions. When you estimate models from this data, these models inherit your data notes.

  4. Click Import to add the icon named data to the System Identification Tool GUI.

  5. Click Close to close the Import Data dialog box.

Plotting and Processing Data

In this portion of the tutorial, you evaluate the data and process it for system identification. You learn how to:

The reason you subtract the mean values from each signal is because, typically, you build linear models that describe the responses for deviations from a physical equilibrium. With steady-state data, it is reasonable to assume that the mean levels of the signals correspond to such an equilibrium. Thus, you can seek models around zero without modeling the absolute equilibrium levels in physical units.

You must have already imported data into the System Identification Tool, as described in Importing Data Arrays into the System Identification Tool.

If you have not performed this step, click here to complete it.

To plot and process the data:

  1. In the System Identification Tool GUI, select the Time plot check box to open the Time Plot. If the plot window is empty, click the data icon in the System Identification Tool GUI.

    The top axes show the output data (temperature), and the bottom axes show the input data (power). Both the input and the output data have nonzero mean values.

  2. In the System Identification Tool GUI, select <--Preprocess > Remove means to subtract the mean input value from the input data and the mean output value from the output data.

    This action adds a new data set to the System Identification Tool GUI with the default name datad (the suffix d means detrend), and updates the Time Plot window to display both the original and the detrended data. The detrended data has a zero mean value.

  3. In the System Identification Tool GUI, drag the datad data set to the Working Data rectangle. This action specifies the detrended data to be used for estimating models.

  4. Select <--Preprocess > Select range to open the Select Range window.

    In this window, you can split the data into two parts and specify the first part for model estimation, and the second part for model validation, as described in the following steps.

  5. In the Select Range window, change the Samples field to select the first 500 samples, as follows:

    1 500

      Tip   You can also select data samples using the mouse by clicking and dragging a rectangular region on the plot. If you select samples on the input-channel axes, the corresponding region is also selected on the output-channel axes.

  6. In the Data name field, type the name estimate, and click Insert. This action adds a new data set to the System Identification Tool GUI to be used for model estimation.

  7. In the Select Range window, change the Samples field to select the last 500 samples, as follows:

    501 1000

  8. In the Data name field, type the name validate, and click Insert. This action adds a new data set to the System Identification Tool GUI to be used for model validation.

  9. Drag and drop estimate to the Working Data rectangle, and drag and drop validate to the Validation Data rectangle so that the System Identification Tool GUI resembles the following figure.

  10. To get information about a data set, right-click its icon. For example, right-click the estimate data set to open the Data/model Info dialog box.

    In the Data/model Info dialog box, you can perform the following actions:

    • Change the name of the data set in the Data name field.

    • Change the color of the data icon by changing the RGB values (relative amounts of red, green, and blue). Each value is between 0 and 1. For example, [1,0,0] indicates that only red is present, and no green and blue are mixed into the overall color.

    • In the noneditable area, view the total number of samples, the sampling interval, and the output and input channel names and units.

    • In the editable Diary And Notes area, view or edit the actions you performed on this data set. The actions are translated into commands equivalent to your GUI operations. For example, as shown in the Data/model Info: estimate window, the estimate data set is a result of importing the data, detrending the mean values, and selecting the first 500 samples of the data:

      % Import data
      datad = detrend(data,0)
      estimate = datad([1:500])

      For more information about these and other toolbox commands, see the reference page corresponding to each command.

Learn More

For information about supported data processing operations, such as resampling and filtering the data, see the System Identification Toolbox User's Guide.

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS