0% found this document useful (0 votes)
50 views32 pages

Previewpdf

Uploaded by

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

Previewpdf

Uploaded by

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

A Numerical Primer

for the
Chemical Engineer
Second Edition
A Numerical Primer
for the
Chemical Engineer
Second Edition

Edwin Zondervan
MATLABr is a trademark of The MathWorks, Inc. and is used with permission. The Math-
Works does not warrant the accuracy of the text or exercises in this book. This book’s use
or discussion of MATLABr software or related products does not constitute endorsement
or sponsorship by The MathWorks of a particular pedagogical approach or particular use
of the MATLABr software.

CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
c 2020 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa business
No claim to original U.S. Government works
Printed on acid-free paper
International Standard Book Number-13: 978-1-138-31538-9 (Hardback)
This book contains information obtained from authentic and highly regarded sources. Rea-
sonable efforts have been made to publish reliable data and information, but the author
and publisher cannot assume responsibility for the validity of all materials or the conse-
quences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced in this publication and apologize to copyright holders if
permission to publish in this form has not been obtained. If any copyright material has not
been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted,
reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other
means, now known or hereafter invented, including photocopying, microfilming, and record-
ing, or in any information storage or retrieval system, without written permission from the
publishers.
For permission to photocopy or use material electronically from this work, please access
www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Cen-
ter, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-
for-profit organization that provides licenses and registration for a variety of users. For
organizations that have been granted a photocopy license by the CCC, a separate system
of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trade-
marks, and are used only for identification and explanation without intent to infringe.

Visit the Taylor & Francis Web site at


http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
In memory of my dear father,
Ekke Zondervan.
Contents

Introduction xiii

Preface xv

1 The role of models in chemical engineering 1


1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 The idea of a model . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Model building . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Model analysis . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Model solution strategies . . . . . . . . . . . . . . . . . . . 5
1.6 The seven-step modeling procedure . . . . . . . . . . . . . . 6
1.7 Ingredients of process models . . . . . . . . . . . . . . . . . 10
1.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2 Errors in computer simulations 13


2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2 Significant digits . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3 Round-off and truncation errors . . . . . . . . . . . . . . . . 14
2.4 Break errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 Loss of digits . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.6 Ill-conditioned problems . . . . . . . . . . . . . . . . . . . . 17
2.7 (Un-)stable methods . . . . . . . . . . . . . . . . . . . . . . 19
2.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

vii
viii Contents

3 Linear equations 21
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3 Linear systems . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.4 The inverse of a matrix . . . . . . . . . . . . . . . . . . . . 22
3.5 The determinant of a matrix . . . . . . . . . . . . . . . . . 23
3.6 Useful properties . . . . . . . . . . . . . . . . . . . . . . . . 24
3.7 Matrix ranking . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.8 Eigenvalues and eigenvectors . . . . . . . . . . . . . . . . . 26
3.9 Spectral decomposition . . . . . . . . . . . . . . . . . . . . 27
3.10 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.11 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

4 Elimination methods 31
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2 MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.3 Gaussian elimination . . . . . . . . . . . . . . . . . . . . . . 31
4.4 LU factorization . . . . . . . . . . . . . . . . . . . . . . . . 36
4.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5 Iterative methods 41
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.2 Laplace’s equation . . . . . . . . . . . . . . . . . . . . . . . 41
5.3 LU factorization . . . . . . . . . . . . . . . . . . . . . . . . 44
5.4 Iterative methods . . . . . . . . . . . . . . . . . . . . . . . . 45
5.5 The Jacobi method . . . . . . . . . . . . . . . . . . . . . . . 46
5.6 Example for the Jacobi method . . . . . . . . . . . . . . . . 49
5.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

6 Nonlinear equations 53
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.2 Newton method 1D . . . . . . . . . . . . . . . . . . . . . . 53
Contents ix

6.3 Newton method 2D . . . . . . . . . . . . . . . . . . . . . . 55


6.4 Reduced Newton step method . . . . . . . . . . . . . . . . . 56
6.5 Quasi-Newton method . . . . . . . . . . . . . . . . . . . . . 59
6.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

7 Ordinary differential equations 63


7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.2 Euler’s method . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.3 Accuracy and stability of Euler’s method . . . . . . . . . . 65
7.4 The implicit Euler method . . . . . . . . . . . . . . . . . . 67
7.5 Stability of the implicit Euler method . . . . . . . . . . . . 67
7.6 Systems of ODEs . . . . . . . . . . . . . . . . . . . . . . . . 68
7.7 Stability of ODE systems . . . . . . . . . . . . . . . . . . . 69
7.8 Stiffness of ODE systems . . . . . . . . . . . . . . . . . . . 71
7.9 Higher-order methods . . . . . . . . . . . . . . . . . . . . . 71
7.10 Boundary value problems . . . . . . . . . . . . . . . . . . . 74
7.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.12 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

8 Numerical integration 81
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.2 Euler’s method . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.3 The trapezoid method . . . . . . . . . . . . . . . . . . . . . 85
8.4 Simpson’s method . . . . . . . . . . . . . . . . . . . . . . . 86
8.5 Estimation of errors using numerical integration . . . . . . 87
8.6 The Richardson correction . . . . . . . . . . . . . . . . . . . 88
8.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
8.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

9 Partial differential equations 1 91


9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
9.2 Types of PDEs . . . . . . . . . . . . . . . . . . . . . . . . . 91
9.3 The method of lines . . . . . . . . . . . . . . . . . . . . . . 92
x Contents

9.4 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
9.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

10 Partial differential equations 2 99


10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.2 Transport PDEs . . . . . . . . . . . . . . . . . . . . . . . . 99
10.3 Finite volumes . . . . . . . . . . . . . . . . . . . . . . . . . 100
10.4 Discretizing the control volumes . . . . . . . . . . . . . . . 101
10.5 Transfer of heat to fluid in a pipe . . . . . . . . . . . . . . . 102
10.6 Simulation of the heat PDE . . . . . . . . . . . . . . . . . . 105
10.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
10.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

11 Data regression and curve fitting 109


11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
11.2 The least squares method . . . . . . . . . . . . . . . . . . . 109
11.3 Residual analysis . . . . . . . . . . . . . . . . . . . . . . . . 112
11.4 ANOVA analysis . . . . . . . . . . . . . . . . . . . . . . . . 114
11.5 Confidence limits . . . . . . . . . . . . . . . . . . . . . . . . 114
11.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
11.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

12 Optimization 117
12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
12.2 Linear programming . . . . . . . . . . . . . . . . . . . . . . 118
12.3 Nonlinear programming . . . . . . . . . . . . . . . . . . . . 120
12.4 Integer programming . . . . . . . . . . . . . . . . . . . . . . 122
12.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
12.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

13 Basics of MATLAB 129


13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
13.2 The MATLAB user interface . . . . . . . . . . . . . . . . . 129
Contents xi

13.3 The array structure . . . . . . . . . . . . . . . . . . . . . . 130


13.4 Basic calculations . . . . . . . . . . . . . . . . . . . . . . . . 131
13.5 Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
13.6 Reading and writing data . . . . . . . . . . . . . . . . . . . 134
13.7 Functions and m-files . . . . . . . . . . . . . . . . . . . . . . 134
13.8 Repetitive operations . . . . . . . . . . . . . . . . . . . . . . 135

14 Numerical methods in Excel 137


14.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
14.2 Basic functions in Excel . . . . . . . . . . . . . . . . . . . . 137
14.3 The Excel solver . . . . . . . . . . . . . . . . . . . . . . . . 137
14.4 Solving nonlinear equations in Excel . . . . . . . . . . . . . 139
14.5 Differentiation in Excel . . . . . . . . . . . . . . . . . . . . 141
14.6 Curve fitting in Excel . . . . . . . . . . . . . . . . . . . . . 141

15 Case studies 145


15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
15.2 Modeling a separation system . . . . . . . . . . . . . . . . . 145
15.3 Modeling a chemical reactor system . . . . . . . . . . . . . 146
15.4 PVT behavior of pure substances . . . . . . . . . . . . . . . 148
15.5 Dynamic modeling of a distillation column . . . . . . . . . . 151
15.6 Dynamic modeling of an extraction cascade (ODEs) . . . . 153
15.7 Distributed parameter models for a tubular reactor . . . . . 159
15.8 Modeling of an extraction column . . . . . . . . . . . . . . 161
15.9 Fitting of kinetic data . . . . . . . . . . . . . . . . . . . . . 165
15.10 Fitting of NRTL model parameters . . . . . . . . . . . . . . 167
15.11 Optimizing a crude oil refinery . . . . . . . . . . . . . . . . 171
15.12 Planning in a manufacturing line . . . . . . . . . . . . . . . 173

Bibliography 177

Index 181
Introduction

Since 2008 I have been lecturing a course on numerical methods, at first at


Eindhoven University in the Netherlands and since 2015 at Bremen University
in Germany. The course is set up specifically for chemical engineers. There are
good references for this subject, and everyone who has a heart for numerical
methods probably possesses the book Numerical Recipes by William Press
and co-authors.
When I started collecting material for the course, it began with the online ma-
terial of John Hult (Cambridge), who allowed me to use his materials with the
proper acknowledgments. I also discovered some materials concerning com-
puter errors from Roel Verstappen (Groningen), which I thought could be
important to incorporate in the course.
After development of MATLAB code, exercises, assignments, and lecture
slides, I thought it could be handy to put everything into a syllabus, as a
useful guide for the students attending the class.
In 2013, it turned into a real book and was published with CRC! After using
the book successfully in the last few years, I noticed that several corrections
and extensions were needed to further improve the book. For example, a more
detailed discussion on model development in the first chapter was needed. A
chapter on numerical integration was missing as well. I also thought a short
description on boundary value problems could be useful, as I was discussing
it in class, but it was not documented in the book.
After carefully making the modifications, I can proudly say that I am happy
that a second edition of my book is now released. A numerical primer for the
chemical engineer will give you a taste for this exciting field and prove that
this discipline is alive and vivid. There is a reference list with useful books and
papers. In case you are interested, you can contact me regarding MATLAB
code, references, and other course materials.
I hope this second edition will be a useful companion. Enjoy!

xiii
Preface

This book emphasizes the derivation and use of a variety of numerical methods
for solving chemical engineering problems. The algorithms are used to solve
linear equations, nonlinear equations, ordinary differential equations, and par-
tial differential equations. It also includes chapters on linear and nonlinear re-
gression, and on optimization. MATLAB R ∗ is adopted as the programming
environment throughout the book. MATLAB is a high-performance comput-
ing program. An introductory chapter on MATLAB basics has been added
and Excel users can find a chapter on the implementation of numerical meth-
ods in Excel. Worked-out examples are given in the case study chapter to
demonstrate the numerical techniques. Most of the examples were written in
MATLAB and are compatible with the latest versions of MATLAB.
It is important to mention that the main purpose of this book is to give
students a flavor for numerical methods and problem solving, rather than as
an in-depth guide to numerical analysis. The chapters end with small exercises
that students can use to familiarize themselves with the numerical methods.
The material in this book has been used in undergraduate and graduate
courses in the chemical engineering department of Eindhoven University of
Technology. To aid lecturers and students, course materials have also been
made available on the Web at http://www.crcpress.com/product/ISBN/
9781138315389.
Finally, the author would like to thank everyone who has been helpful and
supportive in the creation of this book, especially some of the PhD students
at Eindhoven University who have assisted during lectures and directly in-
fluenced the content of this book: Juan Pablo Gutierrez, Esayas Barega, and
Arend Dubbelboer.
Edwin Zondervan
January 2014

MATLAB is a registered trademark of The MathWorks, Inc. For product informa-
tion, please contact:
The MathWorks, Inc.
3 Apple Hill Drive
Natick, MA 01760-2098 USA
Tel: 508 647 7000
Fax: 508-647-7001
E-mail: info@mathworks.com
Web: www.mathworks.com

xv
1
The role of models in chemical engineering

1.1 Introduction
The concept of a model has been around since ancient times. Models appear in
all branches of science and engineering. However, it is often said that modeling
is more art than science or engineering. In this chapter we will discuss general
aspects of models, and more specifically the models that describe (chemical)
process systems. It is not intended as an in-depth discussion.
Ultimately, this book is about solving the developed models in a numerical
fashion. We could consider Ptolemy’s Amalgest (150 BC) as one of the first
recorded studies on modeling and numerical analysis in which numerical ap-
proximations to describe the motions of the heavenly bodies with accuracy
matching reality sufficiently were developed (Figure 1.1). This is basically the

FIGURE 1.1
(Left) An image of Ptolemy; (Right) Ptolemy’s model of our solar system

1
2 A Numerical Primer for the Chemical Engineer

essence of numerical analysis. Numerical analysis is concerned with obtaining


approximate solutions to problems while maintaining reasonable bounds of er-
ror, because it is often impossible to obtain exact answers. Numerical analysis
makes use of algorithms to approximate solutions. Model development and
solving the models is important to the world, for example in astronomy, con-
struction, agriculture, architecture, and, of course, in engineering! In chemical
engineering we use models and their (numerical) solutions to describe reactors
and separators (dynamic and steady state), to perform computational fluid
dynamics, to solve thermodynamic equations of state, to optimize process
performance, to design and synthesize processes, and to regress experimental
data, e.g., isotherms, kinetics, and so forth.

1.2 The idea of a model


In Figure 1.2 we can see an image by the Belgian surrealist Rene Magritte. It
is a pipe, and below this pipe is a sentence in French that says, “Ceci n’est
pas une pipe” (“this is not a pipe”). Actually, it is, indeed, not a pipe; it is an

FIGURE 1.2
“The Treachery of Images” by Rene Magritte
The role of models in chemical engineering 3

Type of model Criterion or classification


Mechanistic Based on mechanisms/underlying phenomena
(first principles)
Empirical Based on input-output data, trials or experiments
Stochastic Contains elements that are probabilistic in nature
Deterministic Based on cause–effect analysis
Lumped parameter Dependent variables not a function of spatial position
Distributed Dependent variables as a function of spatial position
parameter
Linear Superposition applies
Nonlinear Superposition does not apply
Continuous Dependent variables defined over continuous space
Discrete Only define for discrete values of time and/or space
Hybrid Containing continuous and discrete behavior

TABLE 1.1
Model types and their classifications

image of a pipe. Models are similar. Models are not the reality, they are an
approximate description of reality. Eykhoff [20] defines an engineering model
as a representation of the essential aspects of an existing system (or a system
to be constructed) which presents knowledge of that system in a usable form.
This implies basically that a model is (always) a simplification of reality. A
model as such can give insight into the behavior of the system under study, but
it does not always mean that this insight is phenomenological. For example,
if an engineer develops a controller for a distillation tower, he would like to
know how the distillation tower behaves dynamically. Whether this knowledge
is based on first principles or not is not really relevant for his purposes. In
Table 1.1 the different model types are listed.
The mathematical forms of the different model types can involve linear alge-
braic equations, nonlinear algebraic equations, ordinary differential equations,
differential algebraic equations and partial differential equations. Each of the
equation forms requires special techniques for solution.

1.3 Model building


Although there have been many attempts to structure the process of setting up
process models to describe phenomena or systems, the general notion is that
each modeling problem requires a custom-made approach. The applications
and requirements are so different that general model development strategies
would be extremely difficult and decisions regarding the modeling of a system
4 A Numerical Primer for the Chemical Engineer

can often best be made by an expert. However there is some kind of agreement
on the four elementary steps in the modeling process: problem definition,
design, evaluation and application.
In the problem definition phase, the modeling problem and the goal of the
model are properly formulated. This formulation is based on performance and
structure requirements with respect to the application and on the modeling
expertise of the modeler. In the design phase, the structure and key variables
of the model are identified.
For mechanistic models, the structure of the model reflects the physical struc-
ture of the system. This often means that additional steps have to be taken
such as the formulation of physical and chemical laws and a proper translation
of the major assumptions made in the design stage.
Key in the process is the application of conservation principles for conserved
extensive quantities. Another important component is the development of con-
stitutive relations, which are normally used to complete the model.
The conservation principle holds for mass, energy and momentum, and states
that these quantities are neither destroyed or created but simply change form.
Conservation principles lead to typical gas-liquid-solid systems involving the
mass, component and energy balances. In particulate systems, particle number
balances for the generation of population balance equations are also consid-
ered.
Constitutive relations are normally algebraic equations. Constitutive equa-
tions describe five classes of relations in a model, the mass, energy/heat trans-
fer, the reaction rate expressions, the so-called property relations (thermody-
namic constants and relations), the balance volume relations which define the
connections between mass and energy, and the equipment and control con-
straints. For a detailed description of conservation and constitutive equations
the reader is referred to Hangos and Cameron [25].
In the evaluation phase the model is verified with respect to its structure and
the results of the model are validated with the real world situation. In this
phase also the requirements with respect to model structure as formulated
in the problem definition phase are evaluated. If all criteria are satisfied, the
model can be applied.

1.4 Model analysis


The analysis or evaluation of models concerns two parts: numerical perfor-
mance validation and model structure verification. Validation and verification
are two strictly different criteria for model analysis.
The role of models in chemical engineering 5

Verification is related to the mathematical correctness of the model structure.


Using commonsense is of importance, but there are also instruments available
which aid the verification process. For example, one could study the range in
which the parameters of the model are valid, or one could study the sensitivity
of the parameters in relation to the outputs of the model. Models should be
kept as simple as possible. If one model contains more parameters than another
its performance can be better but it is also more complex. There are structure
tests available that quantify the model structure on the basis of modeling error
and model complexity. One of these tests is, for example, Akaike’s information
criterion.
In model validation the outputs of the model are compared with actual mea-
surements from the system to determine whether the model describes the
real system adequately. Cross-parameter validation, residual tests, and the
root mean squared error are a few examples of model validation instruments.
Chapter 11 on data regression will discuss model validation in more detail.

1.5 Model solution strategies


The main objective of this book is to prime the reader with the actual numeri-
cal solution strategies to the formulated process models. In Table 1.2 common
solution approaches are listed for different equation systems.

Equation system Solution strategy


Linear Matrix inversion
Ch. 2,3,4 Gaussian elimination
Jacobi method
Nonlinear Newton’s method
Ch. 5 Secant method
Broyden’s method
ODEs Euler’s method (implicit/explicit)
Ch. 6 Runge Kutta method
PDEs Method of lines
Ch. 7,8 Finite Volume Method

TABLE 1.2
Model types and solution strategies
6 A Numerical Primer for the Chemical Engineer

1.6 The seven-step modeling procedure


In setting up models for engineering application, a good practice is to follow
a well-described sequence of modeling steps. Several modeling methodologies
have been proposed, but here we will follow the seven-step procedure discussed
in Cameron and Hangos.
You should understand that development of the model through a sequence of
steps often leads to iterations—moving up and down through the modeling
steps—especially when unusual or unwanted developments occur later in the
process. No one gets it right the first time.
Before starting the setup of a process model, the problem definition should be
clearly stated. This defines the process, the modeling goal, and the validation
criteria. These decisions precede the seven-step modeling procedure, which
is given in the form of an algorithmic problem. An algorithm is a systematic
procedure for carrying out the modeling task. Figure 1.3 shows the systematic
modeling procedure of Cameron and Hangos.
For an algorithmic problem, you should formally specify the following items:

1. The inputs to the problem should be listed in the “Given” section.


2. The desired output of the procedure should be listed in the “Find”
or “Compute” section.
3. The method description should be listed in the “Procedure” or
“Solution” section.

By following the above principles, the following algorithmic problem statement


can be constructed.
The seven-step modeling procedure:
Given:

1. A process system
2. A modeling goal
3. Validation criteria
4. A mathematical model
The role of models in chemical engineering 7

FIGURE 1.3
Systematic model building steps

The seven steps for model development:


Step 1: Define the problem
In Step 1, all relevant inputs and outputs have to be fixed. The type of spatial
distribution has to be defined (i.e., distributed or lumped models), and the
necessary range and accuracy of the model need to be specified. Additionally,
the time characteristics of the model should be identified (i.e., stationary or
dynamic).
Step 2: Identify the controlling factors or mechanisms
The next step is to explore the physicochemical processes and phenomena
taking place in the system that are related to our modeling goal. These are
called the controlling factors or mechanisms. The most common controlling
8 A Numerical Primer for the Chemical Engineer

factors include (1) chemical reaction, (2) diffusion, (3) conduction of heat, (4)
forced convection heat transfer, (5) free convection heat transfer, (6) radiation
heat transfer, (7) evaporation, (8) turbulent mixing, (9) heat or mass transfer
through a boundary layer, and (10) fluid flow.
When modeling, we must understand that there is a set of process charac-
teristics that are never fully identified. We often only identify and include a
subset of essential characteristics in the model, which means that some es-
sential characteristics might be missing from our model description. It could
also very well happen that we include unnecessary complexity in our model
or include process characteristics that are actually not part of the system.
The issues sketched above are not easy to deal with and depend strongly on
our understanding of the system. Model validation is key here.
One cannot take all possible controlling mechanisms into account, and for that
reason, a filter should be applied when considering the following key elements:

1. The hierarchy level(s) relevant to the model


2. The type of spatial distribution
3. The necessary range and accuracy
4. The time characteristics

Step 3: Evaluate data for the problem


Models of real process systems are of the gray-box type: we almost always
need to use either measured process data directly or estimate parameter val-
ues in our models. It is important to consider both measured process data
and parameter values together with their uncertainties or precision. Typi-
cally, industrial measured data has uncertainties between 10 and 30#, while
laboratory or pilot plant data has uncertainty ranges of 5%–20%, but, for
example, reaction kinetic data can have uncertainties up to 500%!
In Step 3, we need to look at the data required for modeling, found in literature
or measured directly. The outcomes of this data evaluation might lead us back
to the decisions in Steps 1 and 2.
Step 4: Develop a set of model equations
The equations in a process model are either differential (partial as well as
ordinary) or algebraic in nature. Differential equations originate from conser-
vation balances; therefore, they can be termed balance equations. Algebraic
equations are usually of mixed origin and are generally called constitutive
equations.
Step 5: Find and implement a solution procedure
After setup of the mathematical model, we must identify its mathematical
form and find or implement a solution procedure. In all cases we must make
sure that the model is well posed; that is, excess variables or all degrees of
The role of models in chemical engineering 9

freedom are satisfied. We must also try to avoid numerical problems, such
as high index systems. Lack of solution techniques may prevent a modeler
using a particular type of process model, and that can lead to additional
simplifications. This could be the case with distributed parameter process
models.
Step 6: Verify the model solution
Verification is determining whether the model is behaving correctly. Is it coded
correctly and giving you the intended answer? This is not the same as model
validation, where we check the model against reality. You need to check care-
fully that the model is correctly implemented. One aspect is the correct pro-
gramming practice, where a top-down algorithm design can help out. The
other component is to verify whether the model exhibits the right qualita-
tive characteristics; for example, if modeling a reactor, an increase in reactor
temperature should deliver an increase in conversion.
Step 7: Validate the model
Model validation concerns the determination of the quality of the model as
compared to independent observations or assumptions. Often only a partial
validation is carried out in practical cases, depending on the modeling goal.
There are several possibilities to validate a process model. The actual vali-
dation method strongly depends on the process system, the modeling goal,
and the possibilities of getting independent information for validation. These
possibilities include:

1. Experimentally verify the assumptions.


2. Compare the model behavior with the process behavior.
3. Develop analytical models for simplified cases and compare behav-
ior.
4. Compare with other models using a common problem.
5. Compare the model directly with process data.

The tools to carry out this task include the use of sensitivity analysis to
identify the key controlling inputs or system parameters as well as the use
of statistical validation tests. They can involve hypothesis testing and the
use of various measures such as averages, variances, maxima, minima, and
correlation factors.
If the validation results show that the developed model is not suitable for a
modeling goal, then one has to return to Step 2 and perform the sequence
again. Usually validation results indicate how to improve the model. We can
often identify inadequate areas in our model development, and for that reason,
not all modeling efforts are lost. Once more, it is mentioned that often one
has to move up and down through the seven-step modeling hierarchy in an
iterative fashion.
10 A Numerical Primer for the Chemical Engineer

1.7 Ingredients of process models


The modeling procedure described in the previous section demonstrates that
a model resulting from this procedure is not simply a set of equations. It
incorporates a lot more information. To encourage clarity of presentation and
consistency of the process model, a structural presentation incorporating all
key ingredients is suggested.
List the:

1. Assumptions: time characteristics, spatial characteristics, flow con-


ditions, controlling mechanisms or factors, neglected dependencies
(such as temperature or concentration dependency of physicochem-
ical properties), and the required range of states and associated
accuracy.
2. Model equations and characterizing variables: the differential (bal-
ance) equations for
a. overall mass, component masses for all components for all
phases in all equipment at hierarchical levels, energy (or en-
thalpy) and momentum
b. constitutive equations for mass transfer, heat/energy transfer
and reaction rates, property relations (thermodynamic rela-
tions for equilibrium, temperature pressure, and composition),
balance volume relations (relationships between mass and en-
ergy balance regions), and equipment and control equations.
3. Initial conditions: needed for differential balance equations in dy-
namic process models.
4. Boundary conditions: must be specified for differential balance equa-
tions in spatially distributed process models.
5. Parameters: the values and/or sources of the parameters have to be
specified with their units and precision.

1.8 Summary
In this chapter the role of models in chemical engineering was briefly dis-
cussed. First, the basic definition of a model was introduced. Subsequently a
common way of model building was discussed, starting with a problem defi-
nition phase, followed by design, evaluation, and application. After the model
The role of models in chemical engineering 11

building phase, model analysis is done in two ways: the mathematical cor-
rectness of the model (model verification) and the numerical performance of
the model (model validation). In the final section, a short overview of model
solution strategies was given.

1.9 Exercises
Exercise 1

Describe the major steps to be taken when building a model of a process


system, and explain the reason for each step.

Exercise 2

Explain the differences between stochastic, empirical, and mechanistic models.


Describe which factors make it difficult or easy to develop these models?

Exercise 3

Review what kinds of models are used in a particular industry sector (select,
for example, the food, petrochemical, or pharmaceutical industries) and why
they are used. Discuss how the modeling efforts relate to the potential benefits
derived from their use?
Bibliography

[1] Asbjornsen, O. A. and T. Hertzberg (1974). “Constrained regression in


chemical engineering practice.” Chemical Engineering Science 29(3): 679.
[2] Ataie-Ashtiani, B. and S. A. Hosseini (2005). “Error analysis of finite
difference methods for two-dimensional advection-dispersion-reaction equa-
tion.” Advances in Water Resources 28(8): 793.
[3] Baleo, J. N. and P. Le Cloirec (2000). “Validating a prediction method of
mean residence time spatial distributions.” AIChE Journal 46(4): 675.
[4] Balendra, S. and I. D. L. Bogle (2009). “Modular global optimisation in
chemical engineering.” Journal of Global Optimization 45(1): 169.
[5] Biegler, L. T. and I. E. Grossmann (2004). “Retrospective on optimiza-
tion.” Computers and Chemical Engineering 28(8): 1169.
[6] Biegler, L. T., I. E. Grossmann, et al. (1997). Systematic Methods of Chem-
ical Process Design, Prentice Hall.
[7] Botte, G. G., J. A. Ritter, et al. (2000). “Comparison of finite difference
and control volume methods for solving differential equations.” Computers
and Chemical Engineering 24(12): 2633.
[8] Burghoff, B., E. Zondervan, et al. (2009). “Phenol extraction with Cyanex
923: Kinetics of the solvent impregnated resin application.” Reactive and
Functional Polymers 69(4): 264.
[9] Carmo Coimbra, M. D., C. Sereno, et al. (2000). “Modelling multicom-
ponent adsorption process by a moving finite element method.” Journal of
Computational and Applied Mathematics 115(1–2): 169.
[10] Caussignac, P. and R. Touzan (1990). “Solution of three-dimensional
boundary layer equations by a discontinuous finite element method, part
I: Numerical analysis of a linear model problem.” Computer Methods in
Applied Mechanics and Engineering 78(3): 249.
[11] Chen, H. S. and M. A. Stadtherr (1984). “On solving large sparse non-
linear equation systems.” Computers and Chemical Engineering 8(1): 1.

13
14 A Numerical Primer for the Chemical Engineer

[12] Chen, W. S., B. R. Bakshi, et al. (2004). “Bayesian estimation via sequen-
tial Monte Carlo sampling: Unconstrained nonlinear dynamic systems.” In-
dustrial and Engineering Chemistry Research 43(14): 4012.
[13] Coimbra, M. D. C., C. Sereno, et al. (2004). “Moving finite element
method: Applications to science and engineering problems.” Computers and
Chemical Engineering 28(5): 597.
[14] Cruz, P., J. C. Santos, et al. (2005). “Simulation of separation processes
using finite volume method.” Computers and Chemical Engineering 30(1):
83.
[15] de Jong, M. C., R. Feijt, et al. (2009). “Reaction kinetics of the ester-
ification of myristic acid with isopropanol and n-propanol using p-toluene
sulphonic acid as catalyst.” Applied Catalysis A: General 365(1): 141.
[16] Des Costello (1992). Dynamic Modelling of a Small Scale Liquid-Liquid
Extraction Rig, Ph.D. thesis, Edinburgh University.
[17] Dormand, J. R. and P. J. Prince (1980). “A family of embedded Runge-
Kutta formulae.” Journal of Computational and Applied Mathematics
6(1): 19–26.
[18] Edgar, T. F., D. M. Himmelblau, et al. (2001). Optimization of Chemical
Processes, McGraw-Hill.
[19] Evangelista, F. (2005). “Dynamics of shell and tube heat exchangers: New
insights and time-domain solutions.” 7th World Congress of Chemical En-
gineering, GLASGOW2005, incorporating the 5th European Congress of
Chemical Engineering.
[20] Eykhoff, P. (1974). System Identification: Parameter and State Estima-
tion, Wiley & Sons.
[21] Floudas, C. A. and X. Lin (2004). “Continuous-time versus discrete-time
approaches for scheduling of chemical processes: A review.” Computers and
Chemical Engineering 28(11): 2109.
[22] Golub, G. H. and C. F. v. Loan (1996). Matrix Computations, The John
Hopkins University Press.
[23] Gritton, K. S., J. D. Seader, et al. (2001). “Global homotopy continuation
procedures for seeking all roots of a nonlinear equation.” Computers and
Chemical Engineering 25(7–8): 1003.
[24] Hahn, B.H. and Valentine, D.T. (2010). Essential MATLAB for Engi-
neers and Scientists, Academic Press.
[25] Hangos, K. and Cameron, I. (2001). Process Modeling and Model Analy-
sis, Academic Press.
Bibliography 15

[26] Hartland, S. and A. Kumar (1997). Design of Liquid-Liquid Extractors,


Mineral Processing and Extractive Metallurgy Review, 17(1), 43–79

[27] Ierapetritou, M. G. and C. A. Floudas (1998). “Effective continuous-time


formulation for short-term scheduling. 1. Multipurpose batch processes.” In-
dustrial and Engineering Chemistry Research 37(11): 4341.
[28] Kiyofumi Kurihara, Mikiyoshi Nakamichi, and Kazuo Kojima (1993). Iso-
baric Vapor-Liquid Equilibria for Methanol + Ethanol + Water and the
Three Constituent Binary Systems, J. Chem. Eng. Data 38, 446–449.
[29] Koster, L. G., E. Gazi, et al. (1992). “Finite elements for near-singular
systems - an overview.” Computers & Chemical Engineering 16(Supple-
ment 1): S43.
[30] Kruger, U., Y. Zhou, et al. (2008). “Robust partial least squares regression:
Part I, algorithmic developments.” Journal of Chemometrics 22(1): 1.
[31] Kumar, J., G. Warnecke, et al. (2009). “Comparison of numerical meth-
ods for solving population balance equations incorporating aggregation and
breakage.” Powder Technology 189(2): 218.
[32] Kuno, M. and J. D. Seader (1988). “Computing all real solutions to sys-
tems of nonlinear equations with a global fixed-point homotopy.” Industrial
and Engineering Chemistry Research 27(7): 1320.
[33] Liu, F. and S. K. Bhatia (2001). “Solution techniques for transport prob-
lems involving steep concentration gradients: Application to noncatalytic
fluid solid reactions.” Computers and Chemical Engineering 25(9–10):
1159.
[34] Lohmann, T., H. G. Bock, et al. (1992). “Numerical methods for parame-
ter estimation and optimal experiment design in chemical reaction systems.”
Industrial & Engineering Chemistry Research 31(1): 54.
[35] Martinez, E. C., M. D. Cristaldi, et al. (2009). “Design of dynamic ex-
periments in modeling for optimization of batch processes.” Industrial and
Engineering Chemistry Research 48(7): 3453.
[36] Marwuardt, D. W. (1963). “An algorithm for least-squares estimation of
nonlinear parameters.” J. Soc. Indust. Appl. Math. 11(2): 431-441.
[37] McCann, N. and M. Maeder (2009). “Tutorial: The modelling of chemical
processes.” Analytica Chimica Acta 647(1): 31.
[38] Mosbach, S. and A. G. Turner (2009). “A quantitative probabilistic in-
vestigation into the accumulation of rounding errors in numerical ODE
solution.” Computers & Mathematics with Applications 57(7): 1157.
16 A Numerical Primer for the Chemical Engineer

[39] Motz, S., A. Mitrovic, et al. (2002). “Comparison of numerical meth-


ods for the simulation of dispersed phase systems.” Chemical Engineering
Science 57(20): 4329.
[40] Murthi, M., L. D. Shea, et al. (2009). “Numerical problems and agent-
based models: For a mass transfer course.” Chemical Engineering Education
43(2): 153.
[41] Oberkampf, W. L., S. M. DeLand, et al. (2002). “Error and uncertainty in
modeling and simulation.” Reliability Engineering & System Safety 75(3):
333.
[42] Patankar, S. V. and D. B. Spalding (1972). “A calculation procedure for
heat, mass and momentum transfer in three-dimensional parabolic flows.”
International Journal of Heat and Mass Transfer 15(10): 1787.
[43] Pistikopoulos, E. N. and M. G. Ierapetritou (1995). “Novel approach for
optimal process design under uncertainty.” Computers and Chemical Engi-
neering 19(10): 1089.
[44] Sahinidis, N. V. (2004). “Optimization under uncertainty: State-of-the-art
and opportunities.” Computers and Chemical Engineering 28(6–7): 971.
[45] Schittkowski, K. (2004). “Data fitting in partial differential algebraic
equations: Some academic and industrial applications.” Journal of Com-
putational and Applied Mathematics 163(1): 29.
[46] Schuermans, M., I. Markovsky, et al. (2007). “An adapted version of the
element-wise weighted total least squares method for applications in chemo-
metrics.” Chemometrics and Intelligent Laboratory Systems 85(1): 40.
[47] Seth, D., A. Sarkar, et al. (2005). “Uncertainties in the simulation of
catalytic distillation process: A systematic grid refinement study.” Chemical
Engineering Science 60(20): 5445.
[48] Skogestad, S. (2004). “Dynamics and control of distillation columns: A
tutorial introduction.” Trans. IChemE 75(PART A): 539.
[49] Sousa Jr., R., D. M. dos Anjos, et al. (2008). “Modeling and simulation of
the anode in direct ethanol fuels cells.” Journal of Power Sources 180(1):
283.
[50] Zitney, S. E. and M. A. Stadtherr (1993). “Frontal algorithms for
equation-based chemical process flowsheeting on vector and parallel com-
puters.” Computers and Chemical Engineering 17(4): 319.
[51] Zondervan, E., B. H. L. Betlem, et al. (2007). “Development of a dynamic
model for cleaning ultra filtration membranes fouled by surface water.” Jour-
nal of Membrane Science 289(1–2): 26.

You might also like

pFad - Phonifier reborn

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

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


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy