chapter 5 conservation of mass: chemistry,...

50
Chapter 5 Conservation of Mass: Chemistry, Biology, and Thermodynamics 5.1 An Environmental Pollutant Consider a region in the natural environment where a water borne pollutant enters and leaves by stream flow, rainfall, and evaporation. A plant species absorbs this pollutant and returns a portion of it to the environment after death. A herbivore species absorbs the pollutant by eating the plants and drinking the water, and it return a portion of the pollutant to the environ- ment in excrement and after death. We are given (by ecologists) the initial concentrations of the pollutant in the ambient environment, the plants, and the animals together with the rates at which the pollutant is transported by the water flow, the plants and the animals. A basic problem is to determine the concentrations of the pollutant in the water, plants, and animals as a function of time and the parameters in the system. Figure 5.1 depicts the transport pathways for our pollutant, where the state variable x 1 denotes the pollutant concentration in the environment, x 2 its concentration in the plants, and x 3 its concentration in the herbivores. These three state variables all have dimensions of mass per volume (in some consistent units of measurement). The pollutant enters the environment at the rate A (with dimensions of mass per volume per time) and leaves at the rate ex 1 (where e has dimensions of inverse time). Likewise the remaining 37

Upload: dokien

Post on 15-Jul-2018

242 views

Category:

Documents


0 download

TRANSCRIPT

Chapter 5

Conservation of Mass:Chemistry, Biology, andThermodynamics

5.1 An Environmental Pollutant

Consider a region in the natural environment where a water borne pollutantenters and leaves by stream flow, rainfall, and evaporation. A plant speciesabsorbs this pollutant and returns a portion of it to the environment afterdeath. A herbivore species absorbs the pollutant by eating the plants anddrinking the water, and it return a portion of the pollutant to the environ-ment in excrement and after death. We are given (by ecologists) the initialconcentrations of the pollutant in the ambient environment, the plants, andthe animals together with the rates at which the pollutant is transported bythe water flow, the plants and the animals. A basic problem is to determinethe concentrations of the pollutant in the water, plants, and animals as afunction of time and the parameters in the system.

Figure 5.1 depicts the transport pathways for our pollutant, where thestate variable x1 denotes the pollutant concentration in the environment, x2

its concentration in the plants, and x3 its concentration in the herbivores.These three state variables all have dimensions of mass per volume (in someconsistent units of measurement). The pollutant enters the environment atthe rate A (with dimensions of mass per volume per time) and leaves at therate ex1 (where e has dimensions of inverse time). Likewise the remaining

37

38 Conservation of Mass

x3

A

e

c

a

f

b

d

Environment

x1

Plants Animals

x2

Figure 5.1: Schematic representation of the transport of an environmentalpollutant.

rate constants a, b, c, d, and f all have dimensions of inverse time.The scenario just described is typical. We will derive a model from the

law of conservation of mass: the rate of change of the amount of a substance(which is not created or destroyed) in some volume is its rate in (through theboundary) minus its rate out; or, to reiterate,

time rate of change of amount of substance = rate in! rate out.

This law is easy to apply by taking the units of measurement into account.Often we are given the volume V of a container, compartment, or regionmeasured in some units of volume, the concentration x of some substancein the compartment measured in amount (mass) per volume, and rates k ofinflow and ! of outflow for some medium carrying the substance measuredin units of volume per time. The rate of change dx/dt in this case, wheret denotes time measured in some consistent unit, has units of amount pervolume per time. The rate of outflow ! times the concentration x has unitsof amount per time. Thus, we must multiply the time-derivative by the totalvolume to achieve consistent units in the di!erential equation

d(V x)

dt= rate in! !x,

where the inflow rate must have units of amount per time. In case V isconstant, we may divide both sides of the equation by V . The quantity !/V

Conservation of Mass 39

has units of inverse time. In this case, it is called the rate constant for theoutflow of the substance.

For the environmental pollutant, the rate constants are supposed to begiven; the volumes of the compartments (the environment, herbivores, andplants) are in the background but not mentioned. Using conservation ofmass, the transport equations are

x1 = A+ ax2 + bx3 ! (c+ d+ e)x1,

x2 = cx1 ! (a+ f)x2,

x3 = dx1 + fx2 ! bx3. (5.1)

This type of model, which is ubiquitous in mathematical biology, is called acompartment model.

The parameters in the model (5.1) would be measured by the field workof ecologists. When the parameters are determined, the model can be usedto make quantitative predictions of the future concentrations of the pollutantby solving the system of ODEs (5.1).

Some of the rates might be di"cult to measure directly (for example, therate constant f that determines the transport of the pollutant from plants tothe herbivore). These rates might be estimated using a two step procedure:The pollutant concentrations are measured in the field over some suitableperiod of time and the parameters are chosen in the model to match thesemeasurements. Exactly how to choose the parameters based on availabledata is the parameter estimation problem; it is one of the most importantand di"cult issues in mathematical modeling.

Our model may also be used to make qualitative predictions. For example,we might make a mathematical deduction from the form of the equationsthat determines the long-term substance concentrations for some range ofparameter values. We might also use our model to predict the outcomeof some intervention in the environment. For example, suppose that someportion of the plants are harvested by humans and removed from the regionunder study. The e!ect of this change can be predicted by solving our modelequations with appropriate assumptions. The ability to make predictionswithout conducting new field studies is one of the most important motivationsfor developing a mathematical model. Another reason to develop a modelis to test hypotheses about the underlying physical process. For example, amodel that leads to predictions which do not agree with data obtained fromfield observations must be based on at least one false hypothesis.

40 Conservation of Mass

The linear system (5.1) can be solved explicitly. But, since the eigenvaluesof the system matrix are roots of a cubic polynomial, explicit formulas for thetime evolution of the state variables x1, x2, and x3 are complicated. This isto be expected. Di!erential equations with simple explicit solutions are rare.Most di!erential equations do not have explicit solutions and most explicitsolutions are too complicated to be useful. For this reason, model validationand predictions are usually obtained by a combination of qualitative methods,analytic approximations, and numerical approximations. The most valuableinformation is usually obtained by qualitative analysis.

Physically meaningful concentrations are all nonnegative. Hence, ourmodel should have the property that nonnegative initial concentrations re-main nonnegative as time evolves. Geometrically, the positive octant of thethree-dimensional state space for the variables u, v, and w should be posi-tively invariant (that is, a solution starting in this set should stay in the setfor all positive time or at least as long as the solution exists). To check theinvariance, it su"ces to show that the vector field given by the right-handside of the system of di!erential equations is tangent to the boundary of thepositive octant or points into the positive octant along its boundary, whichconsists of the nonnegative parts of the coordinate planes. In other words,positive invariance follows because x3 " 0 whenever x3 = 0, x2 " 0 wheneverx2 = 0, and x1 " 0 whenever x1 = 0.

What happens to the concentrations of the pollutant after a long time?Our expectation is that the system will evolve to a steady state (that is,a zero of the vector field that defines the ODE). To determine the steadystate, we simply solve the system of algebraic equations obtained by settingthe time derivatives of the system equal to zero. A computation shows thatif be(a + f) #= 0, then the solution of the system

A+ ax2 + bx3 ! (c+ d+ e)x1 = 0,

cx1 ! (a + f)x2 = 0,

dx1 + fx2 ! bx3 = 0 (5.2)

is

x1 =A

e, x2 =

Ac

e(a+ f), x3 =

A(ad+ (c+ d)f)

be(a + f).

If be(a + f) > 0, then there is a steady state in the positive first octant. Ifb = 0, e = 0, or (a+ f) = 0, then there is no steady state. This is reasonableon physical grounds. If the pollutant is not returned to the environment

Conservation of Mass 41

by the herbivores, then we would expect the pollutant concentrations in theherbivores to increase. If the pollutant does not leave the environment, thenthe concentration of the pollutant in our closed system will increase. If theplants do not transfer the pollutant to the environment or the herbivores, wewould expect their pollutant concentration to increase.

Suppose that there is a steady state. Do the concentrations of the pollu-tant approach their steady state values as time passes? This basic questionis answered for our linear system by determining the stability of the corre-sponding rest point in our dynamical system. The stability of a steady statecan usually be determined from the signs of the real parts of the eigenvaluesof the system matrix of the linearization of the system at the steady state(see Appendix A.16). In particular, if all real parts of these eigenvalues arenegative, then the steady state is asymptotically stable.

The system matrix at our steady state is!

"!c! d! e a b

c !(a + f) 0d f !b

#

$ . (5.3)

To show the asymptotic stability of the rest point, it su"ces to prove thatall the real parts of the eigenvalues are negative. This follows by a directcomputation using the Routh-Hurwitz criterion (see Appendix A.16 and Ex-ercise 5.1). Of course, this also agrees with physical intuition. Since oursystem is linear, we can make a strong statement concerning stability: ife #= 0, then all initial concentrations evolve to the same steady state concen-trations.

Our qualitative analysis makes numerical computation unnecessary foranswering some questions about our system, at least in those cases where wecan reasonably assume the system is in steady state. For example, if the rateat which the pollutant leaves the environment is decreased by 50%, then wecan conclude that the pollutant concentration in the plants will be doubled.On the other hand, we may resort to numerical computation if we wish topredict some transient behavior of our system (see Exercise 5.2).

Exercise 5.1. (a) Prove that if a, b, c, d ,e, and f are all positive, then all theroots of the characteristic polynomial of the matrix (5.3) have negative real parts.(b) Show that the same result is true if a, b, e, and f are positive and the constantsc and d are nonnegative.

42 Conservation of Mass

VII gal

b gal/mina gal/min

! lb/min " lb/min

h gal/min

c gal/min

k gal/min

X lb Y lby lbx lb

Tank I Tank II

VI gal

Figure 5.2: Schematic representation of mixing tanks

Exercise 5.2. Suppose that the parameters in the model (5.1) are

A = 10, a = 1, b = 1/100, c = 3, d = 1, e = 1, f = 4.

See Section 5.4.3 if you are not familiar with numerical methods for ODEs. (a)For the initial concentrations (at time t = 0) x1 = 0, x2 = 0, and x3 = 0,determine the time t = T such that x3(T ) = 1/2. (b) Suppose that the pollutantenters the environment periodically, A = 10+5 sin(2!t) instead of the constant rateA = 10. Argue that the state concentrations fluctuate periodically and determinethe amplitude of this fluctuation in the plant species.

Exercise 5.3. Consider the arrangement of tanks and pipes depicted in Fig-ure 5.2. In this case, liquid is pumped at the indicated rates. Two solutions en-ter the first tank, which has liquid volume VI , with concentrations " lbs/gal and# lbs/gal and flow rates of a gal/min and b gal/min(respectively) and the solutionin the tank (which is assumed to be stirred so that the system is mixed instantly)enters and leaves the first tank at the rates h and c gal/min (respectively), and itleaves the second tank, which has liquid volume VII , at the rate k gal/min. Theliquid volume of each tank is constant. We are also given the initial amounts ofthe chemical in each tank. (a) Determine the amounts of the solutes in each of thetanks as a function of time. (b) What happens to the concentrations of the solutesin the long run?

Conservation of Mass 43

Exercise 5.4. Imagine three tanks each containing three di!erent substances insolution. The tanks are connected by equal sized pipes to form a closed loop; thatis, tank-1 feeds tank-2 and is fed by tank-3, tank-2 feeds tank-3 and is fed by tank-1, and tank-3 feeds tank-1 and is fed by tank-2. There are pumps in the pipesthat maintain the circulation in the indicated direction at a fixed flow rate and thecontents of the tanks are stirred so that the mixtures are homogeneous. (a) Make amodel for the concentrations of the first substance in the three tanks and use it topredict concentrations as functions of time. What does the model predict? (Hint:Use pencil and paper to determine the steady states.) (b) Consider three bins eachcontaining a mixture of red, blue, and green balls. The same number of balls (lessthan the minimum number of balls in a bin) is chosen at random from each binand redistributed. Those chosen from the first bin are moved to the second, thosefrom the second bin are moved to the third, and those from the third bin are movedto the first. This process may be repeated. Write a computer simulation of theprocess and track the concentration of red balls in each bin. (c) A simple model ofthe process in part (b) is given by the di!erential equations model of part (a). Howwell does the model predict the concentrations of red balls? Discuss the assumptionsof the model and their validity for the redistribution process. (Hint: Make sure theinitial states are the same for the process and the ODE model.) (d) Suppose afixed amount of the first substance is created continuously in tank-2 and the sameamount is destroyed in tank-1. What happens in the long run? Compare with abin simulation. Note: The bin simulation is an example of a Markov process, forwhich there is a well-developed theory that is beyond the scope of this book.

Exercise 5.5. [PID-Controller] (a) Imagine a tank partially filled with water.A pipe feeds water to the tank at a variable flow rate, and there is also a drainpipe with a computer controlled variable flow valve connected to a sensor in thetank that measures the tank’s volume. The valve opens exactly enough to let waterdrain from the tank at a rate proportional to the volume of the tank. The programallows the user to set one number: the constant of proportionality. Write a modelfor this physical problem. Be sure to define all the variables in your model. (b)Suppose the inflow rate is constant. How should the proportionality constant inthe control mechanism be set to keep the tank near a constant desired volume?(c) Suppose the inflow rate is periodic. To be definite, take the flow rate to besinusoidal and known exactly, how should the constant of proportionality be setfor the controller to best keep the tank at a constant desired volume. Part of theproblem is to define ”best.” Explain your choice. The abbreviation PID stands forproportional-integral-derivative. This exercise is about a proportional controller.It is a feed-back controller where the feed-back is proportional to the volume asa function of time. Adding into the feedback a constant times the integral of thevolume change would create a PI control. Adding into the feedback a constant

44 Conservation of Mass

times the derivative of the volume function would create a PD control. A feed-backcontrol given by a linear combination of the volume as a function of time, theintegral of the volume, and the derivative of the volume creates a PID control. (d)Find the constants of proportionality for the PID control of the tank volume thattunes the control to best keep the tank volume constant for the case of constantinflow and for periodic inflow.

5.2 Acid Dissociation, Bu!ering, and Titra-tion with a Base

Dissociation is a basic chemical process that is amenable to a mathematicaldescription. We will discuss the dissociation of acetic acid in water, titrationwith sodium hydroxide, and bu!ering.

5.2.1 A Model for Dissociation

In a beaker of water, some water molecules ionize; that is, a water moleculemay dissociate producing a proton and an ion consisting of an oxygen atomwith one hydrogen attached. In chemical symbols

H2O ! H+ +OH!,

where the arrows indicate that the reaction occurs in both directions: waterdissociates and the ions may recombine to form water.

Similarly, acetic acid dissociates in water

CH3COOH +H2O ! CH3COO! +H+;

or, in shorthand,AcH ! Ac! +H+

with Ac! used here to denote the acetate ion CH3COO!. (Note: acetate isalso denoted by AcO!.)

A simple chemistry experiment is to put some acetic acid in water. Whathappens?

There are four chemical species of interest: acetic acid, acetate, protons,and OH ions:

AcH, Ac!, H+, OH!.

Conservation of Mass 45

The OH! ion is produced from the dissociation of water and is lost by as-sociation. The rate of change of the concentration [OH!] is the di!erenceof some constant Wf (forward water rate constant) times the concentrationof water and some rate constant Wf times the product of the proton andhydroxide ions. The latter statement is a model that comes from chemicalkinetic theory. For simplicity, we may view the product of the concentra-tions as a measure of the number of times the ions meet each other in thesolution. The principle of mass action states that the rate of reaction of twochemical species is proportional to the product of their concentrations. Theseassumptions lead to the equations in the following system:

[OH!]" =Wf [H2O]!Wb[H+][OH!],

[AcH ]" =Ab[H+][Ac!]! Af [AcH ][H2O],

[Ac!]" =Af [AcH ][H2O]!Ab[H+][Ac!],

[H+]" =Af [AcH ][H2O]!Ab[H+][Ac!] +Wf [H2O]!Wb[H

+][OH!].

A complete model would also contain an equation for the rate of changeof water concentration. But, we may ignore this equation in our model forthe dissociation of the acid dissolved in a relatively large amount of water.There is lots of water compared with the other species and it is known thatwater does not dissociate easily. Its concentration will remain constant forthe measurements we might consider in our experiment. This is a goodexample of a simplifying assumption in mathematical modeling. Under ourassumption, the model is less realistic but perhaps more useful. To implementthis idea, we define the parameters (quantities that for our model do notchange with time)

wf := Wf [H2O], af := Af [H2O], wb = Wb, ab = Ab

and rewrite the model in the form

[OH!]" =wf ! wb[H+][OH!],

[AcH ]" =ab[H+][Ac!]! af [AcH ],

[Ac!]" =af [AcH ]! ab[H+][Ac!],

[H+]" =af [AcH ]! ab[H+][Ac!] + wf ! wb[H

+][OH!].

With our simplification, we have a system of four first-order ordinary dif-ferential equations in four unknowns. By the existence theory for ordinary

46 Conservation of Mass

di!erential equations, there is a unique solution of the system correspondingto each choice of initial concentrations (see Appendix A.3).

Mathematicians generally do not like all the extra decorations on thespecies names, and they do not care to be reminded about what the symbolsrepresent. Let us follow this convention by defining

w = [OH!], x = [AcH ], y = [Ac!], z = [H+]

anda = af , b = ab c = wf , d = wb

so that our model has the more aesthetically pleasing form

w" =c! dwz,

x" =byz ! ax,

y" =ax! byz,

z" =ax! byz + c! dwz.

(5.4)

The fundamental mathematical question is to describe the behavior ofthis system (5.4) for arbitrary choices of the parameters and arbitrary initialdata. As applied mathematicians, we should perhaps not be so general;we should restrict attention to the physically relevant parameter values andinitial data. Chemists should supply this data.

Unfortunately, the rate constants in our model are di"cult to measuredirectly. Instead, the basic experimental measurements are made at equi-librium and involve ratios of concentrations. For example, the dissociationconstant for water is

Kw :=[OH!][H+]

[H2O]$ 10!14.

Its value implies that almost no water molecules dissociate. At steady state,the concentrations of our species are not changing; therefore, we must have

Wf [H2O]!Wb[H+][OH!] = 0.

A rearrangement of this equality is

Kw =Wf

Wb. (5.5)

Conservation of Mass 47

We are given a ratio of rate constants, not the rate constants themselves. Areasonable choice of the rate constants might be

c = wf = Wf [H2O] = 10!14, d = wb = Wb = 1.

For acetic acid

Ka =[Ac!][AcH ]

[H+]$ 10!4.75.

The numberpKa := ! log10Ka $ 4.75

is also useful. There is no obvious way to choose the forward and back-ward rate constants. Thus, some chemical intuition is required to make areasonable choice, for example,

a = af = Af [H2O] = 105, b = Ab = Af [H2O]/Ka

so that again Ka = Af/Ab.We are using parameters in our dynamic model derived from experiments

at equilibrium. Is this justified? Perhaps this is a good time to emphasizethat no mathematical model is a perfect representation of reality. If the modelconfirms other experimental data, we can be reasonably certain that theunderlying chemistry (including rate constants, dissociation equations, first-order reactions, and constant water concentration assumption) is correct.We could then make predictions of the outcomes of new experiments withsome confidence that the predictions will agree with nature. Of course, thefinal word in science is determined by experiment. On the other hand, wehave very strong reasons to believe the universe is rational: if we start withfundamental laws and make logical deductions (for example, by applyingmathematics), the conclusions will agree with new experiments. This is oneof the main reasons why mathematics is so important in science.

Rest points—solutions of our model that do not change with time—correspond to states in physical equilibrium. The rest points are exactlythe solutions of the equations

c! dwz = 0, byz ! ax = 0, ax! byz = 0, ax! byz + c! dwz = 0.

Simple algebraic manipulation shows that this nonlinear system has infinitelymany solutions that are given by the relations

x =byz

a, w =

c

dz;

48 Conservation of Mass

that is, there is a two-dimensional surface of rest points, which may beparametrized by the two variables y and z. These rest points cannot beasymptotically stable (see Appendix A.16) for a simple reason. Each restpoint lies on an entire surface of rest points. Nearby rest points are notattracted; they stay fixed. But, we may still ask about the destination ofinitial states that are not rest points. Are they attracted to rest points astime approaches infinity? To obtain some insight, let us linearize as usualand see what happens.

The Jacobian matrix of the vector field is given by!

%%"

!dz 0 0 !dw0 !a bz by0 a !bz !by

!dz a !bz !by ! dw

#

&&$ . (5.6)

At a rest point w = c/(dz); thus, we would like to find the eigenvalues of thematrix

J :=

!

%%"

!dz 0 0 ! cz

0 !a bz by0 a !bz !by

!dz a !bz !by ! cz

#

&&$ . (5.7)

There are several ways to proceed. Perhaps the most instructive methoduses basic geometry and linear algebra. The rest points lie on a two-dimensionalsurface of rest points in four dimensional space. The function given by

(y, z) %& (c

dz,byz

a, y, z)

parameterizes the surface. If we hold z fixed and let y move, the functiontraces out a curve on the surface of rest points whose velocity vector mustbe tangent to the surface. Likewise, we may hold y fixed and consider thetangent vector along the corresponding curve in the surface. These vectors(obtained by di!erentiation with respect to y and z, respectively) are

!

%%"

0bza10

#

&&$ ,

!

%%"

! cdz2bya01

#

&&$ .

We should expect that the linearization of our system of di!erential equationsapproximates the dynamics of the nonlinear system. In the directions of

Conservation of Mass 49

the two-velocity vectors the solutions should not move; thus, these vectorsshould be eigenvectors of J with zero eigenvalues. This fact is easily verifiedby simply multiplying each vector by J . Thus, we know that there are twozero eigenvalues. There are exactly two more eigenvalues. These have to beroots of the characteristic polynomial p of the matrix (p(") = det(J ! "I)).It is a polynomial of degree four. But, since it has two zero roots, it willbe divisible by "2 and the desired roots are simply solutions of a quadraticpolynomial. Under our hypotheses, all the coe"cients of this polynomial,given by

p(") = ac+bcz+adz2+bdyz2+bdz3+(c+az+byz+bz2+dz2)"+z"2, (5.8)

are positive. Thus, the real parts of its roots are negative (see Exercise 5.8).We have not proved that every solution converges to a rest point, but

this conclusion is supported by the linearization. In fact, every physicallyrelevant solution of our model system is asymptotic to exactly one steadystate as time grows without bound. This result requires some phase planeanalysis and hypotheses derived from the physical problem. The parametersa, b, c and d, as computed previously, vary greatly in size. Most importantly,c is very small compared to the other parameters and d < b. This is ourfirst assumption. Note also that the concentration of acetate y, which isformed by dissociation, cannot exceed the initial concentration of acetic acidx0; that is, y ' x0. This is our second assumption. We will of course assumenonnegative concentrations and positive parameters.

The set of nonnegative states N is positively invariant for system (5.4).For instance, on the coordinate hyperplane H corresponding to the coordi-nates x, y, and z (that is the set of all states whose first coordinate w iszero), the tangent vectors to solutions of the di!erential equation at a pointon H are given by the transpose of a vector of the form

(c, byz ! ax, ax! byz, ax! byz + c).

The first coordinate of such a vector is not zero. Thus, this vector is not inthe tangent space of the hyperplane H; the vector points into the region N .In other words, it is impossible for a solution that starts in N to exit this setthrough the hyperplane H. A similar argument (which might require notingthat on the boundary ofN the coordinates are always nonnegative) applied toeach of the coordinate hyperplanes boundingN can be used to show the sameresult: the vector field corresponding to the system of di!erential equations

50 Conservation of Mass

points into the region N on its boundary. Thus, this region is positivelyinvariant, as it should be for our mathematical model. Concentrations cannotbecome negative. Inspection of system (5.4) suggests that we add the secondand third equations. This yields the identity x" + y" = 0. Hence, there mustbe a constant c1 such that x+ y = c1. Similarly, there is a constant c2 suchthat z ! y ! w = c2. In other words, the functions (w, x, y, z) %& x + y and(w, x, y, z) %& z ! y ! w stay constant along all solutions. Such a function iscalled a first integral of the system. In our case, we consider only a small setof initial conditions: acid is added to water at the start of the experiment.Thus, at time t = 0, the water has partially dissociated but the acid is allassociated and the initial data is taken to be such that

w(0) > 0, w(0) = z(0), x(0) = x0 > 0, y(0) = 0.

Using this information, we have that c1 = x(0) and c2 = 0; therefore, ourevolving states satisfy the relations

x(t) = x(0)! y(t), w(t) = z(t)! y(t). (5.9)

Clearly, we may reduce our system of four di!erential equations to

y" = a(x(0)! y)! byz, z" = c+ a(x(0)! y)! z(by + d(z ! y)) (5.10)

and, if desired, recover the states x and w from the relations (5.9).We have proved that the evolving states, with physical initial values,

must remain positive. Repeating a similar argument for system (5.10) andusing our assumption that y ' x(0), it follows that the region bounded bythe horizontal y-axis, the vertical axis, and the line with equation y = x(0)is positively invariant. For z su"ciently large, z" < 0 in this strip becausethe dominant term is !dz2. Thus, we have proved that system (5.10) has apositively invariant rectangle R. Moreover, we can arrange the choice of theupper boundary of R so that all solutions starting above it eventually enterR. We may therefore restrict attention to this rectangle.

We would like to show that all solutions are asymptotic to a rest point inR.

Are there rest points in R? The answer is obtained by solving the systemof equations

a(x(0)! y)! byz = 0, c+ a(x(0)! y)! z(by + d(z ! y)) = 0.

Conservation of Mass 51

The first equation may be rearranged to

z =a(x(0)! y)

by. (5.11)

The graph of the corresponding function (in R) contains the point with coor-dinates (y, z) = (x(0), 0) (which is the lower right corner of the rectangle), isasymptotic to the vertical axis, and has negative slope. The second equationmay be rearranged to the form

y =c+ ax(0)! dz2

a + bz ! dz. (5.12)

The denominator is not zero in R because we have assumed b > d. We mayconsider substitution of this relation into the equation (5.11), which leads toa cubic equation for the unknown y coordinate of the rest points we seek.For c = 0, this cubic can be solved explicitly. One root is y = x(0), oneroot is negative, and the third root (which is also the positive root of theequation (a(x(0)! y)/(by)! y = 0) lies in R, as it must because the graphof the relation (5.12) is also the graph of a function with respect to z, itcrosses the vertical axis at (0,

'ax(0)/d), and it crosses the horizontal axis

at x(0). Moreover, the slope of this graph at the intersection point of therelations (5.11) and (5.12) in R is positive. For c su"ciently small, the sameconfiguration must be true with the new graph of the relation (5.12) crossingthe horizontal axis at c/a+x(0), which lies to the right of x0. In other words,there is exactly one rest point in the rectangle. To show this is true for thespecific values of the parameters of our problem takes more work; we mustdo better than the statement “for c su"ciently small.”

Our rest point for c = 0 is the intersection of the graphs of the relations

a(x(0)! y)

by! y = 0, z =

a(x(0)! y)

by.

In particular, for c = 0, our rest point lies on the line y = z. The linearizationat the rest point has system matrix

(!a! by !by

!a! by + dy !by ! dy

).

Its trace is negative and its determinant is positive. Using the characteristicequation for 2( 2-matrices, which is given by "2 ! tr (A)" + det (A) = 0, it

52 Conservation of Mass

follows that both eigenvalues have negative real parts. Thus, the rest pointis asymptotically stable.

Unfortunately, we can conclude only that nearby solutions are attractedto the asymptotically stable rest point. There might be limit cycles sur-rounding the rest point that prevent solutions from reaching the rest pointas time grows without bound. By the Poincare-Bendixson theorem (see Ap-pendix A.17), this is the only possible obstruction.

For c = 0, the line y = z is invariant and the unique asymptotically stablerest point lies on this line. It is not possible for a limit cycle to exist. It mustsurround the rest point, but it cannot cross this invariant line. Thus, thephase portrait for c = 0 is simple, there is exactly one hyperbolic rest pointin (the closed and bounded set) R, this rest point is globally attracting, andthe corresponding vector field points into the region R on the boundary ofR. This is a (structurally) stable configuration. For su"ciently small c, theperturbed phase portrait has the same properties. This result (called theStructural Stability Theorem) is intuitively clear, but its proof is beyond thescope of this book.

Fortunately, there is another simpler proof that there are no periodicorbits in the set R. Note first that the divergence of the vector field X thatdetermines the model equation (5.10) is

!a! bz ! 2dz ! (b! d)y. (5.13)

Under our assumption that b > d and taking into account that both y and zare positive in R, it follows that the divergence of the vector field is negativeeverywhere in this set.

The vector field X has two components P and Q; indeed,

X = (P (y, z), Q(y, z)),

(y", x") = (P (y, z), Q(y, z)),

(P (y, z), Q(y, z)) = (a(x(0)! y)! byz, c+ a(x(0)! y)! z(by + d(z ! y))).

Suppose there is a periodic orbit that is the boundary of the set # containedin R. Every periodic orbit in the plane is the boundary of a closed andbounded set that is a region in the plane with no holes. Green’s theoremstates that

*

!

Py(y, z) +Qz(y, z) dydz =

*

!!

P (y, z) dz !Q(y, z) dy.

Conservation of Mass 53

The area integral must be negative because Py(y, z) + Qz(y, z) is the diver-gence of X . The line integral vanishes. To see this, simply parameterize theboundary ## by a periodic solution of the di!erential equation (y(t), z(t)).Let T > 0 be its period. We then have that

*

!!

P (y, z) dz !Q(y, z) dy =

* T

0

y"(t)z"(t)! z"(t)y"(t) dt = 0.

This contradiction proves that there are no periodic orbits in R. The corre-sponding general result: If a vector field has a periodic integral curve in theplane and the vector field is defined on the entire planar region bounded bythis curve , then the divergence of the vector field must change sign in theregion bounded by the curve. is called Bendixon’s theorem.

We have outlined a proof of the desired result: for physical initial dataand system parameters, every solution of system (5.4) is asymptotic to a restpoint that depends on the initial data. In fact, the choice of x(0) determinesthe steady state (cf. Exercise 5.10).

Exercise 5.6. Consider the prototype reaction A + B & C with forward rateconstant k. (a) Determine the steady state behavior of the concentration of C.(b) Find an explicit formula for the concentration of C as a function of time. (c)What is the steady state behavior in case the reverse reaction C & A+B with rateconstant $ is included?

Exercise 5.7. [Michaelis-Menton Enzyme Kinetics] An enzyme is catalyst for abiochemical reaction. In a typical situation there is a substrate S, an enzyme E,and a product P . In the presence of the enzyme (perhaps a protein) biochemicalelements that compose the substrate combine to form the product; in symbols, S +E & E + P . This is an example of a situation where the principle of mass actionleads to a prediction that is inconsistent with experimental evidence.(a) By applying the principle of mass action, show that the rate of change of theconcentration of the product grows (without bound) as the concentration of substrateis increased and enzyme concentration is held constant.A better model was proposed in 1913 by Lenor Michaelis and Maud Menton. Theyhypothesized the existence of an intermediate substance I included in the chain ofreactions

S + E ! I & E + P.

(b) Suppose the forward and backward rate constants for the first reaction are k+and k! and the forward rate constant for the section reaction is $. Write the rate

54 Conservation of Mass

equations for the complete reaction. Hint: There are four species and hence fourrate equations.We wish to know the rate of change of the product concentration as a function ofthe substrate concentration and the initial enzyme concentration.(c) Under the further assumption that the substrate concentration is (nearly) con-stant, determine the rate of change of the product concentration as a function ofthe substrate concentration and the initial enzyme concentration.In 1925, G. E. Briggs and J. B. S. Haldane proposed a modification of the Michaelis-Menton substrate concentration assumption: The intermediate product concentra-tion is (nearly) constant.(d) Determine the rate of change of the product concentration as a function ofthe substrate concentration and the initial enzyme concentration under the Briggs-Haldane assumption.(e) Compare and contrast the assumptions and results of parts (c) and (d).

Exercise 5.8. Prove that the roots of the polynomial (5.8) ( for the dissociationmodel) have negative real parts. Are the roots real?

Exercise 5.9. Prove that every solution of the system (5.4) starting in the phys-ical space where initial concentrations are not negative converges to a unique restpoint. A possible strategy is to first reduce the first-order system to a lower dimen-sional system by using conserved quantities, for example, x" + y" = 0.

Exercise 5.10. (a) Specify a method to obtain the steady state of a solution ofacetic acid and water (where all the pure acetic acid is assumed to be added allat once to water) that is already in steady state as predicted by the model (5.4)without solving the system of di!erential equations. Your result should determinea function of the initial concentration of acetic acid at the instant it is added to thewater. (b) Using a numerical method, approximate the length of time (in seconds)for the solution to reach steady state after the addition of one mole of acetic acid?According to the model, the solution never reaches steady state. For this exercise,assume that steady state has been reached once the final concentrations are within0.1% of their theoretical steady state values. (c) Discuss how the time to reachsteady state is related to the amount of added acetic acid. Does the time to steadystate increase or decrease with an increase in the amount of acetic acid? Discussyour answer. Does your result agree with physical intuition?

5.2.2 Titration with a Base

Imagine the following experiment: A beaker contains a solution of acetic acidand water that is made by combining a known amount of acetic acid with

Conservation of Mass 55

a known volume of water. A known concentration of sodium hydroxide inwater, stored in a graduated pipe (buret), is released slowly into the beaker,the solution is stirred continuously, and the pH of the solution is measuredat specified time intervals. We will model the pH in the beaker as a functionof time.

What is pH? Recall that the pH of a solution is a measure of its acidity. Infact, it is defined to be the negative logarithm, base ten, of the concentrationof protons H+ (in units of mol / l) or

pH := ! log10[H+].

For sodium hydroxide In water, we have

NaOH ! Na+ +OH!.

The forward dissociation constant is very large compared with the associationconstant. Almost all of the sodium hydroxide dissociates to sodium andOH! ions. The sodium does not react with acetic acid. Thus, we are onlyinterested in the OH! ions. A solution of A mol / l of NaOH has A mol / lof OH! for “all practical purposes.” Let us assume that all of the NaOHdissociates. The solution enters at a rate of B ml / sec. We must not mixunits. Thus, we should express this concentration as B/1000 l / sec. It followsthat OH! ions enters the acetic acid solution at the rate of

AB mol / sec .

The concentration of this ion changes during the addition of NaOH becausethe volume is changing from 100 ml via the function

vol =1

10+

B

1000t.

A model of the ion concentration entering the solution (measured in mol / l)as a function of time is

AB

( 110 +

B1000 t)

. (5.14)

Using the model (5.14) for addition of OH! (during the addition of the

56 Conservation of Mass

sec pH sec pH sec pH sec pH sec pH0 2.567 16 3.590 32 4.196 48 4.490 64 4.6772 2.563 18 3.738 34 4.240 50 4.514 68 4.7174 2.563 20 3.852 36 4.283 52 4.540 70 4.7376 2.563 22 3.923 38 4.327 54 4.564 72 4.7558 2.689 24 3.979 40 4.363 56 4.590 74 4.77110 3.038 26 4.042 42 4.396 58 4.60712 3.279 28 4.094 44 4.436 60 4.63214 3.418 30 4.148 46 4.462 62 4.656

Figure 5.3: The data in this table is produced by a pH meter while a onemolar sodium hydroxide solution is added to a one molar solution of aceticacid and water.

NaOH solution), our basic model (5.4) is modified to

w" = c! dwz +AB

( 110 +

B1000 t)

,

x" = byz ! ax,

y" = ax! byz,

z" = ax! byz + c! dwz. (5.15)

The flow rate B does not remain constant. The flow is turned on after theacetic acid solution is in steady state and turned o! when the measurementdevice is stopped or the reservoir of NaOH is empty. The model can be usedto make predictions via numerical integration.

An experiment was performed where a solution of one mol / l of NaOHis added to a solution of one mol / l of acetic acid at the rate of 0.5 ml / sec.The beaker containing the solution was stirred continuously and a pH sensorrecorded the pH of the solution every two seconds for 74 sec (see Table 5.3).The flow of NaOH was started at 5 sec. The results of this experiment and asimulation using the model (5.15) are depicted in Figure 5.4. The agreementis excellent (compare, Exercise 5.11).

We note that the solution pH does not rise significantly during the titra-tion if not too much base is added. The presence acid bu!ers the solution tothe addition of the strong base. Bu!ering is an essential process in the livingorganisms. The pH of essential fluids, for example blood, must remain withinsome narrow range for certain biochemical processes to work properly. Whileour model is viable for small concentrations of the base, sodium hydroxide,it does not seem to predict the correct titration curve (pH versus the amount

Conservation of Mass 57

0 10 20 30 40 50 60 700

1

2

3

4

5

Figure 5.4: Plots of pH versus time in seconds for the addition of NaOH inacetic acid. The continuous graph is from the mathematical model (5.15);the discrete graph is from the data in Table 5.3.

of added base) over a larger range of additional OH!. A better model is thesubject of the next section.

Exercise 5.11. (a) The results of experiment and simulation using the math-ematical model (5.15) depicted in Figure 5.4 show excellent agreement. On theother hand, transient in the solutions of the model are very short. Good resultscan also be obtained by a static model based on the assumption that the mixturesare instantaneously in steady state. Discuss this alternative. Hint: This approachis used in textbooks on basic chemistry. (b) The accuracy of predictions from themodel should depend on the accuracy of its parameters. How sensitive is the resultto the given parameters. (c) Which choice of parameters best fits the experimentaldata?

Exercise 5.12. Prove the generalization of Bendixson’s theorem due to Dulac:If a vector field has a periodic integral curve in the plane and the vector field

is defined on the entire planar region bounded by this curve , then every positivefunction multiple of the vector field must have its divergence change sign in theregion bounded by the curve. This result is useful when a given vector field Xdoes not have fixed sign in a region to be tested for the existence of periodic orbits.If there is a positive function f defined on the region, and the new vector field fXhas fixed sign, then there are no periodic orbits in the region.

58 Conservation of Mass

5.3 An Improved Titration Model

The titration of a weak acid by a strong base (for example, titration of aceticby sodium hydroxide) stays in the bu!er region, where the change in pH isnot too great for small additions of the base until some critical amount ofbase is added. At this point a sharp rise in pH occurs. The pH levels o! asmore base is added. This general behavior is typical and is easily observed inexperiments. Appropriate mathematical models build from rate equations,which are discussed in this section, predict the observed behavior.

Recall that we have introduced the chemical reactions for the dissociationof water

H2O ! H+ +OH

and acetic acid

CH3COOH +H2O ! CH3COO! +H+;

or, in shorthand,AcH +H2O ! Ac! +H+,

and sodium hydroxide

NaOH ! Na+ +OH!.

The water concentration is considered to be very large compared with theconcentrations of the other species. To account for the additional OH! ionsfrom the dissociated sodium hydroxide, one additional reaction should beincluded:

CH3COOH +OH!! CH3COO! +H2O. (5.16)

In the previous section, we ignored the rate constants in this equation andsimply changed the OH! concentration in the mixture.

Using the notation of system (5.4), incorporating the water concentrationinto the forward rate constant for the dissociation of water and the backwardrate constant e for reaction (5.16), and using f for the forward rate constantin the reaction (5.16), we have the rate equations

w" = c! dwz + ey ! fxw,

x" = byz ! ax+ ey ! fxw,

y" = ax! byz ! ey + fxw,

z" = ax! byz + c! dwz. (5.17)

Conservation of Mass 59

0.00 0.05 0.10 0.15 0.200

2

4

6

8

10

12

14

Figure 5.5: Simulated titration curve (that is, pH versus initial molarity) ofsodium hydroxide added to an 0.1 molar acetic acid solution.

We do not know the exact values of the rate constants e and f . To determinetheir ratio, let us recall that

Kw =Wf

Wb$ 10!14

(see, equation (5.5)). At steady state for the system (5.17),

Wf [H2O]!Wb[H+][OH+] = Cf [OH!][AcH ]! Cb[H2O][Ac!].

A rearrangement of the formula is

CfKw ! CbKa =[H+]

[AcH ](Wf ! wbKw) = 0.

Thus, we havee

f=

Cf

Cb=

Ka

Kw$ 109.

Using the rate constants

a = 105, b =a

10!4.75, c = 10!14, d = 1, e = 10!9, f =

e

10!9,

the titration curve depicted in Figure 5.5 is computed by first integratingsystem (5.17) forward with initial acetic acid concentration 0.1mol / l untilan equilibrium pH is reached, which is approximately 2.88. The equilibriumvalues of the states are used as initial conditions for the states during the

60 Conservation of Mass

titration simulation (see Exercise 5.14). An initial OH! concentration isset and the states are evolved forward in time (by numerical integration)until (an approximation of) equilibrium is reached. The corresponding pH isthen plotted as a function of the initial OH!. The figure shows a bu!eringregion with relatively unchanged pH for low concentrations of the base, aregion of rapid pH increase, and a region of high pH for the addition of highconcentrations of the base.

The steep change in pH in Figure 5.5 is not an obvious prediction fromthe model. Why does this happen? To explain this phenomenon withoutnumerical approximations, let us consider the steady states in more detail.

The dynamical system (5.17) has two first-integrals:

x+ y = 0, z ! y ! w

(see the discussion on page 50.) Using the chemistry at the initial time—which is after the acid solution is in equilibrium and at the instant the baseis added, we have that y = x(0)! x and w = z ! y + w(0). We may reduceour model to the two-dimensional system

y = a(x(0)! y)! byz ! ey + f(x(0)! y)(z ! y + w(0)), (5.18)

z = a(x(0)! y)! byz + c! dz(z ! y + w(0)). (5.19)

Using the parameter values

a = 105, b = 1010, c = 10!14, d = 1, e = 10!9, f = 1.

The equations for the steady states—the right-hand sides of the di!erentialequations set to zero—have some small and some large coe"cients. Inspec-tion of these coe"cients suggests defining µ, a new parameter that has value10!5 in our model, so that the coe"cients are expressed in the form

a = 1/µ, b = 1/µ2, c = 10µ3, d = 1, e = 10µ2, f = 1.

We may treat µ as an order parameter (which orders the relative sizes of thecoe"cients) and reduces the number of parameters. The equations for thesteady states are equivalent to

!10yz + (1! 10y)µ+ (w(0)! y ! 10w(0)y + 10y2 + z ! 10yz)µ2 ! 100yµ4 = 0,

!10yz + (1! 10y)µ! (10w(0)z ! 10yz + 10z2)µ2 + 100µ5 = 0.

(5.20)

Conservation of Mass 61

We may solve for the state variable y in the second equation, where it ap-pears linearly, and substituting this solution into the first equation. A minormiracle occurs: the equation for z factors and the desired steady state is thepositive root of the cubic polynomial

p(z) := !10w(0)z2!10z3+zµ!10w(0)zµ!10z2µ+100zµ3+100µ4. (5.21)

The pH is ! log10 z. The derivative of this expression with respect to w(0) is

!1

z

dz

dw(0)=

10(z + µ)

20w(0)z + 30z2 + (10w(0)! 1)µ+ 20zµ! 100µ3.

The rate of change of the pH with respect to w(0) is large near values of zthat are nearly roots of both the cubic polynomial p and its derivative withrespect to z. If we ignore terms of order at least four in µ, then z = 0 is sucha point provided that w(0) = 1/10. Thus, for z near zero (as it must be whenthe base and the acid are both close to being neutralized), we expect the pHto have a large derivative for w(0) near 1/10, which explains the numericalresult depicted in Figure 5.5 (compare, Exercise 5.16).

The kinetic theory expressed in the models discussed here predicts phe-nomena that are in complete agreement with physical experiments. Thus, wemay have a high level of confidence that the underlying theory is correct. Tomake such a statement about a class of mathematical models is satisfying;the validation (and invalidation) of models is of course a strong motivationfor doing applied mathematics.

Exercise 5.13. Redraw Figure 5.4 using the improved titration model. Is therea di!erence?

Exercise 5.14. Redraw Figure 5.5 using an alternative method: do not inte-grate the di!erential equations; solve for the steady states. Which method is moree"cient?

Exercise 5.15. Redraw Figure 5.5 using the cubic polynomial (5.21) to solve forz as a function of w(0).

Exercise 5.16. (a) The roots of the cubic polynomial p in equation (5.21) maybe determined explicitly using Cardano’s formula. Can it be used to explain theshape of titration curves? (b) It is possible to determine the discriminant of acubic. It is zero exactly when the cubic has a multiple root. The discriminant is

62 Conservation of Mass

also equal to the resultant of the cubic and its first derivative. Find the lowestorder approximation in powers of µ for the discriminant of p and show that itvanishes for w(0) = 1/10. Hint: Learn the meaning of the concepts mentioned inthe problem: discriminant and resultant.

Exercise 5.17. A titration of 0.1 molar acetic acid with sodium hydroxide isdiscussed in the section. The point of mutual neutralization occurs for the additionof approximately 0.1 mole of the base. Repeat the analysis, using the same methods,for titration of 0.3 molar acetic acid with sodium hydroxide.

Problem 5.18. The titration curve depicted in Figure 5.5 is obtained by a staticmodel; that is, we set the new OH concentration, integrate to steady state, deter-mine the pH and iterate this process. A dynamic model would predict results for atitration where the sodium hydroxide solution is poured continuously into the aceticacid solution. Model (5.15) is a first approximation of such a model. Created amodel that can be used to predict titration curves consistent with Figure 5.5.

5.4 Reaction, Di!usion, and Convection

Conservation of mass is a fundamental physical law used to model manyphysical processes.

5.4.1 Fundamental and Constitutive Model Equations

Let us suppose that some substance (considered to have mass) is distributedin Rn and let # denote a bounded region in Rn with boundary ## andouter normal $. The density of the substance is represented by a functionu : Rn ( R & R, where u(x, t) is the numerical value of the density in someunits of measurement at the site with coordinate x ) Rn at time t.

The time rate of change of the amount of the substance in # is givenby the negative flux of the substance through the boundary of # plus theamount of the substance generated in #; that is,

d

dt

*

!

u dV = !*

!!

X · $ dS +

*

!

f dV,

where X is the velocity vector field (sometimes called the di!usion flux)of the substance (with units of mass per area per time); dV is the volumeelement; dS is the surface element; the vector field $ is the outer unit normal

Conservation of Mass 63

field on the boundary of #; and f , a function of density, position and time,represents the amount of the substance generated in # per volume per time.The minus sign on the flux term is required because we are measuring therate of change of the amount of substance in #. If, for example, the flow isall out of #, then X · $ " 0 and the minus sign is required because the rateof change of the amount of substance in # must be negative.

Using the divergence theorem (also called Gauss’s Theorem) to rewritethe flux term and by interchanging the time derivative with the integral ofthe density, we have the relation

*

!

ut dV = !*

!

divX dV +

*

!

f dV.

Moreover, because the region # is arbitrary in this integral identity, it followsthat

ut = ! divX + f. (5.22)

To obtain a useful dynamical equation for u from equation (5.22), we needa constitutive relation between the density u of the substance and the flowfield X . It is not at all clear how to derive this relationship from the funda-mental laws of physics. Thus, we have an excellent example of an importantproblem where physical intuition must be used to propose a constitutive lawwhose validity can only be tested by comparing the results of experimentswith the predictions of the corresponding model. Problems of this type lieat the heart of applied mathematics and physics.

For equation (5.22), the classic constitutive relation—called Darcy’s, Fick’s,or Fourier’s law depending on the physical context—is

X = !K gradu+ µV (5.23)

where K " 0 and µ are functions of density, position, and time; and Vdenotes the flow field for the medium in which our substance is moving. Theminus sign on the gradient term represents the assumption that the substancedi!uses from higher to lower concentrations.

By inserting the relation (5.23) into the balance law (5.22), we obtain thedynamical equation

ut = div(K gradu)! div(µV ) + f. (5.24)

Also, if we assume that the di!usion coe"cient K is equal to k2 for someconstant k, the function µ is given by µ(u, x, t) = %u where % is a constant,

64 Conservation of Mass

and V is an incompressible flow field (div V = 0); then we obtain the mostoften used reaction-di!usion-convection model equation

ut + % grad u · V = k2$u+ f. (5.25)

In this equation, the gradient term is called the convection term, the Lapla-cian term is called the di!usion term, and f is the source term.

Let us also note that if the di!usion coe"cient is zero, the convectioncoe"cient is given by % = 1, the source function vanishes, and V is notnecessarily incompressible, then the dynamical equation (5.24) reduces tothe law of conservation of mass, also called the continuity equation, given by

ut + div(uV ) = 0. (5.26)

Because equation (5.25) is derived from general physical principles, thisPDE is used to model all physical processes where reaction, di!usion, orconvection is involved.

In case the substrate medium is stationary (that is, V = 0), the modelequation (5.25) is the di!usion (or heat) equation with a source

ut = k2$u+ f. (5.27)

Using Fourier’s law, this equation is the basic model equation for heat flow.

Exercise 5.19. Show that the gradient of a function evaluated at a point p pointsin the direction of maximum increase of the function at p. Also, the gradient isorthogonal to each level set of the function at each point on a level set.

Exercise 5.20. Discuss the meaning of the divergence of a vector field. In par-ticular, discuss positive divergence, negative divergence, and zero divergence. Giveexamples. Hint: You may wish to consider the equation

divX(p) = lim!#{p}

*

!!X · % dS.

5.4.2 Reaction-Di!usion Systems: Gray-Scott Modeland Pattern Formation

Let us consider two concentrations u and v in some process involving di!usionof each concentration and some interaction between the two substances. We

Conservation of Mass 65

can imagine interacting populations (for example a predator and its prey) ora chemical reaction.

Absent di!usion, the interaction of two species is often modeled by a(nonlinear) system of ordinary di!erential equations

u = f(u, v), v = g(u, v). (5.28)

For example, the basic interaction between a predator concentration u andits prey concentration v might be modeled by

u = !au+ buv, v = cv(1! 1

kv)! buv. (5.29)

Here a is the death rate of the predator, c is the growth rate of the prey, kis the carrying capacity of the prey’s environment, and b is the success rateof the predator. By taking into account the (spatial) di!usion of the twospecies, we obtain the reaction-di!usion model

ut = "$u! au+ buv, vt = µ$v + cv(1! 1

kv)! buv, (5.30)

where now u and v are functions of space and time.At a practical level, the derivation of phenomenological reaction-di!usion

models of the form

ut = "$u+ f(u, v), vt = µ$v + g(u, v) (5.31)

can be as simple as our derivation of a predator-prey model. The derivationof more accurate models of course requires a detailed understanding of theunderlying reaction [49, 52].

A famous and important paper [66] by Alan Turing suggests reaction-di!usion models to explain pattern formation in biological systems (morpho-genesis). One of his models is given by

ut = "$u+ r(&! uv), vt = µ$v + r(uv ! v ! '). (5.32)

The patterns we see in nature (for example, animal skin spots and stripes, fishskins, snow flakes, etc) can all be generated by reaction di!usion equations.This fact suggests a broad form of Turing’s principle: Reaction and di!usionare the underlying mechanisms for pattern formation in the natural world.While Turing’s Principle is controversial, the application of mathematics tounderstand reaction and di!usion is fruitful.

66 Conservation of Mass

A widely studied reaction-di!usion model for pattern formation is thedimensionless Gray-Scott model [29, 51, 70, 48, 24]

ut = "$u+ F (1! u)! uv2,

vt = µ$v + uv2 ! (F + ()v. (5.33)

It is derived from a hypothetical chemical reaction of the form

u+ 2v & 3v, v & P,

where the second reaction creates an inert product; the coe"cient F is thedimensionless feed/drain rate ( which feeds u and drains u, v, and P ), and( is the dimensionless rate of conversion in the second reaction v & P . Astandard theory in chemical kinetics, called the law of mass action, assumesthat the rate of a reaction is proportional to the product of the concentrationsof the chemicals involved in the reaction. For a reaction of the form nA +mB & C the reaction rate is r = k[A]n[B]m, where the square bracketsdenote concentration, k is the constant of proportionality, and n and m arethe stoichiometric coe"cients that specify the number of molecules of thecorresponding chemical species that combine in the reaction. Thus, accordingto the first reaction equation u + 2v & 3v, the rate at which v is increasedby the reaction is proportional to uvv—one molecule of u plus two moleculesof v combine to form three molecules of v.

For a system of reaction-di!usion equations

Ut = "$U +H(U),

Turing’s fundamental idea—which has had a profound influence on develop-mental biology—is that spatial patterns can form even for the case of smalldi!usion for a reaction ODE

U = H(U)

that has an attracting steady state. In e!ect, the di!usion can act againstthe tendancy of the process to proceed to the steady state of the reaction.The implication is that a pattern (for example, the spots and strips of animalskins) might arise from a chemical process involving reaction and di!usion.

How might we investigate a mathematical model for pattern formation?To obtain a unique solution of our partial di!erential equation (dis-

tributed parameter system), we must specify initial and boundary conditions.

Conservation of Mass 67

Let us consider a two-dimensional spatial domain #. Our concentrationvector U = (u, v) is a function U : # ( [0, T ] & R2. The initial conditionsimply gives the initial spatial distribution of the concentration vector; thatis,

U(x, 0) = U0(x) (5.34)

for some function U0 : #& R2.The boundary conditions depend on the underlying physical problem. A

Dirichlet boundary condition is used for the case where the concentrationvector is a known (vector) function g : ## ( [0, T ] & R2; that is,

U(x, t) = g(x, t) (5.35)

whenever x ) ## and t ) [0, T ]. A Neumann boundary condition is usedfor the case where the reactants do penetrate the boundary at some spec-ified rate. In this case, we consider the outer unit-length normal $ on ##.The Neumann boundary condition states that the normal derivative of theconcentration vector is a known function on the boundary; that is,

$ ·*U(x, t) = g(x, t) (5.36)

whenever x ) ## and t " 0.A computationally convenient (but perhaps less physically realistic) bound-

ary condition is the periodic boundary condition

U(x+ a, y) = U(x, y), U(x, y + b) = U(x, y),

where a and b are fixed positive constants. In other words, the concentrationvector is supposed to be defined on a torus given by a rectangle with oppositesides identified with the same orientations.

A reaction-di!usion system defined on a bounded domain # with a piece-wise smooth boundary, either Dirichlet, Neumann, or periodic boundary con-ditions, and an initial condition, has a unique solution that exists for somefinite time-interval 0 ' t < ) (see [52, 58]). This is our hunting license. Inthe next section we will consider some qualitative and numerical methodsthat can be used to obtain some understanding of the evolution predicted bythe Gray-Scott model.

68 Conservation of Mass

5.4.3 Analysis of Reaction-Di!usion Models: Qualita-tive and Numerical Methods

The mechanism for pattern formation is not well understood. At least it isvery di"cult to define the properties of the patterns that arise and prove theirexistence. To show that patterns arise begins with numerical approximations.But, as we will see, qualitative methods for understanding the solutions ofdi!erential equations arise naturally in this investigation.

Numerical methods and numerical analysis for di!erential equations arevast subjects, which are essential tools for applied mathematics. This sectionis meant as a glimpse into a few numerical methods together with somediscussion of the issues that are encountered in practice. Our context willbe an analysis of the the Gray-Scott model (5.33). What is the fate of theconcentrations of the reactants of this hypothetical chemical reaction?

Euler’s Method

To begin our adventure, let us recall Euler’s method. It is the prototypicalmethod for solving ODEs, for example the system of ODEs

u = f(u, v), v = g(u, v) (5.37)

obtained by ignoring the spatial dependence in our reaction-di!usion sys-tem (5.31). The idea is to discretize the time derivatives and thus approx-imate the continuous flow of time by a series of discrete steps that can becomputed. To do this and for future reference, note that for a su"cientlysmooth function of one variable F : R & R we have the Taylor series expan-sions

F (x+ h) = F (x) + F "(x)h+1

2!F ""(x)h2 +

1

3!F """(x)h3 +O(h4),

F (x! h) = F (x)! F "(x)h +1

2!F ""(x)h2 ! 1

3!F """(x)h3 +O(h4), (5.38)

where the big O notation is explained in Appendix A.7 and Taylor’s formulain Appendix A.8. Using the first equation of the display, it follows that

F "(x) =F (x+ h)! F (x)

h+O(h).

Thus, by replacing F "(x) with the (forward) di!erence quotient F (x + h)!F (x)/h, we make an error of order h. The numerical method is to make this

Conservation of Mass 69

replacement; the numerical analysis is to recognize the error has order h.This replacement leads to Euler’s method for approximating solutions of thesystem of ODEs (5.37): For an initial time t0 and initial state (u, v) = (u0, v0),future times at the regular time-increment $t and the corresponding futurestates are given recursively by

un = un!1 +$tf(un!1, vn!1), (5.39)

vn = vn!1 +$tg(un!1, vn!1), (5.40)

tn = tn!1 +$t. (5.41)

The discretization error is O(h); it is proportional to the step size h. Thelocal truncation error, or the error per step, is the norm of the di!erencebetween the solution and the approximation after one step. In vector form(U = H(U)) using Taylor’s formula, this error is

|U(t0 +$t)! U1|= |U(t0) +$tU"(t0) +

$t

2!U ""())! (U0 +$tH(U0))|

= |$t2!

U ""())|

=O($t2),

where ) is a number between t0 and t0 +$t.

The Reaction Equations

We can apply Euler’s method to the Gray-Scott reaction model (5.33); thatis, the system of ODEs

u= F (1! u)! uv2,

v = uv2 ! (F + ()v. (5.42)

To compute an approximate solution, we must set values for the parameters( > 0 and F > 0, an initial condition (u(0), v(0)), and a time step $t. Howshould be make these choices? This question does not have a simple answer.The choices depend on the application. For the Gray-Scott model, we areinterested in the fate of a typical solution. Thus, the choice of initial conditionis not essential as long as it is generic. On the other hand, the reaction modelhas a two-dimensional parameter space. We will be computing for a very longtime if we wish to exhaust all the possible parameter values. A wiser course

70 Conservation of Mass

0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08

0.05

0.1

0.15

0.2

0.25

Figure 5.6: Plot of the parabola F = 4(F + ()2 with horizontal axis ( andvertical axis F . Outside the curve, the system (5.42) has one rest point at(u, v) = (1, 0). Inside the curve the system has three rest points.

of action is to rely on a fundamental principle of applied mathematics: Thinkbefore you compute.

Our current goal is to understand the general behavior of the system (5.42).Does this behavior depend on the parameter values?

The state variables u and v are supposed to represent chemical concen-trations; thus, their values should be nonnegative. Moreover, the evolutionof the system from a physically realistic state (u(0) " 0 and v(0) " 0) shouldproduce only physically realistic states. In other words, the closed first quad-rant in the state space should remain invariant under the flow. This fact iseasily checked. Simply note that the u-axis is invariant (because v = 0whenever v = 0), and the vector field points into the first quadrant along thepositive v-axis (because u > 0 whenever u = 0).

The simplest dynamics is given by rest points; that is, constant solutionsof the system of ODEs given by solutions of the algebraic equations

F (1! u)! uv2 = 0, uv2 ! (F + ()v = 0.

Note that (u, v) = (1, 0) is a solution for all values of ( and F . Also,(1/2, F/(2(F + ())) is a double root whenever F = 4(F + ()2 and F >

Conservation of Mass 71

0. Figure 5.6 depicts this curve (a parabola) in the parameter space. Itmeets the vertical axis at ((, F ) = (0, 0) and ((, F ) = (0, 1/4); the point((, F ) = (1/16, 1/16) is the point on the curve with the largest first coor-dinate. Our ODE has three rest points for the parameter vector ((, F ) inthe region bounded by the curve and the vertical axis and one rest pointoutside of this region. For parameter values inside the region, the two newrest points have coordinates

u =1

2

+1±

'1! 4(F + ()2/F

,, v =

F

F + ((1! u). (5.43)

The system matrix for the linearization of the system of ODEs at (1, 0)is the diagonal matrix whose main diagonal has the components !F and!(F + () (see Appendix A.16 for a discussion of linearization and stability).These negative numbers are the eigenvalues of this matrix; hence, (1, 0) isasymptotically stable independent of the parameter values.

The new rest points appear as the parameters cross the curve from outsideto inside; on the curve a double root appears “out of the blue.” This is calleda saddle-node bifurcation or a blue sky catastrophe. The prototype for thisbifurcation (called a normal form) is given by

x = b! x2; y = ±y,

where b is the bifurcation parameter. Note that for b < 0 (which correspondsin our case to being outside the parabola F = 4(F + ()2), there are no restpoints. The system with b = 0 has a semi-stable rest point called a saddle-node. For b > 0, there are two rest points: one saddle and one sink in the+-sign case, and one saddle and one source in the !-sign case. This scenariois exactly what happens for system (5.42). (The rest point at (1, 0) plays norole in this bifurcation.)

The system matrix at the rest points in display (5.43) is

A =

(!F ! v2 !2uv

v2 2uv ! (F + ()

). (5.44)

At these rest points uv = F + (; therefore, we have the formulas

Trace (A) = (! v2, Determinant (A) = (F + ()(v2 ! F ). (5.45)

The eigenvalues of A are the roots of the characteristic equation

Determinant (A! "I) = 0,

72 Conservation of Mass

0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08

0.05

0.1

0.15

0.2

0.25

Figure 5.7: The figure (with horizontal axis ( and vertical axis F ) depictswith a solid curve the parabola F = 4(F + ()2 (the saddle-node bifurcationcurve) and the dashed curve F = 1/2(

+( ! 2( !

+(! 4(3/2) (the Hopf

bifurcation curve). Outside the saddle-node curve, the system (5.42) has onestable rest point at (u, v) = (1, 0). Inside this curve the system has three restpoints. Above the Hopf bifurcation curve and inside the saddle-node curvethere are three rest points, two sinks and one saddle. Below the Hopf curveand above the saddle-node curve there is one sink, one source and one saddle.For F decreasing and ( < 0.0325 (approximately), the Hopf bifurcation issupercritical, for ( > 0.0325, the Hopf bifurcation is subcritical.

Conservation of Mass 73

where I denotes the 2 ( 2 identity matrix. By an easy computation, thecharacteristic equation is seen to have the general form

"2 ! Trace (A)"+Determinant (A) = 0

and the roots

" =Trace(A)±

'Trace(A)2 ! 4Determinant(A)

2.

The stability types of rest points are determined from the signs of Trace(A)and Determinant(A). For example, if Trace(A) < 0 and Determinant(A) > 0,then the radicand is either complex or, in case it is real, less than Trace(A) <0. Hence, both roots have positive real parts and the corresponding rest pointis a source.

Consider Trace(A) on the parabola F = 4(F + ()2. Using the formulasin display (5.43) for the corresponding rest points, it follows that

v =F

2(F + ();

hence,

Trace(A) = (! v2

= (! F- F

4(F + ()2

.

= (! F

=

+F

2! 2F.

By simple analysis of the function F %&$F2 ! 2F , we see that Trace(A) is

positive for 0 < F < 1/16, zero at F = 1/16 and positive for 1/16 < F < 1/4.Also, by the continuity of Trace(A) as a function of ( and F , it maintainsits sign along curves in the parameter space that cross the parabola, exceptthose that cross at the point ((, F ) = (1/16, 1/16).

The quantity Determinant(A) as a function of ( and F vanishes on theparabola. To determine its sign along a curve in the parameter space thatcrosses into the region bounded by the parabola and the coordinate axes,note that F > 4(F +()2 in this region; thus, in the bounded region and nearthe boundary parabola, there is some (small) * > 0 such that

4(F + ()2

F= 1! *.

74 Conservation of Mass

The value of v at the corresponding rest points is

v2± =F

F + (

-12, 1

2

'1! (1! *)

.

=F

2(F + ()(1, $),

where $ :=+*. The sign of Determinant(A) is determined by the sign of

v2 ! F , which is given by

v± ! F =F 2

4(F + ()2(1, 2$ + $2)! F

= F- F

4(F + ()2(1, 2$ + $2)! 1

.

= F- 1

1! $2(1, 2$ + $2)! 1

.

=2F$

1! $2(,1 + $).

From this computation, it is clear that Determinant(A) is positive (respec-tively, negative) at the rest point whose second component is v! (respectively,v+). Also, the value of this determinant goes to zero as * > 0 approacheszero.

In summary, a source and a saddle appear in a saddle node bifurcationupon crossing the parabola into the bounded region at points on the parabolacorresponding to 0 < F < 1/16; a sink and a saddle appear in a saddle nodebifurcation upon crossing the parabola into the bounded region at points onthe parabola corresponding to 1/16 < F < 1/4.

Another type of bifurcation, called Hopf bifurcation, occurs in the regimewhere A has complex eigenvalues; it occurs whenever, along a curve in theparameter space, a pair of complex conjugate eigenvalues crosses the imagi-nary axis in the complex plane with nonzero speed. A normal form for thisimportant bifurcation is most easily understood in polar coordinates (r, +);it is given by

r = br ± r3, + = , + ar2.

the corresponding system in Cartesian coordinates has the linear part

x = bx! ,y, y = ,x+ by. (5.46)

Conservation of Mass 75

With , #= 0 and a #= 0 fixed, a pair of complex conjugate eigenvalues (b± i,)crosses the imaginary axis as the bifurcation parameter b passes through zeroin the positive direction. The rest point at the origin thus changes from asink to a source. For the plus sign and b < 0, there is an unstable limitcycle (that is, an isolated periodic orbit), which is a circle of radius

+!b

that disappears into the rest point at b = 0. The bifurcation in this case iscalled a subcritical Hopf bifurcation. For the minus sign, a stable limit cycle(which in this special case is the circle with radius

+b) emerges out of the

rest point as b increases from zero.We can detect the Hopf bifurcation by finding the curve(s) in the parame-

ter space where the characteristic equation of the linearization at a rest pointhas pure imaginary eigenvalues. Generically, there is a Hopf bifurcation as acurve in the parameter spaces crosses this “Hopf curve.”

The eigenvalues of A are pure imaginary whenever its trace vanishes andits determinant is positive. For parameter values in the region of parameterspace bounded by the saddle node bifurcation curve, the system matrix of thelinearization at the rest point v+ has positive determinant. By the formulasin display (5.45), the trace of this matrix at v+ is given by (! v2+. Using theformulas in display (5.43) and

G := 1! 4(F + ()2

F,

the trace vanishes if and only if ((, F ) lie on the Hopf curve

( =F 2

4(F + ()2(1 +

+G)2.

After some algebra, the Hopf curve in the first quadrant is also given by

((+ F )2 = F+( ,

a quadratic equation for F that has solutions

F =

+(! 2(±

+(! 4(3/2

2. (5.47)

Because the trace of A (given by ( ! v2) vanishes and the determiniant ofA (given by (F + ()(v2 ! F )) is positive on the Hopf curve, we must haveF < ( on this curve. By inspection of the graphs of the solutions (5.47), it

76 Conservation of Mass

follows that this condition is satisfied only with the minus sign on the interval0 < ( < 1/16 = 0.0625. The corresponding graph, depicted in Figure 5.7,is the Hopf curve. It meets the saddle node curve at ((, F ) = (0, 0) and((, F ) = (1/16, 1/16).

Outside the saddle-node curve, the system (5.42) has one stable rest pointat (u, v) = (1, 0). Inside this curve the system has three rest points. Abovethe Hopf bifurcation curve and inside the saddle-node curve there are threerest points, two sinks and one saddle. Below the Hopf curve and above thesaddle-node curve there is one sink, one source and one saddle. There isa critical value (% $ 0.0325 of ( such that for F decreasing and ( < (%,the Hopf bifurcation is supercritical, for ( > (%, the Hopf bifurcation issubcritical.

To prove the statements about the subcritical and supercritical Hopf bi-furcations is not trivial. An idea for a proof is to translate the correspondingrest point to the origin of a new coordinate system and then transform (bya linear transformation) the resulting system so that its linearization hasthe normal form for the Hopf bifurcation given in display (5.46). After thisprocess is complete, the resulting second and third-order terms of the right-hand side of the system of di!erential equations, determine the “stabilityindex,” which gives the direction of the Hopf bifurcation (see [17]). For ourdi!erential equation in the form

x = &x! y + p(x, y), y = x+ &y + q(x, y)

where p =/&

j=1 pj(x, y) and q =/&

j=1 qj(x, y) with

pj(x, y) :=j0

i=0

aj!i,ixj!iyi, qj(x, y) :=

j0

i=0

bj!i,ixj!iyi,

the sign of the stability index is given by the sign of the expression

L4 =1

8(a20a11 + b21 + 3a30 ! b02b11

+ 3b03 + 2b02a02 ! 2a20b20 ! b20b11 + a12 + a02a11). (5.48)

If the quantity L4 > 0 (respectively, L4 < 0) , then our Hopf bifurcation issubcritical (respectively, supercritical).

The bifurcation diagram in Figure 5.7 is not complete. For example,the existence of the subcritical Hopf bifurcation for ( > (% as F decreases

Conservation of Mass 77

0.2 0.4 0.6 0.8 1

0.1

0.2

0.3

0.4

0.5

0.2 0.4 0.6 0.8 1

0.1

0.2

0.3

0.4

0.5

Figure 5.8: The left panel depicts the phase portrait for system (5.42) forthe parameter values ( = 0.05 and F = 0.02725. An orbit in the unstablemanifold of the saddle point is asymptotic to a spiral sink. In the oppositedirection on the stable manifold, an orbit is asymptotic to the sink at (1, 0).The right panel depicts the phase portrait for the parameter values ( = 0.05and F = 0.0265. The positions of the stable and unstable manifolds havecrossed. An orbit in the stable manifold of the saddle point is asymptotic toan unstable limit cycle, which surrounds a spiral sink (not depicted).

78 Conservation of Mass

0.2 0.4 0.6 0.8 1

0.1

0.2

0.3

0.4

0.5

0.6

0.7

Figure 5.9: The phase portrait for system (5.42) for the parameter values( = 0.02 and F = 0.0039847. An orbit in the unstable manifold of thesaddle point is asymptotic to a stable limit cycle. In the opposite directionon the stable manifold, an orbit is asymptotic to the sink at (1, 0).

through the Hopf curve means that an unstable limit cycle disappears intothe corresponding rest point at this bifurcation. Where did the limit cyclecome into existence for some larger value of F ? The answer is that there isa third bifurcation in our system called a homoclinic loop bifurcation.

Two phase portraits (corresponding to a value of the parameter F slightlylarger than its critical value and slightly smaller than its critical value) aredepicted in Figure 5.8. Pay attention to the portion of the unstable manifoldof the saddle point (which is at the point where two curves appear to cross)that lies above and to the left of the saddle; the other part of the unstablemanifold goes to the sink at (u, v) = (1, 0). In the left panel, the unstablemanifold lies below the stable manifold; in the right panel, it lies above.Between the parameter values corresponding to these phase portraits, thereis a value of F where the stable and unstable manifolds meet to form a(homoclinic) loop. During this process, there is a sink surrounded by theloop. In the second panel the stable manifold winds around this sink. But,it can’t be asymptotic to the sink. So, (by the Poincare-Bendixson theorem)there must be an unstable periodic orbit surrounding the sink and surroundedby the spiral formed by the stable manifold (see [17]). This is an example ofa homoclinic loop bifurcation.

Conservation of Mass 79

A homoclinic loop bifurcation also occurs for ( < 0.035 as F decreasesto a critical value below the Hopf curve. In this case the homoclinic loopbifurcation absorbs a stable limit cycle. An example of this cycle near thehomoclinic loop bifurcation is depicted in Figure 5.9.

The conjectural position of the homoclinic loop curve in the bifurcationdiagram is between the saddle-node and Hopf curve for ( < 0.035 and abovethe Hopf curve for ( > 0.035. Its end points are the same as the end pointsof the Hopf curve (see Exercise 5.22 and [9] for more details of the bifurcationanalysis of this system).

Exercise 5.21. Show that there is a critical value &% $ 0.0325 of & such that, for& < &%, system (5.42) has a supercritical Hopf bifurcation as F decreases throughthe Hopf curve (5.47).

Exercise 5.22. Make a numerical study of the homoclinic loop curve for sys-tem (5.42) and plot it together with the saddle-node and Hopf curves. Hint: Publicdomain software such as AUTO or XPPAUTO can approximate bifurcation curves.

Exercise 5.23. Add a periodic forcing term to system (5.42) and compute thestroboscopic Poincare map (that is, start at some initial condition integrate forwardfor one period of the forcing, plot the final point, and iterate this process. Vary theamplitude and frequency of the forcing and plot some typical phase portraits of thePoincare map.

Exercise 5.24. Add a periodic parametric forcing term to system (5.42) andcompute the stroboscopic Poincare map (that is, start at some initial conditionintegrate forward for one period of the forcing, plot the final point, and iterate thisprocess. Here the most interesting scenario is to make F or & periodically time-dependent so that these parameters sweep through some of their bifurcation values(cf. [35]). For example, fix & = 0.02 and replace F by

F = 0.004 + 0.00005 sin('t),

where ' is small (perhaps ' = 0.0001) so that F changes relatively slowly. See ifyou can obtain a long transient that exhibits beats. Our system is not well-suitedto dynamic bifurcation because the basin of attraction of the sink at (1, 0) is likelyto capture our orbit.

Exercise 5.25. A simple model (derived from the Oregonator model) for anoscillating chemical reaction between the concentrations x and z of two chemical

80 Conservation of Mass

species is given by

(x" =fz() ! x)

) + x+ x(1! x),

z" = x! z,

where (, f , and ) are positive parameters. For ) fixed at ) = 8( 10!4, determinethe parameters ( and f for which oscillations occur. Draw a bifurcation diagramfor the parameter space.

Exercise 5.26. The Brusselator model for a hypothetical oscillating chemicalreaction is

A& B

B +X & Y +D

2X + Y & 3X

X & E

Assume that the concentrations of A and B are constant. (a) Write the rateequations for the concentrations of the species X and Y . (b) Determine a changeof variables (including time) for your equation to obtain the dimensionless form

x= a! bx+ x2y ! x,

y = bx! x2y.

(c) Determine the steady state(s) of the dimensionless system and their stabilitytypes. (d) Show that oscillations can occur for some parameter values. (d) Drawa bifurcation diagram for oscillatory solutions in the (a, b) parameter space.

Exercise 5.27. The Oregonator is given by the reactions

A+ Y &X + P

X + Y & 2P

A+X & 2X + 2Z

2X & A+ P

B + Z & 1

2fY

where A, B, and P are assumed constant and f is a parameter 12 < f < 1. (a)

Show that the rate equations can transformed to the dimensionless system

(x" = )y ! xy + x(1! x),

*y" = )y ! xy + fz,

z" = x! z.

Conservation of Mass 81

Also express the parameters (, *, and ) as functions of the reaction rates. (b)Assume that the parameters are

( $ 4( 10!2, * $ 4( 10!4, ) $ 8( 10!4.

Consider * as a small parameter; ( and ) as parameters. In the limiting case with* = 0, argue that in the region x > 0 it makes sense to take

y =fz

q + x.

What ingredients would be needed to make a rigorous argument? Use the formulafor y to obtain the system

(x" =fz() ! x)

) + x+ x(1! x), z" = x! z

studied in Exercise 5.25.

Di!usion and Spatial Discretization

We have succeeded in understanding the bifurcation diagram for the Gray-Scott model without di!usion. What happens when di!usion is introduced?

It seems reasonable that if we add su"ciently small di!usion (" and µ)and choose our parameters ( and F in the region where the only steady stateis (u, v) = (1, 0), then this spatially constant steady state will also be a stablesteady state for the PDE (5.33). On the other hand, it is not at all clearwhat happens for parameter values close to the bifurcations for the reactionequations (5.42). Let us explore the dynamical behavior of the PDE nearthese values using numerical approximations.

By adding the Taylor series (5.38) and rearranging terms, note that

F ""(x) =F (x+ h)! 2F (x) + F (x! h)

h2+O(h2). (5.49)

This approximation is used to discretize the second derivatives in our PDE.The first step of our numerical procedure is to choose a spatial discretiza-

tion of a spatial domain. For the Gray-Scott model there is no naturalspatial domain; it is just some region in two-dimensional space. FollowingPearson [51], let us consider the spatial domain to be the square [0, L]( [0, L]

82 Conservation of Mass

in the (x, y)-plane. A lattice (or grid) in this square is defined by the points(i$x, j$y) (called nodes), for i = 0, 1, 2, . . . , m and j = 0, 1, 2, . . . , n, where$x := L/m and $y := L/n. As in Euler’s method for ODEs, let us alsochoose a time step $t. The concentration u(i$x, j$y, k$t) is denoted byUki,j and v(i$x, j$y,$t) by V k

i,j.The next step is to approximate the PDE by di!erence quotients; this

idea leads to many possible alternatives. Perhaps the simplest viable schemeis the forward Euler method given by

Uk+1i,j = Uk

i,j +$t1 "

$x2(Uk

i+1,j ! 2Uki,j + Uk

i!1,j) +"

$y2(Uk

i,j+1 ! 2Uki,j + Uk

i,j!1)

+ F (1! Uki,j)! Uk

i,j(Vki,j)

22,

V k+1i,j = V k

i,j +$t1 µ

$x2(V k

i+1,j ! 2V ki,j + V k

i!1,j) +µ

$y2(V k

i,j+1 ! 2V ki,j + V k

i,j!1)

+ Uki,j(V

ki,j)

2 ! (F + ()V ki,j

2; (5.50)

it is exactly Euler’s method applied to PDEs.The third step is to impose the boundary conditions. For periodic bound-

ary conditions, we will update the concentrations at (what we will call) theinterior nodes corresponding to i = 0, 1, 2, . . . , m! 1 and i = 0, 1, 2, . . . , m!1. To do this, we will require values at the “fictitious nodes” with (i, j)-coordinates (!1, j), for j = 0, 1, 2, . . . , n!1 and (i,!1), for i = 0, 1, 2, . . . , m!1. These are defined by

Uk!1,j = Uk

m!1,j , V k!1,j = V k

m!1,j,Uki,!1 = Uk

i,n!1, V ki,!1 = V k

i,n!1.(5.51)

Likewise we define values at the unassigned portion of the boundary of thesquare:

Ukm,j = Uk

0,j , V km,j = V k

0,j,Uki,n = Uk

i,0, V ki,n = V k

i,0.(5.52)

To complete the grid (for graphics), we can also define Ukm,n = Uk

0,0.To implement this procedure, we start at k = 0 and assign (initial) val-

ues of the concentrations at all the interior nodes. The periodic boundaryconditions are used to assign values to the unassigned portion of the bound-ary of the square and at the fictitious nodes. We then update the values ofthe concentrations (to U1

ij and V 1ij) at all the interior nodes using the equa-

tions (5.50), and update the values of the concentrations at the reminder of

Conservation of Mass 83

Figure 5.10: The figure depicts the u-concentration for a computer generatedapproximate state of the Gray-Scott model for the parameter values ( = 0.06,F = 0.038, " = 2(10!5 and µ = 10!5. The system evolves from the depictedstate to states with similar configurations for at least 200,000 time steps ofunit length.

the boundary and the fictitious nodes using the formulas (5.51) and (5.52).This process is continued until some preassigned final time is reached, oruntil some other test applied to the array of concentrations is met.

To reproduce the numerical experiments in [51] (which are reported withcolor graphics), use the assignments

L = 2.5, m = n = 256, " = 2( 10!5, µ = 10!5, $t = 1.0

with ((, F ) chosen near the bifurcation curves in Figure 5.7 and impose theinitial data as follows: Set the initial concentrations to the spatial steadystate value (u, v) = (1, 0), reset the values in the 20 ( 20 central square ofnodes to (u, v) = (0.5, 0.25), and then perturb every grid point value by arandom number that changes the originally assigned value by no more than1%. Integrate forward for some number of time steps, usually chosen in therange 100,000–200,000, and plot the final approximate concentrations.

The result of a typical numerical experiment, for the parameter values( = 0.06 and F = 0.038, 100,000 time steps of unit length, and a renderingof the value of the function (x, y) %& u(100000, x, y) into a Gray scale on theinterval [0, 1], is depicted in Figure 5.10. This pattern seems to evolve over a

84 Conservation of Mass

long time-interval and eventually it reaches a (time-independent) steady statethat retains the basic qualitative features in the figure (see Exercise 5.28).

Numerical Stability

A virtue of the forward Euler method is that it is easy to program. Its errorper step is O($x2 +$y2) in space and O($t) in time. Unfortunately, thereis a hidden danger: the discretization can introduce instabilities that are notpresent in the PDE.

To understand how a numerical instability might occur, imagine that thevalues of the concentrations at the interior grid points are written as a columnvector W (of length 2mn). The update equations (5.50) can be recast in thematrix form

W k+1 = AW k +H(W k),

where A is the matrix corresponding to the discretization of the secondderivatives and H is the nonlinear function whose components are the re-action terms. Is this process stable?

The linear part of our update equation is W k+1 = AW k. At some step ofour numerical computation, perhaps the first, an error E will be introducedinto the computed value of W k; it will propagate in future steps as follows:

W 2 = AW 1 + E, W 3 = A2W 1 + AE, . . .W k+2 = Ak+1W 1 + AkE.

The error will not cause too much trouble if its propagation by the iterationprocess remains bounded; that is, if there is some constant M such that|AkE| ' M |E| for all k > 1. A su"cient condition for the desired stabilityis that all eigenvalues of A are in the open unit disk in the complex plane;or, equivalently, the spectral radius of A is strictly less than one. On theother hand, if at least one eigenvalue of A lies outside the closed unit disk,then a generic error will grow without bound. (The error will not grow inthe unlikely situation that it remain in the eigenspace of an eigenvalue whichis in the open unit disk.)

Unfortunately, in some cases there are choices of $t, $x and $y, suchthat some eigenvalue of A (the matrix for the forward Euler method) liesoutside the unit disk.

For simplicity, let us consider the A-matrix for the forward Euler methodin case there is only one spatial dimension. The forward Euler update equa-tion is given by

Uk+1i = Uk

i + "(Uki+1 ! 2Uk

i + Uki!1),

Conservation of Mass 85

for i = 1, 2, . . .m, where " := µ$t/$x2 and µ " 0. Using the rearrangement

Uk+1i = (1! 2")Uk

i + "Uki+1 + "Uk

i!1

and assuming that Uk!1 = 0 and Uk

m+1 = 0, it follows that

A =

!

%%%%%%%"

1! 2" " 0 0 0 0 · · · "" 1! 2" " 0 0 0 · · · 00 " 1! 2" " 0 0 · · · 0...

...0 0 · · · 0 0 " 1! 2" "" 0 0 · · · 0 0 " 1! 2"

#

&&&&&&&$

.

By an application of Gerschgorin’s theorem (A.4), the eigenvalues of A alllie in the interval [1 ! 4", 1]. Thus, there is the possibility of an eigenvalueoutside the unit disk if 1 ! 4" < !1; that is, if " " 1/2. Using this result,our stability criterion is

µ$t

$x2<

1

2. (5.53)

Numerical instabilities that lead to meaningless numerical results might occurif this condition is not met (see Exercise 5.30).

Exercise 5.28. (a) Perform numerical experiments (using the forward Eulermethod with periodic boundary conditions) that reproduces a pattern for the Gray-Scott model similar to the pattern in Figure 5.10. (b) Demonstrate that the quali-tative results for part (a) do not change with the choice of the choice of step sizesin space and time. For example, repeat the experiment(s) in part (a) with a spatialgrid containing twice the number of nodes. (b) Use the code written for part (a)to find a pattern generated by the Gray-Scott model that is clearly di!erent fromthe pattern in Figure 5.10 and does not correspond to a constant value of u.

Exercise 5.29. Explore the parameter space for the Gray-Scott model (using theforward Euler method with no flux boundary conditions).

Exercise 5.30. Write a forward Euler code for the one dimensional heat equa-tion ut = +uxx with Neumann boundary conditions on the interval [0, 1]. Takinginto account the stability condition (5.53), demonstrate with carefully designed nu-merical experiments that numerical instability occurs when the stability conditionis not met.

86 Conservation of Mass

Exercise 5.31. Determine the stability criterion analogous to inequality (5.53)for the forward Euler scheme with periodic boundary conditions for the PDE (5.33).

We have explored some of the qualitative long-term behavior of the Gray-Scott model. The forward Euler method converges to the solution of thePDE as the discretization step sizes in space and time approach zero. But,how do we know that the qualitative behavior—for example, the qualitativebehavior depicted in Figure 5.10—is present in the solution of the PDE? Thisis a di"cult question. The correct answer: we don’t know! The only wayto be sure is to prove a mathematical theorem. On the other hand, we cangain confidence in the correctness of the results of a numerical experimentin several ways that will be discussed. For example, we might computethe answer with di!erent step sizes in (space and time) and confirm that thequalitative features of the computed values do not change (see Exercise 5.28);or, we might recompute with a di!erent numerical scheme.

We should start with a moderately small step size (perhaps the step sizeequal to one) and decrease the step size until the result of the experimentdoes not appear to change with the choice of the step size. A decease instep size theoretically decreases the truncation error. On the other hand, aswe decrease the step size, we increase the number of numerical operations(additions, subtractions, multiplications, and divisions) thus increasing thee!ects of roundo! error due to the finite number of decimal digits storedin the computer. Another source of error is called condition error. Onemanifestation of this type of error is due to the big O estimates that determinethe order of the numerical method. Recall that these estimates state that theerror in some approximation is proportional to a power of the step size. But,the size of the constant of proportionality is ignored. It might happen thatthese constants are very large for our application, in which case it is calledill-conditioned. The errors due to roundo! and condition tend to accumulatewith subsequent iterations of our numerical method. Hence, the global errorwill generally decrease with step size to some minimum value as the orderestimates dominate; but, it will increase (perhaps not monotonically) as thestep size is decreased further due to the accummulation of roundo! andcondition errors.

Quantitative PDE: A computational challenge

The interesting qualitative behavior of the Gray-Scott model is the patternformation. Because it is di"cult to quantify a particular pattern, we will