Docsity

Numerical Techniques for Chemical, Notas de estudo de Engenharia Elétrica

Pré-visualização parcial do texto

Baixe Numerical Techniques for Chemical e outras Notas de estudo em PDF para Engenharia Elétrica, somente na Docsity!

Numerical Techniques

for Chemical and

Biological Engineers

Using

MATLAB®

Numerical Techniques

for Chemical and

Biological Engineers

Using

MATLAB®

A Simple

Bifurcation

Approach

Said Elnashaie

Frank Uhlig

with the assistance of

Chadia Affane

SAID ELNASAIE

Born 1947, Cairo/Egypt; grew up in Egypt; married, two children, three grandchildren. Chemical Engineering student at Cairo University, University of Waterloo, and University of Edinburgh. B. S., Cairo University, 1968; M.S., U of Waterloo, Canada, 1970; Ph.D., U Edinburgh, UK, 1973. Postdoc, University of Toronto and McGill U, 1973 – 1974. Professor, Cairo University, 1974 – 1992; King Saud University, Saudi Arabia, 1986 – 1996; University of British Columbia, Canada, 1990; University Putra Malaysia, 1996/97; King Fahad University, Saudi Arabia, 1999; Auburn University, 1999 – 2005; Visiting Professor, U British Columbia, Vancouver, 2004; U British Columbia, Vancouver, 2005 – Vice President, Environmental Energy Systems and Services (EESS), Egypt, 1996 – 1998. Research Areas: Modeling, Simulation and Optimization of Chemical and Biological Processes, Clean Fuels (Hydrogen, Biodiesel and Ethanol), Fixed and Fluidized Bed Catalytic Reactors, Nonlinear Dynamics, Bifurcation and Chaos, Clean Technology, Utilization of Renewable Materials, Sustainable Engineering. 300+ papers, 3+ books. [email protected]

FRANK U HLIG

Born 1945, M¨agdesprung, Germany; grew up in M¨ulheim/Ruhr, Germany; married, two sons. Mathematics student at University of Cologne, California Institute of Technology. Ph.D. CalTech 1972; Assistant, University of W¨urzburg, RWTH Aachen, Germany, 1972 – 1982. Two Habilitations (Mathematics), University of W¨urzburg 1977, RWTH Aachen 1978. Visiting Professor, Oregon State University 1979/1980; Professor of Mathematics, Auburn University 1982 – Two Fulbright Grants; (Co-)organizer of eight research conferences. Research Areas: Linear Algebra, Matrix Theory, Numerical Analysis, Numerical Algebra, Geometry, Krein Spaces, Graph Theory, Mechanics, Inverse Problems, Mathematical Education, Applied Mathematics, Geometric Computing. 50+ papers, 3+ books. [email protected] www.auburn.edu/~uhligfd

v

C HADIA A FFANE

Born 1968, Fes/Morocco; grew up in Morocco; married, two children. Engineering student at Ecole Sup´´ erieure de Technologie, E.S.T., Fes, Morocco, 1989 – 1991. Chemical engineering student at Texas A&M University, 1997 – 1999; B.S. Texas A&M University, 1999. MS in Applied Mathematics, Auburn University, 2003. Ph. D. student, Mathematics, Auburn University, 2004 – Research Areas: Numerical Analysis, Applied Mathematics. [email protected]

vi

Contents

The question mark

Introduction

This book is interdisciplinary, involving two relatively new fields of human endeavor. The

two fields are: Chemical/Biological^1 Engineering and Numerical Mathematics.

How do these two disciplines meet? They meet through mathematical modeling.

Mathematical modeling is the science or art of transforming any macro-scale or micro-

scale problem to mathematical equations. Mathematical modeling of chemical and bio-

logical systems and processes is based on chemistry, biochemistry, microbiology, mass

diffusion, heat transfer, chemical, biochemical and biomedical catalytic or biocatalytic

reactions, as well as noncatalytic reactions, material and energy balances, etc.

As soon as the chemical and biological processes are turned into equations, these

equations must be solved efficiently in order to have practical value. Equations are usually

solved numerically with the help of computers and suitable software.

Almost all problems faced by chemical and biological engineers are nonlinear. Most

if not all of the models have no known closed form solutions. Thus the model equa-

tions generally require numerical techniques to solve them. One central task of chemi-

cal/biological engineers is to identify the chemical/biological processes that take place

within the boundaries of a system and to put them intelligently into the form of equa-

tions by utilizing justifiable assumptions and physico-chemical and biological laws. The

best and most modern classification of different processes is through system theory. The

models can be formed of steady-state design equations used in the design (mainly sizing

and optimization), or unsteady-state (dynamic) equations used in start-up, shutdown,

and the design of control systems. Dynamic equations are also useful to investigate the

bifurcation and stability characteristics of the processes.

The complexity of the mathematical model depends upon the degree of accuracy

required and on the complexity of the interaction between the different processes taking

place within the boundaries of the system and on the interaction between the system

and its surrounding. It is an important art for chemical/biological engineers to reach an

optimal degree of sophistication (complexity) for the system model. By “optimal degree

of sophistication” we mean finding a model for the process, which is as simple as possible

without sacrificing the required accuracy as dictated by the specific practical application

(^1) Biological engineering comprises both biochemical and biomedical engineering

Introduction 3

year elementary undergraduate level. Having had a one semester course in numerical

analysis is not required, but will definitely be helpful. We include an appendix on linear

algebra and matrices at the end of the book since linear lgebra is often not required in

chemical/biological engineering curricula.

In order to solve chemical/biological problems of differing levels we rely throughout

on well tested numerical procedures for which we include MATLAB codes and test files.

Moreover, a large part of this book is dedicated to explain the workings of our algorithms

on an intuitive level and thereby we give a valuable introduction to the world of scientific

computation and numerical analysis.

It is precisely the interdisciplinary bridge between chemical/biological engineering and

numerical mathematics that this book addresses. A true melding of the two disciplines

has been lacking up to now. We hope that this book is a step in the right direction.

Chemical/biological engineers need such a book in order to learn and be able to solve

their continuously expanding problems (in size, complexity, and degree of nonlinearity).

And numerical analysts can enrich their applied know-how from the civil, mechanical,

and electrical engineering problem menu to include the richness of chemical/biological

engineering problems.

An unusual aspect of this book addresses generality and special cases. What do we

mean by that? We mean this in three different and distinct senses:

* The first regards reacting and nonreacting systems, that is, chemical/biological sys-

tems in which chemical and/or biological reactions take place within the boundaries

of the system, and those with no reaction, such as encountered in nonreacting sepa-

rating processes. Many texts treat nonreacting systems first for the obvious reason

that they are simpler, followed by more complex reacting systems. Actually this is

not optimal. From a pedagogical point of view and for a more efficient transfer of

knowledge, it is advisable to do the opposite, i.e., to start with the more general

reacting cases and then treat the nonreacting cases as special cases in which the

rates of reactions are equal to zero.

* The second regards the number of states of a system (we will call them attractors

for reasons explained inside the book). Almost all books by mistake treat systems

as if they essentially have only one state (usually of one specific type which is an-

other limitation), and consider systems with more than one state as if they were

special or odd cases. Thus they rarely address cases having different numbers or

types of states and attractors. In this book, and maybe for the first time in the

engineering literature, we will address our systems in a more general and funda-

mental form. We will consider systems that have more than one state or attractor

as the general case, with systems having one state being a special case thereof.

We also address problems that have more than one type of steady state. This will

necessitate a correction in terminology. We are afraid that this will be faced by

some resistance. But this is to be expected when scientific research starts to change

the way we treat our undergraduate curriculum and our terminology in a more

fundamental manner. Consequently, the usual term “steady state” will have to be

replaced by “Stationary Nonequilibrium State”( SNES) for example, to distinguish

it from “Thermodynamic Equilibrium” which is also a steady state (no change with

4 Introduction

time), but a dead one.

This SNES will also be called a “Fixed Point Attractor” (FPA) in order to dis-

tinguish it from oscillatory states which we will call “Periodic Attractors” (PA),

and from quasi periodic states which we will call “Torus Attractors” (TA), and

more complex states such as “Chaotic Attractors” (CA). Thus our more advanced

approach will necessitate the definition of all basic principles of bifurcation theory

early in the book, and it will make us introduce senior undergraduates early in our

text to the generality and practical importance of these concepts. These modern

engineering concepts will be reflected in the models’ numerical solutions, specially

with regard to initial guesses and numerical convergence criteria. Appendix 2 on bi-

furcation, multiplicity, and chaos in chemical and biological systems explains these

natural phenomena in a simple manner.

Likewise, we treat numerical analysis from a modern and fresh perspective here.

* In the currently available (less than one handful) textbooks that treat numerical

analysis and chemical/biological engineering problems, most of the numerics have

the flavor of the 1960s. These texts labor long over Gaussian elimination to solve

linear equations, over the intricacies of solving scalar equations given in standard

form f(x) = 0 versus via fixed-point iterations xi+1 = φ(xi) and so forth, and

thus they build mostly on ancient and outdated methods and ideas. Worse, they

generally fail to mention limitations of the proposed and often highly elementary

algorithms. Many books in this area are not aware and do not make the readers

aware of the instability of un-pivoted Gauss, of solving “unsolvable” linear systems

in the least squares sense, or of the gross errors of standard zero finders in cases

with multiple or repeated solutions, for example. In a nutshell, they do not con-

vey the advances in numerical analysis over the last 40 or 50 years. This advance

preeminently consists of a better understanding of numerical analysis and of the

development of intricate verifiably stable codes for the efficient solution of standard

numerical problems, as well as having learnt how to recognize ill-conditioned input

data sets. The omission of these advances is very unfortunate and we intend to

remedy this gap in the timely transfer of knowledge from one part of science to an-

other. This book contains a plethora of new and stable algorithms that solve many

chemical/biological engineering model problems efficiently. It does so by working

with the stable codes inside MATLAB, rather than developing line by line original

programs. There is no need to reinvent pivoted Gauss, or stable adaptive and effi-

cient integration schemes, etc, over and over again.

All of our programs are available on the accompanying CD.

Our book is a four pronged approach at modernizing chemical/biological engineer-

ing education through numerical analysis.

The three prongs

(1) of addressing generalities versus what is a special case in chemical models,

(2) of treating bifurcation phenomena and multiple steady states as the norm and not

the exception, and

6 Introduction

The first chapter must be studied regardless of the particular background of the stu-

dent or reader, but it need not be studied in class. Instead it can be assigned as reading

and exploratory homework in the first days of class. Chapter 1 gives the reader an intro-

duction to MATLAB and numerical analysis. It shows how to use MATLAB and explains

how MATLAB treats many important numerical problems that will be encountered later

in the book. As said before, the student/reader best studies Chapter 1 concretely on a

MATLAB desktop displayed on his/her computer screen by mimicking the elementary

examples from the book, varying them and thereby learning the fundamentals of MAT-

LAB computation.

Chapter 2 introduces the essential principles of modeling and simulation and their

relation to design from a systems point of view. It classifies systems based on system

theory in a most general and compact form. This chapter also introduces the basic prin-

ciples of nonlinearity and its associated multiplicity and bifurcation phenomena. More

on this, the main subject of the book, is contained in Appendix 2 and the subsequent

chapters.

One of the characteristics of the book is to treat the case with multiple steady states

as the general case while the case with a unique steady state is considered a special

case. When reading Chapter 2, our readers should notice the systems similarities be-

tween chemical and biological systems that make these two areas conjoint while uniquely

disjoint from the other engineering disciplines.

We suggest to start a class based on our book with Chapter 3 and to assign or study

the first two chapters as reading or reference material whenever the need arises in class.

Chapter 3 tries to give students the essential tools to solve lumped systems that are

governed by scalar equations. It starts with the simplest continuous-start reactor, a CSTR

in the adiabatic case. The first section should be studied carefully since it represents the

basis of what follows. Our students should write their own codes by studying and even-

tually rewriting the codes that are given in the book. These personal codes should be run

and tested before the codes on the CD are actually used to solve the unsolved problems

in the book. Section 3.2 treats the nonadiabatic case.

Section 3.3 is devoted to biochemical enzyme systems in which the biocatalyst enzyme

does not change during the progressing reaction. Biological systems whose biocatalysts

change with time are presented later in the book.

In Section 3.4 we study several systems that have no multiple steady states and we

introduce several transcendental and algebraic equations of chemical and biological en-

gineering import. As always, the students and readers should find their own MATLAB

codes for the various problems first before relying on those that are supplied and before

solving the included exercises.

Chapter 4 studies problems that involve change over time or location and that there-

fore are modeled by differential equations. Specifically, we study initial value problems

(IVP) here, including

1. one-dimensional distributed steady-state plug flow systems that are characterized

by the complete absence of multiplicity and bifurcation phenomena for adiabatic

Introduction 7

systems with cocurrent cooling or heating; and

2. unsteady states of lumped systems. These systems usually have multiple steady

states when at least one of the processes depends nonmonotonically on one of the

state variables. The unsteady-state trajectory that describes the dynamic behavior

will, however, be unique since IVP cannot have multiple solutions. But different

initial conditions can lead to different steady states.

The readers should study the four given examples very carefully and perform the asso-

ciated exercises. Students should solve the solved-in-detail problems of this chapter first

independently of the book and then solve the exercises of each section and of the chapter

as a whole.

Chapter 4.1 deals with an important industrial problem, the vapor-phase cracking of ace-

tone. Here the material- and energy-balance design equations are developed. We advise

the students to try and develop the design equations independently before consulting the

book’s derivations. Numerical solutions and MATLAB codes are developed and explained

for this problem and sample results are given that need to be checked against those of

the students’ codes.

The remaining sections of Chapter 4 treat an anaerobic digester, heterogeneous fluidized

catalytic-bed reactors, and a biomedical problem of the neurocylce enzyme system.

Chapter 5 introduces a more difficult differential equations problem, namely bound-

ary value problems (BVP). Such problems are very common in chemical and biological

engineering but are unfortunately often given the least bit of attention in undergraduate

training.

Two point boundary value problems of chemical/biological engineering typically arise

from some “feedback” of information. They can result from any of the following sources:

1. diffusion;

2. conduction;

3. countercurrent operation; or

4. recycle or circulation.

Two point boundary value problems are much more difficult to solve and more demanding

than initial value problems for differential equations. One of the strengths of MATLAB

is that it has very good and efficient subroutines for solving both IVPs and BVPs.

First we introduce the reader to the principles of such problems and their solution in Sec-

tions 5.1.2 and 5.1.2. As an educational tool we use the classical axial dispersion model

for finding the steady state of one-dimensional tubular reactors. The model is formulated

for the isothermal case with linear kinetics. This case lends itself to an otherwise rare

analytical solution that is given in the book. From this example our students can under-

stand many characteristics of such systems.

Students and readers should be very familiar with the nature of the isothermal case be-

fore embarking on the nonlinear case and its numerical solution in Section 5.1.3. The