| System Identification Toolbox™ | ![]() |
System Identification Toolbox
The IDNLHW Model block simulates a Hammerstein-Wiener (idnlhw) model for time-domain input and output data.
Input signal to the model.
Simulated output from the model.

Name of the idnlhw variable in the MATLAB® workspace.
Specifies the initial states as one of the following:
Zero: Specifies zero, which corresponds to a simulation starting from a state of rest.
State values: When selected, you must specify a vector of length equal to the number of states in the model in the Specify a vector of state values field.
If you do not know the initial states, you can estimate these states, as follows:
To simulate about a given input level when you do not know the corresponding steady-state output level, you can estimate the equilibrium state values using the findop(idnlhw) command.
For example, to simulate a model M about a steady-state condition where the input is 1 and the output is unknown, you can enter X0, such that:
X0 = findop(M,'steady',1,NaN)
To estimate the initial states such that the simulated response of the model matches specified output data for the same input, use the findstates(idnlhw).
For example, for the data set z and model m, you can enter X0, such that:
X0 = findstates(m,z)
In this example, you estimate a Hammerstein-Wiener model from data and compare the model output of the model to the measured output of the system.
Load the sample data.
load twotankdata
Create a data object from sample data.
z = iddata(y,u,0.2, ...
'Name','Two tank system',...
'Tstart',0);
Estimate a Hammerstein-Wiener model.
mhw1 = nlhw(z,[1 5 3],pwlinear,pwlinear);
Build the following Simulink model using the IDDATA Source, IDNLHW Model, and Scope blocks.

Double-click the IDDATA Source block and enter the following into the block parameter dialog box:
IDDATA Object: z
Click OK.
Double-click the IDNLHW Model block and enter the following into the block parameter dialog box:
Model: mhw1
Initial Conditions: Zero
Run the simulation.
Click the Scope block to view the difference between the measured output and the model output. Use the Autoscale toolbar button to scale the axes.

In this example, the plot shows a difference between the measured and simulated responses at the start of the simulation. This difference may be reduced by estimating the initial states that best fit the measured output.
In this example, you reduce the difference between the measured and simulated responses at the start of the simulation. To achieve this, you use the findstates command to estimate an initial state vector for the model from the data.
Estimate initial states from the data z:
x0 = findstates(mhw1,z,[],'maxiter',50);
Set the Initial Conditions to State Values. Enter x0 in the corresponding field.
Run the simulation.
MATLAB software produces the following plot.

The difference between the measured and simulated responses at the beginning of the simulation is now reduced.
| findop(idnlhw) |
| findstates(idnlhw) |
| idnlhw |
| Identifying Hammerstein-Wiener Models |
![]() | IDNLGREY Model | OE Estimator | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |