Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Linearization

Smooth functions look like straight lines when you zoom in close enough to any point. It turns out something similar is true of dynamical systems. If we “zoom in close enough,” it will look like a linear system. In this section, we will make this idea precise and show how to derive linear approximations of nonlinear dynamical systems.

Linearizing a function

Linearization is an approximation method. Given a function f(x)f(x), consider a reference point x0x_0. If ff is a smooth function, f(x)f(x) near x=x0x=x_0 drawing a tangent line on the graph and using the line as the approximation. The line will have slope f(x0)f'(x_0), so the linear approximation will have equation:

f(x)f(x0)+f(x0)(xx0)f(x) \approx f(x_0) + f'(x_0)(x-x_0)

We can write this another way. Define y=f(x)y=f(x) and y0=f(x0)y_0=f(x_0). Then define the deviations from the reference point as

δx:=xx0andδy:=yy0\delta x := x - x_0\qquad\textsf{and}\qquad \delta y := y - y_0

and we can write our linearized equation as:

δy=f(x0)δx\delta y = f'(x_0) \delta x

Now it truly looks like a linear equation y=kxy=kx, but it is linear in the deviations from the reference point. It is not linear in the original coordinates (x,y)(x,y).

Linearization of a function f(x) about a point x_0.

Figure 1:Linearization of a function f(x)f(x) about a point x0x_0.

Example: approximating the square root

Let’s approximate 4.01\sqrt{4.01} via linearization.

We know that 4.014.01 is close to 44 and 4=2\sqrt{4}=2, so let’s set f(x)=xf(x) = \sqrt{x} and pick the reference point x0=4x_0=4. Then we have f(x0)=4=2f(x_0) = \sqrt{4} = 2 and f(x)=12xf'(x) = \frac{1}{2\sqrt{x}}, so f(x0)=122=14f'(x_0) = \frac{1}{2\cdot 2} = \frac{1}{4}. Therefore, our linearized approximation near x0=4x_0=4 is:

f(x)2+14δx=2+14(x4)f(x) \approx 2 + \frac{1}{4}\delta x = 2 + \frac{1}{4}(x-4)

In our example, δx=0.01\delta x = 0.01, so we have 4.012.0025\sqrt{4.01} \approx 2.0025.

The true value is 4.012.002498\sqrt{4.01} \approx 2.002498, so our approximation is quite accurate!

Multivariable functions

We can make an analogous approximation for multivariable functions, except we approximate the function using a tangent hyperplane rather than a tangent line. For example, for a function f(x,y)f(x,y), we can approximate it about the point (x0,y0)(x_0,y_0) as

f(x,y)    f(x0,y0)  +  fx0(xx0)  +  fy0(yy0)f(x,y) \;\approx\; f(x_0,y_0) \;+\; \left.\frac{\partial f}{\partial x}\right|_0 (x-x_0) \;+\; \left.\frac{\partial f}{\partial y}\right|_0 (y-y_0)

where we use the notation fx0\left.\frac{\partial f}{\partial x}\right|_0 to mean “take the partial derivative of f(x,y)f(x,y) with respect to xx and then evaluate the result at x=x0x=x_0 and y=y0y=y_0”. Setting z=f(x,y)z=f(x,y) and z0=f(x0,y0)z_0=f(x_0,y_0) and defining the deviations δx\delta x, δy\delta y, δz\delta z analogously as before, our linearized equation becomes

δz  =  fx0δx  +  fy0δy\delta z \;=\; \left.\frac{\partial f}{\partial x}\right|_0 \delta x \;+\; \left.\frac{\partial f}{\partial y}\right|_0 \delta y
Linearization of a function f(x,y) about a point (x_0,y_0).

Figure 2:Linearization of a function f(x,y)f(x,y) about a point (x0,y0)(x_0,y_0).

Equilibrium points

For example, consider the pendulum of Eq. (3).

m2θ¨+mgsinθ=Tm\ell^2\ddot\theta + mg\ell\sin\theta = T

An equilibrium point (θ0,T0)(\theta_0,T_0) is a constant angle θ0\theta_0 and constant torque T0T_0 that satisfies (7). All time derivatives vanish and we are left with the equation of motion, we have

T0=mgsinθ0T_0=mg\ell\sin\theta_0

There are many ways to satisfy Eq. (8). Each is a valid equilibrim point.

In all cases, if we use θ(0)=θ0\theta(0)=\theta_0 as an initialization and apply the equilibrium torque T(t)=T0T(t)=T_0 for all t0t\geq 0, the pendulum will remain at the angle θ(t)=θ0\theta(t)=\theta_0 for all t0t\geq 0.

We typically find equilibrium points in one of two ways. If the system in question has input uu and other signals xx, then:

  1. We are interested in the zero-input equilibrium, so we use u0=0u_0=0 and we ask what values of x0x_0 are possible. This is what we did for the first two equilibrium examples for the pendulum above.

  2. We pick a desired x0x_0, and we ask what is the required u0u_0 that will lead to equilibrium. This is what we did for the last two equilibrium examples for the pendulum above.

Linearizing a dynamical system

To linearize a non-LTI system, we carry out the following steps. We will assume the system has inputs u=[u1,,um]\u = [u_1,\dots,u_m] and other signals x=[x1,,xn]\x = [x_1,\dots,x_n] (we use the boldface letters to denote vectors).

We will spend the rest of this section doing specific examples to understand how to derive linearized approximations in practice.

Example: gravity shift

Consider a spring-mass system under the effect of a force FF and also gravity.

Spring-mass system under the effect of a force F and also gravity.

Figure 3:Spring-mass system under the effect of a force FF and also gravity.

If we imagine that the spring is at rest without gravity then the equations of motion are:

mx¨+kx=F+mgm\ddot x + kx = F + mg

This equation is not linear due to the affine term mgmg. So let’s linearize!

We want the system to be at rest when F=0F=0 (no applied force), so let’s pick F0=0F_0=0 and see what x0x_0 must be. Substituting into the equation of motion, we have

kx0=mgkx_0 = mg

Therefore x0=mgkx_0=\frac{mg}{k}. This is where the mass will sit so that the spring force perfectly balances out the force of gravity.

Our equation of motion (11) is already affine, so we don’t need to take any derivatives. We can simply substitute our deviations from equilibrium: x=x0+δxx = x_0 + \delta x and F=F0+δF=δFF = F_0 + \delta F = \delta F. Substituting into (11), we have

mδx¨+k(x0+δx)=δF+mgm\,\delta \ddot x + k(x_0 + \delta x) = \delta F + mg

The constant terms cancel out (kx0=mg)(kx_0 = mg) because of how we chose x0x_0 in (12) and we are left with

mδx¨+kδx=δF\boxed{m\,\delta \ddot x + k\,\delta x = \delta F}

This is an LTI system in the variables (δx,δF)(\delta x, \delta F). In fact, it looks very similar to our original equations of motion (11), except that the gravity term is gone.

What happened physically? We shifted our coordinate system down by mgk\frac{mg}{k}, so that the new “zero” position is where the mass naturally sits under gravity. In this new coordinate system, there is no gravity term, and if we apply a force from this new “zero” position, the mass will move up or down the same way as without gravity, except shifted down by mgk\frac{mg}{k}. The equations of motion (14) describe exactly this behavior.

Example: cruise control

Consider a car moving along a flat road. The motor provides a forward force FaF_a and the aerodynamic drag provides an opposing force FdF_d. Let’s derive linearized equations of motion linearized about a nominal speed v0v_0.

Free body diagram of a car with drag force F_d.

Figure 4:Free body diagram of a car with drag force FdF_d.

Aerodynamic drag is typically proportional to the square of the speed of the object. This drag force is given by the equation

Fd=12CdρAcv2,F_d = \underbrace{\tfrac{1}{2} C_d \, \rho \, A }_{c}\, v^2,

where CdC_d is the drag coefficient, ρ\rho is the air density, AA is the lateral surface area, and vv is the speed of the moving object. We replaced all the constant terms by cc for simplicity. The equation of motion for the car is therefore

mv˙+cv2=Fam\dot v + cv^2 = F_a

This is not linear due to the v2v^2 term. Let’s linearize about the nominal speed v0v_0. We will carefully follow the four steps outlined earlier.

Step 1: Let’s identify an equilibrium point. In order to maintain a constant speed v0v_0, what must be the applied force FaF_a? We can substitute into the equation of motion to obtain:

F0=cv02F_0 = c\, v_0^2

Step 2: Now we linearize all nonlinear terms. The only nonlinear term is the drag force cv2cv^2. Linearize this about v0v_0 using Eq. (1):

cv2cv02+2cv0(vv0)\begin{aligned} cv^2 &\approx c v_0^2 + 2 c v_0 ( v - v_0 ) \end{aligned}

Substituting this into our equation of motion, we obtain

mv˙+cv02+2cv0(vv0)=Fam\dot v + c v_0^2 + 2 c v_0 ( v - v_0 ) = F_a

Step 3: Now we replace all signals with their deviations from equilibrium: v=v0+δvv = v_0 + \delta v and Fa=F0+δFF_a = F_0 + \delta F. Also use the fact that v˙=δv˙\dot v = \delta \dot v because v0v_0 is constant. Substituting, we have

mδv˙+cv02+2cv0δv=F0+δFm\delta \dot v + c v_0^2 + 2 c v_0 \,\delta v = F_0 + \delta F

Step 4: Finally, we can cancel out the nominal force terms using (17) and we obtain our linearized equation of motion.

mδv˙+2cv0δv=δF\boxed{m\delta \dot v + 2 c v_0 \delta v = \delta F }

We can quickly check that this is indeed LTI: all terms are linear functions of the deviations δv\delta v and δF\delta F.

We can also interpret this result physically. Our linearized equation (21) relates the deviation from F0F_0 to the deviation from v0v_0. If we let δv=δx˙\delta v = \delta \dot x, we can write it as an equation in terms of position:

mδx¨+2cv0δx˙=δFm\delta \ddot x + 2 c v_0 \,\delta \dot x = \delta F

This is a spring-mass-damper equation with no spring! Moreover, the damping coefficient depends linearly on the nominal velocity: the faster you go, the more damping you have. Makes sense!

Example: pendulum

Returning to the pendulum example illustrated below, let’s find the linearized equations of motion about an arbitrary equilibrium angle θ0\theta_0.

Pendulum with an external torque T and gravity.

Figure 5:Pendulum with an external torque TT and gravity.

As mentioned earlier, the equation of motion is

m2θ¨+mgsinθ=Tm\ell^2\ddot\theta + mg\ell\sin\theta = T

Step 1: First, we find the equilibrium torque. As computed earlier,

T0=mgsinθ0T_0 = mg\ell\sin\theta_0

Step 2: Next, we linearize the nonlinear term about θ0\theta_0:

mgsinθmgsinθ0+mgcosθ0(θθ0)mg\ell\sin\theta \approx mg\ell\sin\theta_0 + mg\ell\cos\theta_0 (\theta-\theta_0)

Substituting into the equation of motion (23), we obtain

m2θ¨+mgsinθ0+mgcosθ0(θθ0)=Tm\ell^2\ddot\theta + mg\ell\sin\theta_0 + mg\ell\cos\theta_0 (\theta-\theta_0) = T

Step 3: Now substitute T=T0+δTT = T_0 + \delta T and θ=θ0+δθ\theta = \theta_0 + \delta\theta and obtain

m2δθ¨+mgsinθ0+mgcosθ0δθ=T0+δTm\ell^2\delta\ddot \theta + mg\ell\sin\theta_0 + mg\ell\cos\theta_0\, \delta\theta = T_0 + \delta T

Step 4: We can apply (24) to cancel the nominal torque and we get

m2δθ¨+mgcosθ0δθ=δT\boxed{m\ell^2\delta\ddot \theta + mg\ell\cos\theta_0 \,\delta\theta = \delta T}

This is an LTI system in the variables (δθ,δT)(\delta \theta, \delta T), so our linearization is complete!

We can investigate what happens when we use different equilibrium points:


Test your knowledge

Solution to Exercise 1 #

First, compute the partial derivatives:

fx=2xyandfy=x2+cosy\frac{\partial f}{\partial x} = 2xy \qquad\textsf{and}\qquad \frac{\partial f}{\partial y} = x^2 + \cos y

Next, evaluate everything at the reference point (1,0)(1,0)

f(1,0)=120+sin0=0fx(1,0)=2(1)(0)=0fy(1,0)=12+cos0=1+1=2\begin{aligned} f(1,0) &= 1^2\cdot 0+\sin 0=0 \\ \left.\frac{\partial f}{\partial x}\right|_{(1,0)} &= 2(1)(0)=0 \\ \left.\frac{\partial f}{\partial y}\right|_{(1,0)} &= 1^2+\cos 0 = 1+1=2 \end{aligned}

The linearized approximation is

f(x,y)    f(1,0)  +  fx(1,0)(x1)  +  fy(1,0)y  =  2y\begin{aligned} f(x,y) &\;\approx\; f(1,0) \;+\; \left.\frac{\partial f}{\partial x}\right|_{(1,0)} (x-1) \;+\; \left.\frac{\partial f}{\partial y}\right|_{(1,0)} y \;=\; 2y \end{aligned}

Therefore, using our linearization,

f(1.1,0.05)2(0.05)=0.10f(1.1,0.05)\approx 2 (0.05) = 0.10

We can confirm this is close by check the exact value:

f(1.1,0.05)=(1.1)2(0.05)+sin(0.05)=0.110479...f(1.1,0.05) = (1.1)^2(0.05) + \sin(0.05) = 0.110479...
Solution to Exercise 2 #

At equilibrium, x˙=0\dot x = 0 and y˙=0\dot y = 0. Substituting into the dynamics, we see that this occurs when αx=βy=xy\alpha x = \beta y = xy. Excluding the trivial solution x=y=0x=y=0, we see that

x=βandy=αx^\star = \beta\qquad\textsf{and}\qquad y^\star = \alpha

To find the linearized equations of motion, we linearize each equation about the equilibrium point (β,α)(\beta,\alpha). For the first equation, let f(x,y)=αxxyf(x,y) = \alpha x - xy. Evaluating partial derivatives:

fx=αy,andfy=x\frac{\partial f}{\partial x} = \alpha-y, \qquad\textsf{and}\qquad \frac{\partial f}{\partial y} = -x

Linearizing about (β,α)(\beta,\alpha), we obtain:

f(x,y)f(x,y)+fx(xx)+fy(yy)=0+0(xβ)+(β)(yα)\begin{aligned} f(x,y) &\approx f(x^\star,y^\star) + \left.\frac{\partial f}{\partial x}\right|_{\star}(x-x^\star) + \left.\frac{\partial f}{\partial y}\right|_{\star}(y-y^\star) \\ &= 0 + 0(x-\beta) + (-\beta )(y-\alpha) \end{aligned}

Therefore x˙β(yα)\dot x \approx -\beta (y-\alpha), or δx˙βδy\delta\dot x \approx -\beta \delta y.

Similarly, we can linearize the second equation and obtain δy˙αδx\delta\dot y \approx \alpha \delta x. So our linearized equations of motion are

δx˙=βδyδy˙=αδx\begin{aligned} \delta \dot x &= -\beta \delta y \\ \delta \dot y &= \alpha \delta x \end{aligned}

And these states are measured relative to the equilibrium point, so

x(t)=β+δx(t)andy(t)=α+δy(t)x(t) = \beta + \delta x(t) \qquad\textsf{and}\qquad y(t) = \alpha + \delta y(t)