lecture 5a: model analysis - lumped parameter & dps models · 2018-04-05 · lecture 5a: model...
TRANSCRIPT
Lecture 5a: Model Analysis - Lumped
Parameter & DPS Models
Rafiqul Gani
(Plus material from Ian Cameron)
PSE for SPEED
Skyttemosen 6, DK-3450 Allerod, Denmark
www.pseforspeed.com
2
Lecture 5a: Computer Aided Modelling
Key issues to consider
❖ Must analyze before solving
▪ Degrees of freedom analysis
▪ Incidence matrix; singularity of equation
system; index-number
▪ Stability of the model
3
Lecture 5a: Computer Aided Modelling
Degrees of freedom analysis - 1
Classify equations
Algebraic equations (AEs)
•explicit (a = b*x + c with b, c, x as known)
•implicit (0 = b*x(a) + c – a with b, c as
known)
Ordinary differential equations (ODEs)
•first order ODEs (dy/dt = f(y, t)
Partial differential equations (PDEs)
•time plus one-three spatial directions for
different coordinate systems
Note: Mathematical model can have any combination of above
4
Lecture 5a: Computer Aided Modelling
Degrees of freedom analysis - 2
Classify variables
Known
variables fixed by system
variables fixed by problem
variables fixed by model
Unknown
dependent (differential)
dependent (partial differential)
implicit (algebraic)
explicit (algebraic)
Independent
time, length, ..
5
Lecture 5a: Computer Aided Modelling
Degrees of freedom analysis - 3
Definition (NDF or NS; degrees of freedom or number of variables
to specify):
-NV = total number of variables (not counting
independent variables)
-NU = number of unknown variables
-NE = number of independent equations
Assign dependent (partial) to PDEs; dependent (differential)
to ODEs; implicit & explicit algebraic to AEs
DF V EN N N S V UN N N OR
6
Lecture 5a: Computer Aided Modelling
Example DoF analysis
0
0
0
)(
02
322
211
21
gzPP
PPCF
PPCF
A
FF
dt
dz
V
V
1 2 0 1 2 3
V
State (dependent-differential) variable
Algebraic variables , , , , ,
Parameters C , ,
Constants
Equations 1 + 3
11 4 7DF V E
z
F F P P P P
A
g
N N N
z
P1 P
2P
3
P0
F1
F2
Model DOF analysis
Assign z to ODE; Cv, A,
, g as fixed by system;
select 3 variables from
”algebraic” as fixed &
3 as unkown
Introduction to MoT
•Model construction
•Model analysis
7Lecture 5a: Computer Aided Modelling
Different specifications (DoF selection)
z
P1 P
2P
3
P0
F1
F2
Select 3 variables from
“algebraic” as fixed,
making the remaining 3
as unknown and assigned
to the AEs
Specification 1
3101 ,, PPPS
Specification 2
2102 ,, PPPS
x
xx
xx
3
2
1
221
g
g
g
PFF
3
2
1
321
xx
x
g
g
g
PFF
Unsolvable
system?
8Lecture 5a: Computer Aided Modelling
High index DAEs
❖Only for Differential-algebraic equations
(for PDEs, first discretize the PDEs)
❖ Pure ODE systems are index 0
❖Many index 1 DAE solvers
❖ Few higher index solvers
❖Ensure index 1 models are used
9Lecture 5a: Computer Aided Modelling
DAE index definition
❖The “index” of the DAE system is the
number of times the algebraic sub-
system must be differentiated to give a
set of ODEs.
10Lecture 5a: Computer Aided Modelling
General DAE system
General system
),,(0
),,(
tzyg
tzyfdt
dy
Differentiate the algebraic equations
rankfullgifffggdt
dz
dt
dzgfg
dt
dzg
dt
dyg
zyz
zy
zy
0
0
1
What is full
rank?
11Lecture 5a: Computer Aided Modelling
High index example
! model 1index
once ateDifferenti
1211
211
121
1212
1211
3
2
20
zyyz
yyz
zyy
zyyy
zyyy
! model 2index
...again and
once ateDifferenti
1211
121
121
21
21
1212
1211
442
30
30
20
20
zyyz
zyy
zyy
yy
yy
zyyy
zyyy
Case 1 Case 2
12
Lecture 5a: Computer Aided Modelling
What is the index of this model?
0
0
0
)(
02
322
211
21
gzPP
PPCF
PPCF
A
FF
dt
dz
V
V
z
P1 P
2P
3
P0
F1
F2
Model
Specification 1
3101 ,, PPPS
x
xx
xx
3
2
1
221
g
g
g
PFF
• Insert F1 and F2 into Eq. 1
• Differentiate Eq. 4 with
respect to t
• What happens if P0, P1, P2
are specified?
13Lecture 5a: Computer Aided Modelling
Exercise - 4 : What is the index of this model?
2211ˆˆ hFhFQ
dt
dH
Conservation
Constitutive
DzA
TMcH
PTfh
PTfh
TTUAQ
P
H
),(ˆ
),(ˆ
)(
22
11
Tank
QhFhFdt
dHHoHHiH
J ˆˆ
Conservation
Constitutive
2)(
),(ˆ
),(ˆ
)(
HoHiH
HPHHJJ
HoHo
HiHi
HoHiPHH
TTT
TcMH
PTfh
PTfh
TTcFQ
Jacket
Tank
contents
jacket
fluid
Q
T
THo
THi
F1, T
1
F2, T
System
14
Lecture 5a: Computer Aided Modelling
Stability of the model
❖Indicated by the dynamic modes- time constants of the system
- related to physico-chemical phenomena
•fluid flow (generally fast)
•mass transfer rates (can be slow)
•heat transfer (usually slow)
•reaction kinetics (very fast to very slow)
i
i
1
15
Lecture 5a: Computer Aided Modelling
Linear model analysis
Linear equation system
Solution given by
0
25.1000
11
75.9992000
2
1
2
1
y
y
y
y
Ayy
10025.0999.2)(
1499.0449.1)(
5.20005.0
2
5.20005.0
1
tt
tt
eety
eety
Slow mode (component) Fast mode (component)
16
Lecture 5a: Computer Aided Modelling
Computing eigen-values of the J-matrix
❖ In MoT, write the
ODE system; and then
ask for calculation of
the eigen-values
❖ For problem of slide
13, the solution is:
Solution with MATLAB
» A=[-2000 999.75;1 -1];
» b=eig(A)
b =
1.0e+003 *
-2.0005
-0.0005
Two eigen-values
(-2000.5, -0.5)
17Lecture 5a: Computer Aided Modelling
General linear system analysis
01
1
1
0
:
)(
)exp()(
)0( ,
kjk
n
k
ijij
tn
j
iji
xVVZ
where
eZtx
tZtx
xxAxdt
dx
j
Linear set of equations
Solution to the equations
Individual component
solution to the equations
– note the eigenvalues !
– note the eigenvectors !
The eigen-values
contain the stability
information
18
Lecture 5a: Computer Aided Modelling
Eigen-value analysis
❖ Dynamic modes determined by eigen-values of
the linear system
❖ Nonlinear problems must be linearised first to
get Jacobian J(y,t) on the trajectory
❖ Eigen-values of Jacobian computed using MoT
or MATLAB eig(A) or similar function.
19Lecture 5a: Computer Aided Modelling
Behaviour of linear systems
❖ Phase plane analysis illustrates motion of system
❖ Second order systems plot
❖ Typical second order system (cf. valve actuator) :
yyyy vsor vs 21
2/4
2/4
0
2
2
2
1
baa
baa
with
byyay
Set y1 = dy/dt = ý
y2 = dy1/dt = d2y/dt = ÿ
So,
y2 + a y1 + by = 0
Therefore,
dy/dt = y1
dy1/dt = - (a y1 + by )
20Lecture 5a: Computer Aided Modelling
Phase plane analysis
❖ Several cases dependent on eigen-values
parts real zero with conjugatescomplex and
parts real zero-non with conjugatescomplex and
sign oppositebut realboth and
sign same and realboth and
21
21
21
21
21Lecture 5a: Computer Aided Modelling
Phase plane diagrams
22
Lecture 5a: Computer Aided Modelling
General nonlinear model
❖Linearize at some point
❖Obtain linear model
❖Solution is
),( tyfy
)()( 1 tgvectyi
tn
i i
i
))(,())(( tgtftgyAy
Derive the linear model and solution for:
dy1/dt = y1*y2 + (y1)2
dy2/dt = y1 + (y2)2
23
Lecture 5a: Computer Aided Modelling
Stability cases
❖ Stable model
❖ Unstable model
❖ Ultra-stable (“stiff”)
i allfor 0i
large"" Some
small"" Some
0
i
i
i
0 be will Somei
24
Lecture 5a: Computer Aided Modelling
Stability implications for numerical solution
❖ The problem determines the choice of numerical
method
❖ “Stiff” problems need special attention
❖ All simple explicit methods have limitations on
allowable step lengths
maxi
max
boundstability method
h
25Lecture 5a: Computer Aided Modelling
Multiscale, lumping, simplification, stability: Example
• Fluid zone
• Particle zone
• Heat transfer
zone
• Catalyst
recovery zone
26Lecture 5a: Computer Aided Modelling
Multiscale balance relations
Multiscale, lumping, simplification, stability: Example
27Lecture 5a: Computer Aided Modelling
Constitutive relations
Multiscale, lumping, simplification, stability: Example
28Lecture 5a: Computer Aided Modelling
Multiscale, lumping, simplification, stability: Example
29Lecture 5a: Computer Aided Modelling
Stability analysis
• Multiple steady states
• Unstable state
Multiscale, lumping, simplification, stability: Example