# Linearizing Models for Control

In a variety of applications it is desirable to analyze a complicated system around some steady state condition. Although these real life systems can often not readily be studied by including all of their dynamics, we can create a simplified models, often linear time invariant systems which can give us some real insight into understanding not only how the system behaves but how we might control it. Throughout this wiki we will refer to the problem of linearizing a magnetic levitation system. This nonlinear system uses the current running around wires over an iron core to induce a magnetic field that suspends a magnetic ball in the air.

#### Contents

## The Model

Suppose we have written or looked up the dynamics of a system we would like to study. Using perhaps Newton's laws or Maxwell's equations, we've written down a set of differential equations that describe how the system evolves in time:

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

where $x$ represents an $n$-dimensional vector of states and $u$ represents an $m$-dimensional vector of inputs. For example, the following equations describe a simplified description of the magnetic levitation system:

$m\ddot{y} = mg - \frac{\gamma i^{2}}{y} =f(y,i),$

where $y$ is the distance of the ball from the wires and magnet, $m$ is its mass, $i$ is the current through the wires, $g$ is the gravitational constant, and $\gamma$ is a constant based on our winding and iron core. Thus $y$ is our state and $i$ is our control input. Notice that to arrive at this equation we have simply used Newton's laws $F_\text{net}=ma$, noting that the force down due to gravity is $mg$ and the force upwards due to the induced magnetic field is (approximately) $\frac{\gamma i^{2}}{y}$.

## Operating Point

Implicit of this discussion of linearization so far is that the system we are considering is stable (the output is not blowing up) and that we are considering only small deviations from nominal. That is, we are linearizing about an operating point or trajectory where the system is in a steady state. An operating point mathematically mean that:

$0=f\big(x(t),u(t)\big).$

The system is not evolving in time; it is at a stable equilibrium. Returning to our example, suppose we want to study the system around the point $Y_{N}$. Then we can solve for the nominal current needed to maintain that position:

$I_{N} =\sqrt{\frac{mgY_{N}}{\gamma} },$

where we choose the positive square root and obtain $(Y_{N}, I_{N})$ as our operating point.

## Linearing the System

Due to the square term of the current, this system is obviously nonlinear. How do we obtain a system that is a good approximation in the neighborhood of our equilibirum? Note the neighborhood is intentionally vague; there are system models that are only slightly nonlinear and the approximation will be good for most operating conditions and some where the approximated system is only valid for extremely small deviations for the nominal operating point.

In any case, the most common way to linearize the system is to employ a Taylor series approximation. In the general case of mulitple states and multiple outputs, we have

$f(X,U) = f(X_{N}, U_{N}) +\left.\sum \frac{\partial f}{\partial x_{i}}\right|_{EQ} (x_{j}-x_{Nj})+ \left.\sum \frac{\partial f}{\partial u}\right|_{EQ} (u_{j}-u_{Nj})+(\text{higher order terms}).$

With our example, we have

$f(y,i) = f(Y_{N}, I_{N}) + \left.\frac{\partial f}{\partial y}\right|_{EQ} (y-Y_{N})+ \left.\frac{\partial f}{\partial i}\right|_{EQ} (i-I_{N})+(\text{higher order terms}),$

where the $EQ$ means that the partial derivative is evaluated at our equilibrium (operating point). Evaluating the $y$ term, we have

$\frac{\partial}{\partial y} \left.\left(mg- \frac{\gamma i^{2}}{y}\right)\right|_{EQ}=\left.\frac{\gamma i^{2}}{y^{2}}\right|_{EQ}= \frac{\gamma I_{N}^{2}}{Y_{N}^{2}}= \frac{mg}{Y_{N}}.$

Evaluating the $i$ term, we have $\frac{\partial}{\partial i} \left.\left(mg- \frac{\gamma i^{2}}{y}\right)\right|_{EQ}=\left.\frac{-2 \gamma i}{y}\right|_{EQ}= -2 \sqrt\frac{\gamma mg}{Y_{N}}.$

This is not quite how most people linearize a system however. Because we are looking at deviations from nominal, we define

$\begin{aligned} \Delta x&= x-x_{N} \\ \Delta u&= u-u_{N} \end{aligned}$

so that we have a model

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

where $A$ and $B$ are constant (or possibly time varying) matrices.

Thus our system may be written as

$m \Delta \ddot{y} = \frac{mg}{Y_{N}} \Delta y -2\sqrt\frac{\gamma mg}{Y_{N}} \Delta i.$

Those who may have seen state space representations of linear systems may recognize that this is in a very familiar form (after dividing everything by m),

$\dot{x}=Ax+Bu$

## Generalizing to Multiple Input and Output Systems

As mentioned above, we usually consider deviations from nominal and then perhaps drop the $\Delta$ symbol keeping in mind the original definition of the variables.

We can now extend our above derivation to more general formulas. We form the Jacobian matrices $A$ and $B:$

$\begin{aligned} A&= \left[ \begin{array}{cccc} \frac{\partial f_{1}}{\partial x_{1}} & \frac{\partial f_{1}}{\partial x_{2}} & ... & \frac{\partial f_{1}}{\partial x_{n}} \\ \frac{\partial f_{2}}{\partial x_{1}} &\ddots && \vdots\\ \vdots & &\ddots &\vdots \\ \frac{\partial f_{q}}{\partial x_{1}} &\dots &\dots & \frac{\partial f_{q}}{\partial x_{n}} \end{array} \right] \\\\ B&= \left[ \begin{array}{cccc} \frac{\partial f_{1}}{\partial u_{1}} & \frac{\partial f_{1}}{\partial u_{2}} & ... & \frac{\partial f_{1}}{\partial u_{n}} \\ \frac{\partial f_{2}}{\partial u_{1}} &\ddots && \vdots\\ \vdots & &\ddots &\vdots \\ \frac{\partial f_{q}}{\partial u_{1}} &\dots &\dots & \frac{\partial f_{q}}{\partial u_{n}} \end{array} \right]. \end{aligned}$

This is simply rewriting the partial derivatives method above into matrices. Note that the nomenclature for the matrices $A$ and $B$ is motivated by the standard representation of linear time invariant systems.

## Example Question 1

## Coming Soon!

**Cite as:**Linearizing Models for Control.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/linearizing-models-for-control/