Modern Simulators
Modern Simulators
Keywords and Phrases: Chemical process simulation; Mathematical models; Large nonlinear systems of equations; Sparse matrices; Method of lines;
Differentialalgebraic equations.
Introduction
The last decades have seen an increasing competition in the chemical engineering
industry. This has forced companies to develop and apply mathematical simulation techniques to improve their products. Main issues in this context are
plant economy and safety, minimum feedstock and utilities consumption and
environmental impacts. The pursuit of these goals leads to a rapidly growing
number of applications of computer simulations both in the design phase and
in the operating phase of chemical plants such as refineries, ethylene or gas processing plants or air separators. These examples give some of the applications
the authors have been involved in.
The most important steps in these processes are transformation of the components by chemical reactions and separation of mixtures to obtain certain purities. The effects of the processes are based on different physical and chemical
properties such as volatility, dew and bubble point, density and solubility of the
components in mixtures.
The key tool for modeling a chemical engineering plant is the flowsheet, an
abstract, graphoriented scheme of a planned or existing chemical plant. It
contains in its nodes the relevant single process steps, so called unit operations,
which are modelled independently. A unit operation comprises either an apparatus like a pump, a valve, a distillation column, a heat exchanger or a reactor
as a whole or only one or more distinct parts of a more complex process step.
The key function of a unit operation is to transform the incoming material and
information streams to give new output streams. The directed edges of the
graph represent the ideal flow of material, energy and information among the
unit operations. The flow of material in pipelines is modeled by individual unit
operation only if transportation deadtime and the effects of turbulent/laminar
flow is to be considered.
Figure 1 gives an example for a flowsheet of an ethylene plant. The central
role of flowsheets has made the term flowsheeting a synonym for the simulation
of chemical engineering plants.
Most of the large scale industrial plants operate in a steady-state mode. The
feedstock properties are constant in quantity and composition and - in the ideal
case - the plant continuously yields products at a constant rate and quality.
During the design or process synthesis of such plants an intense feedback from
the customer is indispensable to achieve the goals that he sets. In recent years
customers requirements increased drastically concerning purity of products,
minimization of feedstock, energy consumption, equipment costs and build time.
Additionally, legal constraints for environmental impacts have to be strictly
obeyed. With all major constraints in mind the necessary basic process steps
are determined in a first design phase, called basic engineering. Then, the
flowsheet is refined gradually in the phase of detailed engineering, leading to
the exact dimensions of all unit operations, e.g. the areas of heat exchangers,
volumes of tanks or number of trays in distillation columns. Also, different
2
All three steps are repeated in a cyclic manner. The first two tasks are inverse
problems and use suitable versions of the least-squares function as objective
functions. The objective functions for the latter task usually include maximum
current profit and production yield as well as minimum feedstock and utilities
consumption. Equality constraints arise from the equations describing the flowsheet. Inequality constraints typically force the purity of the products to obey
certain minimum requirements of the customer or guarantee the satisfaction
of legal environmental restrictions. An efficient application of all three steps
requires the on-line operation of the control system and the plant model. Online operation in this case comprises data transfer in both directions - from the
process to the plant model and vice versa - at unique user controlled points in
time. The simultaneous optimization of various continuous process parameters
together with integer quantities such as column feed or side-draw points calls
for mixed-integer nonlinear programming methods in the off-line analysis.
In recent years dynamic simulation has become an increasingly important
tool in the process industries. It is used in a variety of off-line applications,
i.e. with no direct interactions with the actual plant, like operability studies or
safety and risk analyses. It allows the investigation of start-up and shut-down
procedures and, together with optimal control techniques, even their systematic
optimization. Most important, dynamic flowsheeting is the basis for the design
of standard and advanced control strategies and a platform for the preliminary
implementation of the control systems. This is decisive for a stable and efficient
operation of a plant.
Furthermore, dynamic simulation models form the heart of operator training
systems. These simulation programs are used long time before the completion
of the plant to implement distributed control systems and to train future operator personnel in monitoring and controlling the design states of operation
as well as emergency situations. These applications make tough demands on
the efficiency and robustness of the integration algorithms. To represent the
behavior of the actual plant the model must be solved in real-time or faster.
Data exchanged with the on-line operating control system and operator input
account for permanent discontinuities in input values.
Dynamic simulation is increasingly used for dynamic on-line optimization
and identification of process information not directly available through measurements. Both applications are an integral part of modern model-based control systems. Mathematically, dynamic process simulation is governed by large
systems of differentialalgebraic equations with discontinuities.
Principally, simulators for the above mentioned tasks follow two different
concepts in setting up and solving the plant simulation model:
the sequential modular approach and
the equationoriented approach.
Both strategies are compared and discussed e.g. in [2, 17, 26, 32, 43]. Practi4
cal experience during the last decade has proven equationoriented simulation
technique superior to the sequential modular approach. It strongly relies on
efficient numerical methods for large, sparse algebraic and differentialalgebraic
systems of equations.
The present paper focuses on these mathematical aspects of stationary and
dynamic flowsheeting. Practical experience of the authors in these fields is
strongly influenced by the development of the equationoriented simulator
OPTISIM1 , an inhouse development of Linde AG [6]. If not stated otherwise,
model equations and numerical solution methods in the subsequent sections
follow the approaches in this software product. It combines stateoftheart
mathematical methods with a huge amount of experience originating from a
daytoday use of various simulators in different areas of flowsheeting. The
paper includes also results from individual research of the authors.
Section 2 presents the mathematical models of the most important units.
For the simulation of a plant, these units must be combined to a flowsheet.
This process is described in Section 3 with the help of a simple, yet instructive
example. Section 4 focuses on stationary flowsheeting. It describes the numerical solution of the steady state equations, especially the treatment of the large,
sparse systems and remedies for typical numerical difficulties. This section also
surveys techniques for steady state optimization. Section 5 describes properties
of differentialalgebraic equations arising in dynamic flowsheeting. Special attention is given to the index of the model equations for typical unit operations
and to the treatment of discontinuities.
This section introduces dynamic simulation models of the most important process steps found in chemical and refinery plants. All models are based on conservation laws for mass, energy and momentum. Since time constants related
to mass and energy holdups are several magnitudes larger than those found in
momentum transport phenomena and dominate the dynamic behavior, mass
and energy balances are formulated dynamically whereas momentum balances
are usually applied in a simplified and quasi-stationary form. Trivially, for directly calculating a steady state solution with the model equations discussed,
accumulation terms on the left hand sides of the balance equations have to be
neglected.
2.1
V, yj , hV , TV, PV
Vapor
F, z j, h ,T , P
Feed
Heat Q
L, xj , h, T , P
Liquid
= F V L ,
(2.1a)
= F z j V yj L x j
for j = 1, . . . , nc 1 ,
(2.1b)
= 1,
(2.1c)
yj
= 1,
(2.1d)
yj
L
= Kj (T, P, x, y) xj
= (M ) ,
j=1
d
(M hL )
dt
hL
P
for j = 1, . . . , nc ,
= F hF V hV L hL + Q ,
(2.1g)
= hL (T L , P L , x) , hV = hV (T V , P V , y) ,
(2.1h)
= P , PL = P , TV = T , TL = T .
(2.1i)
(2.1e)
(2.1f)
L,V :
xj :
yj :
h L , hV :
T ,TL ,TV :
PL ,PV :
The pressure P in the drum, the added heat Q, the molar feed flowrate F as
well as its mole fractions zj and its molar enthalpy hF are given. The number of
components is denoted by nc . The row vectors x and y collect the mole fractions
of the liquid and the vapor, respectively:
x = (x1 , . . . , xnc ) ,
y = (y1 , . . . , ync ) .
(2.2)
Equation (2.1a) is the all over material balance, while (2.1b) are individual
material balances for the first nc 1 components. The last component is determined by (2.1c). This equation as well as (2.1d) expresses the fact, that the
mole fractions in liquid and vapor sum up to 1 . Thermodynamic equilibrium is
ensured by (2.1d) and (2.1e). The latter equations describe the relation between
the mole fractions in the vapor phase and in the liquid phase. The so-called
Kvalues Kj depend on pressure, temperature and mole fractions of the liquid
and vapor phase. They are determined by a physical property system based on
given T , P , x, and y.
It is assumed, that the flowrate L of the liquid leaving the drum is a known
function of the holdup M in the drum (2.1f). Equation (2.1g) is a total
enthalpy balance, with the liquid and vapor molar enthalpies defined by (2.1h).
Both values are also evaluated in a physical property system from T , P , and
x or y, respectively. Equations (2.1i) equate pressures and temperatures in the
product flows to those in the drum. The system consists of 2nc +10 equations for
the same number of unknowns. For variants of the flash unit and its applications,
see [41].
2.2
= Li+1 + Vi1 Li Vi + Fi ,
(2.3a)
yi,j
= 1,
(2.3d)
yi,j
Li
j=1
for j = 1, . . . , nc ,
d
L
V
L
V
(Mi hL
i ) = Li+1 hi+1 + Vi1 hi1 Li hi Vi hi
dt
+Fi hF
i + Qi ,
L
L
hi = hi (Ti , Pi , xi ) ,
hVi = hVi (Ti , Pi , yi ) ,
Pi Pi+1 = (Mi+1 , Vi ) .
(2.3e)
(2.3f)
(2.3g)
(2.3h)
(2.3i)
yi = (yi,1 , . . . , yi,nc ) .
(2.4)
The external heat input Qi to stage i, the feed flowrate Fi to stage i as well as
its mole fractions zi,j and its molar enthalpy hF
i are given. The system (2.3a)
(2.3i) consists of N (2nc +7) equations. The following specifications complete the
system: the reflux flowrate LN +1 to the top tray together with its mole fractions
xN +1,j and its molar enthalpy hL
N +1 ; the vapor flowrate V0 to the bottom tray
as well as its composition y0,j and the molar enthaly hV0 ; the external pressure
at the column top PN +1 .
The rationale for these equations is the same as that for a single stage separation (see Sec. 2.1). Only the material and enthalpy balances have to be
modified adequately. Equation (2.3i) expresses the pressure drop between two
consecutive stages in terms of resistance incurred by the vapor flowing through
the holes or valves in the tray, and also through the static height of liquid on
the tray. The exact forms of the liquid flow function and vapor flow function
depend on the type and geometry of the trays used. The pressure drop equation for the top tray i = N is usually formulated in a different way than the
pressure drop across an internal tray since there is no external holdup MN +1 .
Usually, the number N of trays is within 10 N 100 , and the number nc of
components is restricted to nc 50 . For a more detailed discussion, see [18]
and [31].
2.3
The main purpose of heat exchangers is to transfer energy among two or more
fluid stream separated through the heat exchanger material. Hot streams leave
the heat exchanger at a lower temperature as they enter the apparatus. The
transferred energy is used to heat up cold streams on their way through the
equipment. Depending on the relative flow direction in the passages of the
exchanger there exist three principal modes of operation: cocurrent, countercurrent, and crosscurrent. The decision for a certain mode of operation depends
9
v1
stream 1
metal
stream 2
v2
q1
6
q2
x=0
h1 , T1
hm , Tm
h2 , T2
x=L
(i = 1, 2).
Here, i = i (Ti , Pi , zi ) is the heat transfer coefficient between the i-th stream
and the heat exchanger wall. It depends on the flow regime and on physical
properties and hence on temperature Ti , pressure Pi and composition zi =
(zi,1 , . . . , zi,nc ) of the stream. The quantity i denotes the heat transfer area
per unit length for the i-th stream.
The effect of heat transport in axial direction due to conduction and dispersion is usually much smaller than that of convection and is therefore neglected
here. Consequently, the model does not contain diffusive terms and is of hyperbolic type:
1
v1
1
v2
h1
t
h2
t
=
=
h1
1 1 (T1 Tm ) ,
x
h2
2 2 (T2 Tm ) ,
x
10
(2.5a)
(2.5b)
hm
t
0
0
0
1 1 (T1 Tm ) + 2 2 (T2 Tm ) ,
(2.5c)
=
=
=
hstream (T1 , P1 , z1 ) h1 ,
hstream (T2 , P2 , z2 ) h2 ,
hmetal (Tm ) hm .
(2.5d)
(2.5e)
(2.5f)
The physical property functions hstream and hmetal depend on the temperature and in the case of a stream also on pressure and composition as indicated
in (2.5d)(2.5f). The concentrations are assumed constant along each heat exchanger tube, the pressure is assumed constant or varying linearly with the
exchanger length. The system is completed by the initial conditions hi (x, 0),
hm (x, 0) and the boundary conditions h1 (0, t), h2 (L, t) .
2.4
@
@
&
cj
T
ri
V
cp
%
? cj , T, F
i,j Aj = 0 ,
i = 1, . . . , M .
(2.6)
j=1
Here, i,j is the stochiometric coefficient of component Aj in the i-th reaction. Stochiometric coefficients are taken positive for products and negative for
reactants.
Let cj,F be the molar concentration of Aj in the feed to the reactor, and
cj the molar concentration in the reactor and hence in the outflowing product.
Then a mass balance for Aj gives
V
M
X
dcj
= F (cj,F cj ) + V
i,j ri ,
dt
i=1
j = 1, . . . , nc .
(2.7)
Here, ri is the total rate of reaction for the i-th reaction. For many technical
reaction systems it is given by the power law rate equation
ri = ri (c1 , . . . , cnc , T ) = ki
nc
Y
j=1
cj i,j
ki0
nc
Y
cj i,j .
(2.8)
j=1
The Arrhenius rate constants ki and ki0 of the i-th reaction in forward and
backward direction obey the Arrhenius equation:
E0
E
0
0
,
k = k0 exp
,
(2.9)
k = k0 exp
RT
RT
where T is the temperature in the reactor. The constants k0 , k00 and E, E 0 are
frequency factors and activation energies, respectively. As usual, R is the gas
law constant. The exponents i,j and i,j denote the order of the i-th reaction
with respect to Aj in forward and backward direction, respectively. They obey
the relation
i,j i,j = i,j .
For a reversible reaction each direction must be considered separately, whereas
for an irreversible reaction only the forward direction is relevant, hence ki0 =
i,j = 0 .
Let TF denote the temperature in the feed. Then, under reasonable assumptions (e.g. constant pressure) an enthalpy balance for the reactor gives
V cp
M
X
dT
= F cp (TF T ) + V
(H,i )ri + Q .
dt
i=1
(2.10)
Here, cp is the constant molar heat capacity of the reaction mixture, is the
constant density, H,i is the heat of the i-th reaction, and Q is the rate of heat
entering the reactor. For more details, the reader is referred to [1, 37].
12
2.5
The model equations require physical property data, e.g. density, enthalpy or
volume. They are given by explicit functions or as solutions of highly nonlinear
implicit equations (thermodynamic state equations). In order to obtain the
physical property data asked for by a unit model, these equations must be
evaluated or solved.
The thermodynamic state equations implicitly relate temperature, pressure
and volume. Often these equations, like the cubic state equation, have multiple
solutions for certain variables. So, the choice of the solution to return depends
on the thermodynamic state of the system. The physical property equations
are solved iteratively in the physical property data system each time a unit
operation model is evaluated. This approach is used in almost all steady state
and dynamic simulation systems.
A flowsheet example
In this section the steps on the way to the simulation model of an actual process
or plant are shown. The small example process in Fig. 6 is first explained
and structured in a flowsheet. The model equations of the unit operations in
the flowsheet are then combined to give the complete simulation model of the
process.
F I , cIA,0 , T0I
F II , T0II
Membrane
?
TI
QI- cIA , cIB
VI A B
?
M
Jm,B
M
JQ
, JHM
-
T II
II
cII
Q
B
V II
TC
?
F I , cIA , cIB
?
F II , cII
B
13
is
A
VI
= F I (cIA0 cIA ) r0 V I
(3.1a)
M
= F I cIB + r0 V I Jm,B
(3.1b)
14
stream source
QI
heat exchanger
QI
6
TC
?
T C
T C-
stream source
heat exchanger
QII
QII
stream source
cIA,0
F II , T0II
T II
II
F I , T0I cI
c
B
B
?
?
II
TI
T
reactor
tank
?- membrane
?
no storage
mass and energy
mass and energy QII
QI
capacity
balances
balances
M
M
M
II
cIA , cIB , T I , r0
JQ
, Jm,B
, JH
cII
B ,T
M
M
JQ
JQ
TI
cIA , cII
B
F I, T I
M
JH
M
Jm,B
M
JH
M
Jm,B
cII
B
F
, T II
?
II
dT I
M
= F I cp (T0I T I ) + QI JQ
JHM r0 V I H,R
dt
E
0 = r0 cIA k0 e RT I
dcII
B
dt
dT II
V II cp
dt
V II
(3.1c)
(3.1d)
M
= F II cII
B + Jm,B
(3.2a)
M
= F II cp (T0II T II ) + QII + JQ
+ JHM
(3.2b)
0 =
QI k I AI (T C T I )
(3.3)
QII k II AII (T C T II )
(3.4)
15
M
JQ
k M AM (T I T II )
(3.5a)
M
Jm,B
AM (cIB cII
B)
(3.5b)
JHM
(3.5c)
cp (T T
II
M
)Jm,B
Source units for information and material streams are included to define
required input information.
The procedure to analyze a plant and to set up the flowsheet is similar
in almost all stationary and dynamic flowsheet oriented simulation packages
[6, 20, 24, 30]. However, they differ significantly in the solution strategies and
hence in the way the system of equations is generated.
In OPTISIM the model equations with their partial derivatives are available
in executable form in the model library. Prior to a simulation, the flowsheet information is analyzed, input and output variables of the unit models are assigned
internally and a calling sequence to the model equation programs is generated.
If a numerical solution algorithm asks for a function evaluation of the simultaneously solved plant model the sequence is interpreted for calls to the equation set
of the individual unit operations. The individual function evaluations are combined to give the entire plant information. Similar strategies are implemented
in DIVA [20].
The resulting state vector associated with the simulation model (3.1)(3.5)
is
II
I
II
M
M
M T
x = (cIA , cIB , T I , r0 , cII
.
B , T , Q , Q , JQ , Jm,B , JH )
Input or control quantities
u = (cIA0 , T0I , F I , T0II , F II , T C )T
of the system are provided by input unit operations.
In SpeedUp [30] model equations are provided and analyzed symbolically.
The program code of the equation system is generated and compiled as a whole
before a simulation can be run. Somewhat different simulation strategies are
pursued in HYSYS [24] and PROTISS2 .
Stationary flowsheeting
16
differential-algebraic system of the type (5.1) by the method of lines. Here, finite
element approximations
hi (x, t) =
N
X
(4.1)
k=1
with basis functions k (x) and time dependent coefficients i,k (t) are used for
the spatial discretization of the partial differential equations (2.5a)(2.5c). Stability requires upwinding within the frame of a PetrovGalerkin method. This
technique takes test functions k (x), which are different from the basis functions, and leads to upwinded, nonsymmetric Galerkin equations (see e.g. [40]).
The first derivative of the physical property function h (enthalpy) is discontinuous at the temperatures T = TBP (BubblePoint) and T = TDP (Dew
Point) due to phase changes. Consequently, the solutions of the system (2.5)
show discontinuities at those locations where the phases change. Naturally, their
positions in the heat exchanger depend on time t. A discretization, that does
not destroy the order of the approximation, requires the knowledge of these positions xBP (t) and xDP (t) . They provide valuable information to the process
engineer, too. Therefore, finite elements with moving nodes [28] are used. The
principle is outlined here for a single phase change location xBP (t) . The key is a
moving coordinate system that tracks xBP (t). For example, a time dependent,
piecewise linear coordinate transformation x = x(; xBP (t)) with the properties
L
x(0; xBP (t)) = 0 ,
x
; xBP (t) = xBP (t) ,
x(L; xBP (t)) = L
2
defines a new coordinate system with the variable , in which the phase change
takes place at the constant position = L/2 (cf. [36]). Assuming that the phase
change takes place in stream 1, the additional variable xBP is determined by
the equation
T1 (xBP (t), t) TBP = 0 .
(4.2)
4.1
Large scale chemical plants deliver products at a constant rate with constant
quality, i.e. concentration, temperature, etc., based on feeds available at uniform
conditions. In other words, the plants operate in a steady state mode. The corresponding mathematical task is the solution of a set of nonlinear equations
F (x, p, sign q)
0,
(4.3a)
q(x, p)
(4.3b)
where F <nx are the model equations with all time derivatives set to zero.
The vector x collects state variables such as concentrations, material and energy
17
flow rates, temperatures, pressures, or material and energy holdups. The vector p summarizes the given parameters, e.g. exchanger areas or vessel volumes.
The so-called switching functions q are used to switch among different states of
the system described by different subsets of equations. Changing from one set
of equations to an other causes discontinuities in the solution of (4.3a). Typical reasons for discontinuities in the steady state case are control devices, the
appearance or disappearance of phases, piecewise continuous physical property
correlations or limitations in rate equations.
This section shows how to obtain a steady state solution of a large system
of nonlinear, discontinuous equations by variants of Newtons method taking
into account the special structure and properties, e.g. sparsity, of the problem.
Approaches to obtain optimal steady states are discussed thereafter.
Eq. (4.3a) is solved using an inexact Newton method
F (i)
(x )x(i) = F (x(i) , p),
x
(4.4)
where (0, 1] is the step length [38]. The system of linear equations in (4.4)
is solved iteratively, see below.
Solution of sparse linear equations. A simulation model for the on-line
optimization of an ethylene plant consists typically of about 40.000 equations,
the Jacobian has about 200.000 non-zero entries. Because of stability and computing time reasons, the high dimension of the systems requires sparse matrix
methods.
18
Fig. 8 gives a typical structure of non-zero elements in the Jacobian. Unfortunately, the matrices do not exhibit properties that would facilitate their decomposition, like bandedness, symmetry, positive definitness or diagonal dominance. Rather, general sparse matrix alogrithms have to be used for their
factorization [10]. These methods are combined with iterative methods for linear equations in order to minimize effort and to increase accuracy. The latter
feature is decisive because the matrices are often ill-conditioned (see e.g. [38]).
Principally, direct methods for sparse systems differ from the standard Gaussian algorithms in their pivot selection strategy. Sparse matrix methods do not
use only stability criteria, but also criteria to minimize additional fill-in during
the decomposition phase. In general, the solution of a sparse linear system is
structured in three phases:
1. Analyze phase: The structure of non-zeroes is analyzed and a pivot sequence is determined.
2. Decomposition phase: The LU -decomposition is computed based on the
previously selected pivot-sequence.
3. Solution phase: For a given right hand side a solution is determined by
forwardbackward substitution.
The computational effort decreases from step 1 to step 3.
In OPTISIM the computation of the first two steps is avoided as far as
possible by iteratively solving the linear equations (4.4). The equations are preconditioned with a previously decomposed matrix, so that the factorization of
the current Jacobian need not be computed. Only in the case of poor convergence, a change in the structure of the Jacobian, or discontinuities the solution
procedure is restarted with phase 1 or phase 2.
The use of sparse matrix methods in OPTISIM is particular facilitated because all unit models provide analytical derivatives. Consequently, the sparsity
structure is explicitly known and no numerical tests with finite differences are
necessary to decide if an element is 0 or not.
For the solution of the linear system (4.4) iterative methods GMRES (generalized minimal residual) [34, 42], biconjugate gradient [33] or iterative
refinement together with the above mentioned preconditioning are applied. For
a comparative survey, see [35].
Discontinuities. Discontinuities occur because the structure of equations or
parameter values depend discontinuously on values of state variables. If this is
the case, discontinuities are inevitable during the solution of the nonlinear system (4.3a) because the final solution and hence the structure of model equations
and certain parameter values are unknown initially.
A discontinuity occurs whenever a switching function (4.3b) changes sign.
Different impacts on the equation system must be handled:
19
4.2
(x, p) =
xmin
F (x, p)
x xmax ,
min ,
(4.5a)
0,
pmin p pmax .
(4.5b)
(4.5c)
x,p
(x xmin )T ,
(xmax x)T ,
(p pmin )T ,
(s) =
min ,
s
F (s) = 0 ,
h(s) 0
xT ,
pT
(pmax p)T
T
the optimization
(4.6a)
(4.6b)
(4.6c)
has to be solved. This is done by the iteration s(i+1) = s(i) + s(i) starting from
initial values s(0) . The main difference among optimization methods is the way
the search direction s(i) is computed.
Sequentiallinear programming (SLP) is popular in the chemical engineering
community because of its robustness. Here, the objective function and the
constraints are linearized around the current point s(i) . Then the solution s(i)
20
F (s(i) ) +
min
s(i)
(4.7a)
= 0
(4.7b)
(4.7c)
Numerical results for the example of the two phase process can be found in the
Appendix.
Dynamic flowsheeting
As can be seen from the examples in Sec. 2 and 4 dynamic models of chemical processes result in large systems of linearly implicit differential-algebraic
equations (DAEs) of the form
A1 (y, z, p, u) A2 (y, z, p, u)
y
f (y, z, p, u)
=
.
(5.1)
0
0
z
g(y, z, p, u)
y
Let x =
be the state variables with x <nx , y, f <ny , z, g <nx ny ,
z
and A1 <ny ny nonsingular. Parameters p <np are known constants
whereas controls u <nu are given functions in time.
Besides pure dynamic simulation, control and optimal control problems, frequency analysis and real-time training simulation are important tasks to be
solved. The main focus of the following section is on the properties of the
DAE system (5.1) and on aspects of the numerical solution of DAE systems not
covered by standard DAE solution algorithms.
5.1
(x, p, u)
22
(5.2a)
(x, p, u)
(5.2b)
V = (P,
PV )
an index 1 DAE system is obtained.
The distillation column model is an index 1 DAE system. However, if different specifications are assumed in the model higher index problems are
obtained [31].
The heat exchanger model has after discretization also index 1, both with
and without moving nodes.
The two phase process from Sec. 3 implemented as a dynamic simulation
problem with given input values has index 1 because each of the algebraic
equations can be solved for the corresponding variable. For some associated dynamic design cases where output variables are specified and input
variables are released, Table 1 gives the corresponding indices.
23
given
time function
cIA
T II
TI
cII
B
unknown
time function
cIA0
FI
cIA0
TC
Index
2
3
3
4
Table 1: Design cases for two phase process and their index
Example:
Another example illustrating the index problem in chemical engineering are two
coupled tanks as shown in Fig. 9.
F0
h1
F1
F2
2
R
A1
A2
=
=
=
=
F0 F1
F1 F2
h1 h2
f (h2 ) .
If R and the input stream F0 are given, the unknowns, i.e. the liquid heights
h1 , h2 and the flows F1 , F2 can be computed. The areas A1 , A2 are assumed
to be given. For R 6= 0 this is an index 1 system. For R = , i.e. the valve
is closed completely, the flow F1 becomes zero and the index remains 1. If the
flow resistance R is decreased, the stiffness of the system increases. For R = 0,
the levels in both tanks adjust instantaneously and the index of the system is
2. It is important to see that a direct algebraic coupling of balanced quantities
increases the index of the system.
24
R0 ( 12 + 12 cos( tt0 ))
R(t) =
0
t < t0
,
t t0
2
h2
1.5
1
R
0.5
t0
0
0
10
15
h2 = const.
h 2 = 0
F1 F2 =
h1 h2
.
F2
h1 h2
F2 ,
R
F2 = const.
f
f F1 F2
h2 = 0 =
,
h2
h2 A2
f
h2
h1 h2
R
F2
A2
R = 0:
0=
f F1 F2
.
h2 A2
F0
h1
A1
F1
h2
R1
A2
F2
R2
F
h3
A3
...
FN-1
R
N-1
hN
FN
AN
The situation may even become worse if more tanks are coupled. The dynamic
behavior is governed by the system of equations
A1 h 1
A2 h 2
h2 h1
,
R1
h2 h1
h3 h2
F1 F2 =
+
,
R1
R2
F0 F1 = F0 +
..
.
Ai h i
Fi1 Fi =
hi+1 hi
hi hi1
+
,
Ri1
Ri
..
.
AN h N
FN 1 FN =
hN hN 1
f (hN )
| {z }
RN 1
:=chN
0=
A1
A2
..
0
.
AN
0
...
26
h1
h 2
..
.
h N
0
F 0
R11
1
R1
0
0
0
1
R1
R11
..
.
...
...
0
1
R2
...
1
R2
..
..
0
1
RN 1 c 0
c
0
0
.
RN11
0
h1
h2
..
.
hN
F0
Tanks are only a special case of holdup devices with the output being an integral
of the input. If the input to the first holdup is to satisfy a specification for the
last output, the index is always one more than the number of storages in series.
Some unit models such as distillation columns and flowsheets in general may
contain numerous coupled holdups. Consequently, the index in a design task
may be arbitrarily high.
5.2
A wide range of general purpose integration algorithms for the direct solution of
DAEs with index 1 and 2 have been published in recent years. Implementations
of the different approaches are:
Backward differential formula methods DASSL[3] and DAESOL[11],
Runge-Kutta methods RADAU5 [16],
Extrapolation methods LIMEX [9] and MEXX [23].
Engineering approaches to solving higher index DAEs are found in [8, 19, 27].
The method of choice in OPTISIM is an implementation of a variable stepsize,
variable order BDF method exploiting specific structures of the model equations
available in the OPTISIM model library.
5.3
A1 A2
y
f (y, z, p, u, sign q)
=
(5.3a)
0
0
z
g(y, z, p, u, sign q)
q
27
q(y, z, p, u)
(5.3b)
0
0,
which leads to consistent values. However, this method is restricted to semiexplicit DAE systems with index 1. For DAEs with index 2 we suggest to
treat the integration step size (or the right point of the integration interval t) as
a variable. Assume for example an implicit Euler discretization for the system
(5.3) (with A1 = I, A2 = 0 for simplicity), the system
y
0 =
0 =
yn + (t tn )f (y, z)
g(y, z)
q(y, z)
3 Parameters
28
5.4
Consistent initialization
Standard integration methods with order and stepsize control require consistent
initial values (y0 , z0 ), (y 0 , z0 ), i.e. the initial values must satisfy not only the
original DAE (5.1) but also the extended system (5.2). If initial values are
inconsistent, e.g. at the very beginning of a new simulation experiment or after
a discontinuity has occurred, the solution contains an error portion that cannot
be controlled by conventional error control strategies. For the initialization of
DAEs general approaches have been published [21, 22, 29].
To avoid inconsistent values in the solution after a discontinuity, smoothed
functions, e.g. a ramp or a half cosine wave, are often used instead of step
changes in parameters or input variables. However, in the DAE context nondifferentiable solutions may occur even though the input function is continuously
differentiable. The reinitialization of DAEs after discontinuities has been studied
in [4, 25].
References
[1] R. Aris. Elementary chemical reactor analysis. Butterworth Publishers,
Boston, 1989.
[2] L. T. Biegler. Chemical process simulation. Chemical Engineering Progress,
85/10, 1989.
[3] K.E. Brenan, S.L. Campbell, and L.R. Petzold. The numerical solution
of initial value problems in ordinary differential-algebraic equations. North
Holland Publishing Co., 1989.
[4] L. Br
ull and U. Pallaske. On consistent initialization of differentialalgebraic equations with discontinuities. In Proceedings of the Fourth European Conference on Mathematics in Industry, pages 213217, Stuttgart,
1991. B.G. Teubner.
[5] P. Bujakiewicz and P.P.J. van den Bosch. Determination of perturbation
index of a DAE with maximum weighted matching algorithm. In Proc. of
IEEE/IFAC Symposium CACSD 94, Tucson, AZ, 1994.
[6] P. Burr. The design of optimal air separation and liquefraction processes
with the OPTISIM equation oriented simulator and its application to online and off-line plant optimization. In Proc. AIChE Spring National Meeting, April 1991, Houston, TX, 1991.
29
[7] S.L. Campbell and C.W. Gear. The index of general nonlinear DAEs.
Numer. Math., 72:173196, 1995.
[8] Y. Chung and A. W. Westerberg. Solving a class of near index problems
as perturbations of index problems. Ind. Eng. Chem. Res., 31:25932603,
1992.
[9] P. Deuflhard, E. Hairer, and J. Zugck. One-step and extrapolation methods
for differential-algebraic systems. Numer. Math., 51:501516, 1987.
[10] I. S. Duff, A. M. Erisman, and J. K. Reid. Direct methods for sparse
matrices. Clarendon Press, Oxford, 1986.
[11] E. Eich. Projizierende Mehrschrittverfahren zur numerischen L
osung der
Bewegungsgleichungen technischer Mehrk
orpersysteme mit Zwangsbedingungen und Unstetigkeiten. PhD thesis, Institut f
ur Mathematik, Universitat Augsburg, 1991. VDI-Fortschrittsberichte, Reihe 18, Nr. 109,
VDI-Verlag, D
usseldorf, 1992.
[12] R. Fletcher. Practical methods of optimization. John Wiley & Sons, 2nd
edition, 1987.
[13] C. W. Gear. Differential-algebraic equation index transformation. SIAM
J. Sci. Stat. Comp., 7:3947, 1988.
[14] P.E. Gill, W. Murray, and M.H. Wright. Practical optimization. Addison
Wesley, 1981.
[15] A. Griewank and G.F. Corliss, editors. Automatic differentiation of algorithms: Theory, implementation and application, Philadelphia, 1991.
SIAM.
[16] E. Hairer and G. Wanner.
Springer, 1991.
[17] M. Hillestad and T. Hertzberg. Dynamic simulation of chemical engineering systems by the sequential modular approach. Comput. chem. Engng.,
10:377388, 1986.
[18] C.D. Holland and A.I. Liapis. Computer methods for solving dynamic seperation problems. McGraw-Hill, New York, 1983.
[19] R.B. Jarvis and C.C. Pantelides. A differentiation-free algorithm for solving
high-index DAE systems. In Proc. AIChE 1992 Annual Meeting, Miami
Beach, 1.-6. November 1992 1992. American Institute of Chemical Engineers. Paper 146g.
30
[34] Y. Saad and M. H. Schultz. GMRES: a generalized minimal residual algorithm for solving nonsymmetric linear systems. SIAM J. Sci. Stat. Comput.,
7:856869, 1986.
[35] W. Schmid, M.Paffrath, and R.H.W. Hoppe. Application of iterative methods for solving nonsymmetric linear systems in the simulation of semiconductor processing. Surv. Math. Ind., 5:126, 1995.
[36] N. L. Schryer. Designing software for one-dimensional partial differential
equations. ACM Trans. Math. Software, 16:7285, 1990.
[37] J. M. Smith. Chemical engineering kinetics. McGraw-Hill, Singapore, third
edition, 1981.
[38] J. Stoer and R. Bulirsch. Introduction to numerical analysis. Springer, New
York, 2nd edition, 1993.
[39] J. Unger, A. Kroner, and W. Marquardt. Structural analysis of differentialalgebraic equation systems Theory and applications. Comput. chem.
Engng., 19:867882, 1995.
[40] R. Wait and A. R. Mitchell. Finite element analysis and applications. John
Wiley & Sons, Chichester, 1985.
[41] S.M. Walas. Phase equilibria in chemical engineering. Butterworth Publishers, Boston, 1985.
[42] H. F. Walker. Implementation of the GMRES method using Householder
transformations. SIAM J. Sci. Stat. Comput., 9:152163, 1988.
[43] S. E. Zitney and M. A. Stadtherr. Computational experiments in equationbased chemical process flowsheeting. Comput. chem. Engng., 12, 1988.
Authors addresses:
Prof. Dr. Edda Eich-Soellner, Fachbereich Informatik/Mathematik, Fachhochschule M
unchen, Lothstr. 34, D80323 M
unchen, Germany.
Prof. Dr. Peter Lory, Institut f
ur Wirtschaftsinformatik, Universitat Regensburg, D93040 Regensburg, Germany.
Dr. Peter Burr and Dipl.-Ing. Andreas Kroner, Linde AG, Process Engineering and Contracting Division, Dr.-Carl-von-Linde-Str. 6-14, D82049 Hollriegelskreuth, Germany
A
A.1
The constant parameters and input variables of the two phase process are:
32
AI =101
AII =101
AM =101
=102
I
cA0 =0.2
cp
=83.2
E
=12000
H,R =1.93 105
F I =2 104
F II =1 104
k0 =1.8 105
kI
=10
k II =10
k M =10.0
R
=8.314
=51.0
T0I =293
T0II =293
T C =293
V I =102
V II =102
cooling area
cooling area
membrane area
mass transfer coefficient
feed concentration of A
molar heat capacitiy
activation energy
heat of reaction
flowrate through phase I
flowrate through phase II
frequency factor
heat transfer coefficient
heat transfer coefficient
heat transfer coefficient
Gas law constant
molar density
feed temperature
feed temperature
cooling water temperature
volume
volume
A.2
m2
m2
m2
m
s
kmol
m3
kJ
kg k
kJ
kmol
kJ
kmol
m3
s
m3
s
1
s
kW
m3 K
kW
m3 K
kW
m3 K
kJ
kmol K
kg
m3
K
K
K
m3
m3
33
kmol
m3
kmol
m3
kmol
m3
K
K
kmol
s
kW
kW
kW
kW
kmol
m3 s .
A.3
The two phase process is optimized w.r.t. costs. Optimization parameters are
the cooling temperature T C , exchange areas AM , AI , AII , volumes V I , V II , and
the input concentration cIA0 (i.e. p = (AM , V I , V II , AI , AII , cIA0 )). The difference
between investment and feed costs, resp., and proceeds is minimized:
(x, p)
with constraints
T II
T II
105
105
105
105
300,
300,
V I 101 ,
V II 101 ,
AI 10,
AII 10 .
34