Unformatted text preview: nt boundary value problem y00(x) = f (x y y0) a<x<b y(a) = A y(b) = B (6.3.1) to describe the essential details of nite di erence methods.
To begin, we divide the domain a x b into N uniform subintervals of width h= b;a
N (6.3.2a) as shown in Figure 6.3.1. Restriction to uniform subintervals is not essential, but is
introduced here for simplicity. We also let xi = a + ih i = 0 1 : : : N:
11 (6.3.2b) y y1
y0 = A yN = B y(x 1)
y1 h
a = x0 x1 x
x N= b xi Figure 6.3.1: Domain, discretization, and notation used for nite di erence solutions of
(6.3.1).
In solving the BVP (6.3.1) by nite di erences, all derivatives are replaced by nite
di erence approximations. These can be constructed from interpolating polynomials, but
we'll illustrate a di erent approach using Taylor's series expansions of the solution y(x).
Thus, consider
k
2
(6.3.3)
y(x) = y(xi) + (x ; xi )y0(xi ) + (x ; xi ) y00(xi ) + : : : + (x ; !xi) y(k)( )
2!
k
where is between xi and x. Speci cally, choosing x = xi+1 = xi + h yields
2
3
k
y(xi+1) = y(xi) + hy0(xi ) + h y00 (xi) + h y000 (xi) + : : : + h ! y(k)( i+1):
(6.3.4a)
2
6
k
Similarly, selecting x = xi;1 = xi ; h produces
2
3
k
y(xi;1) = y(xi) ; hy0(xi) + h y00(xi ) ; h y000(xi) + : : : + (;h) y(k)( i;1): (6.3.4b)
2
6
k!
Setting k = 2 in (6.3.4a) and solving for y0(xi) yields
y0(xi) = y(xi+1)h; y(xi) ; h y00( i+1):
(6.3.5a)
2
Finite di erence approximations are obtained by neglecting the error term of the Taylor's
series thus, the rst forward nite di erence approximation of y0(xi ) is
yi0 = yi+1h; yi
(6.3.5b)
12 and the local discretization error of this approximation is
i = ; h y00(
2 i+1 ): (6.3.5c) Subscripts on y denote nite di erence approximations hence, yi denotes an approximation of y(xi), etc.
In a similar manner, the rst backward di erence approximation of y0(xi ) is obtained
by setting k = 2 in (6.3.4b) yi0 = yi ;hyi;1 i = h y00( i;1):
2 (6.3.6) Notice, however, that a higherorder and symmetric di erence approximation can be
obtained by subtracting (6.3.4b) from (6.3.4a) and setting k = 3 to get
Solving for y0(xi) 3
y(xi+1) ; y(xi;1) = 2hy0(xi ) + h y000( i):
3 ;
yi0 = yi+1 2h yi;1 i = ; h y000 ( i):
6
2 (6.3.7) The di erence formula (6.3.7) is called the rst central di erence approximation of y0(xi ).
In Chapter 5, we found that this approximation led to the leap frog scheme, which had
poor stability characteristics. Here, with secondorder ODEs, central di erences will
generally be preferred to either forward or backward di erences because of their higherorder local discretization errors.
Remark 1. The higherorder accuracy of (6.3.7) relative to (6.3.5) or (6.3.6) only
occurs on a uniform mesh. With nonuniform spacing the second derivative terms in
(6.3.4a) and (6.3.4b) would not cancel upon subtraction.
A central di erence approximation of the second derivative y00(xi ) is obtained by
adding (6.3.4a) and (6.3.4b) while setting k = 4 to obtain yi00 = yi+1 ; 2y2i + yi;1
h h2
= ; 12 yiv ( i):
i (6.3.8) No further approximations are needed to solve (6.3.1) by nite di erences however,
we note that approximations of higher derivatives are obtained by using Taylor's series
13 at more points. For example, consider evaluating the Taylor's series (6.3.3) at x = xi+2
and xi;2 to obtain
h4
h3
(6.3.9a)
y(xi+2) = y(xi) + 2hy0(xi ) + 2h2y00 (xi) + 43 y000(xi ) + 23 yiv (xi ) + : : :
and
h4
h3
y(xi;2) = y(xi) ; 2hy0(xi ) + 2h2y00(xi ) ; 43 y000(xi ) + 23 yiv (xi ) + : : : : (6.3.9b)
Subtracting (6.3.9b) from (6.3.9a) yields
0(xi) + 8h3 y000 (xi) + O(h5):
y(xi+2) ; y(xi;2) = 4hy
3
A similar subtraction of (6.3.4b) from (6.3.4a) yields
3
y(xi+1) ; y(xi;1) = 2hy0(xi ) + h y000(xi ) + O(h5):
3
Elimination of the rst derivative term yields a central di erence approximation of the
third derivative as
(6.3.10)
yi000 = yi+2 ; 2yi+12+32yi;1 ; yi;2 :
h
The local discretization error i = O(h2).
Similar combinations of (6.3.4) and (6.3.9) yield an O(h2) central di erence approximation of the fourth derivative as
yiiv = yi+2 ; 4yi+1 + 6y4i ; 4yi;1 + yi;2 :
(6.3.11)
h
Now let us return to the task of solving (6.3.1) by nite di erence approximations.
We'll try centraldi erence approximations because of their higher order. Thus, evaluating (6.3.1) at x = xi and replacing derivatives by central di erences using (6.3.7a) and
(6.3.8a), we obtain
yi+1 ; 2yi + yi;1 = f (x y yi+1 ; yi;1 )
(6.3.12a)
ii
h2
2h
Writing (6.3.12a) at each interior mesh point i = 1 2 : : : N ; 1, and using the two
boundary conditions y0 = A yN = B
14 (6.3.12b) gives a system of N + 1 nonlinear algebraic equations in the N + 1 unknowns yi, i =
0 1 : : : N . This system is too complex for an introductory example, so let us con ne
our attention to linear problems with f (x y y0) = ;p(x)y0 ; q(x)y + r(x): (6.3.13) In this case, the approximation (6.3.12a) becomes yi+1 ; 2yi + yi;1 + p yi+1 ; yi;1 + q y = r
i = 1 2 ::: N ; 1
(6.3.14)
i
ii
i
h2
2h
where...
View
Full Document
 Spring '14
 JosephE.Flaherty
 Numerical Analysis, Boundary value problem, di erences, di erence

Click to edit the document details