A Computational Study with Finite Difference Methods for Second Order Quasilinear Hyperbolic Partial Differential Equations in Two Independent Variables ()
1. Introduction
A second order quasilinear PDE in two independent variables x, y is an equation of the form
A∂2U(x,y)∂x2+B∂2U(x,y)∂x∂y+C∂2U(x,y)∂y2+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
B2−4AC>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
c2∂2U(x,t)∂x2−∂2U(x,t)∂t2=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)=0U(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(dydx)2−B(dydx)+C=0. (5)
Let us denote by
ξ=dydx 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
η=dydx 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(xQ,yQ),
R(xR,yR) be points on φ and let us denote by
P(xP,yP) 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
(xP,yP) by the equations
(yP−yQ=ξQ(xP−xQ),yP−yR=ηR(xP−xR). (6)
Then, we calculate approximation values for p and q at P by the equations
(AQξQ(pP−pQ)+CQ(qP−qQ)+DQ(yP−yQ)=0,ARηR(pP−pR)+CR(qP−qR)+DR(yP−yR)=0. (7)
Finally, to obtain an approximation value for U at P we can use the following approximation
UP=UQ+pQ(xP−xQ)+qQ(yP−yQ). (8)
An improved approximation to
UP 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
UP=UQ+12(pQ+pP)(xP−xQ)+12(qQ+qP)(yP−yQ). (9)
A similar averaging approach can be used to improve the accuracy of the approximation values of
xP,
yP,
pP and
qP computed by the equations (6), (7). Then we can calculate an improved approximation value of
UP 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
∂2U∂x2+(1−2∂U∂x)∂2U∂x∂y+((∂U∂x)2−∂U∂x)∂2U∂y2+14√x3=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=14√x3. The PDE (10) is hyperbolic since
B2−4AC=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=12√x and
q=1 on φ. In view of (5), the slope of the characteristics is given by
dydx=1−∂U∂x=ξ and dydx=−∂U∂x=η. (11)
At first we start with
n=10 points
Qi,
1≤i≤10, on φ with
Q1(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≤1210−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+c1 and
y(x)=−√x+c2,
c1,c2∈ℝ 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−at|⋅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,
Q1(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.
Points on φ | x | y | U | p | q | r | e |
(0.50, 0), (0.60, 0) | 0.56753734 | 0.02124904 | −0.22535345 | 0.66364004 | 1.00022892 | 5 | 0.02212982% |
(0.60, 0), (0.70, 0) | 0.66209020 | 0.02297473 | −0.16331189 | 0.61445905 | 1.00010789 | 5 | 0.01719141% |
... | ... | ... | ... | ... | ... | ... | ... |
(1.20, 0), (1.30, 0) | 1.24473492 | 0.02450144 | 0.14018015 | 0.44815906 | 1.00000906 | 4 | 0.00337138% |
(1.30, 0), (1.40, 0) | 1.34304443 | 0.02432066 | 0.18321994 | 0.43144511 | 1.00000707 | 4 | 0.00217536% |
(0.50, 0), (0.70, 0) | 0.62962457 | 0.04317622 | −0.16325993 | 0.63002662 | 1.00034125 | 4 | 0.04900196% |
... | ... | ... | ... | ... | ... | ... | ... |
(1.20, 0), (1.40, 0) | 1.28777931 | 0.04841766 | 0.18322483 | 0.44060574 | 1.00001576 | 4 | 0.00484438% |
| | | | | | | |
(0.50, 0), (1.30, 0) | 0.93314793 | 0.17418945 | 0.14032112 | 0.51740523 | 1.00047707 | 4 | 0.10393566% |
(0.60, 0), (1.40, 0) | 1.00868095 | 0.17889873 | 0.18331277 | 0.49774851 | 1.00025857 | 4 | 0.05283959% |
(0.50, 0), (1.40, 0) | 0.97618298 | 0.19520636 | 0.18336621 | 0.50586075 | 1.00047837 | 4 | 0.08201072% |
翻译:
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
∂2U∂x2−U2∂2U∂y2=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+5x2,
p=10x and
q=3x along φ. The slope of the characteristics is given by
dydx=U=ξ and
dydx=−U=η. As in the previous example, we use two different step sizes of
h=0.1 and
h=0.01 with starting point
Q1(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.
Points on φ | x | y | U | p | q | r | e |
(0.50, 0), (0.52, 0) | 0.51400398 | 0.00416958 | −0.27888924 | 0.69740716 | 1.00000249 | 3 | 0.00018142% |
(0.52, 0), (0.54, 0) | 0.53373711 | 0.00427382 | −0.26515264 | 0.68439369 | 1.00000208 | 3 | 0.00016606% |
... | ... | ... | ... | ... | ... | ... | ... |
(1.36, 0), (1.38, 0) | 1.36854366 | 0.00488632 | 0.17473404 | 0.42740607 | 1.00000006 | 3 | 0.00001743% |
(1.38, 0), (1.40, 0) | 1.38848197 | 0.00487733 | 0.18321599 | 0.42432624 | 1.00000005 | 3 | 0.00001612% |
| | | | | | | |
(0.50, 0), (0.60, 0) | 0.56749183 | 0.02127627 | −0.22540130 | 0.66372561 | 1.00000932 | 3 | 0.00090305% |
... | ... | ... | ... | ... | ... | ... | ... |
(0.60, 0), (0.70, 0) | 0.66206445 | 0.02298676 | −0.16333883 | 0.61449609 | 1.00000437 | 3 | 0.00069857% |
... | ... | ... | ... | ... | ... | ... | ... |
(1.20, 0), (1.30, 0) | 1.24473050 | 0.02450064 | 0.14017562 | 0.44815925 | 1.00000036 | 3 | 0.00013554% |
... | ... | ... | ... | ... | ... | ... | ... |
(1.30, 0), (1.40, 0) | 1.34304069 | 0.02431974 | 0.18321612 | 0.43144501 | 1.00000028 | 3 | 0.00008739% |
| | | | | | | |
(0.50, 0), (1.30, 0) | 0.93307188 | 0.17421938 | 0.14018133 | 0.51761377 | 1.00001930 | 3 | 0.00420993% |
... | ... | ... | ... | ... | ... | ... | ... |
(0.60, 0), (1.40, 0) | 1.00862179 | 0.17891488 | 0.18321986 | 0.49785454 | 1.00001043 | 3 | 0.00213246% |
| | | | | | | |
(0.50, 0), (1.38, 0) | 0.96763029 | 0.19105243 | 0.17474006 | 0.50828622 | 1.00001935 | 3 | 0.00346243% |
(0.52, 0), (1.40, 0) | 0.98210863 | 0.19220248 | 0.18322149 | 0.50452677 | 1.00001695 | 3 | 0.00301873% |
(0.50, 0), (1.40, 0) | 0.97611219 | 0.19523248 | 0.18322204 | 0.50607295 | 1.00001935 | 3 | 0.00332074% |
翻译:
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).
Points on φ | x | y | U | p | q | r | e |
(0.10, 0), (0.20, 0) | 0.15565676 | 0.01636097 | 0.33792386 | 1.49699924 | 1.95370626 | 4 | 0.00007794% |
(0.20, 0), (0.30, 0) | 0.25577809 | 0.02668067 | 0.55667070 | 2.52872472 | 1.67647100 | 4 | 0.00021855% |
... | ... | ... | ... | ... | ... | ... | ... |
(0.80, 0), (0.90, 0) | 0.85259361 | 0.20427892 | 4.36820566 | 9.09572434 | 2.67778972 | 5 | 0.00007108% |
(0.90, 0), (1.00, 0) | 0.95232895 | 0.25438967 | 5.47272209 | 10.25014226 | 2.95315548 | 5 | 0.00018604% |
(0.10, 0), (0.30, 0) | 0.22206412 | 0.04481244 | 0.51895204 | 1.89753969 | 2.84864639 | 4 | 0.00020284% |
... | ... | ... | ... | ... | ... | ... | ... |
(0.80, 0), (1.00, 0) | 0.90974916 | 0.49298582 | 5.73430056 | 10.38676102 | 2.92878781 | 5 | 0.00015383% |
| | | | | | | |
(0.10, 0), (0.90, 0) | 0.67162608 | 1.05926769 | 5.42151878 | 3.30115686 | 3.82475670 | 6 | 0.00005101% |
(0.20, 0), (1.00, 0) | 0.75997657 | 1.44380251 | 7.23518898 | 6.07472266 | 3.56250295 | 5 | 0.00040948% |
(0.10, 0), (1.00, 0) | 0.74638995 | 1.54425948 | 7.55244635 | 3.69616814 | 3.88405010 | 6 | 0.00006218% |
翻译:
Table 3. n = 10, h = 0.1, Number of grid points = 45, Machine time < 0.01 s.
Points on φ | x | y | U | p | q | r | e |
(0.10, 0), (0.11, 0) | 0.10505137 | 0.00127725 | 0.25570387 | 1.05331944 | 0.51084533 | 3 | 0.00001381% |
(0.11, 0), (0.12, 0) | 0.11505394 | 0.00133239 | 0.26676919 | 1.15345945 | 0.53274990 | 3 | 0.00001669% |
... | ... | ... | ... | ... | ... | ... | ... |
(0.98, 0), (0.99, 0) | 0.98502419 | 0.02544421 | 5.12667661 | 9.92610038 | 2.96489591 | 3 | 0.00004564% |
(0.99, 0), (1.00, 0) | 0.99502397 | 0.02594486 | 5.22793456 | 10.02760475 | 2.99470565 | 3 | 0.00004836% |
| | | | | | | |
(0.10, 0), (0.20, 0) | 0.15581730 | 0.01622768 | 0.34152684 | 1.48727809 | 2.00839191 | 3 | 0.00004561% |
... | ... | ... | ... | ... | ... | ... | ... |
(0.20, 0), (0.30, 0) | 0.25592568 | 0.02653642 | 0.56032966 | 2.51670474 | 1.71017403 | 3 | 0.00003429% |
... | ... | ... | ... | ... | ... | ... | ... |
(0.80, 0), (0.90, 0) | 0.85271915 | 0.20374804 | 4.36984923 | 9.08156057 | 2.68101493 | 3 | 0.00002173% |
... | ... | ... | ... | ... | ... | ... | ... |
(0.90, 0), (1.00, 0) | 0.95245444 | 0.25368064 | 5.47376149 | 10.23404159 | 2.95606782 | 3 | 0.00004482% |
| | | | | | | |
(0.10, 0), (0.90, 0) | 0.67246944 | 1.05574970 | 5.42447416 | 3.12098463 | 3.86069530 | 3 | 0.00016360% |
... | ... | ... | ... | ... | ... | ... | ... |
(0.20, 0), (1.00, 0) | 0.76093717 | 1.43784349 | 7.23484790 | 5.87000190 | 3.59376186 | 3 | 0.00011402% |
| | | | | | | |
(0.10, 0), (0.99, 0) | 0.73994271 | 1.48214172 | 7.30237139 | 3.43940264 | 3.91095979 | 3 | 0.00017141% |
(0.11, 0), (1.00, 0) | 0.74882941 | 1.52703854 | 7.50921740 | 3.75179139 | 3.88112412 | 3 | 0.00016465% |
(0.10, 0), (1.00, 0) | 0.74741967 | 1.53765015 | 7.54550489 | 3.48300661 | 3.91683165 | 3 | 0.00017223% |
翻译:
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
∂2U∂x2 and
∂2U∂t2 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
(xi,tj)=(ih,jk), with
i=0,1,⋯,n,
j=0,1,⋯,m. The x step size is
h=Ln and the time step is k. We denote by
Ui,j the value of U at the grid point
(ih,jk) and by
ui,j the approximation value for
Ui,j. We also denote by
fi and
gi the values of
f(xi)=f(ih) and
g(ih), respectively.
3.1. The CTCS Explicit Difference Scheme
We approximate
∂2U∂x2 and
∂2U∂t2 by centered second order divided differences in x and t, respectively. This yields
c2ui+1,j−2ui,j+ui−1,jh2=ui,j+1−2ui,j+ui,j−1k2. (12)
We put
r=(ckh)2 and express (12) as
ui,j+1=rui−1,j+(2−2r)ui,j+rui+1,j−ui,j−1. (13)
Putting
j=0 in (13) yields
ui,1=rui−1,0+(2−2r)ui,0+rui+1,0−ui,−1 (14)
and approximating the initial derivative condition by a centered second order divided difference in t gives
gi=ui,1−ui,−12k. (15)
Eliminating
ui,−1 between (14), (15), the values
ui,1 can be computed from the equation
ui,1=12(rui−1,0+(2−2r)ui,0+rui+1,0+2kgi). (16)
In view of (14), Equation (16) is expressed as
ui,1=12(rfi−1+(2−2r)fi+rfi+1+2kgi). (17)
After calculating the values
ui,1 from (17), we continue with the scheme (13) for
j≥1. We consider also two alternative ways of calculating the values
ui,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
(ih,−k) and solving for
(∂U∂t)i,0 the result
(∂U∂t)i,0=Ui,0−Ui,−1k+12k(∂2U∂t2)i,0+O(k2)
is obtained, which in view of (2) and (4) becomes (provided f is smooth enough)
(∂U∂t)i,0=Ui,0−Ui,−1k+12kc2f″i+O(k2).
So, the initial derivative condition can be approximated by a backward second order divided difference formula
gi=ui,0−ui,−1k+12kc2f″i. (18)
Eliminating
ui,−1 between (14), (18) and considering (4) gives
ui,1=rfi−1+(1−2r)fi+rfi+1+kgi−12k2c2f″i.
Similarly, expanding U about the point
(ih,k) in a Taylor series with respect to t, the initial derivative condition can be approximated by a forward second order divided difference formula
gi=ui,1−ui,0k−12kc2f″i.
Solving for
ui,1 and considering (4) we get
ui,1=fi+kgi+12k2c2f″i.
To summarise, the CTCS numerical scheme can be given as
Boundary conditions ( , ) , |
Initial Conditions ( , ) (centered differences (CD)) (19) or (backward differences (BD)) (20) or (forward differences (FD)) (21) |
Rest Values ( , ) (22) |
翻译:
Expanding (13) by Taylor’s theorem about the point
(ih,jk),
j≥1, and considering (2), the truncation error
Ti,j is found to be
Ti,j=112c2h2(1−r)(∂4U∂x4)i,j+26!c2h4(1−r2)(∂6U∂x6)i,j+O(h6+k6) (23)
We notice that for
r=1 the truncation error vanishes completely. As
h,k→0 (with r constant),
Ti,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
∂2U∂t2 by a centered second order divided difference in t and
∂2U∂x2 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
ui,j+1−2ui,j+ui,j−1k2=12c2(ui+1,j+1−2ui,j+1+ui−1,j+1h2+ui+1,j−2ui,j+ui−1,jh2) (24)
As with the CTCS method, the Crank-Nicolson can be written as
Boundary conditions ( , ) , |
Initial Conditions ( , ) (CD) (25) or (BD) (26) or (FD) (27) |
Rest Values ( , ) (28) |
翻译:
The truncation error at the point
(ih,jk),
j≥1 is defined by
Ti,j=c22(Ui+1,j+1−2Ui,j+1+Ui−1,j+1h2+Ui+1,j−2Ui,j+Ui−1,jh2) −Ui,j+1−2Ui,j+Ui,j−1k2 (29)
Expansion of the terms
Ui+1,j+1,
Ui−1,j+1 about the point
(ih,(j+1)k) and the terms
Ui+1,j,
Ui−1,j,
Ui,j+1,
Ui,j−1 about the point
(ih,jk) by Taylors series and substitution into (29) leads to
Ti,j=c23∑ν=1h2(ν−1)(2ν)!(∂2νU∂x2ν)i,j+1+c23∑ν=1h2(ν−1)(2ν)!(∂2νU∂x2ν)i,j −3∑ν=12k2(ν−1)(2ν)!(∂2νU∂t2ν)i,j+O(h6+k6)
Expansion of the terms
(∂2νU∂x2ν)i,j+1, for
ν=1,2,3, about the point
(ih,jk) and substitution into the expression for
Ti,j then gives
Ti,j=c224∑ν=0kνν!∂ν∂tν(∂2U∂x2)i,j+c2h2244∑ν=0kνν!∂ν∂tν(∂4U∂x4)i,j+c2h46!4∑ν=0kνν!∂ν∂tν(∂6U∂x6)i,j +c23∑ν=1h2(ν−1)(2ν)!(∂2νU∂x2ν)i,j−3∑ν=12k2(ν−1)(2ν)!(∂2νU∂t2ν)i,j+O(k5+h2k5+h4k5+h6)
Finally, taking into consideration (2),
Ti,j can be written as
Ti,j=112c2h2(1+2r)(∂4U∂x4)i,j+12k(∂3U∂t3)i,j+O(h3+k3+h2k+h4k). (30)
As
h,k→0 (with r constant),
Ti,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
ui,j=ξieiβjh (
ξ∈ℂ,
i=√−1,
β≥0 ) into (24) and after some simplification we obtain the quadratic equation
Aξ2+(A−3)ξ+1=0, where
A=2rsin2(βh/2)+1≥1,
r=(ck/h)2. Hence, the values of ξ are
ξ1,2=(−A+3±√(A−1)(A−9))/2A. If
A≥9, then
rsin2(βh/2)≥4 which gives no useful result for r. When
A<9, i.e.,
rsin2(β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
∂2U∂t2 by a centered second order divided difference in t and
∂2U∂x2 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≤ω≤12 ), respectively. The ω scheme is given as
ui,j+1−2ui,j+ui,j−1k2=c2[ωui+1,j−1−2ui,j−1+ui−1,j−1h2+(1−2ω)ui+1,j−2ui,j+ui−1,jh2 +ωui+1,j+1−2ui,j+1+ui−1,j+1h2] (31)
We note that for
ω=0 the ω scheme coincide with the CTCS scheme. Similarly, the ω scheme can be written as
Boundary conditions ( , ) , |
Initial Conditions ( , ) (CD) (32) or (BD) (33) or (FD) (34) |
Rest Values ( , ) (35) |
翻译:
The truncation error at the point
(ih,jk),
j≥1 is given by
Ti,j=112c2h2(1−r+12ωr)(∂4U∂x4)i,j +26!c2h4(1−r2+30ω(r2+r))(∂6U∂x6)i,j +O(k5+h6+h2k4) (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≤ω<14 the scheme is von Neumann stable for
r≤11−4ω. For
14≤ω≤12 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
dtdx=1c=ξ and dtdx=−1c=η.
and therefore the characteristics are
t(x)=1cx+c1 and t(x)=−1cx+c2, c1,c2∈ℝ. (37)
Let
P(xP,tP) be a point in the xt-plane. Then the ξ,η-characteristics through P are given by
t(x)=1c(x−xP)+tP and t(x)=−1c(x−xP)+tP, (38)
respectively. Hence, the grid of points is always inside the triangle defined by the lines
t=0,
t(x)=1cx and
t(x)=−1c(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(xP,tP),
0≤xP≤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
(tP−tQ=1c(xP−xQ) (39)tP−tR=−1c(xP−xR) (40)
(c(pP−pQ)−(qP−qQ)=0 (41)c(pP−pR)+(qP−qR)=0 (42)
UP=UQ+12(pQ+pP)(xP−xQ)+12(qQ+qP)(tP−tQ) (43)
Finally, it is easy to verify that the solutions of (39)-(42) give also the true values of
xP,
tP and
pP,
qP, 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)=sin(πx)cos(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
(ih,0) for (19 ) is defined by
Tcdi,0=r(Ui−1,0+Ui+1,0)+(2−2r)Ui,0+2k(∂U∂t)i,0−2Ui,1. (45)
Expansion of the terms
Ui−1,0,
Ui+1,0,
Ui,1 about the point
(ih,0) by Taylors series and substitution into (45) gives
Tcdi,0=r[3∑ν=02h2ν(2ν)!(∂2νU∂x2ν)i,0]+(2−2r)Ui,0+2k(∂U∂t)i,0 −2[6∑ν=0kνν!(∂νU∂tν)i,0]+O(h8+k7).
In view of (2), and few algebraic steps lead to an expression for
Tcdi,0
|
| Analytical Solution | Approximate Solution | Error |
FD | CD | BD | FD | CD | BD |
| , , , , , Number of Grid Points = 200 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.47552826 | 0.47507598 | 0.47552826 | 0.47598055 | 0.095113% | 0.000000% | 0.095113% |
| 0.18163562 | 0.18090380 | 0.18163562 | 0.18236743 | 0.402904% | 0.000000% | 0.402904% |
| −0.18163567 | −0.18236748 | −0.18163567 | −0.18090385 | 0.402904% | 0.000000% | 0.402904% |
| −0.47552829 | −0.47598058 | −0.47552829 | −0.47507601 | 0.095113% | 0.000000% | 0.095113% |
| −0.18163557 | −0.18090385 | −0.18163567 | −0.18236748 | 0.402850% | 0.000054% | 0.402958% |
| 0.18163571 | 0.18236743 | 0.18163562 | 0.18090380 | 0.402850% | 0.000054% | 0.402957% |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
, , , , , Number of Grid Points = 10,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.47552826 | 0.47640902 | 0.47641793 | 0.47642683 | 0.185217% | 0.187090% | 0.188962% |
| 0.18163562 | 0.18450289 | 0.18451732 | 0.18453175 | 1.578586% | 1.586531% | 1.594477% |
| −0.18163567 | −0.17731856 | −0.17730406 | −0.17728957 | 2.376796% | 2.384775% | 2.392754% |
| −0.47552829 | −0.47194709 | −0.47193802 | −0.47192896 | 0.753101% | 0.755006% | 0.756912% |
| −0.18163557 | −0.19168562 | −0.19169999 | −0.19171436 | 5.533084% | 5.540995% | 5.548906% |
| 0.18163571 | 0.17007575 | 0.17006120 | 0.17004665 | 6.364366% | 6.372376% | 6.380387% |
| 0.58778527 | 0.58759009 | 0.58758969 | 0.58758930 | 0.033206% | 0.033273% | 0.033340% |
, , , , , Number of Grid Points = 20,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.47552826 | 0.47552782 | 0.47552826 | 0.47552871 | 0.000094% | 0.000000% | 0.000094% |
| 0.18163562 | 0.18163489 | 0.18163562 | 0.18163634 | 0.000398% | 0.000000% | 0.000398% |
| −0.18163567 | −0.18163639 | −0.18163567 | −0.18163494 | 0.000398% | 0.000000% | 0.000398% |
| −0.47552829 | −0.47552874 | −0.47552829 | −0.47552785 | 0.000094% | 0.000000% | 0.000094% |
| −0.18163557 | −0.18163494 | −0.18163567 | −0.18163639 | 0.000344% | 0.000054% | 0.000451% |
| 0.18163571 | 0.18163634 | 0.18163562 | 0.18163489 | 0.000344% | 0.000054% | 0.000451% |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
, , , , , Number of Grid Points = 100,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.47552826 | 0.47553674 | 0.47553683 | 0.47553692 | 0.001783% | 0.001802% | 0.001821% |
| 0.18163562 | 0.18166320 | 0.18166335 | 0.18166349 | 0.015189% | 0.015268% | 0.015348% |
| −0.18163567 | −0.18159421 | −0.18159407 | −0.18159392 | 0.022823% | 0.022903% | 0.022982% |
| −0.47552829 | −0.47549407 | −0.47549398 | −0.47549389 | 0.007196% | 0.007215% | 0.007234% |
| −0.18163557 | −0.18173259 | −0.18173273 | −0.18173288 | 0.053416% | 0.053495% | 0.053575% |
翻译:
Table 5. CTCS scheme (
c=2,1,0.2 ).
Tcdi,0=112h4r(1−r)(∂4U∂x4)i,0+26!h6r(1−r2)(∂6U∂x6)i,0 −13k3(∂3U∂t3)i,0+O(h8+k5). (46)
Similarly, the truncation errors at the point
(ih,0) for (20) and (21) are found to be
Tfdi,0=−13k3(∂3U∂t3)i,0+O(k4), (47)
Tbdi,0=14!h4r(2−r)(∂4U∂x4)i,0+16!h6r(2−r2)(∂6U∂x6)i,0 −16k3(∂3U∂t3)i,0+O(h8+k5), (48)
respectively. We also notice that, according to (44),
∂kU(x,0)∂tk=0, for
k=2n+1,
n∈ℕ. This yields,
Tcdi,0=0,
Tfdi,0=O(k4) and
Tbdi,0=O(h4) for
r=1. Thus, in view of (23),
Ti,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
ui,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
Tcdi,0 and
Tbdi,0 are of order h4 and
Tfdi,0 is of order k4 with
k<h, usually. We also notice that when
U(ih,jk)=0 the error increases considerably at points near to
(ih,jk). 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
|
| Analytical Solution | Approximate Solution | Error |
| , , , , |
| 0.58778527 | 0.58778527 | 0.000000% |
| 0.55901701 | 0.55901701 | 0.000000% |
| 0.47552826 | 0.47552826 | 0.000000% |
| 0.18163562 | 0.18163562 | 0.000000% |
| −0.18163567 | −0.18163567 | 0.000000% |
| −0.47552829 | −0.47552829 | 0.000000% |
| −0.58778527 | −0.58778520 | 0.000012% |
| −0.47552823 | −0.47552821 | 0.000006% |
| −0.18163557 | −0.18163567 | 0.000054% |
| 0.18163571 | 0.18163562 | 0.000054% |
| 0.47552832 | 0.47552826 | 0.000013% |
| 0.58778527 | 0.58778527 | 0.000000% |
翻译:
Table 6. Initiating the scheme using analytical solution.
|
| Analytical Solution | Approximate Solution | Error |
FD | CD | BD | FD | CD | BD |
| , , , , , Number of Grid Points = 200 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.55901701 | 0.55877922 | 0.55970419 | 0.56058575 | 0.042536% | 0.122926% | 0.280625% |
| 0.58778527 | 0.36051918 | 0.36033826 | 0.36016582 | 38.664816% | 38.695596% | 38.724933% |
, , , , , Number of Grid Points = 10,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.58777366 | 0.58777366 | 0.58777376 | 0.58777385 | 0.000000% | 0.000016% | 0.000032% |
| 0.58778527 | 0.58184235 | 0.58184197 | 0.58184158 | 1.011069% | 1.011135% | 1.011201% |
, , , , , Number of Grid Points = 20,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.58749523 | 0.58749521 | 0.58749522 | 0.58749523 | 0.000004% | 0.000001% | 0.000000% |
| 0.58778527 | 0.55946067 | 0.55946068 | 0.55946069 | 4.818867% | 4.818866% | 4.818864% |
, , , , , Number of Grid Points = 100,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.58777366 | 0.58777366 | 0.58777366 | 0.58777366 | 0.000000% | 0.000001% | 0.000000% |
| 0.58778527 | 0.58201426 | 0.58201426 | 0.58201426 | 0.981822% | 0.981823% | 0.981822% |
|
| , , , , , Number of Grid Points = 100 |
| 0.80901701 | 0.80901701 | 0.80901701 | 0.80901701 | 0.000000% | 0.000000% | 0.000000% |
| 0.76942090 | 0.76909362 | 0.77036673 | 0.77158027 | 0.042536% | 0.122928% | 0.280649% |
| −0.80901701 | −0.63430476 | −0.63414648 | −0.63399557 | 21.595621% | 21.615186% | 21.633840% |
, , , , , Number of Grid Points = 10,000 |
| 0.80901701 | 0.80901701 | 0.80901701 | 0.80901701 | 0.000000% | 0.000000% | 0.000000% |
| 0.80901302 | 0.80901302 | 0.80901305 | 0.80901308 | 0.000000% | 0.000004% | 0.000008% |
| −0.80901701 | −0.80696433 | −0.80696420 | −0.80696406 | 0.253725% | 0.253741% | 0.253758% |
, , , , , Number of Grid Points = 10,000 |
| 0.80901701 | 0.80901701 | 0.80901701 | 0.80901701 | 0.000000% | 0.000000% | 0.000000% |
| 0.80861781 | 0.80861778 | 0.80861781 | 0.80861784 | 0.000004% | 0.000000% | 0.000004% |
| −0.80901701 | −0.78922993 | −0.78922993 | −0.78922994 | 2.445818% | 2.445817% | 2.445817% |
, , , , , Number of Grid Points = 100,000 |
翻译:
Table 7. Crank-Nicolson scheme (
c=2,1,0.2 ).
|
| Analytical Solution | Approximate Solution | Error |
FD | CD | BD | FD | CD | BD |
| , , , , , Number of Grid Points = 200 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.55901701 | 0.55877922 | 0.55970419 | 0.56062916 | 0.042536% | 0.122926% | 0.288391% |
| 0.58778527 | 0.58631380 | 0.58608352 | 0.58585324 | 0.250341% | 0.289518% | 0.328696% |
, , , , , Number of Grid Points = 10,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.58777366 | 0.58777366 | 0.58777376 | 0.58777385 | 0.000000% | 0.000016% | 0.000032% |
| 0.58778527 | 0.58758962 | 0.58758923 | 0.58758884 | 0.033285% | 0.033352% | 0.033418% |
, , , , , Number of Grid Points = 20,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.58749523 | 0.58749521 | 0.58749522 | 0.58749532 | 0.000004% | 0.000001% | 0.000015% |
| 0.58778527 | 0.58778260 | 0.58778269 | 0.58778287 | 0.000453% | 0.000439% | 0.000407% |
, , , , , Number of Grid Points = 100,000 |
翻译:
Table 8. ω scheme,
ω=0.25, (
c=2,1,0.2 ).
|
| Analytical Solution | Approximate Solution | Error |
FD | CD | BD | FD | CD | BD |
| , , , , , Number of Grid Points = 200 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.55901701 | 0.55877922 | 0.56035906 | 0.56193917 | 0.042536% | 0.240074% | 0.522732% |
| 0.58778527 | 0.58200532 | 0.58122589 | 0.58044618 | 0.983342% | 1.115947% | 1.248600% |
, , , , , Number of Grid Points = 10,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.58777366 | 0.58777366 | 0.58777376 | 0.58777385 | 0.000000% | 0.000016% | 0.000032% |
| 0.47552826 | 0.47641108 | 0.47642000 | 0.47642892 | 0.185649% | 0.187525% | 0.189402% |
| 0.58778527 | 0.58758916 | 0.58758877 | 0.58758838 | 0.033363% | 0.033430% | 0.033497% |
, , , , , Number of Grid Points = 20,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.58749523 | 0.58749521 | 0.58749521 | 0.58749537 | 0.000004% | 0.000004% | 0.000025% |
| 0.58778527 | 0.58777278 | 0.58777285 | 0.58777317 | 0.002124% | 0.002112% | 0.002057% |
, , , , , Number of Grid Points = 100,000 |
| 0.58778527 | 0.58778527 | 0.58778527 | 0.58778527 | 0.000000% | 0.000000% | 0.000000% |
| 0.58777366 | 0.58777366 | 0.58777366 | 0.58777366 | 0.000000% | 0.000000% | 0.000000% |
| 0.58778527 | 0.58778509 | 0.58778508 | 0.58778510 | 0.000030% | 0.000031% | 0.000029% |
|
| , , , , , Number of Grid Points = 100 |
| 0.80901701 | 0.80901701 | 0.80901701 | 0.80901701 | 0.000000% | 0.000000% | 0.000000% |
| 0.76942090 | 0.76909362 | 0.77126826 | 0.77344309 | 0.042536% | 0.240098% | 0.522756% |
| −0.80901701 | −0.80729380 | −0.80675574 | −0.80621735 | 0.213001% | 0.279508% | 0.346056% |
, , , , , Number of Grid Points = 10,000 |
| 0.80901701 | 0.80901701 | 0.80901701 | 0.80901701 | 0.000000% | 0.000000% | 0.000000% |
| 0.80901302 | 0.80901302 | 0.80901305 | 0.80901308 | 0.000000% | 0.000004% | 0.000008% |
| −0.80901701 | −0.80894966 | −0.80894953 | −0.80894939 | 0.008325% | 0.008342% | 0.008358% |
, , , , , Number of Grid Points = 10,000 |
| 0.80901701 | 0.80901701 | 0.80901701 | 0.80901701 | 0.000000% | 0.000000% | 0.000000% |
| 0.80861781 | 0.80861778 | 0.80861781 | 0.80861804 | 0.000004% | 0.000000% | 0.000028% |
| −0.80901701 | −0.80894306 | −0.80894315 | −0.80894348 | 0.009141% | 0.009129% | 0.009089% |
, , , , , Number of Grid Points = 100,000 |
| 0.80901701 | 0.80901701 | 0.80901701 | 0.80901701 | 0.000000% | 0.000000% | 0.000000% |
| 0.80901302 | 0.80901302 | 0.80901302 | 0.80901302 | 0.000000% | 0.000000% | 0.000000% |
| −0.80901701 | −0.80901289 | −0.80901289 | −0.80901289 | 0.000509% | 0.000509% | 0.000509% |
翻译:
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(xP,tP),
0≤xP≤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=D1, we get
UP=12(pD1+pP)0.3, (49)
where
pD1,pP can be calculated (as we will see). Obviously, in
xP 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
P1,P2,⋯,Pν=P on the segment
D1P 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
P1(0.1,1),
P2(0.2,1),
P3(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).
UP1=120.1(pD1+pP1), (50)
where
pD1 and
pP1 are computed as follows (Figure 9, right): Consider the η-characteristic through
P1 (Equation (38)) which intersects the line
x=1 at the point
A1(1,0.55). Then, along this characteristic, Equation (42) implies
2pP1+qP1=2pA1+qA1. (51)
The ξ-characteristic through
A1 (Equation (38)) intersects the line
x=0 at
A2(0,0.05) and Equation (41) implies
2pA1=2pA2−qA2+qA1. (52)
The η-characteristic through
A2 intersects the x axis at
A3(0.1,0) and by (42) we get
2pA2=2pA3+qA3−qA2. (53)
In view of (52) and (53), Equation (51) is given by
2pP1+qP1=2pA3+qA3−2qA2+2qA1,
which, according to the ICs and BCs, can be written as
2pP1+qP1=2f′(0.1). (54)
Similarly, initiating with ξ-characteristic through
P1, we get the sequence
B1(0,0.95),
B2(1,0.45),
B3(0.1,0) and by Equations (41), (42) the result
2pP1−qP1=2f′(0.1), (55)
is obtained. Hence, approximation values for p and q at
P1 are determined by solving (54), (55). This way
pD1 can also be estimated. Then we proceed with the next point
P2. Equation (43) yields
UP2=UP1+120.1(pP1+pP2), where
pP2 is evaluated in a similar way. Finally, this procedure calculates
UP3. 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(xP,tP) lies on the segment
D2P (i.e.,
0.5<xP≤1 ), we form the sequence of points
P1,P2,⋯,Pν on the segment
D2P 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
UP 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
| Analytical Solution | Approximate Solution | Error |
UM | MM | MM | UM | MM | MM |
(0.3,1) | 0.80901701 | 0.74822618 | 0.80235214 | 0.80895047 | 7.514159% | 0.823823% | 0.008225% |
(0.4,1) | 0.95105653 | 0.82247964 | 0.94322150 | 0.95097830 | 13.519374% | 0.823823% | 0.008225% |
(0.5,1) | 1.00000000 | 0.78539815 | 0.99176177 | 0.99991775 | 21.460185% | 0.823823% | 0.008225% |
翻译:
Table 10. A comparison between the usual and the modified method of characteristics.
| , | , | , |
Approximate Solution | Error | Approximate Solution | Error | Approximate Solution | Error |
| 0.58778527 | 0.000000% | 0.80901701 | 0.000000% | 0.95105653 | 0.000000% |
| −0.18162073 | 0.008225% | 0.47548914 | 0.008225% | 0.93420594 | 0.000510% |
| −0.58773694 | 0.008222% | −0.00000004 | 0.000000% | 0.90450065 | 0.000868% |
| −0.18162073 | 0.008171% | −0.47548920 | 0.008225% | 0.86053085 | 0.001258% |
| 0.58773692 | 0.008225% | −0.80895051 | 0.008220% | 0.76940594 | 0.001942% |
翻译:
Table 11. Numerical method of 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
|
| CTCS | Crank-Nicolson | | | Characteristics |
| Time = 0.031 s | Time = 7.57 s | Time = 8.42 s | Time = 9.08 s | Time = 0.53 s |
| 0.000000% | 0.000000% | 0.000000% | 0.000000% | 0.000000% |
| 0.001783% | 0.015332% | 0.004380% | 0.000227% | 0.008225% |
| 0.015189% | 0.286670% | 0.034187% | 0.003179% | 0.008225% |
| 0.022823% | 0.779438% | 0.045864% | 0.004626% | 0.008225% |
| 0.007196% | 0.509323% | 0.011759% | 0.002712% | 0.008225% |
| 0.000012% | 0.493089% | 0.003096% | 0.001108% | 0.008222% |
| 0.010793% | 0.475431% | 0.023022% | 0.002405% | 0.008212% |
| 0.053416% | 0.196618% | 0.101159% | 0.017031% | 0.008171% |
| 0.061050% | 1.277865% | 0.112325% | 0.018414% | 0.008279% |
| 0.016215% | 1.000357% | 0.029848% | 0.004864% | 0.008238% |
| 0.000003% | 0.981823% | 0.000511% | 0.000031% | 0.008225% |
|
| CTCS | Crank-Nicolson | | | Characteristics |
Time = 0.031 s | Time = 6.93 s | Time = 8.35 s | Time = 8.42 s | Time = 1.05 s |
| 0.000000% | 0.000000% | 0.000000% | 0.000000% | 0.000000% |
| 0.000411% | 0.000929% | 0.000402% | 0.000094% | 0.001942% |
| 0.001849% | 0.008091% | 0.001809% | 0.000430% | 0.004342% |
| 0.005263% | 0.035146% | 0.005149% | 0.001232% | 0.008225% |
| 0.015705% | 0.146325% | 0.015373% | 0.003840% | 0.008225% |
| 0.005163% | 0.064678% | 0.004865% | 0.001336% | 0.000000% |
| 0.023579% | 0.395394% | 0.021686% | 0.006576% | 0.008225% |
| 0.012311% | 0.284080% | 0.011448% | 0.003808% | 0.008225% |
| 0.007437% | 0.256653% | 0.007008% | 0.002602% | 0.008224% |
| 0.003745% | 0.248873% | 0.003595% | 0.001602% | 0.008223% |
| 0.000007% | 0.247020% | 0.000067% | 0.000509% | 0.008220% |
|
| CTCS | Crank-Nicolson | | | Characteristics |
Time = 0.031 s | Time = 6.3 s | Time = 7.81 s | Time = 7.8 s | Time = 1.79 s |
| 0.000000% | 0.000000% | 0.000000% | 0.000000% | 0.000000% |
| 0.000016% | 0.000013% | 0.000016% | 0.000012% | 0.000168% |
| 0.000065% | 0.000059% | 0.000063% | 0.000049% | 0.000338% |
| 0.000147% | 0.000146% | 0.000143% | 0.000110% | 0.000510% |
| 0.000265% | 0.000283% | 0.000257% | 0.000198% | 0.000686% |
翻译:
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).