You are on page 1of 15

Linearization

We will explore the differences between linear vs. nonlinear func-


tions, and linear vs. nonlinear differential equations. After having
these ideas, we can linearize nonlinear functions and, most impor-
tantly, linearize dynamic system models (differential equations).
Before we start, let’s review the Taylor Series expansion of a func-
tion of one variable, then look at a special case called the binomial
expansion (very powerful).
Given a function f (x), we can expand it, about some operating
point x0 as an infinite polynomial series using the Taylor Series
expansion

0 (x − x0)2
00
f (x) = f (x0) + f (x0 )(x − x0) + f (x0 ) + ... (1)
2!
Example: Find the Taylor series expansion of the exponential func-
tion f (x) = e−x, about the point x = −2.0.
Since we know that we will need many derivatives of f (x), let’s
compute them first

f0 = −e−x
f 00 = e−x
f 000 = −e−x
.. ..
. = .

Now we simply form the series, evaluating the derivatives at the


operating point of x = −2.0.
e2 e2
f (x) = e−x = e2 − e2(x + 2) + (x + 2)2 − (x + 2)3 + . . .
2 6

1
Expansion About Zero
A special case of the Taylor series occurs when the expansion is
about the point x0 = 0. The expansion is then

x2
f (x) = f (0) + f 0 (0)x + f 00 (0)
+ ... (2)
2!
Returning to our previous example, the expansion of e−x about
x0 = 0 is
1
f (x) = e−x = 1 − x + x2 + . . .
2
The important point here is that you must be clear about what
point you are expanding about.
Finally, the Taylor series expansion can also be applied to functions
of several variables. The more general version of the Taylor Series
equation, for the function f (x, y) expanded about the points x0 , y0 ,
is

∂f ∂f
f (x, y) = f (x0, y0 ) + (x0 , y0 )(x − x0) + (x0, y0 )(y − y0 ) +
∂x ∂y
1 ∂ 2f 2 1 ∂ 2f
2
(x0 , y0 )(x − x0) + 2
(x0, y0 )(y − y0 )2 +
2 ∂x 2 ∂y
1 ∂ f2
(x0 , y0 )(x − x0 )(y − y0 ) + . . .
2 ∂x∂y
or for the special case of expanding about zero (for all the variables)

∂f ∂f
f (x, y) = f (0, 0) + (0, 0)x + (0, 0)y +
∂x ∂y
1 ∂ 2f 2 1 ∂ 2f
2
(0, 0)x + 2
(0, 0)y 2 +
2 ∂x 2 ∂y
1 ∂ f2
(0, 0)xy + . . .
2 ∂x∂y

2
Binomial Expansion

The binomial expansion is the last useful special case we will con-
sider. Its general, one-variable form is

1
f (x) = (1 + x)α = 1 + αx + α(α − 1)x2 + (3)
2!
1
α(α − 1)(α − 2)x3 + . . . (4)
3!

where if α and/or x is negative, then you must change the appro-


priate signs in the formula above. It should be noted that this is
simply a Taylor series expansion of the indicated function about
zero. To get a multivariable form, you can simply replace x with
the multivariable expression, in the expansion.

3
Linear Systems
A function is linear if it satisfies both superposition and homogene-
ity. These two conditions can be combined into one as follows
A function f (x) that satisfies the property

f (α1 x1 + α2 x2) = α1 f (x1) + α2 f (x2) (5)


is linear where α1 and α2 are scalars, and x1 and x2 are any allowable
values of x.
Example: Is the function f (x) = sin x linear?
Let’s use our test, that is, is the following true
sin (α1 x1 + α2 x2 ) = α1 sin x1 + α2 sin x2
No way. The left hand side can be expanded into sin and cos, but
there is no way it will be equal to the right side.
Example Is the function f (x) = 3x + 4 linear? It is after all the
equation of a line.

4
Linearizing Dynamic Equations
In this section we’ll examine how to convert a nonlinear differential
equation into a linearized one. Note: This must be done very
carefully, and leads to specific assumptions that must be valid over
the operating region of interest. An example we will consider later
is

ẍ + 3x − sin y = 0

ÿ + xy = u

where we want to generate new, linear differential equations, that


describe the motion of the system (with new variable ∆x, ∆y, ∆u)
about the nominal operating point x0, y0 , u0 .
Steps for Linearizing a dynamical system

1. Solve for a set of steady-state equations by setting all the


time derivative terms to zero, and replacing all the remaining
variables with their nominal values (e.g. x0 , y0 , u0 ). These
equations will be used later.

2. Rewrite the original dynamic equations replacing all the vari-


ables with the sum of the nominal + the perturbed quantity.
For example
x = x0 + ∆x
y = y0 + ∆y
u = u0 + ∆u

Noting that any time derivatives of the nominal values are


zero (since the nominal values are constants).

3. Expand any terms that are nonlinear in ∆ variables using


Taylor or binomial series keeping only terms up to first order.

4. Use the relationships in step 1 to eliminate some terms.

5
Example
Linearize the nonlinear dynamic equations

ẍ + 3x − sin y = 0

ÿ + xy = u
Step 1: Replace x, y, u with x0, y0 , u0 giving the steady-state equa-
tions
3x0 + sin y0 = 0

x 0 y0 = u0
Step 2: Substitute
x = x0 + ∆x
y = y0 + ∆y
u = u0 + ∆u

into the original dynamic equations, giving


¨ + 3(x0 + ∆x) − sin (y0 + ∆y)
∆x = 0
p
¨ + (x0 + ∆x)(y0 + ∆y) = u + u0
∆y
Step 3: Expand the two nonlinear terms in a Taylor series about
∆x = 0, ∆y = 0 and ∆u = 0.
sin (y0 + ∆y) =
p
(x0 + ∆x)(y0 + ∆y) =

6
Linearization Example - cont’d

Step 4: Sub the expansions into the equations of Step 2

¨ + 3x0 + 3∆x − sin y0 − cos y0 · ∆y


∆x = 0
√ 1 1
¨ + x0 y0 + (x0y0 )−1/2 y0 ∆x + (x0y0 )−1/2 x0∆y
∆y = u0 + ∆u
2 2

The final linearized equations are


∆x¨ + 3∆x − cos y0 · ∆y = 0
1 1
¨ + (x0y0 )−1/2 y0 ∆x + (x0y0 )−1/2 x0∆y
∆y = ∆u
2 2

7
Modeling Liquid Level Systems
Consider the simple illustrative example, depicted below

Pump
qi

Patm

Reservoir

orifice
h

P
q

where

• qi is the flow into the tank (m3 /s)

• q is the flow out of the tank (though the orifice) (m3/s)

• At is the tank area (m3 )

• Aor is the orifice area (m2)

• Patm is atmospheric pressure (N/m2)

• P is the pressure at the orifice (liquid side) (N/m2)

• h is the height of the liquid

• w specific weight of the fluid (N/m3)

• ∆P is the pressure drop across the orifice (N/m2 )

8
Liquid Level System Example

The starting point for the dynamic model is the equation that
describes the flow through an orifice

r
∆P
q = Aor 2g (6)
w

Our goal is to find a dynamic equation that relates the input (flow
rate qi ) to the output (liquid height h). To do this we must relate
the quantities in Eq. 6 to qi and h.

First we’ll consider the ∆P term. From the figure, the pressure P
comes from 2 sources

1. Atmospheric pressure above the liquid

2. Weight of the liquid

That is, we can write the pressure at the orifice as

P = Patm + Pliquid

What we need is ∆P , or
∆P = P − Poutside the orif ice = P − Patm = Pliquid

Let’s look at Pliquid in more detail

weight of liquid wAt h


∆P = Pliquid = =
area of tank At
9
Liquid Level Example

∆P = w · h (7)

Substituting Eq. 7 into Eq. 6 gives

p
q = Aor 2gh (8)

The net flow through the tank is

qnet = qi − q

which can be related to the rate of change of the liquid height by


dividing it by the tank area

qnet 1
ḣ = = (qi − q) (9)
At At
Substituting Eq. 8 into Eq. 9

1 p
ḣ = (qi − Aor 2gh) (10)
At

Which is our final, nonlinear, liquid-level dynamic system equation.


the next step is to find a linear equation for small changes in liquid
level height about some nominal height h0 .

10
State Space Representation of Dyn. Systems

Previously, we derived the dynamic equations for several electro-


mechanical-fluid systems. One example gave the dynamic equa-
tions

J1 θ̈1 − b1 (θ̇2 − θ̇1 ) + k0 θ1 = 0


J2θ̈2 + b1 (θ̇2 − θ̇1 ) = τ

Where we have 2, 2nd order differential equations to represent the


system.

The state space representation of the system is exactly equivalent,


but consists of 4, 1st order DEQs.

Note: The state space representation of a system is not unique

Example: One state space representation of the equations above


is
ẋ1 = x2
b1 b1 k0
ẋ2 = x4 − x2 − x1
J1 J1 J1
ẋ3 = x4
b1 b1 1
ẋ4 = x2 − x4 + τ
J2 J2 J2
Definition 1 The state variables of a dynamic system are any min-
imum set of variables such that if one knows (1) the initial state
vector, x0 , (2) the input, u, for all time, and (3) the dynamic equa-
tions, then one can compute the time histories of the states, x(t)
for all time.

11
Steps for Conversion to State Space Representation

1. Determine how many states are needed (sum the highest time
derivative (integer) for each independent variable)

2. Define the states (this is arbitrary)

3. Write the derivative of all the states in terms of the states


and the inputs.

4. Form the output equations

The final form of the state space representation is

x = Ax + B u State Equation
y = C x + Du Output Equation

where

• x ≡ n × 1 vector of state variables

• A ≡ n × n matrix (constants in this course)

• B ≡ n × m matrix

• u ≡ m × 1 vector of inputs

• y ≡ p × 1 vector of outputs

• C ≡ p × n matrix

• D ≡ p × m matrix

where n is the number of states, m is the number of inputs, p is


the number of system outputs.
In this course, m = p = 1 (almost) always.

12
State Space Example
Convert the 2 second order dynamic equations to a state space
representation where the system output is θ2 .
J1 θ̈1 − b1 (θ̇2 − θ̇1 ) + k0 θ1 = 0
J2 θ̈2 + b1 (θ̇2 − θ̇1 ) = τ

Step 1: How many states?


There are 2 independent variables in these equations - θ1 and θ2 .
The maximum number of d/mathrmdt is 2 for each variable, so
n = 2+2 =4

Step 2: Define the states.


We’ll define the states as the angular position and rates
x1 = θ1
x2 = θ̇1
x3 = θ2
x4 = θ̇2

Step 3: Take the derivatives of the states

ẋ1 = θ̇1 = x2
b1 k0
ẋ2 = θ̈1 = (θ̇1 − θ̇2 ) − θ1
J1 J1
ẋ3 = θ̇2 = x3
−b1 1
ẋ4 = θ̈2 = (θ̇2 − θ̇1 ) + τ
J2 J2

Step 4: Form the output equations using your state definitions

y = x3

13
Example Continued - Matrix Form

The state and output equations can also be represented in matrix


form as

0 1 0 0
   
0
− Jk01 − Jb11 0 b1
J1
0
ẋ =  0 0 1 0
x + 0 τ
b1
1
0 J2
0 − Jb12 J2

y = [0 0 1 0] x + [0] τ

One of the powerful aspects of the state space representation is


that it lends itself well to numerical simulation using codes like
MATLAB, and MATLAB’s Simulink toolbox.

Let’s say that J1 = 5.0, J2 = 15.0, b1 = 0.6, and k0 = 45 and we


want to examine the output, θ2 for a torque pulse at the input when
the initial conditions are all zero. The state space representation
becomes
0 1 0 0 0
" # ( )
−9 −.12 0 .12 0
ẋ = 0 0 1 0 x+ 0 τ
0 .013 0 −.013 .067

y = [0 0 1 0] x + [0] τ

which is easily coded in Simulink and analyzed.

14
Examples

ẋ = −3x + 2u (11)
Where the output is x.

...
θ 1 + 3θ̇1 + 7θ2 − 4θ̇2 = 3τ (12)
θ̈2 + 11θ1 + 25θ̇2 + 6θ̇1 = 2τ
Where the output is θ̇2 .

θ̈1 + 2θ̇1 + 5θ1 = 2u + 3u̇ (13)


Where the output is θ̇1 .

15

You might also like