Next Article in Journal
Second-Order L1 Schemes for Fractional Differential Equations
Previous Article in Journal
Memory-Dependent Derivative Versus Fractional Derivative (III): Difference in Modeling Epidemics
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Computational Analysis of the Generalized Nonlinear Time-Fractional Klein–Gordon Equation Using Uniform Hyperbolic Polynomial B-Spline Method

1
College of Sciences, Shenyang University, Shenyang 110044, China
2
Department of Mathematics, University of Sargodha, Sargohd 40100, Pakistan
*
Authors to whom correspondence should be addressed.
Fractal Fract. 2025, 9(12), 815; https://doi.org/10.3390/fractalfract9120815
Submission received: 20 October 2025 / Revised: 2 December 2025 / Accepted: 9 December 2025 / Published: 12 December 2025

Abstract

This study presents an efficient numerical scheme for solving the generalized nonlinear time-fractional Klein–Gordon equation. The Caputo time-fractional derivative is discretized using a conventional finite-difference approach, while the spatial domain is approximated with uniform hyperbolic polynomial B-splines. These discretizations are coupled through the θ -weighted scheme. The uniform hyperbolic polynomial B-spline framework extends classical spline theory by incorporating hyperbolic functions, thereby enhancing flexibility and smoothness in curve and surface representations—features particularly useful for problems exhibiting hyperbolic characteristics. A rigorous stability and convergence analysis of the proposed method is provided. The effectiveness of the scheme is further validated through numerical experiments on benchmark problems. The results demonstrate up to two orders of magnitude improvement in L error norms compared to prior spline methods. This substantial accuracy enhancement highlights the robustness and efficiency of the proposed approach for fractional partial differential equations.

1. Introduction

Fractional differential equations provide a powerful tool for modeling complex systems with memory effects and anomalous diffusion. The nonlinear time-fractional Klein–Gordon equation (TFKGE) is a fundamental partial differential equation that arises in quantum field theory and relativistic quantum mechanics, describing the dynamics of scalar fields and particles. El-Dib et al. [1] applied the homotopy perturbation method to solve nonlinear TFKGE. Yang et al. [2] demonstrated the numerical solutions for nonlinear TFKGE involving the Caputo derivative using a spectral approach. Nagy [3] proposed a numerical scheme to solve nonlinear FKGE using the Sinc-Chebyshev collocation method. Dehghan et al. [4] conducted experiments to solve the nonlinear fractional Klein–Gordon equation and sine-Gordon equation using a finite-difference approach. Furthermore, Singh et al. [5] introduced a computational technique, Mulimani and Kumbinarasaiah [6] used numerical schemes for solving the TFKGE. Khan et al. [7] focused on stability analysis and the development of a numerical scheme. Liu et al. [8] explored the approximate solution through the Yang transform method. In addition to above-mentioned approaches, several analytical and numerical methods for the solving Klein–Gordon equations, using the ( G / G ) -expansion method [9], the modified double Laplace transform decomposition method [10], extended tanh-function method [11], separation of variables [12] and a finite-difference scheme based on the Hermite formula [13].
Consider the generalized time-fractional nonlinear Klein–Gordon equation with the non-negative coefficients:
λ u ( x , t ) t λ + μ 1 u ( x , t ) + μ 2 g ( u ( x , t ) ) = 2 u ( x , t ) x 2 + f ( x , t ) , λ ( 1 , 2 ) , x [ a , b ] , t 0 ,
subject to the initial conditions (ICs):
u ( x , 0 ) = ϕ 0 ( x ) , u ( x , 0 ) t = ϕ 1 ( x ) , x [ a , b ] ,
and the boundary conditions (BCs):
u ( a , t ) = ψ 0 ( t ) , u ( b , t ) = ψ 1 ( t ) , t 0 .
The term g ( u ( x , t ) ) introduces nonlinearity into the governing Equation (1), while f ( x , t ) represents source term or forcing term.
Definition 1
(Caputo Fractional Derivative). Let u ( x , t ) be a twice differentiable with respect to t, then the Caputo time-fractional derivative of order λ ( 1 < λ < 2 ) of u ( x , t ) with respect to t is defined as:
λ u ( x , t ) t λ = 1 Γ ( 2 λ ) 0 t 2 u ( x , s ) s 2 ( t s ) 1 λ d s ,
where Γ ( · ) is the Gamma function.
The Caputo fractional derivative (CFD) is a nonlocal operator that depends on values over the entire interval [ 0 , T ] . Its kernel ( s x ) 1 λ acts as a memory weight. Unlike the Riemann–Liouville fractional derivative, the Caputo formulation requires integer-order differentiability, making it better suited for physical problems with physically standard initial conditions. These properties are widely used in modeling anomalous diffusion, sub-diffusion, and wave–diffusion crossover phenomena in fractional PDEs. In numerical analysis, B-splines are a fundamental class of piecewise polynomial basis functions for their compact local support and high-order continuity. This technique is efficient and stable for solving complex problems, such as fractional differential equations. Vivas Cortez et al. [14] introduced the cubic B-spline, and Akram et al. [15] introduced an extended cubic B-spline for the approximation of nonlinear TFKGE. Amin et al. [16] proposed a redefined extended cubic B-spline-based numerical method for solving the TFKGE. Yassen et al. [17] applied a cubic trigonometric B-spline to approximate the solution of nonlinear TFKGE. Hepson et al. [18] proposed a numerical method for the Klein–Gordon equation using the exponential cubic B-spline collocation method. Siddiqi and Arshed [19] work highlighted the potential of quintic B-splines for solving complex nonlinear partial differential equations like the Good Boussinesq equation. Yassen et al. [20] presented a robust numerical method to solve the diffusion-wave equation that involved a time-fractional derivative using cubic trigonometric B-spline combined with a finite-difference scheme. The uniform hyperbolic polynomial B-splines (UHPBS) have recently emerged as a powerful tool for numerically solving differential equations. Lu et al. [21] explored the development of uniform hyperbolic polynomial B-spline curves in computer-aided geometric design. Manzoor et al. [22] presented a numerical scheme for solving the time-fractional diffusion-wave equation using UHPBS. Palav and Pradhan introduced a redefined fourth-order uniform hyperbolic polynomial B-splines collocation method for solving the advection-diffusion equation [23] and Burgers’ equation [24]. The radial basis function (RBF) method is a class of mesh-free techniques for numerical solving PDEs and fractional-order PDEs. Li et al. [25] introduced a transform-based localized RBF method combined with quadrature for solving the linear time-fractional Klein–Gordon equation. The spectral method is a numerical technique used for solving PDEs and fractional-order PDEs. Bansu and Kumar [26] presented an innovative spectral approach combining RBF and Chebyshev polynomials to solve the TFKGE. Chen et al. [27] proposed a fully discrete spectral method for solving the nonlinear time-fractional Klein–Gordon equation. An effective hybrid technique for solving fractional PDEs by accelerating the series solutions from the variational iteration method using multivariate Pade approximations was presented in [28]. Reddy [29] provided a clear foundation in functional analytic concepts used in modern numerical analysis. The text linked abstract theory with practical finite element formulations, offering key results on operator theroy with practical finite element formulations. Strikwerda’s book [30] systematically presented the construction, analysis and implementation of finite difference methods for partial differential equations.
Definition 2
(Cauchy–Schwarz Inequality). Let V be an inner product space with inner product · , · . For any vectors x , y V , the following inequality holds:
| x , y | x y ,
where · denotes the induced norm. Equality holds if and only if x and y are linearly dependent.
Definition 3
(Discrete Norm). The norm E n 2 is discrete approximation of the L 2 -norm over the spatial domain, defined as:
E n 2 = j = 1 M 1 h | E j n | 2 .
Definition 4
(Continuous Norm). The norm e n 2 is defined using the standard inner product over the continuous domain [ a , b ] :
u , v = a b u ( x ) v ( x ) d x , so that e n = e n , e n = a b | e n ( x ) | 2 d x .
This research aims to develop a computational method for solving the generalized nonlinear time-fractional Klein–Gordon Equation (1) using UHPBS. Stability and convergence analysis will show how well our proposed scheme is stable and convergent. We conducted a numerical experiment and compared the results with those found in previous reports. Additionally, graphical representations of the results are provided to illustrate the accuracy and behavior of the proposed method visually. These graphs highlight key trends, confirm the stability of the method, and emphasize its agreement with theoretical predictions. The comparison shows our proposed scheme is more accurate and efficient.
The fundamental research gap lies in the absence of a numerically efficient, unconditionally stable, and high-accuracy method that specifically addresses the mathematical structure of generalized nonlinear TFKGEs while maintaining computational practicality.
The UHPBS framework offers several advantages over other splines, such as exponential and trigonometric B-splines. While exponential B-splines excel in handling exponential behavior and trigonometric B-splines are effective for periodic problems, UHPBS provide a more balanced approach for equations with mixed hyperbolic polynomial characteristics. The incorporation of hyperbolic functions enables better capture of wave propagation phenomena inherent in the Klein–Gordon equation. Crucially, UHPBS preserve the fundamental advantages of classical B-splines, e.g., compact local support, C 2 continuity, and computational efficiency, while extending their applicability to problems with pronounced hyperbolic behavior.
The primary object of this research is the generalized nonlinear TFKGE, which extends the classical Klein–Gordon equation by incorporating fractional-order temporal derivatives. This generalization enables the modeling of complex physical phenomena with memory effects and anomalous diffusion characteristics that cannot be adequately captured by integer-order derivatives. The specific form considered in this work (Equation (1)) includes coefficients μ 1 and μ 2 , a general nonlinear term g ( u ( x , t ) ) , and an external forcing function f ( x , t ) making it applicable to a wide range of physical systems including quantum field theory, relativistic quantum mechanics and nonlinear wave propagation in complex media. The fractional derivative order λ ( 1 , 2 ) bridges the gap between diffusion and wave phenomena, with the Caputo formulation providing physically meaningful initial conditions compatible with standard physical interpretations.
The pattern of this paper is as follows: Section 2 introduces the numerical method based on uniform hyperbolic polynomial B-splines for the proposed equation. Section 3 discusses the stability of the proposed method to ensure that the numerical method behaves predictably, while Section 4 examines convergence analysis. Section 5 provides a comparative study of our numerical results with those reported in earlier studies. The paper concludes by highlighting key observations and findings in Section 6.

2. Derivation of the Scheme

In this section, we develop and analyze an efficient numerical scheme for solving Equation (1) by employing a θ -weighted temporal discretization combined with a uniform hyperbolic polynomial B-spline for spatial approximation. The complete derivation of the scheme is presented as follows:
Consider M and N to be positive integers defining the spatial and temporal step sizes as:
h = b a M , τ = T N ,
where h and τ represent the spatial and temporal step sizes, respectively. We partition the spatial domain [ a , b ] uniformly with grid points x j = a + j h for j = 0 , 1 , , M and the time interval [ 0 , T ] with t n = n τ for n = 0 , 1 , , N . The approximate solution at ( x j , t n ) is denoted by u j n . The spatial domain is divided into M sub-intervals [ x j , x j + 1 ] with equally spaced knots x j , where a = x 0 < x 1 < < x M 1 < x M = b . The approximate solution U ( x , t ) to analytical solution u ( x , t ) is expressed as:
U ( x , t ) = j = 3 M 1 Ω j ( t ) H j , 4 ( x ) ,
where H j , 4 (x) represents the fourth-order uniform hyperbolic polynomial (UHP) B-spline basis functions. The time-dependent unknown coefficients Ω j ( t ) are determined using the collocation method and boundary conditions. The uniform hyperbolic polynomial (UHP) B-spline basis, introduced by Lu et al. [21], extends the conventional B-splines by incorporating hyperbolic functions. The fourth-order UHP B-spline H j , 4 ( x ) is a piecewise-defined function with C 2 -continuity, ensuring proper handling of second-order spatial derivatives in Equation (1). It is defined as:
H j , 4 ( x ) = 1 p 1 sinh ( x x j ) ( x x j ) , x j x x j + 1 , 2 sinh ( x x j + 1 ) sinh ( x x j + 2 ) + ( 2 cosh ( h ) + 1 ) ( x x j + 1 ) h , x j + 1 x x j + 2 , sinh ( x x j + 2 ) + 2 sinh ( x x j + 3 ) ( 2 cosh ( h ) + 1 ) ( x x j + 2 ) + 2 h cosh ( h ) , x j + 2 x x j + 3 , sinh ( x x j + 4 ) + ( x x j + 4 ) , x j + 3 x x j + 4 ,
where p 1 = 2 h ( cosh ( h ) 1 ) . The set { H 3 , 4 , H 2 , 4 , , H M 2 , 4 , H M 1 , 4 } forms a basis over [ a , b ] . The local support property of UHP B-splines, only three basis functions H j 3 , 4 ( x ) , H j 2 , 4 ( x ) , and H j 1 , 4 ( x ) are non-zero at the grid point ( x j , t n ) . Thus, the approximate solution at the n-th time level is given by:
u ( x j , t n ) = u j n = i = j 1 j + 1 Ω i n H i 2 , 4 ( x j ) ,
where Ω j n are time-dependent, determined using initial and boundary conditions. From Equations (9) and (10), the approximate solution and its derivatives are expressed in terms of Ω j n as:
u j n = c 1 Ω j 1 n + c 2 Ω j n + c 1 Ω j + 1 n , ( u j n ) x = c 3 Ω j 1 n + c 3 Ω j + 1 n , ( u j n ) x x = c 4 Ω j 1 n + c 5 Ω j n + c 4 Ω j + 1 n ,
where the coefficients in Equation (11) are given by:
c 1 = sinh ( h ) h p 1 , c 2 = 2 ( sinh ( h ) h cosh ( h ) ) p 1 , c 3 = 1 2 h , c 4 = sinh ( h ) p 1 , c 5 = 2 sinh ( h ) p 1 .
The Caputo time-fractional derivative in Equation (1) is discretized using a finite-difference (central-difference) approach, while the spatial derivatives are approximated using UHP B-splines. The fractional derivative λ u ( x , t ) t λ is discretized according to the approximation given by Yaseen et al. [20]:
λ u ( x , t n + 1 ) t λ = α k = 0 n w k ( u ( x , t n k + 1 ) 2 u ( x , t n k ) + u ( x , t n k 1 ) ) + r τ n + 1 , = α k = 0 n w k u n k + 1 2 u n k + u n k 1 + r τ n + 1 ,
where u n = u ( x , t n ) , α = 1 τ λ Γ [ 3 λ ] , w k = ( k + 1 ) 2 λ k 2 λ and r τ n + 1 is the truncation error.
r τ n + 1 = C u τ 3 λ ,
where C u is a constant independent of τ . The weights w k satisfy the following properties:
  • w k > 0 , k = 0 , 1 , , n ,
  • 1 = w 0 > w 1 > w 2 > > w n and w n 0 as n ,
  • k = 0 n 1 ( w k w k + 1 ) + w n = 1 .
This approximation is derived by applying a finite-difference scheme to the second derivative within the integral definition of the Caputo derivative, Equation (4). The semi-discrete approximation of Equation (1) is obtained through a θ -weighted temporal discretization is given by:
α k = 0 n w k u n k + 1 2 u n k + u n k 1 + θ μ 1 u n + 1 ( u x x ) n + 1 + ( 1 θ ) μ 1 u n ( u x x ) n + μ 2 g ( u n ) = f n + 1 .
For the case θ = 1 2 , the discretization of scheme Equation (15) reduced to Crank–Nicolson formulation:
α + μ 1 2 u n + 1 1 2 ( u x x ) n + 1 = 2 α μ 1 2 u n α u n 1 + 1 2 ( u x x ) n μ 2 g ( u n ) α k = 1 n w k u n k + 1 2 u n k + u n k 1 + f n + 1 .
When evaluating Equation (16) at the initial time step n = 0 or k = n , the numerical scheme requires the value of u 1 , which is calculated using the initial condition Equation (2):
u t 0 = u 1 u 1 2 τ u 1 = u 1 2 τ u t 0 u 1 = u 1 2 τ ϕ 1 ( x ) .
Substituting the approximation Equation (11) into the discretized scheme Equation (16) leads to the following block-tridiagonal linear system:
α + μ 1 2 c 1 c 4 2 Ω j 1 n + 1 + Ω j + 1 n + 1 + α + μ 1 2 c 2 c 5 2 Ω j n + 1 = 2 α μ 1 2 × c 1 ( Ω j 1 n + Ω j + 1 n ) + c 2 Ω j n α c 1 ( Ω j 1 n 1 + Ω j + 1 n 1 ) + c 2 Ω j n 1 + 1 2 c 4 ( Ω j 1 n + Ω j + 1 n ) + c 5 Ω j n μ 2 g c 1 ( Ω j 1 n + Ω j + 1 n ) + c 2 Ω j n α k = 1 n w k [ ( c 1 Ω j 1 n k + 1 + c 2 Ω j n k + 1 + c 1 Ω j + 1 n k + 1 ) 2 ( c 1 Ω j 1 n k + c 2 Ω j n k + c 1 Ω j + 1 n k ) + ( c 1 Ω j 1 n k 1 + c 2 Ω j n k 1 + c 1 Ω j + 1 n k 1 ) ] + f j n + 1 .
Due to the discretization over the spatial domain j = 0 , 1 , , M , the scheme Equation (17) generates ( M + 1 ) equations involving ( M + 3 ) unknowns coefficients. To obtain a unique solution, we incorporate the boundary conditions Equation (3):
c 1 Ω 3 n + 1 + c 2 Ω 2 n + 1 + c 1 Ω 1 n + 1 = ψ 0 ( t n + 1 ) , c 1 Ω M 3 n + 1 + c 2 Ω M 2 n + 1 + c 1 Ω M 1 n + 1 = ψ 1 ( t n + 1 ) .
This leads to a well-posed linear algebraic system of size ( M + 3 ) × ( M + 3 ) , characterized by sparse and structured matrices. The resulting system can be efficiently solved using numerical techniques such as Gauss elimination. The boundary conditions ψ 0 ( t ) and ψ 1 ( t ) are explicitly incorporated into the block-tridiagonal system through Equation (18). These equations directly constrain the boundary coefficients Ω 3 n + 1 , Ω 2 n + 1 , Ω 1 n + 1 at x = a and Ω M 3 n + 1 , Ω M 2 n + 1 , Ω M 1 n + 1 at x = b . In the nonlinear case, the boundary enforcement remains exact at each time step, as the boundary conditions are applied directly to the coefficient vector rather than through the nonlinear terms. This ensures that the numerical solution strictly satisfies the prescribed boundary conditions throughout the temporal evolution, regardless of the nonlinearity in g ( u ( x , t ) ) .

2.1. Initial Vector Calculation

To commence computations using the scheme in Equation (17), we initialize with n = 0 to obtain the first vector Ω j 1 . This required the initial vector. We need Ω j 0 to start the computation. The initial vector D 0 = [ Ω 3 0 , Ω 2 0 , , Ω M 2 0 , Ω M 1 0 ] T is determined through the initial conditions:
u x ( x 0 , 0 ) = ϕ 0 ( x 0 ) , u ( x i , 0 ) = ϕ 0 ( x i ) , i = 0 , 1 , 2 , , M , u x ( x M , 0 ) = ϕ 0 ( x M ) .
This leads to the ( M + 3 ) × ( M + 3 ) linear system:
c 3 0 c 3 0 0 0 c 1 c 2 c 1 0 0 0 0 0 0 c 1 c 2 c 1 0 0 0 c 3 0 c 3 Ω 3 0 Ω 2 0 Ω M 2 0 Ω M 1 0 = ϕ 0 ( x 0 ) ϕ 0 ( x 0 ) ϕ 0 ( x M ) ϕ 0 ( x M ) .
The system matrix of Equation (20) maintain a sparse, banded structure with specific coefficient c 1 , c 2 and c 3 determined by the UHP B-spline. The solution of Equation (20) provides an initial vector D 0 . Equation (17) is iterated to find D 1 , D 2 etc.

2.2. Computational Algorithm

The computational workflow of the proposed method is outlined in Figure 1. The implementation begins with initializes the computational parameters including a, b, M, T and N, also the positive coefficients μ 1 and μ 2 . Adjust the fractional-order value. Furthermore, the spatial and temporal domains are uniformly partitioned with step sizes h = ( b a ) / M and τ = T / N . The yellow boxes involve constructing uniform hyperbolic polynomial B-spline basis functions, computing the initial coefficient vector D 0 by solving the system in Equation (20) using the prescribed initial conditions, and iteratively determining the solution vector at each time level until reaching the final time step. Finally, reconstructs the numerical solution using the obtained coefficient vector and the B-spline expansion given in Equation (8).

3. Stability Analysis

In this section, we establish the stability analysis of the proposed numerical scheme for solving Equation (17). The analysis is conducted under the following assumptions:
  • The nonlinear term g ( u ) is linearized as g ( u ) = c u , where c is a constant, following the approach of [19].
  • The source term is neglected ( f = 0 ) by invoking Duhamel’s principle, which allows superposition of homogeneous solutions [30].
Under these assumptions, the discretized scheme reduces to:
α + μ 1 2 c 1 c 4 2 Ω j 1 n + 1 + Ω j + 1 n + 1 + α + μ 1 2 c 2 c 5 2 Ω j n + 1 = 2 α μ 1 2 × c 1 ( Ω j 1 n + Ω j + 1 n ) + c 2 Ω j n α c 1 ( Ω j 1 n 1 + Ω j + 1 n 1 ) + c 2 Ω j n 1 + 1 2 c 4 ( Ω j 1 n + Ω j + 1 n ) + c 5 Ω j n c μ 2 c 1 ( Ω j 1 n + Ω j + 1 n ) + c 2 Ω j n α k = 1 n w k [ ( c 1 Ω j 1 n k + 1 + c 2 Ω j n k + 1 + c 1 Ω j + 1 n k + 1 ) 2 ( c 1 Ω j 1 n k + c 2 Ω j n k + c 1 Ω j + 1 n k ) + ( c 1 Ω j 1 n k 1 + c 2 Ω j n k 1 + c 1 Ω j + 1 n k 1 ) ] .
Equation (21) can be systematically simplified by grouping terms at different time levels. The nonlinear term c μ 2 ( c 1 ( Ω j 1 n + Ω j + 1 n ) + c 2 Ω j n ) combines with the existing coefficient ( 2 α μ 1 2 ) to yield the consolidated coefficient ( 2 α μ 1 2 c μ 2 ) in Equation (22). Consequently, we obtain:
α + μ 1 2 c 1 c 4 2 Ω j 1 n + 1 + Ω j + 1 n + 1 + α + μ 1 2 c 2 c 5 2 Ω j n + 1 = 2 α μ 1 2 + c μ 2 × c 1 ( Ω j 1 n + Ω j + 1 n ) + c 2 Ω j n α c 1 ( Ω j 1 n 1 + Ω j + 1 n 1 ) + c 2 Ω j n 1 + 1 2 c 4 ( Ω j 1 n + Ω j + 1 n ) + c 5 Ω j n α k = 1 n w k [ ( c 1 Ω j 1 n k + 1 + c 2 Ω j n k + 1 + c 1 Ω j + 1 n k + 1 ) 2 ( c 1 Ω j 1 n k + c 2 Ω j n k + c 1 Ω j + 1 n k ) + ( c 1 Ω j 1 n k 1 + c 2 Ω j n k 1 + c 1 Ω j + 1 n k 1 ) ] .
Let ρ j n denote the exact solution and ρ ˜ j n its numerical approximation. The error E j n = ρ j n ρ ˜ j n satisfies:
α + μ 1 2 c 1 c 4 2 E j 1 n + 1 + E j + 1 n + 1 + α + μ 1 2 c 2 c 5 2 E j n + 1 = 2 α μ 1 2 + c μ 2 × c 1 ( E j 1 n + E j + 1 n ) + c 2 E j n α c 1 ( E j 1 n 1 + E j + 1 n 1 ) + c 2 E j n 1 + 1 2 c 4 ( E j 1 n + E j + 1 n ) + c 5 E j n α k = 1 n w k [ ( c 1 E j 1 n k + 1 + c 2 E j n k + 1 + c 1 E j + 1 n k + 1 ) 2 ( c 1 E j 1 n k + c 2 E j n k + c 1 E j + 1 n k ) + ( c 1 E j 1 n k 1 + c 2 E j n k 1 + c 1 E j + 1 n k 1 ) ] .
The boundary conditions are given by:
E 0 n = ψ 0 ( t k ) , E M n = ψ 1 ( t k ) , n = 0 , 1 , , N ,
and the initial conditions are:
E j 0 = ϕ 0 ( x j ) , ( E t ) j 0 = ϕ 1 ( x j ) , j = 1 , 2 , , M .
Define the grid function:
E n ( x ) = E j n , x x j h 2 , x j + h 2 , j = 1 , , M 1 , 0 , x a , a + h 2 b h 2 , b .
Expand E n ( x ) in Fourier series as:
E n ( x ) = m = ξ n ( m ) e i 2 π m x b a , n = 0 , 1 , , N ,
where ξ n ( m ) = 1 b a a b E n ( x ) e i 2 π m x b a d x . Let E n = E 1 n E 2 n E M 1 n T . The L 2 -norm on E n is:
E n 2 = j = 1 M 1 h | E j n | 2 1 2 = a b | E n ( x ) | 2 d x 1 2 .
By Parseval’s identity:
a b | E n ( x ) | 2 d x = m = | ξ n ( m ) | 2 .
we have
E n 2 2 = m = | ξ n ( m ) | 2 .
Assume a solution of the form E j n = η n e i β j s ( β [ π , π ] ) . Substituting into Equation (23) and dividing by e i β j s , we obtain:
α + μ 1 2 c 1 c 4 2 e i β s + e i β s + α + μ 1 2 c 2 c 5 2 η n + 1 = 2 α μ 1 2 + c μ 2 × c 1 e i β s + e i β s + c 2 η n α c 1 e i β s + e i β s + c 2 η n 1 + 1 2 c 4 e i β s + e i β s + c 5 η n α k = 1 n w k c 1 e i β s + e i β s + c 2 η n k + 1 2 η n k + η n k 1 .
By applying the Euler identity e i θ + e i θ = 2 cos ( θ ) to the terms e i β s and e i β s and subsequently collecting the coefficients of like terms, we derive the simplified expression:
α + μ 1 2 c 1 c 4 2 cos ( β s ) + α + μ 1 2 c 2 c 5 2 2 c 1 cos ( β s ) + c 2 η n + 1 = 2 α μ 1 2 μ 2 c η n α η n 1 + 2 c 4 cos ( β s ) + c 5 2 ( 2 c 1 cos ( β s ) + c 2 ) η n α k = 1 n w k η n k + 1 2 η n k + η n k 1 ,
the above equation reduces to:
ζ η n + 1 = 2 α μ 1 2 μ 2 c + 2 c 4 cos ( β s ) + c 5 2 ( 2 c 1 cos ( β s ) + c 2 ) η n α η n 1 α k = 1 n w k η n k + 1 2 η n k + η n k 1 ,
which further simplifies to:
η n + 1 = d ζ η n α ζ η n 1 α ζ k = 1 n w k ( η n k + 1 2 η n k + η n k 1 ) ,
where d = 2 α μ 1 2 μ 2 c + 2 c 4 cos ( β s ) + c 5 2 ( 2 c 1 cos ( β s ) + c 2 ) and ζ = α + μ 1 2 2 c 4 cos ( β s ) + c 5 2 ( 2 c 1 cos ( β s ) + c 2 ) . Note that ζ 1 .
Proposition 1.
For the solution η n of Equation (27) with n = 0 , 1 , 2 , , N , there exists a constant D = | d | 2 such that the following inequality holds: | η n | D | η 0 | for all n 0 .
Proof. 
Using mathematical induction) Initial step ( n = 0 ):
Substituting n = 0 in Equation (27) yields:
| η 1 | = | d η 0 ζ | | d η 0 | | d | | η 0 | | d | 2 | η 0 | = D | η 0 | , ( ζ 1 ) .
Induction: Assume | η k | D | η 0 | for k n . Then from Equation (27), we obtain:
| η n + 1 | | d | | η n | ζ | α | ζ | η n 1 | | α | ζ k = 1 n w k | η n k + 1 | 2 | η n k | + | η n k 1 | , | d | | η n | α | η n 1 | α k = 1 n w k | η n k + 1 | 2 | η n k | + | η n k 1 | , | d | 2 | η 0 | α | d | | η 0 | α | d | k = 1 n w k | η 0 | 2 | η 0 | + | η 0 | , | d | 2 | η 0 | = D | η 0 | ,
using the fact that the inequality | | a | | b | | | a b | holds for all a , b R . Hence,
| η n | D | η 0 | for n = 0 , 1 , , N .
The proof is complete. □
Theorem 1.
The numerical scheme Equation (17) is unconditionally stable.
Proof. 
Using Proposition 1 into the Parseval’s identity Equation (26), we have:
E n 2 2 = m = | ξ n ( m ) | 2 D m = | ξ 0 ( m ) | 2 = D E 0 2 2 .
confirming the unconditional stability of the scheme. □

4. Convergence Analysis

In this section, we analyze the convergence of the proposed scheme Equation (17), establishing precise error estimates. Our results demonstrate that the method achieves significantly higher accuracy compared to conventional discretization techniques.

4.1. Temporal Convergence Analysis

Beginning with ( f = 0 ) in Equation (15), we convert it to homogeneous form and express the summation term as:
k = 0 n w k u n k + 1 2 u n k + u n k 1 = u n + 1 u n + w n u 1 w n u 0 + k = 0 n 1 ( w k + 1 w k ) ( u n k u n k 1 ) 2 w n τ ϕ 1 ( x ) .
Substituting Equation (29) into the homogeneous form of Equation (15) and considering the nonlinear term g ( u ) = c u , where c is constant, with θ = 1 2 yields:
α + μ 1 2 u n + 1 1 2 ( u x x ) n + 1 = α μ 1 2 c μ 2 u n + 1 2 ( u x x ) n α w n u 1 + α w n u 0 α k = 0 n 1 ( w k + 1 w k ) ( u n k u n k 1 ) 2 α w n τ ϕ 1 ( x ) .
Theorem 2.
Let { u ( x , t n ) } n = 0 N 1 denote the exact solution of problem Equation (1) subject to the initial and boundary conditions are given in Equations (2) and (3), and let { u n } n = 0 N 1 represent the corresponding numerical solution obtained via the scheme in Equation (30). Then, the numerical error E n + 1 = u ( x , t n + 1 ) u n + 1 satisfies the following error bound:
e n + 1 C τ 3 λ ,
where C > 0 is a constant independent of the time step τ.
Proof. 
The exact solution u satisfies the semi-discrete scheme Equation (30) up to the truncation error r τ n + 1 :
α + μ 1 2 u ( x , t n + 1 ) 1 2 ( u ( x , t n + 1 ) ) x x = α μ 1 2 c μ 2 u ( x , t n ) + 1 2 ( u ( x , t n ) ) x x α w n u ( x , t 1 ) + α w n u ( x , t 0 ) α k = 0 n 1 ( w k + 1 w k ) ( u ( x , t n k ) u ( x , t n k 1 ) ) 2 α w n τ ϕ 1 ( x ) + r τ n + 1 .
Subtracting Equation (30) from Equation (32) gives the error equation:
α + μ 1 2 E n + 1 1 2 ( E x x ) n + 1 = α μ 1 2 c μ 2 E n + 1 2 ( E x x ) n α w n E 1 + α w n E 0 α k = 0 n 1 ( w k + 1 w k ) ( E n k E n k 1 ) + r τ n + 1 .
With E 0 = 0 , taking the inner product with E n + 1 yields:
α + μ 1 2 E n + 1 2 = 1 2 ( E x x ) n + 1 , E n + 1 + α μ 1 2 c μ 2 E n , E n + 1 + 1 2 ( E x x ) n , E n + 1 α w n E 1 , E n + 1 α k = 1 n ( w k + 1 w k ) E n k , E n + 1 E n k 1 , E n + 1 + r τ n + 1 , E n + 1 , = 1 2 ( E n + 1 ) x 2 + α μ 1 2 c μ 2 E n , E n + 1 1 2 ( E n ) x 2 α w n E 1 , E n + 1 α k = 1 n ( w k + 1 w k ) E n k , E n + 1 E n k 1 , E n + 1 + r τ n + 1 , E n + 1 , α μ 1 2 c μ 2 E n , E n + 1 α w n E 1 , E n + 1 α k = 0 n 1 ( w k + 1 w k ) E n k , E n + 1 E n k 1 , E n + 1 + r τ n + 1 , E n + 1 ,
where we have used u x x , u = u x , u x from the [29] with the property ( E n + 1 ) x 2 0 . Applying the Cauchy–Schwarz inequality x , y x y , we obtain:
α + μ 1 2 E n + 1 2 α μ 1 2 c μ 2 E n E n + 1 α w n E 1 E n + 1 α k = 0 n 1 ( w k + 1 w k ) E n k E n + 1 E n k 1 E n + 1 + r τ n + 1 E n + 1 .
Dividing the above equation by E n + 1 gives:
α + μ 1 2 E n + 1 α μ 1 2 c μ 2 E n α w n E 1 α k = 0 n 1 ( w k + 1 w k ) ( E n k E n k 1 ) + r τ n + 1 .
We prove this using mathematical induction. For the base case ( n = 0 ) :
α + μ 1 2 E 1 r τ 1 , E 1 1 α + μ 1 2 r τ 1 , E 1 C 0 τ 3 λ , where C 0 is a constant independent of τ .
Now assume the induction hypothesis hold for n = q 1 then E q C τ 3 λ , where C a is constant independent of τ .
For n = q , we have:
α + μ 1 2 E q + 1 α μ 1 2 c μ 2 E q α w q E 1 α k = 0 q 1 ( w k + 1 w k ) ( E q k E q k 1 ) + r τ q + 1 .
Let E 1 C 1 τ 3 λ , F = max 0 i q E i C 2 τ 3 λ and G = max 0 k q { E q k E q k 1 } C 3 τ 3 λ . where C 1 , C 2 and C 3 are constant independent of τ .
α + μ 1 2 E q + 1 α μ 1 2 c μ 2 C 2 τ 3 λ α w q C 1 τ 3 λ + α ( 1 w n ) C 3 τ 3 λ + C u τ 3 λ , [ α μ 1 2 c μ 2 C 2 α w q C 1 + α ( 1 w n ) C 3 + C u ] C a n s t a n t τ 3 λ .
Note that the constant term is independent of τ . Hence:
E q + 1 C τ 3 λ .
This completes the proof. □

4.2. Spatial-Convergence Analysis

For the spatial-convergence analysis, we use the methodology given in [22] to investigate the convergence of the proposed numerical scheme. We begin with the following fundamental convergence theorem:
Lemma 1.
The set { H j , 4 } j = 3 M 1 of uniform hyperbolic polynomial B-spline basis functions of order 4 satisfies the uniform bound:
j = 3 M 1 H j , 4 ( x ) K , x [ a , b ] ,
where K is a positive constant independent of the mesh size h and position x, and the coefficients satisfy the normalization condition 2 c 1 + c 2 = 1 .
The proof follows from the compact support and non-negative properties of the B-spline basis function. Detailed arguments can be found in [22].
Theorem 3.
Let u ( x , t ) C 4 [ a , b ] × C 2 [ 0 , ) be sufficiently smooth. For a uniform partition χ = { a = x 0 < < x M = b } with x j = a + j h , h = ( b a ) / M , let U ˜ ( x , t ) be the hyperbolic B-spline interpolant of u ( x , t ) at the knots { x j } . Then there exist constants ρ j > 0 independent of h such that:
D j ( u U ˜ ) ρ j h 4 j , j = 0 , 1 , 2 ,
where D j denotes the j-th order spatial derivative.
Remark 1.
While Theorem 3 establishes the O ( h 4 ) approximation power of the UHPBS interpolant itself, the overall numerical method’s spatial-convergence rate is limited by the second-order truncation error of the collocation scheme. This distinction arises because the spline interpolation error represents the best-case approximation capability of the basis functions, while the numerical scheme’s convergence rate incorporates additional factors, including the temporal discretization, collocation error, and treatment of nonlinear terms. The O ( h 2 ) spatial convergence observed in our numerical experiments aligns with the theoretical prediction of Theorem 4 and reflects the dominant second-order error from the finite-difference temporal discretization and collocation formulation.
Theorem 4.
The numerical solution U ( x , t ) converges to the exact solution u ( x , t ) of the nonlinear TFKG equation. Moreover, if q C 2 [ a , b ] , then there exists a constant ρ ˜ > 0 , independent of h, such that for all t 0 :
u ( x , t ) U ( x , t ) ρ ˜ h 2 ,
provided the spatial step size h is sufficiently small.
Proof. 
Decompose the error using the interpolant U ˜ ( x , t ) = j = 3 M 1 d j ( t ) H j , 4 ( x ) :
u U u U ˜ Interpolation error + U ˜ U Discretization error .
From Theorem 3 with j = 0 :
u U ˜ ρ 0 h 4 .
For the discretization error E ( x , t ) = U ˜ U , consider the collocation equations:
L u ( x j , t ) = f ( x j , t ) , L U ˜ ( x j , t ) = f ( x j , t ) + τ j ( t ) ,
where τ j is the spatial truncation error satisfying τ j C τ h 2 due to the approximation properties of the B-splines. The error equation at spatial nodes is:
α + μ 1 2 ( 2 c 1 + c 2 ) 1 2 ( 2 c 4 + c 5 ) E j n + 1 = 2 α μ 1 2 μ 2 c 2 c 1 + c 2 E j n α 2 c 1 + c 2 E j n 1 + 1 2 ( 2 c 4 + c 5 ) E j n α k = 1 n w k Δ 2 E j n k + τ j n + 1 ,
where Δ 2 E j m = E j m + 1 2 E j m + E j m 1 and τ j n + 1 C τ h 2 . Using 2 c 1 + c 2 = 1 and 2 c 4 + c 5 = 0 , and defining Γ = α + μ 1 2 > 0 :
Γ E n + 1 2 α μ 1 2 μ 2 c E n + α E n 1 + α k = 1 n w k Δ 2 E n k + C τ h 2 .
Base Case ( n = 0 ):
Γ E 1 C τ h 2 E 1 C τ Γ h 2 .
Inductive Step: Assume E k ρ h 2 for k n . Then:
Γ E n + 1 2 α μ 1 2 μ 2 c + α + 4 α k = 1 n w k ρ h 2 + C τ h 2 .
Since k = 1 n w k W by the properties of w k , we obtain:
E n + 1 ( 3 α μ 1 / 2 μ 2 c + 4 α W ) ρ + C τ Γ h 2 .
Choosing ρ large enough so that ( 3 α + β + 4 α W ) Γ ρ + C τ Γ ρ yields uniform boundedness. By Lemma 1 and the boundedness of the basis:
U ˜ U K ρ h 2 .
Combining Equations (40) and (43):
u U ρ 0 h 4 + K ρ h 2 ρ ˜ h 2 ,
where ρ ˜ = ρ 0 h 0 2 + K ρ for h < h 0 , completing the proof. □

5. Numerical Experiments

In this section, we evaluate the performance of our proposed numerical scheme through comprehensive tests on both linear and nonlinear time-fractional Klein–Gordon equations. Additionally, we examine a standard (non-fractional) Klein–Gordon equation. To validate our method, we conduct comparisons with the following existing schemes in the literature are Sinc-Chebyshev collocation method [3], implicit radial basis function meshless approach [4], cubic trigonometric B-spline method [17], and radial basis functions and Chebyshev polynomials technique [26]. The accuracy and convergence properties are quantitatively assessed using the following error metrics:
Definition 5
(Absolute Error). The absolute error at a discrete grid point ( x j , t n ) is the non-negative magnitude of the difference between the exact solution u ( x j , t n ) and the numerical approximation U j n . Mathematically, it is defined as:
E a b s = | u ( x j , t n ) U j n | .
Definition 6
(Maximum Norm Error L ). The L error norm is the maximum value of absolute error in a grid point ( x j , t n ) is defined as:
L = max 0 j M | u ( x j , t n ) U j n | .
Definition 7
(Discrete L 2 Norm Error). The L 2 error norm measures the root-mean-square deviation between the exact solution u ( x j , t n ) and the numerical solution U j n over the computational domain at time t n . It is defined as:
L 2 = h j = 0 M | u ( x j , t n ) U j n | 2 1 / 2 .
Definition 8
(Root Mean Square). The root-mean-square (RMS) error between the exact solution and its numerical approximation evaluated at M + 1 discrete points x i , is defined as:
RMS = 1 M + 1 i = 0 M u ( x j , t n ) U j n 2 .
Definition 9
(Convergence Rate). Let E ( h , τ ) be the error for spatial and temporal step sizes h and τ. The rate of convergence in the spatial and temporal domains:
p ( h , τ ) = log 2 E ( 2 h , 2 τ ) E ( h , τ ) .
For the numerical implementation in this study, we employed Python 3.12.2 as the primary programming environment. The computations were performed with the aid of scientific libraries, including NumPy for numerical operations, SciPy for scientific computing, and Matplotlib for graphical visualization. All simulations were executed on a Windows 11 pro (64-bit) workstation equipped with an Intel Core i7 processor and 32 GB of system memory.
Example 1.
Consider the nonlinear TFKGE (1) with coefficients μ 1 = 0 , μ 2 = 1 :
λ u ( x , t ) t λ + g ( u ( x , t ) ) = 2 u ( x , t ) x 2 + f ( x , t ) , ϕ 0 ( x ) = 0 , ϕ 1 ( x ) = 0 , 0 x 1 , ψ 0 ( t ) = t 3 2 , ψ 1 ( t ) = 0 , t 0 , f ( x , t ) = Γ 5 2 Γ 5 2 λ ( 1 x ) 5 2 t 3 2 λ 15 4 ( 1 x ) 1 2 t 3 2 + g ( u ( x , t ) ) , u ( x , t ) = ( 1 x ) 5 2 t 3 2 , g ( u ( x , t ) ) = u ( x , t ) 2 .
The proposed scheme in Equation (17) is used to compute the numerical solution. A detailed comparison between the exact and numerical solutions is presented to assess the accuracy of the method. Figure 2 shows the 3D visualizations of the numerical solution (a) and the exact solution (b) at t = 1 for λ = 1.5 . Figure 3 shows the absolute error distribution and the corresponding heat map. Figure 4 compares solutions at three different time levels for λ = 1.5 , demonstrating the temporal behavior of the method. Figure 5 displays the 2D error profiles, identifying regions of maximum deviation. Table 1 and Table 2 present an absolute error comparison with those obtained using Nagy’s method [3]. Table 3 presents the numerical solutions with temporal and spatial step sizes τ = 0.01 and h = 0.02 for various values of λ . The convergence rates presented in Table 4 demonstrate excellent agreement between the numerical experiments and theoretical predictions for both spatial and temporal domains. This strong correspondence validates the robustness of our numerical scheme and confirms its expected convergence behavior. The absolute error and required computational time for various mesh sizes are reported in Table 5.
Example 2.
Consider the nonlinear TFKGE (1) with coefficients μ 1 = 1 and μ 2 = 3 2 :
λ u ( x , t ) t λ + u ( x , t ) + 3 2 g ( u ( x , t ) ) = 2 u ( x , t ) x 2 + f ( x , t ) , ϕ 0 ( x ) = 0 , ϕ 1 ( x ) = 0 , 0 x 1 , ψ 0 ( t ) = 0 , ψ 1 ( t ) = 0 , t 0 , f ( x , t ) = Γ ( 3 + γ ) 2 sin ( π x ) t 2 + ( 1 + π 2 ) sin ( π x ) t 2 + λ + 3 2 g ( u ( x , t ) ) , u ( x , t ) = sin ( π x ) t λ + 2 , g ( u ( x , t ) ) = u ( x , t ) 3 .
The numerical solution is computed using the scheme in Equation (17). To evaluate the accuracy of the proposed method, the results are presented in tabulated form and compared with existing schemes from the literature. Figure 6 displays a 3D plot of the numerical and exact solutions at t = 1 for λ = 1.5 . The 3D absolute surface and the corresponding heat map are presented in Figure 7. Figure 8 compares the numerical and exact solutions at three different time levels for λ = 1.5 . Figure 9 presents a 2D plot of the absolute error, highlighting the variation in error magnitudes across the domain. This visualization effectively demonstrates the accuracy of the proposed model. The numerical results are summarized in Table 6, Table 7, Table 8, Table 9, Table 10 and Table 11. Specifically, Table 6 compares absolute errors of the proposed method with the Sinc-Chebyshev method for λ = 1.5 and t = 1 , demonstrating improved accuracy with finer discretization. Table 7 analyzes absolute errors and computational times for varying spatial mesh sizes with fixed t a u = 0.005 and λ = 1.5 . Table 8 extends the comparison to λ = 1.7 , showing consistent performance of the proposed method. Table 9 presents approximate solutions for different λ values at t = 1 , highlighting the method’s versatility. Table 10 and Table 11 detail temporal and spatial-convergence rates, respectively, confirming the method’s stability and efficiency.
Example 3.
Consider the nonlinear TFKGE (1) with μ 1 = 0 and μ 2 = 1 :
λ u ( x , t ) t λ + g ( u ( x , t ) ) = 2 u ( x , t ) x 2 + f ( x , t ) , ϕ 0 ( x ) = 0 , ϕ 1 ( x ) = 0 , 0 x 1 , ψ 0 ( t ) = 0 , ψ 1 ( t ) = t 2 sin ( 1 ) , t 0 , f ( x , t ) = Γ ( 3 + γ ) 2 sin ( π x ) t 2 + ( 1 + π 2 ) sin ( π x ) t 2 + λ + 3 2 g ( u ( x , t ) ) , u ( x , t ) = t 2 s i n ( x ) , g ( u ( x , t ) ) = sin ( u ( x , t ) ) .
The numerical solution is computed using the proposed scheme in Equation (17). Figure 10 presents the 3D error comparison between the exact and numerical solutions for λ = 1.5 at t = 1 , while Figure 11 illustrates the 3D absolute error surface and the related heat map. Figure 12 compares the numerical and exact solutions at three different time levels for λ = 1.5 . Figure 13 depicts a 2D plot of the absolute error, showing the distribution of error magnitudes across the domain. This provides a clear visualization of the model’s accuracy and highlights the regions with the largest deviations. The numerical performance for Example 3 is detailed in Table 12, Table 13, Table 14, Table 15 and Table 16. Table 12 compares the L errors of the proposed method with the implicit RBF meshless approach and CTBS method for varying time steps τ , fixed spatial step h = 0.02 at t = 1 and λ = 1.15 , demonstrating superior accuracy of the proposed scheme. Table 13 analyzes absolute errors and computational times for different spatial mesh sizes with fixed time step τ = 0.001 and fractional order λ = 1.5 . Table 14 presents the temporal convergence rate for λ = 1.5 and λ = 1.75 with varying τ and fixed h = 0.02 . Table 15 investigates spatial-convergence rates for λ = 1.5 and λ = 1.75 with fixed τ = 0.0005 , confirming the method’s spatial accuracy. Table 16 lists numerical solutions at t = 1 for different fractional orders λ .
Remark 2.
“In Table 15, the temporal convergence rate p τ is observed to be slightly higher than the theoretical 3 λ = 1.5 . This is a common and expected artifact. As τ becomes very small, the total error becomes dominated by the fixed spatial discretization error (from h = 0.02 ), which can lead to fluctuations in the computed rate”.

Discussion of Convergence Rate Anomaly in Table 15

The observed increase in spatial-convergence rate from O ( h 2 ) to O ( h 3.5 ) in Table 15 represents a super convergence phenomenon attributed to the exceptional smoothness of the exact solution in Example 3. For coarse grids, convergence is limited by the O ( h 2 ) collocation error, but as h decreases, the higher-order approximation power of the UHPBS basis becomes dominant. This effect is particularly pronounced for λ = 1.75 due to favorable error component balancing, where reduced temporal error reveals the underlying spatial approximation potential. While not universally guaranteed, this super convergence demonstrates the method’s capability for enhanced accuracy with a smooth solution.
Example 4.
Consider the nonlinear TFKGE (1) with coefficients μ 1 = 1 and μ 2 = 0 :
λ u ( x , t ) t λ + u ( x , t ) = 2 u ( x , t ) x 2 + f ( x , t ) , ϕ 0 ( x ) = 0 , ϕ 1 ( x ) = 0 , 0 x 1 , ψ 0 ( t ) = 0 , ψ 1 ( t ) = 0 , t 0 , f ( x , t ) = 2 t 2 γ Γ ( 3 γ ) ( e e x ) sin ( x ) + t 2 ( 2 e e x ) sin ( x ) + 2 t 2 e x cos ( x ) .
The exact solution to this problem is given by u ( x , t ) = t 2 sin ( x ) ( e e x ) . When the coefficient μ 2 = 0 , the governing equation reduces to the linear time-fractional Klein–Gordon equation. To validate the efficiency and accuracy of the proposed numerical method, it is applied to this simplified linear case. The numerical solution is computed using the proposed scheme in Equation (17). Figure 14 illustrates the 3D numerical (a) and exact (b) solutions for the fractional order λ = 1.5 at t = 1 , while Figure 15 displays the 3D absolute surface and the corresponding heat map. Figure 16 presents a comprehensive comparison between the numerical and exact solutions at three distinct time levels for λ = 1.5 . The two-dimensional absolute error distribution is shown in Figure 17, demonstrating the method’s accuracy across the spatial domain. The numerical analysis for Example 4 is presented in Table 17, Table 18, Table 19 and Table 20. Table 17 presents both spatial and temporal convergence rates for λ = 1.75 at t = 1 . Table 18 compares the L error norms of the proposed method with RBF and Chebyshev polynomials for λ = 1.1 and λ = 1.4 , showing competitive accuracy with refined time steps. Table 19 lists numerical solutions at t = 1 for different fractional orders λ with fixed h = 0.02 and τ = 0.01 . Table 20 analyzes absolute errors and computational times for different spatial mesh sizes with τ = 0.0005 and λ = 1.5 .
We consider a linear benchmark problem without fractional derivatives by examining the limiting case as the fractional-order approaches λ 2 . This limiting process enables us to verify the consistency and robustness of the numerical scheme when transitioning from fractional to classical integer-order dynamics.
Example 5.
Consider the time-factional linear Klein–Gordon Equation (1) with μ 1 = 1 and μ 2 = 0 :
λ u ( x , t ) t λ + u ( x , t ) = 2 u ( x , t ) x 2 + f ( x , t ) , ϕ 0 ( x ) = 0 , ϕ 1 ( x ) = 0 , 0 x 1 , ψ 0 ( t ) = 0 , ψ 1 ( t ) = t 3 , t 0 , f ( x , t ) = 6 x 3 t + ( x 3 6 x ) t 3 .
The exact solution is u ( x , t ) = x 3 t 3 , valid only for λ = 2 . (My Response: I confrim)
We apply the proposed scheme in Equation (17) to compute the numerical solutions. Figure 18 presents the 3D visualizations comparing the exact and approximate solutions. Figure 19 shows the 3D error surface and corresponding heat map at t = 1 with λ = 1.99999 . Figure 20 compares the numerical and exact solutions at three different time levels for λ = 1.99999 . Figure 21 depicts the 2D absolute error profile. The numerical results for Example 5 are comprehensively presented in Table 21, Table 22, Table 23 and Table 24 and the final Table 25. Table 21 displays the numerical solution at t = 1 for different values of λ approaching the integer order λ = 2 , illustrating the convergence of the proposed method to the classical solution as λ 2 . Table 22 provides the absolute error for various values of λ with a refined time step τ = 0.0001 and fixed h = 0.02 , showcasing the method’s accuracy near the integer-order limit. Table 23 investigates the temporal convergence rate, demonstrating the method’s temporal order of accuracy. Table 24 examines the spatial-convergence rates, confirming the method’s spatial accuracy. The final Table 25 analyzes the absolute errors and computational times for different spatial mesh sizes with fixed τ and λ , highlighting the method’s efficiency under mesh refinements.

6. Concluding Remarks

In this research, we introduced a new numerical approach using a uniform hyperbolic polynomial B-spline for the solution of the generalized nonlinear time-fractional Klein–Gordon equation. The approach uses a finite-difference collocation method and incorporates the Caputo fractional derivative to accurately model the fractional dynamics of the system. The hyperbolic basic functions (sinh, cosh) offer mathematically optimal approximation for wave propagation dynamics, achieving proven convergence rates while maintaining unconditional stability. The Crank–Nicolson temporal discretization ( θ = 1 2 ) is specifically chosen for its second-order accuracy and unconditional stability properties, which are essential for handling the nonlocal fractional derivative terms. To ensure the efficiency and accuracy of our approach, we carried out extensive numerical experiments. The results were compared with those obtained using the techniques previously reported in the literature. Our method consistently produced much smaller errors to affirm its greater efficiency. The numerical outcomes proved that our approach is not only precise but also computationally effective, making it a practical tool in solving complex fractional differential equations. However, the approach has limitations, including computational costs from nonlocal fractional operators, linearization assumptions in stability analysis, and restrictions to regular domains and λ ( 1 , 2 ) . Future research might investigate the usage of this method for other sorts of fractional differential equations and the extension of the method to multi-dimensional problems. Overall, this study contributes a robust and efficient numerical tool to the growing body of work on fractional calculus and its applications.

Author Contributions

Conceptualization, M.U.M. and M.Y.; methodology, M.U.M.; software, Q.W.; validation, J.S., M.U.M. and M.Y.; formal analysis, J.S.; investigation, M.U.M.; resources, Q.W. and J.S.; data curation, M.Y.; writing—original draft preparation, M.U.M.; writing—review and editing, Q.W. and J.S.; visualization, M.U.M. and M.Y.; supervision, M.Y.; project administration, Q.W. and J.S.; funding acquisition, Q.W. All authors have read and agreed to the published version of the manuscript.

Funding

This work was sponsored in part by the Natural Science Foundation of China (No.12301199), the Basic Scientific Research Project of Higher Education of Liaoning Province (No.JYTMS20231164), and the Shenyang Special Project for Cultivating Young and Middle-aged Scientific and Technological Innovation Talents (No.RC240596).

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding authors.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. El-Dib, Y.O.; Elgazery, N.S.; Mady, A.A. Nonlinear dynamical analysis of a time-fractional Klein–Gordon equation. Pramana-J. Phys. 2021, 95, 154. [Google Scholar] [CrossRef]
  2. Yang, Y.; Yang, X.; Wang, J.; Liu, J. The numerical solution of the time-fractional non-linear Klein–Gordon equation via spectral collocation method. Therm. Sci. 2019, 23, 1529–1537. [Google Scholar] [CrossRef]
  3. Nagy, A.M. Numerical solution of time fractional nonlinear Klein–Gordon equation using Sinc-Chebyshev collocation method. Appl. Math. Comput. 2107(310), 139–148. [CrossRef]
  4. Dehghan, M.; Abbaszadeh, M.; Mohebbi, A. An implicit RBF meshless approach for solving the time fractional nonlinear Sine-Gordon and Klein–Gordon equations. Eng. Anal. Bound. Elem. 2015, 50, 412–434. [Google Scholar] [CrossRef]
  5. Singh, H.; Kumar, D.; Pandey, R.K. An efficient computational method for the time-space fractional Klein–Gordon equation. Front. Phys. 2020, 8, 281. [Google Scholar] [CrossRef]
  6. Mulimani, M.; Kumbinarasaiah, S. A numerical study on the nonlinear fractional Klein–Gordon equation. J. Umm Al-Qura Univ. Appl. Sci. 2014, 10, 178–199. [Google Scholar] [CrossRef]
  7. Khan, H.; Khan, A.; Chen, W.; Shah, K. Stability analysis and a numerical scheme for fractional Klein–Gordon equations. Math. Methods Appl. Sci. 2018, 42, 723–732. [Google Scholar] [CrossRef]
  8. Liu, J.; Nadeem, M.; Habib, M.; Akgul, A. Approximate solution of nonlinear time-fractional Klein–Gordon equations using Yang transform. Symmetry 2022, 14, 907. [Google Scholar] [CrossRef]
  9. Khan, H.; Barak, S.; Kumam, P.; Arif, M. Analytical solutions of fractional Klein–Gordon and gas dynamics equations, via the (G/G)-expansion method. Symmetry 2019, 11, 566. [Google Scholar] [CrossRef]
  10. Saifullah, S.; Ali, A.; Irfan, M.; Shah, K. Time-fractional Klein–Gordon equation with solitary/shock wave solutions. Math. Probl. Eng. 2021, 2021, 6858592. [Google Scholar] [CrossRef]
  11. Sadiya, U.; Inc, M.; Arefin, M.A.; Uddin, M.H. Consistent travelling wave solutions to the non-linear time-fractional Klein–Gordon and sine-Gordon equations through extended tanh-function approach. J. Taibah Univ. Sci. 2022, 16, 594–607. [Google Scholar] [CrossRef]
  12. Kheiri, H.; Shabi, S.; Mojaver, A. Analytical solutions for the fractional Klein–Gordon equation. Comput. Methods Differ. Equ. 2014, 2, 99–114. Available online: https://cmde.tabrizu.ac.ir/article_2497_7dd788eed92aa45961fd50bea239e6ee.pdf (accessed on 8 December 2025).
  13. Khader, M.M.; Adel, M.H. Numerical solutions of fractional wave equations using an efficient class of FDM based on the Hermite formula. Adv. Differ. Equ. 2016, 2016, 34. Available online: https://link.springer.com/article/10.1186/s13662-015-0731-0 (accessed on 8 December 2025).
  14. Vivas-Cortez, M.; Huntul, M.J.; Khalid, M.; Shafiq, M.; Abbas, M.; Iqbal, M.K. Application of an extended cubic B-spline to find the numerical solution of the generalized nonlinear time-fractional Klein–Gordon equation in mathematical physics. Computation 2024, 12, 80. [Google Scholar] [CrossRef]
  15. Akram, T.; Abbas, M.; Riaz, M.B.; Ismail, A.I.; Ali, N.M. Development and analysis of new approximation of extended cubic B-spline to the nonlinear time fractional Klein–Gordon equation. Fractals 2020, 28, 2040039. [Google Scholar] [CrossRef]
  16. Amin, M.; Abbas, M.; Iqbal, M.K.; Baleanu, D. Numerical treatment of the time-fractional Klein–Gordon equation using redefined extended cubic B-spline functions. Front. Phys. 2020, 8, 288. [Google Scholar] [CrossRef]
  17. Yaseen, M.; Abbas, M.; Ahmad, B. Numerical simulation of the nonlinear generalized time-fractional Klein–Gordon equation using cubic trigonometric B-spline functions. Math. Methods Appl. Sci. 2020, 44, 901–916. [Google Scholar] [CrossRef]
  18. Hepson, O.E.; Korkmaz, K.; Dag, I. On the numerical solution of the Klein–Gordon equation by exponential cubic B-spline collocation method. Commun. Fac. Sci. Univ. Ankara Ser. A1 Math. Stat. 2019, 68, 412–421. [Google Scholar] [CrossRef]
  19. Siddiqi, S.S.; Arshed, S. Quintic B-spline for the numerical solution of the good Boussinesq equation. J. Egypt. Math. Soc. 2014, 22, 209–213. [Google Scholar] [CrossRef]
  20. Yassen, M.; Abbas, M.; Nazir, T.; Baleau, D. A finite difference scheme based on cubic trigonometric B-splines for a time fractional diffusion-wave equation. Adv. Differ. Equ. 2017, 2017, 274. [Google Scholar] [CrossRef]
  21. Lu, Y.; Wang, G.; Yang, X. Uniform hyperbolic polynomial B-spline curves. Comput. Aided Geom. Des. 2002, 19, 379–393. [Google Scholar] [CrossRef]
  22. Manzoor, M.U.; Yaseen, M.; Awadalla, M.; Zaway, H. A uniform hyperbolic polynomial B-spline approach for solving the fractional diffusion-wave equations in the Caputo-Fabrizio sense. AIMS Math. 2025, 10, 17049–17081. [Google Scholar] [CrossRef]
  23. Palav, M.S.; Pradhan, V.H. Redefined fourth order uniform hyperbolic polynomial B-splines based collocation method for solving advection-diffusion equation. Appl. Math. Comput. 2025, 484, 128992. [Google Scholar] [CrossRef]
  24. Palav, M.; Pradhan, V. Efficient numerical solution of Burgers’ equation using collocation method based on re-defined uniform hyperbolic polynomial B-splines. J. Appl. Math. Comput. 2025, 71, 4429–4474. [Google Scholar] [CrossRef]
  25. Li, X.; Kamran, A.; Haq, U.; Zhang, X. Numerical solution of the linear time fractional Klein–Gordon equation using transform based localized RBF method and quadrature. AIMS Math. 2020, 5, 5287–5308. [Google Scholar] [CrossRef]
  26. Bansu, H.; Kumar, S. Numerical solution of space-time fractional Klein–Gordon equation by radial basis functions and Chebyshev polynomials. Int. J. Appl. Comput. Math. 2021, 7, 201. [Google Scholar] [CrossRef]
  27. Chen, H.; Lu, S.; Chen, W. A fully discrete spectral method for the nonlinear time fractional Klein–Gordon equation. Taiwan. J. Math. 2014, 21, 231–251. [Google Scholar] [CrossRef]
  28. Turut, V.; Guzel, N. On solving partial differential equations of fractional order by using the variational iteration method and multivariate Padé approximations. Eur. J. Pure Appl. Math. 2013, 6, 147–171. Available online: https://www.ejpam.com/index.php/ejpam/article/view/1928 (accessed on 8 December 2025).
  29. Reddy, B.D. Introductory Functional Analysis with Applications to Boundary Value Problems and Finite Elements; Springer: Berlin/Heidelberg, Germany, 1997. [Google Scholar]
  30. Strikwerda, J.C. Finite Difference Schemes and Partial Differential Equations, 2nd ed.; SIAM: Philadelphia, PA, USA, 2004. [Google Scholar]
Figure 1. Flowchart of computational algorithm for solving nonlinear time-fractional Klein–Gordon equations using uniform hyperbolic polynomial B-spline.
Figure 1. Flowchart of computational algorithm for solving nonlinear time-fractional Klein–Gordon equations using uniform hyperbolic polynomial B-spline.
Fractalfract 09 00815 g001
Figure 2. 3D space–time graphs of the numerical approximation (a) and the exact solution (b) for Example 1. The solutions were computed with spatial and temporal step sizes h = 0.0125 and τ = 0.0001 .
Figure 2. 3D space–time graphs of the numerical approximation (a) and the exact solution (b) for Example 1. The solutions were computed with spatial and temporal step sizes h = 0.0125 and τ = 0.0001 .
Fractalfract 09 00815 g002
Figure 3. 3D absolute error distribution (a) and 2D absolute heat graph (b) using spatial step size h = 0.0125 and time step sizes τ = 0.0001 for Example 1.
Figure 3. 3D absolute error distribution (a) and 2D absolute heat graph (b) using spatial step size h = 0.0125 and time step sizes τ = 0.0001 for Example 1.
Fractalfract 09 00815 g003
Figure 4. The numerical and exact solutions are plotted for different time levels for Example 1 with spatial and temporal step sizes h = 0.01 and τ = 0.001 .
Figure 4. The numerical and exact solutions are plotted for different time levels for Example 1 with spatial and temporal step sizes h = 0.01 and τ = 0.001 .
Fractalfract 09 00815 g004
Figure 5. 2D error distribution for Example 1 with parameters h = 0.005 and τ = 0.0005 .
Figure 5. 2D error distribution for Example 1 with parameters h = 0.005 and τ = 0.0005 .
Fractalfract 09 00815 g005
Figure 6. 3D surface plot of numerical (a) and exact (b) solutions for Example 2 with spatial and temporal step sizes h = 0.0125 and τ = 0.0001 .
Figure 6. 3D surface plot of numerical (a) and exact (b) solutions for Example 2 with spatial and temporal step sizes h = 0.0125 and τ = 0.0001 .
Fractalfract 09 00815 g006
Figure 7. 3D absolute error surface with spatial step size h = 0.0125 and time step size τ = 0.0001 for Example 2.
Figure 7. 3D absolute error surface with spatial step size h = 0.0125 and time step size τ = 0.0001 for Example 2.
Fractalfract 09 00815 g007
Figure 8. The numerical and the exact solutions are plotted at different time levels for Example 2 with spatial and temporal step sizes h = 0.01 and τ = 0.001 .
Figure 8. The numerical and the exact solutions are plotted at different time levels for Example 2 with spatial and temporal step sizes h = 0.01 and τ = 0.001 .
Fractalfract 09 00815 g008
Figure 9. 2D absolute error profile for Example 2 with parameters h = 0.005 and τ = 0.0005 .
Figure 9. 2D absolute error profile for Example 2 with parameters h = 0.005 and τ = 0.0005 .
Fractalfract 09 00815 g009
Figure 10. 3D surface plot of the numerical solution (a) and exact solution (b) for Example 3 with spatial and temporal step sizes h = 0.0125 and τ = 0.0001 .
Figure 10. 3D surface plot of the numerical solution (a) and exact solution (b) for Example 3 with spatial and temporal step sizes h = 0.0125 and τ = 0.0001 .
Fractalfract 09 00815 g010
Figure 11. 3D absolute error surface and corresponding heat map for Example 3 with spatial step size h = 0.0125 and time step size τ = 0.0001 .
Figure 11. 3D absolute error surface and corresponding heat map for Example 3 with spatial step size h = 0.0125 and time step size τ = 0.0001 .
Fractalfract 09 00815 g011
Figure 12. The numerical and the exact solutions at different time levels for Example 3 with spatial and temporal step size h = 0.01 and τ = 0.001 .
Figure 12. The numerical and the exact solutions at different time levels for Example 3 with spatial and temporal step size h = 0.01 and τ = 0.001 .
Fractalfract 09 00815 g012
Figure 13. Two-dimensional absolute error profile for Example 3 with parameter h = 0.005 and τ = 0.0005 .
Figure 13. Two-dimensional absolute error profile for Example 3 with parameter h = 0.005 and τ = 0.0005 .
Fractalfract 09 00815 g013
Figure 14. 3D surface plot of the numerical solution (a) and the exact solution (b) when spatial and temporal step sizes h = 0.0125 and τ = 0.0001 for Example 4.
Figure 14. 3D surface plot of the numerical solution (a) and the exact solution (b) when spatial and temporal step sizes h = 0.0125 and τ = 0.0001 for Example 4.
Fractalfract 09 00815 g014
Figure 15. 3D absolute error surface and corresponding heat map with spatial step size h = 0.0125 and time step size τ = 0.0001 for Example 4.
Figure 15. 3D absolute error surface and corresponding heat map with spatial step size h = 0.0125 and time step size τ = 0.0001 for Example 4.
Fractalfract 09 00815 g015
Figure 16. The numerical and the exact solutions for Example 4 at different time levels with spatial and temporal step sizes h = 0.01 and τ = 0.001 .
Figure 16. The numerical and the exact solutions for Example 4 at different time levels with spatial and temporal step sizes h = 0.01 and τ = 0.001 .
Fractalfract 09 00815 g016
Figure 17. 2D absolute error profile for Example 4 with spatial and temporal step sizes h = 0.005 and τ = 0.0005 .
Figure 17. 2D absolute error profile for Example 4 with spatial and temporal step sizes h = 0.005 and τ = 0.0005 .
Fractalfract 09 00815 g017
Figure 18. 3D surface plot of the numerical solution (a) and the exact solution (b) when spatial and temporal step sizes h = 0.0125 and τ = 0.0001 for Example 5.
Figure 18. 3D surface plot of the numerical solution (a) and the exact solution (b) when spatial and temporal step sizes h = 0.0125 and τ = 0.0001 for Example 5.
Fractalfract 09 00815 g018
Figure 19. 3D absolute error surface and corresponding heat map with spatial step size h = 0.0125 and time step size τ = 0.0001 for Example 5.
Figure 19. 3D absolute error surface and corresponding heat map with spatial step size h = 0.0125 and time step size τ = 0.0001 for Example 5.
Fractalfract 09 00815 g019
Figure 20. The numerical and the exact solutions for Example 5 at different time levels with spatial and temporal step sizes h = 0.01 and τ = 0.001 .
Figure 20. The numerical and the exact solutions for Example 5 at different time levels with spatial and temporal step sizes h = 0.01 and τ = 0.001 .
Fractalfract 09 00815 g020
Figure 21. 2D absolute error profile for Example 5 with spatial and temporal step sizes h = 0.005 and τ = 0.0005 .
Figure 21. 2D absolute error profile for Example 5 with spatial and temporal step sizes h = 0.005 and τ = 0.0005 .
Fractalfract 09 00815 g021
Table 1. Absolute error comparison for Example 1 at t = 1 with fractional order λ = 1.5 .
Table 1. Absolute error comparison for Example 1 at t = 1 with fractional order λ = 1.5 .
Sinc-Chebyshev [3]Proposed Method
x m = n = 3 m = n = 6 m = n = 9 h = 0 . 02 , τ = 0 . 0001
0.1 1.7221 × 10 2 1.9004 × 10 3 8.7105 × 10 4 4.0026 × 10 5
0.2 1.8443 × 10 2 2.0752 × 10 3 6.7781 × 10 4 5.7907 × 10 5
0.3 1.5848 × 10 2 2.0682 × 10 3 6.2089 × 10 4 6.0269 × 10 5
0.4 1.2813 × 10 2 1.8787 × 10 3 5.7015 × 10 4 5.2468 × 10 5
0.5 9.9088 × 10 3 1.6102 × 10 3 5.1476 × 10 4 3.8765 × 10 5
0.6 7.9067 × 10 3 1.4483 × 10 3 4.8948 × 10 4 2.2466 × 10 5
0.7 8.0209 × 10 3 1.5545 × 10 3 5.1671 × 10 4 6.0757 × 10 6
0.8 1.0523 × 10 2 1.6959 × 10 3 5.3919 × 10 4 8.4174 × 10 6
0.9 1.0241 × 10 2 1.4757 × 10 3 6.0660 × 10 4 1.8649 × 10 5
CPUTime (s) 168 s
Table 2. Absolute error comparison for Example 1 at t = 1 with fractional order λ = 1.7 .
Table 2. Absolute error comparison for Example 1 at t = 1 with fractional order λ = 1.7 .
Sinc-Chebyshev [3]Proposed Method
x m = n = 3 m = n = 6 m = n = 9 h = 0 . 02 , τ = 0 . 0001
0.1 1.3578 × 10 2 1.8702 × 10 3 6.2045 × 10 4 1.1844 × 10 5
0.2 1.1764 × 10 2 1.4814 × 10 3 3.1908 × 10 4 1.0015 × 10 5
0.3 7.3720 × 10 3 9.4578 × 10 4 6.5573 × 10 5 3.7997 × 10 6
0.4 3.5858 × 10 3 4.9595 × 10 4 1.1160 × 10 4 2.5419 × 10 5
0.5 7.9658 × 10 4 1.9552 × 10 4 1.9899 × 10 4 4.8519 × 10 5
0.6 3.4804 × 10 4 1.6063 × 10 4 1.8808 × 10 4 6.6426 × 10 5
0.7 1.2764 × 10 3 5.1077 × 10 4 6.4274 × 10 5 7.4114 × 10 5
0.8 5.8352 × 10 3 1.0007 × 10 3 1.2118 × 10 4 6.9240 × 10 5
0.9 7.9189 × 10 2 1.1757 × 10 3 3.7056 × 10 4 5.1463 × 10 5
CPUTime (s) 160 s
Table 3. Numerical solutions for Example 1 at t = 1 for varying values of λ .
Table 3. Numerical solutions for Example 1 at t = 1 for varying values of λ .
x λ = 1.1 λ = 1.3 λ = 1.5 λ = 1.7 λ = 1.9
0.1 0.767575 0.767749 0.768081 0.768364 0.768426
0.2 0.570993 0.571306 0.571871 0.572365 0.572403
0.3 0.408243 0.408627 0.409317 0.409988 0.409957
0.4 0.277095 0.277491 0.278218 0.279046 0.278963
0.5 0.175151 0.175517 0.176213 0.177153 0.177132
0.6 0.099817 0.100126 0.100737 0.101707 0.101976
0.7 0.048237 0.048475 0.048964 0.049847 0.050683
0.8 0.017184 0.017344 0.017683 0.018357 0.019713
0.9 0.002822 0.002902 0.003076 0.003441 0.004549
CPU
Time (s) 0.0512 0.0524 0.0520 0.0520 0.0518
Table 4. The maximum absolute error ( L ) with both spatial and temporal convergence rate for Example 1 at t = 2 and for λ = 1.75 .
Table 4. The maximum absolute error ( L ) with both spatial and temporal convergence rate for Example 1 at t = 2 and for λ = 1.75 .
Spatial-Convergence Rate ( τ = 0.005 ) Temporal Convergence Rate ( h = 0.01 )
h L p h Second τ L p τ Second
1 2 7.563392 × 10 2 0.290 1 2 9.332533 × 10 2 0.003
1 4 2.091588 × 10 2 1.85443 0.292 1 4 2.122093 × 10 2 2.13678 0.005
1 8 4.586716 × 10 3 2.18907 0.293 1 8 7.185911 × 10 3 1.56224 0.013
1 16 8.715622 × 10 4 2.39579 0.362 1 16 2.975086 × 10 3 1.27224 0.027
Table 5. Absolute error and computational time for different spatial mesh sizes with fixed time step τ = 0.05 and fractional order λ = 1.5 at t = 1 for Example 1.
Table 5. Absolute error and computational time for different spatial mesh sizes with fixed time step τ = 0.05 and fractional order λ = 1.5 at t = 1 for Example 1.
L CPU Time (s) L CPU Time (s)
M = 2 M = 3
M 2.617125 × 10 2 0.0023 1.256832 × 10 2 0.0025
M 2 6.945129 × 10 3 0.0025 1.080375 × 10 3 0.0033
M 3 1.436999 × 10 3 0.0050 6.243754 × 10 4 0.0065
Table 6. Comparison of absolute errors for Example 2 at t = 1 and with fractional order λ = 1.5 .
Table 6. Comparison of absolute errors for Example 2 at t = 1 and with fractional order λ = 1.5 .
Sinc-Chebyshev [3]Proposed Method
x m = n = 3 m = n = 6 m = n = 9 h = 0 . 01 , τ = 0 . 0005
0.1 3.1046 × 10 2 3.7536 × 10 3 1.6396 × 10 3 2.6852 × 10 7
0.2 3.2585 × 10 2 4.2261 × 10 3 1.2808 × 10 3 5.2928 × 10 6
0.3 2.4258 × 10 2 3.0398 × 10 3 1.0869 × 10 3 1.5354 × 10 5
0.4 2.2308 × 10 2 2.1007 × 10 3 8.4196 × 10 4 2.5664 × 10 5
0.5 2.2683 × 10 2 1.9285 × 10 3 7.8252 × 10 4 3.0029 × 10 5
0.6 2.2308 × 10 2 2.1007 × 10 3 8.4196 × 10 4 2.5664 × 10 5
0.7 2.4258 × 10 2 3.0398 × 10 3 1.0869 × 10 3 1.5354 × 10 5
0.8 3.2585 × 10 2 4.2261 × 10 3 1.2808 × 10 3 5.2928 × 10 6
0.9 3.1046 × 10 2 3.7536 × 10 3 1.6396 × 10 3 2.6852 × 10 7
CPUTime (s) 8.35 s
Table 7. Absolute error and computational time for different spatial mesh sizes with fixed time step τ = 0.005 and fractional order λ = 1.5 at t = 1 for Example 2.
Table 7. Absolute error and computational time for different spatial mesh sizes with fixed time step τ = 0.005 and fractional order λ = 1.5 at t = 1 for Example 2.
L CPU Time (s) L CPU Time (s)
M = 2 M = 3
M 1.037598 × 10 1 0.0837 4.207734 × 10 2 0.0918
M 2 2.699383 × 10 2 0.0887 4.644302 × 10 3 0.0981
M 3 6.165988 × 10 3 0.1164 1.980571 × 10 4 0.1428
Table 8. Comparison of absolute errors for Example 2 at t = 1 and with fractional order λ = 1.7 .
Table 8. Comparison of absolute errors for Example 2 at t = 1 and with fractional order λ = 1.7 .
Sinc-Chebyshev [3]Proposed Method
x m = n = 3 m = n = 6 m = n = 9 h = 0 . 01 , τ = 0 . 0005
0.1 2.5704 × 10 2 3.4995 × 10 3 1.5471 × 10 3 4.4231 × 10 6
0.2 2.2232 × 10 2 3.7942 × 10 3 1.1272 × 10 3 1.2568 × 10 5
0.3 1.0041 × 10 2 2.5077 × 10 3 8.9663 × 10 4 2.4323 × 10 5
0.4 5.7397 × 10 3 1.5230 × 10 3 6.3348 × 10 4 3.5231 × 10 5
0.5 5.3306 × 10 3 1.3380 × 10 3 5.6868 × 10 4 3.9699 × 10 5
0.6 5.7397 × 10 3 1.5230 × 10 3 6.3348 × 10 4 3.5231 × 10 5
0.7 1.0041 × 10 2 2.5077 × 10 3 8.9664 × 10 4 2.4323 × 10 5
0.8 2.2232 × 10 2 3.7942 × 10 3 1.1272 × 10 3 1.2568 × 10 5
0.9 2.5704 × 10 2 3.4995 × 10 3 1.5471 × 10 3 4.4231 × 10 6
CPUTime (s) 8.35 s
Table 9. Approximate solutions for Example 2 at t = 1 for different values of λ .
Table 9. Approximate solutions for Example 2 at t = 1 for different values of λ .
x λ = 1.1 λ = 1.3 λ = 1.5 λ = 1.7 λ = 1.9 λ = 2
0.1 0.309498 0.309385 0.309318 0.309549 0.310886 0.309017
0.2 0.588792 0.588579 0.588449 0.588875 0.591386 0.587785
0.3 0.810555 0.810268 0.810084 0.810647 0.814051 0.809017
0.4 0.953008 0.952676 0.952456 0.953097 0.957048 0.951056
0.5 1.002110 1.001760 1.001530 1.002190 1.006330 1.000000
0.6 0.953008 0.952676 0.952456 0.953097 0.957048 0.951056
0.7 0.810555 0.810268 0.810084 0.810647 0.814051 0.809017
0.8 0.588792 0.588579 0.588449 0.588875 0.591386 0.587785
0.9 0.309498 0.309385 0.309318 0.309549 0.310886 0.309017
CPU
Time (s) 0.0681 0.0728 0.0719 0.0697 0.0712
Table 10. The L -norm with temporal convergence rate for Example 2 at t = 1 when h = 0.01 .
Table 10. The L -norm with temporal convergence rate for Example 2 at t = 1 when h = 0.01 .
λ = 1.5 CPU Time λ = 1.75 CPU Time
τ L p τ Second L p τ Second
1 40 4.668897 × 10 3 0.045 8.470385 × 10 3 0.044
1 80 2.134990 × 10 3 1.12885 0.090 3.702567 × 10 3 1.19390 0.097
1 160 9.856104 × 10 4 1.11514 0.212 1.621113 × 10 3 1.19154 0.205
1 320 4.501543 × 10 4 1.13059 0.504 7.047413 × 10 4 1.20182 0.493
1 640 1.957547 × 10 4 1.20137 1.262 2.980196 × 10 4 1.24169 1.304
1 1280 7.314904 × 10 5 1.42014 3.706 1.160850 × 10 4 1.36022 3.843
Table 11. The L -norm with spatial-convergence rate for Example 2 at t = 1 when τ = 1 1280 .
Table 11. The L -norm with spatial-convergence rate for Example 2 at t = 1 when τ = 1 1280 .
λ = 1.5 CPU Time λ = 1.75 CPU Time
h L p h Second L p h Second
1 2 1.043302 × 10 1 2.404 8.495030 × 10 2 2.426
1 4 2.762621 × 10 2 1.91705 2.445 2.178856 × 10 2 1.96305 2.428
1 8 6.840716 × 10 3 2.01382 2.664 5.325714 × 10 3 2.03252 2.548
1 16 1.622524 × 10 3 2.07591 2.679 1.216999 × 10 3 2.12965 2.633
Table 12. L error comparison with implicit RBF meshless approach and the present scheme for Example 3 with varying τ , fixed h = 0.02 , t = 1 and λ = 1.15 .
Table 12. L error comparison with implicit RBF meshless approach and the present scheme for Example 3 with varying τ , fixed h = 0.02 , t = 1 and λ = 1.15 .
τ RBF [4]CTB-Spline [17]Proposed MethodCPU Time
1 10 1.3757 × 10 2 8.4989 × 10 3 5.875545 × 10 4 0.005
1 20 6.9463 × 10 3 4.3701 × 10 3 7.566187 × 10 5 0.011
1 40 3.4855 × 10 3 2.2164 × 10 3 9.323207 × 10 5 0.023
1 80 1.7414 × 10 3 1.1165 × 10 3 6.545505 × 10 5 0.575
1 160 8.6602 × 10 4 5.6082 × 10 4 3.839958 × 10 5 1.215
Table 13. Absolute error and computational time for different spatial mesh sizes with time step size τ = 0.001 and fractional order λ = 1.5 at t = 1 for Example 3.
Table 13. Absolute error and computational time for different spatial mesh sizes with time step size τ = 0.001 and fractional order λ = 1.5 at t = 1 for Example 3.
L CPU Time (s) L CPU Time (s)
M = 2 M = 3
M 1.776452 × 10 3 1.5368 7.693085 × 10 4 1.5237
M 2 4.113132 × 10 4 1.6023 6.409192 × 10 5 1.6062
M 3 8.825094 × 10 5 1.6363 1.513199 × 10 5 1.8315
Table 14. The L error with temporal convergence rate for Example 3 presented with varying values of τ and fixed h = 0.02 at t = 1 .
Table 14. The L error with temporal convergence rate for Example 3 presented with varying values of τ and fixed h = 0.02 at t = 1 .
λ = 1.5 CPU Time λ = 1.75 CPU Time
τ L p τ Second L p τ Second
1 80 2.701420 × 10 4 0.05 5.047712 × 10 4 0.05
1 160 1.407746 × 10 4 0.94033 0.13 2.807606 × 10 4 0.84629 0.13
1 320 7.155831 × 10 5 0.97619 0.32 1.519434 × 10 4 0.88581 0.33
1 640 3.529759 × 10 5 1.01955 0.95 8.011813 × 10 5 0.92333 0.96
1 1280 1.657489 × 10 5 1.09057 3.05 4.106510 × 10 5 0.96422 3.23
1 2560 7.012563 × 10 6 1.24099 10.9 2.025453 × 10 5 1.01967 11.2
1 5120 2.186351 × 10 6 1.68141 42.6 9.304020 × 10 6 1.12232 41.8
1 10240 6.340125 × 10 7 1.78594 176 3.636223 × 10 6 1.35541 167
Table 15. The L errors with spatial-convergence rate for Example 3 at t = 1 with τ = 0.0005 . Results are shown for λ = 1.5 and λ = 1.75 across different spatial step size h.
Table 15. The L errors with spatial-convergence rate for Example 3 at t = 1 with τ = 0.0005 . Results are shown for λ = 1.5 and λ = 1.75 across different spatial step size h.
λ = 1.5 CPU Time λ = 1.75 CPU Time
h L p h Second L p h Second
1 2 1.78891 × 10 3 5.93 1.696022 × 10 3 5.91
1 4 4.23830 × 10 4 2.07752 6.06 3.785764 × 10 4 2.16349 5.93
1 8 9.99675 × 10 5 2.08395 6.16 7.844376 × 10 5 2.27085 6.06
1 16 1.59915 × 10 5 2.64415 6.22 6.715410 × 10 6 3.54611 6.23
Table 16. The numerical solutions for Example 3 at t = 1 for across varying values of λ .
Table 16. The numerical solutions for Example 3 at t = 1 for across varying values of λ .
x λ = 1.1 λ = 1.3 λ = 1.5 λ = 1.7 λ = 1.9
0.1 0.099817 0.099843 0.099897 0.099959 0.099964
0.2 0.198638 0.198687 0.198791 0.198908 0.198908
0.3 0.295474 0.295544 0.295690 0.295848 0.295841
0.4 0.389360 0.389445 0.389622 0.389803 0.389803
0.5 0.479357 0.479452 0.479644 0.479831 0.479849
0.6 0.564570 0.564666 0.564857 0.565033 0.565072
0.7 0.644149 0.644235 0.644407 0.644559 0.644612
0.8 0.717302 0.717367 0.717499 0.717615 0.717669
0.9 0.783299 0.783333 0.783407 0.783471 0.783508
CPU
Time (s) 0.0780 0.0688 0.0706 0.0667 0.0719
Table 17. The L error norm with both spatial and temporal convergence rates is presented in the table for Example 4 at t = 1 at fractional order λ = 1.75 .
Table 17. The L error norm with both spatial and temporal convergence rates is presented in the table for Example 4 at t = 1 at fractional order λ = 1.75 .
Spatial-Convergence Rate ( τ = 0.0001 ) Temporal Convergence Rate ( h = 0.025 )
h L p h Second τ L p τ Second
1 2 2.119790 × 10 2 160 1 20 4.115170 × 10 3 0.023
1 4 4.943085 × 10 3 2.10044 161 1 40 1.655999 × 10 3 1.31325 0.033
1 8 1.258837 × 10 3 1.97332 163 1 80 6.455360 × 10 4 1.35913 0.079
1 16 3.121478 × 10 4 2.01179 167 1 160 2.621443 × 10 4 1.30014 0.168
1 32 7.669177 × 10 5 2.02508 174 1 320 1.218630 × 10 4 1.10510 0.425
Table 18. The L error norm comparison with radial basis functions and Chebyshev polynomials for Example 4 at t = 1 .
Table 18. The L error norm comparison with radial basis functions and Chebyshev polynomials for Example 4 at t = 1 .
RBF and Chebyshev [26] N = 365 Proposed Method h = 0.005
n λ = 1.1 λ = 1.4 τ λ = 1.1 λ = 1.4
3 1.6721 × 10 5 1.7534 × 10 5 1 2000 2.481975 × 10 5 1.718789 × 10 5
5 1.6706 × 10 5 1.4029 × 10 5 1 4000 1.326458 × 10 5 9.405530 × 10 6
9 1.6419 × 10 5 1.3190 × 10 5 1 8000 7.490157 × 10 6 5.527043 × 10 6
Table 19. The numerical solutions of Example 4 at t = 1 for different fractional orders λ h = 0.02 and τ = 0.01 .
Table 19. The numerical solutions of Example 4 at t = 1 for different fractional orders λ h = 0.02 and τ = 0.01 .
x λ = 1.1 λ = 1.3 λ = 1.5 λ = 1.7 λ = 1.9
0.1 0.160894 0.160917 0.160964 0.161006 0.161007
0.2 0.297102 0.297143 0.297235 0.297316 0.297316
0.3 0.404007 0.404074 0.404190 0.404301 0.404302
0.4 0.477144 0.477226 0.477360 0.477490 0.477492
0.5 0.512285 0.512363 0.512514 0.512650 0.512653
0.6 0.505540 0.505615 0.505759 0.505888 0.505894
0.7 0.453462 0.453526 0.453650 0.453760 0.453767
0.8 0.353168 0.353216 0.353306 0.353387 0.353393
0.9 0.202468 0.202493 0.202541 0.202583 0.202587
CPU
Time (s) 0.1131 0.1077 0.1048 0.1045 0.1064
Table 20. Absolute error and computational time for different spatial mesh sizes with fixed time step τ = 0.005 and fractional order λ = 1.5 at t = 1 for Example 4.
Table 20. Absolute error and computational time for different spatial mesh sizes with fixed time step τ = 0.005 and fractional order λ = 1.5 at t = 1 for Example 4.
L CPU Time (s) L CPU Time (s)
M = 2 M = 3
M 4.452998 × 10 2 0.0816 1.751640 × 10 2 0.0860
M 2 1.042219 × 10 2 0.0901 1.642833 × 10 3 0.1240
M 3 2.225510 × 10 3 0.1029 2.860265 × 10 4 0.1721
Table 21. The numerical solutions of Example 5 at t = 1 for different values of fractional orders λ against the exact solution (for λ = 2 ), for h = 0.02 and τ = 0.001 .
Table 21. The numerical solutions of Example 5 at t = 1 for different values of fractional orders λ against the exact solution (for λ = 2 ), for h = 0.02 and τ = 0.001 .
x λ = 1.9 λ = 1.99 λ = 1.999 λ = 1.9999 λ = 1.99999 λ = 2
0.1 0.004782 0.001507 0.001103 0.001062 0.0010577 0.001
0.2 0.015093 0.008907 0.008176 0.008103 0.0080944 0.008
0.3 0.036638 0.028195 0.027224 0.027126 0.027116 0.027
0.4 0.075364 0.065376 0.064253 0.064139 0.064128 0.064
0.5 0.137298 0.126458 0.125264 0.125144 0.125132 0.125
0.6 0.228396 0.217442 0.216260 0.216141 0.216129 0.216
0.7 0.354523 0.344318 0.343238 0.343130 0.343119 0.343
0.8 0.521431 0.513064 0.512194 0.512106 0.512098 0.512
0.9 0.734754 0.729642 0.729118 0.729066 0.729060 0.729
CPU
Time (s) 1.7792 1.8116 1.7440 1.7499 1.7263
Table 22. Absolute errors for Example 5 with τ = 0.0001 , h = 0.02 at t = 1 for different fractional orders λ against the exact solution (for λ = 2 ).
Table 22. Absolute errors for Example 5 with τ = 0.0001 , h = 0.02 at t = 1 for different fractional orders λ against the exact solution (for λ = 2 ).
x λ = 1.9 λ = 1.99 λ = 1.999 λ = 1.99999
0.1 3.7775 × 10 3 4.8292 × 10 4 7.5005 × 10 5 2.9753 × 10 5
0.2 7.0842 × 10 3 8.6717 × 10 4 1.3065 × 10 4 4.8676 × 10 5
0.3 9.6227 × 10 3 1.1448 × 10 3 1.6884 × 10 4 6.0163 × 10 5
0.4 1.1344 × 10 2 1.3206 × 10 3 1.9201 × 10 4 6.6463 × 10 5
0.5 1.2275 × 10 2 1.4007 × 10 3 2.0201 × 10 4 6.8931 × 10 5
0.6 1.2372 × 10 2 1.3859 × 10 3 1.9943 × 10 4 6.7889 × 10 5
0.7 1.1499 × 10 2 1.2666 × 10 3 1.8164 × 10 4 6.2685 × 10 5
0.8 9.4109 × 10 3 1.0216 × 10 3 1.4812 × 10 4 5.1637 × 10 5
0.9 5.7409 × 10 3 6.1558 × 10 4 8.9981 × 10 5 3.2015 × 10 5
Time (s) 6.67 6.77 6.92 6.69
Table 23. The L error and Convergence rate when h = 0.02 at t = 1 for Example 5.
Table 23. The L error and Convergence rate when h = 0.02 at t = 1 for Example 5.
λ = 1.999 CPU Time λ = 1.99999 CPU Time
τ L p τ Second L p τ Second
1 10 1.181179 × 10 2 0.00 1.174013 × 10 2 0.00
1 20 6.182314 × 10 3 0.93401 0.00 6.084512 × 10 3 0.94823 0.01
1 40 3.214926 × 10 3 0.94336
0.01
3.101518 × 10 3 0.97217 0.01
1 80 1.690177 × 10 3 0.92761 0.03 1.567467 × 10 3 0.98454 0.03
1 160 9.179203 × 10 4 0.88073 0.08 7.901715 × 10 4 0.98820 0.08
Table 24. The L error and Convergence rate when τ = 0.0005 at t = 1 for Example 5.
Table 24. The L error and Convergence rate when τ = 0.0005 at t = 1 for Example 5.
λ = 1.999 CPU Time λ = 1.99999 CPU Time
h L p τ Second L p τ Second
1 2 3.686082 × 10 3 6.13 3.509645 × 10 3 6.15
1 4 9.892809 × 10 4 1.89764 6.28 8.735939 × 10 4 2.00629 6.19
1 8 3.992401 × 10 4 1.30912
6.41
2.674315 × 10 4 1.70779 6.38
1 16 2.462376 × 10 4 0.69721 6.48 1.128595 × 10 4 1.24464 6.48
1 32 2.096620 × 10 4 0.23199 6.67 7.593303 × 10 5 0.57172 6.82
Table 25. Absolute error and computational time for different spatial mesh sizes with fixed time step τ = 0.05 and fractional order λ = 1.99999 at t = 1 for Example 5.
Table 25. Absolute error and computational time for different spatial mesh sizes with fixed time step τ = 0.05 and fractional order λ = 1.99999 at t = 1 for Example 5.
L CPU Time (s) L CPU Time (s)
M = 2 M = 3
M 1.10833998 × 10 2 0.0020 8.36798516 × 10 3 0.0022
M 2 7.36660005 × 10 3 0.0031 6.33232913 × 10 3 0.0025
M 3 6.36547108 × 10 3 0.0036 6.10017381 × 10 3 0.0038
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wu, Q.; Shao, J.; Manzoor, M.U.; Yaseen, M. Computational Analysis of the Generalized Nonlinear Time-Fractional Klein–Gordon Equation Using Uniform Hyperbolic Polynomial B-Spline Method. Fractal Fract. 2025, 9, 815. https://doi.org/10.3390/fractalfract9120815

AMA Style

Wu Q, Shao J, Manzoor MU, Yaseen M. Computational Analysis of the Generalized Nonlinear Time-Fractional Klein–Gordon Equation Using Uniform Hyperbolic Polynomial B-Spline Method. Fractal and Fractional. 2025; 9(12):815. https://doi.org/10.3390/fractalfract9120815

Chicago/Turabian Style

Wu, Qingzhe, Jing Shao, Muhammad Umar Manzoor, and Muhammad Yaseen. 2025. "Computational Analysis of the Generalized Nonlinear Time-Fractional Klein–Gordon Equation Using Uniform Hyperbolic Polynomial B-Spline Method" Fractal and Fractional 9, no. 12: 815. https://doi.org/10.3390/fractalfract9120815

APA Style

Wu, Q., Shao, J., Manzoor, M. U., & Yaseen, M. (2025). Computational Analysis of the Generalized Nonlinear Time-Fractional Klein–Gordon Equation Using Uniform Hyperbolic Polynomial B-Spline Method. Fractal and Fractional, 9(12), 815. https://doi.org/10.3390/fractalfract9120815

Article Metrics

Back to TopTop