Download ebooks file (Ebook) Computational Techniques for Process Simulation and Analysis Using MATLAB® by Niket S. Kaisare ISBN 9781138746084, 9781315119519, 9781498762113, 1138746088, 131511951X, 1498762115 all chapters
Download ebooks file (Ebook) Computational Techniques for Process Simulation and Analysis Using MATLAB® by Niket S. Kaisare ISBN 9781138746084, 9781315119519, 9781498762113, 1138746088, 131511951X, 1498762115 all chapters
com
DOWLOAD EBOOK
ebooknice.com
ebooknice.com
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
ebooknice.com
ebooknice.com
(Ebook) Cambridge IGCSE and O Level History Workbook 2C -
Depth Study: the United States, 1919-41 2nd Edition by
Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
ebooknice.com
ebooknice.com
https://ebooknice.com/product/vibration-simulation-using-matlab-and-
ansys-1116060
ebooknice.com
Computational Techniques for
Process Simulation and Analysis
Using MATLAB®
Computational Techniques for
Process Simulation and Analysis
Using MATLAB®
Niket S. Kaisare
MATLAB ® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does not warrant the accuracy
of the text or exercises in this book. This book’s use or discussion of MATLAB ® software or related products does not constitute
endorsement or sponsorship by The MathWorks of a particular pedagogical approach or particular use of the MATLAB ® software.
CRC Press
Taylor & Francis Group,
6000 Broken Sound Parkway NW, Suite 300,
Boca Raton, FL 33487-2742
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to pub-
lish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the
consequences 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 recording, 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 Center, 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 trademarks, and are used only for identification
and explanation without intent to infringe.
Preface, xix
Author, xxiii
vii
viii ◾ Contents
Chapter 7 ◾ Special Methods for Linear and Nonlinear Equations 273
7.1 GENERAL SETUP 273
7.1.1 Ordinary Differential Equation–Boundary Value Problems 274
7.1.2 Elliptic PDEs 274
7.1.3 Outlook of This Chapter 275
7.2 TRIDIAGONAL AND BANDED SYSTEMS 275
7.2.1 What Is a Banded System? 275
7.2.1.1 Tridiagonal Matrix 276
7.2.2 Thomas Algorithm a.k.a TDMA 276
7.2.2.1 Heat Conduction Problem 277
7.2.2.2 Thomas Algorithm 281
7.2.3 ODE-BVP with Flux Specified at Boundary 285
7.2.4 Extension to Banded Systems 288
7.2.5 Elliptic PDEs in Two Dimensions 289
7.3 ITERATIVE METHODS 290
7.3.1 Gauss-Siedel Method 291
7.3.2 Iterative Method with Under-Relaxation 295
7.4 NONLINEAR BANDED SYSTEMS 296
7.4.1 Nonlinear ODE-BVP Example 296
7.4.1.1 Heat Conduction with Radiative Heat Loss 297
7.4.2 Modified Successive Linearization–Based Approach 298
7.4.3 Gauss-Siedel with Linearization of Source Term 302
7.4.4 Using fsolve with Sparse Systems 304
7.5 EXAMPLES 304
7.5.1 Heat Conduction with Convective or Radiative Losses 304
7.5.2 Diffusion and Reaction in a Catalyst Pellet 305
xiv ◾ Contents
BIBLIOGRAPHY, 527
INDEX, 529
Preface
S tudents today are expected to know one or more of the several computing or simu-
lation tools as part of their curriculum, due to their widespread use in the industry.
MATLAB® has become one of the prominent languages used in research and industry.
MATLAB is a numerical computing environment that is based on a MATLAB scripting
language. MathWorks, the makers of MATLAB, describe it as “the language of technical
computing.” The focus of this book will be to highlight the use of MATLAB in technical
computing or, more specifically, in solving problems in the analysis and simulation of pro-
cesses of interest to engineers.
This is intended to be an intermediate-level book, geared toward postgraduate students,
practicing engineers, and researchers who use MATLAB. It provides advanced treatment
of topics relevant to modeling, simulation, and analysis of dynamical systems. Although
this is not an introductory MATLAB or numerical techniques textbook, it may however
be used as a companion book for introductory courses. For the sake of completeness, a
primer on MATLAB as well as introduction to some numerical techniques is provided in
the Appendices. Since mid-2000s,we have always used MATLAB in electives in IIT Madras.
The popularity of MATLAB among students led us to start a core undergraduate (sopho-
more) and a postgraduate (first-year masters) laboratory. Since 2016, I have started teach-
ing a massive open online course (MOOC) on MATLAB programming on the NPTEL
platform.* The first two years of this course had over 10,000 enrolled students. Needless to
say, MATLAB has become an important tool in teaching and research. The focus of all the
above courses is to introduce students to MATLAB as a numerical methods tool. Some of
the students who complete these courses inquire about the next-level courses that would
help them apply MATLAB skills to solve engineering problems. This book may also be used
for this purpose. In introductory courses, a significant amount of time is spent in develop-
ing the background for numerical methods itself. In our effort to make the treatment gen-
eral and at a beginner’s level, we eschew real-world examples in favor of abstracted ones.
For example, we would often introduce a second-order ODE using a generic formulation,
such as y″ + ay′ + b(y − c) = 0. A sophomore who hasn’t taken a heat transfer course may
not yet appreciate a “heating in a rod” problem. An intermediate-level text means that it
is more valuable to use a real example, such as T″ + r−1T′ + β(T − Ta) = 0. The utility of such
* NPTEL stands for National Programme for Technology Enhanced Learning and is a Government of India−funded initiative
to bring high-quality engineering and science courses on an online (MOOC) platform to enhance students’ learning.
xix
xx ◾ Preface
an approach cannot be understated, since it allows the freedom to introduce some of the
complexity that engineers, scientists, and researchers face in their work.
The value of using real-world examples was highlighted during my experience in indus-
trial R&D, where we used MATLAB extensively. We needed to interface with cross-func-
tional teams: engineering, implementation, and software development teams. Individuals
came from a wide range of backgrounds. These interactions exposed me to a new experi-
ence: Your work must be understood by people with very different backgrounds, who may
not speak the same technical language. The codes had to bridge the “language barrier”
spoken in different teams, and the codes were to be combined with a reasonably intuitive
interface. I have tried to adopt some of these principles in this book, without moving too far
from the more common pedagogy in creating such a book.
Thus, a practically oriented text that caters to an intermediate-level audience is my objec-
tive in writing this book.
systems. The “process” is the focus. Numerical methods are introduced insofar as is essen-
tial to make a judicious choice of algorithms for simulation and analysis.
PREREQUISITES
Since this is a postgraduate-level text, some familiarity with an undergraduate-level
numerical techniques or an equivalent course is assumed, though we will review all the
relevant concepts at the appropriate stage. So, the students are not expected to remem-
ber the details or nuances of “Newton-Raphson” or “Runge-Kutta” methods, but this
book is not the first time they hear these terms.
Some familiarity with coding (MATLAB, Fortran, C++, Python, or any language)
will be useful, but not a prerequisite. MATLAB primer is provided in the Appendix for
first-time users of MATLAB. Finally, with respect to writing MATLAB code, I focus on
“doing it right the first time” approach—by bringing in good programming practices
that I have learnt over the years. Things like commenting and structuring your code,
scoping of variables, etc., are also covered, not as an afterthought but as an integral part
of the discussion. However, these are dealt with more informally than a “programming
language” course.
xxiii
CHAPTER 1
Introduction
1.1 OVERVIEW
1.1.1 A General Model
This book is targeted toward postgraduate students, senior undergraduates, researchers, and
practicing engineers to provide them with a practical guide for using MATLAB® for process
simulation and numerical analysis. MATLAB was listed among the top ten programming
languages by the IEEE Spectrum magazine in 2015 (a list that was topped by Java, followed by
C and C++). While the basics of MATLAB can be learnt through various sources, the focus
of this book is on the analysis and simulation of processes of interest to engineers.
The terms “analysis” and “simulation” are generic terms that define a rather broad spectrum
of problems and solution techniques. Engineering is a discipline that deals with the transfor-
mation of raw material, momentum, or energy. Thus, this book will focus on those process
examples where the variables of interest vary with time and/or space, including the relationship
of these state variables with their properties. I will use an example of a reactor-separator process
in Section 1.1.2 to illustrate this. While this is a chemical engineering example, the treatment in
this book is general enough for other engineering and science disciplines to also find it useful.
The problems mentioned above that are considered in this book include ordinary and
partial differential equations (ODEs and PDEs), algebraic equations (either linear or non-
linear), or combinations thereof. The three sections of this book are organized based on the
computational methodology and analysis tools that will be used for the respective problems.
Section I of this book includes Chapters 2 through 5 and deals with ODE-IVPs (initial
value problems) as well as the problems that can be converted into a standard form that can
be solved with ODE-IVP tools. A generic ODE-IVP is of the type
dy
= f ( t ,y ;f
f) (1.1)
dt
where
t is an independent variable
y ∈ R n is a vector of dependent variables
ϕ represents parameters
1
2 ◾ Computational Techniques for Process Simulation and Analysis Using MATLAB®
0 = g ( x;f
f) (1.2)
where
x ∈ R m is a vector of dependent variables
ϕ represents parameters
Nonlinear algebraic equations, such as Equation 1.2, fall under this category. Moreover,
ODE-BVPs (boundary value problems) and several PDEs are also converted into the form
of Equation 1.2. Section II will not only cover techniques to solve algebraic equations but
also expound methods to convert ODEs/PDEs to this form. A combination of Equations 1.1
and 1.2, called differential algebraic equations (DAEs), is covered in Chapter 8. Chapters 5
and 9 are the concluding chapters of the first two sections. They build on the concepts from
the preceding chapters in the respective sections for the analysis of dynamical systems and
provide an introduction to advanced topics in simulations.
Finally, Chapter 10, included in Section III, deals with the parameter estimation prob-
lem, that is, to compute the parameter vector, ϕ, that best fits the experimental data.
dx A
F = -r ( x A ) , x A V =0 = xin (1.3)
dV
Ffeed Fr, xr P, xp
D, xD Purge
Fin, xin
F, xf
F, xf
B, xB
FIGURE 1.1 A typical process consisting of a reactor and a separator, with a recycle.
Introduction ◾ 3
The reactor outlet conditions are obtained by solving the ODE-IVP above. ODE-IVP prob-
lems are covered in Chapter 3 of this book. If a dynamic response of the PFR is required,
the resulting model is a PDE, where the state variable of interest varies in both space and
time. Solutions to transient PDEs are covered in Chapter 4. Advanced topics in simulation
are presented in Chapter 5, for example, when the inlet conditions or model parameters
vary with time and/or space.
The distillation column consists of N nonlinear algebraic equations in N unknowns (mole
fractions on each tray). For example, one of the model equations for the kth tray is given by
ax i
0 = ( Li -1 xi -1 - Li xi ) + (Vi +1 yi +1 - Vi yi ) where yi = (1.4)
1 + ( a - 1) xi
Such balance equations are written for each ideal stage of the distillation column, resulting
in N nonlinear algebraic equations that need to be solved simultaneously to obtain N vari-
ables. These are further discussed in Chapter 6.
Axial dispersion is neglected while deriving the model (Equation 1.3). Inclusion of the
axial dispersion term converts this IVP to a BVP, which is covered in Chapter 7. Discretizing
the ODE-BVP results in a set of equations with a special matrix structure. Mass transfer
limitations result in DAEs, which are covered in Chapter 8.
MATLAB is instead provided in Appendix A. This book follows the principle of “learn it
right the first time.” Good programming hygiene, in writing MATLAB codes, is evange-
lized and implemented right from the first example. The book follows another principle
that the best way to learn programming is through extensive practice. MathWorks, the
parent company that develops MATLAB, has good introductory video tutorials, available
at: http://in.mathworks.com/products/matlab/videos.html.* A beginner may want to start
with their “Getting Started” videos.† I also have an introductory MOOC course on using
MATLAB for numerical computations on National Programme for Technology Enhanced
Learning.‡
Figure 1.2 shows a screenshot of MATLAB window. The main section contains two
windows: MATLAB editor at the top and MATLAB command window at the bottom. The
MATLAB editor currently shows the MATLAB file firstFlowSheet.m, which is a
“driver script” to simulate the reactor-separator flow sheet described above. Line number
13 shows the following statement:
[F,x,err] = solveFlowSheet(Ffeed,Vpfr,purge,initVal);
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com