**5. Numerical Results**

In this section, we provide two numerical examples to validate the presented finite difference–collocation method. In the given examples, we calculate the maximum absolute error (MAE), absolute error (AE), and the order of convergence (CO) for each example. With the help of the MAE and CO, we analyze the error and convergence analysis numerically. Furthermore, we have plotted the graphs of the numerical solutions by changing the various parameters of *γ*, *α*, *β*, and scale function *z*(*t*). For the numerical simulations, we take the weight function *w*(*t*) = 1. All numerical simulations were performed with Mathematica software.

The MAE at time *t* is given by

$$\mathcal{E}\_n(t) = \max\_{0 \le x \le 1} |v(x, t) - v\_{\mathcal{N}}(x, t)|,\tag{46}$$

and the order of convergence is defined by

$$\text{CO} = \frac{\log\left(\frac{\mathcal{E}\_{w\_1}(t)}{\mathcal{E}\_{w\_2}(t)}\right)}{\log\left(\frac{\eta\_2}{n\_1}\right)},\tag{47}$$

where *<sup>v</sup>*(*x*, *<sup>t</sup>*) and *<sup>v</sup>*<sup>N</sup> (*x*, *<sup>t</sup>*) are the exact and approximate solutions, respectively. E*n*<sup>1</sup> (*t*) and E*n*<sup>2</sup> (*t*) are the MAEs for two consecutive values *n*<sup>1</sup> and *n*2.

**Example 1.** *Here, we consider the generalized version of the problem given in [34] as*

$$t \ast \mathcal{D}\_t^\gamma v(\mathbf{x}, t) - \frac{\mathbf{x}^2}{2} \frac{\partial^2 v(\mathbf{x}, t)}{\partial \mathbf{x}^2} = 0, \ t \in [0, \tau], \tag{48}$$

*the initial and boundary conditions are given by*

$$\begin{cases} \ v(\mathbf{x},0) = \mathbf{x}^2, \ 0 \le \mathbf{x} \le \mathbf{1},\\ v(0,t) = 0, \ v(\mathbf{1},t) = \mathbf{e}^{t+\gamma}, \ 0 \le t \le \tau. \end{cases} \tag{49}$$

The exact solution of Example (1) is *x*2*et*+*γ*. This problem is solved for various values of N , *γ*, *z*(*t*), and *t*. In Tables 1 and 2, we compare the results obtained by our technique to the given methods in [35–37] at *γ* = 0. We observed that the results obtained by the present method (PM) provided a better approximation for this problem. In Table 3, we have discussed the MAE and CO for various values of *γ* and M. Further, in Figure 1, we plotted the AE comparison graphs for different values of *γ* and observe that the numerical approximation showed good agreement with the exact solution. Figure 2 shows the behavior of the AEs for various values of N with a fixed *γ* = 0.2. We observe from Figure 2 that the numerical solution at N = 6, 8 showed good agreement with the exact solution at *γ* = 0.2. Finally, in Figure 3, we plotted the numerical solutions for the various values of *γ* = 0.1, 0.3, 0.5, 0.7, 0.9 for a fixed value of N = 5.


**Table 1.** Comparison of MAE for Example 1 with *γ* = 0.75, *z*(*t*) = *t*.

**Table 2.** Comparison of MAE for Example 1 with *γ* = 0.9, *z*(*t*) = *t*.


**Table 3.** The CO and MAE for Example 1 with various values of *γ* and *z*(*t*) = *t* 2.


**Figure 1.** Comparison of AE at *t* = 0.5, N = 5, *z*(*t*) = *t*, and different values of *γ* for Example 1.

**Figure 2.** Plot of AE for different values of N at *t* = 0.1 and *z*(*t*) = *t* for Example 1.

**Figure 3.** Comparison of the numerical solution for different values of *γ* at *t* = 1 and *z*(*t*) = *t* <sup>2</sup> for Example 1.

**Example 2.** *Consider the following Example [34],*

$$\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), \ t \in [0, \tau], \tag{50}$$

*where*

$$g(\mathbf{x},t) = 4\pi^2 t^2 \sin(2\pi \mathbf{x}) + \frac{2t^{2-\gamma}\sin(2\pi \mathbf{x})}{(2-3\gamma+\gamma^2)\Gamma(1-\gamma)}\mathbf{x}$$

*with the initial and boundary conditions given by,*

$$\begin{cases} \ v(x,0) = 0, \\ v(0,t) = 0, \ v(1,t) = 0. \end{cases} \tag{51}$$

The exact solution for this Example (2) is *t* <sup>2</sup> sin(2*πx*).

We shall apply the numerical scheme (26) to solve this problem (2) for different values of N with *z*(*t*) = *t* varying the fractional order *γ* = 0.1, 0.3, 0.5, 0.7. We obtain the AEs at the grid points in the given domain, which are shown in Tables 4 and 5, respectively. The results presented in Tables 4 and 5 establish the convergence of the proposed method for different values of *γ*. In Table 6, we show the MAE by varying the different values of *γ* = 0.3, 0.5, 0.7 and M. Further, we show the CO for each value of *γ*, which proves the accuracy of the present method. In Figure 4, we compared the numerical solutions for various choices of *γ* with the exact solution known at *γ* = 0.2. In Figure 5, the solution graphs for different values of N and plot of the exact solution (for *γ* = 0.2) are shown. From Figures 4 and 5, we conclude that the numerical solution obtained by the proposed method converges to the exact solution. Finally, we compared our results with the existing method [34] in Table 7. We see that the proposed method gives better accuracy in approximating the numerical solutions.


**Table 4.** Comparison of AE for Example 2 at *γ* = 0.1, 0.3 and various values of N .

**Table 5.** Comparison of AE for Example 2 at *γ* = 0.5, 0.7 and various values of N .


**Table 6.** The MAE and CO for Example 2 for various values of *γ* and M.


**Table 7.** Comparison of the MAE of Example 2 with *γ* = 0.5.


**Figure 4.** Comparison of the numerical and the exact solution at *t* = 0.1 and different values of *γ* for Example 2.

**Figure 5.** Plot of the numerical solutions for different values of N at *t* = 0.1 for Example 2.
