5
Finite Difference Method

5.1 Introduction

Finite difference methods (FDM) are well‐known numerical methods to solve differential equations by approximating the derivatives using different difference schemes [1,2]. The finite difference approximations for derivatives are one of the simplest and oldest methods to solve differential equations [3]. Finite difference techniques in numerical applications began in the early 1950s as represented in Refs. [4,5], and their advancement was accelerated by the emergence of computers that offered a convenient framework for dealing with complex problems of science and technology. Theoretical results have been found during the last five decades related to accuracy, stability, and convergence of the finite difference schemes (FDS) for differential equations. Many science and engineering models involve nonlinear and nonhomogeneous differential equations, and solutions of these equations are sometimes beyond the reach by analytical methods. In such cases, FDM may be found to be practical, particularly for regular domains.

There are various types and ways of FDS [6,7] depending on the type of differential equations, stability, and convergence [8]. However, here only the basic idea of the titled method is discussed.

5.2 Finite Difference Schemes

In this section, the fundamental concept and FDS are addressed. The numerical solutions of differential equations based on finite difference provide us with the values at discrete grid points. Let us consider a domain (Figure 5.1) in the xy‐plane. The spacing of the grid points in the x‐ and y‐directions are assumed to be uniform and given by Δx and Δy. It is not necessary that Δx and Δy be uniform or equal to each other [ 1 , 5 , 8 ] always.

Image described by caption and surrounding text.

Figure 5.1 Discrete grid points.

The grid points in the x‐direction are represented by index i and similarly j in the y‐direction. The concept of FDM is to replace the derivatives involved in the governing differential equations with algebraic difference techniques. This results in a system of algebraic equations which can be solved by any standard analytical/numerical methods for evaluating the dependent variables at the discrete grid points. There are three ways to express derivatives in FDS which are

  1. Forward difference scheme
  2. Backward difference scheme
  3. Central difference scheme.

5.2.1 Finite Difference Schemes for Ordinary Differential Equations

5.2.1.1 Forward Difference Scheme

In this scheme, the rate of change of the function with respect to the variable x is represented between the current value at x = xi and the forward step at xi + 1 = xi + Δxi. Mathematical representation of the derivative of the function y(x) can be presented as

equation

where h is the increment in step size.

The second‐order derivative of the function at x can be derived as

equation

5.2.1.2 Backward Difference Scheme

In this case, we evaluate the rate of change of the function values between the current step at xi and back step at xi − 1 = xi − Δx. Mathematically, we can represent it as

equation

and the second‐order derivative in the form

equation

5.2.1.3 Central Difference Scheme

In the central difference scheme the rate of change of y(x) is considered between the step at xi − Δx and the step ahead of xi, i.e. xi + Δx. Mathematically,

equation

and the second‐order central difference form for the derivative is given by

equation

5.2.2 Finite Difference Schemes for Partial Differential Equations

Similar to the FDS for ODE discussed in Section 5.2.1, FDS for Partial differential equations (PDEs) are given in Table 5.1.

Table 5.1 Finite difference schemes for PDEs.

Derivative approximation of z(x, y)
Scheme Derivative with respect to x Derivative with respect to y
Forward images images
images images
Center images images
images images
Backward images images
images images

To evaluate the derivative term images, let us write the x‐direction as a central difference of y‐derivatives [9], and further we make use of central difference to find out the y‐derivatives. Thus, we obtain

equation

Similarly, other difference schemes may also be written.

5.3 Explicit and Implicit Finite Difference Schemes

Explicit and implicit approaches are used to obtain the numerical approximations to the time‐dependent differential equations, as required for computer simulations [10,11].

5.3.1 Explicit Finite Difference Method

Explicit finite difference scheme evaluates the state of a system at later time by using the known values at current time. Mathematically, the temperature at time t + Δt depends explicitly on the temperature at time t and this scheme is relatively simple and computationally fast.

Let us introduce a parabolic PDE, namely heat equation, to understand the procedure for the explicit finite difference method.

Let us consider a time‐dependent heat equation

(5.1)equation

with respect to initial condition

equation

and boundary conditions

equation

Let the domain from x = 0 to x = L be subdivided into N subparts so that x = 0 corresponds to i = 0 and x = L corresponds to i = N with t = 0 corresponding to j = 0. Then the initial conditions may be represented as

equation

and the boundary conditions

equation

The central difference scheme has been used to represent the term images and a forward difference scheme for the derivative term images. By substituting the differencing schemes of the derivative terms in Eq. (5.1), one may obtain

(5.2)equation
(5.3)equation

where images

Since, we know the values of ui, j, ui + 1, j , and ui − 1, j of Eq. (5.3), one may get the values of ui, j + 1.

5.3.2 Implicit Finite Difference Method

In implicit finite difference scheme the solution of governing differential equation depends on both the current state of the system and later state. So, a general recursive computation is not specified. Implicit schemes are generally solved by using matrix inverse methods for linear problems and iterative methods in nonlinear problems [ 10 , 11 ].

Next, solving procedure has been included for a time‐dependent diffusion equation by using the implicit finite difference method.

Let us consider a time‐dependent equation

(5.4)equation

with the initial conditions

equation

and the boundary conditions

equation

By approximating the derivatives, Eq. (5.4) can be represented as

(5.5)equation
(5.6)equation

where images.

There are different stability conditions for the above two schemes and interested readers may find the details in Refs. [ 1 , 2 , 4 , 6 , 10 , 11 ].

The next section implements numerical example results of the explicit and implicit schemes for heat equation subject to specific initial and boundary conditions.

Surface graph illustrating the solution of heat equation using the explicit scheme.

Figure 5.2 Solution of heat equation using the explicit scheme.

Surface graph illustrating the solution of heat equation using the implicit scheme.

Figure 5.3 Solution of heat equation using the implicit scheme.

A 3 x 3 grid made up of nine equally sized squares, with the center square having 4 solid dots on its vertices labeled T1, T2, T3, and T4. Parameters are indicated alongside the grid.

Figure 5.4 Discretizing the temperature (T) of a square shaped domain.

Exercise

  1. 1 Use FDMs to solve the boundary value problem images with respect to the boundary conditions y(0) = 1 and images.
  2. 2 Solve images with y(1) = 1.0 and y(6) =  − 0.5 using the FDM with 25 subintervals.

References

  1. 1 Hoffman, J.D. and Frankel, S. (2001). Numerical Methods for Engineers and Scientists. New York: CRC Press.
  2. 2 Bhat, R.B. and Chakraverty, S. (2004). Numerical Analysis in Engineering. London: Alpha Science International Ltd.
  3. 3 Euler, L. (2012). Elements of Algebra. New York: Springer Science & Business Media.
  4. 4 Iserles, A. (2009). A First Course in the Numerical Analysis of Differential Equations (No. 44). Cambridge, New York: Cambridge University Press.
  5. 5 Steger, J.L. (1978). Implicit finite‐difference simulation of flow about arbitrary two‐dimensional geometries. AiAA Journal 16 (7): 679–686.
  6. 6 Gel′fond, A.O. (1971). Calculus of Finite Differences. New Delhi: Hindustan Publishing Corporation.
  7. 7 Lele, S.K. (1992). Compact finite difference schemes with spectral‐like resolution. Journal of Computational Physics 103 (1): 16–42.
  8. 8 Smith, G.D. (1985). Numerical Solution of Partial Differential Equations: Finite Difference Methods. Oxford: Oxford University Press.
  9. 9 Grossmann, C., Roos, H.G., and Stynes, M. (2007). Numerical Treatment of Partial Differential Equations, vol. 154. Berlin: Springer.
  10. 10 Ghazizadeh, H.R., Maerefat, M., and Azimi, A. (2010). Explicit and implicit finite difference schemes for fractional Cattaneo equation. Journal of Computational Physics 229 (19): 7042–7057.
  11. 11 Hughes, T.J. and Liu, W.K. (1978). Implicit‐explicit finite elements in transient analysis: stability theory. Journal of Applied Mechanics 45 (2): 371–374.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.173.249