You are on page 1of 15

Linearization of Nonlinear Models

Most chemical process models are nonlinear, but they are often linearized to perform a simulation and stability analysis. Linear models are easier to understand (than nonlinear models) and are necessary for most control system design methods.

Single Variable Example


A general single variable nonlinear model dx = f ( x) dt The function f(x) can be approximated by a Taylor series approximation around the steady-state operating point (xs)
f f ( x) = f ( xs ) + x 1 2 f ( x xs ) + 2 x 2 xs

( x xs )
xs

+ high order terms

Neglect the quadratic and higher order terms


f ( x ) f ( xs ) +
At steady-state

f x

( x xs )
xs

dxs = f ( xs ) = 0 dt f dx = f ( x) dt x

The partial derivative of f(x) with respect to x, evaluated at the steady-state

( x xs )
xs

Since the derivative of a constant (xs) is zero


dx d ( x xs ) = dt dt

d ( x xs ) f dt x

( x xs )
xs

We are often interested in deviations in a state from a steadystate operating point (deviation variable)

dx f dt x

x
xs

x = x xs : the change or perturbation from a steady-state value


Write in state-space form

dx ax dt

where a =

f x

xs

One State Variable and One Input Variable


Consider a function with one state variable and one input variable dx x= = f ( x, u ) dt Using a Taylor Series Expansion for f(x,u)
f x = f ( xs , u s ) + x 2 f + xu f x xs ) + ( u xs ,us 1 2 f ( u us ) + 2 x 2 xs , u s

( x xs )
xs , u s

xs ,us

1 2 f ( x xs )( u us ) + 2 u 2

( u us )
xs , u s

+ high order terms

Truncating after the linear terms


x f ( xs , u s ) +
zero

f x
f x

( x xs ) +
xs ,us

f u
f u

( u us )
xs ,us

d ( x xs ) dt

( x xs ) +
xs ,us

( u us )
xs , u s

Using deviation variables, x = x xs and u = u us


dx f dt x x+
xs ,us

f u

u
xs ,us

Write in state-space form


dx a x + bu dt
where

a=

f x

b=
xs , u s

f u

xs ,us

If there is a single output that is a function of the state and input

y = g ( x, u )
Perform a Taylor series expansion and truncate high order terms
g ( x, u ) g ( xs , us ) + y ys = g x g x g u

( x xs ) +
xs ,us

( u us )
xs ,us

g ( xs , us ) = ys

( x xs ) +
xs , u s

g u

( u us )
xs , u s

y =cx +du

where

c=

g x

d=
xs ,us

g u

xs , u s

Linearization of Multistate Models


Two-state system
x1 = dx1 = f1 ( x1 , x2 , u ) dt

x2 =

dx2 = f 2 ( x1 , x2 , u ) dt

y = g ( x1 , x2 , u )

Perform Taylor series expansion of the nonlinear functions and neglect high-order terms
f1 ( x1 , x2 , u ) = f1 ( x1s , x2 s , us ) + f1 x1 f 2 x1 g x1

( x1 x1s ) +
x1 s , x2 s ,us

f1 x2 f 2 x2

( x2 x2 s ) +
x1 s , x2 s ,us

f1 u f 2 u

( u us )
x1 s , x2 s ,us

f 2 ( x1 , x2 , u ) = f 2 ( x1s , x2 s , us ) +

( x1 x1s ) +
x1 s , x2 s ,us

( x2 x2 s ) +
x1 s , x2 s ,us

( u us )
x1 s , x2 s ,us

g ( x1 , x2 , u ) = g ( x1s , x2 s , us ) +

( x1 x1s ) +
x1 s , x2 s ,us

g x2

( x2 x2 s ) +
x1 s , x2 s ,us

g u

( u us )
x1 s , x2 s ,us

For the linearization about the steady-state


f1 ( x1s , x2 s , us ) = f 2 ( x1s , x2 s , us ) = 0

g ( x1s , x2 s , us ) = ys

dx1 d ( x1 x1s ) = dt dt

dx2 d ( x2 x2 s ) = dt dt

We can write the state-space model


d ( x1 x1s ) f1 x1 dt = d ( x2 x2 s ) f 2 dt x 1
g y ys = x1

x1 s , x2 s ,us

x1 s , x2 s ,us

f1 u x1 s , x2 s ,us x1 x1s x x + f 2 2 2 s f 2 x2 x , x ,u u 1s 2 s s f1 x2
g x2 x1 x1s g + u x x2 s x1 s , x2 s ,us 2

x1 s , x2 s ,us u us ] [ x1 s , x2 s ,us
[u u s ] x1 s , x2 s ,us

x1 s , x2 s ,us

x = A x + Bu y = C x + Du

Generalization
Consider a general nonlinear model with n state variables, m input variables, and r output variables
x1 = f1 ( x1 , , xn , u1 , , um ) xn = f n ( x1 , , xn , u1 , , um ) y1 = g1 ( x1 , , xn , u1 , , um ) yr = g r ( x1 , , xn , u1 , , um )
Vector notation:

x = f(x,u) y = g(x,u)

Elements of the linearization matrices

Aij =

f i x j

Bij =
xs ,u s

f i u j

State-space form:
xs ,u s

x = A x + Bu y = C x + Du
or

g Cij = i x j

xs ,u s

gi Dij = u j

x s , us

x = A x + B u (The overbar is y = C x + Du usually dropped)

Example: Interacting Tanks


Two interacting tank in series with outlet flowrate being function of the square root of tank height
F

F1

F2

F1 = R1 h1 h2
Modeling equations
dh1 F R1 = dt A1 A1 dh2 R1 = dt A2 h1 h2 = f1 ( h1 , h2 , F ) R2 A2

F2 = R2 h2

h1 h2

h2 = f 2 ( h1 , h2 , F )

Assume only the second tank height is measured. The output, in deviation variable form is y = h2 - h2s There are two state variables, one input variable, one one output variable
h h s = 1s h2 s x h h x = 1 = 1 1s x2 h2 h2 s
u = F Fs

The element of the A (Jacobian) and B matrices


A11 = f1 h1 =
hs , Fs

R1 2 A1 h1s h2 s

f A12 = 1 h2 f A21 = 2 h1 A22 = f 2 h2

hs , Fs

R1 = 2 A1 h1s h2 s = 2 A2 R1 h1s h2 s R1 R2 h1s h2 s 2 A2 h2 s

B11 = B21 =

f1 F f 2 F

=
hs , Fs

1 A1

=0
hs , Fs

hs , Fs

=
hs , Fs

2 A2

Only the height of the second tank is measured


y = g (h1 , h2 , F ) = h2 h2 s
C11 = C12 = g h1 g 2 h2 =0
hs , Fs

=1
hs , Fs

The state-space model is


dx1 dt 2 A1 = dx2 dt 2 A 2 R1 h1s h2 s R1 h1s h2 s 2 A2 R1 2 A1 h1s h2 s 1 x1 + A [u ] 1 R1 R2 x2 0 h1s h2 s 2 A2 h2 s

x1 y = [ 0 1] x2

( y = x2 = h2 h2 s )

Interpretation of Linearization
Consider the single tank problem (assume F is constant) dh F R 1 = h = f ( h, F ) = 1 h dt A A 5 1 Linearization f ( h, F ) 0 ( h hs ) 10
1

nonlinear linear

0.5

The linear approximation works well between 3.5 to 7 feet The two functions are exactly equal at the steady-state value of 5 feet

f(x)

h =5
0

-0.5

10

x (h)

Exercise: interacting tanks


Two interacting tank in series with outlet flowrate being function of the square root of tank height
Parameter values

ft 2.5 R1 = 2.5 min

5 ft 2.5 R2 = 6 min

A1 = 5ft 2

A2 = 10ft 2

Input variable F = 5 ft3/min Steady-state height values : h1s = 10, h2s = 6

Perform the following simulation using state-space model


What are the responses of tank height if the initial heights are h1(0)=12 ft and h2(0)=7 ft ? Assume the system is at steady-state initially. What are the responses of tank height if F changes from 5 to 7 ft3/min at t = 0 F has periodic oscillation of F = 5 + sin(0.2t) F changes from 5 to 4 ft3/min at t = 20

Stability of State-Space Models


A state-space model is said to be stable if the response x(t) is bounded for all u(t) that is bounded Stability criterion for state-space model The state-space model will exhibit a bounded response x(t) for all bounded u(t), if and only if all of the eigenvalues of A have negative real parts (the stability is independent matrices B and C)

Single variable equation x = a x has the solution


x(t ) = e at x(0) stable if a < 0
At The solution of x = Ax is x(t ) = e x(0)

Stable if all of the eigenvalues of A are less than zero The response x(t) is oscillatory if the eigenvalues are complex

Exercise
Consider the following system equations

1 0.5547 Find the responses of x(t) for x(0) = and x(0) = 0 0.8321 (slow subspace v.s. fast subspace)

x1 = 0.5 x1 + x2 x2 = 2 x2

Consider the following system equations

0.2703 0.8719 Find the responses of x(t) for x(0) = and x(0) = 0.9628 0.4896 (stable subspace v.s. unstable subspace)
Note: Find eigenvalue and eigenvector of A >> [V, D] = eig(A)

x1 = 2 x1 + x2 x2 = 2 x1 x2

You might also like