# linearize#

Class method.

linearize(model, xss=None, uss=None, tvp0=None, p0=None)[source]#

Linearize the non-linear Model to obtain a LinearModel . The linearized model is required, e.g. for the do_mpc.controller.LQR controller.

This method uses the taylor expansion series to linearize non-linear model to linear model at the specified set points. Linearized model retains the same variable names for all states, inputs with respect to the original model. The non-linear model equation this method can solve is as follows:

$\dot{x} = f(x,u)$

The above model is linearized around steady state set point $$x_{ss}$$ and steady state input $$u_{ss}$$

$\begin{split}\frac{\partial f}{\partial x}|_{x_{ss}} = 0 \\ \frac{\partial f}{\partial u}|_{u_{ss}} = 0\end{split}$

The linearized model is as follows:

$\Delta\dot{x} = A \Delta x + B \Delta u$

Similarly, it can be extended to discrete time systems. Since the linearized model has only rate of change input and state. The names are appended with ‘del’ to differentiate from the original model. This can be seen in the above model definition. Therefore, the solution of the lqr will be u and its corresponding x. In order to fetch $$\Delta u$$ and $$\Delta x$$, setpoints has to be subtracted from the solution of lqr.

Parameters:
• model (Model) – dynamic systems model

• xss (ndarray) – Steady state state

• uss (ndarray) – Steady state input

• tvp0 (ndarray) – value for tvp variable

• p0 (ndarray) – value for parameter variable

Returns:

LinearModel – Linearized Model