linearize#
Class method.
- linearize(model, xss=None, uss=None, tvp0=None, p0=None)[source]#
Linearize the non-linear
Model
to obtain aLinearModel
. The linearized model is required, e.g. for thedo_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 correspondingx
. In order to fetch \(\Delta u\) and \(\Delta x\), setpoints has to be subtracted from the solution of lqr.- Parameters
model (
Model
) – dynamic systems modelxss (
Optional
[ndarray
]) – Steady state stateuss (
Optional
[ndarray
]) – Steady state inputtvp0 (
Optional
[ndarray
]) – value for tvp variablep0 (
Optional
[ndarray
]) – value for parameter variable
- Returns
LinearModel
– Linearized Model
This page is auto-generated. Page source is not available on Github.