16.12.2012 Views

Computer Algebra Recipes

Computer Algebra Recipes

Computer Algebra Recipes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

150 CHAPTER 4. NONLINEAR ODE MODELS<br />

4.1 First-Order Models<br />

4.1.1 An Irreversible Reaction<br />

I shall use the phrase \time's arrow" to express this one-way property<br />

of time which has no analogue in space.<br />

Arthur Eddington, British astrophysicist (1882{1944)<br />

As our ¯rst example, we consider the following problem, which the reader was<br />

previously asked to solve numerically (see Problem 2-29).<br />

Consider the irreversible chemical reaction<br />

2K 2Cr 2O 7 +2H 2O+3S ! 4KOH+2Cr 2O 3 +3SO 2<br />

with initially N1 molecules of potassium dichromate (K 2Cr 2O 7), N2 molecules of<br />

water (H2O), N3 atoms of sulphur (S), and 0 molecules of potassium hydroxide<br />

(KOH). The number x of KOH molecules at time t seconds is given by the<br />

nonlinear rate equation<br />

_x = k (2 N1 ¡ x) 2 (2 N2 ¡ x) 2 (4 N3=3 ¡ x) 3<br />

with k =1:64 £ 10 ¡20 s ¡1 . Taking N1 = 2000, N2 = 2000, and N3 = 3000,<br />

analytically determine the number of KOH molecules at arbitrary time t>0<br />

and plot the solution for the ¯rst second after the chemical reaction begins.<br />

How many KOH molecules are present at 0:2 seconds? How many are present<br />

in the limit t !1?<br />

To observe Maple's method of solution, the infolevel[dsolve] command<br />

is set equal to 2, and the rate equation entered.<br />

> restart: infolevel[dsolve]:=2:<br />

> de:=diff(x(t),t)=k*(2*N1-x(t))^2*(2*N2-x(t))^2<br />

*(4*N3/3-x(t))^3;<br />

de := d<br />

dt x (t) =k (2 N1 ¡ x(t))2 (2 N2 ¡ x(t)) 2<br />

μ<br />

4 N3<br />

3<br />

3<br />

¡ x(t)<br />

Theratecoe±cientk and the initial molecule numbers are speci¯ed.<br />

> k:=1.64*10^(-20): N1:=2000: N2:=2000: N3:=3000:<br />

The di®erential equation de is analytically solved for x(t), subject to x(0) = 0.<br />

> sol:=dsolve(fde,x(0)=0g,x(t));<br />

Methods for ¯rst order ODEs:<br />

| Trying classi¯cation methods |<br />

trying a quadrature<br />

trying 1st order linear<br />

trying Bernoulli<br />

trying separable<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!