Products & Services Solutions Academia Support User Community Company

Learn more about System Identification Toolbox   

sim(idnlgrey) - Simulate nonlinear ODE model

Syntax

YS = sim(NLSYS,DATA)
YS = sim(NLSYS,DATA,'Noise');
YS = sim(NLSYS,DATA,X0INIT);
YS = sim(NLSYS,DATA,'Noise',XOINIT);
YS = sim(NLSYS,DATA,'Noise','InitialState',X0INIT);
[YS, YSD, XFINAL] = sim(NLSYS,DATA,'Noise','InitialState',X0INIT);

Description

YS = sim(NLSYS,DATA) simulates the output of an idnlgrey model.

YS = sim(NLSYS,DATA,'Noise'); simulates the model with Gaussian noise added to YS.

YS = sim(NLSYS,DATA,X0INIT); simulates the model with the specified initial states.

YS = sim(NLSYS,DATA,'Noise',XOINIT); simulates the model with the specified initial states and with Gaussian noise added.

YS = sim(NLSYS,DATA,'Noise','InitialState',X0INIT); simulates the model with the specified initial states.

[YS, YSD, XFINAL] = sim(NLSYS,DATA,'Noise','InitialState',X0INIT); performs simulation starting with the specified initial states and with Gaussian noise added, and returns the final states of the model after the simulation is completed.

To simulate the model with user-defined noise, set the input DATA = [UIN E], where UIN is the input signal and E is the noise signal. UIN and E must both be one of the following:

Input

Output

Examples

In this example you simulate an idnlgrey model for a data set z. This example uses the nlgr model created in idnlgreydemo2.

  1. Load the data set and create an idnlgrey model.

    load twotankdata;
    
  2. Estimate the idnlgrey model.

    % Specify file.
    FileName = 'twotanks_c';
    % Specify model orders [ny nu nx].
    Order = [1 1 2];
    % Specify initial parameters.
    Parameters = {0.5; 0.0035; 0.019; ...
                  9.81; 0.25; 0.016};
    % Specify initial states.
    InitialStates = [0; 0.1];
    Ts = 0;
    nlgr = idnlgrey(FileName, Order, Parameters, ...
                    InitialStates, Ts, ...
                    'Name', 'Two tanks');
    
  3. Create an iddata object z from data z (from twotankdata.mat).

    z = iddata([], u, 0.2, 'Name', 'Two tanks');
  4. Simulate the model using the input signal from the data z.

    sim(nlgr,z)

See Also

findstates(idnlgrey) 
pe 
pem 
predict(idnlgrey) 

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS