# Numerical Approximation of Nonlinear Klein-Gordon Equation Using an Element-Free Approach

Authors: Dong-mei Huang; Guo-liang Zou; L. W. Zhang
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

Numerical approximation of nonlinear Klein-Gordon (KG) equation with quadratic and cubic nonlinearity is performed using the element-free improved moving least squares Ritz (IMLS-Ritz) method. A regular arrangement of nodes is employed in this study for the numerical integration to compute the system equation. A functional formulation for the KG equation is established and discretized by the Ritz minimization procedure. Newmark’s integration scheme combined with an iterative technique is applied to the resulting nonlinear system equations. The effectiveness and efficiency of the IMLS-Ritz method for the KG equation have been testified through convergence analyses and comparison study between the present results and the exact solutions.


---

## Body

## 1. Introduction

The Klein-Gordon (KG) equation is essentially a relativistic version of the Schrödinger equation. It has wide applications in many scientific fields, such as quantum mechanics, solid state physics, and nonlinear optics [1]. Similar to the Schrödinger equation, the KG equation is considered as one of the important equations in mathematical physics, as well as kinds of solitons studies, especially in the investigation of solitons interactions for a collisionless plasma and the recurrence of initial states [2, 3].As a kind of essential nonlinear PDEs, the KG type equations have received considerable attention in deriving both analytical and numerical solutions by using different types of methods, such as the Adomian decomposition method [3, 4], the sine-cosine ansatz and the tanh methods [2, 5, 6], the auxiliary equation method, the Weierstrass elliptic function method, the elliptic equation rational expansion method, and the extended F-function method [7–9]. In the process, various numerical schemes have also been developed based on different theories, such as the homotopy method [10], the cubic B-spline collocation method on a uniform mesh [11], and the approximation with thin plate splines (TPS) radial basis functions (RBF) based collocation approach [12].To seek for an effective and efficient numerical technique, the meshless method has been successfully developed to solve partial differential equations that used to describe many physical and engineering problems. The advantages of these meshless methods are as follows: (i) solutions can be obtained with only a minimum of meshing or no meshing at all [13–18]; (ii) a set of scattered nodes is used instead of meshing the entire domain of the problem. Several meshless methods have been proposed and can be chosen as an alternative to search for approximate solutions of the KG equations [19, 20]. Based on different approximation functions, various meshless methods were proposed, such as the element-free Galerkin (EFG) method [21], the moving least squares differential quadrature method [22], the radial point interpolation method [23], the smooth particle hydrodynamics methods [24], the radial basis function [25], the element-free kp-Ritz method [26–30], the meshless local Petrov-Galerkin method [31], the reproducing kernel particle method [32], and the local Krigging method [33].In this study, by combining the IMLS approximation and the Ritz procedure, the element-free IMLS-Ritz method for numerical solution of the nonlinear KG equation is presented. The cubic spline weight function and linear basis are employed in this study. A regular arrangement of nodes is employed for numerical integration to compute the system equation. A functional formulation for the KG equation is established and discretized by the Ritz procedure. The essential boundary conditions are imposed by the penalty method. Newmark’s integration scheme is employed to solve the nonlinear system equations. The applicability of the IMLS-Ritz method is examined on a few selected example problems. The accuracy of the presented method is also investigated by comparing the obtained numerical results with the existing analytical solutions.


## 2. Theoretical Formulation

### 2.1. Equivalent Functional of the One-Dimensional Nonlinear KG Equation

We consider the following KG equation including the nonlinear term as(1)
∂
2
u
x
,
t
∂
t
2
+
α
∂
2
u
u
,
t
∂
x
2
+
β
u
u
,
t
+
γ
u
k
=
f
x
,
t
,
x
∈
Ω
,
0
<
t
≤
T
,subject to the initial condition(2)
u
x
,
0
=
u
0
,
a
≤
x
≤
band the boundary conditions (3)
u
a
,
t
=
g
1
t
,
u
b
,
t
=
g
2
t
,
0
<
t
≤
T
,where Ω
=
[
a
,
b
]
⊂
R, u
(
x
,
t
) denotes the wave displacement at position x and time t, u
0, g
1
(
t
), and g
2
(
t
) are known functions, and α, β, and γ are real numbers (γ
≠
0). The function u is to be determined when functions f, g
1, and g
2 are given; k
=
2 for the case of quadratic nonlinearity and k
=
3 for a cubic nonlinearity.An equivalent functional is defined in the weighted integral form based on (1) with the initial condition in the following form:(4)
Π
u
=
∫
Ω
w
∂
2
u
x
,
t
∂
t
2
+
α
∂
2
u
u
,
t
∂
x
2
∂
2
u
x
,
t
∂
t
2
+
β
u
u
,
t
+
γ
u
k
-
f
x
,
t
d
Ω
.Using integration by parts and the divergence theorem, (4) yields the following expression:(5)
Π
u
=
∫
Ω
-
α
2
∂
u
∂
x
2
-
1
2
∂
u
∂
t
2
1
2
∂
u
∂
t
2
α
2
+
1
2
β
u
2
+
γ
k
+
1
u
k
+
1
-
u
f
x
,
t
d
Ω
,where the weight w is set to be u in this numerical study.


### 2.2. Improved Moving Least Squares Shape Functions

The IMLS approximation was proposed for construction of the shape functions in the element-free method. In one-dimensional IMLS approximation, for allf
(
x
), g
(
x
)
∈
s
p
a
n
(
p
), we define(6)
f
,
g
=
∑
I
=
1
n
w
x
-
x
I
f
x
I
g
x
I
,where (
f
,
g
) is an inner product and s
p
a
n
(
p
) is the Hilbert space.Ins
p
a
n
(
p
), for the set of points {
x
i
} and weight functions {
w
i
}, if functions p
1
(
x
)
,
p
2
(
x
)
,
…
,
p
m
(
x
) satisfy the conditions(7)
p
k
,
p
j
=
∑
i
=
1
n
w
i
p
k
x
i
p
j
x
i
=
0
,
k
≠
j
A
k
,
k
=
j
k
,
j
=
1,2
,
…
,
m
,we furnish the function set p
1
(
x
)
,
p
2
(
x
)
,
…
,
p
m
(
x
) as a weighted orthogonal function set with a weight function {
w
i
} about points {
x
i
}. If p
1
(
x
)
,
p
2
(
x
)
,
…
,
p
m
(
x
) are polynomials, the function set p
1
(
x
)
,
p
2
(
x
)
,
…
,
p
m
(
x
) is called a weighted orthogonal polynomials set with a weight function {
w
i
} about points {
x
i
}.Consider an equation system from MLS approximation:(8)
A
x
a
x
=
B
x
u
,where A is the moment matrix. Then, (8) can be expressed as(9)
p
1
,
p
1
p
1
,
p
2
⋯
p
1
,
p
m
p
2
,
p
1
p
2
,
p
2
⋯
p
2
,
p
m
⋮
⋮
⋱
⋮
p
m
,
p
1
p
m
,
p
2
⋯
p
m
,
p
m
a
1
x
a
2
x
⋮
a
m
x
=
p
1
,
u
I
p
2
,
u
I
⋮
p
m
,
u
I
.If the basis function setp
i
(
x
)
∈
s
p
a
n
(
p
), i
=
1,2
,
…
,
m, is a weighted orthogonal function set about points {
x
i
}, that is, if(10)
p
i
,
p
j
=
0
,
i
≠
j
,then (8) becomes(11)
p
1
,
p
1
0
⋯
0
0
p
2
,
p
2
⋯
0
⋮
⋮
⋱
⋮
0
0
⋯
p
m
,
p
m
a
1
x
a
2
x
⋮
a
m
x
=
p
1
,
u
I
p
2
,
u
I
⋮
p
m
,
u
I
.Subsequently, coefficientsa
i
(
x
) can be determined accordingly:(12)
a
i
x
=
p
i
,
u
I
p
i
,
p
i
,
i
=
1,2
,
…
,
m
;that is,(13)
a
x
=
A
~
x
B
x
u
,where(14)
A
~
x
=
1
p
1
,
p
1
0
⋯
0
0
1
p
2
,
p
2
⋯
0
⋮
⋮
⋱
⋮
0
0
⋯
1
p
m
,
p
m
.From (8) and (12), the expression of approximation function u
h
(
x
) is(15)
u
h
x
=
Φ
~
x
u
=
∑
I
=
1
n
Φ
~
I
x
u
I
,where Φ
~
(
x
) is the shape function and(16)
Φ
~
x
=
Φ
~
1
x
,
Φ
~
2
x
,
…
,
Φ
~
n
x
=
p
T
x
A
~
x
B
x
.The abovementioned formulation details an IMLS approximation in which coefficientsa
i
(
x
) are obtained directly. It is, therefore, avoiding forming an ill-conditioned or singular equation system.From (16), we have(17)
Φ
~
I
x
=
∑
j
=
1
m
p
j
x
A
~
x
B
x
j
I
,which represents the shape function of the IMLS approximation corresponding to node I. From (17), the partial derivatives of Φ
~
I
(
x
) lead to(18)
Φ
~
I
,
i
x
=
∑
j
=
1
m
p
j
,
i
A
~
B
j
I
+
p
j
A
~
,
i
B
+
A
~
B
,
i
j
I
.The weighted orthogonal basis function setp
=
(
p
i
) is formed by using the Schmidt method as (19)
p
1
=
1
,
⋮
p
i
=
r
i
-
1
-
∑
k
=
1
i
-
1
r
i
-
1
,
p
k
p
k
,
p
k
p
k
,
i
=
2,3
,
…
.Moreover, using the Schmidt method, the weighted orthogonal basis function setp
=
(
p
i
) can be formed from the monomial basis function. For example, for the monomial basis function(20)
p
~
=
p
~
i
=
1
,
x
1
,
x
2
,
x
3
,
x
1
x
2
,
x
1
x
3
,
x
2
x
3
,
x
1
2
,
x
2
2
,
x
3
2
,
…
,the weighted orthogonal basis function set can be generated by(21)
p
i
=
p
~
i
-
∑
k
=
1
i
-
1
p
~
i
,
p
k
p
k
,
p
k
p
k
,
i
=
1,2
,
3
,
…
.When the weighted orthogonal basis functions in (20) and (21) are used, there exist fewer coefficients in the trial function.


## 2.1. Equivalent Functional of the One-Dimensional Nonlinear KG Equation

We consider the following KG equation including the nonlinear term as(1)
∂
2
u
x
,
t
∂
t
2
+
α
∂
2
u
u
,
t
∂
x
2
+
β
u
u
,
t
+
γ
u
k
=
f
x
,
t
,
x
∈
Ω
,
0
<
t
≤
T
,subject to the initial condition(2)
u
x
,
0
=
u
0
,
a
≤
x
≤
band the boundary conditions (3)
u
a
,
t
=
g
1
t
,
u
b
,
t
=
g
2
t
,
0
<
t
≤
T
,where Ω
=
[
a
,
b
]
⊂
R, u
(
x
,
t
) denotes the wave displacement at position x and time t, u
0, g
1
(
t
), and g
2
(
t
) are known functions, and α, β, and γ are real numbers (γ
≠
0). The function u is to be determined when functions f, g
1, and g
2 are given; k
=
2 for the case of quadratic nonlinearity and k
=
3 for a cubic nonlinearity.An equivalent functional is defined in the weighted integral form based on (1) with the initial condition in the following form:(4)
Π
u
=
∫
Ω
w
∂
2
u
x
,
t
∂
t
2
+
α
∂
2
u
u
,
t
∂
x
2
∂
2
u
x
,
t
∂
t
2
+
β
u
u
,
t
+
γ
u
k
-
f
x
,
t
d
Ω
.Using integration by parts and the divergence theorem, (4) yields the following expression:(5)
Π
u
=
∫
Ω
-
α
2
∂
u
∂
x
2
-
1
2
∂
u
∂
t
2
1
2
∂
u
∂
t
2
α
2
+
1
2
β
u
2
+
γ
k
+
1
u
k
+
1
-
u
f
x
,
t
d
Ω
,where the weight w is set to be u in this numerical study.


## 2.2. Improved Moving Least Squares Shape Functions

The IMLS approximation was proposed for construction of the shape functions in the element-free method. In one-dimensional IMLS approximation, for allf
(
x
), g
(
x
)
∈
s
p
a
n
(
p
), we define(6)
f
,
g
=
∑
I
=
1
n
w
x
-
x
I
f
x
I
g
x
I
,where (
f
,
g
) is an inner product and s
p
a
n
(
p
) is the Hilbert space.Ins
p
a
n
(
p
), for the set of points {
x
i
} and weight functions {
w
i
}, if functions p
1
(
x
)
,
p
2
(
x
)
,
…
,
p
m
(
x
) satisfy the conditions(7)
p
k
,
p
j
=
∑
i
=
1
n
w
i
p
k
x
i
p
j
x
i
=
0
,
k
≠
j
A
k
,
k
=
j
k
,
j
=
1,2
,
…
,
m
,we furnish the function set p
1
(
x
)
,
p
2
(
x
)
,
…
,
p
m
(
x
) as a weighted orthogonal function set with a weight function {
w
i
} about points {
x
i
}. If p
1
(
x
)
,
p
2
(
x
)
,
…
,
p
m
(
x
) are polynomials, the function set p
1
(
x
)
,
p
2
(
x
)
,
…
,
p
m
(
x
) is called a weighted orthogonal polynomials set with a weight function {
w
i
} about points {
x
i
}.Consider an equation system from MLS approximation:(8)
A
x
a
x
=
B
x
u
,where A is the moment matrix. Then, (8) can be expressed as(9)
p
1
,
p
1
p
1
,
p
2
⋯
p
1
,
p
m
p
2
,
p
1
p
2
,
p
2
⋯
p
2
,
p
m
⋮
⋮
⋱
⋮
p
m
,
p
1
p
m
,
p
2
⋯
p
m
,
p
m
a
1
x
a
2
x
⋮
a
m
x
=
p
1
,
u
I
p
2
,
u
I
⋮
p
m
,
u
I
.If the basis function setp
i
(
x
)
∈
s
p
a
n
(
p
), i
=
1,2
,
…
,
m, is a weighted orthogonal function set about points {
x
i
}, that is, if(10)
p
i
,
p
j
=
0
,
i
≠
j
,then (8) becomes(11)
p
1
,
p
1
0
⋯
0
0
p
2
,
p
2
⋯
0
⋮
⋮
⋱
⋮
0
0
⋯
p
m
,
p
m
a
1
x
a
2
x
⋮
a
m
x
=
p
1
,
u
I
p
2
,
u
I
⋮
p
m
,
u
I
.Subsequently, coefficientsa
i
(
x
) can be determined accordingly:(12)
a
i
x
=
p
i
,
u
I
p
i
,
p
i
,
i
=
1,2
,
…
,
m
;that is,(13)
a
x
=
A
~
x
B
x
u
,where(14)
A
~
x
=
1
p
1
,
p
1
0
⋯
0
0
1
p
2
,
p
2
⋯
0
⋮
⋮
⋱
⋮
0
0
⋯
1
p
m
,
p
m
.From (8) and (12), the expression of approximation function u
h
(
x
) is(15)
u
h
x
=
Φ
~
x
u
=
∑
I
=
1
n
Φ
~
I
x
u
I
,where Φ
~
(
x
) is the shape function and(16)
Φ
~
x
=
Φ
~
1
x
,
Φ
~
2
x
,
…
,
Φ
~
n
x
=
p
T
x
A
~
x
B
x
.The abovementioned formulation details an IMLS approximation in which coefficientsa
i
(
x
) are obtained directly. It is, therefore, avoiding forming an ill-conditioned or singular equation system.From (16), we have(17)
Φ
~
I
x
=
∑
j
=
1
m
p
j
x
A
~
x
B
x
j
I
,which represents the shape function of the IMLS approximation corresponding to node I. From (17), the partial derivatives of Φ
~
I
(
x
) lead to(18)
Φ
~
I
,
i
x
=
∑
j
=
1
m
p
j
,
i
A
~
B
j
I
+
p
j
A
~
,
i
B
+
A
~
B
,
i
j
I
.The weighted orthogonal basis function setp
=
(
p
i
) is formed by using the Schmidt method as (19)
p
1
=
1
,
⋮
p
i
=
r
i
-
1
-
∑
k
=
1
i
-
1
r
i
-
1
,
p
k
p
k
,
p
k
p
k
,
i
=
2,3
,
…
.Moreover, using the Schmidt method, the weighted orthogonal basis function setp
=
(
p
i
) can be formed from the monomial basis function. For example, for the monomial basis function(20)
p
~
=
p
~
i
=
1
,
x
1
,
x
2
,
x
3
,
x
1
x
2
,
x
1
x
3
,
x
2
x
3
,
x
1
2
,
x
2
2
,
x
3
2
,
…
,the weighted orthogonal basis function set can be generated by(21)
p
i
=
p
~
i
-
∑
k
=
1
i
-
1
p
~
i
,
p
k
p
k
,
p
k
p
k
,
i
=
1,2
,
3
,
…
.When the weighted orthogonal basis functions in (20) and (21) are used, there exist fewer coefficients in the trial function.


## 3. The Ritz Minimization Procedure and Discretion Implementation

In the present work, the penalty method is used to modify the constructed functional in implementing the specified Dirichlet boundary conditions for a domainΩ bounded by Γ. We use a penalty parameter λ to penalize the difference between the displacement of the IMLS approximation and the prescribed displacement on the essential boundary. The penalty function can be expressed as(22)
T
=
λ
2
∫
Γ
1
u
-
u
-
2
d
Γ
,where λ is the penalty parameter and u
- is the specified function on the Dirichlet boundary Γ
1. Normally, λ is chosen as 10
3
~
10
7 which is case dependent.The resulting functional enforcing the Dirichlet boundary conditions for the KG equation is(23)
Π
∗
u
=
Π
u
+
T
.Substituting (5) and (22) into the functional of (23), we have the modified functional(24)
Π
∗
u
=
∫
Ω
-
α
2
∂
u
∂
x
2
-
1
2
∂
u
∂
t
2
+
1
2
β
u
2
∂
u
∂
x
2
1
2
+
γ
k
+
1
u
k
+
1
-
u
f
x
,
t
α
2
∂
u
∂
x
2
d
Ω
+
λ
2
∫
Γ
u
u
-
u
-
2
d
Γ
.The approximation of the field function can be obtained from (15) as follows:(25)
u
h
x
,
t
=
∑
I
=
1
n
Φ
I
x
u
I
t
=
Φ
x
U
t
,
∂
u
h
x
,
t
∂
x
=
∑
I
=
1
n
Φ
I
,
x
x
u
I
t
=
Φ
x
x
U
t
,
∂
2
u
h
x
,
t
∂
t
2
=
∑
I
=
1
n
Φ
I
,
x
x
∂
2
u
I
t
∂
t
2
=
Φ
x
x
U
¨
t
,where(26)
Φ
x
=
Φ
1
x
,
Φ
2
x
,
…
,
Φ
n
x
,
Φ
x
x
=
Φ
1
,
x
x
,
Φ
2
,
x
x
,
…
,
Φ
n
,
x
x
,
U
¨
t
=
∂
u
1
2
t
∂
t
2
,
∂
u
2
2
t
∂
t
2
,
…
,
∂
u
n
2
t
∂
t
2
T
.Substituting (25) into (24) and applying the Ritz minimization procedure to the maximum energy function Π
∗
(27)
∂
Π
∗
∂
u
I
t
=
0
,
I
=
1,2
,
…
,
n
,that yields the following matrix form: (28)
M
u
¨
+
K
-
u
=
F
-
,where (29)
K
-
=
β
M
-
α
K
+
K
a
,
F
-
=
F
+
F
a
,
M
=
∫
Ω
Φ
T
Φ
d
Ω
,
K
=
∫
Ω
Φ
x
T
Φ
x
d
Ω
,
F
=
∫
Ω
Φ
f
x
,
t
d
Ω
,
K
I
J
a
=
α
Φ
I
x
T
Φ
J
x
x
=
a
+
Φ
I
x
T
Φ
J
x
x
=
b
,
F
I
a
=
-
γ
∫
Ω
Φ
I
u
k
d
Ω
+
λ
Φ
I
x
u
-
x
=
a
+
Φ
I
x
u
-
x
=
b
.To solve the above nonlinear system, time discretization of (28) is forming with Newmark’s integration scheme. According to the fundamental assumptions of Newmark’s integration(30)
u
˙
t
+
Δ
t
=
u
˙
t
+
1
-
δ
u
¨
t
+
δ
u
¨
t
+
Δ
t
Δ
t
,
u
t
+
Δ
t
=
u
t
t
+
u
˙
t
Δ
t
+
-
1
2
-
α
u
¨
t
+
α
u
¨
t
+
Δ
t
Δ
t
2
,we have (31)
u
¨
t
+
Δ
t
=
1
α
Δ
t
2
u
t
+
Δ
t
-
u
t
-
1
α
Δ
t
u
˙
t
-
1
2
α
-
1
u
¨
t
,
u
˙
t
+
Δ
t
=
δ
α
Δ
t
u
t
+
Δ
t
-
u
t
+
1
-
δ
α
u
˙
t
+
1
-
δ
2
α
Δ
t
u
¨
t
,where δ
≥
0.5 and α
≥
0.25
(
0.5
+
δ
)
2 are redefined as parameters here to influence the accuracy and stability of the integration.The dynamic form of (28) at t
+
Δ
t can be written as(32)
M
u
¨
t
+
Δ
t
+
K
-
u
t
+
Δ
t
=
F
t
+
Δ
t
.Substituting (31) into (32), we have the full discretized equation(33)
K
-
+
1
α
Δ
t
2
M
u
t
+
Δ
t
=
F
-
t
+
Δ
t
+
M
1
α
Δ
t
2
u
t
+
1
α
Δ
t
u
˙
t
+
1
2
α
-
1
u
¨
t
.By solving the above iteration equations, we can obtain numerical solutions to the one-dimensional nonlinear Klein-Gordon equation.


## 4. Numerical Results and Discussion

Three selected examples are included with their numerical solutions obtained by the presented method for the nonlinear KG equation. The problems are solved using regular node arrangements. The convergence study is carried out for the results of the KG equation. The accuracy and efficiency of the IMLS-Ritz method are compared with available analytical solutions by evaluating theL
2-norm and L
∞ errors defined as(34)
L
2
=
u
e
x
a
c
t
-
u
n
u
m
e
r
i
c
a
l
2
=
∑
i
=
0
N
u
e
x
a
c
t
i
-
u
n
u
m
e
r
i
c
a
l
i
2
,
L
∞
=
u
e
x
a
c
t
-
u
n
u
m
e
r
i
c
a
l
∞
=
max
i
⁡
u
e
x
a
c
t
i
-
u
n
u
m
e
r
i
c
a
l
i
,where u
e
x
a
c
t and u
n
u
m
e
r
i
c
a
l present the exact solution and numerical approximation, respectively.


### 4.1. Example1

Consider the KG equation (1) with quadratic nonlinearity (k
=
2), by taking the parameters α
=
-
1, β
=
0, γ
=
1, and f
(
x
,
t
)
=
-
x
c
o
s
t
+
x
2
c
o
s
2
t.The exact solution of the equation is given as [1](35)
u
x
,
t
=
x
c
o
s
t
,
-
1
≤
x
≤
1
.The corresponding initial conditions and Dirichlet boundary function can be extracted from the analytical solution directly as(36)
u
x
,
0
=
x
,
-
1
≤
x
≤
1
,
u
t
x
,
0
=
0
,
-
1
≤
x
≤
1
,
u
x
,
t
=
-
c
o
s
t
x
=
-
1
c
o
s
t
x
=
1
.In the present example, the numerical solutions are obtained as the penalty factorα
=
10
3 and d
m
a
x
=
3. We examine the convergence of the element-free IMLS-Ritz method by varying the number of nodes (N) from 11 to 201. The L
2-norm and L
∞ errors of u
(
x
,
t
) with CPU times are computed at t
=
10 with Δ
t
=
0.1 and tabulated in Table 1. We found that both L
2-norm and L
∞ errors arise as N increases. This may be due to that once convergent result has been obtained, in this case on N
=
11, the additional arranged nodes will cause errors being accumulated. Based on this observation, the following analysis will be performed using N
=
11 for accuracy consideration. We also investigated the influence of d
m
a
x on the accuracy of the IMLS-Ritz method. As illustrated in Table 2, by varying d
m
a
x from 2 to 3, accurate results can be furnished when d
m
a
x
=
2. Furthermore, the predicted results are compared with the available exact solutions at t
=
10 and illustrated in Figure 1. It is apparent that a close agreement is obtained from the illustrated results. The computed results of u
(
x
,
t
) for a time history are also predicted between t
=
0 s and t
=
10 s (Δ
t
=
0.1) (see Figure 2(a)). The corresponding absolute error contour is plotted in Figure 2(b). From the presented results, we can conclude that the approximate solutions generated by the IMLS-Ritz method agree well with the analytical results.Table 1
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the number of nodes (N) for the solutions of Example  1 (t = 10, Δ
t = 0.1, and d
max
⁡ = 3).
N
L
2-norm error
L
∞ error
CPU time (s)
11
4.7172 × 10−4
2.0891 × 10−4
1.5224
21
6.6446 × 10−4
2.1335 × 10−4
1.7486
51
1.0503 × 10−3
2.1488 × 10−4
5.2065
101
1.5343 × 10−3
2.1500 × 10−4
10.3477
201
2.1912 × 10−3
2.1504 × 10−4
19.8889
251
2.3485 × 10−3
2.1505 × 10−4
25.6620Table 2
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the d
max
⁡ for the solution of Example  1 (N = 11, t = 10, and Δ
t = 0.1).
d
max
⁡
L
2-norm error
L
∞ error
CPU time (s)
2
6.7304 × 10−4
2.1170 × 10−4
1.7510
2.2
6.9125 × 10−4
2.1913 × 10−4
1.7888
2.4
7.1843 × 10−4
2.2411 × 10−4
1.8604
2.6
6.5686 × 10−4
2.2234 × 10−4
1.7744
2.8
6.4655 × 10−4
2.1186 × 10−4
1.7812
3
6.6445 × 10−4
2.1335 × 10−4
1.7949Figure 1
IMLS-Ritz and exact solutions ofu
(
x
,
t
) at N
=
2
1, Δ
t
=
0.1 (Example 1). (a) Solutions of u
(
x
,
t
); (b) absolute error.
(a)
(b)Figure 2
IMLS-Ritz solutions and absolute errors ofu
(
x
,
t
) at different times (Example 1). (a) Solution surface of u
(
x
,
t
); (b) absolute error contour.
(a)
(b)


### 4.2. Example2

In the present numerical example, we consider KG in (1) with a quadratic nonlinearity (k
=
2), by taking the parameters α
=
-
1, β
=
0, γ
=
1, and f
(
x
,
t
)
=
6
x
t
(
x
2
-
t
2
)
+
x
6
t
6. The initial conditions are described by(37)
u
x
,
0
=
0
,
0
≤
x
≤
1
,
u
t
x
,
0
=
0
,
0
≤
x
≤
1
.The exact solution of the equation is given as [1](38)
u
x
,
t
=
x
3
t
3
,
0
≤
x
≤
1
.The corresponding Dirichlet boundary function can be extracted from the analytical solution directly as(39)
u
x
,
t
=
0
x
=
0
t
3
x
=
1
.In this analysis, numerical solutions are predicted and compared with the analytical solutions att
=
1, Δ
t
=
0.01, d
m
a
x
=
2
.
2, and the penalty factor λ
=
1
0
3. Table 3 presents the convergence patterns of the IMLS-Ritz results by varying N from 6 to 101. A similar convergence trend is observed in Example 1; that is, convergent results can be obtained from N
=
6 to 21; then, the errors are accumulated as N increases. Table 4 illustrates the values of L
2-norm and L
∞ errors as d
m
a
x varying from 2 to 3.5. A growing trend of L
2-norm and L
∞ errors is observed from Table 4, and the CPU time rises oscillatory as d
m
a
x increases. As presented in Figure 3, the comparison study shows that the IMLS-Ritz method provides very similar solutions to the exact results. In Figure 4, the absolute errors of u
(
x
,
t
) at a selected time point (t
=
1) and the absolute error contour on a time period (0
≤
t
≤
1) are exhibited at N
=
2
1. Figure 5 is plotted at N
=
101 for comparison with Figure 4. Although the increase in number of nodes has been identified to be unaided in enhancing the accuracy of the approximation, it influences the smoothness of the solutions indeed.Table 3
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the number of nodes (N) for the solutions of Example  2 (t = 1, Δ
t = 0.1, and d
max
⁡ = 2.2).
N
L
2-norm error
L
∞ error
CPU time (s)
6
2.1937 × 10−2
1.7231 × 10−2
0.1081
21
3.3745 × 10−4
2.0891 × 10−4
0.2683
26
3.7023 × 10−4
1.6600 × 10−4
0.3275
51
5.1750 × 10−4
1.6589 × 10−4
0.6268
101
7.2991 × 10−4
1.6588 × 10−4
1.1983Table 4
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the d
max
⁡ for the solution of Example  2 (N = 11, t = 1, and Δ
t = 0.1).
d
max
⁡
L
2-norm error
L
∞ error
CPU time (s)
2
3.3081 × 10−4
2.1170 × 10−4
0.2637
2.2
3.3746 × 10−4
1.6616 × 10−4
0.2644
2.4
3.4597 × 10−4
1.6866 × 10−4
0.2754
2.6
3.7193 × 10−4
1.7459 × 10−4
0.2690
2.8
3.8596 × 10−4
1.8276 × 10−4
0.2686
3
3.8960 × 10−4
1.9179 × 10−4
0.2650
3.2
4.2300 × 10−4
1.999 × 10−4
0.2644
3.5
4.9035 × 10−4
2.3717 × 10−4
0.2819Figure 3
IMLS-Ritz and exact solutions ofu
(
x
,
t
) (Example 2). (a) Solutions of u
(
x
,
t
) at N
=
21, Δ
t
=
0.1; (b) solution surface of u
(
x
,
t
).
(a)
(b)Figure 4
Absolute errors ofu
(
x
,
t
) at N
=
21 (Example 2). (a) Absolute errors of u
(
x
,
t
) at Δ
t
=
0.1; (b) absolute errors contour.
(a)
(b)Figure 5
Absolute errors ofu
(
x
,
t
) at N
=
101 (Example 2). (a) Absolute errors of u
(
x
,
t
) at Δ
t
=
0.1; (b) absolute errors contour.
(a)
(b)


### 4.3. Example3

Consider the nonlinear Klein-Gordon equation (1) with a cubic nonlinearity (k
=
3), by taking parameters as α
=
-
2.5, β
=
1, γ
=
1.5, and f
(
x
,
t
)
=
0. The initial conditions are given by(40)
u
x
,
0
=
B
t
a
n
K
x
,
0
≤
x
≤
1
,
u
t
x
,
0
=
B
c
K
s
e
c
2
K
x
,
0
≤
x
≤
1
,where B
=
β
/
γ and K
=
-
β
/
2
(
α
+
c
2
) and c
=
0.05.The exact solution of the equation is given as [4](41)
u
x
,
t
=
B
t
a
n
K
x
+
c
t
,
0
≤
x
≤
1
.The IMLS-Ritz computation is carried out by settingΔ
t
=
0.1, the penalty factor λ
=
1
0
3, and d
m
a
x
=
2.5. The L
2-norm and L
∞ errors of u are computed with the number of nodes varied from 13 to 201. The results are tabulated in Table 5. It is apparent that both L
2-norm and L
∞ errors decrease as N increases, indicating that convergent results are obtained by the IMLS-Ritz method. From Table 6, the results of numerical analysis suggested that satisfied accuracy can be achieved when d
m
a
x
=
2. In Figure 6, the numerical and analytical solutions are plotted on a time point (t
=
2) and a time period (0
≤
t
≤
2). From the comparison results, we can conclude that the IMLS-Ritz method provides very similar solutions to the exact results. In Figures 7 and 8, the absolute errors of u
(
x
,
t
) at a selected time point (t
=
2) and the absolute error contour on a time period (0
≤
t
≤
1) are depicted at N
=
21 and N
=
201, respectively. As expected, more accurate results can be obtained as N increases in this example. From the results presented in both tables and figures, it is evident that the IMLS-Ritz values almost coincide with the exact solutions.Table 5
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the number of nodes (N) for the solutions of Example  3 (t = 2, Δ
t = 0.1, and d
max
⁡ = 2.5).
N
L
2-norm error
L
∞ error
CPU time (s)
13
1.9791 × 10−5
1.3049 × 10−5
447.3713
21
9.5355 × 10−6
5.7505 × 10−6
559.7717
51
2.8692 × 10−6
1.7171 × 10−6
600.6953
101
1.8512 × 10−6
1.3635 × 10−6
650.4551
126
1.4819 × 10−6
1.0907 × 10−6
687.4458
201
7.8596 × 10−7
5.3053 × 10−7
721.8184Table 6
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the d
max
⁡ for the solution of Example  3 (N = 11, t = 10, and Δ
t = 0.1).
d
max
⁡
L
2-norm error
L
∞ error
CPU time (s)
2
5.5466 × 10−6
3.4260 × 10−6
793.1491
2.2
1.8244 × 10−5
1.0416 × 10−5
826.7344
2.4
3.2447 × 10−5
1.8490 × 10−5
891.1543
2.6
4.5397 × 10−5
2.5715 × 10−5
945.6493
2.8
4.4504 × 10−5
2.6234 × 10−5
975.9027
3
2.7963 × 10−5
1.6959 × 10−5
1027.5762
3.2
3.2756 × 10−5
1.6014 × 10−5
1070.3232Figure 6
IMLS-Ritz and exact solutions ofu
(
x
,
t
) (Example 3). (a) Solutions of u
(
x
,
t
) at N
=
21, Δ
t
=
0.1; (b) solution surface of u
(
x
,
t
).
(a)
(b)Figure 7
Absolute errors ofu
(
x
,
t
) at N
=
21 (Example 3). (a) Absolute errors of u
(
x
,
t
) at Δ
t
=
0.1; (b) absolute errors contour.
(a)
(b)Figure 8
Absolute errors ofu
(
x
,
t
) at N
=
201 (Example 3). (a) Absolute errors of u
(
x
,
t
) at Δ
t
=
0.1; (b) absolute errors contour.
(a)
(b)


## 4.1. Example1

Consider the KG equation (1) with quadratic nonlinearity (k
=
2), by taking the parameters α
=
-
1, β
=
0, γ
=
1, and f
(
x
,
t
)
=
-
x
c
o
s
t
+
x
2
c
o
s
2
t.The exact solution of the equation is given as [1](35)
u
x
,
t
=
x
c
o
s
t
,
-
1
≤
x
≤
1
.The corresponding initial conditions and Dirichlet boundary function can be extracted from the analytical solution directly as(36)
u
x
,
0
=
x
,
-
1
≤
x
≤
1
,
u
t
x
,
0
=
0
,
-
1
≤
x
≤
1
,
u
x
,
t
=
-
c
o
s
t
x
=
-
1
c
o
s
t
x
=
1
.In the present example, the numerical solutions are obtained as the penalty factorα
=
10
3 and d
m
a
x
=
3. We examine the convergence of the element-free IMLS-Ritz method by varying the number of nodes (N) from 11 to 201. The L
2-norm and L
∞ errors of u
(
x
,
t
) with CPU times are computed at t
=
10 with Δ
t
=
0.1 and tabulated in Table 1. We found that both L
2-norm and L
∞ errors arise as N increases. This may be due to that once convergent result has been obtained, in this case on N
=
11, the additional arranged nodes will cause errors being accumulated. Based on this observation, the following analysis will be performed using N
=
11 for accuracy consideration. We also investigated the influence of d
m
a
x on the accuracy of the IMLS-Ritz method. As illustrated in Table 2, by varying d
m
a
x from 2 to 3, accurate results can be furnished when d
m
a
x
=
2. Furthermore, the predicted results are compared with the available exact solutions at t
=
10 and illustrated in Figure 1. It is apparent that a close agreement is obtained from the illustrated results. The computed results of u
(
x
,
t
) for a time history are also predicted between t
=
0 s and t
=
10 s (Δ
t
=
0.1) (see Figure 2(a)). The corresponding absolute error contour is plotted in Figure 2(b). From the presented results, we can conclude that the approximate solutions generated by the IMLS-Ritz method agree well with the analytical results.Table 1
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the number of nodes (N) for the solutions of Example  1 (t = 10, Δ
t = 0.1, and d
max
⁡ = 3).
N
L
2-norm error
L
∞ error
CPU time (s)
11
4.7172 × 10−4
2.0891 × 10−4
1.5224
21
6.6446 × 10−4
2.1335 × 10−4
1.7486
51
1.0503 × 10−3
2.1488 × 10−4
5.2065
101
1.5343 × 10−3
2.1500 × 10−4
10.3477
201
2.1912 × 10−3
2.1504 × 10−4
19.8889
251
2.3485 × 10−3
2.1505 × 10−4
25.6620Table 2
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the d
max
⁡ for the solution of Example  1 (N = 11, t = 10, and Δ
t = 0.1).
d
max
⁡
L
2-norm error
L
∞ error
CPU time (s)
2
6.7304 × 10−4
2.1170 × 10−4
1.7510
2.2
6.9125 × 10−4
2.1913 × 10−4
1.7888
2.4
7.1843 × 10−4
2.2411 × 10−4
1.8604
2.6
6.5686 × 10−4
2.2234 × 10−4
1.7744
2.8
6.4655 × 10−4
2.1186 × 10−4
1.7812
3
6.6445 × 10−4
2.1335 × 10−4
1.7949Figure 1
IMLS-Ritz and exact solutions ofu
(
x
,
t
) at N
=
2
1, Δ
t
=
0.1 (Example 1). (a) Solutions of u
(
x
,
t
); (b) absolute error.
(a)
(b)Figure 2
IMLS-Ritz solutions and absolute errors ofu
(
x
,
t
) at different times (Example 1). (a) Solution surface of u
(
x
,
t
); (b) absolute error contour.
(a)
(b)


## 4.2. Example2

In the present numerical example, we consider KG in (1) with a quadratic nonlinearity (k
=
2), by taking the parameters α
=
-
1, β
=
0, γ
=
1, and f
(
x
,
t
)
=
6
x
t
(
x
2
-
t
2
)
+
x
6
t
6. The initial conditions are described by(37)
u
x
,
0
=
0
,
0
≤
x
≤
1
,
u
t
x
,
0
=
0
,
0
≤
x
≤
1
.The exact solution of the equation is given as [1](38)
u
x
,
t
=
x
3
t
3
,
0
≤
x
≤
1
.The corresponding Dirichlet boundary function can be extracted from the analytical solution directly as(39)
u
x
,
t
=
0
x
=
0
t
3
x
=
1
.In this analysis, numerical solutions are predicted and compared with the analytical solutions att
=
1, Δ
t
=
0.01, d
m
a
x
=
2
.
2, and the penalty factor λ
=
1
0
3. Table 3 presents the convergence patterns of the IMLS-Ritz results by varying N from 6 to 101. A similar convergence trend is observed in Example 1; that is, convergent results can be obtained from N
=
6 to 21; then, the errors are accumulated as N increases. Table 4 illustrates the values of L
2-norm and L
∞ errors as d
m
a
x varying from 2 to 3.5. A growing trend of L
2-norm and L
∞ errors is observed from Table 4, and the CPU time rises oscillatory as d
m
a
x increases. As presented in Figure 3, the comparison study shows that the IMLS-Ritz method provides very similar solutions to the exact results. In Figure 4, the absolute errors of u
(
x
,
t
) at a selected time point (t
=
1) and the absolute error contour on a time period (0
≤
t
≤
1) are exhibited at N
=
2
1. Figure 5 is plotted at N
=
101 for comparison with Figure 4. Although the increase in number of nodes has been identified to be unaided in enhancing the accuracy of the approximation, it influences the smoothness of the solutions indeed.Table 3
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the number of nodes (N) for the solutions of Example  2 (t = 1, Δ
t = 0.1, and d
max
⁡ = 2.2).
N
L
2-norm error
L
∞ error
CPU time (s)
6
2.1937 × 10−2
1.7231 × 10−2
0.1081
21
3.3745 × 10−4
2.0891 × 10−4
0.2683
26
3.7023 × 10−4
1.6600 × 10−4
0.3275
51
5.1750 × 10−4
1.6589 × 10−4
0.6268
101
7.2991 × 10−4
1.6588 × 10−4
1.1983Table 4
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the d
max
⁡ for the solution of Example  2 (N = 11, t = 1, and Δ
t = 0.1).
d
max
⁡
L
2-norm error
L
∞ error
CPU time (s)
2
3.3081 × 10−4
2.1170 × 10−4
0.2637
2.2
3.3746 × 10−4
1.6616 × 10−4
0.2644
2.4
3.4597 × 10−4
1.6866 × 10−4
0.2754
2.6
3.7193 × 10−4
1.7459 × 10−4
0.2690
2.8
3.8596 × 10−4
1.8276 × 10−4
0.2686
3
3.8960 × 10−4
1.9179 × 10−4
0.2650
3.2
4.2300 × 10−4
1.999 × 10−4
0.2644
3.5
4.9035 × 10−4
2.3717 × 10−4
0.2819Figure 3
IMLS-Ritz and exact solutions ofu
(
x
,
t
) (Example 2). (a) Solutions of u
(
x
,
t
) at N
=
21, Δ
t
=
0.1; (b) solution surface of u
(
x
,
t
).
(a)
(b)Figure 4
Absolute errors ofu
(
x
,
t
) at N
=
21 (Example 2). (a) Absolute errors of u
(
x
,
t
) at Δ
t
=
0.1; (b) absolute errors contour.
(a)
(b)Figure 5
Absolute errors ofu
(
x
,
t
) at N
=
101 (Example 2). (a) Absolute errors of u
(
x
,
t
) at Δ
t
=
0.1; (b) absolute errors contour.
(a)
(b)


## 4.3. Example3

Consider the nonlinear Klein-Gordon equation (1) with a cubic nonlinearity (k
=
3), by taking parameters as α
=
-
2.5, β
=
1, γ
=
1.5, and f
(
x
,
t
)
=
0. The initial conditions are given by(40)
u
x
,
0
=
B
t
a
n
K
x
,
0
≤
x
≤
1
,
u
t
x
,
0
=
B
c
K
s
e
c
2
K
x
,
0
≤
x
≤
1
,where B
=
β
/
γ and K
=
-
β
/
2
(
α
+
c
2
) and c
=
0.05.The exact solution of the equation is given as [4](41)
u
x
,
t
=
B
t
a
n
K
x
+
c
t
,
0
≤
x
≤
1
.The IMLS-Ritz computation is carried out by settingΔ
t
=
0.1, the penalty factor λ
=
1
0
3, and d
m
a
x
=
2.5. The L
2-norm and L
∞ errors of u are computed with the number of nodes varied from 13 to 201. The results are tabulated in Table 5. It is apparent that both L
2-norm and L
∞ errors decrease as N increases, indicating that convergent results are obtained by the IMLS-Ritz method. From Table 6, the results of numerical analysis suggested that satisfied accuracy can be achieved when d
m
a
x
=
2. In Figure 6, the numerical and analytical solutions are plotted on a time point (t
=
2) and a time period (0
≤
t
≤
2). From the comparison results, we can conclude that the IMLS-Ritz method provides very similar solutions to the exact results. In Figures 7 and 8, the absolute errors of u
(
x
,
t
) at a selected time point (t
=
2) and the absolute error contour on a time period (0
≤
t
≤
1) are depicted at N
=
21 and N
=
201, respectively. As expected, more accurate results can be obtained as N increases in this example. From the results presented in both tables and figures, it is evident that the IMLS-Ritz values almost coincide with the exact solutions.Table 5
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the number of nodes (N) for the solutions of Example  3 (t = 2, Δ
t = 0.1, and d
max
⁡ = 2.5).
N
L
2-norm error
L
∞ error
CPU time (s)
13
1.9791 × 10−5
1.3049 × 10−5
447.3713
21
9.5355 × 10−6
5.7505 × 10−6
559.7717
51
2.8692 × 10−6
1.7171 × 10−6
600.6953
101
1.8512 × 10−6
1.3635 × 10−6
650.4551
126
1.4819 × 10−6
1.0907 × 10−6
687.4458
201
7.8596 × 10−7
5.3053 × 10−7
721.8184Table 6
Values ofL
2-norm errors and L
∞-norm errors and CPU time as functions of the d
max
⁡ for the solution of Example  3 (N = 11, t = 10, and Δ
t = 0.1).
d
max
⁡
L
2-norm error
L
∞ error
CPU time (s)
2
5.5466 × 10−6
3.4260 × 10−6
793.1491
2.2
1.8244 × 10−5
1.0416 × 10−5
826.7344
2.4
3.2447 × 10−5
1.8490 × 10−5
891.1543
2.6
4.5397 × 10−5
2.5715 × 10−5
945.6493
2.8
4.4504 × 10−5
2.6234 × 10−5
975.9027
3
2.7963 × 10−5
1.6959 × 10−5
1027.5762
3.2
3.2756 × 10−5
1.6014 × 10−5
1070.3232Figure 6
IMLS-Ritz and exact solutions ofu
(
x
,
t
) (Example 3). (a) Solutions of u
(
x
,
t
) at N
=
21, Δ
t
=
0.1; (b) solution surface of u
(
x
,
t
).
(a)
(b)Figure 7
Absolute errors ofu
(
x
,
t
) at N
=
21 (Example 3). (a) Absolute errors of u
(
x
,
t
) at Δ
t
=
0.1; (b) absolute errors contour.
(a)
(b)Figure 8
Absolute errors ofu
(
x
,
t
) at N
=
201 (Example 3). (a) Absolute errors of u
(
x
,
t
) at Δ
t
=
0.1; (b) absolute errors contour.
(a)
(b)


## 5. Conclusion

In this paper, an element-free IMLS-Ritz method and its numerical implementation on three examples of nonlinear KG equation have been presented. The effectiveness and efficiency of the IMLS-Ritz method for KG equation have been testified through convergence and comparison studies. From the numerical results, it is concluded that the agreement of the IMLS-Ritz solutions with the exact results is excellent. Due to difficulties of constructing analytical solutions for many nonlinear PDEs, the element-free IMLS-Ritz method will have great advantages for solving them through simple implementation with high accuracy.



---

*Source: 548905-2015-10-11.xml*