solution to homework 1

25
President University Erwin Sitompul SMI 2/1 Dr.-Ing. Erwin Sitompul President University Lecture 2 System Modeling and Identification http://zitompul.wordpress.com

Upload: gauri

Post on 06-Feb-2016

48 views

Category:

Documents


2 download

DESCRIPTION

Chapter 2. Examples of Dynamic Mathematical Models. Solution to Homework 1. q i. A 1 :Cross-sectional area of the first tank [m 2 ] A 2 :Cross-sectional area of the second tank [m 2 ] h 1 : Height of liquid in the first tank [m] - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Solution to Homework 1

President University Erwin Sitompul SMI 2/1

Dr.-Ing. Erwin SitompulPresident University

Lecture 2

System Modeling and Identification

http://zitompul.wordpress.com

Page 2: Solution to Homework 1

President University Erwin Sitompul SMI 2/2

Solution to Homework 1

v1

qi

h1

Chapter 2 Examples of Dynamic Mathematical Models

h2

v2

q1

a1 a2

A1 : Cross-sectional area of the first tank [m2]

A2 : Cross-sectional area of the second tank [m2]

h1 : Height of liquid in the first tank [m]

h2 : Height of liquid in the second tank [m]

qo

The process variable are now the heights of liquid in both tanks, h1 and h2.

The mass balance equation for this process yields:

1 1i 1

( )d Ahq q

dt

2 21 o

( )d A hq q

dt

Page 3: Solution to Homework 1

President University Erwin Sitompul SMI 2/3

Solution to Homework 1Chapter 2 Examples of Dynamic Mathematical Models

Assuming ρ, A1, and A2 to be constant, we obtain:

After substitution and rearrangement,

1 1 1q v a 1 2 12 ( )g h h a

o 2 2q v a 2 22gh a

1 i 11 2

1 1

2 ( )dh q a

g h hdt A A

2 1 21 2 2

2 2

2 ( ) 2dh a a

g h h ghdt A A

Page 4: Solution to Homework 1

President University Erwin Sitompul SMI 2/4

Homework 2Chapter 2 Examples of Dynamic Mathematical Models

Build a Matlab-Simulink model for the interacting tank-in-series system and perform a simulation for 200 seconds. Submit the mdl-file (softcopy) and the screenshots of the Matlab-Simulink file and the scope of h1 and h2 as the homework result (hardcopy).Use the following values for the simulation.

a1 = 210–3 m2

a2 = 210–3 m2

A1 = 0.25 m2

A2 = 0.10 m2

g = 9.8 m/s2

qi = 510–3 m3/stsim = 200 s

Page 5: Solution to Homework 1

President University Erwin Sitompul SMI 2/5

Homework 2 (New)Chapter 2 Examples of Dynamic Mathematical Models

Build a Matlab-Simulink model for the triangular-prism-shaped tank and perform a simulation for 200 seconds. Submit the mdl-file (softcopy) and the screenshots of the Matlab-Simulink file and the scope of h as the homework result (hardcopy).Use the following values for the simulation.

NEW

a = 210–3 m2

Amax= 0.5 m2

hmax = 0.7 mh0 = 0.05 m (!)g = 9.8 m/s2

qi1 = 510–3 m3/sqi2 = 110–3 m3/stsim = 200 s

Page 6: Solution to Homework 1

President University Erwin Sitompul SMI 2/6

Chapter 2 Examples of Dynamic Mathematical Models

Heat Exchanger Consider a heat exchanger for the heating of liquids as shown

below.

Assumptions: • Heat capacity of the tank is small

compare to the heat capacity of the liquid.

• Spatially constant temperature inside the tank as it is ideally mixed.

• Constant incoming liquid flow, constant specific density, and constant specific heat capacity.

Page 7: Solution to Homework 1

President University Erwin Sitompul SMI 2/7

Chapter 2 Examples of Dynamic Mathematical Models

Heat Exchanger Consider a heat exchanger for the heating of liquids as shown

below.

Tj

qTl

qT

Vρ Tcp

Tl : Temperature of liquid at inlet [K]

Tj : Temperature of jacket [K]T : Temperature of liquid inside

and at outlet [K]

q : Liquid volume flow rate [m3/s]V : Volume of liquid inside the

tank [m3]ρ : Liquid specific density [kg/m3]cp : Liquid specific heat capacity

[J/(kgK)]

Page 8: Solution to Homework 1

President University Erwin Sitompul SMI 2/8

Chapter 2 Examples of Dynamic Mathematical Models

Heat Exchanger The heat balance equation becomes:

l j

( )( )p

p p

d V c Tq c T q c T A T T

dt

A : Heat transfer area of the wall [m2]a : Heat transfer coefficient [W/(m2K)]

Rearranging:

l j( )p p p

dTV c q c T q c A T AT

dt

l jp p

p p p

V c q cdT AT T T

q c A dt q c A q c A

The heat exchanger will be in steady-state if dT/dt = 0, so the steady-state temperature at outlet is:

steady-state l jp

p p

q c AT T T

q c A q c A

Page 9: Solution to Homework 1

President University Erwin Sitompul SMI 2/9

Chapter 2 Examples of Dynamic Mathematical Models

Series of Heat Exchangers Consider a series of heat exchangers where a liquid is heated.

Assumptions: • Heat flows from heat sources into liquid are

independent from liquid temperature.• Ideal liquid mixing and zero heat losses.• Accumulation ability of exchangers walls is

neglected• Flow rates and liquid specific heat capacity

are constant

T0 T1 T2 Tn–1 Tn

V1 V2 VnT1 T2 Tn

w1 w2 w3

Page 10: Solution to Homework 1

President University Erwin Sitompul SMI 2/10

Chapter 2 Examples of Dynamic Mathematical Models

Series of Heat Exchangers Under these circumstances, the following heat balances result:

11 0 1 1p p p

dTV c q c T q c T w

dt

22 0 2 2p p p

dTV c q c T q c T w

dt

1n

n p p n p n n

dTV c q c T q c T w

dt

t : Time variable [s]T0 : Liquid temperature in the

first tank inlet [K]Ti : Liquid temperature inside

the i-th heat exchanger [K]Vi : Liquid temperature inside

the i-th heat exchanger [m3]q : Volume flow rate [m3/s]ρ : Liquid density [kg/m3]wi : Heat inputs [W]

The process input variables are heat inputs wi and the first tank inlet temperature T0.

The process state variables are temperatures T1, ... Tn. Initial conditions, i.e., initial temperatures in heat exchangers,

are arbitrary. T1(0) = T10, ..., Tn(0) = Tn0. The output variables can be chosen up to the interest of the

user.

Page 11: Solution to Homework 1

President University Erwin Sitompul SMI 2/11

Chapter 2 Examples of Dynamic Mathematical Models

Series of Heat Exchangers The series of heat exchangers will be in a steady-state if:

1 2 ... 0ndTdT dT

dt dt dt

Let the steady-state values of the process inputs wi, T0 be given, the steady-state temperatures inside the exchangers are:

1,1, 0,

ssss ss

p

wT T

q c

2,2, 1,

ssss ss

p

wT T

q c

,

, 1,n ss

n ss n ssp

wT T

q c

Page 12: Solution to Homework 1

President University Erwin Sitompul SMI 2/12

τ : Space variable [m]Ti : Liquid temperature in the inner

tube [K] Ti(τ,t)To : Liquid temperature in the outer

tube [K] To(t)q : Liquid volume flow rate in

the inner tube[m3/s]ρ : Liquid specific density in the

inner tube [kg/m3]cp : Liquid specific heat capacity

[J/(kgK)]A : Heat transfer area per

unit length [m]Ai : Cross-sectional area of

the inner tube [m2]

Chapter 2 Examples of Dynamic Mathematical Models

Double-Pipe Heat Exchanger

L

To,ss

τ dτ

A single-pass, double-pipe steam heat exchanger is shown below. The liquid in the inner tube is heated by condensing steam.

Ti,ss

τ q

• Heat transfer modes: convection (through the moving fluid) and conduction (across the metal of the inner tube

Page 13: Solution to Homework 1

President University Erwin Sitompul SMI 2/13

Double-Pipe Heat Exchanger

To(t)

Ti(τ,t)

ii

TT d

The profile of temperature Ti of an element of heat exchanger with length dτ for time dt is given by:

i ii

T TT d dt

t

(taken as approximation)

i ii i i o i( ) ( )p p p

dT TAd c q c T q c T d Ad T T

dt

The heat balance equation of the element can be derived as:

Chapter 2 Examples of Dynamic Mathematical Models

Page 14: Solution to Homework 1

President University Erwin Sitompul SMI 2/14

Chapter 2 Examples of Dynamic Mathematical Models

Double-Pipe Heat Exchanger

i i io i

p pA c q cdT TT T

A dt A

The equation can be rearrange to give:

The boundary condition is Ti(0,t) and Ti(L,t). The initial condition is Ti(τ,0).

Page 15: Solution to Homework 1

President University Erwin Sitompul SMI 2/15

Heat Conduction in a Solid Body

L

q(0) q(L)q(x) q(x+dx)

xdx

Consider a metal rod of length L with ideal insulation. Heat is brought in on the left side and withdrawn on the right side. Changes of heat flows q(0) and q(L) influence the rod temperature

T(x,t). The heat conduction coefficient, density, and specific heat capacity

of the rod are assumed to be constant.

Chapter 2 Examples of Dynamic Mathematical Models

Page 16: Solution to Homework 1

President University Erwin Sitompul SMI 2/16

Heat Conduction in a Solid Body

t : Time variable [s]x : Space variable [m]T : Rod temperature [K] T(x,t)ρ : Rod specific density [kg/m3]A : Cross-sectional area of the rod [m2]cp : Rod specific heat capacity [J/(kgK)]q(x) : Heat flow density at length x [W/m2]q(x+dx) : Heat flow density at length x+dx [W/m2]

L

q(0) q(L)q(x) q(x+dx)

x dx

Chapter 2 Examples of Dynamic Mathematical Models

Page 17: Solution to Homework 1

President University Erwin Sitompul SMI 2/17

Heat Conduction in a Solid Body

The heat balance equation of at a distance x for a length dx and a time dt can be derived as:

L

q(0) q(L)q(x) q(x+dx)

x dx

in out

( )pd mc TQ Q

dt

( ) ( )p

dTAdx c A q x q x dx

dt

( )p

dT dq xAdx c A dx

dt dx ( )

( ) ( )dq x

q x dx q x dxdx

x dxx

( )q x

( )q x dx ( )( )

dq xq x dx

dx

0dxfor

Chapter 2 Examples of Dynamic Mathematical Models

Page 18: Solution to Homework 1

President University Erwin Sitompul SMI 2/18

Heat Conduction in a Solid Body According to Fourier equation:

( )dT

q xdx

λ : Coefficient of thermal conductivity [W/(mK)]

Substituting the Fourier equation into the heat balance equation:2

2p

dT d TAdx c A dx

dt dx

2

2p

dT d Tcdt dx

2

2p

dT d T

dt c dx

: Heat conductifity factor [m2/s]pc

Chapter 2 Examples of Dynamic Mathematical Models

Page 19: Solution to Homework 1

President University Erwin Sitompul SMI 2/19

The boundary conditions should be given for points at the ends of the rod:

Heat Conduction in a Solid Body

0(0, ) ( )T t T t( , ) ( )LT L t T t

The temperature profile of the rod in steady-state Ts(x) can be dervied when ∂T(x,t)/∂t = 0.

Chapter 2 Examples of Dynamic Mathematical Models

The initial conditions for any position of the rod is:

0( ,0) ( )T x T x

2

2

( )0sd T x

dx ( )sT x ax b

(0)sT b 0,sT

( )sT L aL b

0,saL T

,L sT , 0,L s sT Ta

L

Page 20: Solution to Homework 1

President University Erwin Sitompul SMI 2/20

Thus, the steady-state temperature at a given position x along the rod is given by:

Chapter 2

Heat Conduction in a Solid Body

, 0,0,( ) L s s

s s

T TT x x T

L

Examples of Dynamic Mathematical Models

Page 21: Solution to Homework 1

President University Erwin Sitompul SMI 2/21

A general process model can be described by a set of ordinary differential and algebraic equations, or in matrix-vector form.

The set of ordinary differential equations that constructs a model is called a state space model, consisting of state equations and output equations.

For control purposes, linearized mathematical models are used, to maintain the simplicity of the control design.

Later in this section, the conversion from partial differential equations that describes processes into models with ordinary differential equations will be shown.

General Process ModelsChapter 2 General Process Models

Page 22: Solution to Homework 1

President University Erwin Sitompul SMI 2/22

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

Page 23: Solution to Homework 1

President University Erwin Sitompul SMI 2/23

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

Page 24: Solution to Homework 1

President University Erwin Sitompul SMI 2/24

State Equations in Vector FormChapter 2 General Process Models

If the vectors of state variables x, manipulated variables u, disturbance variables r, and the functionsf 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

Page 25: Solution to Homework 1

President University Erwin Sitompul SMI 2/25

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