Applied Mathematics
Vol.09 No.11(2018), Article ID:88430,32 pages
10.4236/am.2018.911079

A Computational Study with Finite Difference Methods for Second Order Quasilinear Hyperbolic Partial Differential Equations in Two Independent Variables

Pavlos Stampolidis, Maria Ch. Gousidou-Koutita

Department of Mathematics, Faculty of Sciences, Aristotle University, Thessaloniki, Greece

Copyright © 2018 by authors and Scientific Research Publishing Inc.

This work is licensed under the Creative Commons Attribution International License (CC BY 4.0).

http://creativecommons.org/licenses/by/4.0/

Received: October 8, 2018; Accepted: November 10, 2018; Published: November 13, 2018

ABSTRACT

In this paper we consider the numerical method of characteristics for the numerical solution of initial value problems (IVPs) for quasilinear hyperbolic Partial Differential Equations, as well as the difference scheme Central Time Central Space (CTCS), Crank-Nicolson scheme, ω scheme and the method of characteristics for the numerical solution of initial and boundary value problems for the one-dimension homogeneous wave equation. The initial derivative condition is approximated by different second order difference quotients in order to examine which gives more accurate numerical results. The local truncation error, consistency and stability of the difference schemes CTCS, Crank-Nicolson and ω are also considered.

Keywords:

Finite Difference Method, CTCS Method, Crank-Nicolson Method, ω-Method, Numerical Method of Characteristics, Wave Equation

1. Introduction

A second order quasilinear PDE in two independent variables x, y is an equation of the form

A 2 U ( x , y ) x 2 + B 2 U ( x , y ) x y + C 2 U ( x , y ) y 2 + D = 0 , (1)

where A, B, C, D may be functions of x, y, U ( x , y ) , U ( x , y ) x and U ( x , y ) y .

We assume that the PDE (1) is of hyperbolic type, which means that we are restricted to a region of the xy-plane where B 2 4 A C > 0 .

The second order quasilinear hyperbolic Partial Differential Equations (PDEs) with appropriate initial and boundary conditions serve as models in many branches of physics, engineering, biology, etc. Thus, the numerical solution of such PDEs plays an important rule in the current research. During the last decades, a variety of numerical methods have been developed to solve these PDEs some of which can be found in [1] - [7] . Among those methods the classic characteristic method and its variations are used in a wide range of hyperbolic problems (see [5] [8] - [18] ).

In this paper, a modification of the numerical method of characteristics is proposed to solve special cases of initial and boundary value problems (IBVPs) for second order hyperbolic PDEs. To test the method it is applied for the numerical solution of IBVPs for the one-dimension homogeneous wave equation and it is compared with the following well-known finite difference methods: Central Time Central Space (CTCS), Crank-Nicolson and ω scheme.

The CTCS method is the classic explicit scheme to approach the wave equation which can be very accurate under certain restriction. The ω-method is an implicit scheme first introduced by von Neumann [17] . We use the term ω-method following Zauderer [18] . Crank-Nicolson method [19] is usually used in parabolic equations and is not recommended for second order hyperbolic PDEs. However, we prove the consistency and von Neumann stability for this method and compare it with the other methods.

The common thing among the schemes CTCS, Crank-Nicolson and ω is that it is required to compute the solution on the first time step before they can be employed [20] . In the literature, this is usually done by approximating the initial derivative condition by centered or forward second order divided difference without any specific preference [20] - [27] . This is justified by the fact that the initialization method has no effect on the stability of the overall method [26] . Nevertheless, from numerical point of view, the initialization method affects the accuracy of the methods as we will see.

The manuscript is organized as follows. In Section 2 we describe briefly the numerical method of characteristics and we apply it into two specific quasilinear hyperbolic PDEs, in order to examine the accuracy of the method. In Section 3 we consider the one-dimensional homogeneous wave equation

c 2 2 U ( x , t ) x 2 2 U ( x , t ) t 2 = 0 , 0 < x < L , t > 0 , c , L + , (2)

which is a special case of (1). We consider that (2) satisfies the following boundary (BCs) and initial conditions (ICs)

BCs ( U ( 0 , t ) = 0 U ( L , t ) = 0 , t > 0 (3)

ICs ( U ( x , 0 ) = f ( x ) U ( x , 0 ) t = g ( x ) , 0 x L . (4)

and we give the numerical schemes for the methods CTCS, Crank-Nicolson, ω and characteristics. For each of the methods CTCS, Crank-Nicolson and ω we use second order forward, centered and backward differences to approximate the initial derivative condition. In Section 4 we use the methods mentioned in Section 3 to solve an IBVP for (2) for different values of c ( c = 0.2 , 1 , 2 ). Firstly, we investigate which of the forward, centered and backward differences give better results from numerical aspect. Secondly, we compare the methods mentioned previously taking into consideration the accuracy of the numerical results and the machine time needed for the calculations. In Section 5 we summarize the results of the present work.

Finally, we note that the algorithms of the numerical methods presented in the current paper were written in Fortran 95 and were tested on a 32-bit processor Intel Celeron E1200, 1.60 GHz with 3 GB RAM. A “slow” processor was chosen intentionally to distinguish time consuming methods.

2. Numerical Method of Characteristics

Consider the hyperbolic PDE (1). It is well-known [16] [18] that in this case there are exactly two characteristics curves, say y = y ( x ) , through every point ( x , y ) of the solution domain which satisfy the equation

A ( d y d x ) 2 B ( d y d x ) + C = 0. (5)

Let us denote by ξ = d y d x the slope at every point of the first characteristic curve through a point P ( x , y ) of the solution domain (which is said to be a ξ-characteristic) and by η = d y d x the slope at every point of the other characteristic through the point P (η-characteristic).We also assume that along an initial curve, say φ, (non characteristic) U, p = U x and q = U y are known.

Let Q ( x Q , y Q ) , R ( x R , y R ) be points on φ and let us denote by P ( x P , y P ) the intersection point of the ξ-characteristic through Q and the η-characteristic through R (see Figure 1, left). Then we can calculate approximation values for U, p and q at the point P by the following algorithm. Firstly, we compute approximation values for the coordinates ( x P , y P ) by the equations

( y P y Q = ξ Q ( x P x Q ) , y P y R = η R ( x P x R ) . (6)

Then, we calculate approximation values for p and q at P by the equations

( A Q ξ Q ( p P p Q ) + C Q ( q P q Q ) + D Q ( y P y Q ) = 0, A R η R ( p P p R ) + C R ( q P q R ) + D R ( y P y R ) = 0. (7)

Finally, to obtain an approximation value for U at P we can use the following approximation

U P = U Q + p Q ( x P x Q ) + q Q ( y P y Q ) . (8)

An improved approximation to U P is obtained by averaging the values of p and q at the points P, Q and P, R respectively and is given by the equation

U P = U Q + 1 2 ( p Q + p P ) ( x P x Q ) + 1 2 ( q Q + q P ) ( y P y Q ) . (9)

A similar averaging approach can be used to improve the accuracy of the approximation values of x P , y P , p P and q P computed by the equations (6), (7). Then we can calculate an improved approximation value of U P by the Equation (9). With this way an iteration scheme is developed. The iterations are terminated when the errors from one step to the next are less than a prespecified error tolerance or an upper limit is placed on the number of iterations. Suppose three points are given on the initial curve φ, say Q, R, S, instead of two (see Figure 1, right). Then we can compute approximation values for U at a grid of three points in the xy-plane. By the previous algorithm we can calculate solution values at the grid points P and T and then proceed to the grid point V. In general, given n 2 points on φ then solution values can be computed at a grid of

n ( n 1 ) 2 points.

Example 2.1. Consider the PDE

2 U x 2 + ( 1 2 U x ) 2 U x y + ( ( U x ) 2 U x ) 2 U y 2 + 1 4 x 3 = 0. (10)

This has the general form of the PDE (1) with A = 1 , B = 1 2 U x , C = ( U x ) 2 U x and D = 1 4 x 3 . The PDE (10) is hyperbolic since B 2 4 A C = 1 > 0 . We consider the initial curve as φ = { ( x , y ) | x + , y = 0 }

Figure 1. A grid is defined by the number of points on initial curve.

with U = x 1 , p = 1 2 x and q = 1 on φ. In view of (5), the slope of the characteristics is given by

d y d x = 1 U x = ξ and d y d x = U x = η . (11)

At first we start with n = 10 points Q i , 1 i 10 , on φ with Q 1 ( 0.5,0 ) and a step size of h = 0.1 . Hence a grid of 45 points is created. The calculation of the approximation value for U at a grid point is terminated when

| U ( r ) U ( r 1 ) U ( r ) | 100 1 2 10 3 (where U ( r ) is the approximation value for U at the point after r iterations) or when the number of iterations exceeds 100. The machine time needed for the calculation of x, y, U, p and q at 45 grid points is less than 0.01s. The actual solution of (10) with the given initial conditions is U ( x , y ) = x + y 1 . Hence in view of (11) we see that the characteristics are given as y ( x ) = x x + c 1 and y ( x ) = x + c 2 , c 1 , c 2 and the grid that they form is shown in Figure 2, left. We can also see the solution U along ξ, η-characteristics and the approximation values for U at the grid points in Figure 2, right. Table 1 gives selected values of x, y, U, p and q. The arrangement in the table has the two points on φ (from which the characteristics pass through and intersect at a specific grid point) in each line followed by the approximation values of x, y, U, p, and q, the number r of iterations and the absolute percent relative error e for U given by e = | t a t | 100 % , where t, a are the true and approximation values, respectively. If | t | 10 8 then e is replaced by the absolute percent error | t a | 100 % . Example 2.1 was also run using n = 46 , Q 1 ( 0.5,0 ) and h = 0.02 . The grid consists of 1035 points and the machine time needed for the calculation at those points is 0.016 s. Selected values are given in

Figure 2. n = 10, h = 0.1, 45 Grid Points.

Table 1. n = 10, h = 0.1, Number of grid points = 45, Machine time < 0.01 s.

Table 2 and approximate and exact solutions are illustrated in Figure 3, Figure 4.

As we can see for smaller step size the number of iterations as well as the error e at same grid points are decreased.

Example 2.2. Consider the PDE

2 U x 2 U 2 2 U y 2 = 0.

The above PDE is quasilinear and is hyperbolic away from U = 0 . We consider the initial curve as φ = { ( x , y ) | 0 x 1 , y = 0 } with U = 0.2 + 5 x 2 , p = 10 x and q = 3 x along φ. The slope of the characteristics is given by d y d x = U = ξ and d y d x = U = η . As in the previous example, we use two different step sizes of h = 0.1 and h = 0.01 with starting point Q 1 ( 0.1,0 ) and the same stopping criteria. The number of initial points taken on φ is n = 10 and n = 91 , respectively. In the first case the grid consists of 45 points and in the second of 4095 points. Figure 5 provides a visual representation for the second case and a selection of computed values of x, y, U, p and q is given in Table 3, Table 4 for h = 0.1 and h = 0.01 , respectively. In these Tables the absolute percent relative error e for U is given by e = | U ( r ) U ( r 1 ) U ( r ) | 100 % , if | U ( r ) | > 10 8 and the absolute percent error by e = | U ( r ) U ( r 1 ) | 100 % if | U ( r ) | 10 8 .

Even though the number of iterations is smaller by decreasing the step size, there is no significant difference between the errors, approximately 1/10 of the corresponding error of the first case.

Table 2. n = 46, h = 0.02, Number of grid points = 1035, Machine time = 0.016 s.

Figure 3. Approximated and exact solutions (h = 0.02).

Figure 4. Approximated and exact solutions (h = 0.02).

Figure 5. Approximated solutions (h = 0.01).

Table 3. n = 10, h = 0.1, Number of grid points = 45, Machine time < 0.01 s.

Table 4. n = 91, h = 0.01, Number of grid points = 4095, Machine time = 0.078 s.

3. Finite Difference Methods for the Wave Equation

Consider the IBVP (2)-(4). Approximating 2 U x 2 and 2 U t 2 by various divided differences formulae, a number of difference schemes is created and some of them are presented below. Before doing that, we need to discretize the space of solutions. Let h > 0 be an increment in x and k > 0 be an increment in t. The grid in xt-plane on which a numerical solution is to be computed is given as ( x i , t j ) = ( i h , j k ) , with i = 0 , 1 , , n , j = 0 , 1 , , m . The x step size is h = L n and the time step is k. We denote by U i , j the value of U at the grid point ( i h , j k ) and by u i , j the approximation value for U i , j . We also denote by f i and g i the values of f ( x i ) = f ( i h ) and g ( i h ) , respectively.

3.1. The CTCS Explicit Difference Scheme

We approximate 2 U x 2 and 2 U t 2 by centered second order divided differences in x and t, respectively. This yields

c 2 u i + 1 , j 2 u i , j + u i 1 , j h 2 = u i , j + 1 2 u i , j + u i , j 1 k 2 . (12)

We put r = ( c k h ) 2 and express (12) as

u i , j + 1 = r u i 1 , j + ( 2 2 r ) u i , j + r u i + 1 , j u i , j 1 . (13)

Putting j = 0 in (13) yields

u i , 1 = r u i 1 , 0 + ( 2 2 r ) u i , 0 + r u i + 1 , 0 u i , 1 (14)

and approximating the initial derivative condition by a centered second order divided difference in t gives

g i = u i , 1 u i , 1 2 k . (15)

Eliminating u i , 1 between (14), (15), the values u i ,1 can be computed from the equation

u i , 1 = 1 2 ( r u i 1 , 0 + ( 2 2 r ) u i , 0 + r u i + 1 , 0 + 2 k g i ) . (16)

In view of (14), Equation (16) is expressed as

u i , 1 = 1 2 ( r f i 1 + ( 2 2 r ) f i + r f i + 1 + 2 k g i ) . (17)

After calculating the values u i ,1 from (17), we continue with the scheme (13) for j 1 . We consider also two alternative ways of calculating the values u i ,1 . We do this by approximating the initial derivative condition by a backward and forward second order divided differences in t. By Taylor’s expansion of U with respect to t about the point ( i h , k ) and solving for ( U t ) i ,0 the result

( U t ) i ,0 = U i ,0 U i , 1 k + 1 2 k ( 2 U t 2 ) i ,0 + O (k2)

is obtained, which in view of (2) and (4) becomes (provided f is smooth enough)

( U t ) i ,0 = U i ,0 U i , 1 k + 1 2 k c 2 f i + O ( k 2 ) .

So, the initial derivative condition can be approximated by a backward second order divided difference formula

g i = u i ,0 u i , 1 k + 1 2 k c 2 f i . (18)

Eliminating u i , 1 between (14), (18) and considering (4) gives

u i , 1 = r f i 1 + ( 1 2 r ) f i + r f i + 1 + k g i 1 2 k 2 c 2 f i .

Similarly, expanding U about the point ( i h , k ) in a Taylor series with respect to t, the initial derivative condition can be approximated by a forward second order divided difference formula

g i = u i , 1 u i , 0 k 1 2 k c 2 f i .

Solving for u i ,1 and considering (4) we get

u i , 1 = f i + k g i + 1 2 k 2 c 2 f i .

To summarise, the CTCS numerical scheme can be given as

Expanding (13) by Taylor’s theorem about the point ( i h , j k ) , j 1 , and considering (2), the truncation error T i , j is found to be

T i , j = 1 12 c 2 h 2 ( 1 r ) ( 4 U x 4 ) i , j + 2 6 ! c 2 h 4 ( 1 r 2 ) ( 6 U x 6 ) i , j + O ( h 6 + k 6 ) (23)

We notice that for r = 1 the truncation error vanishes completely. As h , k 0 (with r constant), T i , j 0 , so the difference scheme (13) is consistent with the wave Equation (2). The CTCS method is also stable for r 1 , [22] hence by Laxs equivalence theorem [21] it is also convergent for r 1 .

3.2. The Crank-Nicolson Implicit Difference Scheme

The Crank-Nicolson scheme is obtained by approximating 2 U t 2 by a centered second order divided difference in t and 2 U x 2 by the mean of centered second order divided difference in x evaluated at the jth and (j + 1)th time levels. The difference scheme is given as

u i , j + 1 2 u i , j + u i , j 1 k 2 = 1 2 c 2 ( u i + 1 , j + 1 2 u i , j + 1 + u i 1 , j + 1 h 2 + u i + 1 , j 2 u i , j + u i 1 , j h 2 ) (24)

As with the CTCS method, the Crank-Nicolson can be written as

The truncation error at the point ( i h , j k ) , j 1 is defined by

T i , j = c 2 2 ( U i + 1 , j + 1 2 U i , j + 1 + U i 1 , j + 1 h 2 + U i + 1 , j 2 U i , j + U i 1 , j h 2 ) U i , j + 1 2 U i , j + U i , j 1 k 2 (29)

Expansion of the terms U i + 1, j + 1 , U i 1, j + 1 about the point ( i h , ( j + 1 ) k ) and the terms U i + 1, j , U i 1, j , U i , j + 1 , U i , j 1 about the point ( i h , j k ) by Taylors series and substitution into (29) leads to

T i , j = c 2 ν = 1 3 h 2 ( ν 1 ) ( 2 ν ) ! ( 2 ν U x 2 ν ) i , j + 1 + c 2 ν = 1 3 h 2 ( ν 1 ) ( 2 ν ) ! ( 2 ν U x 2 ν ) i , j ν = 1 3 2 k 2 ( ν 1 ) ( 2 ν ) ! ( 2 ν U t 2 ν ) i , j + O ( h 6 + k 6 )

Expansion of the terms ( 2 ν U x 2 ν ) i , j + 1 , for ν = 1 , 2 , 3 , about the point ( i h , j k ) and substitution into the expression for T i , j then gives

T i , j = c 2 2 ν = 0 4 k ν ν ! ν t ν ( 2 U x 2 ) i , j + c 2 h 2 24 ν = 0 4 k ν ν ! ν t ν ( 4 U x 4 ) i , j + c 2 h 4 6 ! ν = 0 4 k ν ν ! ν t ν ( 6 U x 6 ) i , j + c 2 ν = 1 3 h 2 ( ν 1 ) ( 2 ν ) ! ( 2 ν U x 2 ν ) i , j ν = 1 3 2 k 2 ( ν 1 ) ( 2 ν ) ! ( 2 ν U t 2 ν ) i , j + O ( k 5 + h 2 k 5 + h 4 k 5 + h 6 )

Finally, taking into consideration (2), T i , j can be written as

T i , j = 1 12 c 2 h 2 ( 1 + 2 r ) ( 4 U x 4 ) i , j + 1 2 k ( 3 U t 3 ) i , j + O ( h 3 + k 3 + h 2 k + h 4 k ) . (30)

As h , k 0 (with r constant), T i , j 0 , so the scheme (24) is consistent with the wave equation (2). To determine the von Neumann stability condition for the scheme, we insert u i , j = ξ i e i β j h ( ξ , i = 1 , β 0 ) into (24) and after some simplification we obtain the quadratic equation A ξ 2 + ( A 3 ) ξ + 1 = 0 , where A = 2 r s i n 2 ( β h / 2 ) + 1 1 , r = ( c k / h ) 2 . Hence, the values of ξ are ξ 1 , 2 = ( A + 3 ± ( A 1 ) ( A 9 ) ) / 2 A . If A 9 , then r s i n 2 ( β h / 2 ) 4 which gives no useful result for r. When A < 9 , i.e., r sin 2 ( β h / 2 ) < 4 , which is true for r < 4 , the two roots are complex conjugates and the squared modulus of ξ 1,2 satisfy | ξ 1,2 | 2 1 / A 1 . Thus a necessary condition for von Neumann stability is r < 4 .

3.3. The ω Implicit Difference Scheme

The ω scheme is obtained by approximating 2 U t 2 by a centered second order divided difference in t and 2 U x 2 by a weighted average of centered divided difference in x evaluated at the (j − 1)th, jth and (j + 1)th time levels, with the nonnegative weights ω, 1 2 ω , and ω ( 0 ω 1 2 ), respectively. The ω scheme is given as

u i , j + 1 2 u i , j + u i , j 1 k 2 = c 2 [ ω u i + 1 , j 1 2 u i , j 1 + u i 1 , j 1 h 2 + ( 1 2 ω ) u i + 1 , j 2 u i , j + u i 1 , j h 2 + ω u i + 1 , j + 1 2 u i , j + 1 + u i 1 , j + 1 h 2 ] (31)

We note that for ω = 0 the ω scheme coincide with the CTCS scheme. Similarly, the ω scheme can be written as

The truncation error at the point ( i h , j k ) , j 1 is given by

T i , j = 1 12 c 2 h 2 ( 1 r + 12 ω r ) ( 4 U x 4 ) i , j + 2 6 ! c 2 h 4 ( 1 r 2 + 30 ω ( r 2 + r ) ) ( 6 U x 6 ) i , j + O ( k 5 + h 6 + h 2 k 4 ) (36)

As h , k 0 (with r constant), the truncation error tends to zero, so the scheme (24) is consistent with the wave Equation (2). If 0 ω < 1 4 the scheme is von Neumann stable for r 1 1 4 ω . For 1 4 ω 1 2 the scheme is unconditionally von Neumann stable.

3.4. The Numerical Method of Characteristics

Equation (2) has the form of the PDE (1) and is hyperbolic. The initial curve is φ = { ( x , t ) | 0 x L , t = 0 } with U = f , p = f (provided f is smooth enough) and q = U t = g on φ. In view of (5), the slope of the characteristics is given by

d t d x = 1 c = ξ and d t d x = 1 c = η .

and therefore the characteristics are

t ( x ) = 1 c x + c 1 and t ( x ) = 1 c x + c 2 , c 1 , c 2 . (37)

Let P ( x P , t P ) be a point in the xt-plane. Then the ξ,η-characteristics through P are given by

t ( x ) = 1 c ( x x P ) + t P and t ( x ) = 1 c ( x x P ) + t P , (38)

respectively. Hence, the grid of points is always inside the triangle defined by the lines t = 0 , t ( x ) = 1 c x and t ( x ) = 1 c ( x L ) no matter how many initial points are considered along φ. However, we will see in the next section that approximation values for U can be calculated at any point P ( x P , t P ) , 0 x P L , t 0 . We also notice that we can have only one iteration of the scheme due to the fact that the coefficients of (2) and the slope of characteristics are constants. Therefore, in view of (6), (7), and (9), the scheme takes the form

( t P t Q = 1 c ( x P x Q ) ( 39 ) t P t R = 1 c ( x P x R ) (40)

( c ( p P p Q ) ( q P q Q ) = 0 ( 41 ) c ( p P p R ) + ( q P q R ) = 0 (42)

U P = U Q + 1 2 ( p Q + p P ) ( x P x Q ) + 1 2 ( q Q + q P ) ( t P t Q ) (43)

Finally, it is easy to verify that the solutions of (39)-(42) give also the true values of x P , t P and p P , q P , respectively.

4. Numerical Study of the Wave Equation

Consider the wave Equation (2) with L = 1 , f ( x ) = sin ( π x ) and g ( x ) = 0 . The analytical solution of (2) satisfying these conditions is

U ( x , t ) = s i n ( π x ) c o s ( c π t ) . (44)

In the following, we apply the methods discussed in the previous section for c = 2 , 1 , 0.2 . We also mention that the implicit schemes Crank-Nicolson and ω lead to tridiagonal systems of equations, which we solve by the method of Gauss-Seidel [28] [29] .

4.1. The CTCS, Crank-Nicolson and ω Schemes

We apply these schemes for different x-step sizes and time steps. For each step size and time step we run the schemes three times considering the center, backward and forward approximation for the 1st time level in order to examine which one produce better results. In the following Tables by Error we mean the absolute percent relative error for U (or the absolute percent error if | U | 10 7 ).

Studying Table 5 one would expect that the errors would be vanished for r = 1 as was mentioned in section 3.1. However, the errors are vanished only if we initiate the scheme with the centered difference approximation. To analyze this behavior more closely we need to examine the truncation errors for the ICs (19)-(21). The truncation error at the point ( i h ,0 ) for (19 ) is defined by

T i , 0 c d = r ( U i 1 , 0 + U i + 1 , 0 ) + ( 2 2 r ) U i , 0 + 2 k ( U t ) i , 0 2 U i , 1 . (45)

Expansion of the terms U i 1,0 , U i + 1,0 , U i ,1 about the point ( i h ,0 ) by Taylors series and substitution into (45) gives

T i , 0 c d = r [ ν = 0 3 2 h 2 ν ( 2 ν ) ! ( 2 ν U x 2 ν ) i , 0 ] + ( 2 2 r ) U i , 0 + 2 k ( U t ) i , 0 2 [ ν = 0 6 k ν ν ! ( ν U t ν ) i , 0 ] + O ( h 8 + k 7 ) .

In view of (2), and few algebraic steps lead to an expression for T i ,0 c d

Table 5. CTCS scheme ( c = 2 , 1 , 0.2 ).

T i , 0 c d = 1 12 h 4 r ( 1 r ) ( 4 U x 4 ) i , 0 + 2 6 ! h 6 r ( 1 r 2 ) ( 6 U x 6 ) i , 0 1 3 k 3 ( 3 U t 3 ) i , 0 + O ( h 8 + k 5 ) . (46)

Similarly, the truncation errors at the point ( i h ,0 ) for (20) and (21) are found to be

T i , 0 f d = 1 3 k 3 ( 3 U t 3 ) i , 0 + O ( k 4 ) , (47)

T i , 0 b d = 1 4 ! h 4 r ( 2 r ) ( 4 U x 4 ) i , 0 + 1 6 ! h 6 r ( 2 r 2 ) ( 6 U x 6 ) i , 0 1 6 k 3 ( 3 U t 3 ) i , 0 + O ( h 8 + k 5 ) , (48)

respectively. We also notice that, according to (44), k U ( x , 0 ) t k = 0 , for k = 2 n + 1 ,

n . This yields, T i , 0 c d = 0 , T i , 0 f d = O ( k 4 ) and T i , 0 b d = O ( h 4 ) for r = 1 . Thus, in view of (23), T i , j = 0 , for j 0 , r = 1 and using the centered difference approach. Hence the errors vanish completely. We assume that, initiating the scheme with (20) or (21) introduces an error of order h4 and k4, respectively at the 1st time level which affect the rest calculations for j 1 . To confirm the latter assertion we run the scheme computing the values u i ,1 from (44) and then proceed with (13) for j 1 . As we can see in Table 6, the errors vanish.

For r < 1 , the forward difference approach gives more accurate results. This is possibly due to the fact that T i ,0 c d and T i ,0 b d are of order h4 and T i ,0 f d is of order k4 with k < h , usually. We also notice that when U ( i h , j k ) = 0 the error increases considerably at points near to ( i h , j k ) . From (44) we have that for c = 2 , U ( x , 0.25 ) = 0 = U ( x , 0.75 ) and U ( x , 0.5 ) = 0 for c = 1 . The results in Table 5 show that errors are increased significantly at t = 0.2 , 0.3 , 0.7 , 0.8 for c = 2 and at t = 0.4 , 0.6 for c = 1 . This is not the case for c = 0.2 and as we can see U ( x , t ) 0 for
x , t ( 0,1 ] . The methods Crank-Nicolson and ω also follow this behavior as it is illustrated in Figures 6-8. These Figures provide also a visual representation of which of the FD, BD and CD is more accurate. This was done by assigning the red, blue and black color for the FD, CD, BD errors, respectively and selecting the smallest error among them for each time step. In the next tables numerical results are presented only for the first two and the last time steps.

The Crank-Nicolson scheme is not quite as good as the CTCS scheme. Small values of h and k were employed in order to provide adequate numerical

Table 6. Initiating the scheme using analytical solution.

Table 7. Crank-Nicolson scheme ( c = 2 , 1 , 0.2 ).

Table 8. ω scheme, ω = 0.25 , ( c = 2 , 1 , 0.2 ).

Table 9. ω scheme, ω = 0.5 , ( c = 2 , 1 , 0.2 ).

solutions. However, this is not true for c = 0.2 . Bigger value of h still provides satisfactory results.

As we can see the ω implicit scheme is more accurate than the Crank-Nicolson implicit scheme. A visual inspection of the Figures 6-8 indicates that initiating with CD is preffered only when using the ω-method, ω = 0.5 , for c = 2 , 1 and the method Crank-Nicolson for c = 2 . For the other cases FD give the smallest error.

4.2. The Numerical Method of Characteristics

As was mentioned in section 3.4, the grid of points will always be inside a triangle. A special case which computes approximation values at a specific point outside the triangle is presented by Smith [16] . We extend the idea and compute approximation values for U at any point P ( x P , t P ) , 0 x P L , t 0 , L > 0 , c > 0 and then adjust the method to improve accuracy. For convenience of calculation, we will demonstrate it in the following example. Let c = 2 and P ( 0.3,1 ) a point in the xt-plane (Figure 9, left). Then, by (43), for Q = D 1 , we get

U P = 1 2 ( p D 1 + p P ) 0.3 , (49)

where p D 1 , p P can be calculated (as we will see). Obviously, in x P closer to 0.5, the bigger magnitude of the error is observed. In order to improve the level of accuracy we modify the previous method. We start by forming a sequence of points P 1 , P 2 , , P ν = P on the segment D 1 P at which we compute approximation values for U. Therefore, a step size of l = 0.1 is employed to approach the point P (decreasing l improves the accuracy). Thus, the sequence P 1 ( 0.1,1 ) , P 2 ( 0.2,1 ) , P 3 ( 0.3 , 1 ) = P is defined. By (43) we get

Figure 6. Percent relative errors at x = 0.2 , 0 t 1 , with c = 2 , h = 0.01 , k = 0.001 .

Figure 7. Percent relative errors at x = 0.3 , 0 t 1 , with c = 1 , h = 0.01 , k = 0.001 .

Figure 8. Percent relative errors at x = 0.4 , 0 t 1 , with c = 0.2 , h = 0.01 , k = 0.001 . ( Forward Differences (FD) with red color, Central Differences (CD) with blue color, Backward Differences (BD) with black color).

U P 1 = 1 2 0.1 ( p D 1 + p P 1 ) , (50)

where p D 1 and p P 1 are computed as follows (Figure 9, right): Consider the η-characteristic through P 1 (Equation (38)) which intersects the line x = 1 at the point A 1 ( 1,0.55 ) . Then, along this characteristic, Equation (42) implies

2 p P 1 + q P 1 = 2 p A 1 + q A 1 . (51)

The ξ-characteristic through A 1 (Equation (38)) intersects the line x = 0 at A 2 ( 0,0.05 ) and Equation (41) implies

2 p A 1 = 2 p A 2 q A 2 + q A 1 . (52)

The η-characteristic through A 2 intersects the x axis at A 3 ( 0.1,0 ) and by (42) we get

2 p A 2 = 2 p A 3 + q A 3 q A 2 . (53)

In view of (52) and (53), Equation (51) is given by

2 p P 1 + q P 1 = 2 p A 3 + q A 3 2 q A 2 + 2 q A 1 ,

which, according to the ICs and BCs, can be written as

2 p P 1 + q P 1 = 2 f ( 0.1 ) . (54)

Similarly, initiating with ξ-characteristic through P 1 , we get the sequence B 1 ( 0,0.95 ) , B 2 ( 1,0.45 ) , B 3 ( 0.1,0 ) and by Equations (41), (42) the result

2 p P 1 q P 1 = 2 f ( 0.1 ) , (55)

is obtained. Hence, approximation values for p and q at P 1 are determined by solving (54), (55). This way p D 1 can also be estimated. Then we proceed with the next point P 2 . Equation (43) yields U P 2 = U P 1 + 1 2 0.1 ( p P 1 + p P 2 ) , where p P 2 is evaluated in a similar way. Finally, this procedure calculates U P 3 . A comparison between the usual method (UM) (Equation (49)) and the modified method (MM) is provided in Table 10 by giving the absolute percent relative errors.

The advantage of using the modified method is evident. If the point P ( x P , t P ) lies on the segment D 2 P (i.e., 0.5 < x P 1 ), we form the sequence of points P 1 , P 2 , , P ν on the segment D 2 P in order to reduce the computational effort. This procedure was programmed and used to compute approximation values for U on an orthogonal grid. We also note that in case the point P lies inside the triangle, then U P is calculated by the Equations (39)-(43) because they produce more accurate results. Numerical results are presented in Table 11 where by error we mean absolute percent relative error for U (or the absolute percent error if | U | 10 7 ).

4.3. Comparison of the Methods

Among the methods discussed in section 4, the most accurate results are obtained

Table 10. A comparison between the usual and the modified method of characteristics.

Table 11. Numerical method of characteristics.

Figure 9. Characteristics.

with the CTCS method for r = 1 and by approximating the initial derivative condition with centered differences. For r < 1 , the forward difference approximation is preffered with the exception that centered differences are used for the methods ω, ω = 0.5 ( c = 1 , 2 ) and Crank-Nicolson ( c = 2 ). In order to compare the methods, numerical results from Table 5, Tables 7-9, Table 11 are summarized in Table 12 where we give the absolute percent relative errors for U (or the absolute percent errors if | U | 10 7 ). Each method was initiated by the forward difference approximation except for the ones mentioned above. Machine time needed for the calculations is also considered. It should be mentioned that this time includes the computations at all grid points within the rectangle 0 x , t 1 which are formed by the given step size h and time step k.

Inspection of Table 12 leads us to the following conclusions:

・ The ω method for ω = 0.5 gives the most accurate solutions in most of the cases.

・ The method of characteristics is the second best in precision. However, taking into consideration the machine time, the (modified) method of the

Table 12. r < 1, Comparison of the methods with respect to percent relative errors.

characteristics is considerably faster with slightly bigger errors.

・ The third best choice seems to be the ω scheme for ω = 0.25 , with the exception of the case where c = 2 . In this case the CTCS scheme is more accurate.

・ Even though there is no significant difference in the errors between the methods CTCS and ω, ω = 0.25 , for the specific problems, the difference in machine time is considerable, and as follows it will increase for more complicated problems with more large number of grid points.

・ Finally, the method of Crank-Nicolson is the least accurate for hyperbolic problems.

5. Conclusions

In the present work, finite difference methods were considered for the numerical solution of PDEs. Firstly, the method of characteristics was employed to solve IVPs for second order genuine quasilinear hyperbolic PDEs. The method was applied into two specific examples and provided adequate numerical results which were improved by decreasing the step sizes.

Secondly, the methods of CTCS, Crank-Nicolson, ω and characteristics were analyzed to solve numerically the homogeneous wave Equation (2) satisfying (3) and (4). These methods were applied for specific values of c,L and given functions f,g. Three different approaches were employed to approximate the initial derivative condition. The numerical results that were obtained indicated that the most accurate method is the CTCS scheme for r = 1 and employing the centered difference approach. This conclusion was confirmed after a theoretical investigation. It is easily verified that this is also the case for arbitrary function f and g being the zero function. For r < 1 , the methods seem to be more accurate if they initiate with the forward difference approximation with the exception of the methods Crank-Nicolson and ω, ω = 0.5 , for c = 2 and c = 1 , 2 , respectively, where the centered difference approach is more accurate. In this case ( r < 1 ) the ω scheme for ω = 0.5 is the most accurate with the (modified) method of characteristics being the second best but much faster. We also observe that for r < 10 2 the errors increase, probably due to the large number of grid points and the great number of computations, which increase the round-off errors.

Finally, for further research, other values of ω can be tested. In addition, forward third or higher order differences can be used to approximate the initial derivative condition. Moreover, we can test the above in problems of 2D, 3D and more complicated problems.

Acknowledgements

The authors would like to thank the reviewers for their helpful suggestions for revising this paper. Research of Pavlos Stampolidis has been financially supported by General Secretariat for Research and Technology (GSRT) and the Hellenic Foundation for Research and Innovation (HFRI). This support is greatly appreciated.

Fund

Research of Pavlos Stampolidis has been financially supported by General Secretariat for Research and Technology (GSRT) and the Hellenic Foundation for Research and Innovation (HFRI).

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

Cite this paper

Stampolidis, P. and Gousidou-Koutita, M.C. (2018) A Computational Study with Finite Difference Methods for Second Order Quasilinear Hyperbolic Partial Differential Equations in Two Independent Variables. Applied Mathematics, 9, 1193-1224. https://doi.org/10.4236/am.2018.911079

References

  1. 1. Mohanty, R.K., Arora, U. and Jain, M.K. (2001) Linear Stability Analysis and Fourth-Order Approximations at First Time Level for the Two Space Dimensional Mildly Quasilinear Hyperbolic Equations. Numerical Methods for Partial Differential Equations, 17, 607-618. https://doi.org/10.1002/num.1029

  2. 2. Kumar, V., Jiwari, R. and Gupta, R.K. (2013) Numerical Simulation of Two Dimensional Quasilinear Hyperbolic Equations by Polynomial Differential Quadrature Method. Engineering Computations, 30, 892-909. https://doi.org/10.1108/EC-02-2012-0030

  3. 3. Mohanty, R.K., Jain, M.K. and Singh, S. (2013) A New Three-Level Implicit Cubic Spline Method for the Solution of 1D Quasilinear Hyperbolic Equations. Computational Mathematics and Modeling, 24, 452-470. https://doi.org/10.1007/s10598-013-9190-1

  4. 4. Mohanty, R. K. and Kumar, R. (2014) A New Fast Algorithm Based on Half-Step Discretization for One Space Dimensional Quasilinear Hyperbolic Equations. Applied Mathematics and Computation, 244, 624-641. https://doi.org/10.1016/j.amc.2014.07.020

  5. 5. Simpson, D.L. (1967) A Numerical Method of Characteristics for Solving Hyperbolic Partial Differential Equations. Retrospective Theses and Dissertations, 3430. https://lib.dr.iastate.edu/cgi/viewcontent.cgi?referer=https://www.google.ae/&httpsredir=1&article=4429&context=rtd

  6. 6. Kartsiotis, G. (2013) Numerical Methods of solution of Partial Differential Equations Finite Element Method-Applications in MATLAB. Master’s Thesis, Aristotle University, Thessaloniki.

  7. 7. Papanikos, G. and Gousidou-Koutita, M. (2015) A Computational Study with Finite Element Method and Finite Difference Method for 2D Elliptic Partial Differential Equations. Applied Mathematics, 6, 2104-2124. https://doi.org/10.4236/am.2015.612185

  8. 8. Lucier, B.J. (1986) A Moving Mesh Numerical Method for Hyperbolic Conservation Laws. Mathematics of Computation, 46, 59-69. https://doi.org/10.1090/S0025-5718-1986-0815831-4

  9. 9. Bercovier, M., Pironneau, O. and Sastri, V. (1983) Finite Elements and Characteristics for Some Parabolic-Hyperbolic Problems. Applied Mathematical Modelling, 7, 89-96. https://doi.org/10.1016/0307-904X(83)90118-X

  10. 10. Yang, H.Q. (1990) Characteristics-Based, High-Order Accurate and Nonoscillatory Numerical Method for Hyperbolic Heat Conduction. Numerical Heat Transfer, Part B: Fundamentals, 18, 221-241. https://doi.org/10.1080/10407799008944951

  11. 11. Suli, E. and Ware, A. (1991) A Spectral Method of Characteristics for Hyperbolic Problems. SIAM Journal on Numerical Analysis, 28, 423-445. http://www.jstor.org/stable/2157822 https://doi.org/10.1137/0728024

  12. 12. Shoucri, R.M. and Shoucri, M.M. (2007) Application of the Method of Characteristics for the Study of Shock Waves in Models of Blood Flow in the Aorta. Cardiovascular Engineering, 7, 1-6. https://doi.org/10.1007/s10558-007-9024-x

  13. 13. Surov, V.S. (2010) On a Variant of the Method of Characteristics for Calculating One-Velocity Flows of a Multicomponent Mixture. Journal of Engineering Physics and Thermophysics, 83, 366372. https://doi.org/10.1007/s10891-010-0353-z

  14. 14. Acosta, S., Puelz, C., Rivière, B., Penny, D.J. and Rusin C.G. (2015) Numerical Method of Characteristics for One-Dimensional Blood Flow. Journal of Computational Physics, 294, 96-109. https://doi.org/10.1016/j.jcp.2015.03.045

  15. 15. Papanikos, G. (2015) Numerical Study with Methods of Characteristic Curves and Finite Element for Solving Partial Differential Equations with Matlab. Master’s Thesis, Aristotle University, Thessaloniki.

  16. 16. Smith, G.D. (1986) Numerical Solution of Partial Differential Equations: Finite Difference Methods. 3rd Edition, Oxford University Press, Oxford.

  17. 17. O’Brien, G.G., Hyman, M.A. and Kaplan, S. (1950) A Study of the Numerical Solution of Partial Differential Equations. Journal of Mathematics and Physics, 29, 223-251. https://doi.org/10.1002/sapm1950291223

  18. 18. Zauderer, E. (2006) Partial Differential Equations of Applied Mathematics. 3rd Edition, Wiley Interscience, Hoboken. https://doi.org/10.1002/9781118033302

  19. 19. Crank, J. and Nicolson, P. (1947) A Practical Method for Numerical Evaluation of Solutions of Partial Differential Equations of the Heat-Conduction Type. Mathematical Proceedings of the Cambridge Philosophical Society, 43, 50-67. https://doi.org/10.1017/S0305004100023197

  20. 20. Gousidou-Koutita, M. (2008) Numerical Methods with Applications to Ordinary and Partial Differential Equations. Lecture Notes, Aristotle University of Thessaloniki, Thessaloniki.

  21. 21. Richtmyer, R.D. and Morton, K.W. (1967) Difference Methods for Initial-Value Problems. 2nd Edition, Wiley Interscience, New York.

  22. 22. Mitchell, A.R. (1969) Computational Methods in Partial Differential Equations. John Wiley & Sons, Hoboken.

  23. 23. Tveito, A. and Winther, R. (2005) Introduction to Partial Differential Equations. A Computational Approach. Springer.

  24. 24. Griffiths, D.F., Dold, J.W. and Silvester, D.J. (2015) Essential Partial Differential Equations. Analytical and Computational Aspects. Springer. https://doi.org/10.1007/978-3-319-22569-2

  25. 25. Li, Z., Qiao, Z. and Tang, T. (2017) Numerical Solution of Differential Equations. Introduction to Finite Difference and Finite Element Methods. Cambridge University Press, Cambridge. https://doi.org/10.1017/9781316678725

  26. 26. Strikwerda, J.C. (2004) Finite Difference Schemes and Partial Differential Equations. 2nd Edition, SIAM.

  27. 27. Gousidou-Koutita, M. (2004, 2016) Numerical Analysis. Kyriakidis Bros Publications S.A., Thessaloniki.

  28. 28. Burden, R.L. and Faires, J.D. (2010) Numerical Analysis. 9th Edition, Brooks/Cole, Cengage Learning, Boston.

  29. 29. Gousidou-Koutita, M. (2014) Computational Mathematics. Tziola Publications, Thessaloniki.