769513
769513
769513
BENGT ANDERSSON
Chalmers University of Technology, Gothenberg
LOUISE OLSSON
Chalmers University of Technology, Gothenberg
RONNIE ANDERSSON
Chalmers University of Technology, Gothenberg
University Printing House, Cambridge CB2 8BS, United Kingdom
Published in the United States of America by Cambridge University Press, New York
Cambridge University Press is part of the University of Cambridge.
It furthers the University’s mission by disseminating knowledge in the pursuit of
education, learning and research at the highest international levels of excellence.
www.cambridge.org
Information on this title: www.cambridge.org/9781107049697
C Cambridge University Press 2014
This publication is in copyright. Subject to statutory exception
and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First published 2014
Printed in the United Kingdom by Clays, St Ives plc
A catalog record for this publication is available from the British Library
Library of Congress Cataloging in Publication data
Rasmuson, Anders, 1951–
Mathematical modeling in chemical engineering / Anders Rasmuson, Chalmers University of Technology,
Gothenberg, Bengt Andersson, Chalmers University of Technology, Gothenberg, Louise Olsson, Chalmers
University of Technology, Gothenberg, Ronnie Andersson, Chalmers University of Technology, Gothenberg.
pages cm
Includes index.
ISBN 978-1-107-04969-7 (hardback)
1. Chemical engineering – Mathematical models. I. Title.
TP155.2.M35R37 2014
660 – dc23 2013040670
ISBN 978-1-107-04969-7 Hardback
Cambridge University Press has no responsibility for the persistence or accuracy of
URLs for external or third-party internet websites referred to in this publication,
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate.
Contents
Preface page ix
1 Introduction 1
1.1 Why do mathematical modeling? 1
1.2 The modeling procedure 5
1.3 Questions 9
2 Classification 10
2.1 Grouping of models into opposite pairs 10
2.2 Classification based on mathematical complexity 14
2.3 Classification according to scale (degree of physical detail) 16
2.4 Questions 18
3 Model formulation 20
3.1 Balances and conservation principles 20
3.2 Transport phenomena models 22
3.3 Boundary conditions 26
3.4 Population balance models 28
3.4.1 Application to RTDs 32
3.5 Questions 34
3.6 Practice problems 35
6 Numerical methods 81
6.1 Ordinary differential equations 81
6.1.1 ODE classification 81
6.1.2 Solving initial-value problems 82
6.1.3 Numerical accuracy 87
6.1.4 Adaptive step size methods and error control 88
6.1.5 Implicit methods and stability 90
6.1.6 Multistep methods and predictor–corrector pairs 93
6.1.7 Systems of ODEs 94
6.1.8 Transforming higher-order ODEs 96
6.1.9 Stiffness of ODEs 97
6.2 Boundary-value problems 99
6.2.1 Shooting method 99
6.2.2 Finite difference method for BVPs 102
6.2.3 Collocation and finite element methods 107
6.3 Partial differential equations 108
6.3.1 Classification of PDEs 109
6.3.2 Finite difference solution of parabolic equations 110
6.3.3 Forward difference method 110
6.3.4 Backward difference method 113
Contents vii
Bibliography 180
Index 181
Preface
The aim of this textbook is to give the reader insight and skill in the formulation,
construction, simplification, evaluation/interpretation, and use of mathematical models
in chemical engineering. It is not a book about the solution of mathematical models,
even though an overview of solution methods for typical classes of models is
given.
Models of different types and complexities find more and more use in chemical
engineering, e.g. for the design, scale-up/down, optimization, and operation of reactors,
separators, and heat exchangers. Mathematical models are also used in the planning and
evaluation of experiments and for developing mechanistic understanding of complex
systems. Examples include balance models in differential or integral form, and algebraic
models, such as equilibrium models.
The book includes model formulation, i.e. how to describe a physical/chemical reality
in mathematical language, and how to choose the type and degree of sophistication of
a model. It is emphasized that this is an iterative procedure where models are gradually
refined or rejected in confrontation with experiments. Model reduction and approximate
methods, such as dimensional analysis, time constant analysis, and asymptotic methods,
are treated. An overview of solution methods for typical classes of models is given.
Parameter estimation and model validation and assessment, as final steps, in model
building are discussed. The question “What model should be used for a given situation?”
is answered.
The book is accompanied by problems, tutorials, and projects. The projects include
model formulation at different levels, analysis, parameter estimation, and numerical
solution.
The book is aimed at chemical engineering students, and a basic knowledge of chemi-
cal engineering, in particular transport phenomena, will be assumed. Basic mathematics,
statistics, and programming skills are also required.
Using the book (course) the reader should be able to construct, solve, and apply
mathematical models for chemical engineering problems. In particular:
Mathematical modeling has always been an important activity in science and engineering.
The formulation of qualitative questions about an observed phenomenon as mathematical
problems was the motivation for and an integral part of the development of mathematics
from the very beginning.
Although problem solving has been practiced for a very long time, the use of math-
ematics as a very effective tool in problem solving has gained prominence in the last
50 years, mainly due to rapid developments in computing. Computational power is par-
ticularly important in modeling chemical engineering systems, as the physical and chem-
ical laws governing these processes are complex. Besides heat, mass, and momentum
transfer, these processes may also include chemical reactions, reaction heat, adsorption,
desorption, phase transition, multiphase flow, etc. This makes modeling challenging but
also necessary to understand complex interactions.
All models are abstractions of real systems and processes. Nevertheless, they serve
as tools for engineers and scientists to develop an understanding of important systems
and processes using mathematical equations. In a chemical engineering context, math-
ematical modeling is a prerequisite for:
The dryer essentially consists of a long tube in which the material is conveyed by, in
our case, superheated steam. The aim of the modeling task was to develop a tool that
could be used for design and rating purposes.
Inside the tubes, the single particles, conveying steam, and walls interact in a complex
manner, as illustrated in Figure 1.2. The gas and particles exchange heat and mass due
to drying, and momentum in order to convey the particles. The gas and walls exchange
momentum by wall friction, as well as heat by convection. The single particles and walls
also exchange momentum by wall friction, and heat by radiation from the walls. The
single particle is, in this case, a wood chip shaped as depicted in Figure 1.3.
The chip is rectangular, which leads to problems in determining exchange coefficients.
The particles also flow in a disordered manner through the dryer. The drying rate is
controlled by external heat transfer as long as the surface is kept wet. As the surface
dries out, the drying rate decreases and becomes a function of both the external and
internal characteristics of the drying medium and single particle. The insertion of cold
material into the dryer leads to the condensation of steam on the wood chip surface,
which, initially, increases the moisture content of the wood chip. The pressure drop at
the outlet leads to flashing, which, in contrast, reduces the moisture content.
The mechanisms that occur between the particles and the steam, as well as the
mechanisms inside the wood chip, are thus complex, and a detailed understanding is
necessary. How would you go about modeling this problem? Models for these complex
processes have been developed in the cited articles by Fyhr and Rasmuson.
4 Introduction
decelerate in the expansion chamber, and fall down to the dense region of particles
outside the tube. During the upward movement and the deceleration, the particles are
dried by the warm air, and a thin coating layer starts to form on the particle surface.
From the dense region the particles are transported again into the Wurster tube, where
the droplets again hit the particles, and the circulation motion in the bed is repeated.
The particles are circulated until a sufficiently thick layer of coating material has been
built up around them.
The final coating properties, such as film thickness distribution, depend not only on
the coating material, but also on the process equipment and the operating conditions
during film formation. The spray rate, temperature, and moisture content are operating
parameters that influence the final coating and which can be controlled in the process.
The drying rate and the subsequent film formation are highly dependent on the flow field
of the gas and the particles in the equipment. Local temperatures in the equipment are
also known to be critical for the film formation; different temperatures may change the
properties of the coating layer. Temperature is also important for moisture equilibrium,
and influences the drying rate.
Several processes take place simultaneously at the single-particle level during the
coating phase. These are: the atomization of the coating solution, transport of the
droplets formed to the particle, adhesion of the droplets to the particle surface, sur-
face wetting, and film formation and drying. These processes are repeated for each
applied film layer, i.e. continuously repeated for each circulation through the Wurster
bed.
Consequently, the mechanisms that occur at the microscopic and macroscopic levels
are complex and include a high degree of interaction. The aim of the modeling task is to
develop a tool that can be used for design and optimization. What models do you think
best describe the mechanisms in this process?
In undergraduate textbooks, models are often presented in their final, neat and elegant
form. In reality there are many steps, choices, and iterative processes that a modeler goes
through in reaching a satisfactory model. Each step in the modeling process requires an
understanding of a variety of concepts and techniques blended with a combination of
critical and creative thinking, intuition and foresight, and decision making. This makes
model building both a science and an art.
Model building comprises different steps, as shown in Figure 1.5. As seen here,
model develpoment is an iterative process of hypotheses formulation, validation, and
refinement.
Figure 1.5 also gives an outline of this process. Conceptual and mathematical model
formulation are treated further in Chapters 3–5; solution methods are discussed in
Chapter 6; and finally parameter estimation and model validation are discussed in
Chapter 7.
6 Introduction
What is the objective (i.e. what questions should the model be able to answer)?
What resolution is needed?
What degree of accuracy is required?
What are the variables (dependent, independent, parameters)? The distinction between
dependent and independent variables is that the independent variable is the one being
changed, x, and the dependent variable, y, is the observed variable caused by this change,
e.g. y = x3 . Parameters represent physical quantities that characterize the system and
model such as density, thermal conductivity, viscosity, reaction rate constants, or activa-
tion energies. Parameters are not necessarily constants, and can be described as functions
of the dependent (or independent) variables, e.g. heat capacity cp (T) and density ρ(p,T).
What are the constraints? Are there limitations on the possible values of a variable?
For example, concentrations are always positive.
What boundary conditions, i.e. the relations valid at the boundaries of the system, are
suitable to use?
What initial conditions, i.e. conditions valid at the start-up of a time-dependent pro-
cess, exist?
Each relationship is represented by an equation, inequality, or other suitable mathe-
matical relation.
for parameter estimation. During the validation procedure it may happen that the model
still has some deficiencies. In that case, we have to “iterate” the model and eventually
modify it. In the work by Melander, O. and Rasmuson, A. (Nordic Pulp Paper Res.
J. 20, 78–86, 2005) it was found that the original model for pulp fiber flow in a gas
stream severely underestimated lateral spreading of the fibers. Detailed analysis led to
a modified model (Melander, O. and Rasmuson, A., J. Multiphase Flow 33, 333–346,
2007) with an additional term in the governing equations, and good agreement with
experimental data.
In Chapter 7, the general question of model quality is discussed. Is the model good
enough?
In the evaluation of the model, sensitivity analysis, i.e. the change in model output
due to uncertainties in parameter values, is important.
There are certain characteristics that models have to varying degrees and which have
a bearing on the question of how good they are:
r accuracy (is the output of the model correct?);
r descriptive realism (i.e. based on correct assumptions);
r precision (are predictions in the form of definite numbers?);
r robustness (i.e. relatively immune to errors in the input data);
r generality (applicable to a wide variety of situations);
r fruitfulness (a model is considered fruitful if its conclusions are useful or if it inspires
development of other good models).
Step 7: Interpretation/application
The validated model is then ready to be used for one or several purposes as described
earlier, e.g. to enhance our understanding, make predictions, and give information about
how to control the process.
Let us conclude this chapter with a classical modeling problem attributable to Galileo
Galilei (1564–1642).
“Understanding” gravity is too vague and ambitious a goal. A more specific question
about gravity is:
Aristotle´s answer was that objects fall to the earth because that is their natural place,
but this never led to any useful science or mathematics. Around the time of Galileo
(early seventeenth century), people began asking how gravity worked instead of why it
worked. For example, Galileo wanted to describe the way objects gain velocity as they
fall. One particular question Galileo asked was:
1.3 Questions 9
The next step is to identify relevant factors. Galileo decided to take into account only
distance, time, and velocity. However, he might have also considered the weight, shape,
and density of the object as well as air conditions.
The first assumption Galileo made was:
Assumption 1 If a body falls from rest, its velocity at any point is proportional to the distance
already fallen.
1.3 Questions
(1) Give some reasons for doing mathematical modeling in chemical engineering.
(2) Explain why the model development often becomes an iterative procedure.
2 Classification
In this section, we will examine various types of mathematical models. There are many
possible ways of classification. One possibility is to group the models into opposite
pairs:
r linear versus non-linear;
r steady state versus non-steady state;
r lumped parameter versus distributed parameter;
r continuous versus discrete variables;
r deterministic versus stochastic;
r interpolation versus extrapolation;
r mechanistic versus empirical;
r coupled versus not coupled.
models in which a concentration is uniform at each stage but differs from stage to stage in
discrete jumps. Continuous models are described by differential equations and discrete
models by difference equations. Figure 2.2 illustrates the two configurations.
The left-hand figure shows a packed column modeled as a continuous system, whereas
the right-hand figure represents the column as a sequence of discrete (staged) units. The
concentrations in the left-hand column would be continuous variables; those in the right-
hand column would involve discontinuous jumps. The tick marks in the left-hand column
represent hypothetical stages for analysis. It is, of course, possible to model the packed
2.1 Grouping of models into opposite pairs 13
column in terms of imaginary segregated stages and to treat the plate column in terms
of partial differential equations in which the concentrations are continuous variables.
by means of a linear model into a region beyond the range of experimental data for a
chemical reaction that reaches a maximum yield in time.
In the safety analysis of nuclear waste repositories models are used to predict the fate of
leaking radionuclides into the sur rounding rock formation over geological time scales.
Naturally, it is of the utmost importance that these models are physically/chemically
sound and based on well-understood mechanistic principles.
Table 2.1. Classification of mathematical problems and their ease of solution using analytical methods
equations. Thus we can rather seldom find the analytical solution to a partial differential
equation, and, in fact, when we do, it very often involves such things as infinite series,
which are sometimes difficult to handle computationally. Table 2.1 shows the various
classes of mathematical equations and the limited class amenable to analytical solution.
It should be noted that, in a model with more than one equation, the difficulty in
obtaining a solution is dependent on the degree of coupling.
16 Classification
Level of physicochemical
description Topical designations Parameters
Physicochemical models based on the degree of internal detail of the system encom-
passed by the model are classified in Table 2.2. The degree of detail about a process
decreases as we proceed down the table.
Molecular description
The most fundamental description of processes, in the present context, would be based
on molecular considerations. A molecular description is distinguished by the fact that it
treats an arbitrary system as if it were composed of individual entities, each of which
obeys certain rules. Consequently, the properties and state variables of the system are
obtained by summing over all of the entities. Quantum mechanics, equilibrium and
non-equilibrium statistical mechanics, and classical mechanics are typical methods of
analysis, by which the properties and responses of the system can be calculated.
Microscopic description
A microscopic description assumes that a process acts as a continuum and that the
mass, momentum, and energy balances can be written in the form of phenomenological
equations. This is the “usual” level of transport phenomena where detailed molecular
2.3 Classification according to scale 17
Figure 2.5. Concept of representative elementary volume for a fluid (a) and a porous medium (b),
respectively.
interactions are ignored and differential balance equations are formulated for momentum,
energy, and mass.
The continuum concept is illustrated in Figure 2.5(a) with the density of a fluid. The
density, ρ, at a particular point in the fluid is defined as
m
ρ = lim , (2.1)
V →Vr V
where m is the mass contained in a volume V, and Vr is the smallest volume (the
representative elementary volume) surrounding the point for which statistical averages
are meaningful (in the figure, λ is the molecular mean free path and L is the macroscopic
length scale). For air at room temperature and atmospheric pressure, the mean free path,
λ, is approximately 80 nm. The concept of the density at a mathematical point is seen to
be fictitious; however, taking ρ = limV →Vr (m/V ) is extremely useful, as it allows
us to describe the fluid flow in terms of continuous functions. Note that, in general, the
density may vary from point to point in a fluid and may also vary with respect to time.
Mesoscopic description
The next level of description, mesoscopic, involves averaging at larger scales and thus
incorporates less detailed information about the internal features of the system of interest.
This level is of particular interest for processes involving turbulent flow or flow in
geometrically complex systems on a fine scale, such as porous media. The values of the
dependent variables are averaged in time (turbulence) or space (porous media). Processes
at this level are described by “effective” transport coefficients such as eddy viscosity
(turbulence) or permeability (porous media).
The continuum concept at the porous media level is illustrated in Figure 2.5(b) for
porosity:
Vv
ε = lim , (2.2)
V →Vr V
where Vv is the void volume in V, and d is the pore length scale.
Time averaging in turbulence is illustrated in Figure 2.6. The instantaneous velocity vz
oscillates irregularly. We define the time-smoothed velocity v z by taking a time average
of vz over a time interval t0 , which is large with respect to the time of turbulent oscillation
18 Classification
Macroscopic description
The final level, macroscopic, ignores all the details within a system and merely creates
a balance equation for the entire system. The dependent variables, such as concentration
and temperature, are not functions of position, but represent overall averages throughout
the volume of the system. The model is effective as long as detailed information internal
to the system is not required in model building. Macroscopic and lumped mean the
same thing.
In science, events distinguished by large differences in scale often have very little
influence on one another. The phenomena can, in such a case, be treated independently.
Surface waves in a liquid, for instance, can be described in a manner that ignores the
molecular structure of the liquid. Almost all practical theories in physics and engineering
depend on isolating a limited range of length scales. This is why the kinetic theory of
gases ignores effects with length scales smaller than the size of a molecule and much
larger than the mean free path of a molecule. There are, however, some phenomena where
events at many length scales make contributions of equal importance. One example is the
behavior of a liquid near the critical point. Near that point water develops fluctuations in
density at all possible scales: drops and bubbles of all sizes occur from single molecules
up to the volume of the specimen.
2.4 Questions
Before formulating a model it is crucial to define the system boundary. The purpose of
the boundary is to define the system in relation to its surroundings. In Figure 3.1, a stirred
tank is isolated from its surroundings by the dashed circle. All significant phenomena
enclosed within this boundary need to be included in a successful model. The system
boundary may be chosen in different ways, but for most systems the boundary to use
is natural. Models derived from physicochemical principles are usually based on the
general balance concept:
⎡ ⎤
net transport into
accumulation net generation
= ⎣ system through ⎦ + .
within system within system
boundaries
This relation is very general. The objective of model building is to transform the
verbal concept into mathematical statements that are specific to the quantity of interest.
We may balance mass, energy, and momentum as well as, for example, entropy and
countable entities such as size and age distributions (population balances). Some of
these entities are conserved, for example total mass, whilst some are not, for example
the mass of a species in a mixture (due to chemical reactions).
By using the balance principle, we can derive model equations by balancing the
quantities within the defined system boundary. A few examples of important balance
equations are given in the following.
Energy balance
An energy balance equation for the total energy, TE, in the system, taking into con-
sideration temperature-dependent thermal energy U, the potential energy PKE, pressure
energy PE, and the kinetic energy KE, is given by
⎡ ⎤ ⎡ ⎤ ⎡ ⎤
accumulation net flow of U, PKE, net generation
⎣ of TE ⎦ = ⎣ PE, KE into system ⎦ + ⎣ within ⎦.
within system through boundaries system
Momentum balance
Momentum and force are vector quantities, and the number of equations equals the
number of spatial dimensions in the model, e.g. a 2D model must contain momentum
balances for x- and y-momentum. Three kinds of forces are typically accounted for in
chemical engineering: pressure force, shear force, and gravitational force. A force is
associated with momentum production (Newton´s second law) and thus enters via the
last term in the general balance.
The most common types of models in chemical engineering are those related to the
transport of mass, heat, and momentum. In addition to the balance equation, a constitutive
equation that relates the flux of interest to the dependent variable (e.g. mass flux to
concentration) is needed. These relations (in simple 1D form) for the microscopic level
and for flow at the porous media level are given in Table 3.1. It should be noted that all
these relations have the general form
A simple example of setting up a model at the microscopic level (1D transient heat
conduction with a heat source) is given in Example 3.1 (Figure 3.2).
3.2 Transport phenomena models 23
accumulation: ρc p T (Ax);
in (conduction): (q A)|x t;
out (conduction): (q A)|x+x t;
production: S Axt.
∂T ∂2T
ρc p = k 2 + S,
∂t ∂x
that is to be solved with proper boundary and initial conditions.
Using the balance equation and taking the limit as x, y, z, t → 0 yields
∂T ∂T ∂T ∂T ∂ T ∂2T ∂2T
ρc p + vx + vy + vz =k + + 2 + S.
∂t ∂x ∂y ∂z ∂x2 ∂ y2 ∂z
In Example 3.1, there is no convective flow, consequently there is no heat convection,
and the following terms are canceled:
∂T ∂T ∂T
vx , vy , vz ≡ 0.
∂x ∂y ∂z
Furthermore, it is a 1D problem, which means that conduction in the y- and
z-directions can also be omitted, i.e.
∂2T ∂2T
k , k 2 ≡ 0.
∂ y2 ∂z
The only terms that remain in the general balance equation are accumulation,
conduction in the x-direction, and the source term. Thus, the balance equation
simplifies to
∂T ∂2T
ρc p = k 2 + S,
∂t ∂x
which is the same model equation as derived in Example 3.1.
In Example 3.1, the flow was set to zero by definition. In many situations the problem
is more complex and involves estimating the various terms. For instance, in Example 3.3
there may be both flow and conduction of heat. To estimate if one mechanism dominates,
a dimensionless number comparing the terms can be used.
The total flux of a quantity is the sum of its molecular flux and convective flux. The
ratio of the convective flux to the molecular flux (the Péclet number) can be used to
determine the relative importance of each flux. The dimensionless Péclet numbers are
26 Model formulation
defined by
Peheat = u L/α (heat transfer),
Pemass = u L/DAB (mass transfer).
Here, u and L are the characteristic velocity and length scales, and α and DAB are
the diffusivities for heat and mass transport, respectively. They obviously both have
the same unit (m2 s−1 ). Heat diffusivity is defined as α = λ(ρcp ) where λ is the heat
conductivity.
Depending on the magnitude of the Péclet number, we have
Pe 1 total flux ≈ molecular flux,
Pe ≈ 1 total flux = molecular flux + convective flux,
Pe 1 total flux ≈ convective flux.
Table 3.2. Common boundary conditions for use with the transport of mass
Description Math
Table 3.3. Common boundary conditions for use with the transport of momentum
Description Math
Table 3.4. Common boundary conditions for use with the transport of energy
Description Math
Dirichlet (first type) specifies the value a solution must take at its y(0) = γ1
boundary
∂y
Neumann (second type) specifies the value the derivative of the solution = γ1
∂ x x=0
must take at its boundary
∂y
Robin (third type) specifies a linear combination of the value of a1 y + b1 = γ1
∂x
the function and the value of its derivatives at
the boundary
28 Model formulation
In setting up the domain to be modeled, all symmetries in the problem should be used
to reduce the computational domain. (As long as this does not compromise the physics
of the system, i.e. we do not want to restrict the solution.)
The basis of a population balance model is that the number of entities with some
property in a system is a balanceable quantity. Properties include, among others, size,
mass, and age.
There are many examples in the process industries for which discrete entities are
created, destroyed, or changed in some way as a result of processing. A classical example
concerns crystallization, where the size distribution of crystals and its evolution is of
the highest relevance. In this application, the evolution of the crystal size distribution is
predicted using population balance models and closures describing mechanisms such as
nucleation, growth, and breakage. Granulation is another example; in this process, fine
particles are bound together into larger granules. Applications include manufacturing of
pharmaceuticals, detergents, and fertilizers. Consequently, population balance models
serve as a tool to predict, control, and optimize the complex dynamics of these systems.
Many biochemical processes also have characteristics that lend themselves to analysis via
the population balance model. Other examples include flocculation for purifying drinking
water, gas–liquid dispersions, and liquid–liquid extraction and reaction.The residence
time distribution (RTD) theory is a special case of the general population balance.
Let us first, as an introduction, discuss a commonly used population balance model
for flocculation in stirred reactor tanks. The aim of flocculation is to agglomerate fine
particles in water, using chemical additives, to large aggregates that are easy to separate
in sedimentation processes. The agglomerates are formed due to binary collisions of
particles. Not every collision is successful, however, so the collision efficiency has to be
accounted for. As the agglomerates grow, there is an increasing risk that they fragment
into smaller aggregates or even “primary” particles. This may be the result of shear
forces or collisions with the impeller, walls, or other particles.
Figure 3.4 shows the experimental results, using laser techniques, to follow the evolu-
tion of floc sizes over time. The primary data have been evaluated, using image analysis
techniques, and the result is also shown in the figure as the evolution of the number
concentration of flocs of different sizes (“population”) over time. It can be seen that the
number of small flocs decrease, and larger flocs form, over time.
The population balance, including these effects, can be written as follows:
∞ ∞
dn k 1
= α(i, j)β(i, j)n i n j − α(i, k)β(i, k)n i n k − χ (k)n k + χ (i)n i .
dt 2 i+ j=k i=1 i>k
(3.5)
In this equation, the term on the left-hand side represents the rate of change of the
number concentration of agglomerates of size k (valid for any size k). This is the result
of the processes accounted for on the right-hand side of the equation. The first term
accounts for the formation of agglomerates of size k due to collisions of two smaller
3.4 Population balance models 29
Figure 3.4. Change in floc size distribution during a flocculation process (Pelin, K., Licentiate
thesis, Chalmers University of Technology, 1999).
particles with sizes i and j (the factor of ½ is to avoid counting the same collision twice).
The second term gives a decrease in the number of k agglomerates, due to collisions
with existing agglomerates of this size and other particles with arbitrary size i (note
the negative sign). The third term, also negative, is a breakage function for particles of
size k; and the last term is a breakage function for agglomerates larger than k giving
fragments of size k. Here
α(i, j) is the collision efficiency of binary collision between i and j (a number between
0 and 1);
β(i, j) is the collision frequency between i and j (strongly dependent upon local flow
conditions);
χ (i) is the breakage function.
This population balance model is able to reproduce the results in Figure 3.4.
Flocculation is an example of a discrete growth of particles. In other processes,
notably crystallization, the growth is continuous. As a second, introductory, example,
we derive the population balance for batch crystallization (well mixed), only accounting
for continuous growth given by the growth rate:
dm
v= ,
dt
where m is the crystal mass. The number distribution is now given by f (m, t), where
f (m, t)m represents the number of crystals with mass within the range
m, m + m at time t.
30 Model formulation
The left-hand side of this relation represents the change in the number of crystals in the
size range m, m + m at time t. The right-hand side gives the number of smaller crystals
that reach this size by continuous growth minus the number of crystals of the “right”
size growing to a larger size.
Taking the limit as mt → 0, we obtain
∂f ∂( f v)
=− , (3.6)
∂t ∂m
which is to be solved with appropriate boundary conditions.
Before deriving the general population balances, we will give another example with
one spatial dimension and one distributed property (mass of cell): continuous cell growth
in a plug flow reactor.
Example 3.4 Population balance for cell behavior in a simple flow system
Let us consider a population of cells flowing through a plug flow reactor (Figure 3.5).
The cells are characterized at time t by their position, x, and their mass, m. They are
supposed to grow, to die, and to divide into two daughter cells (with mass conservation).
Figures 3.6(a) and (c) illustrate the “trajectories” of the cells in the physical space
domain and in the mass–time domain, respectively. These two curves may be
summarized in a single one, Figure 3.5(b), illustrating the mass–abscissa relationship.
Figure 3.5(d) considers a small control surface x over m.
Let
f (x, m, t)mx represent the number of cells within the range m, m + m and x,
x + x at time t;
G(x, m, t) = G+ − G− be the net generation of cells (where G+ represents birth and
G− represents death);
v (= dm/dt) be the growth rate of an individual cell in a uniform medium of
constant composition.
3.4 Population balance models 31
(a) (b)
(c) (d)
Figure 3.6. Illustration of the basis for establishing a population balance.
The mass balance for the cells in the (x, m, t) space is thus given by
× mt + Gxmt.
generation
Let us denote the distributed properties by pi , where vi is their respective rate of change
(vi = dpi /dt). The local population balance equation then becomes
∂f ∂ ( f vi )
n
=− − ∇ · ( f u) + G. (3.8)
∂t i=1
∂ pi
In the case of granulation, there will now be two terms in the sum on the right-hand side
of the equation: one associated with granule growth, and one associated with change in
liquid content. Note that particle velocity may differ from the fluid velocity due to slip
or external forces.
In cases where diffusion cannot be neglected, the additonal term ∇ · [ D p ∇ f ] must be
included in Equation 3.8:
∂f ∂ ( f vi )
n
=− − ∇ · ( f u) + ∇ · [ D p ∇ f ] + G. (3.9)
∂t i=1
∂ pi
Integrating Equation (3.8) over space and dividing by V (note that V is not necessarily
constant with time) yields
1 ∂(V
f ) ∂(
f vi )
n
1
=− − (Q out f out − Q in f in ) +
G. (3.10)
V ∂t i=1
∂ pi V
Equation (3.10) can, of course, be derived directly using a macroscopic control volume.
Let f be the number of fluid particles of age α. Equation (3.10) for this case becomes
1 ∂(V
f ) ∂
f 1
=− − (Q out f out − Q in f in ). (3.12)
V ∂t ∂α V
Define the normalized distributions:
f n =
f /
C,
f in,n = f in /Cin ,
f out,n = f out /Cout ,
where
C, Cin , and Cout are the mean concentration, and the inlet and outlet concentra-
tions, respectively.
Insertion of these definitions into Equation (3.12) and using the mass balance,
∂(V
C)
= Q in Cin − Q out Cout , (3.13)
∂t
yields
∂
f n ∂
f n 1 1 f out,n f in,n
=− −
fn − 1 − − 1 , (3.14)
∂t ∂α τin
1 τout τout
1 τin
where τ 1 are characteristic hydrodynamic times defined on a molar (or mass) basis,
and
τin1 = (V
C)/Q in Cin ,
τout
1
= (V
C)/Q out Cout .
Using standard RTD nomenclature:
f n is the normalized internal age distribution, I(α, t),
fout,n is the distribution of age in the outlet stream, E(α, t),
fin,n is the normalized distribution of age in the inlet stream, i.e. δ(α) (Dirac’s delta
function).
Consequently, Equation (3.14) may be written as follows:
∂I ∂I 1 1 E δ(α)
=− −I − 1 − − 1 . (3.15)
∂t ∂α τin1 τout τout
1 τin
Equation (3.15) is the generalized relationship between the residence time distribution,
E, and the internal age distribution, I, in the transient state for an arbitrary flow system.
For an incompressible fluid (given a constant volume),
Q in = Q out .
Assuming further steady state:
Cin = Cout
and
τin1 = τout
1
= τ 1.
34 Model formulation
τin1 = V /Q in = t Q in /Q in = t,
Consequently,
I dα = d V /V = dα/t.
3.5 Questions
(1) What are the key steps in deriving a transport phenomena model?
(2) What does a generic balance equation describe?
(3) Explain what is meant by a boundary condition, and how they can be classified.
3.6 Practice problems 35
3.1 A spherical nuclear fuel element consists of a sphere of fissionable material with
radius RF , surrounded by a spherical shell of aluminum cladding with outer radius
RC . Fission fragments with very high kinetic energies are produced inside the
fuel element. Collision between these fragments and the atoms of the fissionable
material provide the major source of thermal energy in the reactor. The volume
source of thermal energy, in the fissionable material, is assumed to be
r 2
Sn = Sn0 1 + b (J m−3 s−1 ),
RF
Figure P3.1
3.3 In the Liseberg Amusement Park in Gothenburg, there is a “fountain” where a water
film flows along the outside of a vertical pipe. Derive a model for the velocity profile
in the film:
(a) by using a shell balance approach;
(b) by simplifying the general momentum transport equation.
36 Model formulation
3.4 In making tunnels in the ground (porous material), water infiltration is a complicat-
ing factor. Assume a cylindrical tunnel (see Figure P3.2) with P1 ˃ P0 . Formulate
a model that can be used to calculate the flow into the tunnel. Assume that Darcy’s
law is valid.
Figure P3.2
3.5 Around 1850, Fick conducted experiments that convinced him of the correctness of
the diffusion equation. He dissolved salt crystals at the bottom of the experimental
setups shown in Figure P3.3. The water in the top section was continually renewed
to fix the concentration at zero. What concentration profiles did Fick obtain in the
lower section at steady conditions?
Figure P3.3
3.6 A fluid flows in the positive x-direction through a long flat duct of length L, width
W, and thickness B, where L W B (see Figure P3.4). The duct has porous walls
at y = 0 and y = B, so that a constant cross flow can be maintained, with v y = v0 .
Derive, by simplifying the general transport equation, a steady-state model for the
velocity distribution vx (y).
Figure P3.4
3.7 Consider two concentric porous spherical shells of radii κR and R (see Figure P3.5).
The inner surface of the outer shell is kept at temperature T1 and the outer surface
of the inner shell is to be maintained at a lower temperature Tκ . Dry air (mass
3.6 Practice problems 37
flow wr kg s−1 ) at temperature Tκ is blown radially from the inner shell into the
intervening space and out through the outer shell.
Develop, using a shell balance, an expression for the temperature at steady
conditions. In addition, give an expression for the rate of heat removal from the
inner sphere. Assume steady laminar flow.
Figure P3.5
3.8 A liquid (B) is flowing at laminar conditions down a vertical wall (see Figure P3.6).
For z < 0 the wall does not dissolve in the fluid, but for 0 < z < L the wall contains
a species A that is slightly soluble in B. Develop a mathematical model for the
dissolution process.
Figure P3.6
38 Model formulation
3.9 In a cookbook, a “gentle” way of preparing fish is suggested (a fish is ready when
the temperature is around 60 °C). A pan is filled with water that is boiled. The pan
is then taken from the stove and put upon a heat-insulating material. Thereafter
the piece of fish is placed into the pan and the lid is put on. State a model for the
process, assuming the following:
3.10 Develop a model for the freezing of a spherical falling water drop (see Figure P3.7).
The drop is surrounded by cool air at temperature T∞ and its initial temperature
is Ti (˃ freezing temperature T0 ). Assume no volume change in the freezing
process.
Figure P3.7
3.11 Chlorine dioxide (ClO2 ) is a common chemical for bleaching aqueous suspensions
of wood pulp. The ClO2 reacts rapidly and irreversibly with lignin, which constitutes
about 5% of the pulp; the remainder of the pulp (predominantly cellulose) is inert
with respect to ClO2 . In addition to its reaction with lignin, ClO2 also undergoes
a slow spontaneous decomposition. The bleaching process may be studied under
simplified conditions by assuming a water-filled mat of pulp fibers exposed to a
dilute aqueous solution of ClO2 (see Figure P3.8). The solution–mat interface is
at x = 0 and the thickness of the mat is taken to be infinite. As ClO2 diffuses in
and reacts, the boundary between brown (unbleached) and white (bleached) pulp
moves away from the interface, the location of that boundary being denoted by
x = δ(t). Assuming the reaction between ClO2 and lignin to be “infinitely” fast,
a sharp moving boundary is formed separating bleached and unbleached pulp.
The concentration of ClO2 at x = 0 is constant, CA0 , and the unbleached lignin
concentration is CB0 . Lignin is a component of the pulp fibers and may be regarded
as immobile. The decomposition of ClO2 is assumed to be as a first-order chemical
reaction.
3.6 Practice problems 39
Figure P3.8
3.12 Erik released two newly born rabbits on the island of Tistlarna in the archipelago
of Gothenburg during the summer. Now it is autumn, and he wonders how many
rabbits there will be in five years.
Help Erik to solve this problem, assuming that rabbits are born pair-wise (one
female and one male) and that the number of pairs follows the Fibonacci sequence:
1, 1, 2, 3, 5, 8, . . . (every number in the series is the sum of its two predecessors).
Assume further that the death frequency is given by
death frequency (age) = a · age2 − b · age + c[yr−1 ].
Develop a model, giving how many rabbits there are as a function of time, as
well as the age distribution of the rabbits. Calculate the number of rabbits after five
years by solving the discretized problem with time step 1 yr, a = 0.015, b = 0.1,
and c = 0.3.
3.13 Formulate a population balance for the number of crystals with “characteristic”
dimension (size), assuming:
r the crystallizer is operating at steady conditions and is well mixed (tank volume =
V);
r the flow rate through the reactor is constant (= Q) and the inflow contains no
crystals;
r the growth rate is v (m s−1 );
r agglomeration and breakage of crystals can be neglected.
3.14 Use the method of population balances to develop expressions for the RTDs in the
following reactor systems:
(a) ideal tank reactor with volume V, constant flow rate q, and no chemical
reaction;
(b) as in (a) but in series with an ideal tube reactor with volume V1 ;
(c) two ideal tank reactors in series (both with volume V).
4 Empirical model building
Many phenomena in engineering are very complex and we do not have sufficient knowl-
edge at the moment to develop a model from first principles; instead, we have to rely
on empirical correlations. Today most process development is done using empirical or
semi-empirical models. These models are usually accurate and very useful. The draw-
back is that they are only valid for specific equipment within an experimental domain
where the parameters are determined.
In developing a correlation, we need first to identify all the variables that may have
an influence on it. There are different approaches to finding important variables. One
approach is to formulate the governing equations even if we do not have sufficient
knowledge or computer resources to solve the equations. These equations and the corre-
sponding boundary conditions provide information about which variables are important
in formulating an empirical correlation. A second approach, used by experienced engi-
neers, is to list all variables that are believed to be important. The final correlation is
then obtained by experimenting and model fitting using experimental design to obtain
reliable results and to minimize correlations between the parameters in the model.
The recommended approach to formulating an empirical correlation is to use dimen-
sionless numbers for describing both the dependent and the independent variables. Using
dimensionless variables decreases the degrees of freedom, i.e. it decreases the number
of variables and parameters in the fitting. All terms in an equation must have the same
dimension, and a system that contains n variables involving m dimensions can be stud-
ied by varying the n − m dimensionless variables. An additional advantage of using
dimensionless variables is that correlations written in dimensionless variables are also
easier to read and cause less confusion when used.
A dimensional system consists of the selected base dimensions and the dimensions of all
involved variables. Table 4.1 contains a useful set of base dimensions; note that this set
has the potential for additional variables for the sake of convenience, e.g. the enthalpy
(in joules) is added despite the fact that it has the dimension J = kg m2 s−2 and can
be rewritten as a function of mass, length, and time. In formulating the model, we can
remove one of the dimensions in enthalpy, i.e. mass, length, or time, and replace it with
enthalpy to keep the base dimension at a minimum. In addition to the base dimensions
4.2 Dimensionless equations 41
Length L m
Mass M kg
Time t s
Temperature T K
Enthalpy H J
Amount of species N mole
in Table 4.1, there are several more variables that can be selected as base dimensions if
required, e.g. electric cur rent (ampere) and magnetic field (gauss).
The dimensions of all variables can then be written as functions of the base variables
in Table 4.1, as seen in Table 4.2. Depending on the selection of base dimensions, the
dimension can be written in different forms.
As pressure is not an explicit variable in the momentum equation, the continuity equation
is often rewritten by combining momentum balance and the continuity equation. For
constant viscosity and density, the continuity equation can be replaced by the Poisson
equation:
Pa kg
∇ p = −∇ · ρv · ∇v
2
= 3 2 . (4.3)
m2 m s
Rewriting the governing equations in the dimensionless form simplifies the estimation
of the behavior of processes on different scales. Since all terms in the equations have
the same dimensions, we can obtain a dimensionless equation by dividing the terms in
the equations by any of the other terms. However, dividing by the term that we assume
is the most important will simplify the analysis. In many cases, the convective term is
the dominating term. The tables in Appendix B show how the dimensionless variables
are formed from momentum, heat, and mass balances.
All variables must be scaled with a variable characteristic of the process. The char-
acteristic velocity U may be the average inlet velocity. The characteristic length L may
be the tube diameter, the reactor length, or the catalyst particle diameter, depending on
the processes involved. Time may be scaled with residence time or the time constant for
diffusion.
Throughout the book we will be using ˆ to denote dimensionless variables, and we
will obtain
x U D
x̂ = and tˆ = t or tˆ = t 2 . (4.6)
L L L
4.2 Dimensionless equations 43
Concentration is usually scaled with the total or inlet concentrations. The characteristic
temperature may be inlet temperature, but it is often scaled with the minimum and
maximum temperatures to obtain a dimensionless variable between 0 and 1:
C T − Tmin T − Tmin
Ĉ = and T̂ = = . (4.7)
CT O T Tmax − Tmin T
Gravity is important for buoyancy, and the maximal force caused by gravity due to the
difference in density is a suitable characteristic variable:
G
Ĝ = . (4.8)
ρ g
The additional dimensionless dependent variables are formed from the characteristic
velocity and the pressure difference over the system:
v (x, t ) p (x, t )
v̂ (x̂, tˆ) = , p̂ (x̂, tˆ) = . (4.9)
U p
The Reynolds, Euler, Froude, and Péclet numbers,
ρU L p gLρ UL UL
Re = , Eu = , Fr = , Pe H = , Pe D = ,
μ ρU 2 ρU 2 α D
are dimensionless numbers that are most often used in formulating the transport equa-
tions, Equations (4.1)–(4.5), in the dimensionless form. The Péclet number for heat con-
duction, Pe H = U L/α , with thermal diffusion α = k/ρ c P , has a cor responding Péclet
number for diffusion, Pe D = U L/ D . It is often convenient to separate the dimensionless
variables into variables that describe the properties of a flow and a fluid. The Prandtl and
Schmidt numbers are useful dimensionless variables that describe the fluid properties
heat conduction and diffusion, respectively:
cpμ μ
Pr = and Sc = . (4.10)
k ρD
Note that the Péclet number can also be formulated as a product of the Reynolds number,
i.e.
Momentum balance
∂ v̂ 1 2 1 1
+ v̂ · ∇ v̂ = ∇ v̂ + Ĝ − ∇ p̂. (4.12)
∂t ˆ Re Fr Eu
Equation of continuity
1
∇ 2 p̂ = − ∇ · v̂ · ∇ v̂. (4.13)
Eu
44 Empirical model building
Heat balance
∂ T̂ 1
+ v̂ · ∇ T̂ = ∇ 2 T̂ . (4.14)
∂ tˆ Pe H
Species balance
∂ Ĉ 1
+ v̂ · ∇ Ĉ = ∇ 2 Ĉ. (4.15)
∂ tˆ Pe D
between the bulk temperature and the surface temperature, i.e. T = Tb − Tw . Time is
not relevant here, but is discussed in Section 5.1.5. The governing equations and the
characteristic dimensions are written in the following using particle diameter as the
characteristic length L = d .
The film theory describes heat transfer to the surface. The heat flux modeled using
the heat transfer coefficient is balanced with the flux into the solid sphere:
dT J
q = h(Tb − Tw ) = k . (4.20)
dr r = R m2 s
Removing the transient part from Equations (4.12)–(4.14) gives the remaining
equations.
Momentum balance
1 2 1 1
v̂ · ∇ v̂ = ∇ v̂ + Ĝ − ∇ p̂. (4.22)
Re Fr Eu
Equation of continuity
1
∇ 2 p̂ = − ∇ v̂ · ∇ v̂. (4.23)
Eu
Heat balance
1
v̂ · ∇ T̂ = ∇ 2 T̂ . (4.24)
Pe H
46 Empirical model building
The parameters bi , αi , and βi are determined from experimental data. One common
cor relation is the Frössling/Ranz–Marshall cor relation,
The dimensionless form is also suitable for developing models or correlations that
have a less theoretical basis and cannot be deduced from simple balance equations. The
advantage of using dimensionless variables is that, if there are any n variables containing
m primary dimensions, the correlation can be formulated using n − m dimensionless
groups. However, we need experience or some preliminary experiments to identify the
variables that are important.
To illustrate this method, we will use Example 4.1 with heat transfer to a particle or a
wall. Fluid solid heat transfer can be modeled as in Equation (4.20) as follows:
dT
q = h (Tb − Tw ) = k . (4.20)
dr r = R
The objective is to develop a model that can predict the heat transfer coefficient h
or the Nusselt number. Equation (4.20) says nothing about the heat transfer coefficient
h, and we need to conduct experiments to develop a model of heat flux that includes
convection, heat conduction, viscosity, heat capacity, etc., so that we can predict the
4.3 Empirical models 47
Length L=l m
Mass M = ρl3 kg
Time t = ρl2 μ−1 s
Temperature T = T K
Enthalpy H = kl3 ρμ−1 T J
Nusselt number. In formulating a general correlation, we can list all variables that we
believe will affect heat transfer:
q = f (k, T, U, l, ρ, μ, c p , βg). (4.27)
These n variables have dimensions in length L (m), mass M (kg), time t (s), temperature
T (K), and enthalpy H (J). The variables with their dimensions are listed in Table 4.3.
In contrast to Example 4.1, we allow free convection, and an additional variable βg
describes the effect of gravity on free convection. The thermal expansion coefficient β
describes how fluid density changes with temperature, e.g. for an ideal gas β = 1/T . A
correlation for heat transfer should include these variables in a dimensional consistent
form.
The dimensionless variables can be found by selecting m variables as a recurring
set. These variables should contain the different variables that form a complete set
of dimensions, i.e. it should not be possible to formulate a dimensionless variable
by combining the variables in the recurring set. Here we will select l, ρ, μ, T, k as
the recurring set. They are listed with their dimensions in Table 4.4. The selection of
variables is not critical, and other combinations of variables containing length, mass,
time, temperature, and enthalpy that could form the recurring set of variables are possible.
Selecting l, ρ, μ, T, k as the recurring set leaves the n − m variables q, U, βg, c p as
the non-recurring variables. Using the dimensions in Table 4.4, the dimensional variables
are then identified as functions of the recurring variables. The non-recurring variables
q [J m−2 s−1 ], U [m s−1 ], cp [J kg K−1 ], and βg [m s−2 K−1 ] can be reformulated into
dimensionless variables, e.g. q [J m−2 s−1 ] can be made dimensionless by dividing by
enthalpy H (J) and multiplying by length (L2 ) and time (t). After replacing H, L, and t
by the variables in Table 4.4 and q by hT, we obtain
qL2 t q(l 2 )(ρl 2 /μ) ql h hl
1 = = = = = N u,
H (kl ρT /μ)
3 kT h k
U Uρl
2 = = = Re,
Lt μ
(4.28)
c p MT cpμ
3 = = = Pr,
H k
βgt2 T βgTρ 2l 3
4 = = = Gr.
L μ2
48 Empirical model building
The use of as the symbol for dimensionless variables was introduced by Bucking-
ham, and this method has been called Buckingham’s theorem since then. This is a
very general and useful method, but it will not guarantee the most physical meaningful
correlation.
According to Equation (4.27), heat flux should be a function of the remaining variables,
which allows us to write the dimensionless heat flux as a function of the remaining
dimensionless numbers:
1 = f (2 , 3 , 4 ) or N u = f (Re, Pr, Gr ). (4.29)
The dimensionless analysis tells us nothing about the correlation; it only reveals which
variables are involved. The final correlations can be formulated in many different ways.
An empirical model for heat transfer may be formulated as
N u = b0 + b1 Reα1 Pr β1 Gr γ1 + b2 Reα2 Pr β2 Gr γ2 + · · · , (4.30)
and the parameters bi , α i , β i , and γ i can be fitted from measurements. The dimension-
less number Gr includes the effect of buoyancy. For heat transfer to a sphere in Exam-
ple 4.1, with no buoyancy, the following empirical model has been found, as shown
previously:
N u = 2 + 0.6Re1/2 Pr 1/3 ; (4.26)
for free convection on a vertical wall,
0.67Ra 1/4
N u = 0.68 + , (4.31)
[1 + (0.492/Pr )9/16 ]4/9
where Ra = Gr · Pr.
4.4 Scaling up
on a small scale to develop models that are scale independent and can be used for
designing the full-scale equipment. In scaling down, we already have the large-scale
equipment that we want to optimize for a new process. In such a case, we want to know
how to design and run a pilot plant to mimic the behavior of a large-scale plant in order to
find the optimal conditions for it. In scaling out, we build a large-scale plant by putting
the small-scale equipment in parallel. We then expect to obtain the same conditions
in the large scale as in the small scale. This can be done by, e.g., using small tubular
reactors in parallel instead of building a large tubular reactor. The scaling-up problem
is then limited to obtaining the same flow rate in all tubes and sufficient heat control of
the tube bundle to keep the temperature equal.
The fundamental principle in scaling models is to keep all dimensionless variables
constant. The dimensionless equations, e.g. Equations (4.12)–(4.15), are scale indepen-
dent, and keeping Re, Pr, Eu, and Fr numbers constant results in dimensionless variables
v̂, Ĝ, p̂, T̂ , and Ĉ versus tˆ that is the same at all scales. In the simplest case, scaling with
a constant Re, i.e. an increase in length scale by a factor of 10, requires that the charac-
teristic velocity decreases by a factor of 10. As a result, assuming no density difference,
i.e. Fr = 0, Eu will be constant and the pressure drop is scaled with ρU 2 . Keeping Re
and Pr constant should also result in the same dimensionless heat transfer coefficient,
i.e. the Nusselt number, as obtained in the dimensionless correlations in Example 4.1.
For free convection problems, the Froude number must also be kept constant. Since
we cannot change gravity, the density change with temperature and ρ/ρ must be
increased. This might be very difficult while keeping Re and Pr constant.
More complex phenomena require keeping more dimensionless variables constant.
A more complete heat flux balance will contain more terms, and consequently more
dimensionless variables must be kept constant:
1 2 1 Nu eσ T 3 L
v̂ · ∇ T̂ = ∇ T̂ + r̂A + T̂ + T̂ . (4.33)
Pe Da I I I Re Pr ρc p U
In addition to the dimensionless variables for flow, Re, Fr, and Eu, we also need to keep
Pe, Nu, DaIII , and eσ T 3 L/ρc p U constant to obtain the same dimensionless predicted
conditions, i.e. Re = ρU L/μ, Pr = μ/ρα, Eu = p/ρU 2 , Fr = gLρ/ρU 2 , Pe =
ρc p U L/k, N u = h L/k, Da I I I = rA LH /ρc p U T , and eσ T 3 L/ρc p U should be
kept constant.
We quickly reach a level of complexity that makes it impossible to keep all dimen-
sionless variables constant. Using correlations developed on a small scale to predict the
behavior on the large scale may not be a good solution, because empirical correlations
are only correlations and as such are only valid within the range of experiments that
form the basis for the correlations. As not all the dimensionless variables could be kept
constant on all scales in our example, no experimental data from the small scale are
50 Empirical model building
valid for the large scale. Even if the correlations are written in the dimensionless form,
this limitation must be kept in mind.
The next part of the procedure is to identify the rate-determining step, and to determine
which conditions should be scale similar. All the dimensionless variables may not be
important. There are no general methods for finding the rate-determining steps, and a
genuine understanding of the actual processes is needed. Detailed knowledge of specific
processes is beyond the scope of this book. However, the example below will illustrate
this approach.
In a slow chemical reaction, the flow circulation time in the reactor is on the same
time scale as the chemical reaction time, which will lead to variations in concentration
within the reactor. Scaling up with constant circulation times would be a proper
scaling-up rule. However, the flow must be turbulent in both cases, or the mixing time
will increase by several orders of magnitude.
The pumping capacity of an impeller is proportional to the impeller tip speed
N · π · d and the swept area of the impeller tip π · d · h. Here, N is the impeller speed,
d is the impeller diameter, and h is the height of the impeller blades. Assuming that the
impeller blades scale with the reactor size, D, we can assume that dD and hD are
constant on all scales, and consequently the pumping rate is given by
and, following the scaling-up rule with a constant pumping rate per volume reactor,
circulation time is given by
3
3
D D 1 1
τcirc ∝ 3
= 3
or τcirc ∝ = . (4.35)
ND large ND small N large N small
This scaling rule indicates that the impeller speed should be kept constant. However,
the energy input from the impeller scales with N3 D5 , as shown in Practice problem 4.3,
and at constant impeller speed the required power input scales as (Dlarge /Dsmall )5 . An
increase by a factor of 10 in linear dimension will require an increase by a factor of 105
in power input. This is usually not possible to obtain, and a larger variation in
concentration will occur on the large scale.
Fast chemical reactions are affected by the mixing on the smallest scale. The
turbulent properties together with the kinetics determine the outcome. The turbulence
is generated by the impeller, but turbulence is also dissipated much faster in the
impeller region. This will lead to two very different regions in the reactor: the impeller
region with very fast mixing and reaction, and the remaining volume with very slow
mixing and reaction.
The mixing time for fast reactions scales with the lifetime of the turbulent eddies
√
kε or, for more viscous, fluids as ν/ε, where k is the turbulent kinetic energy, ε is
the rate of dissipation, and ν is the kinematic viscosity. The kinetic energy scales as the
impeller tip speed squared, i.e. k ∝ (ND)2 , and the dissipation scales as power input per
volume, ε ∝ P/V ∝ N 3 D 5 /D 3 = N 3 D 2 . The micromixing time is then estimated as
k N 2 D2 1 ν
τmicro ∝ ∝ 3 2 = or τmicro ∝ ∝ N −3/2 D −1 . (4.36)
ε N D N ε
Keeping kε constant requires the same impeller speed on all scales, and
consequently we obtain the same problem with power input as for constant circulation
time. Constant ε requires that when size D increases, the impeller speed should
decrease as
Dsmall 2/3
Nlarge = Nsmall . (4.37)
Dlarge
52 Empirical model building
Here we have assumed that the turbulent kinetic energy and the dissipation rate are
the same throughout the whole reactor. However, stir red tank reactors are very
heterogeneous, with much higher kinetic energy and a higher dissipation rate in the
impeller region than in the rest of the tank. This makes stir red tank reactors very
difficult to scale-up. Reactors containing packed beds, metal foams, or static mixers are
much easier to scale-up since the flow, mass transfer, and reactions are much more
similar on the small and large scales.
4.1 The Ergun equation for pressure drop in porous beds is given by
P 1
= −AμU − B ρU 2 , (4.38)
L 2
with
150(1 − α )2 1.75(1 − α )
A= and B= ,
d 2p α 3 d p α3
where α is the void fraction.
Show that the pressure drop can be written in the form
Eu = b0 + b1 Reβ1 + b2 Reβ2 .
4.2 Derive an expression for the Sherwood number as a function of Re and Sc using
Equations (4.12), (4.13), and (4.15), and suitable boundary conditions.
4.3 The power input per unit volume in a stirred tank reactor depends on liquid density,
the impeller diameter, and speed, i.e. P = f (ρ, D, N ). Write a dimensionless
relation between power input and these variables. Assume that the impeller and tank
size have a constant ratio, and only one characteristic length, the impeller diameter
D, is needed.
4.4 In boiling, the heat transfer coefficient h [W m−2 K−1 ] depends on the heat flux q [W
m−2 ], thermal conductivity k [W m−1 K−1 ], latent heat of vaporization λ [J kg−1 ],
viscosity μ [kg m−1 s−1 ], surface tension σ [J m−2 ], pressure, P [N m−2 ], bubble
diameter d [m], liquid density ρ [kg m−3 ], and the density difference between liquid
and vapor ρ [kg m−3 ]:
h = f (q, k, λ, μ, σ, P, d, ρ, ρ).
Formulate a model for the heat transfer coefficient (Nusselt number) with the
minimum number of dimensionless variables.
5 Strategies for simplifying
mathematical models
A mathematical model can never give an exact description of the real world, and the
basic concept in all engineering modeling is, “All models are wrong – some models are
useful.” Reformulating or simplifying the models is not tampering with the truth. You
are always allowed to change the models, as long as the results are within an acceptable
range. It is the objective of the modeling that determines the required accuracy: Is it a
conceptual study limited to order of magnitude estimations? Or is it design modeling in
which you will add 10–25% to the required size in order to allow for inaccuracies in the
models and future increase in production? Or is it an academic research work that you
will publish with as accurate simulations as possible?
A simulation may contain both errors and uncertainties. An error is defined as a
recognizable deficiency that is not due to lack of knowledge, and an uncertainty is a
potential deficiency that is due to lack of knowledge. All simulations must be validated
and verified in order to avoid errors and uncertainties. Validation and verification are two
important concepts in dealing with errors and uncertainties. Validation means making
sure that the model describes the real world correctly, and verification is a procedure to
ensure that the model has been solved in a correct way.
Poor simulation results are due to many different reasons:
r errors in formulating the problem;
r inaccurate models;
r inaccurate data on the physical properties;
r numerical errors due to the choice of numerical methods;
r lack of convergence in the simulations.
It is always recommended that you do simple by-hand calculations to define the properties
of the system prior to formulating the final model. The objective of this chapter is to
present strategies for simplifying given mathematical models and for reducing the models
already in the formulation.
Many models in chemical engineering are derived from four basic balance equations,
as seen in Chapter 4, but now we have also included the source terms for chemical
reactions and heat formation.
Material balance
∂ CA
+ v · ∇CA = ∇ · DA ∇CA − RA . (5.1)
∂t
54 Strategies for simplifying mathematical models
Heat balance
∂T
ρc p + v · ∇T = ∇ · k∇ T + Q. (5.2)
∂t
Momentum balance
∂v
ρ + v · ∇v = μ ∇ 2 v + ρ G − ∇ p. (5.3)
∂t
Equation of continuity
∂ρ
= −[∇ (ρ v)], (5.4)
∂t
Equations (5.1)–(5.4) describe many systems in chemical engineering. But the equations
do not contain the true nature of the real world; they are merely convenient mathematical
approximations of our models of the real world.
These complex mathematical models are in many cases difficult to solve. A very
good work station is necessary for solving 3D flows in a reactor with an exothermic
chemical reaction. If we want to solve the equations for a heterogeneous system, a
computer cluster is required that can give a solution within a reasonable time. Yet in
many cases the equations can be reduced without losing too much accuracy. In some
cases, an even better numerical precision can be reached. The following list covers some
of the most commonly used methods for reducing the computational efforts for solving
mathematical equations.
r decoupling equations;
r reducing the number of independent variables;
r averaging over time or space, “lumping”;
r simplifying geometry;
r separating equations into steady state and transient;
r linearizing;
r solving for limiting cases;
r neglecting terms;
r changing boundary conditions.
5.1 Reducing mathematical models 55
Geometrical symmetry requires that the boundary conditions as well as the equations
are symmetrical. Problems including gravity can only be symmetrical in a cylinder
with gravity in the axial direction. Reduction to a 1D or 2D problem may also change
the physical appearance, e.g. bubbles do not exist in axisymmetric 2D except on the
symmetry axis; they become toroid in 3D elsewhere. A toroid bubble moving in a radial
direction must alter the diameter to maintain the volume, and the forces around the
bubble will be unphysical.
Symmetry boundary conditions should be used with care. The outflow across a sym-
metry boundary is balanced by an identical inflow, which means that the net transport
will be zero. Transport along the boundary is allowed, but no transport across the bound-
ary will occur. It is not sufficient for a conclusive result that the differential equations
and the boundary conditions are symmetrical; the symmetrical solution may be only one
of many possible solutions.
5.1.3 Lumping
Using the average over one dimension or over a volume, i.e. lumping, may reduce the
complexity of a problem. This will reduce partial differential equations to ordinary
differential equations or algebraic equations. Separation processes are often modeled
as equilibrium stages, as shown in Figure 2.1. Very complex flow and mass transfer
conditions are lumped together into an ideal equilibrium stage with an efficiency factor
to compensate for the non-ideal behavior. A second frequently used simplification is
transforming a tubular reactor with axial and radial dispersion to tank reactors in series
by assuming negligible variations in the radial direction and over a short axial distance.
Tanks in series may also be viewed as an implicit numerical solution of a model for
a tubular reactor. Implicit numerical methods are, in general, more stable than explicit
methods, and the tanks-in-series model can also be chosen for numerical stability reasons.
Figure 5.2. Simplified geometry. When only the outer part of a complex body is active, the body
may be simplified to a slab.
Figure 5.3. Time constants for diffusion in a slab with different boundary conditions. (a) No flux
at ẑ = 1; (b) ŷ (tˆ, ∞) = 0.
ŷ (0, ẑ ) = 0,
describe a step change at the boundary from 0 to 1, and Equation (5.6) has the solution
∞
ẑ − 2i 2i + 2 − ẑ
ŷ (tˆ, ẑ ) = i
(−1) erfc √ + erfc √ . (5.7)
i=0 2 tˆ 2 tˆ
From Figure 5.3(a) we can see that steady state at ŷ = 1 is reached when tˆ 1,
i.e. tˆ = Dt/ L 2 1 or t L 2 / D . It is also very convenient to define dimensionless
time as tˆ = t/τ using the time constants τ = L 2 / D, τ = ρ c p L 2 /λ, and τ = ρ L 2 /μ
for diffusion, heat conduction, and the viscous transport of momentum, respectively.
In Figure 5.3(a), ŷ is close to 1 when tˆ = 1, and in this case we can, with reasonable
confidence, assume steady state when t > τ .
Information about how far the species will penetrate as a function of time is obtained
by changing the boundary condition at ẑ = 1 for Equation (5.6) to ŷ (tˆ, ∞) = 0. This
boundary condition gives the solution
ẑ
ŷ(tˆ, ẑ) = 1 − erf √ . (5.8)
2 tˆ
√
The result is shown in√ Figure 5.3(b). As ŷ depends √ only on ẑ/ 4tˆ, √
there is a linear
ˆ
relation between ẑ and t at constant √ ŷ, and putting ẑ/ t = 1, i.e. z = Dt, will yield
ˆ
a constant value of ŷ = 0.48, and ẑ/2 tˆ = 1 results in ŷ = 0.16. We can then estimate
how far into a fluid a species has reached by diffusion after a certain time, e.g. the
concentration of a species 1 mm into a fluid has reached 0.48 of the boundary condition
after 1000 s with a liquid diffusivity of 10−9 m−2 s−1 . Using dimensionless time tˆ = t/τ
and the time constants τ = ρc p L 2 /λ or τ = ρ L 2 /μ, we can calculate heat transport and
the viscous transport of momentum, respectively.
60 Strategies for simplifying mathematical models
Time constants are discussed further in the case study given in Section 5.2.3.
∂T ∂2T ∂T
ρm c pm = λea 2 − vρ c p − k (T, t )(−H ) · C n , (5.10)
∂t ∂x ∂x
where ρ m and cpm denote the weighted mean density and the heat capacity of the solid
catalyst and the fluid, respectively, and Dea and λea denote the effective axial dispersion
for axial mass and heat transport, respectively. Catalyst deactivation may be written as
a decrease in the rate constant, which is often a function of temperature:
dk(T, t)
= f (k, T ). (5.11)
dt
When calculating the instantaneous outlet concentrations due to fast variations in
inlet concentrations, the temperature and the catalyst activity do not change, and only
Equation (5.9) is needed if the temperature and the catalyst activity are known. When
solving for bed temperature on the minutes scale, the catalyst activity can be assumed
constant and the species can be assumed to be at steady state. Setting the activity
constant means that the time derivative in Equation (5.11) is zero, and setting the
right-hand side in the species balance to zero means that the species are at steady state
and the accumulation term in the material balance can be omitted. Note the difference
in the equations when the right-hand side is zero and when the left-hand side is zero.
When the right-hand side is zero, the time derivative is zero, and nothing will change in
time; when the left-hand side is zero, we assume negligible accumulation, and the
dependent variable will immediately reach its steady-state value.
The time for reaching steady state for a process with stationary boundary conditions
is estimated using the time constants. We can estimate the importance of the
5.1 Reducing mathematical models 61
accumulation term in Equation (5.9) by comparing the accumulation term with the
dominating terms in the equation, i.e. convection or reaction. For simplicity, we can
choose convection. We want to estimate how long it will take to reach steady state. At
that time, the accumulation of species should be negligible:
∂C ∂C
v .
∂t ∂x
Approximate
∂C C C ∂C C C
≈ ≈− and ≈ ≈− .
∂t t τ ∂x x L
The preceding condition will result in
C C L
v or τ .
τ L v
The same discussion for Equation (5.10) yields
T T ρm c pm L
ρm c pm vρc p or τ .
τ L ρc p v
Steady state for concentration is reached when τ L/v, and for temperature when
τ ρm c pm L/ρc p v. For gas-phase reactions, the heat capacity of the bed is much
larger than the heat capacity for the gas, i.e. ρm c pm ρc p , and the time constant for
heat is much larger than the time constant for species. The densities of liquids and
solids are more equal, and the difference between the time constants for species and
heat is
less.
An analysis of the time constant reveals that the first approximation, that change in
concentration is much faster than change in temperature, may be a correct assumption
for gas flow, but this is questionable for liquid flow due to the difference in heat
capacity.
5.1.6 Linearizing
Linear equations are much easier to solve. Many problems that describe laminar flow
or diffusion in simple geometry can be solved analytically if the mathematical model
is linear. In many cases, the equations are basically linear, but small temperature- and
concentration-dependent parameters, e.g. viscosity, density, and diffusivity, make the
equations non-linear. A small non-linearity may have a minor influence on the accuracy
and speed of a numerical solution, but it prevents an analytical solution. Assuming
constant parameters over a volume and solving the equations analytically, and later
iterating the solution with varying parameters, may be a very effective way of solving
difficult equations. Even very simple linear approximations of the true model are useful
for estimating order of magnitude.
62 Strategies for simplifying mathematical models
and by evaluating the omitted terms it is possible to determine whether the linearization
is an over- or an underestimation.
g
ω(t) = ω0 cos t , ω 1. (5.17)
L
The omitted term ω3 /3! has the opposite sign to ω, and the forces on the right-hand
side will be overestimated using Taylor linearization. The positive third term will
5.1 Reducing mathematical models 63
hardly ever have an effect because the maximum angle is π due to the physics of the
pendulum.
The first approximation gives a velocity that is too high after a long period of time,
and the second gives a velocity that is too high after a short period of time. A
combination of Equations (5.21) and (5.24), using the first one until the terminal
velocity is reached and using the terminal velocity after that, will give a good
64 Strategies for simplifying mathematical models
approximation. However, the solution still overestimates the velocities and the distance
the body has fallen, as shown in Figure 5.4.
Figure 5.5. Approximate concentration profiles (solid lines) in the tubular reactor at different
residence times or rate constants, simulated without the axial dispersion term. The dashed lines
indicate slopes of 0.1, 1, and 10, respectively.
Ĉ = 1 at ẑ = 0
and
d Ĉ
= 0 at ẑ = 1.
d ẑ
First we need an order-of-magnitude estimation of the derivatives. A preliminary
assumption is that the concentration profile has a shape as shown in Figure 5.5, i.e. the
outlet concentration is much lower than the inlet concentration, but not zero. This
assumption must be verified against the final model.
A coarse estimation of the derivatives is for the first-order derivative
dC C 0 − CIN CIN
≈ = =− , (5.27)
dz z L −0 L
66 Strategies for simplifying mathematical models
dC dC C C C IN
− − 0 − −
d2 C dz z+dz dz z z L z 0 L CIN
≈ ≈ = = , (5.29)
dz 2 dz L L L2
in the dimensionless form
Ĉ Ĉ
−
d 2 Ĉ ẑ ẑ 0 − (−1)
≈ 1 0
= = 1, (5.30)
d ẑ 2 1 1
using the boundary condition d Ĉ/d ẑ = 0 at ẑ = 1.
We can now make an order-of-magnitude estimation of the relative importance of
the different terms in (5.26), repeated here for convenience:
1 d 2 Ĉ d Ĉ
− − k Ĉτ = 0 (5.26)
Pe d ẑ 2 d ẑ
1
1 kτ
Pe
The axial dispersion term can be neglected when it is small in comparison with the
largest terms in the model, i.e.
1
1 ≈ kτ. (5.31)
Pe
It follows from the transport equation (5.26) that kτ ≈ 1 if the axial dispersion can
be neglected. If this criterion is fulfilled, Equation (5.26) can be approximated by
d Ĉ
= −k Ĉτ. (5.32)
d ẑ
This is a first-order ordinary differential equation. For this type of equation, we need
only one boundary condition. In this case, the inlet condition Ĉ = 1 at ẑ = 0 is the
most important.
The solution of Equation (5.32) is
Ĉ = e−kτ ẑ . (5.33)
An analysis of the validity of the approximations is always necessary, and the first
and second derivatives are calculated by differentiating Equation (5.33) to obtain
d Ĉ
= −kτ e−kτ ẑ (5.34)
d ẑ
and
d 2 Ĉ
= k 2 τ 2 e−kτ ẑ . (5.35)
d ẑ 2
5.1 Reducing mathematical models 67
Example 5.6 Boundary condition for a tubular reactor with axial dispersion
This scenario has been discussed for more than 50 years. The condition
dC
= 0 at z = L
dz
is under dispute because it introduces a feedback of information from the end of the
reactor that does not occur in real reactors. A more realistic formulation for an
irreversible reaction is perhaps
C → 0 when z → ∞.
68 Strategies for simplifying mathematical models
5.2 Case study: Modeling flow, heat, and reaction in a tubular reactor
The methods listed in Sections 5.1.1–5.1.7 are illustrated by a tubular reactor with a
first-order reaction and laminar flow. Models for species, heat, and momentum have
been formulated and simplified. In addition to showing the methods, we discuss the
assumptions in a traditional 1D lumped-parameter model for a tubular reactor with axial
dispersion,
∂C ∂ 2C ∂C
= Dea 2 − v − kn (T, t) · C n , (5.36)
∂t ∂z ∂z
∂T ∂2T ∂T
ρm cm = λea 2 − vρc p − kn (T, t)(−H ) · C n . (5.37)
∂t ∂z ∂z
Heat balance
∂T ∂T ∂T vθ ∂ T
ρc p + vz + vr +
∂t ∂z ∂r r ∂θ
1 ∂ ∂T ∂ T
2
1 ∂2T
=k r + + + QA. (5.39)
r ∂r ∂r ∂ z2 r 2 ∂θ 2
5.2 Case study: Modeling flow, heat, and reaction in a tubular reactor 69
∂ vr ∂ vr ∂ vr vθ ∂ vr v2
ρ + vr + vz + − θ
∂t ∂r ∂z r ∂θ r
∂ 1 ∂ ∂ 2 vr 1 ∂ 2 vz 2 ∂vz ∂p
=μ (r vr ) + + − + ρ Gr − ; (5.41)
∂r r ∂r ∂z 2 r ∂θ
2 2 r ∂θ ∂r
∂ vθ ∂ vθ ∂ vθ vθ ∂ vθ vr vθ
ρ + vr + vz + −
∂t ∂r ∂z r ∂θ r
∂ 1 ∂ ∂ vθ
2
1 ∂ 2 vz 2 ∂vz 1∂ p
=μ (r vθ ) + + 2 + + ρ Gθ − . (5.42)
∂r r ∂r ∂ z2 r ∂θ 2 r ∂θ r ∂θ
Equation of continuity
∂ρ 1 ∂ 1 ∂ ∂
+ (ρ r vr ) + (ρvθ ) + (ρ vz ) = 0. (5.43)
∂t r ∂r r ∂θ ∂z
With no variation in tangential direction, the balance equation for tangential momen-
tum, Equation (5.42), and the θ dependence in the remaining Equations (5.38)–(5.43)
should be removed.
Radial velocity will occur due to the inlet velocity, which has not taken the final
parabolic form. A general rule of thumb is that the variation in radial velocity that arises
from an uneven inlet can be neglected in a pipe after an inlet distance of δ , estimated
from the pipe diameter and the Reynolds number:
δ
= 0.05 Re.
d
Radial diffusion
∂ CA /∂ t CA /t CA /τ
≈
≈ .
1 ∂ ∂ CA 1 C DCA / R 2
D r D R 2
r ∂r ∂r R r
Table 5.2. Time constants of a 0.1 m s−1 gas and liquid flow in a 10 m tubular reactor with two different
tube diameters, R
diffusivity and heat conduction. The very low diffusivity in liquids is, to some extent,
compensated for in the table by a much smaller tube radius.
With a step response at the inlet and no external time-dependent influence, the reactor
will reach steady state after the largest of the time constants. The much larger time
constants for the radial diffusion (R2 D) than for the residence time (Lv), indicate that
the concentration will vary radially within the whole reactor if the inflow does not have
equal concentration over the cross section.
In this case study we assume a constant even flow and concentration at the inlet
and only consider steady state. However, the concentration will have a radial variation
downstream due to the reaction and the radial difference in residence time. Assuming
an even inflow and a minor effect of gravity in the radial and tangential directions, the
convective radial transport terms can be removed. Axial viscous transport, diffusion,
and conduction can also be neglected because the convective axial transport is much
larger. After a sufficiently long period of time with no change in flow, the transient terms
become very small, and we obtain a model with steady axial convection, radial diffusion,
and conduction with a reaction source term.
Material balance
∂ CA 1 ∂ ∂ CA
vz = D r − RA . (5.44)
∂z r ∂r ∂r
Heat balance
∂T 1 ∂ ∂T
ρc p vz =k r + QA. (5.45)
∂z r ∂r ∂r
Momentum balance
∂ vz 1 ∂ ∂ vz ∂p
ρ vz =μ r + ρ Gz − . (5.46)
∂z r ∂r ∂r ∂z
Equation of continuity
∂
(ρ vz ) = 0. (5.47)
∂z
72 Strategies for simplifying mathematical models
1 ∂ ∂vz ∂p
μ r = − ρ G z = constant. (5.48)
r ∂r ∂r ∂z
∂ p R2 r2 r2
vz (r ) = ρ G z − 1 − 2 = 2 vav 1 − 2 , (5.49)
∂z 4μ R R
where vav denotes the average velocity in the pipe. As expected, we obtain the parabolic
velocity profile for laminar flow in a circular pipe.
r 2 ∂ CA 1 ∂ ∂ CA
2 vav 1 − 2 =D r − RA ; (5.50)
R ∂z r ∂r ∂r
r2 ∂ T 1 ∂ ∂T
ρ c p 2 vav 1 − 2 =k r + QA. (5.51)
R ∂z r ∂r ∂r
∂ CA LD 1 ∂ ∂ CA L
2 1 − r̂ 2 = 2 r̂ − · RA ; (5.52)
∂ ẑ R vav r̂ ∂ r̂ ∂ r̂ vav
∂T L ·k 1 ∂ ∂T L
2 1 − r̂ 2 = 2 r̂ + · QA. (5.53)
∂ ẑ R vav ρ c p r̂ ∂ r̂ ∂ r̂ vav ρ c p
In order to obtain ordinary differential equations, we must eliminate one space coor-
dinate. There are several possibilities for doing this: we can calculate an average by
integrating over the radial or axial coordinates; we can find simple polynomials that can
approximate the radial concentration and temperature dependencies; or we can assume
that the radial coupling is negligible.
The simplest solution is to use the radial average, as we assume that the axial variations
are much larger than the radial variations.
First, we integrate radially (this mean to integrate over a thin circular slice 2π r dr,
which in the dimensionless form is 2π r̂ d r̂ ). The integration of the radial transport term
5.2 Case study: Modeling flow, heat, and reaction in a tubular reactor 73
is straightforward because
1
d dy dy dy dy
r̂ d r̂ = r̂ − r̂ = r̂
d r̂ d r̂ d r̂ r̂ =1 d r̂ r̂ =0 d r̂ r̂ =1
0
and
1 1
∂ CA L D ∂ CA L
2 1 − r̂ 2
2π r̂ d r̂ = 2π 2 − RA 2π r̂ d r̂ , (5.54)
∂ ẑ R vav ∂ r̂ r̂ =1 vav
0 0
1
∂T Lk ∂ T
2 1 − r̂ 2
2π r̂ d r̂ = 2π 2
∂ ẑ R vav ρ c p ∂ r̂ r̂ =1
0
1
L
+ Q A 2π r̂ d r̂ . (5.55)
vav ρ c p
0
1
2vav ( 1 − r̂ 2 ) CA (ẑ, r̂ ) 2π r̂ d r̂
0
C A · vav =
1
2π r̂ d r̂
0
1
= 2vav 1 − r̂ 2 CA (ẑ, r̂ ) 2r̂ d r̂ (5.58)
0
1
T vav = 2 vav 1 − r̂ 2 T (ẑ, r̂ ) 2r̂ d r̂ . (5.59)
0
Observe that this averaging over the radius also eliminates the axial dispersion that is
caused by the parabolic velocity profile.
74 Strategies for simplifying mathematical models
Also note that the difference between the mixed-cup average and the average
C
1
CA (ẑ, r̂ ) 2π r̂ d r̂ 1
0
CA = = CA (ẑ, r̂ ) 2r̂ d r̂ (5.60)
1
2π r̂ d r̂ 0
0
over the cylinder, is due to the radial variation in velocity. If we take a sample from the
outlet to measure concentration, we will obtain more sample from the center of the pipe
due to the higher velocity in the center. If we measure concentration spectrometrically,
we will have equal contribution from all parts, ir respective of velocity. Usually it is the
mixed-cup average we need as it is related to the total amount converted in the reactor.
The final integrals on the right-hand side of Equations (5.54) and (5.55) are approxi-
mated by
1
L L
2 RA (CA , T ) r̂ d r̂ ≈ RA (C A , T ), (5.61)
vav vav
0
1
L L
2 Q A r̂ d r̂ ≈ Q A (C A , T ), (5.62)
vav ρ c p vav ρ c p
0
i.e. the average of the reaction rate is approximated by the reaction rate at averaged
concentration and temperature.
We now have two coupled ordinary differential equations:
dC L
=− RA (C A , T ), (5.63)
d ẑ vav
dT Lu L
=2 (Tw − T ) + Q A (C A , T ). (5.64)
d ẑ R vav ρ c p vav ρ c p
However, comparing the heat flux through the wall, we have
u(Tw − Tx=1 ) = u(Tw − T ), (5.65)
but, because the mixed-cup temperature differs from the wall temperature, i.e.
T = Tr̂ =1 ,
we must adjust u; one common method is to add a part of the heat transfer resistance in
the reactor as follows:
1 1 R
= +α . (5.66)
u u k
By making this adjustment we assume that we have the temperature T , a distance αR
from the wall, and that heat is conducted through the fluid and the wall.
Because the equations are non-linear, there is still no analytical solution to the equa-
tions. The equations describe a simple initial-value problem, and numerical solutions are
straightforward. An analytical solution is possible only if we assume that, by efficient
5.2 Case study: Modeling flow, heat, and reaction in a tubular reactor 75
cooling or through a reaction of low heat of reaction, the temperature will be constant
axially and the reaction rate will be a function of concentration only, i.e.
CAOUT 1
dC
=− d ẑ. (5.67)
CAIN L
RA (C A )
vav 0
5.2.7 Conclusions
The complex partial differential equations have been simplified all the way, until an
analytical solution is possible. The simplifications can be halted at any point depending
on the desired accuracy and available numerical tools.
The assumptions in a lumped-parameter model are not always transparent. For exam-
ple, in the 1D model for a tubular reactor with axial dispersion (Equations (5.36) and
(5.37), repeated here for convenience)
∂C ∂ 2C ∂C
= Dea 2 − v − kn (T, t) · C n , (5.36)
∂t ∂z ∂z
∂T ∂2T ∂T
ρc p = λea 2 − vρc p − kn (T, t)(−H ) · C n , (5.37)
∂t ∂z ∂z
where the axial dispersion term Dea can be estimated from
R2v2
Dea = D + ,
192D
and λea by replacing D by thermal diffusion α in the equation.
The main assumptions in the lumped-parameter model are
(1) the average reaction rate is the rate at average temperature and concentration;
(2) the axial dispersion term describes the complex combination of transport by velocity
gradients and diffusion;
(3) the velocity is the traditional average, and the concentration and temperature are the
mixed-cup averages.
The simulations must be validated and verified before they can be trusted. At the
beginning of this chapter, we stated that poor simulation results may be due to many
different reasons: errors in formulating the problem, inaccurate models, inaccurate data
on physical properties, numerical errors due to the choice of numerical methods, and
lack of convergence in the simulations.
5.4 Questions 77
5.4 Questions
(1) What properties are essential in an equation that may be solved independently of the
remaining equations in a system of equations?
(2) Why are the net mass and heat transfer through a symmetry boundary condition
zero?
(3) What are the maximum number of symmetry planes in a cube, cylinder, and sphere?
78 Strategies for simplifying mathematical models
(4) In Equation (5.9), what is the difference if the left-hand side or the right-hand side
is set to zero?
(5) How many symmetry planes exist for a cube exposed to gravity? Analyze the cases
with gravity along the sides and along the diagonal of the cube.
5.1 Estimate how far into a liquid a compound will diffuse or heat will conduct in
1 min. (Diffusivity = 10−9 m2 s−1 , ρ = 1000 kg m−3 , cp = 4000 J kg−1 , k =
0.2 J m−1 K−1 .) Use ŷ = 0.16.
5.2 About 150 years ago, Lord Kelvin estimated the age of the earth to be about 100
million years. He assumed that the earth originally had a temperature of 6000 °C
and that it now has an average temperature of 3000 °C. He solved the heat equation
for the different zones,
2
∂T ∂ T ∂2T ∂2T
ρc p =k + + ,
∂t ∂ x12 ∂ x22 ∂ x32
with the boundary conditions
dT dT dT
kn + + = σ T 4,
d x1 d x2 d x3
where n is the normal to the surface and
dT
=0
d xi
in the middle at xi = 0.
Figure P5.1
5.5 Practice problems 79
Discuss how the following methods can be used to simplify the calculations:
r decoupling of equations;
r reducing the number of independent variables;
r separation of equations into steady state and transient;
r simplifying geometry;
r linearizing;
r neglecting terms;
r solving for limiting cases.
Make your own estimation using the data in Figure P5.1. The radiation inflow
from the sun and the radiation outflow are today the dominant terms; the solar
constant is 1400 W m−2 . The net flux from the inner part of the earth is today on
the order of 5 · 10−2 W m−2 . Assume a heat capactity of 5 · 106 J m−3 K−1 .
5.3 Most of the harmful emissions from cars appear during cold start because the
catalyst has to reach 250 °C before it becomes active. It takes about 1 min under
normal driving conditions. An option to reduce the time is to put a smaller catalyst
with less thermal mass close to the engine. Using late ignition in the engine makes
it possible to raise the exhaust temperature very quickly. Calculate an over- and
underestimation of how long it will take to heat the catalytic converter to 250 °C
when the exhaust gas temperature increases linearly from 20 to 700 °C for 10 s and
is then kept constant.
The catalyst has a volume of 0.5 l and a mass of 100 g. The channel surface (i.e.
the area of contact with the exhaust gases) is 2000 m2 m−3 . The mass flow of the
exhaust gas is 0.01 kg s−1 . Assume that the catalyst heat capacity is 1000 J kg−1
K−1 , and that of the exhaust gas is 1000 J kg−1 K−1 . The Nusselt number for heat
transfer in the channels is 4, and the gas heat conduction is 0.04 W K−1 m−1 .
5.4 Over 80 times more CO2 is dissolved in the sea than in the atmosphere, and the
gas will not contribute to global warming if it dissolves in the oceans. The primary
mechanism for the transport of CO2 from the atmosphere to the ocean is through
its dissolution in raindrops. Calculate approximately (over- and underestimates)
how much it needs to rain in Sweden (486 000 km2 ) in m m−2 if the production of
CO2 (55 million tons yr−1 ) is balanced with the amount that dissolves in the rain.
Assume that the raindrops are of about 6 mm diameter and that they fall with a
velocity of 10 m s−1 from 1000 m.
The transport of the CO2 into a raindrop can be approximated by diffusion:
∂C ∂ 2C 2 ∂C
=D + .
∂t ∂r 2 r ∂r
The atmospheric CO2 concentration is 0.0325%, and its solubility in water is 40 mol
m−3 bar−1 . The diffusivity of CO2 in water is 10−9 m2 s−1 . The model neglects the
deformation of the droplet, the convection inside the droplet, and the mass transfer
in the air outside the droplet. Does this lead to an over- or underestimation of CO2
transport into the drop?
Hint: Estimate how far into the drop the CO2 can diffuse in the available time.
80 Strategies for simplifying mathematical models
5.5 The surface temperature in the desert can vary between +80 °C during day-
time and −10 °C during the night. Estimate how far into the sand the tempera-
ture fluctuations can reach. Define the position where no fluctuation is observed
as the point where less than 1% of the surface variations are noticed. The density
of the sand is 2000 kg m−3 , the heat conductivity is 0.8 W m−1 K−1 , and the heat
capacity is 1000 J kg−1 K−1 .
5.6 Monolithic catalytic converters with a large number of parallel channels are very
common in emission control for cars. The flow is laminar in order to minimize
pressure drop with parabolic velocity profile. The maximum velocity in the center
is twice the average velocity. Calculate the required catalyst volume assuming
the rate-determining step is that the pollutants should have time to diffuse from
the center of the channel to the catalytic wall. The channels are 1 mm wide and the
channel volume is 80% of the catalytic converter volume. The volumetric flow of
exhaust gas for a 2 l engine running at 3000 rpm can be approximated as (engine
speed) × (engine volume)/2.
6 Numerical methods
ODE on an interval x ∈ [a, b], with two different sets of conditions, which cause the
equation to be classsified as either IVP or BVP:
d2 y dy
= f x, y, . (6.1)
dx2 dx
Initial-value problem
y(a) = α,
dy
= β.
d x x=a
Boundary-value problem
y(a) = α,
y(b) = γ .
The numerical methods used to solve these two classes of problems, i.e. IVPs and
BVPs, are different, and the two separate conditions for the BVP generally make it more
difficult to solve. Methods for solving both of these types of problems will be introduced
in this chapter.
The er ror made in the Euler method in a single step, ε, can be estimated by using the
Taylor expansion
1
y (x0 + h ) = y (x0 ) + hy (x0 ) + h 2 y (x0 ) + O(h 3 ). (6.4)
2
By subtracting Equation (6.3) from Equation (6.4) we obtain
1 2
ε= h y (x0 ) + O(h 3 ), (6.5)
2
which shows that the local truncation error is approximately proportional to h2 . It can
also be shown that the global error over the interval x ∈ [a, b] is O(h). (This will be
dicussed in detail later in the chapter.) As shown in Figure 6.1, the derivative changes
between xn and xn+1 , but the Euler method simply relies on the derivative at xn .
The numerical solution using the explicit first-order Euler method, and the step size
h = 0.2, is shown in Figure 6.2.
By using the globally first-order accurate Euler method, O(h), the error is halved
becomes when the step size is halved. If the step size is further reduced, the global
error continues to decrease, but very slowly, as shown in Figure 6.3. A major drawback
of the Euler method is that it has low accuracy; a very small step size is required to
control and keep error low. The errors, shown in Figure 6.3, have been calculated as the
84 Numerical methods
Figure 6.2. Solution using the Euler method, step size h = 0.2.
difference between the numerical solution and the true value. In this case, the error can
be easily calculated as the analytical solution is given by y(t) = 2 exp(t) − t − 1.
Figure 6.5. Solution using the midpoint method, step size h = 0.2.
k1 = h f (xn , yn ), (6.6)
k2 = h f (xn + h/2, yn + k1 /2), (6.7)
Consequently, the midpoint method increases accuracy by one order. Obviously the
increased order of accuracy leads to a better approximation than the Euler solution, as
shown in Figure 6.5.
A comparison between the errors in the Euler and midpoint methods is summarized
in Table 6.1 and shown in Figure 6.6.
86 Numerical methods
5 0.4599 0.0311
10 0.2491 0.0084
20 0.1300 0.0022
50 0.0534 0.000357
100 0.0269 8.99e − 5
1000 0.0027 9.05e − 7
Figure 6.6. Euler, O(h), and midpoint, O(h2 ), vs. step size.
k1 = h f (xn , yn ), (6.9)
k4 = h f (xn + h, yn + k3 ), (6.12)
These methods (Euler, midpoint, and Runge–Kutta) are examples of explicit algorithms.
For the same step size, the higher-order Runge–Kutta method gives better precision but
at the cost of more calculations in each step.
To be clear, let us first define the correct solution to the initial-value problem as y(x).
The approximative solution using a single-step numerical method, e.g. the Euler method,
with an increment function f (xn , yn ) and step size h is yn+1 = yn + h f (xn , yn ), and it
is approximated at a number of discrete points {(xn , yn )}n=0 M
.
The global truncation error, en , is defined as the difference between the approximation,
yn , and the correct solution of the IVP, y(xn ):
en = yn − y(xn ). (6.14)
The local error, εn+1 , is defined as the error committed in each step from xn to xn+1 .
Let us introduce z(x), which is the correct solution of the IVP over that single step. The
local truncation error is then given by
Whereas the local error is due to a single step, the global error, en+1 , is the sum of the
local error, εn+1 , and the amplified error from previous steps. As a consequence, it is
not equal to the sum of the local errors from previous steps. The local and global errors
are illustrated in Figure 6.7. Note that the upper curve, y(x), is the correct (true) solution
to the IVP and that the lower curve, z(x), is the correct solution of the IVP on xn < x <
xn+1 , given y(xn ) = yn .
88 Numerical methods
Generally, if the local discretization error is O(hn ), the global error is O(hn−1 ). Con-
sequently, the Euler method is locally second-order accurate, O(h2 ), and globally (over
the interval x ∈ [a, b]) it is first-order accurate, O(h).
The accuracy of the three single-step methods introduced so far in this chapter is
presented in Table 6.2. For practical applications, higher-order methods are needed to
reduce the computational effort. Therefore, the advantage of using a higher-order method
does not come from getting an extremely accurate solution; in most cases, it is satisfying
to reach a specified target accuracy. The advantage comes instead from the fact that it is
possible to more rapidly, i.e. computationally more efficiently, reach the specified target
by using fewer steps.
As shown in Table 6.2, the global error in the Euler method is O(h). This means that
if the step size is reduced by a factor of 12, the overall error will be reduced by a factor
of 12. In contrast, the global error in the fourth-order Runge–Kutta method is O(h4 ),
which means that the error will decrease by a factor of 1/16 when the step size is reduced
by a factor of 12.
Why not use higher-order methods beyond the fourth order? One reason is that the
Runge–Kutta methods with higher order use more function evaluations, which means
that the number of computations increases. The objective of numerical solutions is to
obtain a solution with sufficient accuracy, not an exact solution. Consequently, it is
often not necessary to use higher-order methods because the improvement in accuracy is
offset by the increase in computational effort. A better strategy for increasing accuracy
is instead to use adaptive step size methods.
acceptable tolerance. The simplest way to do this is to compare the error estimate εi ,
or the relative error estimate εi yi , with the error tolerance, and then double or halve
the step size, depending on the current error. If the error exceeds the tolerance, the
step must be repeated, using a reduced step size to improve accuracy. In regions where
solution accuracy is met unnecessarily well, the step size can be increased to reduce
computational effort.
The Runge–Kutta–Fehlberg method is one example of an adaptive step size method.
It compares the solutions from a fourth-order Runge–Kutta method with a solution
from a fifth-order Runge–Kutta method to determine the optimal step size. The optimal
step, hopt , is determined by evaluating the difference between the fourth- and fifth-order
Runge–Kutta solutions, and accounting for the specified error tolerance.
Another method that uses fourth- and fifth-order embedded pairs is the Dormand–
Prince method. The Dormand–Prince method is more accurate than the Runge–Kutta–
Fehlberg method and it is used by the MATLAB ode45 solver. Both methods have in
common that the difference between the fourth- and fifth-order accurate solutions is
calculated to determine the error, and to adapt the step size. The error estimate, εn+1 ,
for the step is
k1 = f (xn , yn ),
1 1
k2 = f xn + h, yn + h k1 ,
5 5
3 3 9
k3 = f xn + h, yn + h k1 + k2 ,
10 40 40
4 44 56 32
k4 = f xn + h, yn + h k1 − k2 + k3 ,
5 45 15 9
where
k7 = f (xn + h, z n+1 ).
90 Numerical methods
In contrast to the forward (explicit) Euler method, which uses the slope at the left-hand
side to step across the interval, the implicit version of the Euler method crosses the
interval by using the slope at the right-hand side, as shown in Figure 6.8. The implicit
formula does not give any direct approximation of yn+1 , instead an iterative method, e.g.
the Newton method, is added inside the loop, thus advancing the differential equation to
solve for yn+1 . This obviously comes at the price of more computation, but allows stability
6.1 Ordinary differential equations 91
Figure 6.9. Comparison between the explicit and implicit Euler methods. (a) Step size h = 2.5;
(b) step size h = 0.5.
also with comparatively large step size. This makes the implicit methods efficient and
useful. The implicit Euler method is unconditionally stable for h > 0. Without using a
rigorous stability analysis, the issue with stability is shown in Example 6.2.
In this equation, we have introduced the time constant of the system, which is the
inverse of the rate constant k, i.e. τ = 1/k. This simple problem involves a linear
differential equation that allows us to investigate how the implicit and the explicit
methods behave as the step size is modified. Recall that the explicit Euler method is
given by yn+1 = yn + h f (xn , yn ). This means that
yn h
yn+1 = yn − h = yn 1 − . (6.21)
τ τ
Therefore, if the time step, h, is larger than the time constant, the explicit method will
predict negative concentrations and easily diverge, as shown in Figure 6.9(a). In
contrast, the implicit Euler method yn+1 = yn + h f (xn+1 , yn+1 ) has the advantage of
92 Numerical methods
stability,
yn+1
yn+1 = yn − h , (6.22)
τ
which can be written as
yn
yn+1 = . (6.23)
1 + h/τ
Consequently, the implicit method will be stable even for the poor choice of time step
h. However, in order to achieve an appropriate accuracy, the step size h has to be
chosen reasonably small. This simple example differs from most practical applications
in one very important aspect. In this case, it was simple, using algebra, to rewrite the
original implicit formula as an explicit one for evaluation. This is usually not the case
in practical applications. In such cases, the implicit method is more complex to use,
and it involves solving for yn+1 , using indirect means.
Let us now compare the explicit and implicit Euler techniques using two different step
sizes, h = 2.5 and h = 0.5, for the interval t ∈ [0, 10], using τ = 1 and the initial value
y0 = 1. From what we have just learned, the stability issues are manifested as divergence
in the explicit solver when too large time steps are used. As shown in Figure 6.9(a), on
using a step size larger than the time constant of the system, the explicit method diverges,
whereas the implicit formula does not. The solutions are comparable for smaller time
steps (Figure 6.9(b)). Note that both these methods have low accuracy due to their low
order.
By using the the implicit Euler method, yn+1 = yn + h f (xn+1 , yn+1 ), and a time step of
h = 0.1, we obtain, at the first time step,
y1 = y0 − hy12 .
As the value y1 is unknown we need to iterate, e.g. use the Newton method, to find the
solution. Let us denote y1 = z and implement the Newton method to determine the
solution at the first time step, t = 0.1. First we reformulate the non-linear equation to
F(z) = 0; this gives
F(z) = z − y0 + hz 2 = z − 1 + 0.1z 2 = 0.
6.1 Ordinary differential equations 93
The Newton method to find a root of F(z) = 0 and with an initial guess, z i , is given by
F(z i )
z i+1 = z i − for i = 0, 1, 2 . . .
F (z i )
We can obtain an initial guess, z0 , by using the forward Euler method,
y1 = y0 − hy02 = 1 − 0.1 · 12 = 0.9. The first iteration with the Newton method gives
F(z 0 ) z 0 − 1 + 0.1z 02 0.9 − 1 + 0.1 · 0.92
z1 = z0 − = z 0 − = 0.9 −
F (z 0 ) 1 + 0.2z 0 1 + 0.2 · 0.9
= 0.916101694915254,
and the second iteration gives
F(z 1 ) z 1 − 1 + 0.1z 12
z2 = z1 −
= z1 − = 0.916079783140194.
F (z 1 ) 1 + 0.2z 1
Finally the solution converges at z = 0.916079783099616, which is the reactant
concentration, y1 , predicted by the implicit Euler method at the first time step t = 0.1.
This procedure is repeated for the following nine time steps to determine the final
reactant concentration. To sum up, the implicit Euler method involves more
computation; it does not improve accuracy because it is only first-order accurate, but it
significantly improves stability.
3 1
yn+1 = yn + h f (xn , yn ) − f (xn−1 , yn−1 ) . (6.24)
2 2
The fourth-order, four-step Adams–Bashforth method,
55 59 37
yn+1 = yn + h f (xn , yn ) − f (xn−1 , yn−1 ) + f (xn−2 , yn−2 )
24 24 24
9
− f (xn−3 , yn−3 ) , (6.25)
24
requires information about f (xn , yn ), f (xn−1 , yn−1 ), f (xn−2 , yn−2 ), and f (xn−3 , yn−3 );
however, only f (xn , yn ) needs to be calculated in this step as the other values have been
94 Numerical methods
calculated in previous steps. Obviously the multistep methods need help getting started
because they require information about previous steps. A one-step method is often used
for this start-up phase. Compared to the fourth-order Runge–Kutta method, which needs
four function evaluations, this method requires only one function evaluation after the
start-up phase. The advantage is clear; the multistep method can be used to obtain the
same accuracy with less computational effort.
5 8 1
yn+1 = yn + h f (xn+1 , yn+1 ) + f (xn , yn ) − f (xn−1 , yn−1 ) , (6.26)
12 12 12
and the three-step Adams–Moulton method (fourth-order accurate) is
9 19 5
yn+1 = yn + h f (xn+1 , yn+1 ) + f (xn , yn ) − f (xn−1 , yn−1 )
24 24 24
1
+ f (xn−2 , yn−2 ) . (6.27)
24
The implicit multistep methods add stability but require more computation to evaluate
the implicit part. In addition, the error coefficient of the Adams–Moulton method of
order k is smaller than that of the Adams–Bashforth method of the same order. As a
consequence, the implicit methods should give improved accuracy. In fact, the error
coefficient for the implicit fourth-order Adams–Moulton method is 19/720, and for the
explicit fourth-order Adams–Bashforth method it is 251/720. The difference is thus
about an order of magnitude. Pairs of explicit and implicit multistep methods of the
same order are therefore often used as predictor–corrector pairs. In this case, the explicit
method is used to calculate the solution, ỹn+1 , at xn+1 . Furthermore, the implicit method
(corrector) uses ỹn+1 to calculate f (xn+1 , ỹn+1 ), which replaces f (xn+1 , yn+1 ). This
allows the solution, yn+1 , to be improved using the implicit method. The combination
of the Adams–Bashforth and the Adams–Moulton methods as predictor–corrector pairs
is implemented in some ODE solvers. The MATLAB ode113 solver is an example of a
variable-order Adams–Bashforth–Moulton multistep solver.
r1 = kCA = k0 e− Ea / RT CA . (6.28)
Solving Equations (6.31) and (6.32) obviously requires that the slopes f 1 (CA,n , Tn ) and
f 2 (CA,n , Tn ) are calculated before CA and T are updated. Using a fourth-order
Runge–Kutta algorithm means that eight slopes need to be calculated in each step.
96 Numerical methods
dn y dy d 2 y d n−1 y
= f 1 x, y, , , . . . , n−1 . (6.33)
dxn dx dx2 dx
Higher-order ODEs can be rewritten to a system of first-order equations. In this case,
the numerical methods developed for solving single first-order ODEs can be extended
directly to ODE systems. This means that the numerical methods for solving higher-
order differential equations are reduced to integrating a system of first-order differential
equations. The general principle for transforming a higher-order differential equation,
Equation (6.33), is shown in Example 6.5 and is summarized in Table 6.3.
Figure 6.11. Solution to (a) a non-stiff system, α = 2, (b) a stiff system, α = 200 000.
We can draw several conclusions from Table 6.4 after what we have learned in this
chapter. We can conclude that for non-stiff problems and moderate error tolerances all
methods work efficiently. When the error tolerance is stricter, the higher-order method
ode45 performs better than the ode23 method.
6.2 Boundary-value problems 99
For stiff problems, both of the explicit methods (ode23 and ode45) perform poorly,
regardless of the error tolerance specified. Both require many steps to advance through
the interval t ∈ [0, 1]. As mentioned before, these two explicit solvers use adaptive step
sizes, but there are also stability constraints that prevent them from taking large time
steps, even if the problem would seem to allow for this in regions where the derivative
is low. In contrast, the implicit ODE solvers have much better stability and solve the
problem more efficiently. When the error tolerence is very strict, ode15s performs better
than ode23s; this is because it is a variable-order method, of orders 1–5, whereas ode23s
is based on a formulation of orders of 2 and 3. More information about these numerical
algorithms can be found at the end of this chapter.
A differential equation that has data given at more than one value of the independent
variable is a boundary-value problem (BVP). Consequently, the differential equation
must be of at least second order. The solution methods for BVPs are different com-
pared to the methods used for initial-value problems (IVPs). An overview of a few of
these methods will be presented in Sections 6.2.1–6.2.3. The shooting method is the
first method presented. It actually allows initial-value methods to be used, in that it
transforms a BVP to an IVP, and finds the solution for the IVP. The lack of boundary
conditions at the beginning of the interval requires several IVPs to be solved before
the solution converges with the BVP solution. Another method presented later on is the
finite difference method, which solves the BVP by converting the differential equation
and the boundary conditions to a system of linear or non-linear equations. Finally, the
collocation and finite element methods, which solve the BVP by approximating the
solution in terms of basis functions, are presented.
iterative approach is needed to determine the missing initial values that are consistent
with the boundary values. Consider the following second-order BVP:
⎧ 2
⎪
⎪
d y
=
dy
,
⎪
⎪ f x, y,
⎨ dx2 dx
y(a) = ya , (6.40)
⎪
⎪
⎪
⎪ y(b) = yb ,
⎩
x ∈ [a, b],
Adjustment of the initial guess can be done using the secant method, which can be
applied as soon as two trials have been completed,
y2,i − y2,i−1
y2,i+1 = y2,i − εi . (6.41)
εi − εi−1
As an alternative, the Newton method can be used. The reader is referred to the literature
to learn more about these methods.
Figure 6.13. Concentration profile in the catalyst particle of Example 6.7 for φ = 2.
From the Taylor theorem, we can derive the difference approximation for the first- and
second-order derivatives by expanding y about xi .When using central differences, the
first-order derivative is approximated by
dy y (xi+1 ) − y (xi−1 )
= + O (h 2 ), (6.45)
d x xi 2h
which means that the approximation is O(h2 ). The second-order derivative (using central
difference approximations) is approximated by
d 2 y y(xi+1 ) − 2y(xi ) + y(xi−1 )
= + O(h 2 ). (6.46)
d x 2 xi h2
By substituting Equations (6.45) and (6.46) into Equation (6.44), and introducing
pi = p(xi ), qi = q(xi ), ri = r(xi ), the discretized version of Equation (6.44) is obtained as
follows:
y(xi+1 ) − 2y(xi ) + y(xi−1 ) y(xi+1 ) − y(xi−1 )
= pi + qi y(xi ) + ri ,
h2 2h
for i = 1, 2, . . . , n − 1, (6.47)
which simplifies to
This means there are n − 1 unknowns, i.e. y1 , y2 , . . . , yn−1 , and n − 1 algebraic equations
that should be solved for. This can be written in the matrix form, Ay = f, where
⎡ ⎤
−2−h 2 q1 1 − hp1 /2 0 0 . .
⎢1 + hp /2 −2 − h 2 q 1 − hp /2 . ⎥
⎢ 2 2 2 0 0 ⎥
⎢ ⎥
⎢ 0 ⎥
A=⎢ ⎥,
⎢ 0 ⎥
⎢ ⎥
⎣ . 0 1 + hpn−2 /2 −2 − h 2 qn−2 1 − hpn−2 /2 ⎦
. 0 0 1 + hpn−1 /2 −2 − h 2 qn−1
(6.49)
⎡ ⎤ ⎡ ⎤
y1 h 2r1 − (1 + hp1 /2)ya
⎢ ⎥ ⎢ h 2 r2 ⎥
⎢ ⎥
y2 ⎢ ⎥
⎢ ⎥. ⎢ . ⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
y=⎢ ⎥,
. and f =⎢ . ⎥. (6.50)
⎢ ⎥ ⎢ ⎥
⎢ ⎥. ⎢ . ⎥
⎢ ⎥ ⎢ ⎥
⎣ yn−2 ⎦ ⎣ 2
h rn−2 ⎦
yn−1 h 2rn−1 − (1 − hpn−1 /2)yb
Consequently, the approximative solution to the BVP is calculated on a computational
mesh, and it results in a system of algebraic equations. In this example, the prob-
lem is linear and the Gaussian elimination can be used to solve the equation system
(n − 1 algebraic equations). Dirichlet boundary conditions were specified in this prob-
lem. Note that the boundary conditions are accounted for in two of these equations, i.e.
104 Numerical methods
the first and last rows in the matrix Equations (6.50). The finite difference method can
be summarized as follows.
(1) Convert the continuous variable to discrete variables. The mesh for the independent
variable may be evenly or unevenly spaced.
(2) Use the difference approximation to replace the derivatives.
(3) Implement the boundary conditions.
(4) Solve the equation system using direct or indirect methods.
d2T α
= (T − Tamb ), (6.51)
dx2 λB
6.2 Boundary-value problems 105
where α is the heat transfer coefficient and λ is the thermal conductivity. This is a
second-order differential equation that requires two boundary conditions. We assume
that the temperature at x = 0 equals Tw , i.e.
T (0) = Tw , (6.52)
and that the flux at the tip is negligible, i.e.
∂ T
= 0. (6.53)
∂ x x= L
By introducing the dimensionless variables
T − Tam b αL2
θ= , ξ = x/ L , H= ,
Tw − Tam b λB
Equation (6.51) can be written as
d 2θ
= H 2 θ, (6.54)
dξ 2
and the new boundary conditions become
θ (0) = 1, (6.55)
dθ
= 0. (6.56)
dξ ξ =1
By using the central difference approximation for the second-order derivative, the
discretized version of Equation (6.54) is obtained:
θ (ξi+1 ) − 2θ (ξi ) + θ (ξi−1 )
− H 2 θ (ξi ) = 0, (6.57)
h2
which simplifies to
θ (ξi−1 ) − (2 + h 2 H 2 )θ (ξi ) + θ (ξi+1 ) = 0. (6.58)
For simplicity, the domain ξ ∈ [0, 1] is discretized into four equally spaced intervals,
h = (1 − 0)4 = 0.25, and we solve the problem for H = 1. This results in the linear
equation system
θ0 − (2 + h 2 )θ1 + θ2 = 0,
θ1 − (2 + h 2 )θ2 + θ3 = 0,
(6.59)
θ2 − (2 + h 2 )θ3 + θ4 = 0,
θ3 − (2 + h 2 )θ4 + θ5 = 0.
Note that a Dirichlet boundary condition is specified for the left-hand side of the
domain, i.e. θ0 = 1. In order to implement the Neumann boundary condition on the
right-hand side of the domain (the no-heat-flux condition on the tip), we can extend the
computational domain from ξi = i × h for i = 0, 1, 2, . . . , n to i = 0, 1, 2, . . . , n + 1.
For this reason, the dependent variable is also calculated at the fictitious boundary
outside the domain, at ξ5 . The Neumann boundary condition, i.e. the derivative at the
106 Numerical methods
Figure 6.16. Temperature profile in the cooling fin of Example 6.8 for H = 1, grid resolution
h = 0.1.
which yields θ5 − θ3 = 0. In total we have five equations and five unknowns in the
equation system Equations (6.59) and (6.60), which can be written as follows:
⎡ ⎤⎡ ⎤ ⎡ ⎤
−(2 + h 2 ) 1 0 0 0 θ1 −1
⎢1 −(2 + h 2 ) 1 0 0⎥ ⎢θ2 ⎥ ⎢0 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢0 0⎥ ⎢ ⎥ ⎢ ⎥
⎢ 1 −(2 + h 2 ) 1 ⎥ ⎢θ3 ⎥ = ⎢0 ⎥ . (6.61)
⎣0 0 1 −(2 + h 2 ) 1 ⎣θ4 ⎦ ⎣0 ⎦
⎦
0 0 −1 0 1 θ5 0
Equation (6.61) can be solved by using Gaussian elimination, and the predicted
temperature profile inside the cooling fin is θ1 = 0.8396, θ2 = 0.7318, θ3 = 0.6696,
θ4 = 0.6493 (and θ5 = 0.6696).
Note that θ5 is the solution at the fictitious boundary (outside the domain), it can be
excluded when plotting the solution on the domain of interest. In order to reduce the
error, the domain is simply discretized into smaller intervals. The solution to the
problem using finite differences and a mesh with h = 0.1 is shown in Figure 6.16.
The error, evaluated at ξ = 0.5, for different grid resolutions is shown in
Figure 6.17. The error plotted in this log-log plot is a straight line with a slope equal to
2, which can be expected because the central difference approximation is second-order
accurate, O(h2 ).
6.2 Boundary-value problems 107
In this case, we will select a trial function, φi (x ), which can fulfill the boundary
conditions
y ( x ) = a1 + a2 x + a3 x 2 . (6.64)
The derivatives of the polynomial, y(x), are
dy d2 y
= a2 + 2a3 x and = 2a3 . (6.65)
dx dx2
Three equations are obviously required to determine the unknowns a1 , a2 , a3 . By sub-
stituting Equation (6.65) into the differential equation Equation (6.63) and evaluating at
certain mesh points, the problem is reduced to solving a system of equations in ai . The
collocation points should be selected at points that have a large influence on the function.
We require that the BVP is satisfied in the middle of the domain, at the collocation point
x2 = 0.5, which yields
d2 y
= 2a3 = 6x2 = 6 · 0.5 = 3. (6.66)
dx2
This means that a3 = 1.5. The left boundary condition, y(0) = 0, gives
a1 + a2 · 0 + a3 · 02 = 0,
and the right boundary condition, y(1) = 1, gives
a1 + a2 · 1 + a3 · 12 = 1.
This gives the two other coefficients, a1 = 0, a2 = −0.5, and the polynomial becomes
y(x) = a1 + a2 x + a3 x 2 = −0.5x + 1.5x 2 . (6.67)
The approximative solution to the BVP, i.e. the polynomial, and the true solution are
shown in Figure 6.18.
∂ 2u ∂ 2u ∂ 2u ∂u ∂u
A 2 +B +C 2 + f , , u, x, y = 0 (6.68)
∂x ∂ x∂ y ∂y ∂x ∂y
6.3 Partial differential equations 109
or
Au x x + Bu x y + Cu yy + f (u x , u y , u, x, y ) = 0, (6.69)
where the subscripts denote the partial derivatives of the dependent variable, u, and the
focus is on the finite difference method.
The B2 − 4AC term is refer red to as the discriminant of the solution, and the behavior
of the solution of Equation (6.69) depends on its sign. The smoothness of a solution is
110 Numerical methods
affected by the type of equation. The solutions to elliptic PDEs are smooth. In addition,
boundary conditions at any point affect the solution at all points in the computational
domain. Elliptic PDEs often describe the steady-state condition of a variable, for exam-
ple a diffusion process that has reached equilibrium, or a steady-state temperature
distribution. In hyperbolic PDEs, the smoothness of a solution depends on the initial
and boundary conditions. For instance, if there is a jump in the data at the start or
at the boundaries, this jump will propagate in the solution. Parabolic PDEs arise in
time-dependent diffusion problems, for example the transient flow of heat.
∂u ∂ 2u
= D 2. (6.70)
∂t ∂x
For instance, Equation (6.70) can describe the diffusion of a chemical species in porous
material as a function of time and space, with diffusivity constant D. The equation
can also describe the heat conduction in a material. As such it can be used to quantify
how temperature is conducted throughout a material in time, with the heat diffusivity
D = λ/(ρc p ). We limit the discussion to how to solve parabolic PDEs by using the finite
difference method.
1 D
(u i, j+1 − u i, j ) = 2 (u i+1, j − 2u i, j + u i−1, j ), (6.73)
k h
where ui, j is the numerical approximation to u(xi , tj ). This forward time central space
(FTCS) discretization has the local error O(k) + O(h2 ), i.e. it is first-order accurate in
6.3 Partial differential equations 111
Figure 6.21. Stencil for the explicit forward method. (a) σ = 0.1; (b) σ = 0.5; (c) σ = 1.
kD
u i, j+1 = u i, j + (u i+1, j − 2u i, j + u i−1, j ). (6.74)
h2
Let us now introduce the parameter σ = k D/ h 2 ; then Equation (6.74) can be written as
The forward difference formula is explicit as the new values can be determined directly
from the previous known values, i.e. the solution takes the form of a marching procedure
in time. The mesh points involved in stepping forward in time are shown in Figure 6.19.
In the figure, the filled circles represent values known from the previous time step and
the open circle is the unknown value.
In order to solve the PDE, the initial and boundary conditions also need to be specified.
The explicit forward difference method is of little practical use because the method is
only conditionally stable. This can be understood better by looking at the relationship
between the unknown value and the values known from previous time steps, as in the
stencil in Figure 6.20.
Note that when σ = 0.5 the solution at the new point is independent of the closest
point (Figure 6.21(b)). When σ > 0.5, the new point depends negatively on the clos-
est point (Figure 6.21(c)). A consequence of this is that the solution is unstable for
σ > 0.5.
112 Numerical methods
Figure 6.22. Solution of the heat equation problem, D = 1.0 and σ < 0.5, Example 6.9.
u(0, t) = 0,
u(1, t) = 0, (6.77)
The solution of the heat equation problem (D = 1.0), using the explicit forward method,
is shown in Figure 6.22. Here, σ < 0.5 and the solution is stable. Considering that the
time scale for diffusive heat transport is τ = L 2 /D, the temperature profile is expected.
6.3 Partial differential equations 113
Figure 6.23. Stability of the forward explicit method for the heat equation. Temperature
distributions are shown at t = 1; (a) stable for σ = 0.4; (b) unstable for σ = 0.5005.
The instability in the solution of the heat equation problem occurs for σ > 0.5.
Figure 6.23(a) shows the temperature profile at t = 1.0 for D = 1.0 and σ = 0.4, and
Figure 6.23(b) shows the predicted profile for σ = 0.5005. The instability for σ > 0.5
is very clear. The problem with stability can be overcome by using other difference
methods, e.g. implicit methods.
This section has provided a short introduction to solving PDEs using the finite difference
method. But there is much more to explore, and the reader is referred to books on
advanced numerical methods to learn more about how to solve PDEs. In most cases
the reader will use existing numerical algorithms for solving ODEs and PDEs, either
commercial or open-source. Section 6.4 gives a short description of some of these
software products.
There are many numerical software products available, both commerical and open-
source. It is good practice to use the available algorithms for solving ODEs and PDEs
rather than to develop new ones from scratch. In this section we list some of most popular
algorithms in MATLAB, since it is used widely in both academia and industry. Another
popular software product is GNU Octave (freeware). Besides these software products,
there is a series of useful books on numerical analysis, “Numerical Recipes.”
6.4.1 MATLAB
The two work horses used for solving ODE problems are ode45 for non-stiff equations
and ode15s for stiff equations. These methods have in common that the step size does not
need to be specified, because the solvers include an estimate of the error at each step. The
solver then adapts the step size to meet the specified error tolerance. The explicit solvers
are all unstable with stiff systems. The solver will shorten time steps and the solution
will take a long time, or the step reduces to a point where machine precision causes the
algorithm to fail. The most widely used ODE solvers are classified in accordance to their
characteristics, as discussed in the preceding sections, and as shown in Table 6.5.
The MATLAB ODE solvers are given three arguments: the function evaluating the
right-hand side of the differential equation; the time interval to integrate over; and the
initial conditions. There are also other important characteristics, besides the ones listed
in the table, that might be of importance when selecting a particular algorithm. For
example, the ode15s solver can solve differential algebraic equations (DAEs).
Methods for solving BVPs and PDEs are summarized in Table 6.6. The standard
MATLAB installation has one PDE solver. But there is also a toolbox for solving PDEs
6.4 Simulation software 115
ode23 explicit single non-stiff low Runge–Kutta pair of order 2 and 3, of Bogacki
and Shampine
ode45 explicit single non-stiff medium Runge–Kutta pair of order 4 and 5, of
Dormand–Prince
ode113 explicit multi non-stiff variable low Adams–Bashforth–Moulton
to high predictor–corrector pairs of order 1 to 13
ode15s implict multi stiff variable low numerical differentiation formulas, orders 1
to medium to 5
ode23s implicit single stiff low modified Rosenbrock formula of order 2
Method Comment
in which the command pdetool invokes a graphical user interface (GUI). In this GUI,
the user can draw geometry, define boundary conditions, specify the PDE, generate the
mesh, and compute and display the solution. It allows the solution of PDEs in two space
dimensions and time.
Method Comment
y=dsolve(’Dy=k1-k2*y’,’y(0)=0’,’t’)
which gives
y = (k1 - k1/exp(k2*t))/k2
⎪
⎪ y(0) = 1,
⎪
⎩x ∈ [0, 1],
function dy = f(x,y)
dy = y + x;
Note that the MATLAB ODE solver is given three arguments: the function evaluating
the right-hand side of the differential equation, the time interval to integrate over, and
the initial conditions. The first line of code (opts) sets the relative error tolerance to
1e−4 (default is 1e−3). This line is followed by a command which calls the ode45
solver, and specifies that the differential equation is specified in the m-file. Further, the
command also specifies that the ODE should be solved in the interval 0–1 and at the
initial condition y0 = 1. The third line is just used to plot the solution in a graph.
6.6 Questions 117
It is also possible to solve the problem by defining the function f (x, y) “inline”:
[x,y] = ode45(inline(’y+x’,’x’,’y’), [0 1], 1, opts)
6.5 Summary
6.6 Questions
(1) What is the difference between the local truncation error and the global error, and
how are they related?
(2) How can error tolerance be ensured when a true solution does not exist when
solving differential equations?
(3) Explain what is meant by adaptive step size methods, and why they are used.
(4) What characterizes multistep methods, and why are they often used?
(5) How do predictor–corrector pairs work, and why are they used?
(6) How is stability related to explicit and implicit methods, and what is a conditionally
stable method?
(7) Explain what is meant by stiff differential equations, and what category of ODE
solvers is suitable for stiff systems.
(8) Why are different solution methods needed for IVPs and BVPs, and how can BVPs
be solved?
(9) Explain the principle behind the finite difference method.
(10) What do the collocation and finite element methods have in common, and how do
they differ?
118 Numerical methods
There are many books on numerical methods available that contain exercises that allow
you to practice writing your own algorithms to solve differential equations. It is equally
important to learn how to use the existing software products for numerical analysis,
and select appropriate numerical methods for stability and efficiency reasons. With this
in mind, some of the problems in this section require that you work with software for
numerical computing, e.g. MATLAB.
6.1 Find the approximate solution to the IVP dy/dt = t − y, y(0) = 1, for t ∈ [0, 1],
using step sizes h = 0.1, 0.01, and 0.001. Determine the error at t = 1 and make a
log-log plot of the global error as a function of the step size h, using
(a) the forward Euler method,
(b) the fourth-order Runge–Kutta method.
(c) Confirm that the two lines are consistent with the order of the method.
The analytical solution is y(t) = t + 2/et − 1.
6.2 Apply the explicit and implicit Euler methods to find an approximate solution to the
following IVPs:
dy
(a) = 50(1 − y), y(0) = 0.5, t ∈ [0, 1];
dt
dy
(b) = 50(y − y 2 ), y(0) = 0.5, t ∈ [0, 1].
dt
Plot the solutions for different step sizes. What step size is required for the explicit
method to converge to the equilibrium value? Recall that Newton’s method to find a
root of z(x) = 0 and starting guess, x0 , is xi+1 = xi − [z(xi )/z (xi )].
6.3 Write the higher-order differential equation as a system of first-order differential
equations:
d2 y dy
(a) 2
+ x2 − y sin(x) = 0;
dx dx
d2 y dy
(b) 2
−y + x 2 − α = 0;
dx dx
d3 y d 2 y dy
(c) − + y 2 − e x = 0;
dx3 dx2 dx
d4 y dy 2
(d) 4
− y + e x = 0.
dx dx
6.4 Depending on the rate constants, chemical reacting systems might be stiff. One
well-known stiff system is the Robertson example, which consists of non-linear
ODEs characterized by a large difference in the rate constants. The three reactions
occurring in the system are
k1
A −→ B,
k2
B + B −→ B + C,
k3
B + C −→ A + C,
6.7 Practice problems 119
where the rate constants are k1 = 0.04, k2 = 3 · 107 , k3 = 1 · 104 , and the initial
concentrations of the three species are CA0 = 1, CB0 = 0, and CC0 = 0.
(a) Assume the reactions are carried out in a batch reactor operated at isothermal
conditions, and derive the system of ODEs.
(b) Use a solver suitable for stiff problems and plot the solution for t ∈ [0, 100].
(c) Evaluate the performance of non-stiff and stiff solvers, e.g. MATLAB ode45 and
ode15s, by analyzing the number of steps required by the two different solvers.
(d) Determine how the order of the method for stiff solvers is related to the error
tolerance specified.
6.5 An ideal batch reactor is used to hydrogenate compound A. The hydrogen is fed
through a gas sparger and dissolves in the liquid phase, where it reacts with com-
pound A,
r
A + H2 −→ B,
where the reaction rate is r = kCA CH2 and k = 10−3 m3 s−1 mol−1 .
The hydrogen mass transfer rate is dominated by the liquid film resistance. This
allows the mass transfer rate to be modeled as N a = k L a(CHi 2 − CH2 ), where k L a =
10 s−1 . The initial concentration of compound A is CA0 = 10[mol m−3 ], and, as
hydrogen is replenished to maintain the reactor pressure, CHi 2 = 0.1[mol m−3 ].
(a) Derive the material balances that describe how the concentrations CA and CH2
vary in time. Assume perfect mixing and isothermal conditions in the reactor.
(b) Estimate the time constants and select a suitable ODE solver.
(c) Make a plot that shows how the concentrations change in time.
6.6 Diffusion and reaction inside a spherical catalyst particle are described by the
following BVP:
d 2C 2 dC
+ − 4C = 0,
dr 2 r dr
C(1) = 1,
dC
= 0,
dr r =0
r ∈ [0, 1].
(a) Use the collocation method, with a collocation point at r = 0.5, to find an
approximate solution. The result can be compared with the concentration profile
shown in Figure 6.13.
(b) Use the MATLAB built-in BVP solver to find the solution to the problem.
6.7 Heat transport by conduction is described by the parabolic PDE
∂T ∂2T
= D 2,
∂t ∂x
x ∈ [0, 1], t ∈ [0, 1],
the boundary conditions T (0, t) = 0 and T (1, t) = 0, the initial condition T (x, 0) =
sin2 (4π x), and the heat diffusivity D = λ/ρc p = 1. Find the solution by
120 Numerical methods
(a) using the finite difference, forward time central space, method;
(b) using the finite difference, Crank–Nicolson, method;
(c) using the MATLAB built-in PDE solver “pdepe”.
6.8 A metal rod initially at ambient air temperature, 25 °C, is connected on one side
to a wall at constant temperature 100 °C, and the other side is surrounded by air.
Heat conduction through the rod and losses by convection to the surroundings are
balanced by accumulation of thermal energy in the rod. The energy balance is given
by
∂T λ ∂2T
= − k1 (T − Ts ),
∂t ρc p ∂ x 2
where Ts = 25 °C is the surrounding air temperature (constant) and k1 =
5.25 · 10−7 s−1 (depends amongst other things on the heat conduction in air and
the radius of the rod). The rod is 1 m long and made of silver; the corresponding
material data for silver are λ = 424 W m−1 K−1 , ρ = 10 500 kg m−3 , and c p =
236 J kg−1 K−1 .
(a) Propose a suitable boundary condition for the tip of the rod, which is in contact
with air.
(b) Estimate the time constant of the system.
(c) Determine how the temperature profile evolves in time.
7 Statistical analysis of
mathematical models
7.1 Introduction
the stochastic part, ε . The term E ( y) is also called the expectation function, and it is
described by
E ( y) = β0 + β1 x. (7.2)
Figure 7.2 shows a straight-line fit. The slope of the line represents β 1 and the y-
intercept β 0 in Equation (7.1). The er rors ε1 for x = x1 and ε2 for x = x2 are also shown
in the figure.
A more general equation for the linear regression is the so-called multiple linear
regression that is described by
y = β0 + β1 x 1 + β2 x 2 + · · · + βk x k + ε, (7.3)
where x1 and x2 could be different variables for, e.g., pressure and temperature, but
may also be powers of x, x2 , x3 , etc. This equation is denoted linear by virtue of its
linear parameters. This can also be seen by the fact that d y/dβ is only a function of
the independent variables, x. To illustrate linear models further, some examples are
given. The model in Equation (7.4) is linear in its parameters and is called a polynomial
model:
y = β0 + β1 x + β2 x 2 + β4 x 4 + ε. (7.4)
7.2 Linear regression 123
Another set of models, which are also linear with respect to the parameters, are the
so-called sinusoidal models:
k = Ae− E A / R T , (7.6)
where k is the rate constant, A is the pre-exponential factor, EA is the activation bar rier,
R is the general gas constant, and T is the temperature. The rate constant is included
in the material and heat balances for a system, with the result that the concentrations
and temperature depend on the parameters in the rate constants. The parameters of this
equation that should be determined are A and EA . Rewriting Equation (7.6) using the
notation in Equation (7.3) would result in
k = β0 e−β1 / R x . (7.7)
This yields
dk −β0 −β1 / R x
= e ,
dβ1 Rx
and as this derivative contains β 1 it means that it is not linear in the parameter β1 ;
therefore this is a non-linear model.
y = β0 + β1 x + ε. (7.8)
where ɛi is the random er ror at the experimental point i (see Figure 7.2). To illustrate
this further, if there were experimental points x1 , x2 , x3 , x4 , . . . , xn , the cor responding
er rors would be described by ε1 , ε2 , ε3 , ε4 , . . . , εn . These errors for experimental point
i would be expressed by
εi = yi − (β0 + β1 xi ). (7.10)
This means that the error in each point is the difference between the experimentally
measured value and the value calculated by the model. In the least square method, the
SSE described in Equation (7.9) is minimized. The resulting line, when SSE is at a
124 Statistical analysis of mathematical models
minimum, is known as the least square, or regression, line. The true model is described
by
y = β0 + β1 x + ε, (7.11)
ŷ = b0 + b1 x, (7.12)
where b0 and b1 are estimates of the true β 0 and β 1 , respectively, and ŷ is the y predicted
by the model. When minimizing SSE, the normal equations are set up. This will be
performed for the simplest case, the first-order straight-line model. The least square
error is minimized when the derivative with respect to the two parameters equals zero:
∂SSE
= 0, (7.13)
∂β0
∂SSE
= 0, (7.14)
∂β1
where the least square error is given by
n
n
SSE = εi2 = (yi − (β0 + β1 xi ))2 . (7.15)
i=1 i=1
When using the expression for SSE in Equation (7.15) and differentiating it with
respect to each parameter, the following expressions are obtained:
∂SSE
n
= 2(yi − (b0 + b1 xi ))(−1) = 0; (7.16)
∂b0 i=1
∂SSE n
= 2(yi − (b0 + b1 xi ))(−xi )
∂b1 i=1
n
=2 (yi xi − (b0 xi + b1 xi2 )) = 0. (7.17)
i=1
Equations (7.18) and (7.19) are often denoted as normal equations. The parameters
b0 and b1 can be easily retrieved from these equations. Often, the averages of y and x,
respectively, are used. They are denoted by x̄ and ȳ, and are given by
1
n
x̄ = (xi ) (7.20)
n i=1
7.3 Linear regression in its generalized form 125
and
1
n
ȳ = (yi ). (7.21)
n i=1
This results in
b0 = ȳ − b1 x̄ (7.22)
and
n
(xi − x̄)(yi − ȳ)
b1 = n
i=1
. (7.23)
i=1 (x i − x̄)
2
V (ε) = σ 2 . (7.29)
In many experiments, the expected error is not constant for all observation points. We
can still make a least squares minimization, but we cannot make any statistical analysis
unless we stabilize the variance (see Section 7.4). For a detailed statistical analysis, each
observation should be weighted with its variance.
126 Statistical analysis of mathematical models
Figure 7.3. Two data sets with (a) small and (b) large variance, respectively.
To illustrate further the importance of the variance, two different data sets are shown in
Figure 7.3. The data in Figure 7.3(a) have a small variance, whilst the data in Figure 7.3(b)
have a large variance. The variance will be determined using so-called analysis of
variance (ANOVA) tables, which will be described in detail in Section 7.8.2.
When using models in a more generalized matrix form, the residual sum of squares
is defined by
SSE = ( y − Xβ) ( y − Xβ). (7.31)
In the same way as for the simple case of the straight-line model, the sum of squares
is minimized when the derivative of SSE with respect to the parameters is set at zero.
This results in
∂SSE
= 0, (7.32)
∂β b
where b (p × 1) is a vector with the estimated parameters. In Equation (7.31), SSE can
be further developed into
SSE = y y − y Xβ − β X y + β X Xβ
= y y − 2β X y + β X Xβ. (7.33)
The derivative of SSE with respect to β gives
∂SSE
= −2X y + 2X X b = 0. (7.34)
∂β b
This is the normal equation in matrix form. This equation can be rearranged to yield
X y = X X b, (7.35)
7.4 Weighted least squares 127
which can be used to retrieve an equation for determining the parameter vector b:
b = (X X)−1 X y. (7.36)
The basis for this equation is that the expected value for the error is 0, i.e.
E(ε) = 0, (7.37)
V (ε) = σ 2 . (7.38)
Weighted least squares are important and have several different applications. Examples
of cases where weighted least squares are important include:
z i = ln yi . (7.40)
If z i is differentiated, we obtain
1
dz i = dyi , (7.41)
yi
which means that dz i corresponds to a small error in yi divided by yi that yields the
weight factor 1/yi2 . Weight factors are discussed further in the context of residual plots
in Section 7.8.1.
128 Statistical analysis of mathematical models
y = β0 + β1 x 1 + β2 x 2 + · · · + βk x k + ε, (7.42)
where
n n
SSE = εi2 = (yi − ŷi )2 . (7.43)
i−1
i=1
7.4 Weighted least squares 129
Figure 7.6. Model and experimental data for ammonia storage and desorption over a catalyst.
From Olsson, L., Sjövall, H., and Blint, R. J., Appl. Catal. B 81, 203–207, 2008. Reproduced
with permission from Elsevier.
For the case using weight factors, the weighted sum of square errors, WSSE, can be
expressed as follows:
n
n
WSSE = wi ei2 = wi (yi − ŷ i )2 . (7.44)
i=1 i=1
In this section, we have described cases when experimental data points are not fully
reliable, which might be the case with outliers. Another key area for weighted residuals is
when certain parts of the experiment are very important and we would like to emphasize
those parts of the regression model. An example from our research on automotive
catalysis is depicted in Figure 7.6. In this experiment, the catalyst is exposed to ammonia
for 80 min and the experimental (solid line) and simulated (dashed line) outlet ammonia
concentration are shown in the figure. Initially, ammonia adsorbs on the catalyst, which
is why the outlet ammonia concentration is zero. When the catalyst is saturated, ammonia
130 Statistical analysis of mathematical models
breaks through. Thereafter, the ammonia is turned off and the temperature is increased,
which results in an ammonia desorption peak. The binding strength can be received
during the temperature ramp, so the desorption part is far more critical than the adsorption
part when tuning a model to the data. However, the concentration in the desorption is quite
low, with the result that, in a standard fitting procedure, the adsorption part influences
the parameters in the model to a greater extent. Since the desorption part is far more
important to the kinetic model, this is not the desired situation. In this case, weighted
residuals can be used, where the error during the desorption part has a larger weight
factor compared to the adsorption. In the example shown in Figure 7.6, the model is
non-linear but the interpretation of weighted residuals remains the same.
Different weight factors can also be applied to the residual sum of squares when the
response variables have varying orders of magnitude. For example, for models describing
emission cleaning with the help of catalysis, it is common to use both molar fractions
and temperatures as response variables. In many cases, the molar fraction is in the range
100 × 10−6 –500 × 10−6 , and the temperature is 400–700 K. If no weight factor were
applied in this case, the errors in the prediction of the temperature would totally dominate
and the molar fraction would have only a minor influence. However, as the errors in
the molar fractions are crucial, this is not a good solution. Therefore, a weight factor
can be applied to the molar fractions, with the result that the errors are similar in size
to those for the temperatures (the opposite would also be possible using a smaller factor
on the temperature instead).
E(b) = β. (7.45)
The variance, s2 , can be estimated by dividing the sum of square errors, SSE, by the
degrees of freedom, v
v = n − p, (7.46)
SSE SSE
s2 = = (7.47)
v n−p
where n is the number of experimental data points and p is the number of parameters
in the model. Equation (7.46) applies to the case for which there is only one source
of errors. The estimation of the degrees of freedom, v, will be discussed in detail in
Section 7.5.1.1. The standard error of the parameter p is calculated according to:
se(b p ) = s {(X X)−1 } pp , (7.48)
7.5 Confidence intervals and regions 131
Figure 7.7. (a) Straight-line fit to two experimental points. (b) Quadratic fit to three experimental
points.
where {(X X)−1 } pp is the pth diagonal term of the matrix (X X)−1 . For example, the
standard error of parameter b3 is
se(b3 ) = s {(X X)−1 }33 , (7.49)
where {(X X)−1 }33 is the third diagonal term in the matrix. By using these results, it is
possible to determine the 1 − α confidence interval for parameter bp in the model as
follows:
v = n − p. (7.52)
If there were other sources of the random variation that were more important than the
spreading in repeated analyses, the number of observations of the dominant variation
would be the number of degrees of freedom. When determining the confidence inter-
vals, one step would be to calculate the number of degrees of freedom (v = n − p) as
described. The reason why the number of parameters must be extracted from the number
of degrees of freedom can be understood from the following example. In Figure 7.7(a),
the result of a straight line fit ( ŷ = b0 + b1 x) to two points is shown. The fit is naturally
132 Statistical analysis of mathematical models
Figure 7.8. NO, NO2 , NH3 , and N2 O concentration after an ammonia selective catalytic reduction
(SCR) experiment over a copper–zeolite catalyst. The inlet gas composition is 400 ppm NOx
(NO or NO2 ), 400 ppm NH3 , and 8% O2 . From Sjövall, H., Olsson, L., Fridell, E., and Blint,
R. J., Appl. Catal. B 64, 180–188, 2006. Reproduced with permission from Elsevier.
perfect because there is only one way in which a line can be drawn between two points.
The number of degrees of freedom for this case is therefore
v = n − p = 2 − 2 = 0. (7.53)
Figure 7.9. Student’s t-distribution for 10 degrees of freedom, showing 95% confidence limit.
bp
tobs = , (7.54)
se(b p )
and this value is compared with the t-value from the t-distribution with n − p degrees
of freedom, t(n − p; α/2). If tobs > t(n − p; α/2), the parameter is significant.
134 Statistical analysis of mathematical models
Figure 7.10. Student’s t-distribution for 2, 10, or 1000 degrees of freedom, showing 95%
confidence limit.
Figure 7.11. Individual confidence intervals and joint confidence region for a two-parameter
model ( ŷ = b0 + b1 x).
Figure 7.12. F-distribution for 10 and 10 degrees of freedom, showing 95% confidence limit.
which is indicated by the solid line in Figure 7.11. The joint confidence region is
ellipsoidal, whereas the individual levels form a rectangle, differences that are important
to notice.
To calculate the 1 − α confidence region, the following relationship can be used for
the linear case:
(β − b) X X (β − b) ≤ ps 2 F ( p, n − p ; α ). (7.55)
This yields an elliptical contour. In more general terms, the 1 − α confidence region
is determined by
p
SSE(β ) ≤ SSE( b) 1 + F ( p, n − p ; α ) , (7.56)
n−p
where F ( p, n − p ; α ) is the F-distribution (see Appendix C) for the degrees of freedom,
p, and n − p, respectively, at level α . For linear models, the results for the confidence
regions will be the same when using Equation (7.55) or Equation (7.56). Note that for
the F-distribution the level to be used is α, whilst for the t-distribution it is α/2. The
reason for this difference is that the t-distribution is centered around zero and has two
tails, whereas the F-distribution is non-symmetrical (and positive), and only has one tail
(Figure 7.12).
As described in Section 7.5.1, the 1 − α confidence interval for the dependent variable
ŷ(x 0 ) is determined according to
x 0 b ± s x 0 (X X)−1 x 0 t(n − p; α/2). (7.57)
If this calculation is performed for several different points (x), a “point-wise confi-
dence band” is retrieved. It is also possible to determine the 1 − α confidence interval
for the value predicted, which is obtained when considering all intervals simultaneously,
i.e.
x b ± s x (X X)−1 x p F( p; n − p; α). (7.58)
136 Statistical analysis of mathematical models
This is denoted the “simultaneous 1 − α confidence band” for the response function
at any x. Note that the confidence band (Figure 7.13) depends on the independent
variable x.
After a model has been constructed, it is important to determine the cor relation between
the parameters. If there is high cor relation and one parameter is changed, another
parameter must also change. Multiple choices of parameters can result in a similar sum
of square er rors. In order to determine the cor relation between parameters, the variance
and co-variance must be calculated. Therefore, we start with a description of the variance
calculation, followed by the determination of the co-variance, and finally the cor relation
matrix.
b3
⎡ ⎤
V (b0 ) cov(b0 , b1 ) cov(b0 , b2 ) cov(b0 , b3 )
⎢cov(b1 , b0 ) V (b1 ) cov(b1 , b2 ) cov(b1 , b3 )⎥
=⎢
⎣cov(b2 , b0 )
⎥. (7.59)
cov(b2 , b1 ) V (b2 ) cov(b2 , b3 )⎦
cov(b3 , b0 ) cov(b3 , b1 ) cov(b3 , b2 ) V (b3 )
and results in a lower correlation between the parameters when doing the regression
analysis. This transformation will not affect the activation energy, but the pre-
exponential factor will be the rate constant at T = Tref .
In chemical engineering, many models are non-linear, which means that they are non-
linear with respect to the parameters. This will be illustrated by a few examples below.
The simple straight-line model,
ŷ = b0 + b1 x, (7.67)
is of course linear. However, the following models (because they are linear in the
parameters) are also linear. Note that the regressor, x, can have different exponents, sine
form, etc., while the model remains linear. We have
y = β0 + β1 x + β2 x 2 + β3 x 4 + β x 6 ; (7.68)
y = β0 + β1 sin(x) + β2 cos(x). (7.69)
However, due to the form of the parameters, the following models are non-linear:
y = θ0 + eθ1 x ; (7.70)
y = θ0 + θ1 sin(θ2 x) + θ3 cos(θ4 x). (7.71)
In order to separate clearly the linear and non-linear models, we denote the parameters
for the linear models as β i , and that for the non-linear models as θ i . In this chapter, we
discuss the statistical evaluation of non-linear models, which is often very complex;
therefore, iterative numerical solutions will be used.
Another example is
y = f (x, θ ) + ε. (7.76)
The error sum of squares for the non-linear case can be expressed as
n
n
SSE(θ) = εi2 = (yi − f (xi , θ̂ ))2 . (7.77)
i=1 i=1
In the same way as for the linear case, the normal equations are set up by differentiating
SSE(θ ) with respect to the parameters and setting the equations equal to zero. This will
result in an estimate of θ, which we denote θ̂ ; i.e.
& '
∂SSE(θ) n
∂ f (xi , θ̂ )
=2 {yi − f (xi , θ̂ )} = 0. (7.78)
∂θ ∂θ p
i=1 θ =θ̂
This is performed for each parameter, and results in p (the number of parameters)
normal equations. These equations are solved by different numerical methods. In much
of the available software, it is possible to set up SSE(θ) and then call for a routine that
minimizes the error sum of squares. For example, this can be performed in MATLAB
using the function lsqnonlin.
An early method used for solving these equations is the Gauss–Newton method,
for which the Taylor series is used. Other methods include “steepest descent” and
“Marquardt’s compromise.” It is not the scope of this book to go into the details of
solving non-linear normal equations because they are often solved computationally
by using various software. However, this information is readily available in various
textbooks. In this book, we will use linearization to determine approximate confidence
levels and correlation matrices. For many applications, linearization is a very important
tool that is used as a standard method in research.
140 Statistical analysis of mathematical models
f (x, θ ) = b0 + b1 θ. (7.80)
The derivative
& '
∂ f (x n , θ̂ )
∂θ p
θ=θ̂
f (x n , θ̂ ) − f (x n , θ̂ p,1% )
Jn, p ≈ . (7.82)
θ p
The 1 − α approximate confidence interval for the parameter θ̂ p in the model can be
determined by
where t(n − p; α/2) is the Student’s t-distribution with n − p degrees of freedom. The
standard error of the parameter p, se(θ̂ p ), is calculated according to
se(θ̂ p ) = s {( J J)−1 } pp . (7.84)
Note the similarities between this equation and the case of the linear equation. The
only difference is that X is replaced by J. The standard deviation, s, can be retrieved
from the variance, s2 :
SSE SSE
s2 = = . (7.85)
v n−p
7.7 Non-linear regression 141
where
∂ f (x 0 , θ )
j0 = . (7.87)
∂θ θ=θ̂
The confidence intervals, for several points, together form a so-called “1 − α point-
wise confidence band.” The “simultaneous confidence band” at the 1 − α level can be
determined according to
f (x, θ̂ ) ± s j ( J J)−1 j p F( p; n − p; α). (7.88)
This is the exact confidence region with approximate confidence levels. The confidence
region considers the effect of varying all parameters. For linear models, the confidence
regions assume an elliptical shape, whereas the region is often more banana shaped for
non-linear models.
It is also possible to determine the approximate elliptical contour for non-linear
models, with exact probability level 1 − α, using
Note that this results in an elliptical confidence region and that this is only an approxi-
mation, not the exact region. The differences between these two confidence regions are
illustrated in Case study 7.3 (see Section 7.11).
142 Statistical analysis of mathematical models
After the model has been constructed and the parameters estimated, it is crucial to
evaluate it. In this book, we describe two methods for evaluating models: residual plots
and lack of fit. Residual plots are discussed in Section 7.8.1 and lack of fit is described
in the context of the analysis of variance (ANOVA) table. The error is defined as
e = y − ŷ, (7.92)
which refers to the differences between the experimentally measured values and the
values predicted by the model. The assumptions usually made when developing a model
through regression analysis are that (i) the error is random, (ii) the error is normally
distributed, and (iii) the variance is constant and equal to σ 2 . After the model has been
constructed, it should be confirmed that none of these assumptions has been violated.
Figure 7.14. Residual plot for an example with randomly distributed er rors.
95% of the standardized er rors should be in the −1.96 to 1.96 range and approximately
99% in the −2.576 to 2.576 range. For other degrees of freedom, the t-values should
be taken from the t-distribution (see Appendix C). However, because the variance is not
constant for each error, this is not exact. Therefore, it is better to use the Studentized
residuals,
ei
z i∗ = √ , (7.95)
s 1 − h ii
where h ii is the “leverage” and denotes the diagonal elements of the Hat matrix, H:
It is useful to construct residual plots based on the error, e, or the standardized residuals,
for many applications.
Figure 7.15. Residual plot versus time for examples with non-random er rors.
Figure 7.16. Residual plot versus the regressor variable (xi ), where the er rors are not random.
this problem. This example clearly shows that all trends observed in the residual plots
should not be removed by adding new terms to the model. For some cases, there are
experimental problems, resulting in experiments having to be repeated or the experi-
mental procedure refined, representing the causes of the trends in residual plots. It is
therefore crucial for the person conducting the experiment to collaborate closely with
the model developer. There are many additional types of patterns that the residual plots
can assume; the objective of Figure 7.15 was to illustrate some of these patterns.
Figure 7.17. Residual plot versus ŷ calculated from the model, where the errors are not random.
7.8.1.5 Outliers
Outliers are experimental points that deviate significantly from the others in the plot.
This phenomenon was discussed in Section 7.4.2, and examples are shown in Figure 7.4
and Figure 7.5. If the Studentized residuals z i∗ are plotted, they should be in the –3 to
3 range. However, if there are points larger than 3 or smaller than –3, they represent
outliers. Figure 7.18 illustrates two outliers.
Source SS df MS Fobs
SSReg M SReg
Regression SSReg v Reg M S Reg =
vReg s2
SSE
Residual SSE v s2 =
v
SSLoF M SLoF
Lack of fit SSLoF vLoF M SLoF =
vLoF M SPE
SSPE
Pure error SSPE vPE M SPE =
vPE
Total, corrected for mean SStot, corr vtot,corr
Figure 7.19. Data for three factors, showing differences within and between samples.
(ii) to check on its lack of fit. Repeated experiments are needed to examine this. Data
for three different factors (x1 , x2 , and x3 ) are shown in Figure 7.19. Each experiment
is repeated multiple times in order to determine its variance. The figure shows that the
variance is larger for x2 than for the others because its points are more spread out. The
mean value for y, ȳ, is shown for the three factors. With the use of the ANOVA table,
we can investigate if there is a lack of fit to the model. We can also examine whether the
differences between ȳi are significant or are due to the variance of the points.
The ANOVA table is shown in Table 7.1; and in the following paragraph different
terms in the table and its use are discussed.
The first two lines represent the regression model and the residual, where the residual
can be divided into two parts: lack of fit and pure error. We start with the regression and
residual used to test if the model is significant. The sum of squares due to regression,
SSReg , can be calculated according to
n
SSReg = ( ŷi − ȳ)2 . (7.97)
i=1
This value is corrected to the mean, the background to subtracting the number of
parameters by one (for the mean) to retrieve the degrees of freedom:
vReg = p − 1, (7.98)
7.8 Model assessments 147
where p represents the number of parameters. The sum of square errors, SSE, can be
calculated as described earlier as
n
n
SSE = εi2 = (yi − ŷi )2 , (7.99)
i=1 i=1
with
v=n−p (7.100)
where n represents the total number of observations and m is the number of different xi .
For example, in Figure 7.19, m = 3 and n = 6 + 5 + 6 = 17. The sum of square errors
contains both the errors associated with the pure error, SSPE , and lack of fit SSLoF , i.e.
The sum of squares of the pure error can be calculated from repeated identical
experiments, according to
m
nj
SSPE = (y ji − ȳ j )2 , (7.103)
j=1 i=1
with
vLoF = m − p (7.106)
Here, it becomes clear that the number of degrees of freedom for the lack of fit may be
calculated from v and vPE :
It can also be calculated by adding the sum of squares for the regression and residual,
which results in
It is refer red to as “cor rected” because it is cor rected by the total mean, and this cor rection
is done in SSReg . Simultaneously, the degrees of freedom are cor rected by –1 (due to the
mean), so
vtot,cor r = n − 1. (7.111)
Dividing the sum of squares by the number of degrees of freedom for the respective
case yields the values for the mean squares, M SReg , s 2 , M SLoF , M SPE , M Stot,cor r . The
pure er ror mean square, M SPE , is an estimate of σ 2 that is valid both when there is a
lack of fit in the model and when there isn’t.
The reason for setting up the ANOVA table is to determine if the model is significant
and if there is any lack of fit to the model. First, we must determine if there is a lack
of fit to the model. If there is, we cannot use s 2 as an estimation of σ 2 and thus cannot
check the significance of the model. The lack of fit can be determined by examining the
observed F-value for the lack of fit, that is
M SLoF
Fobs,LoF . (7.112)
M SPE
This value should be compared to the F-value from the F-distribution with vLoF
and vPE degrees of freedom at α confidence level (for example, at the 95% or the
99% level), which is denoted F(vLoF , vPE ; α ). In the F-table (see Appendix C), data
are shown for F(v1 , v2 ; α); thus v1 = vLoF and v2 = vPE . If Fobs,LoF > F(vLoF , vPE ; α)
is valid, the lack of fit is significant. For this case, it is not possible to determine
confidence regions, significance of the model, etc. Instead, residual plots and further
examination of the model are needed in order to uncover the reason for the lack of fit and
thereafter to improve the model until there is no longer any lack of fit. For the case when
Fobs,LoF < F(vLoF , vPE ; α), there is no lack of fit observed and it becomes possible to
determine the significance of the model. In this case, we can use s 2 as an estimation of
σ 2 . However, the fact that there is no lack of fit does not mean that the model is perfect,
it merely means that we do not observe any lack of fit in these analyses.
In order to examine the significance of the model, the F-value observed for the
regression, Fobs,Reg , should be calculated:
M SReg
Fobs,Reg = . (7.113)
s2
This value should be compared to F(vReg , v; α) and if Fobs,Reg > F(vReg , v; α) is valid,
the model is significant at the α level. However, if the opposite holds true, i.e. Fobs,Reg <
F(vReg , v; α), the model is not significant, and it is recommended not to use this model.
7.9 Case study 7.1: Statistical analysis of a linear model 149
7.8.3 R 2 statistic
An important tool for examining the model is to use the R2 statistic, which is calculated
by
n
SS Reg ( ŷi − ȳ)2
R2 = = i=1
n . (7.114)
i=1 (yi − ȳ)
SStot,corr 2
Thus, R 2 represents the fraction of the total variation around the mean, ȳ, explained by
the model. Often, R 2 is multiplied by 100 and expressed in percentage terms. Generally,
R 2 can assume values between 0 and 1. However, because the model can never explain
the pure error, R 2 cannot be 1. The higher the value of R 2 , the more capable the model
is of describing experimental data. There are, however, also some issues with using R 2 .
If, for example, there are five different experimental points and you use five parameters
in your model, you will receive a model that goes through all five points and thereby
gives R2 = 1. Of course, this does not mean that you have a good model, only that the
model is over-parameterized, for the set of performed experiments. For this example,
it is obvious that too many parameters were chosen. However, it is also important to
examine this when repeating experiments, where it might not be obvious when the model
is over-parameterized. Assume, for example, that you have 80 experimental points, and
that there are 20 repeated experiments for each x point. If you choose a model with four
parameters, you will get a perfect fit and a very high R 2 value, but this model is over-
parameterized or is developed with too little variation in the experimental conditions.
In an article about the growth rates of ice crystals (Ryan, B. F., Wishart, E. R., and Show,
D. E. (J. Atmos. Sci. 33, 842–850, 1976)), experiments were conducted in which ice
crystals were placed into a compartment at a constant temperature (–5 °C). In order to
analyze the growth of the ice crystals as a function of time, the saturation of the air by
water was kept constant. The experimental data points were randomized over time. The
experimental data are presented in Table 7.2, where y is the axial length of the crystals
50 19 125 28
60 20, 21 130 31, 32
70 17, 22 135 34, 25
80 25, 28 140 26, 33
90 21, 25, 31 145 31
95 25 150 36, 33
100 30, 29, 33 155 41, 33
105 35, 32 160 40, 30, 37
110 30, 28, 30 165 32
115 31, 36, 30 170 35
120 36, 25, 28 180 38
150 Statistical analysis of mathematical models
in microns and x is the time in seconds. Repeated measurements were also performed
in order to examine the lack of fit.
Use a straight-line model, y = β0 + β1 x + ε, and fit it to the data. In addition, make
a complete statistical analysis of the model. Use a 95% confidence level, i.e. α = 0.05.
7.9.1 Solution
The experimental data are presented in vector and matrix notation:
⎡ ⎤ ⎡ ⎤
19 1 50
⎢20⎥ ⎢1 60 ⎥
⎢ ⎥ ⎢ ⎥
⎢21⎥ ⎢1 60 ⎥
⎢ ⎥ ⎢ ⎥
⎢17⎥ ⎢1 70 ⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
y = ⎢· ⎥ X = ⎢ · · ⎥
⎢ ⎥ ⎢ ⎥
⎢· ⎥ ⎢· · ⎥
⎢ ⎥ ⎢ ⎥
⎢· ⎥ ⎢· · ⎥
⎢ ⎥ ⎢ ⎥
⎣35⎦ ⎣1 170⎦
38 1 180
where y is an n × 1 vector and X is an n × p matrix; n = 43 is the total number of
experimental points, and p represents the number of parameters, in this case two (b0 and
b1 ). The first column in X should only contain 1 at each position. The number of different
x-values is 22, which is denoted m (m = 22). As there are many repeated experiments,
m is significantly lower than the total number of experimental points (n). The number of
m
observations for each xi is named ni , where i = 1, . . . , m and n = i=1 ni .
The model parameters can be calculated as follows:
b 0.33355 −0.0026342 1292 14.19
b = 0 = (X X)−1 X y = = .
b1 −0.0026342 2.23641 × 10−5 158205 0.1346
Thus, the following model is obtained:
ŷ = 14.19 + 0.1346x.
Source SS df MS Fobs
s2 is already calculated and presented in the ANOVA table (Table 7.3). The confidence
intervals are presented in Table 7.4.
The confidence interval can also be written using the following notation:
10.02 ≤ b0 ≤ 18.36;
0.1005 ≤ b1 ≤ 0.1687.
7.10 Case study 7.2: Multiple regression 153
Student’s t-tests can be used to determine the significance of the parameters. In order to
do so, the t-value from the t-distribution is needed (see Appendix C):
This value should be compared with the calculated tobs = b p /se(b p ), which are shown
in Table 7.4. For both parameters tobs > 2.02, thus both parameters in the model are
significant.
The confidence interval for the mean response, μ(x0 ), at x0 = 100, can be calculated
according to
ŷ(x 0 ) ± s x 0 (X X)−1 x 0 t(n − p; α/2),
resulting in
x0 = 27.65 ± 1.26,
26.4 ≤ μ(x0 ) ≤ 28.9.
7.9.1.4 Correlation
The correlation coefficient can be determined by
A die-casting process was examined and experiments conducted in order to study the
effects of the furnace temperature (x1 ) and the die-closing time (x2 ) on the temperature
difference of the die surface (y). The data are shown in Table 7.5.
Fit the model y = β 0 + β 1 x1 + β 2 x2 + ε to the data. In addition, make a complete
statistical analysis of the model. Use a 95% confidence level, i.e. α = 0.05.
154 Statistical analysis of mathematical models
x1 x2 y
1250 6 80
1300 7 95
1350 6 101
1250 7 85
1300 6 92
1250 8 87
1300 8 96
1350 7 106
1350 8 108
7.10.1 Solution
The experimental data are presented below in vector and matrix notation:
⎡ ⎤ ⎡ ⎤
80 1 1250 6
⎢ ⎥ ⎢ ⎥
⎢ 95⎥ ⎢1 1300 7⎥
⎢ ⎥ ⎢ ⎥
⎢101⎥
⎢ ⎥
⎢1
⎢ 1350 6⎥
⎥
⎢ ⎥ ⎢ ⎥
⎢ 85⎥ ⎢1 1250 7⎥
⎢ ⎥ ⎢ ⎥
y=⎢ ⎥
⎢ 92⎥ ; X= ⎢
⎢1 1300 6⎥
⎥,
⎢ ⎥ ⎢ ⎥
⎢ 87⎥ ⎢1 1250 8⎥
⎢ ⎥ ⎢ ⎥
⎢ 96⎥ ⎢1 1300 8⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎣106⎦ ⎣1 1350 7⎦
108 1 1350 8
Source SS df MS Fobs
are evenly distributed and that there are no clear trends. In addition, all points fall
between −3 and 3, with no evidence of outliers (see Section 7.8.1).
Since the residual plots evidence good results, it is now possible to determine the
significance of the model. See the ANOVA table (Table 7.6).
The significance of the model is examined by calculating Fobs, Reg = M S Reg /s 2 =
319.3 (see Table 7.6). The F-value can be retrieved from the F-table (see Appendix C)
and F(vReg , v; α), which for this case study is F(2, 6; 0.05) = 5.14. This results in
Fobs,Reg > F(v Reg, v; α), i.e. the model is significant at the α level. Further, the R2
statistic is determined using Equation (7.114) to be
SSReg
R2 = = 0.991.
SStot,corr
Thus, we observe that the regression model can describe a large fraction of the
variation in the data.
where
se(b p ) = s {( X X )−1 } pp ;
−228.04 ≤ b0 ≤ −171.07,
0.1889 ≤ b1 ≤ 0.2311,
1.94 ≤ b2 ≤ 4.06.
Student’s t-tests can be used for determining the significance of the parameters. A
t-value is taken from the t-distribution (see Appendix C):
The term tobs shown in Table 7.7 is calculated from b p /se(b p ). These values are then
compared with t(n − p; α/2). For all parameters, tobs ˃ 2.45, thus b0 , b1 , and b2 are
significant. Note that tobs for b0 is negative. However, the absolute value for tobs should
be used in these tests, yielding 17.14 for b0 .
The confidence interval for the mean response, μ(x 0 ), at x 0 = [1 1250 8], can be
calculated according to
ŷ(x 0 ) ± s x 0 (X X)−1 x 0 t(n − p; α/2)
which results in
The results for the confidence region and interval are shown in Figure 7.26 for b1 and
b2 , while keeping b0 constant. Note that the scales are different on the x- and y-axes.
Thus the confidence interval and band are much larger for b2 .
158 Statistical analysis of mathematical models
Figure 7.26. Confidence region and confidence intervals. Note that the scales are different on the
axes.
From Figure 7.26, it is clear that there is a small correlation between the parameters
b1 and b2 . In addition, it becomes evident that the confidence region is very different
from the confidence intervals.
7.10.1.3 Correlation
The correlation matrix can be determined by
{(X X)−1 }i j
Ci j = ,
{(X X)−1 }ii {(X X)−1 } j j
which produces
⎡ ⎤
1 −0.9652 −0.2599
⎣
C = −0.9652 1 1.5 × 10−14 ⎦ .
−0.2599 1.5 × 10−14 1
Note the symmetry of the matrix due to the fact that the correlation between b1 and b2
is the same as that between b2 and b1 . The results in the matrix show that the correlation
is high between b0 and b1 . However, the correlation between b0 and b2 is low, and that
between b1 and b2 is extremely low.
Hydrogen peroxide has been used to oxidize a secondary alcohol in a stirred batch
reactor. In order to increase the reaction rate, a solid catalyst was added. The conversion
(y) of hydrogen peroxide was detected at different times (t); see Table 7.8.
7.11 Case study 7.3: Non-linear model with one predictor 159
t (min) y
20 0.0476
50 0.0700
80 0.129
110 0.152
140 0.126
170 0.157
200 0.173
230 0.140
260 0.210
290 0.155
320 0.197
Source SS df MS Fobs
Fit the non-linear model y = θ1 (1 − e−θ2 t ) to the data. Thereafter examine the sig-
nificance of the model and the parameter significance. In addition, construct confidence
bands and joint confidence regions. Use a 95% confidence level, i.e. α = 0.05.
7.11.1 Solution
The non-linear model parameters are determined numerically using the least square
method in MATLAB. In order achieve this, the sum of square errors is used according
to
n
n
2
SSE(θ) = εi2 = (yi − f (xi , θ̂ )) .
i=1 i=1
or directly through the software. In this case, MATLAB’s built-in functions have been
used to generate the Jacobian, resulting in
⎡ ⎤
0.2166 2.8649
⎢0.4568 4.9662⎥
⎢ ⎥
⎢0.6234 5.5096⎥
⎢ ⎥
⎢0.7388 5.2529⎥
⎢ ⎥
⎢0.8189 4.6356⎥
⎢ ⎥
⎢ ⎥
J (θ̂1 , θ̂2 ) = ⎢0.8744 3.9030⎥ ,
⎢ ⎥
⎢0.9129 3.1839⎥
⎢ ⎥
⎢0.9396 2.5388⎥
⎢ ⎥
⎢0.9581 1.9900⎥
⎢ ⎥
⎣0.9710 1.5390⎦
0.9799 1.1775
which yields
7.1627 27.2607
J J =
27.2607 151.8384
and
0.4408 −0.0791
( J J )−1 = ;
−0.0791 0.0208
s2 (= 0.00049) is given in Table 7.9. The calculations for the confidence intervals are
shown in Table 7.10.
The significance of the parameters is evaluated using the t-test. The t-value
t (n − p ; α/2) is 2.26 (for the t-distribution, see Appendix C). Since the values of tobs for
7.11 Case study 7.3: Non-linear model with one predictor 161
Figure 7.27. Experimental data together with predicted conversion. In addition, the point-wise
and simultneous confidence bands are presented.
both parameters are larger than t(n − p; α/2), θ̂1 and θ̂2 are significant; tobs is calculated
using tobs = θ̂ p /se(θ̂ p ).
The 1 − α confidence interval for the dependent variable f (x0 , θ ), which can also be
called the “mean response,” is retrieved by
f (x0 , θ ) ± s j 0 ( J J)−1 j 0 t(n − p; α/2),
where
∂ f (x0 , θ )
j0 = .
∂θ θ=θ̂
The confidence intervals for several points, calculated using the preceding equation,
together form a so-called “1 − α point-wise confidence band.” The “simultaneous
confidence band” at the 1 − α level is determined by
f (x, θ ) ± s j ( J J)−1 j p F( p; n − p; α).
The experimental data are shown in Figure 7.27 together with the predicted conversion
using the developed model. In addition, the resulting point-wise and simultaneous
confidence bands are shown. The results show that the point-wise and simultaneous
confidence bands are similar for this example.
(θ − θ̂ ) × J J × (θ − θ̂) ≤ ps 2 F( p, n − p, 1 − α),
162 Statistical analysis of mathematical models
which yields
θ1 − 0.1829
[θ1 − 0.1829 θ2 − 0.0122] × J J × ≤ 4.177 · 10−3 .
θ2 − 0.0122
The exact contour with approximate probability level 1 − α is determined using
where
S(θ̂ ) = SSE.
The results for the confidence regions are shown in Figure 7.28, together with the
individual confidence intervals for θ̂1 and θ̂2 . The results clearly show that there is a
large difference between the individual confidence intervals and the joint confidence
regions, but also that there is a difference between the elliptical contour and the exact
region. Further, the results of the joint confidence region also show that there is a
correlation between the parameters θ 1 and θ 2 .
7.11.1.4 Correlation
The correlation is determined using the correlation matrix according to
{( J J)−1 }
Ci j = ,
{( J J)−1 }ii {( J J)−1 } j j
which gives
1 −0.8266
C= .
−0.8266 1
Thus, there is a quite high correlation between the parameters.
7.13 Practice problems 163
7.12 Questions
(1) Set up the normal equations and derive expressions for b0 and b1 in a linear
model.
(2) How can the parameters in vector b be determined using the matrix form?
(3) Why are weighted residuals used?
(4) What is an outlier?
(5) How do you determine confidence intervals and regions, respectively?
(6) What are the differences between confidence intervals and confidence bands?
(7) Describe the ANOVA table and how to calculate the different values in the table.
(8) What is the correlation between parameters and how do you determine it?
(9) Why is the correlation matrix symmetrical?
(10) What makes a model non-linear?
(11) Give an example of an intrinsically linear model.
(12) How do you determine confidence intervals for a non-linear model?
(13) Give examples of residual plots when the residuals are evenly distributed and when
there are clear trends. Also describe how the models should be changed when clear
trends are discernible.
(14) How is R2 determined in order to get information about how much of a variation
can be described by a model?
7.1 The dependence of the reaction rate for the pressure of a hydrogenation reaction in
a tubular reactor has empirically been shown to follow the model
θ1 · P
r( P) =
1 + θ2 · P
where r is the reaction rate (mol s−1 , per kilogram of catalyst) and P is the total
pressure (bar). At 170 °C, the reaction rates given in Table 7.11 were determined.
(a) Determine the parameters θ̂1 and θ̂2 by using one of MATLAB’s (or that of
another software) least squares functions to search for the parameter values that
minimize the model error. In order to obtain a rapid convergence against the
global minima, good start guesses of θ̂1 and θ̂2 are important.
(b) Determine the individual confidence intervals for the parameters at a 95%
level.
164 Statistical analysis of mathematical models
0.0192 1.382
0.0234 2.075
0.0258 2.431
0.0281 2.762
0.0318 3.500
0.0319 3.833
0.0334 4.129
Table 7.12. Reaction rates for the two cases treated and untreated with
pyromycin
0.025 79 69
0.025 45 55
0.07 94 87
0.07 111 81
0.105 127 101
0.105 142 111
0.23 163 129
0.23 156 127
0.54 194 142
0.54 199 159
1.18 209 162
1.18 205 161
(c) Plot the joined, approximate confidence region of the parameters at the 95%
level. Hint: If you use MATLAB, the contour function can be a great help.
(d) Determine the prediction interval for a new observation at 2.8 bar pressure.
7.2 The possible effect the substance pyromycin might have on an enzymatic reaction
is examined. Two experimental series are conducted, one applying the pyromycin
treatment, the other without. In the tests, the dependence of the reaction rate on
the substrate concentration is measured. The kinetics can be assumed to follow the
Michaelis–Menten model:
θ1 · x
f (θ , x) = .
θ2 + x
An hypothesis is that pyromycin influences parameter θ 1 , not θ 2 . Do a statistical
analysis and, based on that result, determine whether the hypothesis is likely to be
true or not. The experimental data are given in Table 7.12.
7.13 Practice problems 165
Table 7.13. Data for pressure drop, pressure, heat loading, and mass flow
7.5 In order to reduce the shrinkage of an artificial fiber, it is pretreated by dipping into
a solution with concentration C and then heat-treated at temperature T. The goal is
to make a model describing how the shrinkage Y depends on the pretreatment.
Nine experiments were conducted; the data are shown in Table 7.14. The measured
shrinkage is denoted Yobs . The results of a first version of the model are also given
in the column Ycalculated . Note that N is the notation for the experiment number, and
the residual is denoted Res.
With the help of residual analysis, examine the suggested model and propose,
with motivation, if and how the model might be improved.
7.6 As part of an assignment to find the optimal process conditions in a steam stripper,
a simple model is needed. The model should describe how the water content in the
7.13 Practice problems 167
x (kg s−1 ) y
0.263 0.34
0.294 0.32
0.321 0.24
0.367 0.20
0.429 0.16
0.608 0.11
1.33 0.06
13.6 0.04
distillate (y) depends on the steam consumption (x). As a basis for the model, the
data in Table 7.15 were collected during the experiments.
The following model is suggested:
x −2/3
y = a ln ,
b
where a and b are the parameters in the model.
By minimizing the residual sum of squares, SSE, the following data were obtained:
r a (parameter 1) = 0.1321
r b (parameter 2) = 0.211 kg s−1
r SSE = 0.003726
r J T J = 20.3453 25.9254
25.9254 38.9143
r ( J T J)−1 = 0.3254–0.2168 .
−0.2168 0.1701
(a) Optimal steam flow is expected to be about 0.58 kg s−1 . Calculate a 95%
confidence interval, which will describe the uncertainty of the model for this
flow.
(b) Others that have conducted similar experiments have found a = 0.107 and b =
0.211. Are these parameters within the confidence region on the 95% significance
level?
Appendix A
Microscopic transport equations
∂T ∂T ∂T ∂T ∂ T ∂2T ∂2T
ρc p + vx + vy + vz =k + + + S.
∂t ∂x ∂y ∂z ∂x2 ∂ y2 ∂z 2
Momentum balance (ρ and μ constant)
2
∂v y ∂v y ∂v y ∂v y ∂p ∂ vy ∂ 2vy ∂ 2vy
y: ρ + vx + vy + vz =− +μ + +
∂t ∂x ∂y ∂z ∂y ∂x2 ∂ y2 ∂z 2
+ ρg y ,
2
∂T ∂T 1 ∂T ∂T 1 ∂ ∂T 1 ∂2T ∂2T
ρc p + vr + vθ + vz =k r + 2 2 + 2 + S.
∂t ∂r r ∂θ ∂z r ∂r ∂r r ∂θ ∂z
1 ∂ 2 ∂CA 1 ∂ ∂CA 1 ∂ 2 CA
= DAB r + sin θ + + RA .
r 2 ∂r ∂r r 2 sin θ ∂θ ∂θ r 2 sin2 θ ∂φ 2
Energy balance (ρ and k constant)
∂T ∂T 1 ∂T 1 ∂T
ρc p + vr + vθ + vφ
∂t ∂r r ∂θ r sin θ ∂φ
1 ∂ 2 ∂T 1 ∂ ∂T 1 ∂2T
=k r + sin θ + + S.
r 2 ∂r ∂r r 2 sin θ ∂θ ∂θ r 2 sin2 θ ∂φ 2
Appendix B
Dimensionless variables
Useful dimensionless numbers can be created by taking the ratios of different forces,
mass fluxes, or heat fluxes. The dimensionless number will indicate which of the
forces or fluxes is the most important. Various dimensionless quantities are given in
Tables B.1–B.4.
Name Definition
hL external heat transfer
Biot Bi =
k internal conductive heat transfer
μU viscous force
Capillary Ca =
γ capillary force
kn C0n reaction rate
Damköhler I Da I = = kn C0n−1 τ
C0 U/L convective mass transport rate
kn C0n−1 reaction rate
Damköhler II Da I I =
kg a mass transport rate
kn C0n−1 LH heat of reaction
Damköhler III Da I I I =
ρc p U T heat transport rate
gL 2 ρ buoyancy force
Eotvos Eo =
γ surface tension force
p pressure force
Euler Eu =
ρU 2 inertial force
αt heat conduction
Fourier Fo =
L2 heat accumulation
gLρ buoyed weight
Froude Fr =
ρU 2 surface inertial force
ρ 2 gβ(Ts − T∞ )L 3 (buoyancy) (inertial force)
Grashof Gr =
μ2 viscous force
hL convective heat transfer
Nusselt Nu =
k conductive heat transfer
LU LU convective transport
Péclet Pe H = or Pe D =
α D diffusive transport
μ viscosity
Prandtl Pr =
ρα heat diffusivity
ρgβ(Ts − T∞ )L 3 free convection
Rayleigh Ra =
μα conduction
(cont.)
172 Appendix B
Name Definition
ρU L inertial force
Reynolds Re =
μ viscous force
μ viscosity
Schmidt Sc =
ρD diffusivity
kc L convective mass transfer
Sherwood Sh =
D conductive mass transfer
τp particle relaxation time
Stokes St =
τfluid fluid characteristic time
ρU 2 L inertial force
Weber We =
γ surface tension force
Appendix C
Student’s t-distribution
Bird, R.B., W.E. Stewart, and E.N. Lightfoot, Transport Phenomena, 2nd edn. New York: Wiley,
2002.
Levenspiel, O., Chemical Reaction Engineering, 3rd edn. New York: Wiley, 1999.
Welty, J.R., C.E. Wicks, and R.E. Wilson, Fundamentals of Momentum, Heat and Mass Transfer,
5th edn. Hoboken, NJ: Wiley, 2007.
Kunes, J., Dimensionless Physical Quantities in Science and Engineering. Burlington, MA:
Elsevier, 2012.
LeVeque, R.J., Finite Difference Methods for Ordinary and Partial Differential Equations: Steady-
State and Time-Dependent Problems. Philadelphia, PA: SIAM, 2007.
Sauer, T., Numerical Analysis. Boston, MA: Pearson, 2012.
Haberman, R., Applied Partial Differential Equations. Upper Saddle River, NJ: Pearson, 2004.
Draper, N.R. and H. Smith, Applied Regression Analysis, 3rd edn. New York: John Wiley & Sons,
1998.
Chatfield, C., Statistics for Technology, 3rd edn. London: Chapman and Hall, 1983.
Mendenhall, W. and T. Sincich, A Second Course in Statistics Regression Analysis, 6th edn. Upper
Saddle River, NJ: Pearson Education International, 2003.
Devore, J. and N. Farnum, Applied Statistics for Engineers and Scientists, 2nd edn. Belmont, CA:
Thomson, 2005.
Montgomery, D.C., Design and Analysis of Experiments, 7th edn. Hoboken, NJ: John Wiley &
Sons, 2009.
Index