6.5 KB · commit a9602da
We have so far discussed the methods which yield the solution of a differential equation in the form of a power series. We will now describe the methods which give the solution in the form of a set of tabulated values.
Suppose that we wish to solve the Eqs. (8.1) for values of y at x=xr=x0+rh (r=1,2,…). Integrating Eq. (8.1), we obtain y1=y0+∫x0x1f(x,y)dx.(8.6) Assuming that f(x,y)=f(x0,y0) in x0≤x≤x1, this gives Euler’s formula y1≈y0+hf(x0,y0).(8.7a) Similarly for the range x1≤x≤x2, we have y2=y1+∫x1x2f(x,y)dx. Substituting f(x1,y1) for f(x,y) in x1≤x≤x2 we obtain y2≈y1+hf(x1,y1).(8.7b) Proceeding in this way, we obtain the general formula yn+1=yn+hf(xn,yn),n=0,1,2,…(8.8) The process is very slow and to obtain reasonable accuracy with Euler’s method, we need to take a smaller value for h. Because of this restriction
on h, the method is unsuitable for practical use and a modification of it, known as the modified Euler method, which gives more accurate results, will be described in Section 8.4.2.
Let the true solution of the differential equation at x=xn be y(xn) and also let the approximate solution be yn. Now, expanding y(xn+1) by Taylor’s series, we get
y(xn+1)=y(xn)+hy′(xn)+2h2y′′(xn)+⋯=y(xn)+hy′(xn)+2h2y′′(τn),where xn≤τn≤xn+1.(8.9)We usually encounter two types of errors in the solution of differential equations. These are (i) local errors, and (ii) rounding errors. The local error is the result of replacing the given differential equation by means of the equation yn+1=yn+hyn′. This error is given by Ln+1=−21h2y′′(τn)(8.10) The total error is then defined by en=yn−y(xn)(8.11) Since y0 is exact, it follows that e0=0. Neglecting the rounding error, we write the total solution error as
en+1=yn+1−y(xn+1)=yn+hyn′−[y(xn)+hy′(xn)−Ln+1]=en+h[f(xn,yn)−y′(xn)]+Ln+1.⟹en+1=en+h[f(xn,yn)−f(xn,y(xn))]+Ln+1. By mean value theorem, we write f(xn,yn)−f(xn,y(xn))=[yn−y(xn)]∂y∂f(xn,ξn),y(xn)≤ξn≤yn. Hence, we have en+1=en[1+hfy(xn,ξn)]+Ln+1(8.12) Since e0=0, we obtain successively:
e1e3=L1;e2=[1+hfy(x1,ξ1)]L1+L2;=[1+hfy(x2,ξ2)][1+hfy(x1,ξ1)](L1+L2)+L3; etc.See the book by Isaacson and Keller [1966] for more details.
Instead of approximating f(x,y) by f(x0,y0) in Eq. (8.6), we now approximate the integral given in Eq. (8.6) by means of trapezoidal rule to obtain y1=y0+2h[f(x0,y0)+f(x1,y1)](8.13) We thus obtain the iteration formula y1(n+1)=y0+2h[f(x0,y0)+f(x1,y1(n))],n=0,1,2,…(8.14) where y1(n) is the nth approximation to y1. The iteration formula (8.14) can be started by choosing y1(0) from Euler’s formula: y1(0)=y0+hf(x0,y0).