0% found this document useful (0 votes)
21 views

Modeling_Simre3

sim

Uploaded by

zarandluxurey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Modeling_Simre3

sim

Uploaded by

zarandluxurey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

9/30/2019

Ali M. Sahlodin
Department of Chemical Engineering
AmirKabir University of Technology
1397 S.H

F, C1
 Fixed inlet concentration

dC2 F
(t )   C1  C2 (t )  Ordinary-differential
F, C2
dt V equation

 Variable inlet concentration


dC2 F
(t )   C1 (t )  C2 (t )  Differential-algebraic equation
dt V
C1 (t )   (t )

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


2

1
9/30/2019

 Fully-implicit DAE
 t ), t )  0
F(x(t ), x( F
Singular
 x

Implicit ODE F
 Non-singular  t )  f(x(t ), t )
x(
 x

 Semi-explicit DAE
 t ), y(t ), t )  0
F(x(t ), x( F
Non-singular
G(x(t ), y(t ), t )  0  x

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


3

 Conservation of mass/energy
 Hydraulic relations
 Reaction kinetics
 Thermodynamic relations
 Total volume
…

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


4

2
9/30/2019

FV

Fin P, T
FL
Q

Sahlodin et. al. 2016, AIChE J.

All algebraic equations

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


5

 Method of lines
 Convert PDE to system of ODEs by discretizing
the space

 Example 1: one-dimensional heat


equation
T  2T

t x 2

T j T j 1  2T j  T j 1
  0, j  2,, N  1 ODE System
t ( x) 2

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


6

3
9/30/2019

 Example 2:

y z  2 y
b  2
t x x
 z
2
Discretization of the spatial derivative  a
results in a DAE x 2

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


7

 System of ODEs
 t )  f(x(t ), y(t ), t ,  )
x(
Singular perturbation problem
 y(
 t )  g(x(t ), y(t ), t ,  )

 If 0    1 (variables y have fast dynamics)

 t )  f(x(t ), y(t ), t ,0)


x(
Semi-explicit DAE
0  g(x(t ), y(t ), t ,0)

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


8

4
9/30/2019

x  x 2  x 3
 What is stiffness?
 No agreed-upon definition!
 Depends on differential
equation, initial conditions,
and numerical method

 Presence of both fast and slow


dynamics
 Non-stiff solvers must take very
small steps

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


9

 DAEs are similar to stiff ODEs in the limit.


 Recall singular perturbation problem

 t )  f(x(t ), y(t ), t ,  )
x(  t )  f(x(t ), y(t ), t ,0)
x(
 y(
 t )  g(x(t ), y(t ), t ,  ) 0  g(x(t ), y(t ), t ,0)

 Stiff ODE methods can be used to solve DAEs


(discussed later).

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


10

5
9/30/2019

1. Accuracy of numerical solution


2. Stability of numerical solution
3. Constraint satisfaction
4. Initialization

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


11

dx
 Numerical solution of ODEs (t )  f ( x, t )
dt

h2 
x(tk )  x(tk 1 )  hf ( xk 1 , tk 1 )  f ( xk 1 , tk 1 )  ...
2
•Forward Euler
x(tk )  x(tk 1 )  hf ( xk 1 , tk 1 )  O(h 2 )

•Backward Euler
x(tk )  x(tk 1 )  hf ( xk , tk )  O(h 2 )

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


12

6
9/30/2019

F, C1
 Tank example: Case I
 Dynamic Simulation problem (known input)
dC2 F
(t )   C1 (t )  C2 (t ) 
dt V F, C2
C1 (t )   (t )

Order of error O(h 2 )

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


13

F, C1
 Tank example: Case II
 Dynamic design problem (known output)
dC2 F
(t )   C1 (t )  C2 (t ) 
dt V F, C2
C2 (t )   (t )

Order of error O ( h)

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


14

7
9/30/2019

F, C1
 Tank example: Case III
 Tanks in series with known output

dC2 F
(t )   C1 (t )  C2 (t ) 
dt V F, C2
dC3 F
(t )   C2 (t )  C3 (t ) 
dt V
C3 (t )   (t )

F, C3
Order of error O (1)

Reducing step size will not improve order of accuracy!

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


15

F, C1
 Tank example: Case I

dC2 F
(t )   C1 (t )  C2 (t ) 
dt V
C1 (t )   (t ) F, C2

How close is this to an ODE?

dC1
Differentiate the system until (t ) appears.
dt
One differentiation is enough.

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


16

8
9/30/2019

F, C1
 Tank example: Case II

dC2 F
(t )   C1 (t )  C2 (t ) 
dt V
C2 (t )   (t ) F, C2

dC1
Differentiate the system until (t ) appears.
dt
Two differentiations are needed.

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


17

F, C1
 Tank example: Case III
dC2 F
(t )   C1 (t )  C2 (t ) 
dt V
dC3 F
(t )   C2 (t )  C3 (t )  F, C2
dt V
C3 (t )   (t )

dC1
Differentiate the system until (t ) appears.
dt F, C3
Three differentiations are needed.

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


18

9
9/30/2019

 The minimum number of times a DAE system or


part of it must be differentiated in order to
arrive at an implicit ODE

F0 : F(x(t ), x(
 t ), t )  0

d
F1 :  t ), t )  0
F(x(t ), x(
dt

d2
F 2 :  t ), t )  0
F(x(t ), x(
dt 2
d j 1
F j 1   t ), t )  0
F(x(t ), x(
dt j 1
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.
19

 Find index
x
mxT 0
L
y
my mg T 0
L
x 2  y 2  L2 0

What is the index?

Wikipdia by Ruryk

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


20

10
9/30/2019

 Semi-explicit DAE
 t ), y(t ), t )  0 F
F(x(t ), x( Non-singular
 x
G(x(t ), y(t ), t )  0

is index 1 IFF
g
Non-singular
y
 Example: a CSTR with the rate equation
written separately.

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


21

 High-index DAEs (v>1) can be problematic.


 ODE solvers with high-index DAEs may
 Converge poorly
 Converge to wrong results!
 Fail to converge

 Problem formulation can affect the index.

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


22

11
9/30/2019

 Use high-index DAEs solvers


 No general-purpose solver available
 Solvers available for specialized forms
 Reduce DAE index to <=1.

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


23

 Convert a high-index DAE (v>1) to a low-index


DAE (v<2).
 Simplify computational complexity

 How to do it?
 Successive differentiation
 Change of variables
 Regularization

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


24

12
9/30/2019

x2  x1  f1  0
x3  x2  f 2  0
x3  f3  0

Define z1  x1 and substitute above.


Obtain the index again.

Applicable when time derivative of a state variable does not appear in


the system
Not easily automatable

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


25

 t )  f(x(t ), y(t ), t ,0)


x(  t )  f(x(t ), y(t ), t ,  )
x(
0  g(x(t ), y(t ), t ,0)  y(
 t )  g(x(t ), y(t ), t ,  )

•Converts DAEs to stiff ODEs (we know how to solve ODEs!)

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


26

13
9/30/2019

x1  x3  f1  0
x2  x1  f 2  0
x2  f3  0 1 apparent algebraic equation

Substitution will reveal two additional constraints


This issue will be discussed further.

Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech.


27

14

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy