**1. Introduction**

Fractional calculus (FC) is an important branch of applied mathematics, which deals with the arbitrary order derivative and integration [1–5]. Its applications in different fields are seen in biophysics [6], engineering [7], fluid mechanics and bioengineering [8,9] and other areas including image processing [10–13]. Most of these studies are mainly based on the traditional fractional derivatives, such as the Riemann–Liouville fractional derivative and the Caputo fractional derivative, etc. Recently, in [14] Agrawal discussed a new GFD, which generalized the traditional derivatives using weight and scale functions. The scale functions were used to compress and enlarge the domain for the close observation of physical phenomena, while the weight functions provide flexibility for the researchers to assess physical events at different times. Due to such behaviors of the scale and weight functions, the study of fractional partial differential equations (FPDE) using a GFD has attracted researchers in recent years. Several authors have developed numerical schemes for solving FPDEs involving GFDs. Here, we cite only few of them. In [15,16], Agrawal and coauthors presented the numerical solutions to the Berger's equation and the fractional advection–diffusion equation (FADE) with a generalized time-fractional derivative for the first time. The numerical solutions to these problems were obtained using the finite difference method. Further, the authors of [17,18], studied the time-fractional telegraph equations and fractional advection–diffusion equations in terms of GFDs and developed the higher order schemes to solve such equations. Kumar et al. [19] presented two numerical schemes to approximate the GFDs and obtained the convergence orders as (2 − *α*) and (3 − *α*), respectively. Further, these schemes were applied to solve the fractional integrodifferential equations defined in terms of GFDs. In [20], Kumari and Pandey proposed

**Citation:** Kumar, S.; Pandey, R.K.; Kumar, K.; Kamal, S.; Dinh, T.N. Finite Difference–Collocation Method for the Generalized Fractional Diffusion Equation. *Fractal Fract.* **2022**, *6*, 387. https://doi.org/ 10.3390/fractalfract6070387

Academic Editor: Tomasz W. Dłotko

Received: 25 May 2022 Accepted: 6 July 2022 Published: 11 July 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

an approximation method with a (4 − *α*)*th* order of convergence to approximate GFDs and applied it to solve the fractional advection–diffusion equations. Li and Wong [21] discussed a numerical scheme to find the solution of the generalized subdiffusion equation. Here, the authors used the generalized Grunwald–Letnikov approximation method to solve the problem. Some other recently presented methods for solving different types of fractional diffusion equations are summarized as follows: in [22], the authors discussed the matrix method for the reaction–diffusion equation that involved the Mittag–Leffler kernel. Duan et al. [23] solved the convection–diffusion equations using the Shannon– Runge–Kutta–Gill method. In [24], the authors discussed the solution to the fractional subdiffusion and the reaction–subdiffusion equations with a nonlinear source term using the Legendre collocation method. Lin and Xu [25] solved the time-fractional diffusion equation (TFDE) using the spectral method and finite difference method (FDM). In [26], Murio solved the time-fractional advection–diffusion equation (TFADE) by using implicit FDM. Sweilam et al. [27] developed the Crank–Nicolson FDM to solve a linear TFDE defined with a Caputo fractional derivative. In [28], Luchko solved the initial value and boundary value multi-term TFDE using the Fourier series method. Dubey et al. [29] proposed a residual power series method to obtain the solution of homogeneous and nonhomogeneous nonlinear fractional order partial differential equations.

In this paper, we study the generalized fractional diffusion equation (GFDE) obtained from the standard diffusion equation by replacing the first-order time derivative term with a fractional derivative of order *γ*, 0 < *γ* < 1, given as,

$$\mathbf{x} \ast \mathcal{D}\_t^\gamma v(\mathbf{x}, t) = \frac{\partial^2 v(\mathbf{x}, t)}{\partial \mathbf{x}^2} + \mathbf{g}(\mathbf{x}, t), \; \mathbf{x} \in [0, 1], \; t \in [0, \pi], \tag{1}$$

with initial and boundary conditions,

$$\begin{cases} \ v(\mathbf{x},0) = \eta\_1(\mathbf{x}), \quad 0 \le \mathbf{x} \le 1, \\\ v(0,t) = \eta\_2(t), \ v(1,t) = \eta\_3(t), \quad 0 \le t \le \mathbf{r}, \end{cases} \tag{2}$$

where *g*(*x*, *t*) is the source/sink function.

The motive of this paper is to construct an efficient method to obtain the numerical solution to the GFDE. The present method is based on the finite difference and collocation methods with Jacobi polynomials as the basis function. The outline of the paper is as follows: In Section 2, we discuss some basic facts about FC and Jacobi polynomials, which are needed throughout this paper. In Section 3, first, the finite difference method is used to discretize the time derivative. Second, on the space variable, we use the collocation method for numerical approximation. Further, we estimate the error and convergence analysis analytically, which ensures the numerical applicability of the proposed method. In Section 5, we present two numerical examples to validate the proposed method. Furthermore, we compare our results with a few other methods from the literature, which are presented in Section 5. Finally, in Section 6, the conclusions are discussed.
