4.5 KB · commit a9602da
Let the (x,y) plane be divided into a network of rectangles of sides Δx=h and Δy=k by drawing the sets of lines
xy=ih,i=0,1,2,…=jk,j=0,1,2,…The points of intersection of these families of lines are called mesh points, lattice points or grid points. Then, we have
\begin{aligned} u_x &= \frac{u_{i+1, j} - u_{i, j}}{h} + O(h) \tag{9.15} \\ &= \frac{u_{i, j} - u_{i-1, j}}{h} + O(h) \tag{9.16} \\ &= \frac{u_{i+1, j} - u_{i-1, j}}{2h} + O(h^2) \tag{9.17} \end{aligned}and uxx=h2ui−1,j−2ui,j+ui+1,j+O(h2)(9.18) where ui,j=u(ih,jk)=u(x,y) Similarly, we have the approximations
\begin{aligned} u_y &= \frac{u_{i, j+1} - u_{i, j}}{k} + O(k) \tag{9.19} \\ &= \frac{u_{i, j} - u_{i, j-1}}{k} + O(k) \tag{9.20} \\ &= \frac{u_{i, j+1} - u_{i, j-1}}{2k} + O(k^2) \tag{9.21} \end{aligned}and uyy=k2ui,j−1−2ui,j+ui,j+1+O(k2)(9.22) We can now obtain the finite-difference analogues of partial differential equations by replacing the derivatives in any equation by their corresponding difference approximations given above. Thus, the Laplace equation in two dimensions, namely
uxx+uyy=0 has its finite-difference analogue h21(ui+1,j−2ui,j+ui−1,j)+k21(ui,j+1−2ui,j+ui,j−1)=0.(9.23) If h=k, this gives ui,j=41(ui+1,j+ui−1,j+ui,j+1+ui,j−1),(9.24) which shows that the value of u at any point is the mean of its values at the four neighbouring points. This is called the standard five-point formula [see Fig. 9.2(a)], and is written ui+1,j+ui−1,j+ui,j+1+ui,j−1−4ui,j=0(9.25) By expanding the terms on the right side of Eq. (9.24) by Taylor's series, it can be shown that
ui+1,j+ui−1,j+ui,j+1+ui,j−1−4ui,j=h2(uxx+uyy)−61h4uxxyy+O(h6)=−61h4uxxyy+O(h6)(9.26)Instead of formula given in Eq. (9.24), we may also use the formula ui,j=41(ui−1,j−1+ui+1,j−1+ui+1,j+1+ui−1,j+1)(9.27) which uses the function values at the diagonal points [see Fig. 9.2(b)], and is therefore called the diagonal five-point formula. This is perfectly valid since it is well-known that the Laplace equation remains invariant when the coordinate axes are rotated through 45∘. Expanding the terms on the right side of Eq. (9.27) by Taylor's series, it can be shown that ui−1,j−1+ui+1,j−1+ui+1,j+1+ui−1,j+1−4ui,j=32h4uxxyy+O(h6)(9.28)
Figure 9.2 — Approximations to Laplace's equation.
Neglecting terms of the order h6, it follows from Eqs. (9.26) and (9.28) that the error in the diagonal formula is four times that in the standard formula. Hence, in all computations we should prefer to use the standard five-point formula, whenever possible.
Eliminating the term containing h4 from both Eqs. (9.26) and (9.28), we obtain the nine-point formula
ui−1,j−1+ui+1,j−1+ui+1,j+1+ui−1,j+1+4(ui+1,j+ui−1,j+ui,j+1+ui,j−1)−20ui,j=0(9.29)It is clear that the error in this formula is of order h6. In a similar manner, the finite-difference analogues of Eqs. (9.4) and (9.5) can be obtained.
In this chapter, we consider those partial differential equations which can be replaced by the finite-difference analogues. These analogues, or difference equations, are then used as approximations to the concerned partial differential equations. Our general procedure is, therefore, to replace the partial differential equation by a finite-difference analogue and then obtain the solution at the mesh points. In the next section, we will discuss Laplace's equation which is generally solved by reduction to a system of algebraic equations. In Section 9.4, we will discuss methods for the numerical solution of the parabolic Eq. (9.5). Hyperbolic equations are considered in Section 9.8.