solution to homework 2
DESCRIPTION
Chapter 2. Examples of Dynamic Mathematical Models. Solution to Homework 2. Chapter 2. General Process Models. State Equations. A suitable model for a large class of continuous theoretical processes is a set of ordinary differential equations of the form:. t :Time variable - PowerPoint PPT PresentationTRANSCRIPT
President University Erwin Sitompul SMI 3/1
Dr.-Ing. Erwin SitompulPresident University
Lecture 3
System Modeling and Identification
http://zitompul.wordpress.com
President University Erwin Sitompul SMI 3/2
Solution to Homework 2Chapter 2 Examples of Dynamic Mathematical Models
1,s
2,s
0.6378 m0.3189 m
hh
1,0 2,0 0h h
1,0 2,00.1 m, 0.8 mh h
President University Erwin Sitompul SMI 3/3
A suitable model for a large class of continuous theoretical processes is a set of ordinary differential equations of the form:
11 1 1 1
( ), ( ), , ( ), ( ), , ( ), ( ), , ( )n m s
dx tf t x t x t u t u t r t r t
dt
State EquationsChapter 2 General Process Models
22 1 1 1
( ), ( ), , ( ), ( ), , ( ), ( ), , ( )n m s
dx tf t x t x t u t u t r t r t
dt
1 1 1
( ), ( ), , ( ), ( ), , ( ), ( ), , ( )n
n n m s
dx tf t x t x t u t u t r t r t
dt
t : Time variable x1,...,xn : State variablesu1,...,um : Manipulated variablesr1,...,rs : Disturbance, nonmanipulable variablesf1,...,fn : Functions
President University Erwin Sitompul SMI 3/4
A model of process measurement can be written as a set of algebraic equations:
1 1 1 1 1( ) , ( ), , ( ), ( ), , ( ), ( ), , ( )n m m mty t g t x t x t u t u t r t r t
Output EquationsChapter 2 General Process Models
2 2 1 1 1( ) , ( ), , ( ), ( ), , ( ), ( ), , ( )n m m mty t g t x t x t u t u t r t r t
1 1 1( ) , ( ), , ( ), ( ), , ( ), ( ), , ( )r r n m m mty t g t x t x t u t u t r t r t
t : Time variable x1,...,xn : State variablesu1,...,um : Manipulated variablesrm1,...,rmt : Disturbance, nonmanipulable variables at outputy1,...,yr : Measurable output variablesg1,...,gr : Functions
President University Erwin Sitompul SMI 3/5
State Equations in Vector FormChapter 2 General Process Models
If the vectors of state variables x, manipulated variables u, disturbance variables r, and vectors of functions f are defined as:
1 1 1 1
, , ,
n m s n
x u r f
x u r f
x u r f
Then the set of state equations can be written compactly as:
( ), ( ), ( ), ( )
d tt t t t
dt
xf x u r
President University Erwin Sitompul SMI 3/6
Output Equations in Vector FormChapter 2 General Process Models
If the vectors of output variables y, disturbance variables rm, and vectors of functions g are defined as:
1 1 1
, , m
m
r mt r
y r g
y r g
y r g
Then the set of algebraic output equations can be written compactly as:
( ) , ( ), ( ), ( )mt t t t ty g x u r
President University Erwin Sitompul SMI 3/7
Chapter 2
Heat Exchanger in State Space Form
Tj
qTl
qT
Vρ Tcp
l jp p
p p p
V c q cdT AT T T
q c A dt q c A q c A
j l
( )p
p p
q c AdT A qT T T
dt V c V c V
If ,1 1 j 1 l, , x T u T r T
then 11 1 1 1, ,
dxf x u r
dt
1 1 1 1
( )p
p p
q c A A qx x u r
V c V c V
1y xState Space Equations
General Process Models
President University Erwin Sitompul SMI 3/8
Chapter 2
Double-Pipe Heat Exchanger in State Space Form General Process Models
Processes with distributed parameters are usually approximated by a series of well-mixed lumped parameter processes.
This is also the case for the heat exchanger, as shown in the next figure, which is divided into n well-mixed heat exchangers.
The space variable is divided into n equal lengths within the interval [0, L].
After rearrangement, the mathematical model of the heat exchanger is of the form:
i ii o
i i ip p
dT Tq A AT T
dt A A c A c
1 2 2 o
dT Tc c T c T
dt
where 1
i
qc
A and 2
i p
Ac
A c
After rearrangement, the mathematical model of the heat exchanger is of the form:
President University Erwin Sitompul SMI 2/9
Double-Pipe Heat Exchanger in State Space Form We introduce the state parameters
Chapter 2 General Process Models
1( ) ,L
x t T tn
2
2( ) ,
Lx t T t
n
( ) ,nx t T L t
1 ou T
1 (0, )r T t
President University Erwin Sitompul SMI 2/10
Difference Quotient The derivation with respect to space, δT/δτ, will now be
approximated by using a difference quotient. The difference quotient itself is the equation that can be used to
approximately calculate the slope of a function at a certain point. There are three formations of difference quotient:
Chapter 2 General Process Models
1( ) ( )( ) i iF
ix x
f x f xf x
x x
1( ) ( )( ) i iB
ix x
f x f xf x
x x
1 1( ) ( ) ( )
2C i i
ix x
f x f x f x
x x
●Forward Difference
●Backward Difference
●Central Differenceix
( )if x
x
( )f x
1ix 1ix
1( )if x
1( )if x
President University Erwin Sitompul SMI 2/11
Double-Pipe Heat Exchanger in State Space Form Chapter 2 General Process Models
Replacing δT/δτ with its corresponding difference will result a model that consists of a set of ordinary differential equations only:
1 1 11 2 1 2 1
( )dx x rc c x c u
dt L n
2 2 11 2 2 2 1
( )dx x xc c x c u
dt L n
1
1 2 2 1
( )n n nn
dx x xc c x c u
dt L n
1y x
State Space Equations
President University Erwin Sitompul SMI 3/12
Chapter 2 Linearization
Linearization Linearization is a procedure to replace a nonlinear original model
with its linear approximation. Linearization is done around a constant operating point. It is assumed that the process variables change only very little and
their deviations from steady state remain small.
0x
0( )f x
Operating point
Linearization
x
( )f x
Nonlinear Model
Linear Model
Taylor series expansion
President University Erwin Sitompul SMI 3/13
Chapter 2 Linearization
Linearization
( ) ( ), ( )t t tx f x u
( ) ( ), ( )t t ty g x u
The approximation model will be in the form of state space equations
An operating point x0(t) is chosen, and the input u0(t) is required to maintain this operating point.
In steady state, there will be no state change at the operating point, or x0(t) = 0
0 0 0( ) ( ), ( )t t t x f x u 0
0 0 0( ) ( ), ( )t t ty g x u
President University Erwin Sitompul SMI 3/14
Chapter 2 Linearization
Taylor Expansion Series
0x
0( )f x
0x x x
0( ) ( )f x x f x
Scalar Case
0( ) ( )f x f x x
20 0 00
( ) ( ) ( )( ) ( ) ( ) ( )
1! 2! !
nnf x f x f x
f x f x x x xn
A point near x0
Only the linear terms are used for the linearization
President University Erwin Sitompul SMI 3/15
Chapter 2 Linearization
Taylor Expansion Series Vector Case
( ) ( ), ( ) ,t t tx f x u0( ) ( ) ( )t t t x x x
0 0 0( ) ( ) ( ) ( ), ( ) ( )t t t t t t x x f x x u u
0
0
0
0
0 0 0( )( )
( )( )
( ), ( )( ) ( ) ( ), ( ) ( )
( )
( ), ( ) ( )
( )
tt
tt
t tt t t t t
t
t tt
t
xu
xu
f x ux x f x u x
x
f x uu
u
where
0 0
0 0
( ) ( )( ) ( )
( ), ( ) ( ), ( )( ) ( ) ( )
( ) ( )t tt t
t t t tt t t
t t
x xu u
f x u f x ux x u
x u
President University Erwin Sitompul SMI 3/16
Chapter 2 Linearization
Taylor Expansion Series ( ) ( ) ( )t t t x A x B u
0
0
( )( )
( ), ( ),
( ) tt
t t
t
xu
f x uA
x
0
0
( )( )
( ), ( )
( ) tt
t t
t
xu
f x uB
u
0
0
1 1
1
( )1( )
,n
n n
tnt
f f
x x
f f
x x
x
u
A
0
0
1 1
1
( )1( )
, m
n n
tmt
f f
u u
f f
u u
x
u
B
n : Number of statesm : Number of inputs
President University Erwin Sitompul SMI 3/17
Chapter 2 Linearization
Taylor Expansion Series Performing the same procedure for the output equations,
( ) ( ), ( )t t ty g x u
00 0( ) ( ) ( ) ( ), ( ) ( )t t t t t t y y g x x u u
0
0
0
0
00 0( )( )
( )( )
( ), ( )( ) ( ) ( ), ( ) ( )
( )
( ), ( ) ( )
( )
tt
tt
t tt t t t t
t
t tt
t
xu
xu
g x uy y g x u x
x
g x uu
u
0 0
0 0
( ) ( )( ) ( )
( ), ( ) ( ), ( )( ) ( ) ( )
( ) ( )t tt t
t t t tt t t
t t
x xu u
g x u g x uy x u
x u
President University Erwin Sitompul SMI 3/18
Chapter 2 Linearization
Taylor Expansion Series( ) ( ) ( )t t t y C x D u
0
0
( )( )
( ), ( ),
( ) tt
t t
t
xu
g x uC
x
0
0
( )( )
( ), ( )
( ) tt
t t
t
xu
g x uD
u
0
0
1 1
1
( )1( )
,n
r r
tnt
g g
x x
g g
x x
x
u
C
0
0
1 1
1
( )1( )
,m
r r
tmt
g u
u u
g g
u u
x
u
D
r : Number of outputs
President University Erwin Sitompul SMI 3/19
Chapter 2 Linearization
Taylor Expansion Series
0( ) ( ) ( )t t t x x x
0( ) ( ) ( )t t t y y y
( ) ( ) ( )t t t x A x B u
( ) ( ) ( )t t t y C x D u
( ) ( ), ( ) ,t t tx f x u
( ) ( ), ( )t t ty g x u
Nonlinear Model Linear Model
President University Erwin Sitompul SMI 3/20
Chapter 2 Linearization
Single Tank System
i 1 2q a
h ghA A
v1
qi
qo
V h
The model of the system is already derived as:
The relationship between h and h in the above equation is nonlinear.
i( , )f h q
An operating point for the linearization is chosen, (h0,qi,0).
y h i( , )g h q
President University Erwin Sitompul SMI 3/21
Chapter 2 Linearization
Single Tank System
0 0
i,0 i,0
i ii
i
, ,
h hq q
f h q f h qh h q
h q
The linearization around (h0,qi,0) for the state equation can be calculated as:
00i,0i,0
1i
1 2 1
2 hhqq
a gh h q
A h A
1i
0
1 2 1
2
a gh h q
A h A
i 1 2q a
h ghA A
y h
President University Erwin Sitompul SMI 3/22
Chapter 2 Linearization
Single Tank System
0 0
i,0 i,0
i ii
i
, ,
h hq q
g h q g h qy h q
h q
y h
The linearization for the ouput equation is:
i 1 2q a
h ghA A
y h
0h h h
0y y y h
Note that the input of the linearized model is now Δqi.
To obtain the actual value of state and output, the following equation must be enacted:
i i i,0q q q
President University Erwin Sitompul SMI 3/23
Chapter 2 Linearization
Single Tank System The Matlab-Simulink model of the linearized system is shown
below. All parameters take the previous values.
1i
0
1 2 1
2
a gh h q
A h A
y h
i3.5418 4h h q
y h
President University Erwin Sitompul SMI 3/24
Chapter 2 Linearization
Single Tank System The simulation results
: Original model: Linearized model
i i,0
5 liters sq q
0
0.3185 mh h
President University Erwin Sitompul SMI 3/25
Chapter 2 Linearization
Single Tank System If the input qi deviates from the operating point, the linearized
model will deliver inaccurate output.
: Original model: Linearized model
i i,0
6 liters sq q
President University Erwin Sitompul SMI 3/26
Chapter 2 Linearization
Single Tank System If the input qi deviates from the operating point, the linearized
model will deliver inaccurate output.
: Original model: Linearized model
i i,0
7 liters sq q
President University Erwin Sitompul SMI 3/27
Chapter 2 Linearization
Homework 3
v1
qi
h1 h2
v2
q1
a1 a2
Linearize the the interacting tank-in-series system for the operating point resulted by the parameter values as given in Homework 2. For qi, use the last two digits of your Student ID.
For example: 08 qi= 8 liters/s. Submit the mdl-file and the screenshots of the Matlab-Simulink file
+ scope.
President University Erwin Sitompul SMI 3/28
Chapter 2 Linearization
Homework 3 (New)Linearize the the triangular-prism-shaped tank for the operating point resulted by the parameter values as given in Homework 2 (New). For qi2, use the last two digits of your Student ID.
For example: 03 qi2= 0.3 liter/s, 17 qi2= 1.7 liter/s.
Submit the mdl-file and the screenshots of the Matlab-Simulink file + scope.
NEWv
qi1
qo
a
qi2
hmax
h