next up previous
Next: 2. Error Estimates and Up: 1 Previous: 1.2. Euler's Method

1.3 Example:

Use the Euler's Algorithm to find the approximate value of the solution of the IVP

$\displaystyle y'=y^2,\qquad y(0)=1,\qquad 0\leq x \leq 0.5,$

using step size (i)0.1, (ii)0.005, (iii) (iv)
Show that the exact solution of the IVP is $ y(x)=\frac{1}{1-x}.$ Calculate the error and tabulate the results.
Solution: Comparing the given IVP with (1.1), we note that $ f(x,y)=y^2, \,\, a=0,\,b=0.5,\, y_0=1$. The Euler's algorithm now reads ..... used notations,

$\displaystyle y_{k+1}=y_k+hy^2_k,\qquad k=0,1,2...$and $\displaystyle y_0=1$

See tables 1,2,3 and 4 for the results (upto 5 decimal places)
    Table 1      
Initial x Initial y Stepsize h Appx. y Exa. y Error
0.00000 1.00000 0.10000      
0.10000 1.00000 0.10000 1.10000 1.11111 0.01111
0.20000 1.10000 0.10000 1.22100 1.25000 0.02900
0.30000 1.22100 0.10000 1.37008 1.42857 0.05849
0.40000 1.37008 0.10000 1.55780 1.66667 0.10887
0.50000 1.55780 0.10000 1.80047 2.00000 0.19953



    Table 2      
Initial x Initial y Stepsize h Appx. y Exa. y Error
0.00000 1.00000 0.05000      
0.05000 1.00000 0.05000 1.05000 1.05263 0.00263
0.10000 1.05000 0.05000 1.10513 1.11111 0.00599
0.15000 1.10513 0.05000 1.16619 1.17647 0.01028
0.20000 1.16619 0.05000 1.23419 1.25000 0.01581
0.25000 1.23419 0.05000 1.31035 1.33333 0.02298
0.30000 1.31035 0.05000 1.39620 1.42857 0.03237
0.35000 1.39620 0.05000 1.49367 1.53846 0.04479
0.40000 1.49367 0.05000 1.60522 1.66667 0.06144
0.45000 1.60522 0.05000 1.73406 1.81818 0.08412
0.50000 1.73406 0.05000 1.88441 2.00000 0.11559

    Table 3      
Initial x Initial y Stepsize h Appx. y Exa. y Error
0.00000 1.00000 0.02500      
0.02500 1.00000 0.02500 1.02500 1.02564 0.00064
0.05000 1.02500 0.02500 1.05127 1.05263 0.00137
0.07500 1.05127 0.02500 1.07889 1.08108 0.00219
0.10000 1.07889 0.02500 1.10799 1.11111 0.00312
0.12500 1.10799 0.02500 1.13869 1.14286 0.00417
0.15000 1.13869 0.02500 1.17110 1.17647 0.00537
0.17500 1.17110 0.02500 1.20539 1.21212 0.00673
0.20000 1.20539 0.02500 1.24171 1.25000 0.00829
0.22500 1.24171 0.02500 1.28026 1.29032 0.01006
0.25000 1.28026 0.02500 1.32124 1.33333 0.01210
0.27500 1.32124 0.02500 1.36488 1.37931 0.01443
0.30000 1.36488 0.02500 1.41145 1.42857 0.01712
0.32500 1.41145 0.02500 1.46125 1.48148 0.02023
0.35000 1.46125 0.02500 1.51464 1.53846 0.02383
0.37500 1.51464 0.02500 1.57199 1.60000 0.02801
0.40000 1.57199 0.02500 1.63377 1.66667 0.03290
0.42500 1.63377 0.02500 1.70050 1.73913 0.03863
0.45000 1.70050 0.02500 1.77279 1.81818 0.04539
0.47500 1.77279 0.02500 1.85136 1.90476 0.05340
0.50000 1.85136 0.02500 1.93705 2.00000 0.06295

    Table 4      
Initial x Initial y Stepsize h Appx. y Exa. y Error
0 1 0.0250000      
0.0250000 1 0.0250000 1.025 1.025641026 0.000641026
0.0500000 1.025 0.0250000 1.051265625 1.052631579 0.001365954
0.0750000 1.051265625 0.0250000 1.07889461 1.081081081 0.002186471
0.1000000 1.07889461 0.0250000 1.10799495 1.111111111 0.003116161
0.1250000 1.10799495 0.0250000 1.13868627 1.142857143 0.004170873
0.1500000 1.13868627 0.0250000 1.171101431 1.176470588 0.005369158
0.1750000 1.171101431 0.0250000 1.205388395 1.212121212 0.006732817
0.2000000 1.205388395 0.0250000 1.241712424 1.25 0.008287576
0.2250000 1.241712424 0.0250000 1.280258668 1.290322581 0.010063913
0.2500000 1.280258668 0.0250000 1.321235224 1.333333333 0.012098109
0.2750000 1.321235224 0.0250000 1.364876787 1.379310345 0.014433558
0.3000000 1.364876787 0.0250000 1.411449003 1.428571429 0.017122425
0.3250000 1.411449003 0.0250000 1.46125371 1.481481481 0.020227771
0.3500000 1.46125371 0.0250000 1.514635271 1.538461538 0.023826268
0.3750000 1.514635271 0.0250000 1.571988271 1.6 0.028011729
0.4000000 1.571988271 0.0250000 1.633766949 1.666666667 0.032899718
0.4250000 1.633766949 0.0250000 1.70049681 1.739130435 0.038633625
0.4500000 1.70049681 0.0250000 1.772789045 1.818181818 0.045392773
0.4750000 1.772789045 0.0250000 1.85135857 1.904761905 0.053403335
0.5000000 1.85135857 0.0250000 1.937046784 2 0.062953216

We conclude this section with a flow chart for Euler's Algorithm.


next up previous
Next: 2. Error Estimates and Up: 1 Previous: 1.2. Euler's Method
root 2006-02-16