Next Article in Journal
A Variational Level Set Image Segmentation Method via Fractional Differentiation
Next Article in Special Issue
New Numerical Approach of Solving Highly Nonlinear Fractional Partial Differential Equations via Fractional Novel Analytical Method
Previous Article in Journal
Fractal Analysis of Porous Alumina and Its Relationships with the Pore Structure and Mechanical Properties
Previous Article in Special Issue
A Numerical Strategy for the Approximate Solution of the Nonlinear Time-Fractional Foam Drainage Equation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Energy Conserving Numerical Scheme for the Klein–Gordon Equation with Cubic Nonlinearity

by
Lewa’ Alzaleq
1,* and
Valipuram Manoranjan
2
1
Department of Mathematics, Faculty of Science, Al al-Bayt University, Mafraq 25113, Jordan
2
Department of Mathematics and Statistics, Washington State University, Pullman, WA 99164, USA
*
Author to whom correspondence should be addressed.
Fractal Fract. 2022, 6(8), 461; https://doi.org/10.3390/fractalfract6080461
Submission received: 19 July 2022 / Revised: 15 August 2022 / Accepted: 18 August 2022 / Published: 22 August 2022

Abstract

:
In this paper, we develop a numerical scheme that conserves the discrete energy for solving the Klein-Gordon equation with cubic nonlinearity. We prove theoretically that our scheme conserves not just discrete energy, but also other energy-like discrete quantities. In addition, we prove the convergence and the stability of the scheme. Finally, we present some numerical simulations to demonstrate the performance of our energy-conserving scheme.

1. Introduction

The Klein–Gordon equation is a well-studied equation in mathematical physics in terms of radiation theory, nonlinear optics and general relativity of scattering [1,2,3]. In particular, much work has been carried out on the Klein–Gordon equation with respect to wave collisions and resonance behavior [4]. Recently, we considered the Klein–Gordon equation with quintic nonlinearity from the analytical point of view and were able to obtain a number of new wave solutions [5]. In this paper, our focus is on the numerical study of the initial value problem of the Klein–Gordon equation with cubic nonlinearity
u t t u x x = α u β u 3 , < x < , t 0 ,
with the initial conditions
u ( x , 0 ) = u 0 ( x ) , u t ( x , 0 ) = u 1 ( x ) , < x < ,
where α and β are arbitrary positive constants, and u 0 ( x ) and u 1 ( x ) are known smooth functions. Here, one should note that the non-local version of ( 1 ) , where the dependence of previous time history is considered, gives a time-fractional nonlinear Klein–Gordon equation [6]. There have been a number of analytical and numerical studies to understand the solutions of nonlinear time and space-fractional Klein–Gordon equations [7,8,9,10,11]. The numerical studies have focused on various techniques to discretize the fractional derivatives. However, no special attention was given to the nonlinearities in the equations, as we do in Section 2.
In order to construct a numerical scheme for solving ( 1 ) , we re-cast the initial value problem as the following initial boundary value problem:
u t t u x x = α u β u 3 , x L x x R , 0 t < T ,
with the initial conditions
u ( x , 0 ) = u 0 ( x ) , u t ( x , 0 ) = u 1 ( x ) , x L x x R ,
and the boundary conditions
u ( x L , t ) = 0 , u ( x R , t ) = 0 , 0 t T .
Here x L is negative, and x R is positive with x L and x R being large values so that the finite spatial domain x L x x R mimics the infinite domain < x < . Moreover, T can be large. In some cases, the boundary conditions ( 4 ) may be replaced by
u ( x L , t ) = α β , u ( x R , t ) = ± α β , 0 t T .
The boundary conditions at u ( x L , t ) and u ( x R , t ) for the problem ( 2 ) correspond to the asymptotic conditions for u ( x , t ) of ( 1 ) as x goes to and . The solution u ( x , t ) of the initial boundary value problem ( 2 ) ( 4 ) formally satisfies the following energy identity:
E = x L x R ( t u ) 2 + ( x u ) 2 α u 2 + β 2 u 4 d x = const .
In the literature, one can find a number of numerical schemes with conservation properties for solving the nonlinear Klein–Gordon equation. For example, a three-level finite difference method that conserves energy was developed in [12], while other finite-difference algorithms that preserve energy or linear momentum were studied in [13]. In addition, there are schemes that were constructed using a variational iteration method [14,15], a homotopy-perturbation idea [16,17], radial basis functions [18], spline-collocation approach [19] and discrete Fourier transforms [20] to solve the Klein–Gordon equation under various conditions. Further, some of the recent studies on the nonlinear Klein–Gordon equation have involved making use of pseudo-spectral discretization methods [21], employing a differential quadrature method with cubic B-splines [22] and domain decomposition methods [23]. Other studies include making use of the sinc-collocation idea along with a discrete gradient method to study the Klein–Gordon–Schrödinger equation [24] and developing a higher order method for the Klein–Gordon equation employing a local discontinuous Galerkin method [25]. However, in [25], the numerical simulations were carried out only for the linear Klein–Gordon equation. In [26], energy-preserving schemes were constructed for higher dimensional Klein–Gordon equations using the discrete gradient method and Duhamel principle. In addition, there have been a couple of interesting analytical studies of the Klein–Gordon equation, one utilizing an operational matrix method with clique polynomials [27] and the other a series method using differential transforms [28].
Most of the existing numerical methods investigate the conservation of discrete energy only numerically. If one is to validate the numerical results of an energy conserving numerical scheme, it is important to prove theoretically that the scheme conserves the discrete energy. The work in [29] carried out a theoretical study of four explicit finite difference schemes for solving the Klein–Gordon equation. In the spirit of [29], this paper presents an implicit conservative finite difference scheme for the initial boundary value problem ( 2 ) ( 4 ) . It should be noted that in [30] implicit finite difference schemes were studied for the coupled system of Klein–Gordon–Zakharov equations. Later, more work along the same lines was conducted in [31] for the same system. Even though there is some similarity, in contrast to those works, our study considers not just the conservation of the discrete energy, but other energy-like discrete quantities as well. A predictor–corrector idea is employed to deal with the nonlinearity which appears in the problem. Furthermore, we give some a priori estimates and then prove by the discrete energy method that the difference scheme is stable and second-order convergent. Some numerical results are presented to illustrate the theoretical results. Three-dimensional plots are displayed to demonstrate the sensitivity of the discrete energy and other discrete quantities to the choices of time steps, wave speed, and coefficients α and β .

2. Finite Difference Scheme and Its Conservation Law

Before we propose the conservative finite difference scheme for the Klein–Gordon equation with cubic nonlinearity ( 2 ) ( 4 ) , we give some notations as follows when we discretize the space and time domains:
x m = x L + m h , 0 m M = x R x L h ,
t n = n τ , n = 0 , 1 , 2 , , N = T τ ,
( w m n ) x = w m + 1 n w m n h , ( w m n ) x ¯ = w m n w m 1 n h ,
( w m n ) t = w m n + 1 w m n τ , ( w m n ) t ¯ = w m n w m n 1 τ ,
where h and τ are the step sizes of space and time, respectively. In addition, we define the following inner product and norms:
w n , u n = h m = 0 M w m n u m n , w n p p = h m = 0 M w m n p ,
w n = sup 0 m M w m n .
It should be noted that in the following, C stands for a general positive constant that may take different values on different occasions. In addition, for brevity, we omit the subscript 2 of w n 2 .
Lemma 1.
For any two mesh functions { w m } and { v m } , m = 0 , 1 , 2 , , M , there is the identity
h m = 0 M 1 w m ( v m ) x x ¯ = h m = 0 M 1 ( w m ) x ( v m ) x w 0 ( v 0 ) x + w M ( v M ) x ¯ .
This lemma can be easily proved using the notational definitions directly.
Let U m n be the difference approximation of u ( x , t ) at ( x m , t n ) ; that is, U m n u ( x m , t n ) . In addition, assume that u 0 ( x m ) = U 0 ( x m ) and u 1 ( x m ) = U 1 ( x m ) .
Now, we consider the following finite difference scheme for the Klein–Gordon equation with cubic nonlinearity ( 2 ) ( 4 ) :
U m n t t ¯ 1 2 U m n + 1 + U m n 1 x x ¯ α 2 U m n + 1 + U m n 1 + β 4 U m n + 1 + U m n 1 U m n + 1 2 + U m n 1 2 = 0 .
In order to employ the finite difference scheme ( 6 ) , we need initial values at two different time levels. They are chosen from the initial conditions given in ( 3 ) such that
U m 0 = U 0 ( x m ) and U m 1 U m 1 2 τ = U 1 ( x m )
making use of a fictitious time level 1 .
The boundary conditions are as below.
U 0 n = 0 , U M n = 0 .
It should be pointed out that our two-time-level split approximation of the nonlinear cubic term is very different than the standard nonlinear approximation. As will be seen later in Theorems 1 and 2, this split approximation makes the theoretical analysis easier.
In ( 6 ) , the explicit forms of ( U m n ) t t ¯ and ( U m n ) x x ¯ are given as follows:
( U m n ) t t ¯ = U m n + 1 2 U m n + U m n 1 τ 2 , ( U m n ) x x ¯ = U m + 1 n 2 U m n + U m 1 n h 2 .
As noted before, the solution u ( x , t ) of the initial boundary-value problem ( 2 ) ( 4 ) satisfies the following energy identity:
E = x L x R ( t u ) 2 + ( x u ) 2 α u 2 + β 2 u 4 d x = const .
Now, we present some properties of our finite difference scheme.
Theorem 1.
The difference scheme ( 6 ) ( 8 ) possesses the following property:
Q n = Q n 1 + O ( h τ ) ,
where
Q n = U t n 2 + 1 2 U x n 2 α 2 U n 2 + β 4 U n 4 4 .
Proof. 
Computing the inner product of ( 6 ) with U n U n 1 , we have
U t n 2 U t n 1 2 h m = 0 M 1 τ 2 U m n + 1 2 U m n + U m n 1 U m n + 1 U m n 1 + 1 2 U x n 2 U x n 1 2 α 2 U n 2 U n 1 2 + β 4 U n 4 4 U n 1 4 4 = 0 .
In the computation of the above equation, we have used the boundary conditions and Lemma 1.
Now, using the Taylor’s series expansions for u ( x m , t n + 1 ) and u ( x m , t n 1 ) about u ( x m , t n ) , we can easily show that
u m n + 1 2 u m n + u m n 1 = τ 2 ( u m n ) + τ 4 12 u m n + .
Here u m n = u ( x m , t n ) and t is denoted by .
So, if the higher order terms of τ are neglected beyond τ 4 , we have
u m n + 1 2 u m n + u m n 1 τ 2 ( u m n ) .
Therefore, for the finite difference approximation U m n of u m n , we obtain the relationship
U m n + 1 2 U m n + U m n 1 = τ 2 ( u m n ) .
In a similar fashion, we can obtain
U m n + 1 U m n 1 = 2 τ ( u m n ) .
Using these relationships for the finite difference approximations, we obtain
h m = 0 M 1 τ 2 U m n + 1 2 U m n + U m n 1 U m n + 1 U m n 1 = h m = 0 M 1 τ 2 τ 2 u m n 2 τ u m n = 2 h τ m = 0 M u m n u m n = O ( h τ ) .
So, we have
Q n = Q n 1 + O ( h τ ) ,
where
Q n = U t n 2 + 1 2 U x n 2 α 2 U n 2 + β 4 U n 4 4 .
This completes the proof of the theorem. □
Theorem 2.
The difference scheme ( 6 ) ( 8 ) possesses the following invariant:
E n = E n 1 = = E 0 = c o n s t ,
where
E n = U t n 2 + 1 2 U x n + 1 2 + U x n 2 α 2 U n + 1 2 + U n 2 + β 4 U n + 1 4 4 + U n 4 4 .
Proof. 
Computing the inner product of ( 6 ) with U n + 1 U n 1 , we have
U t n 2 U t n 1 2 + 1 2 U x n + 1 2 U x n 1 2 α 2 U n + 1 2 U n 1 2 + β 4 U n + 1 4 4 U n 1 4 4 = 0 .
In the computation of Equation ( 13 ) , we have used the boundary conditions and Lemma 1. By adding and subtracting 1 2 U x n 2 ,   α 2 U n 2 , and β 4 U n 4 4 to the left-hand side of Equation ( 13 ) and rearranging the terms, we obtain
U t n 2 U t n 1 2 + 1 2 U x n + 1 2 + U x n 2 1 2 U x n 2 + U x n 1 2 α 2 U n + 1 2 + U n 2 + α 2 U n 2 + U n 1 2 + β 4 U n + 1 4 4 + U n 4 4 β 4 U n 4 4 + U n 1 4 4 = 0 .
Hence, result ( 11 ) follows from Equation ( 14 ) . This completes the proof.  □
Now, from Equations ( 10 ) and ( 12 ) , we can easily observe that
E n = Q n + 1 + Q n U t n + 1 2 ,
and therefore, it follows from ( 9 ) that
E n = 2 Q n U t n + 1 2 + O ( h τ ) .
Moreover, from Equation ( 15 ) and Equation ( 11 ) , we have
Q n + Q n 1 U t n 2 = Q n 1 + Q n 2 U t n 1 2 ,
or equivalently,
U t n 2 U t n 1 2 = Q n Q n 2 .
In addition, from Equation ( 9 ) , we obtain
Q n = Q n 2 + O ( h τ ) .
Therefore, it follows from ( 17 ) and ( 18 ) that
U t n 2 = U t n 1 2 + O ( h τ ) .
Theorem 3.
The difference scheme ( 6 ) ( 8 ) possesses the following property:
E ˜ n = E ˜ n 1 + O ( h τ ) ,
where
E ˜ n = U t n 2 + U x n 2 α U n 2 + β 2 U n 4 4 .
Moreover, if E n is given by Equation ( 12 ) , we have
E n = E ˜ n + O ( h τ ) .
Proof. 
From ( 16 ) and ( 19 ) , we have
E n = 2 Q n U t n 2 + O ( h τ ) .
In addition, from Equations ( 22 ) , and ( 11 ) , we obtain
E ˜ n + O ( h τ ) = E ˜ n 1 + O ( h τ ) .
Hence, result ( 20 ) follows from Equation ( 24 ) , and result ( 22 ) follows from Equation ( 23 ) . This completes the proof.  □
It should be pointed out that even though our numerical scheme ( 6 ) (with two-time-level split approximation) is second order, it does not immediately follow that every discrete quantity that will be conserved will also be conserved up to second order. As we have shown in Theorems 1–3, if a discrete quantity, such as Q n , U t n 2 , or E ˜ n is defined using only the n t h time level, then each one of them will be conserved up to order one. On the other hand, the discrete energy E n defined at two time levels n and ( n + 1 ) is shown to be conserved (Theorem 2) without any order restrictions.

3. Some a Priori Estimates for the Numerical Solutions

In this section, we will obtain some a priori estimates for the numerical solutions of the scheme ( 6 ) . Our work makes use of the lemmas presented in [32].
Lemma 2
(Discrete Sobolev’s Estimate). For any discrete function { u m n m = 0 , 1 , , M } on the finite interval [ x L , x R ] , there is the inequality
u n ε u x n + C ( ε ) u n ,
where ε and C ( ε ) are two constants independent of { u m n m = 0 , 1 , , M } and step length h .
Lemma 3
(Gronwall’s Inequality). Suppose that the nonnegative mesh functions { w ( n ) , ρ ( n ) n = 1 , 2 , , N ; N τ = T } satisfy the inequality
w ( n ) ρ ( n ) + τ l = 1 n B l w ( l ) ,
where B l ( l = 1 , 2 , , N ) are nonnegative constants. Then, for any 0 n N , there is
w ( n ) ρ ( n ) exp n τ l = 1 n B l .
Theorem 4.
Assume that U 0 ( x ) H 1 , U 1 ( x ) L 2 and
U m n C , m = 0 , 1 , 2 , , M ,
then the following estimates hold:
U t n C , U x n C , U n C , U n 4 C , U n C .
Proof. 
From Equation ( 11 ) , we have
U t n 2 + 1 2 U x n + 1 2 + U x n 2 + β 4 U n + 1 4 4 + U n 4 4 = C + α 2 U n + 1 2 + U n 2 .
In addition, from Equation ( 25 ) , we obtain
U n = h m = 0 M U m n 2 C .
Therefore, it follows from the last two equations that
U t n 2 + 1 2 U x n + 1 2 + U x n 2 + β 4 U n + 1 4 4 + U n 4 4 = C + α 2 U n + 1 2 + U n 2 C .
Hence, we obtain
U t n C , U x n C , U n 4 C .
In addition, we can obtain the following estimate by Lemma 2:
U n C .
This completes the proof.  □

4. Convergence and Stability of the Difference Scheme

In this section, we will discuss the convergence and the stability of the difference scheme ( 6 ) ( 8 ) . First, we define the truncation error by
r m n = ( u ( x m , t n ) ) t t ¯ 1 2 ( u ( x m , t n + 1 ) + u ( x m , t n 1 ) ) x x ¯ α 2 ( u ( x m , t n + 1 ) + u ( x m , t n 1 ) ) + β 4 ( u ( x m , t n + 1 ) + u ( x m , t n 1 ) ) ( ( u ( x m , t n + 1 ) ) 2 + ( u ( x m , t n 1 ) ) 2 ) = 0 .
Lemma 4.
Assume that the conditions of Theorem 4 are satisfied, and u ( x , t ) C 4 , 4 , then the truncation error of the difference scheme ( 6 ) ( 8 ) satisfies
r m n = O ( τ 2 + h 2 ) a s τ 0 , h 0 .
By Taylor’s expansion, Lemma 4 can be proved directly. Moreover, we note that the approximation of the initial condition ( 7 ) has the truncation error of order O ( τ 2 ) , which is consistent with the scheme.
Now, we are going to analyze the convergence of the difference scheme ( 6 ) ( 8 ) . Let us set
e m n = u ( x m , t n ) U m n .
Theorem 5.
Assume that the conditions of Lemma 4 are satisfied. Then the solution of the difference scheme ( 6 ) ( 8 ) converges to the solution of the problem stated in ( 2 ) ( 4 ) with order O ( τ 2 + h 2 ) in the L norm for U n .
Proof. 
Subtracting ( 6 ) from ( 26 ) , we obtain
r m n = ( e m n ) t t ¯ 1 2 ( e m n + 1 + e m n 1 ) x x ¯ α 2 ( e m n + 1 + e m n 1 ) + β 4 ( u ( x m , t n + 1 ) + u ( x m , t n 1 ) ) ( ( u ( x m , t n + 1 ) ) 2 + ( u ( x m , t n 1 ) ) 2 ) β 4 ( U m n + 1 + U m n 1 ) ( ( U m n + 1 ) 2 + ( U m n 1 ) 2 ) .
Then computing the inner product of ( 27 ) with e n + 1 e n 1 , we have
e t n 2 e t n 1 2 + 1 2 ( e x n + 1 2 e x n 1 2 ) = α 2 ( e n + 1 2 e n 1 2 ) + R 1 R 2 ,
where
R 1 = h m = 0 M r m n ( e m n + 1 e m n 1 ) = h τ m = 0 M r m n ( e m n + e m n 1 ) t
and
R 2 = β h 4 m = 0 M ( u ( x m , t n + 1 ) + u ( x m , t n 1 ) ) ( ( u ( x m , t n + 1 ) ) 2 + ( u ( x m , t n 1 ) ) 2 ) ( U m n + 1 + U m n 1 ) ( ( U m n + 1 ) 2 + ( U m n 1 ) 2 ) ( e m n + 1 e m n 1 ) .
Using Young’s inequality a b 1 4 a 2 + b 2 , we have
R 1 = h τ m = 0 M r m n ( e m n + e m n 1 ) t = h τ m = 0 M r m n ( e m n ) t + r m n ( e m n 1 ) t
h τ m = 0 M 1 4 ( r m n ) 2 + ( e m n ) t ( e m n ) t + 1 4 ( r m n ) 2 + ( e m n 1 ) t ( e m n 1 ) t
= h τ m = 0 M 1 2 ( r m n ) 2 + ( e m n ) t ( e m n ) t + ( e m n 1 ) t ( e m n 1 ) t
= τ 1 2 r n 2 + e t n 2 + e t n 1 2 C τ r n 2 + e t n 2 + e t n 1 2
and
R 2 = β h 4 m = 0 M ( u ( x m , t n + 1 ) + u ( x m , t n 1 ) ) ( ( u ( x m , t n + 1 ) ) 2 + ( u ( x m , t n 1 ) ) 2 ) ( U m n + 1 + U m n 1 ) ( ( U m n + 1 ) 2 + ( U m n 1 ) 2 ) ( e m n + 1 e m n 1 )
= β h 4 m = 0 M ( u ( x m , t n + 1 ) ) 2 + ( u ( x m , t n 1 ) ) 2 ( e m n + 1 + e m n 1 ) ( e m n + 1 e m n 1 ) + β h 4 m = 0 M u ( x m , t n + 1 ) + U m n + 1 e m n + 1 ( e m n + 1 e m n 1 ) + β h 4 m = 0 M u ( x m , t n 1 ) + U m n 1 e m n 1 ( e m n + 1 e m n 1 )
= β h τ 4 m = 0 M ( u ( x m , t n + 1 ) ) 2 + ( u ( x m , t n 1 ) ) 2 ( e m n + 1 + e m n 1 ) ( e m n + e m n 1 ) t + β h τ 4 m = 0 M u ( x m , t n + 1 ) + U m n + 1 e m n + 1 + u ( x m , t n 1 ) + U m n 1 e m n 1 ( e m n + e m n 1 ) t
β h τ 4 m = 0 M u ˜ 2 + u ˜ 2 e m n + 1 + e m n 1 ( e m n + e m n 1 ) t + β h τ 4 m = 0 M u ˜ + C e m n + 1 + u ˜ + C e m n 1 ( e m n + e m n 1 ) t
C h τ m = 0 M e m n + 1 + e m n 1 ( e m n + e m n 1 ) t + C h τ m = 0 M e m n + 1 + e m n 1 ( e m n + e m n 1 ) t
C h τ m = 0 M e m n + 1 + e m n 1 ( e m n + e m n 1 ) t
C h τ m = 0 M 1 4 e m n + 1 + e m n 1 2 + C h τ m = 0 M ( e m n + e m n 1 ) t 2
C h τ m = 0 M e m n + 1 + e m n 1 2 + C h τ m = 0 M ( e m n + e m n 1 ) t 2
= C τ e n + 1 + e n 1 2 + C τ e t n + e t n 1 2
C τ e n + 1 2 + e n 1 2 + e t n 2 + e t n 1 2
C τ e t n 2 + e t n 1 2 + e x n + 1 2 + e x n 2 + e x n 1 2 + e n + 1 2 + e n 2 + e n 1 2 ,
where
u ˜ = max u ( x m , t n ) : 0 m M , 0 n N .
Therefore,
e t n 2 e t n 1 2 + 1 2 ( e x n + 1 2 e x n 1 2 ) + α 2 ( e n + 1 2 e n 1 2 ) = α ( e n + 1 2 e n 1 2 ) + R 1 R 2 α ( e n + 1 2 + e n 1 2 ) + R 1 + R 2 ,
where
R 1 C τ r n 2 + e t n 2 + e t n 1 2
and
R 2 C τ e t n 2 + e t n 1 2 + e x n + 1 2 + e x n 2 + e x n 1 2 + e n + 1 2 + e n 2 + e n 1 2 .
So, we have
e t n 2 e t n 1 2 + 1 2 ( e x n + 1 2 e x n 1 2 ) + α 2 ( e n + 1 2 e n 1 2 ) α ( e n + 1 2 + e n 1 2 ) + R 1 + R 2 α ( e n + 1 2 + e n 1 2 ) + C τ r n 2 + e t n 2 + e t n 1 2 + C τ e t n 2 + e t n 1 2 + e x n + 1 2 + e x n 2 + e x n 1 2 + e n + 1 2 + e n 2 + e n 1 2 C τ r n 2 + e t n 2 + e t n 1 2 + e x n + 1 2 + e x n 2 + e x n 1 2 + e n + 1 2 + e n 2 + e n 1 2 = C τ r n 2 + C τ e t n 2 + e t n 1 2 + e x n + 1 2 + e x n 2 + e x n 1 2 + e n + 1 2 + e n 2 + e n 1 2 .
Let
B n = e t n 2 + 1 2 ( e x n + 1 2 + e x n 2 ) + α 2 ( e n + 1 2 + e n 2 ) ,
then by ( 28 ) and Lemma 4, we have
B n B n 1 C τ r n 2 + C τ ( B n + B n 1 ) C τ ( h 2 + τ 2 ) 2 + C τ ( B n + B n 1 ) .
Summing ( 29 ) up for n ( 1 n N ) , we obtain
B n B 0 C n τ ( h 2 + τ 2 ) 2 + C τ l = 0 n B l C τ ( h 2 + τ 2 ) 2 + C τ l = 0 n B l C τ ( h 2 + τ 2 ) 2 + B 0 + C τ l = 1 n B l ,
and hence, we have
B n B 0 + C τ B 0 + ( h 2 + τ 2 ) 2 + C τ l = 1 n B l C τ B 0 + ( h 2 + τ 2 ) 2 + C τ l = 1 n B l .
Applying Gronwall’s inequality (Lemma 3 ) , we obtain
B N B 0 + C ( h 2 + τ 2 ) 2 exp C N τ C B 0 + ( h 2 + τ 2 ) 2 .
Therefore, we obtain
e t N 2 + 1 2 ( e x N + 1 2 + e x N 2 ) + α 2 ( e N + 1 2 + e N 2 ) C B 0 + ( h 2 + τ 2 ) 2 .
From the discrete initial conditions, we know that e 0 and e 1 are of second-order accuracy, then
B 0 = O ( τ 2 + h 2 ) 2 .
Hence, the following inequalities can be obtained by ( 30 ) :
e t N O ( τ 2 + h 2 ) , e x N O ( τ 2 + h 2 ) , e N O ( τ 2 + h 2 ) .
It follows from Lemma 2 that
e N O ( τ 2 + h 2 ) .
This completes the proof of Theorem 5.  □
It should be remarked that since our boundary value problem ( 2 ) ( 4 ) involves second derivatives of u ( x , t ) in time and space, in order for the difference scheme ( 6 ) ( 8 ) to be a consistent second order method in both time and space, foundational theory in numerical analysis dictates that u ( x , t ) C 4 , 4 (also, see [31]). If for example, u ( x , t ) C 3 , 3 , still the finite difference scheme ( 6 ) ( 8 ) works, but now, it will be a consistent first order method in both time and space, i.e., u ( x , t ) C 4 , 4 is not an essential condition for the method to be consistent.
In the same way as above and under the conditions of Theorem 5, we can also prove that the solution U n of the difference scheme ( 6 ) ( 8 ) is stable in the sense of norm . .

5. Numerical Results

In this section, we will test the efficiency of our numerical scheme by considering a number of simulations. A predictor–corrector idea is employed to deal with the nonlinearity which appears in the problem.
Let us first define the “error” functions as
e n = sup 0 m M u ( x m , t n ) U m n
and
e n = h m = 0 M u ( x m , t n ) U m n 2 .
  • Bell Solitary Wave Solution
We consider the following initial boundary value problem of the Klein–Gordon equation with cubic nonlinearity
u t t u x x = α u β u 3 , 0 < x < 40 , 0 < t < T ,
subject to the initial conditions
u ( x , 0 ) = 2 α β sech α c 2 1 x , u t ( x , 0 ) = α c 2 β ( c 2 1 ) tanh α c 2 1 x sech α c 2 1 x , 0 x 40 ,
and the homogenous Dirichlet boundary conditions
u ( 0 , t ) = 0 , u ( 40 , t ) = 0 , 0 t T .
Note that the initial conditions are derived from the exact solitary wave solution of ( 31 ) given by [33]
u ( x , t ) = 2 α β sech α c 2 1 ( x c t ) , c > 1 .
This exact solution is of bell shape and represents a soliton which travels with velocity c and whose amplitude is 2 α β . The exact solution u ( x , t ) of the above initial boundary value problem satisfies the following energy identity:
E = 0 40 ( t u ) 2 + ( x u ) 2 α u 2 + β 2 u 4 d x = 0 40 4 α 2 cosh 2 α c 2 1 x 20 1 β c 2 1 cosh 4 α c 2 1 x 20 d x = 4 α 2 sinh α c 2 1 x 20 cosh 2 α c 2 1 x 20 1 3 β c 2 1 α c 2 1 cosh 3 α c 2 1 x 20 x = 0 x = 40 = const .
This is fairly straightforward and is obtained by applying Equation ( 32 ) in Equation ( 5 ) at t = 0 . For our computations, we consider parameters α = 1 , β = 1 π 2 , and c = 1.5 . Hence, the approximate value of the constant E is
E 2.385139 π 2 23.5403801 .
Since ( 6 ) ( 8 ) is a three-time-level numerical scheme, in order to get the computer simulation started, at the beginning, we need initial values at two different time levels. For our computations of bell solitary wave solution and kink solitary solution, respectively, these initial values were obtained from u ( x , 0 ) and u t ( x , 0 ) making use of the respective exact solutions given by ( 32 ) and ( 33 ) .
In Figure 1, the solitary wave computed by the numerical scheme ( 6 ) ( 8 ) is compared with the wave of exact solution at time T = 5 . As one can see, both waves are indistinguishable—the numerical solution simply overlaps the exact solution.
The curves of discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 obtained by the numerical scheme ( 6 ) ( 8 ) at a larger T value ( T = 7 ) are plotted in Figure 2. The figure shows that the numerical scheme ( 6 )– ( 8 ) possesses very good conservation properties when compared to the theoretical results.
In order investigate the influence of the time-step size τ , the computations were repeated with a fixed space step h = 0.1 and a different time-step size τ = 0.0125 . Figure 3 shows the sensitivities of E n , E ˜ n , Q n , and U t n 2 to the time-step size τ . We can easily see that the discrete quantities E ˜ n , Q n , and U t n 2 are more sensitive than the discrete energy E n to the changing of the time-step size τ .
  • Kink Solitary Wave Solution
Now, let us consider the following kink solitary wave solution of ( 31 ) given by [33]
u ( x , t ) = α β tanh α 2 ( 1 c 2 ) ( x c t ) , c < 1 .
This kink solution approaches ± α β as ξ = x c t ± . So, for solving ( 31 ) , initial conditions can be obtained from this exact solution (Equation ( 33 ) ) along with the boundary conditions given by
u ( 0 , t ) = α β , u ( 40 , t ) = α β , 0 t T .
For computations, we choose α = 1 , β = 1 π 2 . We solved ( 31 ) with the numerical scheme ( 6 ) ( 8 ) for different velocities c and several values of τ and h .
Figure 4 shows the comparison between the exact solution and the numerical solution with h = 0.1 and τ = 0.0125 at time T = 50 for c = 0.1 . One can easily see that the solitary wave solution computed by the numerical scheme ( 6 ) ( 8 ) agrees very well with the exact solution. In addition, the curves of discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 obtained by the numerical scheme ( 6 ) ( 8 ) are plotted in Figure 5. This shows that the numerical scheme ( 6 ) ( 8 ) possesses extremely good conservation properties.
Table 1 gives the numerical errors for the scheme ( 6 ) ( 8 ) with different h and τ at time T = 50 . In fact, the errors are presented for mesh widths h and time steps τ as they are halved. Using simple arithmetic, one can easily verify that the L error decreases as second order in time and space when τ and h are halved. Table 2 and Table 3 show the conservation of discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 computed by the numerical scheme ( 6 ) ( 8 ) with h = τ = 0.1 at time T = 10 , 20 , 30 , 40 , and 50. Moreover, Table 4 gives the errors between exact and approximate discrete energies and quantities with different velocities at different times in the case when h = 0.1 and τ = 0.0125 .
Figure 6 and Figure 7 show the error functions e n and e n with c = 0.2 , h = 0.1 , and τ = 0.05 , 0.025 , 0.015 , and 0.01 at time T = 1 . The error functions are computed at different values for α and β . Hence, for a small velocity c, the number of error oscillations decreases as α decreases and β increases—i.e., when the cubic term dominates the linear term in the Klein–Gordon nonlinearity.

6. Conclusions

In this paper, we constructed a finite difference scheme that conserves the discrete energy (and some other discrete quantities) for solving the Klein–Gordon equation with cubic nonlinearity. Theoretical analysis is provided to show the conservation properties of the numerical scheme. In addition, we obtain theoretical error estimates and prove the stability and the convergence of the scheme. Finally, we carry out a number of computer simulations using the scheme. In particular, we consider the cases where the solutions are either traveling pulses or traveling wave fronts. The numerical simulations demonstrate that our method performs very well in both instances—conserving the discrete energies and producing accurate and stable solutions. One observation is that if it is imperative to conserve the other discrete quantities along with the discrete energy, one may have to choose a smaller time step. This is because since the conservation of the discrete quantities are correct up to the order of the spatial mesh and the time step, at instances, some of the discrete quantities, other than the discrete energy, are susceptible to an increasing time step. However, this does not affect the performance of our method. One can still conserve the discrete energy and obtain excellent numerical results that are stable and accurate. In addition, in the case of traveling wave fronts with low speeds, we find that our scheme performs well (with no error oscillations) if the cubic term is dominant compared to the linear term (i.e., larger β and smaller α ). As we noted in the introduction, there are a few energy conserving explicit finite difference schemes in the literature for solving the Klein–Gordon equation. However, because of the explicitness, the stability of these schemes is conditional resulting in restrictive choices for the spatial mesh width and time step. In contrast, since our energy-conserving scheme is an implicit scheme, the stability is unconditional, and we do not have any restrictions on the spatial mesh width or the time step. As pointed out in [29], an energy-conserving scheme is very suitable for studying the long-time behavior of wave solutions. For example, the wave collisions and resonance behavior that were studied decades ago in [4] could be well understood if one employs an implicit method such as ours that does not dissipate energy. At this juncture, one should note that another interesting equation with cubic nonlinearity is the nonlinear Schrödinger equation [34]. An energy-conserving circularly exact leapfrog scheme was developed in [34] to study the nonlinear Schrödinger equation. However, our work could be easily modified to study the nonlinear Schrödinger equation as well. Further, this work could be extended to Klein–Gordon equations with other nonlinearities. For instance, if the nonlinear term in Equation ( 2 ) is β u q , where q = 2 p 1 and p is any positive integer (note that, p = 2 gives u 3 ), one could construct a numerical scheme such that in Equation ( 6 ) , the nonlinear term is split judiciously as
for p = 2 β 2 2 U m n + 1 + U m n 1 U m n + 1 2 + U m n 1 2 , for p = 3 β 2 3 U m n + 1 + U m n 1 U m n + 1 2 + U m n 1 2 U m n + 1 4 + U m n 1 4 , for p = 4 β 2 4 U m n + 1 + U m n 1 U m n + 1 2 + U m n 1 2 U m n + 1 4 + U m n 1 4 U m n + 1 8 + U m n 1 8 ,
and more generally as,
β 2 p U m n + 1 + U m n 1 U m n + 1 2 + U m n 1 2 U m n + 1 4 + U m n 1 4 U m n + 1 r + U m n 1 r ,
where r = 2 ( p 1 ) . Then, as in Section 2, one could proceed to show that the scheme will be energy conserving for any positive integer p. So, the idea of re-arranging the nonlinearity in a judicious manner could even be adopted in combination with the standard discretization of fractional derivatives in order to develop new and efficient numerical schemes for the fractional nonlinear Klein–Gordon equations. Therefore, we believe that our work adds to the body of knowledge with regards to the computational study of Klein–Gordon equations.

Author Contributions

Investigation, L.A., V.M.; Software, L.A.; Supervision, V.M.; Writing — original draft, L.A., V.M.; Writing — review & editing, L.A., V.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict to interest.

References

  1. Caudrey, P.J.; Eilbeck, J.C.; Gibbon, J.D. The sine-Gordon equation as a model classical field theory. Il Nuovo Cimento B 1975, 25, 497–512. [Google Scholar] [CrossRef]
  2. Dodd, R.K.; Morris, H.C.; Eilbeck, J.C.; Gibbon, J.D. Soliton and Nonlinear Wave Equations; Academic Press: London, UK; New York, NY, USA, 1982. [Google Scholar]
  3. Wazwaz, A.M. New travelling wave solutions to the Boussinesq and the Klein–Gordon equations. Commun. Nonlinear Sci. Numer. Simul. 2008, 13, 889–901. [Google Scholar] [CrossRef]
  4. Manoranjan, V.S. Some numerical experiments on Higgs model. Comput. Phys. Commun. 1983, 29, 1–5. [Google Scholar] [CrossRef]
  5. Alzaleq, L.M.; Manoranjan, V. Qualitative analysis and exact traveling wave solutions for the Klein-Gordon equation with quintic nonlinearity. Phys. Scr. 2019, 94, 085208. [Google Scholar] [CrossRef]
  6. Amin, M.; Abbas, M.; Iqbal, M.K.; Baleanu, D. Numerical Treatment of Time-Fractional Klein–Gordon Equation Using Redefined Extended Cubic B-Spline Functions. Front. Phys. 2020, 8, 288. [Google Scholar] [CrossRef]
  7. Golmankhaneh, A.K.; Golmankhaneh, A.K.; Baleanu, D. On nonlinear fractional Klein–Gordon equation. Signal Process. 2011, 91, 446–451. [Google Scholar] [CrossRef]
  8. Kurulay, M. Solving the fractional nonlinear Klein-Gordon equation by means of the homotopy analysis method. Adv. Differ. Equations 2012, 2012, 187. Available online: http://www.advancesindifferenceequations.com/content/2012/1/187 (accessed on 2 November 2012). [CrossRef] [Green Version]
  9. Li, C.; Zeng, F. Finite Difference Methods for Fractional Differential Equations. Int. J. Bifurc. Chaos 2012, 22, 1230014. [Google Scholar] [CrossRef]
  10. Liu, J.; Nadeem, M.; Habib, M.; Akgül, A. Approximate Solution of Nonlinear Time-Fractional Klein-Gordon Equations Using Yang Transform. Symmetry 2022, 14, 907. [Google Scholar] [CrossRef]
  11. Nagy, A.M. Numerical solution of time fractional nonlinear Klein-Gordon equation using Sinc-Chebyshev collocation method. Appl. Math. Comput. 2017, 310, 139–148. [Google Scholar] [CrossRef]
  12. Strauss, W.; Vazquez, L. Numerical solution of a nonlinear Klein-Gordon equation. J. Comput. Phys. 1978, 28, 271–278. [Google Scholar] [CrossRef]
  13. Li, S.; Vu-Quoc, L. Finite difference calculus invariant structure of a class of algorithms for the nonlinear Klein-Gordon equation. SIAM J. Numer. Anal. 1995, 32, 1839–1875. [Google Scholar] [CrossRef]
  14. Abbasbandy, S. Numerical solution of non-linear Klein-Gordon equations by variational iteration method. Int. J. Numer. Methods Eng. 2007, 70, 876–881. [Google Scholar] [CrossRef]
  15. Shakeri, F.; Dehghan, M. Numerical solution of the Klein-Gordon equation via He’s variational iteration method. Nonlinear Dyn. 2008, 51, 89–97. [Google Scholar] [CrossRef]
  16. Aslanov, A. The homotopy-perturbation method for solving klein-gordon-type equations with unbounded right-hand side. Z. Naturforschung A 2009, 64, 149–152. [Google Scholar] [CrossRef]
  17. Yousif, M.A.; Mahmood, B.A. Approximate solutions for solving the Klein–Gordon and sine-Gordon equations. J. Assoc. Arab. Univ. Basic Appl. Sci. 2017, 22, 83–90. [Google Scholar] [CrossRef] [Green Version]
  18. Dehghan, M.; Shokri, A. Numerical solution of the nonlinear Klein-Gordon equation using radial basis functions. J. Comput. Appl. Math. 2009, 230, 400–410. [Google Scholar] [CrossRef] [Green Version]
  19. Khuri, S.A.; Sayfy, A. A spline collocation approach for the numerical solution of a generalized nonlinear Klein-Gordon equation. Appl. Math. Comput. 2010, 216, 1047–1056. [Google Scholar] [CrossRef]
  20. Mohebbi, A.; Asgari, Z.; Shahrezaee, A. Fast and high accuracy numerical methods for the solution of nonlinear Klein-Gordon equations. Z. Naturforschung A 2011, 66, 735–744. [Google Scholar] [CrossRef]
  21. Dutykh, D.; Chhay, M.; Clamond, D. Numerical study of the generalised Klein–Gordon equations. Phys. D Nonlinear Phenom. 2015, 304, 23–33. [Google Scholar] [CrossRef] [Green Version]
  22. Shukla, H.S.; Tamsir, M. Numerical solution of nonlinear sine–Gordon equation by using the modified cubic B-spline differential quadrature method. Beni-Suef Univ. J. Basic Appl. Sci. 2018, 7, 359–366. [Google Scholar] [CrossRef]
  23. El-Sayed, S.M. The decomposition method for studying the Klein–Gordon equation. Chaos Solitons Fractals 2003, 18, 1025–1030. [Google Scholar] [CrossRef]
  24. Zhang, J.; Kong, L. New energy-preserving schemes for Klein-Gordon-Schrödinger equations. Appl. Math. Model. 2016, 40, 6969–6982. [Google Scholar] [CrossRef]
  25. He, Y. High-Order Energy and Linear Momentum Conserving Methods for the Klein-Gordon Equation. Mathematics 2018, 6, 200. [Google Scholar] [CrossRef] [Green Version]
  26. Wang, B.; Wu, X. The formulation and analysis of energy-preserving schemes for solving high-dimensional nonlinear Klein-Gordon equations. IMA J. Numer. Anal. 2019, 39, 2016–2044. [Google Scholar] [CrossRef]
  27. Kumbinarasaiah, S.; Ramane, H.S.; Pise, K.S.; Hariharan, G. Numerical-solution-for-nonlinear-klein–gordon equation via operational-matrix by clique polynomial of complete graphs. Int. J. Appl. Comput. Math. 2021, 7, 1–19. [Google Scholar] [CrossRef]
  28. Kanth, A.R.; Aruna, K. Differential transform method for solving the linear and nonlinear Klein–Gordon equation. Comput. Phys. Commun. 2009, 180, 708–711. [Google Scholar] [CrossRef]
  29. Jiménez, S.; Vázquez, L. Analysis of four numerical schemes for a nonlinear Klein-Gordon equation. Appl. Math. Comput. 1990, 35, 61–94. [Google Scholar] [CrossRef]
  30. Wang, T.; Chen, J.; Zhang, L. Conservative difference methods for the Klein-Gordon-Zakharov equations. J. Comput. Appl. Math. 2007, 205, 430–452. [Google Scholar] [CrossRef]
  31. Chen, J.; Zhang, L. Two energy conserving numerical schemes for the Klein-Gordon-Zakharov equations. J. Appl. Math. 2013, 2013, 46208. [Google Scholar] [CrossRef] [Green Version]
  32. Zhou, Y. Applications of Discrete Functional Analysis to the Finite Difference Method; Pergamon Press: Oxford, UK, 1991. [Google Scholar]
  33. Alzaleq, L.M. A Klein-Gordon Equation Revisited: New Solutions and a Computational Method. Ph.D. Thesis, Washington State University, Pullman, WA, USA, 2016. [Google Scholar]
  34. Sanz-Serna, J.M.; Manoranjan, V.S. A Method for the Integration in Time of Certain Partial Differential Equations. J. Comput. Phys. 1983, 52, 273–289. [Google Scholar] [CrossRef]
Figure 1. U computed by the numerical scheme ( 6 ) ( 8 ) with h = 0.1 and τ = 0.0125 . Comparison between the exact solution and the numerical solution at time T = 5 . Initial condition (solid line); exact solution (dotted line); and numerical solution (dashed line).
Figure 1. U computed by the numerical scheme ( 6 ) ( 8 ) with h = 0.1 and τ = 0.0125 . Comparison between the exact solution and the numerical solution at time T = 5 . Initial condition (solid line); exact solution (dotted line); and numerical solution (dashed line).
Fractalfract 06 00461 g001
Figure 2. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 computed by the numerical scheme ( 6 ) ( 8 ) with h = 0.1 and τ = 0.0125 at time T = 7 . E n (Up-Left); E ˜ n (Up-Right); Q n (Down-Left); and U t n 2 (Down-Right).
Figure 2. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 computed by the numerical scheme ( 6 ) ( 8 ) with h = 0.1 and τ = 0.0125 at time T = 7 . E n (Up-Left); E ˜ n (Up-Right); Q n (Down-Left); and U t n 2 (Down-Right).
Fractalfract 06 00461 g002
Figure 3. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 computed by the numerical scheme ( 6 ) ( 8 ) with h = τ = 0.1 at time T = 7 . E n (Up-Left); E ˜ n (Up-Right); Q n (Down-Left); and U t n 2 (Down-Right).
Figure 3. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 computed by the numerical scheme ( 6 ) ( 8 ) with h = τ = 0.1 at time T = 7 . E n (Up-Left); E ˜ n (Up-Right); Q n (Down-Left); and U t n 2 (Down-Right).
Fractalfract 06 00461 g003
Figure 4. U computed by the numerical scheme ( 6 ) ( 8 ) with h = 0.1 and τ = 0.0125 . Comparison between the exact solution and the numerical solution at time T = 50 . Initial condition (solid line); exact solution (dotted line); and numerical solution (dashed line).
Figure 4. U computed by the numerical scheme ( 6 ) ( 8 ) with h = 0.1 and τ = 0.0125 . Comparison between the exact solution and the numerical solution at time T = 50 . Initial condition (solid line); exact solution (dotted line); and numerical solution (dashed line).
Fractalfract 06 00461 g004
Figure 5. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 computed by the numerical scheme ( 6 ) ( 8 ) with h = 0.1 and τ = 0.0125 at time T = 50 . E n (Up-Left); E ˜ n (Up-Right); Q n (Down-Left); and U t n 2 (Down-Right).
Figure 5. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 computed by the numerical scheme ( 6 ) ( 8 ) with h = 0.1 and τ = 0.0125 at time T = 50 . E n (Up-Left); E ˜ n (Up-Right); Q n (Down-Left); and U t n 2 (Down-Right).
Fractalfract 06 00461 g005
Figure 6. The error functions e n and e n computed when α equals 0.8 , 0.9 , 1.0 , 1.1 , and 1.2 and β equals 0.8 , 0.9 , 1.0 , 1.1 , and 1.2 .
Figure 6. The error functions e n and e n computed when α equals 0.8 , 0.9 , 1.0 , 1.1 , and 1.2 and β equals 0.8 , 0.9 , 1.0 , 1.1 , and 1.2 .
Fractalfract 06 00461 g006
Figure 7. The error functions e n and e n computed when α equals 0.1 , 0.2 , 0.3 , and 0.4 and β equals 7 , 8 , 9 , and 10.
Figure 7. The error functions e n and e n computed when α equals 0.1 , 0.2 , 0.3 , and 0.4 and β equals 7 , 8 , 9 , and 10.
Fractalfract 06 00461 g007
Table 1. The numerical errors for different h and τ at time T = 50 .
Table 1. The numerical errors for different h and τ at time T = 50 .
c = 0.1 h = 0.1 h = 0.05
e n e n e n e n
τ = 0.1 6.4229947 × 10 3 8.4036315 × 10 3 1.7938245 × 10 3 2.3492447 × 10 3
τ = 0.05 6.1916631 × 10 3 8.1103089 × 10 3 1.5889166 × 10 3 2.0859734 × 10 3
τ = 0.025 6.1110808 × 10 3 8.0373959 × 10 3 1.5329330 × 10 3 2.0216974 × 10 3
τ = 0.0125 6.0895241 × 10 3 8.0190648 × 10 3 1.5191884 × 10 3 2.0056431 × 10 3
c = 0.1 h = 0.025 h = 0.0125
e n e n e n e n
τ = 0.1 6.37524510 × 10 4 8.38629564 × 10 4 3.48616848 × 10 4 4.61523940 × 10 4
τ = 0.05 4.42980854 × 10 4 5.82593914 × 10 4 1.56742018 × 10 4 2.06995681 × 10 4
τ = 0.025 3.94393863 × 10 4 5.20513898 × 10 4 1.10009011 × 10 4 1.45397726 × 10 4
τ = 0.0125 3.82361297 × 10 4 5.05042927 × 10 4 9.84232136 × 10 5 1.30065000 × 10 4
Table 2. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 with h = τ = c = 0.1 .
Table 2. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 with h = τ = c = 0.1 .
c = 0.1 E n E ˜ n Q n U t n 2
T = 10 −179.184654861638−179.184653840830−89.545574824157760.09350419251447
T = 20 −179.184654890734−179.184653061841−89.545577873877510.09349731408601
T = 30 −179.184654919834−179.184652734929−89.545584384270850.09348396638753
T = 40 −179.184654948939−179.184652618482−89.545593089851570.09346643877978
T = 50 −179.184654978049−179.184652779509−89.545601879737190.09344902003472
Table 3. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 with h = τ = 0.1 and c = 0.2 .
Table 3. Discrete energy E n and discrete quantities E ˜ n , Q n , and U t n 2 with h = τ = 0.1 and c = 0.2 .
c = 0.2 E n E ˜ n Q n U t n 2
T = 10 −178.894785975667−178.894779071216−89.257493975034540.37979112114713
T = 20 −178.894786093736−178.894775141725−89.257532218338520.37971070504812
T = 30 −178.894786211828−178.894775717560−89.257587191302710.37960133495474
T = 40 −178.894786329945−178.894779939288−89.257633203907500.37951353147354
T = 50 −178.894786448089−178.894786332554−89.257668418803100.37944949494802
Table 4. The errors between exact and approximate discrete energies and quantities with different velocities at different times.
Table 4. The errors between exact and approximate discrete energies and quantities with different velocities at different times.
Velocity Time | E ^ n E n | | E ^ ˜ n E ˜ n | | Q ^ n Q n | U ^ t n 2 U t n 2
c = 0.1 T = 1 1.9263239 × 10 8 3.5616346 × 10 7 1.7027686 × 10 5 3.3699209 × 10 5
T = 5 1.9263836 × 10 8 2.9341919 × 10 8 6.3929299 × 10 6 1.2815201 × 10 5
T = 10 1.9264291 × 10 8 1.2115395 × 10 7 7.3275363 × 10 6 1.4776226 × 10 5
c = 0.2 T = 1 3.2929548 × 10 7 1.2054303 × 10 6 7.6424689 × 10 5 1.5164394 × 10 4
T = 5 3.2929474 × 10 7 5.2233454 × 10 7 3.1137188 × 10 5 6.2796710 × 10 5
T = 10 3.2929548 × 10 7 9.6851493 × 10 7 3.8699464 × 10 5 7.8367444 × 10 5
c = 0.3 T = 1 1.8083146 × 10 6 1.8153764 × 10 6 1.9013949 × 10 4 3.7846360 × 10 4
T = 5 1.8083150 × 10 6 2.7416199 × 10 6 9.0616743 × 10 5 1.8397510 × 10 4
T = 10 1.8083162 × 10 6 3.9544104 × 10 6 1.3546068 × 10 4 2.7487579 × 10 4
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Alzaleq, L.; Manoranjan, V. An Energy Conserving Numerical Scheme for the Klein–Gordon Equation with Cubic Nonlinearity. Fractal Fract. 2022, 6, 461. https://doi.org/10.3390/fractalfract6080461

AMA Style

Alzaleq L, Manoranjan V. An Energy Conserving Numerical Scheme for the Klein–Gordon Equation with Cubic Nonlinearity. Fractal and Fractional. 2022; 6(8):461. https://doi.org/10.3390/fractalfract6080461

Chicago/Turabian Style

Alzaleq, Lewa’, and Valipuram Manoranjan. 2022. "An Energy Conserving Numerical Scheme for the Klein–Gordon Equation with Cubic Nonlinearity" Fractal and Fractional 6, no. 8: 461. https://doi.org/10.3390/fractalfract6080461

APA Style

Alzaleq, L., & Manoranjan, V. (2022). An Energy Conserving Numerical Scheme for the Klein–Gordon Equation with Cubic Nonlinearity. Fractal and Fractional, 6(8), 461. https://doi.org/10.3390/fractalfract6080461

Article Metrics

Back to TopTop