Products & Services Solutions Academia Support User Community Company

Learn more about System Identification Toolbox   

sim(idnlhw) - Simulate Hammerstein-Wiener model

Syntax

YS = sim(MODEL,U)
YS = sim(MODEL,U,'Noise')
YS = sim(MODEL,U,'InitialState',INIT)

Description

YS = sim(MODEL,U) simulates the output of an idnlhw model.

YS = sim(MODEL,U,'Noise') simulates the model output with an additive Gaussian noise scaled according to the value of the NoiseVariance property of MODEL.

YS = sim(MODEL,U,'InitialState',INIT) specifies initial conditions for starting the simulation.

To simulate the model with user-defined noise, set the input U = [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

Simulation Using Initial States to Best Fit Model Response to Measured Output

In this example you simulate the model output using initial states that minimize the error between the simulated and the measured output. z2 is the measured data.

  1. Load the sample data.

    load iddata2
    
  2. Create a Hammerstein-Wiener model.

    M = nlhw(z2,[4 3 2],'wave','pwl');
    
  3. Compute the initial states that best fit the model response to the measured output.

    x0 = findstates(M,z2);
    
  4. Simulate the model using the estimated initial states.

    ysim = sim(M,z2.u,'init',x0)
    
  5. Compare ysim to output signal in z2:

    t = z2.samp;
    plot(t, ysim, t, z2.y) 

Simulating a Hammerstein-Wiener Model at Steady-State with Known Input and Unknown Output

In this example, you simulate a single-input single-output idnlhw model about a steady-state operating point, where the input level is known to be 1 and the output level is unknown.

  1. Load the sample data.

    load iddata2
    
  2. Create a Hammerstein-Weiner model.

    M = nlhw(z2,[4 3 2],'wave','pwl');
  3. Compute steady-state operating point values corresponding to an input level of 1 and an unknown output level.

    x0 = findop(M,'steady',1,NaN); 
  4. Simulate the model using the estimated initial states.

    sim(M,z2.u,'init',x0)

See Also

findop(idnlhw) 
finstates(idnlhw) 
predict(idnlhw) 

  


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