# idNeuralStateSpace/linearize

Linearize a neural state-space model around an operating point

Since R2022b

## Syntax

``sys = linearize(nss,x0)``
``sys = linearize(nss,x0,u0)``
``sys = linearize(nss,t0,x0,u0)``

## Description

example

````sys = linearize(nss,x0)` linearizes the time-invariant autonomous (that is with no input) neural state-space model `nss` about the operating point specified by `x0`.`sys = linearize(nss,x0,u0)` linearizes the time-invariant neural state-space model `nss` about the operating point specified by both `x0` and `u0`.`sys = linearize(nss,t0,x0,u0)` linearizes the time-varying neural state-space model `nss` about the operating point specified by both `x0` and `u0` at the time specified by `t0`.```

## Examples

collapse all

Use `idNeuralStateSpace` to create a time-invariant continuous-time neural state-space system with four states, three inputs and two outputs with direct feedthrough between input and output. The state and output networks are initialized randomly.

```nss = idNeuralStateSpace(4, ... NumInputs=3, ... NumOutputs=4+2, ... HasFeedthrough=true);```

Define a random operating point.

```x0 = randn(4,1); u0 = randn(3,1);```

Linearize `nss` around the operating point.

`sys = linearize(nss,x0,u0)`
```sys = A = x1 x2 x3 x4 x1 -0.3175 0.1922 -0.2388 0.1463 x2 0.01367 0.01112 0.4915 0.001513 x3 -0.07403 -0.1489 0.1822 -0.1584 x4 0.1954 -0.1134 0.1546 0.1356 B = u1 u2 u3 x1 0.1321 0.2498 -0.01543 x2 0.1842 0.01501 -0.04696 x3 -0.08879 0.1664 -0.0748 x4 0.05851 0.02688 -0.04317 C = x1 x2 x3 x4 y1 1 0 0 0 y2 0 1 0 0 y3 0 0 1 0 y4 0 0 0 1 y5 0.1542 -0.06943 0.2562 -0.3387 y6 0.04741 0.2255 0.003164 -0.02298 D = u1 u2 u3 y1 0 0 0 y2 0 0 0 y3 0 0 0 y4 0 0 0 y5 -0.3407 -0.04532 0.1005 y6 0.1535 0.4711 0.08209 Continuous-time state-space model. ```

Since the first output elements are the four states of `nss`, the first four rows of `C` matrix form an identity matrix, and the first four rows of `D` are zero.

You can now apply linear control analysis and synthesis methods on the linear state-space system `sys`.

## Input Arguments

collapse all

Neural state-space system, specified as an `idNeuralStateSpace` object.

Example: `myNrlSS`

Value of the time variable at the operating point, specified as a scalar, for time-varying `idNeuralStateSpace` systems.

Example: 5.75

Value of the state at the operating point, specified as a vector.

Example: [-0.2 0.3]'

Value of the input at the operating point, specified as a vector, for non-autonomous `idNeuralStateSpace` systems.

Example: 2.4

## Output Arguments

collapse all

Linearized model, returned as an `ss` (Control System Toolbox) object, when Control System Toolbox™ is installed, or as an `idss` object otherwise. For more information on linearization, see Linearize Nonlinear Models (Simulink Control Design).

Note

The first output elements are all the states of `nss`. Therefore, their corresponding entries in the C matrix form an identity matrix, and their corresponding entries in the D matrix are zero.

## Version History

Introduced in R2022b