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.

96 CHAPTER 2. PHASE-PLANE ANALYSIS<br />

and for (b) a period-two solution. Discuss how this interpretation can be made<br />

from your plots.<br />

Problem 2-24: Arti¯cial example<br />

Consider the nonlinear equation<br />

dy=dx = xy(y ¡ 2);<br />

with y(0) = 1. Taking h =0:02 and 10-digit accuracy, solve for y(x) outto<br />

x = 3 using the dial-up Euler's method and plot the result.<br />

Problem 2-25: Modi¯ed Euler algorithm<br />

If the rabbits{foxes system is written for brevity as _r = R(r; f )and_ f = F (r; f ),<br />

the modi¯ed Euler algorithm for solving the equations is<br />

rn+1 = rn + h<br />

2 (R1[n]+R2[n]); fn+1 = fn + h<br />

2 (F1[n]+F2[n]);<br />

where<br />

tn+1 = tn + h; R1[n] ´ R(rn;fn); F1[n] ´ F (rn;fn);<br />

R2[n] ´ R(rn + hR1[n];fn + hF1[n]); F2[n] ´ F (rn + hR1[n];fn + hF1[n]):<br />

Taking the same parameter values as in the text recipe, but N twice as large,<br />

solve the rabbits{foxes equations using the modi¯ed Euler algorithm given<br />

above. Rotate your plot to show the r{f phase plane and compare the result<br />

with that for the Euler method.<br />

Problem 2-26: Onset of numerical instability<br />

Investigate the onset of numerical instability as h is increased in the modi¯ed<br />

Euler algorithm of the previous problem.<br />

2.3.3 Glycolytic Oscillator<br />

Give me another horse!<br />

William Shakespeare, King Richard III (1564{1616)<br />

The Euler algorithm, which is the simplest example of an explicit ¯xed-step<br />

method, is not a very accurate numerical procedure, being of order h accuracy<br />

(error O(h2 )). A systematic approach to developing more accurate explicit numerical<br />

schemes are the ¯xed-step Runge{Kutta (RK) methods [BF89], which<br />

still use the FDA approximation for the ¯rst derivatives but create better approximations<br />

to the functions on the right-hand side of the ODEs.<br />

Consider an ODE system of the general form<br />

_x = X(t; x; y); _y = Y (t; x; y); (2.17)<br />

where X and Y are known functions of the arguments. Note that any secondorder<br />

ODE of the general structure Äx = Y (t; x; _x) can be put into this standard<br />

form by setting _x = y ´ X.<br />

In the Euler method, the functions X and Y are evaluated only once on<br />

each step. The general RK approach is to increase the accuracy by using more

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

Saved successfully!

Ooh no, something went wrong!