Documentation

## Exact Linearization Algorithm

Simulink® Control Design™ software linearizes models using a block-by-block approach. The software individually linearizes each block in your Simulink model and produces the linearization of the overall system by combining the individual block linearizations.

The software determines the input and state levels for each block from the operating point, and requests the Jacobian for these levels from each block.

For some blocks, the software cannot compute an analytical linearization. For example:

• Some nonlinearities do not have a defined Jacobian.

• Some discrete blocks, such as state charts and triggered subsystems, tend to linearize to zero.

• Some blocks do not implement a Jacobian.

• Custom blocks, such as S-Function blocks and MATLAB Function blocks, do not have analytical Jacobians.

You can specify a custom linearization for any such blocks for which you know the expected linearization. If you do not specify a custom linearization, the software finds the linearization by perturbing the block inputs and states and measuring the response to these perturbations. For more information, see Perturbation of Individual Blocks.

### Continuous-Time Models

Simulink Control Design software lets you linearize continuous-time nonlinear systems. The resulting linearized model is in state-space form.

In continuous time, the state space equations of a nonlinear system are:

$\begin{array}{l}\stackrel{˙}{x}\left(t\right)=f\left(x\left(t\right),u\left(t\right),t\right)\\ y\left(t\right)=g\left(x\left(t\right),u\left(t\right),t\right)\end{array}$

where x(t) are the system states, u(t) are the input signals, and y(t) are the output signals.

To describe the linearized model, define a new set of variables of the states, inputs, and outputs centered about the operating point:

$\begin{array}{l}\delta x\left(t\right)=x\left(t\right)-{x}_{0}\\ \delta u\left(t\right)=u\left(t\right)-{u}_{0}\\ \delta y\left(t\right)=y\left(t\right)-{y}_{0}\end{array}$

The output of the system at the operating point is y(t0)=g(x0,u0,t0)=y0.

The linearized state-space equations in terms of δx(t), δu(t), and δy(t) are:

$\begin{array}{l}\delta \stackrel{˙}{x}\left(t\right)=A\delta x\left(t\right)+B\delta u\left(t\right)\\ \delta y\left(t\right)=C\delta x\left(t\right)+D\delta u\left(t\right)\end{array}$

where A, B, C, and D are constant coefficient matrices. These matrices are the Jacobians of the system, evaluated at the operating point:

$\begin{array}{l}A={\frac{\partial f}{\partial x}|}_{{t}_{0},{x}_{0},{u}_{0}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}B={\frac{\partial f}{\partial u}|}_{{t}_{0},{x}_{0},{u}_{0}}\\ C={\frac{\partial g}{\partial x}|}_{{t}_{0},{x}_{0},{u}_{0}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}D={\frac{\partial g}{\partial u}|}_{{t}_{0},{x}_{0},{u}_{0}}\end{array}$

This linear time-invariant approximation to the nonlinear system is valid in a region around the operating point at t=t0, x(t0)=x0, and u(t0)=u0. In other words, if the values of the system states, x(t), and inputs, u(t), are close enough to the operating point, the system behaves approximately linearly.

The transfer function of the linearized model is the ratio of the Laplace transform of δy(t) and the Laplace transform of δu(t):

${P}_{lin}\left(s\right)=\frac{\delta Y\left(s\right)}{\delta U\left(s\right)}$

### Multirate Models

Simulink Control Design software lets you linearize multirate nonlinear systems. The resulting linearized model is in state-space form.

Multirate models include states with different sampling rates. In multirate models, the state variables change values at different times and with different frequencies. Some of the variables might change continuously.

The general state-space equations of a nonlinear, multirate system are:

$\begin{array}{ccc}\stackrel{˙}{x}\left(t\right)& =& f\left(x\left(t\right),{x}_{1}\left({k}_{1}\right),\dots ,{x}_{m}\left({k}_{m}\right),u\left(t\right),t\right)\\ {x}_{1}\left({k}_{1}+1\right)& =& {f}_{1}\left(x\left(t\right),{x}_{1}\left({k}_{1}\right),\dots ,{x}_{m}\left({k}_{m}\right),u\left(t\right),t\right)\\ ⋮& & ⋮\\ {x}_{m}\left({k}_{m}+1\right)& =& {f}_{i}\left(x\left(t\right),{x}_{1}\left({k}_{1}\right),\dots ,{x}_{m}\left({k}_{m}\right),u\left(t\right),t\right)\\ y\left(t\right)& =& g\left(x\left(t\right),{x}_{1}\left({k}_{1}\right),\dots ,{x}_{m}\left({k}_{m}\right),u\left(t\right),t\right)\end{array}$

where k1,..., km are integer values and ${t}_{{k}_{1}}$,...,${t}_{{k}_{m}}$ are discrete times.

The linearized equations that approximate this nonlinear system as a single-rate discrete model are:

$\begin{array}{ccc}\delta {x}_{k+1}& \approx & A\text{ }\delta {x}_{k}+\text{ }B\text{ }\delta {u}_{k}\\ \delta {y}_{k}& \approx & C\text{ }\delta {x}_{k}+D\text{ }\delta {u}_{k}\end{array}$

The rate of the linearized model is typically the least common multiple of the sample times, which is usually the slowest sample time.

### Perturbation of Individual Blocks

Simulink Control Design software linearizes blocks that do not have a preprogrammed linearization using numerical perturbation. The software computes the block linearization by numerically perturbing the states and inputs of the block about the operating point of the block.

The block perturbation algorithm introduces a small perturbation to the nonlinear block and measures the response to this perturbation. The default difference between the perturbed value and the operating point value is ${10}^{-5}\left(1+|x|\right)$, where x is the operating point value. The software uses this perturbation and the resulting response to compute the linear state-space of this block. For information on how to change perturbation levels for individual blocks, see Change Perturbation Level of Blocks Perturbed During Linearization.

In general, a continuous-time nonlinear Simulink block in state-space form is given by:

$\begin{array}{l}\stackrel{˙}{x}\left(t\right)=f\left(x\left(t\right),u\left(t\right),t\right)\\ y\left(t\right)=g\left(x\left(t\right),u\left(t\right),t\right).\end{array}$

In these equations, x(t) represents the states of the block, u(t) represents the inputs of the block, and y(t) represents the outputs of the block.

A linearized model of this system is valid in a small region around the operating point t=t0, x(t0)=x0, u(t0)=u0, and y(t0)=g(x0,u0,t0)=y0.

To describe the linearized block, define a new set of variables of the states, inputs, and outputs centered about the operating point:

$\begin{array}{l}\delta x\left(t\right)=x\left(t\right)-{x}_{0}\\ \delta u\left(t\right)=u\left(t\right)-{u}_{0}\\ \delta y\left(t\right)=y\left(t\right)-{y}_{0}\end{array}$

The linearized state-space equations in terms of these new variables are:

$\begin{array}{l}\delta \stackrel{˙}{x}\left(t\right)=A\delta x\left(t\right)+B\delta u\left(t\right)\\ \delta y\left(t\right)=C\delta x\left(t\right)+D\delta u\left(t\right)\end{array}$

A linear time-invariant approximation to the nonlinear system is valid in a region around the operating point.

The state-space matrices A, B, C, and D of this linearized model represent the Jacobians of the block.

To compute the state-space matrices during linearization, the software performs these operations:

1. Perturbs the states and inputs, one at a time, and measures the response of the system to this perturbation by computing $\delta \stackrel{˙}{x}$ and δy.

2. Computes the state-space matrices using the perturbation and the response.

$\begin{array}{l}A\left(:,i\right)=\frac{{\stackrel{˙}{x}|}_{{x}_{p,i}}-{\stackrel{˙}{x}}_{o}}{{x}_{p,i}-{x}_{o}},\text{ }\text{\hspace{0.17em}}\text{\hspace{0.17em}}B\left(:,i\right)=\frac{{\stackrel{˙}{x}|}_{{u}_{p,i}}-{\stackrel{˙}{x}}_{o}}{{u}_{p,i}-{u}_{o}}\\ C\left(:,i\right)=\frac{{y|}_{{x}_{p,i}}-{y}_{o}}{{x}_{p,i}-{x}_{o}},\text{ }\text{\hspace{0.17em}}\text{\hspace{0.17em}}D\left(:,i\right)=\frac{{y|}_{{u}_{p,i}}-{y}_{o}}{{u}_{p,i}-{u}_{o}}\end{array}$

where

• xp,i is the state vector whose ith component is perturbed from the operating point value.

• xo is the state vector at the operating point.

• up,i is the input vector whose ith component is perturbed from the operating point value.

• uo is the input vector at the operating point.

• ${\stackrel{˙}{x}|}_{{x}_{p,i}}$ is the value of $\stackrel{˙}{x}$ at xp,i, uo.

• ${\stackrel{˙}{x}|}_{{u}_{p,i}}$ is the value of $\stackrel{˙}{x}$ at up,i, xo.

• ${\stackrel{˙}{x}}_{o}$ is the value of $\stackrel{˙}{x}$ at the operating point.

• ${y|}_{{x}_{p,i}}$ is the value of $y$ at xp,i, uo.

• ${y|}_{{u}_{p,i}}$ is the value of $y$ at up,i, xo.

• yo is the value of y at the operating point.

### User-Defined Blocks

All user defined blocks such as S-Function and MATLAB Function blocks, are compatible with linearization. These blocks are linearized using numerical perturbation.

User-defined blocks do not linearize when these blocks use nondouble precision data types.

### Look Up Tables

Regular look up tables are numerically perturbed. Pre-lookup tables have a preprogrammed (exact) block-by-block linearization.