Simulate Identified Model Using Simulink Software

This example shows how to set the initial states for simulating a model such that the simulation provides a best fit to measured input-output data.


To simulate the model using input u2, use x0(:,2) as the initial states. x0(:,2) is computed to maximize the fit between the measured output, y2, and the response of M.

To compute initial states that maximizes the fit to the corresponding output y2, and simulate the model using the second experiment:

  1. Extract the initial states that correspond to the second experiment for simulation.

    X0est = x0(:,2);
  2. Open the System Identification Toolbox™ library by typing the following command at the MATLAB® prompt.

  3. Open a new Simulink® model window. Then, drag and drop an Idmodel block from the library into the model window.

  4. Open the Function Block Parameters dialog box by double-clicking the Idmodel block. Specify the following block parameters:

    1. In the Model variable field, type M to specify the estimated model.

    2. In the Initial state field, type X0est to specify the estimated initial states. Click OK.

  5. Drag and drop an Iddata Source block into the model window. Then, configure the model, as shown in the following figure.

  6. Simulate the model for 2 seconds, and compare the simulated output ysim with the measured output ymeasured using the Scope block.

Was this topic helpful?