• Tidak ada hasil yang ditemukan

Lecture 3: Dynamic Simulation and Analysis

N/A
N/A
Protected

Academic year: 2024

Membagikan "Lecture 3: Dynamic Simulation and Analysis"

Copied!
25
0
0

Teks penuh

(1)

458.308 Process Control & Design

Lecture 3: Dynamic Simulation and Analysis

Jong Min Lee

Chemical & Biomolecular Engineering Seoul National University

(2)

Standard Form of the Model

.2 dependent variables and 2 independent variables .

. . ...

x˙1=f1(x1, x2, u1, u2) x˙2=f2(x1, x2, u1, u2)

f1, f2: some (nonlinear) functions ofx1, x2, u1, u2

There can be many more dependent variables and many more independent variables. What would be the form withn

dependent variables andmindependent variables?

(3)

Example: Interacting Tanks

h1(t) Pa q0(t)

h2(t)

q1(t) q2(t)

Pa q1=Cv1

(Pa+ρgh1)(Pa+ρgh2) =Cv1

ρg(h1h2) =Cv1

h1h2

q2=Cv2

(Pa+ρgh2)Pa=Cv2

ρgh2=Cv2

h2

(4)

Standard Form

d(A1h1ρ)

dt = ρq0ρCv1

h1h2

| {z }

q1

d(A2h2ρ)

dt = ρCv1

h1h2

| {z }

q1

ρCv2

h2

| {z }

q2

x1

=h1,x2

=h2,u1

=q0

dh1

|{z}dt

x˙1

= q0Cv1

h1h2) A1

| {z }

f1(x1,x2,u1)

dh2

|{z}dt

x˙2

= Cv1

h1h2Cv2 h2

A2

| {z }

f2(x1,x2,u1)

(5)

What can you do with the model?

Numerical integration(``simulation") to investigate the time behaviour of the dependent variables to a particularx(0)(initial condition) andu(t), t≥0(independent variable).

What does ``numerical solving" the ODEs mean?

Given:x(0)andu(t), t0 Obtain:x(t), t0

Analysis

Linearization

Analytical solution via Laplace Transform

(6)

Numerical Integration

. ..

1 Start withx1(0)andx2(0). Sett= 0. .

..

2 Take an incremental step (of size∆t, which cannot be large, why?) forward in time by solving

Forward Euler: Explicit integration

x1(t+ ∆t) = x1(t) + ∆t·f1(x1(t), · · ·) x2(t+ ∆t) = x2(t) + ∆t·f2(x1(t), · · ·) Backward Euler: Implicit Integration

x1(t+ ∆t) = x1(t) + ∆t·f1(x1(t+ ∆t), · · ·) x2(t+ ∆t) = x2(t) + ∆t·f2(x1(t+ ∆t), · · ·) Trapezoidal (2nd order R-K): Implicit Integration

x1(t+ ∆t) = x1(t) + ∆t·f1(x1(t), · · ·) +f1(x1(t+ ∆t), · · ·) 2

x2(t+ ∆t) = x2(t) + ∆t·f2(x1(t), · · ·) +f2(x1(t+ ∆t), · · ·) 2

. ..

3 Repeat this until you reach the desired end time.

(7)

Equilibrium Calculation

At steady state,d/dt= 0

0 = f1x1, ¯x2, ¯u1, ¯u2) 0 = f2x1, ¯x2, ¯u1, ¯u2)

Giventhe steady state values ofthe independent variables, one can calculate the corresponding steady-state values of the dependent values by solving the above equation.

(8)

Solving Algebraic Equations Numerically

Newton Iteration [ 0

0 ]

=

[ f1x1, ¯x2) f2x1, ¯x2)

]

[ f1xi1, ¯xi2) f2xi1, ¯xi2)

] +

[ ∂f

1

∂x1

∂f1

∂x2

∂f2

∂x1

∂f2

∂x2

]

xi1,¯xi2)

[ ¯x1¯xi1

¯x2¯xi2 ]

¯xi: current guess of the solutions

By solving the above approximate equation, one gets iterative formula:

[ ¯xi+11

¯xi+12 ]

= [ ¯xi1

¯xi2 ]

[ ∂f

1

∂x1

∂f1

∂x2

∂f2

∂x1

∂f2

∂x2

]1 xi1,¯xi2)

[ f1xi1,¯xi2) f2xi1,¯xi2)

]

(9)

Example

0 = ¯q0−Cv1

ρgh1−h¯2) 0 = Cv1

ρgh1¯h2)−Cv2

ρg¯h2 [ ¯hi+11

¯hi+12 ]

= [ ¯hi1

¯hi2 ]

−Mi 1

 ¯q0−Cv1

ρghi1¯hi2) Cv1hi1¯hi2)−Cv2

ρg¯hi2

Mi =

Cv1ρg

2

hi1¯hi2)

Cv1ρg 2

hi1¯hi2) Cv1ρg

2

hi1¯hi2) 2Cv1ρg

hi1¯hi2)C2v2¯ρg

hi2

(10)

Linearization: 1

st

Order Approximation of ODEs Around an Equilibrium

x˙1 =f1(x1, x2, u1, u2) x˙2 =f2(x1, x2, u1, u2)

1st-order Taylor series expansion at the equilibrium

x1, ¯x2,¯u1, ¯u2) [ x˙1

x˙2

]

[ f1x1,¯x2,¯u1,u¯2) f2x1,¯x2,¯u1,u¯2)

] +

[ ∂f

1

∂x1

∂f1

∂x2

∂f2

∂x1

∂f2

∂x2

]

x1,¯x2,¯u1,¯u2)

[ x1¯x1 x2¯x2

]

+ [ ∂f

1

∂u1

∂f1

∂u2

∂f2

∂u1

∂u2

∂x2

]

x1,¯x2,¯u1,¯u2)

[ u1u¯1

u2u¯2

]

(11)

Linearized Model

.Standard Form: 2×2 System .

.

. ...

[ x˙1

x˙2 ]

[ ∂f

1

∂x1

∂f1

∂x2

∂f2

∂x1

∂f2

∂x2

]

x1,¯x2,¯u1,¯u2)

[ x1¯x1

x2¯x2 ]

+ [ ∂f

1

∂u1

∂f1

∂u2

∂f2

∂u1

∂u2

∂x2

]

x1,¯x2,¯u1,¯u2)

[ u1¯u1 u2¯u2

]

Deviation variables:x1≡x1¯x1, etc.

[ x˙1 x˙2

]

=A [ x1

x2 ]

+B [ u1

u2 ]

(12)

Example

dh1

|{z}dt

x˙1

= q0−Cv1 h1−h2 A1

| {z }

f1(x1,x2,u1)

dh2

|{z}dt

x˙2

= Cv1

h1−h2−Cv2 h2 A2

| {z }

f2(x1,x2,u1)

Linearization at¯h1,¯h2,¯q0

[ dh

1 dhdt2 dt

]

=

Cv1

2A1

¯h1¯h2

Cv1 2A1

¯h1¯h2 Cv1

2A2

¯h1¯h2 Cv1

2A2

¯h1¯h2 Cv2

2A2

¯h2

[ h1 h2

] +

[ 1

A1

0 ]

q0

(13)

Laplace Transform -- Main Idea

LinearODEs ) ( ) (t ut dt y

dy+ =

τ

Solution

( )

( )

τζ ζ ζ τ

d u y t

y

t t

t

) ( exp

) 0 ( exp ) (

0

+

=

Laplace Transform

) ( ) ( ) 1

( τ s + Y s = U s

Integration

Inverse Laplace Transform

1 ) ) (

( = +

s s s U

Y τ

Algebraic Manipulation

(14)

Laplace Transform -- Key Points

.Definition .

. . ...

F(s) =L[f(t)] =∫

0 f(t)estdt Lapalace Transform for simple signals

Steps, ramps, exponential decay or rise, pulse, impulse, etc.

Can be found by evaluating the integral See Table 3.1

Must memorize the simple ones

.Important Properties .

.

. ...

L(

df dt

)

=sF(s)−f(0) L(

d2f dt2

)

=s2F(s)−sf(0)−f(0) L(∫t

0f(ζ))

= 1sF(s) L(f(t−δ)) =F(s)eδs

(15)

Key Points

.Warning: LT is a linear operation!

. . . ...

L(af1(t) +bf2(t)) =aF1(s) +bF2(s) L(

y2(t))

̸

=Y2(s) L(y(t)u(t))̸=Y(s)U(s)

.Final and Initial Value Theorem .

.

. ...

tlim→∞f(t) = lim

s0sF(s) f(0) = lim

s→∞sF(s)

(16)

Inverse Laplace Transform

Needed to take the solution obtained through Laplace transform back to the time domain.

The formula involves complex contour integral.

Usepartial fractionexpansion to break the solution down to small pieces and use the table (or your memory) to invert.

.

1.. Break downX(s)into sum of fractions X(s) = A1

sp1

+ A2

sp2

+· · ·+ Am

spm

.

2.. Using linearity property, write

x(t) = L1{X(s)}=L1 { A1

sp1 }

+L1 { A2

sp2 }

+· · ·+L1 { Am

spm }

= A1ep1t+A2ep2t+· · ·+Amepmt

(17)

Transfer Function

Linear differential equationwith a general forcing function (input)

1storder adydt +y(t) =Ku(t) 2ndorder bddt22y+adydt+y(t) =Ku(t)

· · ·

We can solve the eqn. for a specific forcing function, but we can also leave it general and take Laplace transform (with the initial condition zero!) to arrive at ageneral relationship between output and input.

Y(s) = K

as+ 1U(s); Y(s) = K

bs2+as+ 1U(s) With the transfer function, one can conveniently calculate the response of the output to any input bymultiplication.

Y(s) =G(s)U(s)

(18)

Single-Tank Draining

Assume that you start at the steady state: q0(0) = ¯q0, h1(0) = ¯h1

h1(t) Pa q0(t)

q1(t)

q1=Cv1

Pa+ρgh1Pa=Cv1

ρgh1=Cv1

h1

0 t

0 t

-q0(0) )

0(t q

)

0(t q

q0(0)

deviation variable

(19)

Mass Balances

d(A1h1ρ)

dt =ρq0−ρCv1h1

| {z }

q1

Q. Do you think you can solve the above using L.T.?

A. No.

Linearize!

A1dh1

dt =q0 ( Cv1

2√

¯h1 )

| {z }

1/R1

h1

Note: The above can be solved (using L.T.) but will the linear model be valid throughout the entire draining experiment?

(20)

Solution Based on the Linearized Model

A1dhdt1 =q0 R11h1 withh1(0) = 0, q0(s) =¯qs0

⇓ L

(

A1s+ 1 R1

)

H1(s) =¯q0

s, H1(s) = ¯q0R1

s + ¯q0R1

s+A1

1R1

⇓ L−∞

h1(t) =¯q0R1

( 1exp

(

t

A1R1 ))

Note: We can see thath1(t)is an exponentially decaying function oft.

(21)

Real Solution

Integrate the differential equation from time 0 totto obtain A1dh1

dt = −Cv1

h1, h(0) = ¯h

1 h1

dh1

dt = −Cv1 A1

2(√

h1(t)

¯h1)

= −Cv1 A1 (t−0) h1(t) =

(−Cv1 2A1 t+√

¯h1 )2

(22)

Comparison

0 0.5 1 1.5 2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Time

Tank Level (h)

Linear Approximation Exact Nonlinear Solution

(23)

Interacting Tanks -- Revisited

[ dh

dt1

dh2 dt

]

=

[ A11R1 A11R1

A21R1 A12 (

R11 +R1

2

) ] [ h1 h2

] +

[ 1

A1

0 ]

q0

⇓ L [ H1(s)

H2(s) ]

=





(s+A1

2

(1 R1+R1

2

)) 1 A1

(s+A1

2

(1 R1+R1

2

))(s+A1

1R1

)A 1

1A2R2 1

Q0(s)

1 A1A2R1

(s+A1

2

(1 R1+R1

2

))(s+A1

1R1

)A 1

1A2R2 1

Q0(s)





(24)

Impulse Response

0 t

)

0(t q

M/t

t Area

= M t0

Q'0=M

[ H1(s) H2(s)

]

=

[ G1(s)·M G2(s)·M

] Inverse L.T.

[ h1(t) h2(t)

]

(25)

Properties of Transfer Functions

Steady-state gain:G(0)-- Output change under aunit step changein input ast→ ∞

The order of the denominator polynomial = the order of the equivalent differential equation

Physical realizability:n≥m G(s) = Y(s)

U(s) = bmsm+bm1sm1+· · ·+b0 ansn+an1sn1+· · ·+a0 Additiveandmultiplicativeproperty

Referensi

Dokumen terkait