The Chemistry Maths Book, Second Edition

(Grace) #1

20.9 First-order differential equations 587


A numerical method for solving a differential equation is equivalent to starting at


a particular point in the direction field and following the field lines. A number of


methods are available for the solution of most types of differential equation met in the


physical sciences, and most of these have their origin in the Taylor expansion (7.24).


Given the valuey(x


0

) 1 = 1 y


0

of the functiony(x)atx 1 = 1 x


0

, the value at the neighbouring


pointx


1

1 = 1 x


0

1 + 1 his


(20.50)


Then, becausey′(x


0

) 1 = 1 f(x


0

, y


0

)by (20.49),


or


y


1

1 = 1 y


0

1 + 1 hF


0

(20.51)


whereF


0

1 = 1 (y


1

1 − 1 y


0

) 2 (x


1

1 − 1 x


0

)is the slope of the line joining the points 0 and 1 on the


graph ofy(x)(the average slope of the curve). The different numerical methods use


different way of estimating this slope, leading to the recursion relation


y


n+ 1

1 = 1 y


n

1 + 1 hF


n

(20.52)


wherex


n

1 = 1 x


0

1 + 1 nhandy


n

1 ≈ 1 y(x


n

). We consider first the simplest possible method,


Euler’s method.


Euler’s method


Euler’s method is to truncate the Taylor expansion after the second term,


y(x


1

) 1 ≈ 1 y(x


0

) 1 + 1 hy′(x


0

)


so that F


0

has been approximated by the slope at the initial point (x


0

, y


0

). An


approximate value ofy(x


1

)is then


y


1

1 = 1 y


0

1 + 1 hf(x


0

, y


0

) (20.53)


and this provides us with a simple step-by-step procedure whereby an approximate


solution of the equation is obtained by repeated application of the recursion


y


n+ 1

1 = 1 y


n

1 + 1 hf(x


n

, y


n

), n 1 = 1 0, 1, 2, = (20.54)


wherex


n

1 = 1 x


0

1 + 1 nhand y


n

1 ≈ 1 y(x


n

). At each step the slope of the line from point n


to point (n 1 + 11 ) is that of the direction field line at point n, and the procedure is


illustrated in Figure 20.11.


yx yx hf x y() () ( ) hy x()


10 00

2

0

1


2


=+ ,+′′ +


yx yx hy x() () () hy x()


10 0

2

0

1


2


=+′+′′ +

Free download pdf