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
with the initial conditions
where
and
are arbitrary positive constants, and
and
are known smooth functions. Here, one should note that the non-local version of
, 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
, we re-cast the initial value problem as the following initial boundary value problem:
with the initial conditions
and the boundary conditions
Here
is negative, and
is positive with
and
being large values so that the finite spatial domain
mimics the infinite domain
. Moreover,
T can be large. In some cases, the boundary conditions
may be replaced by
The boundary conditions at
and
for the problem
correspond to the asymptotic conditions for
of
as
x goes to
and
∞. The solution
of the initial boundary value problem
–
formally satisfies the following energy identity:
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
–
. 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
–
, we give some notations as follows when we discretize the space and time domains:
where
h and
are the step sizes of space and time, respectively. In addition, we define the following inner product and norms:
|
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 .
Lemma 1. For any two mesh functions and there is the identity This lemma can be easily proved using the notational definitions directly.
Let be the difference approximation of at that is, In addition, assume that and
Now, we consider the following finite difference scheme for the Klein–Gordon equation with cubic nonlinearity
–
:
In order to employ the finite difference scheme
, we need initial values at two different time levels. They are chosen from the initial conditions given in
such that
making use of a fictitious time level
.
The boundary conditions are as below.
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
, the explicit forms of
and
are given as follows:
As noted before, the solution
of the initial boundary-value problem
–
satisfies the following energy identity:
Now, we present some properties of our finite difference scheme.
Theorem 1. The difference scheme – possesses the following property:where Proof. Computing the inner product of
with
, we have
In the computation of the above equation, we have used the boundary conditions and Lemma 1.
Now, using the Taylor’s series expansions for
and
about
we can easily show that
Here
and
is denoted by
.
So, if the higher order terms of
are neglected beyond
, we have
Therefore, for the finite difference approximation
of
we obtain the relationship
In a similar fashion, we can obtain
Using these relationships for the finite difference approximations, we obtain
This completes the proof of the theorem. □
Theorem 2. The difference scheme – possesses the following invariant:where Proof. Computing the inner product of
with
, we have
In the computation of Equation
, we have used the boundary conditions and Lemma 1. By adding and subtracting
, and
to the left-hand side of Equation
and rearranging the terms, we obtain
Hence, result follows from Equation . This completes the proof. □
Now, from Equations
and
, we can easily observe that
and therefore, it follows from
that
Moreover, from Equation
and Equation
we have
or equivalently,
In addition, from Equation
we obtain
Therefore, it follows from
and
that
Theorem 3. The difference scheme – possesses the following property:where Moreover, if is given by Equation we have Proof. From
and
we have
In addition, from Equations
, and
we obtain
Hence, result follows from Equation , and result follows from Equation . This completes the proof. □
It should be pointed out that even though our numerical scheme (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 , or is defined using only the time level, then each one of them will be conserved up to order one. On the other hand, the discrete energy defined at two time levels n and is shown to be conserved (Theorem 2) without any order restrictions.
4. Convergence and Stability of the Difference Scheme
In this section, we will discuss the convergence and the stability of the difference scheme
–
. First, we define the truncation error by
Lemma 4. Assume that the conditions of Theorem 4 are satisfied, and then the truncation error of the difference scheme – satisfies By Taylor’s expansion, Lemma 4 can be proved directly. Moreover, we note that the approximation of the initial condition has the truncation error of order , which is consistent with the scheme.
Now, we are going to analyze the convergence of the difference scheme
–
. Let us set
Theorem 5. Assume that the conditions of Lemma 4 are satisfied. Then the solution of the difference scheme – converges to the solution of the problem stated in – with order in the norm for
Proof. Subtracting
from
, we obtain
Then computing the inner product of
with
, we have
where
and
Using Young’s inequality
we have
and
where
Let
then by
and Lemma 4, we have
Summing
up for
n , we obtain
and hence, we have
Applying Gronwall’s inequality (Lemma
, we obtain
From the discrete initial conditions, we know that
and
are of second-order accuracy, then
Hence, the following inequalities can be obtained by
:
It follows from Lemma 2 that
This completes the proof of Theorem 5. □
It should be remarked that since our boundary value problem
–
involves second derivatives of
in time and space, in order for the difference scheme
–
to be a consistent second order method in both time and space, foundational theory in numerical analysis dictates that
(also, see [
31]). If for example,
, still the finite difference scheme
–
works, but now, it will be a consistent first order method in both time and space, i.e.,
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 of the difference scheme – 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
and
We consider the following initial boundary value problem of the Klein–Gordon equation with cubic nonlinearity
subject to the initial conditions
and the homogenous Dirichlet boundary conditions
Note that the initial conditions are derived from the exact solitary wave solution of
given by [
33]
This exact solution is of bell shape and represents a soliton which travels with velocity
c and whose amplitude is
. The exact solution
of the above initial boundary value problem satisfies the following energy identity:
This is fairly straightforward and is obtained by applying Equation
in Equation
at
. For our computations, we consider parameters
and
Hence, the approximate value of the constant
E is
Since – 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 and making use of the respective exact solutions given by and .
In
Figure 1, the solitary wave computed by the numerical scheme
–
is compared with the wave of exact solution at time
. As one can see, both waves are indistinguishable—the numerical solution simply overlaps the exact solution.
The curves of discrete energy
and discrete quantities
and
obtained by the numerical scheme
–
at a larger
T value
are plotted in
Figure 2. The figure shows that the numerical scheme
)–
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
and a different time-step size
.
Figure 3 shows the sensitivities of
and
to the time-step size
. We can easily see that the discrete quantities
and
are more sensitive than the discrete energy
to the changing of the time-step size
Now, let us consider the following kink solitary wave solution of
given by [
33]
This kink solution approaches
as
. So, for solving
, initial conditions can be obtained from this exact solution (Equation
along with the boundary conditions given by
For computations, we choose
. We solved
with the numerical scheme
–
for different velocities
c and several values of
and
Figure 4 shows the comparison between the exact solution and the numerical solution with
and
at time
for
. One can easily see that the solitary wave solution computed by the numerical scheme
–
agrees very well with the exact solution. In addition, the curves of discrete energy
and discrete quantities
, and
obtained by the numerical scheme
–
are plotted in
Figure 5. This shows that the numerical scheme
–
possesses extremely good conservation properties.
Table 1 gives the numerical errors for the scheme
–
with different
h and
at time
. 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
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
and discrete quantities
and
computed by the numerical scheme
–
with
at time
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
and
.
Figure 6 and
Figure 7 show the error functions
and
with
and
and
at time
. 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
is
, where
and
p is any positive integer (note that,
gives
), one could construct a numerical scheme such that in Equation
, the nonlinear term is split judiciously as
and more generally as,
where
. 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.