Load the data.

The data is from a two-tank system with one input (voltage), and one output (height of liquid in second tank). The structure of the model is specified by the `twotanks_c`

C MEX file.

Create a nonlinear grey-box model.

Create an `iddata`

object containing the input signal `u`

.

Simulate the model using the input data.

Load the data, and obtain the identified model.

`sys`

is a third-order state-sapce model estimated using a subspace method.

Create a simulation option set to add noise to the simulated model response.

Simulate the model.

Default Gaussian white noise is filtered by the noise transfer function of the model and added to the simulated model response.

You can also add your own noise signal, `e`

, using the `NoiseData`

option.

Simulate the model.

Load data.

Specify the estimation option to estimate the initial state.

Estimate a state-space model, and return the value of the estimated initial state.

Specify initial conditions for simulation

Simulate the model, and obtain the model response and standard deviation.

Load estimation data, and estimate a state-space model.

Return the standard deviation and state trajectory.

Obtain the identified model.

`sys`

is an `idtf`

model that encapsulates the third-order transfer function estimated for the measured data `z2`

.

Simulate the model.

Simulate a single-input single-output nonlinear ARX model around a known equilibrium point, with an input level of `1`

and output level of `10`

.

Load the sample data.

Estimate a nonlinear ARX model from the data.

Estimate current states of model based on past data.

Simulate the model using the initial states returned by `data2state`

.

Continue the simulation of a nonlinear ARX model from the end of a previous simulation run.

Estimate a nonlinear ARX model from data.

Simulate the model using the first half of the input data `z2`

. Start the simulation from zero initial states.

Start another simulation using the second half of the input data `z2`

. Use the same states of the model from the end of the first simulation.

To set the initial states for the second simulation correctly, package input `u1`

and output `ys1`

from the first simulation into one `iddata`

object. Pass this data as initial conditions for the next simulation.

Verify the two simulations by comparing to a complete simulation using all the input data `z2`

. First, extract the whole set of input data.

Plot the three responses `ys1`

, `ys2`

and `ysTotal.`

`ys1`

should be equal to first half of `ysTotal`

. `ys2`

should be equal to the second half of `ysTotal`

.

The plot shows that the three responses `ys1`

, `ys2`

, and `ysTotal`

overlap as expected.

Estimate initial states of model `M`

such that, the response best matches the output in data set `z2`

.

Load the sample data.

Estimate a nonlinear ARX model from the data.

Estimate the initial states of `M`

to best fit `z2.y`

in the simulated response.

Simulate the model.

Compare the simulated model output `ysim`

with the output signal in `z2`

.

Start simulation of a model near steady state, where the input is known to be `1`

, but the output is unknown.

Load the sample data.

Estimate a nonlinear ARX model from the data.

Determine equilibrium state values for input `1`

and unknown target output.

Simulate the model using initial states `x0`

.

Load the sample data.

Create a Hammerstein-Wiener model.

Compute steady-state operating point values corresponding to an input level of `1`

and an unknown output level.

Simulate the model using the estimated initial states.

Load time-series data, and estimate an AR model using the least-squares approach.

For time-series data,, specify the desired simulation length, *N = *`200`

using an *N*-by-|0| input data set.

Set the initial conditions to use the initial samples of the time series as historical output samples.

Simulate the model.