The Chemistry Maths Book, Second Edition

(Grace) #1

588 Chapter 20Numerical methods


Euler’s method is called a first-order method because only the first power of his


retained in the Taylor expansion. The truncation error at each step is therefore of


order h


2

, so that halving the step size hreduces the error by a factor of 4. However, the


cumulative (global) error for a series of steps is of order h.


EXAMPLE 20.18Given the initial value problem


y′(x) 1 = 1 y 1 + 1 1, y(0) 1 = 11


use Euler’s method to obtain an approximate value ofy(1)using step sizesh 1 = 1 0.2


andh 1 = 1 0.1.


The results of applying the recursion


y


n+ 1

1 = 1 y


n

1 + 1 h(y


n

1 + 1 1)


are summarized in Table 20.10, and compared with the exact values obtained from


the solutiony(x) 1 = 12 e


x

1 − 1 1.


Table 20.10 Example of Euler’s method


hnx


n

y


n

exact error hnx


n

y


n

exact error


0.2 0 0.0 1.0000 1.0000 0.0000 0.1 0 0.0 1.0000 1.0000 0.0000


1 0.1 1.2000 1.2103 0.0103


1 0.2 1.4000 1.4428 0.0428 2 0.2 1.4200 1.4428 0.0228


3 0.3 1.6620 1.6997 0.0377


2 0.4 1.8800 1.9836 0.1036 4 0.4 1.9282 1.9836 0.0554


5 0.5 2.2210 2.2974 0.0764


3 0.6 2.4560 2.6442 0.1882 6 0.6 2.5431 2.6442 0.1011


7 0.7 2.8974 3.0275 0.1301


4 0.8 3.1472 3.4511 0.3039 8 0.8 3.2872 3.4511 0.1639


9 0.9 3.7159 3.9192 0.2033


5 1.0 3.9766 4.4366 0.4599 10 1.0 4.1875 4.4366 0.2491


.

..

..

...

..

...

..
...
...
..
...
...
..
..

.
...
...
..
...
...
..
..

......................
........
...

.

.......

........

...

x


y














y


0

y


1

y


2

x


0

x


1

x


2

.....

..........

.........

..........

..........

.........

.......

.....

...

....

.....

....

....

....

....

....

.....

....

....

....

....

....

...

...................

........................

...................

.................

..............

.............

.............

..........

..........

...........

........

.........

.........

........

.......

.........

.......

.......

........

.......

.......

........

......

.......

........

......

......

.......

.......

......

.......

......

.....

.......

......

......

......

......

.....

.......

.....

......

......

......

.....

.......

.....

......

......

......

.....

.......

.....

......

......

Figure 20.11

Free download pdf