A space–time spectral collocation algorithm for the variable order fractional wave equation

The variable order wave equation plays a major role in acoustics, electromagnetics, and fluid dynamics. In this paper, we consider the space–time variable order fractional wave equation with variable coefficients. We propose an effective numerical method for solving the aforementioned problem in a bounded domain. The shifted Jacobi polynomials are used as basis functions, and the variable-order fractional derivative is described in the Caputo sense. The proposed method is a combination of shifted Jacobi–Gauss–Lobatto collocation scheme for the spatial discretization and the shifted Jacobi–Gauss–Radau collocation scheme for temporal discretization. The aforementioned problem is then reduced to a problem consists of a system of easily solvable algebraic equations. Finally, numerical examples are presented to show the effectiveness of the proposed numerical method.

Spectral methods (Canuto et al. 2006;Saadatmandi and Dehghan 2011;Doha and Bhrawy 2012;Bhrawy and Zaky 2015b, c;Bhrawy et al. 2016a) have been widely used in many fields in the last four decades. In the early times, the spectral method based on Fourier expansion has been used in few fields such as a simple geometric field and periodic boundary conditions. Recently, they have been developed theoretically and used as powerful techniques to solve various kinds of problems. Based on the accuracy and exponential rates of convergence, spectral methods have an excellent reputation when compared with others numerical methods. The expression of the problem solution as a finite series of polynomials/functions is the major step of all types of spectral methods. Then, the coefficients of this expansion will be chosen such that the absolute error is diminished as well as possible.
The spectral collocation method (Canuto et al. 2006;Bhrawy and Alofi 2013;Gu and Chen 2014;Bhrawy and Abdelkawy 2015;Bhrawy 2016a) is a specific type of spectral methods, that is more applicable and widely used to solve almost types of differential Tatari and Haghighi 2014), integral (Bhrawy et al. 2016c; Rahmoune 2013), integro-differential (Jiang and Ma 2013;Ma and Huang 2014) and delay differential Reutskiy 2015) equations. While, the numerical solution will be enforced to almost satisfy the partial differential equations (PDEs) in spectral collocation method. In other words, the residuals may be permitting to be zero at chosen points. Wei and Chen (2012) proposed Legendre spectral collocation methods for pantograph Volterra delay-integro-differential equations. Bhrawy and Alofi (2012) introduced the spectral shifted Jacobi-Gauss collocation method for solving the Lane-Emden type equation.  proposed the spectral collocation algorithm to solve numerically some wave equations subject to initial-boundary nonlocal conservation conditions in one and two space dimensions. Bhrawy (2016b) proposed Jacobi spectral collocation method for solving multi-dimensional nonlinear fractional sub-diffusion equations.
The aim of this paper is to find the numerical solution of the space-time variable order fractional wave equation subject to initial-boundary conditions. The wave equation is an important second-order partial differential equation for the description of waves as they occur in physics such as sound waves, light waves and water waves. Variable order wave equation appears in areas such as acoustics, electromagnetics, and fluid dynamics. This paper extends the SJ-GL-C and SJ-GR-C schemes in order to solve the space-time variable order fractional wave equation. The proposed collocation scheme is investigated for both temporal and spatial discretizations. The SJ-GL-C and SJ-GR-C are proposed, with a suitable modification for treating the boundary and initial conditions, for spatial and temporal discretizations. This treatment, for the conditions, improves the accuracy of the scheme greatly. Therefore, the space-time variable order fractional wave equation with its conditions is reduced to system of algebraic equations which is far easier to be solved. Finally, numerical examples with comparisons lighting the high accuracy and effectiveness of the proposed algorithm are presented.
The present paper is presented as follows. The definitions of the fractional calculus and some properties of Jacobi polynomials are introduced in "Preliminaries" section. The spectral collocation methods for the space-time variable order fractional wave problem subject to initial-boundary conditions are presented in "Jacobi collocation method" section and then illustrated with two examples in "Numerical examples" section. The "Conclusion" is included in the last section.

Preliminaries
We first recall some definitions and preliminaries of the variable-order fractional differential and integral operators and some knowledge of orthogonal shifted Jacobi polynomials that are most relevant to spectral approximations.

Definition 1
The Riemann-Liouville and Caputo differential operators of constant order γ , when n − 1 ≤ γ < n, of f(t) are given respectively by, where Ŵ(.) represents the Euler gamma function.

Definition 3
The Caputo variable-order fractional differential operator is given by It is important to note here that the constant-order fractional derivative can be seen as a special case of the variable-order fractional derivative. These two definitions are related by the following relation: The Jacobi polynomials, denoted by P (θ,ϑ) j (x)(j = 0, 1 . . .); θ > −1, ϑ > −1 and defined on the interval [−1, 1] are generated from the three-term recurrence relation: The formula that relates Jacobi polynomials and their derivatives is The orthogonality condition is Let the shifted Jacobi polynomials P , then they can be obtained with the aid of the following recurrence formula: The analytic form of the shifted Jacobi polynomials P (θ,ϑ) L,i (x) of degree i is given by and the orthogonality condition is The shifted Jacobi-Gauss quadrature is commonly used to evaluate the previous integrals accurately. For any φ ∈ S 2N +1 [0, L], we have where S N [0, L] is the set of polynomials of degree less than or equal to N , x (θ,ϑ) G,L,j (0 ≤ j ≤ N ) and ̟ (θ,ϑ) G,L,j (0 ≤ j ≤ N ) are used as usual the nodes and the corresponding Christoffel numbers in the interval [0, L], respectively.
are the zeros of P (θ,ϑ) L,N +1 (x) and the weights where while the nodes and the corresponding Christoffel numbers in the shifted Jacobi Gauss-Radau (SJ-GR) quadrature are given by , may be expressed in terms of shifted Jacobi polynomials as where the coefficients c j are given by The qth derivative of P (θ,ϑ) L,k (x) can be written as Accordingly, we can calculate the Caputo variable order derivative of shifted Jacobi polynomials from

Jacobi collocation method
In this section, we introduce a numerical algorithm extends the SJ-GL-C and SJ-GR-C schemes in order to solve the space-time variable order fractional wave equation. The collocation points are selected at the SJ-GR and SJ-GL interpolation nodes for temporal and spatial variables, respectively. The core of the proposed method consists of discretizing the space-time variable order fractional wave equation to create a system of algebraic equations of the unknown coefficients. This system can be then easily solved with a standard numerical scheme.
In particular, we consider the following space-time variable order fractional wave equation with the initial conditions and the boundary conditions where B(x, t) > 0, g 0 (x), g 1 (x), g 2 (t) and g 3 (t) are given functions, while f(u, x, t) is a source term.
We choose the approximate solution to be of the form . The approximation of the temporal partial derivative D t u(x, t) can be easily computed as follows A straightforward calculation shows that the fractional derivative of variable order of the approximate solution can be computed by where Now, adopting (18)-(21), enable one to write (15) in the form: while the numerical treatments of initial and boundary conditions are In the proposed shifted Jacobi collocation method, the residual of (15) is set to be zero at (N − 1) 2 of collocation points. Moreover, the initial-boundary conditions in (23) will be collocated at collocation points. Firstly, we have (N − 1) 2 algebraic equations for (N + 1) 2 unknowns of û i,j where and also we have 2(N − 1) algebraic equations which will be obtained due to the initial conditions (21) Furthermore, using the boundary conditions, we have 2(N + 1) algebraic equations Combining Eqs. (24), (26) and (27), we obtain The previous system of nonlinear algebraic equations can be easily solved. After the coefficients a i,j are determined, it is straightforward to compute the approximate solution u N ,M (x, t) at any value of (x, t) in the given domain from the following equation

Numerical examples
This section reports two numerical examples to demonstrate the high accuracy and applicability of the proposed method. We also compare the results given from our scheme and those reported in the literature. The comparisons reveal that our method is very effective and convenient.

with the initial-boundary conditions
The exact solution of this problem when α(x, t) = β(x, t) = 2 is given by Sweilam and Assiri (2015) proposed the non-standard finite difference (NSFD) method to solve this problem with choices of N = 1000 and M = 125. In Table 1, we contrast our numerical results based on absolute errors obtained using the proposed algorithm for three choices of the shifted Jacobi parameters at N = 8 with the corresponding results of NSFD method (Sweilam and Assiri 2015). In Table 2, we contrast our results based on maximum absolute errors (MAEs) obtained by the present method for three choices the shifted Jacobi parameters at N = 8. From the results of this example,     4.86067 × 10 −13 6.82121 × 10 −13 7.95808 × 10 −13 3.4818 × 10 −3 8 2.00448 × 10 −11 5.00222 × 10 −12 6.36646 × 10 −12 9.0641 × 10 −5 we observe that the approximate solution obtained by our method is more better than those obtained in Sweilam and Assiri (2015). Figure 1 displays the space-graph of the numerical solution of problem (1) with N = 8, and θ 1 = θ 2 = ϑ 1 = ϑ 2 = 0. While, Fig. 2 compares graphically the curves of numerical and exact solutions of problem (1) for the different values of t at N = 8, and θ 1 = θ 2 = ϑ 1 = ϑ 2 = 1 2 . Moreover, we represent in Figs. 3 and 4 the absolute error curves obtained by the present method at t = 0.5 and x = 5 with N = 8, and θ 1 = θ 2 = ϑ 1 = ϑ 2 = 0, respectively. This demonstrates that the proposed method leads to an accurate approximation and yields exponential convergence rates.

Conclusions
We presented a collocation method to achieve an accurate numerical solution for variable-order fractional wave problem subject to initial-boundary conditions. One of the most advantages of the present technique is that a fully spectral method was implemented for the time and space variables by using SJ-GR-C and SJ-G-C approximations respectively. The problem with its conditions was then reduced to an algebraic system. The greatest feature of the present scheme is, adding few terms of the SJ-G and SJ-GR collocation points, a full agreement between the approximate and exact solutions was achieved. Through the numerical examples and specially the comparison between the obtained approximate solution and those obtained by other approximations, we demonstrate the validity and high accuracy of the present method.  (2)