Accelerating the pace of engineering and science

# Documentation Center

• Trials

## Linear Approximation of Nonlinear Black-Box Models

### Why Compute a Linear Approximation of a Nonlinear Model?

Control design and linear analysis techniques using Control System Toolbox™ software require linear models. You can use your estimated nonlinear model in these applications after you linear the model. After you linearize your model, you can use the model for control design and linear analysis.

### Choosing Your Linear Approximation Approach

System Identification Toolbox™ software provides two approaches for computing a linear approximation of nonlinear ARX and Hammerstein-Wiener models.

To compute a linear approximation of a nonlinear model for a given input signal, use the linapp command. The resulting model is only valid for the same input that you use to compute the linear approximation. For more information, see Linear Approximation of Nonlinear Black-Box Models for a Given Input.

If you want a tangent approximation of the nonlinear dynamics that is accurate near the system operating point, use the linearize command. The resulting model is a first-order Taylor series approximation for the system about the operating point, which is defined by a constant input and model state values. For more information, see Tangent Linearization of Nonlinear Black-Box Models.

### Linear Approximation of Nonlinear Black-Box Models for a Given Input

linapp computes the best linear approximation, in a mean-square-error sense, of a nonlinear ARX or Hammerstein-Wiener model for a given input or a randomly generated input. The resulting linear model might only be valid for the same input signal as you the one you used to generate the linear approximation.

linapp estimates the best linear model that is structurally similar to the original nonlinear model and provides the best fit between a given input and the corresponding simulated response of the nonlinear model.

To compute a linear approximation of a nonlinear black-box model for a given input, you must have these variables:

• Nonlinear ARX model (idnlarx object) or Hammerstein-Wiener model (idnlhw object)

• Input signal for which you want to obtain a linear approximation, specified as a real matrix or an iddata object

linapp uses the specified input signal to compute a linear approximation:

• For nonlinear ARX models, linapp estimates a linear ARX model using the same model orders na, nb, and nk as the original model.

• For Hammerstein-Wiener models, linapp estimates a linear Output-Error (OE) model using the same model orders nb, nf, and nk.

To compute a linear approximation of a nonlinear black-box model for a randomly generated input, you must specify the minimum and maximum input values for generating white-noise input with a magnitude in this rectangular range, umin and umax.

### Tangent Linearization of Nonlinear Black-Box Models

linearize computes a first-order Taylor series approximation for nonlinear system dynamics about an operating point, which is defined by a constant input and model state values. The resulting linear model is accurate in the local neighborhood of this operating point.

To compute a tangent linear approximation of a nonlinear black-box model, you must have these variables:

• Nonlinear ARX model (idnlarx object) or Hammerstein-Wiener model (idnlhw object)

• Operating point

To specify the operating point of your system, you must specify the constant input and the states. For more information about state definitions for each type of parametric model, see these reference pages:

• idnlarx — Nonlinear ARX model

• idnlhw — Nonlinear Hammerstein-Wiener model

If you do not know the operating point values for your system, see Computing Operating Points for Nonlinear Black-Box Models.

### Computing Operating Points for Nonlinear Black-Box Models

An operating point is defined by a constant input and model state values.

If you do not know the operating conditions of your system for linearization, you can use findop to compute the operating point from specifications:

#### Computing Operating Point from Steady-State Specifications

Use findop to compute an operating point from steady-state specifications:

• Values of input and output signals.
If either the steady-state input or output value is unknown, you can specify it as NaN to estimate this value. This is especially useful when modeling MIMO systems, where only a subset of the input and output steady-state values are known.

Construct an object that stores specifications for computing the operating point, including input and output bounds, known values, and initial guesses. For more information, see operspec(idnlarx) or operspec(idnlhw).