Introduction

The study of nonlinear partial differential equation (NPDEs) has attracted many researchers due to its pertinent features in many fields of applied science and engineering. The generalized Burgers–Fisher equation (gBFE) appears in a variety of applications in the fields of fluid dynamics, financial mathematics, heat conduction, turbulence, gas dynamics, and many other fields of applied science and engineering. In this article, the discontinuous Legendre wavelet Galerkin method (DLWGM) has been exerted for solving gBFE numerically. This method is fundamentally based on utilization of Legendre wavelets as wavelet basis [1,2,3,4].

The gBFE is defined as [5]

$$\begin{aligned} u_t + \alpha u^{\delta }u_x-u_{xx}=\beta u (1-u^{\delta }), \qquad x\in (0,1), \qquad t\ge 0, \end{aligned}$$
(1)

with the initial condition

$$\begin{aligned} u(x,0) = \left( \frac{1}{2}+\frac{1}{2}\tanh \left( \frac{-\alpha \delta }{2(\delta + 1)}x\right) \right) ^{\frac{1}{\delta }}. \end{aligned}$$
(2)

The exact solution of (1) is given by [5]

$$\begin{aligned} u_{\text{exact}}(x,t) = \left( \frac{1}{2}+\frac{1}{2}\tanh \left( \frac{-\alpha \delta }{2(\delta + 1)}\left( x-\left( \frac{\alpha }{(\delta + 1) }+\frac{\beta (\delta + 1)}{\alpha }\right) t\right) \right) \right) ^{\frac{1}{\delta }}. \end{aligned}$$
(3)

As stated earlier, the discontinuous Legendre wavelet Galerkin (DLWG) scheme combines the discontinuous Galerkin (DG) and Legendre wavelet Galerkin (LWG) method to systematically find numerical solutions of NPDEs. The DG method is a finite element method which forms the weak formulation of the given problem in the piecewise continuous space of functions. However, the Legendre wavelets (LWs) are element-wise discontinuous at the boundary points of the interval. As a result, this will efficiently enable in the construction of weak formulation for the solution of Eq. (1). We construct the variational form of Eq. (1) by following the technique of DG method where numerical fluxes are used to balance with complicated geometries. We will further construct variational form for the initial condition (2). The various properties of LWs are used to transform the variational form of Eq. (1) along with variational form of initial condition (2) into the system of ordinary differential equations (ODEs) that can be solved numerically [3]. In this paper, DLWG method has been successfully used first time ever to obtain the solution of modified Burgers–Fisher equation.

Brief description on LWs

The Rodrigue’s form of Legendre polynomial of degree k is given by

$$\begin{aligned} P_k(x) = \frac{1}{2^k k!}\frac{{\mathrm{d}}^k}{{\mathrm{d}}x^k}[(x^2 - 1)^k]. \end{aligned}$$
(4)

From Eq. (4), we have

$$\begin{aligned}&P_0(x)= 1,~~ P_1(x)= x,\nonumber \\&P_{k}(x) = \frac{2k-1}{k}~x~P_{k-1}(x) - \frac{k-1}{k}~P_{k-2}(x), \quad k\ge 2. \end{aligned}$$
(5)

The Legendre scale function \(\phi _k(x)\) is defined by [6,7,8]

$$\begin{aligned} \phi _k(x)~=~\left\{ \begin{array}{ll} \sqrt{2k+1} ~ P_k(2x-1), &{} \quad x \in [0,1) \\ 0,\quad &{} \quad x \notin [0,1) \end{array}\right. . \end{aligned}$$
(6)

For \(n= 0,1,2,...\), and \(l = 0,1,2,...,2^n - 1\), we define the interval \(I_{nl}\) by

$$\begin{aligned} I_{nl} =\left[ \frac{l}{2^n} , \frac{(l+1)}{2^n}\right) . \end{aligned}$$
(7)

Now for \(p=1,2,...\), we define a subspace of piecewise polynomial functions as follows:

\(V_{p,n} = \{ f : f|_{I_{nl}}\) is a polynomial of degree strictly less than p; and f vanishes elsewhere \(\}\).

The orthonormal basis for the subspace \(V_{p,0}\)  is given by the whole set \(\{\phi _k\}_{k=0}^{p-1}\) which forms an orthonormal basis for the subspace of \(V_{p,n}\). Generally, the subspace \(V_{p,n}\) is spanned by \(2^np\) functions which are obtained from \(\{\phi _k\}_{k=0}^{p-1}\) by dilations and translations [3], given as

$$\begin{aligned} V_{p,n}:= V_{p,nl} = \text{span} \left\{ \phi _{k,nl}(x) = 2^{n/2} \phi _{k}(2^nx - l), 0 \le k \le p-1, 0 \le l \le 2^n - 1 \right\} , \end{aligned}$$
(8)

and

$$\begin{aligned} V_{p,0}\subset V_{p,1}\subset V_{p,2}\subset \cdots V_{p,n}\subset \cdots . \end{aligned}$$

The approximation of a function \(f \in L_2([0,1])\) in \(V_{p,n}\) is expressed by only scale functions as

$$\begin{aligned} P_{p,n}f(x)= P_nf(x)= \sum _{l=0}^{2^n-1}\sum _{k=0}^{p-1} s_{k,nl}\phi _{k,nl}(x), \end{aligned}$$
(9)

where \(P_n\) is the finest scale projection of the function f and \( s_{k,nl}\) are scale coefficients.

Variational form by DLWG method

We construct the weak formulation of Eq. (1) by the DLWG method. The computational domain is [0,1], which is divided into \(N=2^n\) subintervals given by \(I_{nl}=[2^{-n}l,2^{-n}(l+1)]\). Let \(x \in I_{nl}\), now for a specific value of l the numerical solution in space \(V_{p,n}\) can be approximated by

$$\begin{aligned} P_n u(x,t) = \sum _{k=0}^{p-1} c_{k,nl}(t) \phi _{k,nl}(x)=C_l^T(t) \Phi _l(x), \end{aligned}$$
(10)

where \(C_l(t) = [c_{0,nl},c_{1,nl},...,c_{p-1,nl}]^T\). The function \(C_l(t)\) is evaluated from the initial conditions and the weak solution form of Eq. (1), and \(\Phi _l(x) = [\phi _{0,nl}(x),\phi _{1,nl}(x),\ldots ,\phi _{p-1,nl}(x)]^T\) is the vector of the LWs basis.

Let \(u_l^+\) and \(u_l^-\) be the values of u at \(x_l = 2^{-n}l\), \(l=0,1,2,\ldots ,2^{n}-1\) from right and left, respectively [3]

$$\begin{aligned} u^+_l = \lim _{\epsilon \rightarrow 0^+} u(x_l+\epsilon ), \quad u^-_l = \lim _{\epsilon \rightarrow 0^+} u(x_l-\epsilon ), \end{aligned}$$
(11)

where at each boundary point of \(I_{nl}, \{u\}=(u^+ + u^-)/2\) and \([[u]] = u^+ - u^-\) represent the mean and jump of function u respectively.

Now for the approximate solution \(u_h \in V_{p,n} \), weak formulation of Eqs. (1) and (2) is designed by multiplying Eqs. (1) and (2) by all test functions \(v_h\) of subspace \( V_{p,n}\) and integrated over each element \(I_{n,l}\) and thus we obtain the following

$$\begin{aligned}&\int _{I_{n,l}} \frac{\partial u_h}{\partial t}v_h {\mathrm{d}}x + \alpha \int _{I_{n,l}}u_h^\delta \frac{\partial u_h}{\partial x}v_h {\mathrm{d}}x - \int _{I_{n,l}} \frac{\partial ^2 u_h}{\partial x^2}v_h {\mathrm{d}}x \nonumber \\&\quad = \int _{I_{n,l}}\beta u_h (1-u_h^\delta )v_h {\mathrm{d}}x, \end{aligned}$$
(12)
$$\begin{aligned}&\int _{I_{n,l}} u_h(x,0)v_h {\mathrm{d}}x = \int _{I_{n,l}} u(x,0)v_h {\text{d}}x, \end{aligned}$$
(13)

where \(l= 0,1,2,\ldots ,2^{n}-1\). Now simplifying the above equations by formal integration by parts, we obtain

$$\begin{aligned}&\int _{I_{n,l}} \frac{\partial u_h}{\partial t}v_h {\mathrm{d}}x - \int _{I_{n,l}}\left( \alpha \frac{u_h^{\delta +1}}{\delta +1}-\frac{\partial u_h}{\partial x}\right) \frac{\partial v_h}{\partial x} {\mathrm{d}}x + (\hat{f})_{x_{l+1}} v^-_{h(l+1)} - (\hat{f})_{x_{l}} v^+_{h(l)}\nonumber \\&\quad - (\hat{q})_{x_{l+1}} v^-_{h(l+1)} + (\hat{q})_{x_{l}} v^+_{h(l)} = \beta \int _{I_{n,l}} u_h(1-u_h^\delta ) v_h {\mathrm{d}}x, \end{aligned}$$
(14)

for each subinterval \(I_{n,l}\). The functions \(\hat{f}\) and \(\hat{q}\) in Eq. (14) are convection and diffusion numerical fluxes, respectively, which are single-valued functions defined at the boundary points of the subinterval. Since the function \(u_h\) is discontinuous at the boundary points of the subinterval; therefore, the nonlinear convection and diffusion fluxes are replaced by the numerical fluxes \(\hat{f}\) and \(\hat{q}\), which arise from integration by parts. Proper estimation of numerical fluxes is essential for the stability of the DLWG method. In this paper, the convection flux \(\hat{f}\) is decided to be the local Lax–Friedrichs flux which is given by [3]

$$\begin{aligned} \hat{f}=\frac{1}{2}\alpha \left( \frac{(u_h^+)^{\delta + 1}}{\delta + 1} + \frac{(u_h^-)^{\delta + 1}}{\delta + 1}-(u_h^+ -u_h^-)\right) . \end{aligned}$$
(15)

Also, the diffusion flux \(\hat{q} \) [4] is determined as

$$\begin{aligned} \hat{q} = 2^n \beta _0 \mu [[u_h]] + \left\{ \frac{\partial u_h}{\partial x}\right\} + 2^{-n} \beta _1 \left[ \left[ \frac{\partial ^2 u_h}{\partial x^2}\right] \right] . \end{aligned}$$
(16)

The selection of numerical fluxes in DLWG method serves the similar idea as those for the LDG method [3].

The variational form computation

In the present analysis, we separately assess each term of Eq. (14) obtained in section "Variational form by DLWG method” by using the characteristics of the LW basis.

The LWs operational matrix of derivative

Let us define the derivative operator \(D_{p,n}:V_{p,n}\rightarrow V_{p,n}\) for some fixed resolution level n. Let us consider \(P_{p,n} u , D_{p,n} u \in V_{p,n}\) with expansions by the Legendre scale functions. Denoting \(D_{p,n} \Phi _l(x) = \dot{\Phi }_l(x)\), our aim is to find the \(p \times p\) derivative operational matrix R which satisfies [3]

$$\begin{aligned} \dot{\Phi }_l(x) = R.\Phi _l(x), \end{aligned}$$
(17)

where \(\Phi _l(x) = [\phi _{0,nl},\phi _{1,nl}...\phi _{p-1,nl}]\).

The matrix R is calculated as [3]:

$$\begin{aligned} (R)_{i+1,j+1}&=\int _{I_{n,l}}\phi _{i,nl}\frac{\text{d}\phi _{j,nl}}{{\mathrm{d}}x}{\mathrm{d}}x \nonumber \\&= \int _{\frac{l}{2^n}}^{\frac{l+1}{2^n}}\phi _{i,nl}\frac{{\mathrm{d}}\phi _{j,nl}}{{\mathrm{d}}x}{\mathrm{d}}x\nonumber \\&= 2^n \int _{0}^{1}\phi _{i,nl}\frac{{\mathrm{d}}\phi _{j,nl}}{{\mathrm{d}}x}{\mathrm{d}}x\nonumber \\&=2^n( r_0)_{i+1,j+1}, \end{aligned}$$
(18)

where matrix \(r_0\) is given by

$$\begin{aligned} (r_0)_{i+1,j+1} = \int _{0}^{1}\phi _{i,nl}\frac{{\mathrm{d}}\phi _{j,nl}}{{\mathrm{d}}x}{\mathrm{d}}x. \end{aligned}$$
(19)

Now matrix \(r_0\) is calculated by using the Legendre polynomial relation which is given by

$$\begin{aligned} (2j+1)P_{j(x)}=P_{j+1}'(x) - P_{j-1}'(x). \end{aligned}$$
(20)

By using above equation we get

$$\begin{aligned} \frac{\phi _j'(x)}{2\sqrt{2j+1}}= & {} \sqrt{2j-1}\phi _{j-1}(x) + \sqrt{2j-5}\phi _{j-3}(x)+ \cdots \nonumber \\&+ \left\{ {\begin{array}{ll} \phi _0(x), &{} j \; \text{odd}\\ \sqrt{3} \phi _1(x), &{} j \; \text{even} \end{array}}\right. . \end{aligned}$$
(21)

Substituting Eq. (21) in Eq. (18) we get \(r_0\) matrix which is represented by

$$\begin{aligned} (r_0)_{i+1,j+1} = \left\{ {\begin{array}{ll} 2\sqrt{2i+1}\sqrt{2j+1}, &{} j-i \; \text{is odd} \\ 0, &{} \text{otherwise} \end{array}}\right. . \end{aligned}$$
(22)

Now substituting Eq. (22) in Eq. (21), we get derivative operational matrix which is expressed as:

$$\begin{aligned} R_{i+1,j+1} = 2^n \left\{ {\begin{array}{ll} 2\sqrt{2i+1}\sqrt{2j+1}, &{} j-i\; \text{is odd} \\ 0, &{} \text{otherwise} \end{array}}\right. . \end{aligned}$$
(23)

Transformation into ODE

In the present analysis, we use the derivative operational matrix, various properties of Legendre polynomial and the fluxes to transform Eq. (1) into a system of first-order ODEs.

Let us take any test function \(v_h = \phi _{k,nl} \in V_{p,n} , k =0,1,2...,p-1\). Now from first term of Eq. (14) and using Eq. (10), we have

$$\begin{aligned} \int _{I_{n,l} }\frac{\partial u_h}{\partial t} v_h {\mathrm{d}}x= & {} \int _{I_{n,l}} \frac{\partial (C^T_l(t) \Phi _l(x))}{\partial t} v_h {\mathrm{d}}x\nonumber \\= & {} \frac{{\mathrm{d}}C^T_l(t)}{{\mathrm{d}}t} \int _{I_{n,l}} \Phi _l(x) \phi _{k,nl}(x) {\mathrm{d}}x \nonumber \\= & {} \frac{{\mathrm{d}}c_{k,nl}}{{\mathrm{d}}t}. \end{aligned}$$
(24)

Taking the advantage of Eq. (23), we obtain the following calculation for second term of Eq. (14)

$$\begin{aligned}&\int _{{I}_{n,l}}\left( \alpha \; \frac{u_h^{\delta +1}}{\delta +1}-\frac{\partial u_h}{\partial x}\right) \frac{\partial \phi _{k,nl}(x)}{\partial x} {\mathrm{d}}x \nonumber \\&\quad = \alpha \int _{I_{n,l}} \frac{u_h^{\delta +1}}{\delta +1} \frac{\partial \phi _{k,nl}(x)}{\partial x} {\mathrm{d}}x - \int _{I_{n,l}} \frac{\partial u_h}{\partial x}\frac{\partial \phi _{k,nl}(x)}{\partial x} {\mathrm{d}}x\nonumber \\&\quad = \alpha \int _{I_{n,l}} \frac{u_h^{\delta +1}}{\delta +1} \frac{\partial \phi _{k,nl}(x)}{\partial x} {\mathrm{d}}x - \int _{I_{n,l}} \frac{\partial (C_l^T(t)\Phi _l(x))}{\partial x}\frac{\partial \phi _{k,nl}(x)}{\partial x} {\mathrm{d}}x\nonumber \\&\quad = \alpha \int _{I_{n,l}} \frac{u_h^{\delta +1}}{\delta +1} \frac{\partial \phi _{k,nl}(x)}{\partial x} {\mathrm{d}}x - C^T_l(t) \int _{I_{n,l}}\frac{{\mathrm{d}}\Phi _l(x)}{{\mathrm{d}}x}\frac{{\mathrm{d}}\phi _{k,nl}}{{\mathrm{d}}x} {\mathrm{d}}x \nonumber \\&\quad = \alpha \int _{I_{n,l}} \frac{u_h^{\delta +1}}{\delta +1} \frac{\partial \phi _{k,nl}(x)}{\partial x} {\mathrm{d}}x - 2^n C^T_l(t) r_0^T \int _{I_{n,l}}\Phi _l(x)\frac{{\mathrm{d}}\phi _{k,nl}}{{\mathrm{d}}x} {\mathrm{d}}x\nonumber \\&\quad = \alpha \int _{I_{n,l}} \frac{u_h^{\delta +1}}{\delta +1} \frac{\partial \phi _{k,nl}(x)}{\partial x} {\mathrm{d}}x - 4^n C^T_l(t) r_0^T r_0(:,k+1), \end{aligned}$$
(25)

where \(C_l^T(t) \) are the coefficients of the numerical solution \(u_h\) on a certain subinterval \(I_{n,l}\) and \(r_0(:,k+1)\) denotes the \((k+1)\)th column of the derivative operational matrix \(r_0\).

Now we need to calculate the convection and diffusion fluxes, i.e., third and fourth term of Eq. (14). For the computation of fluxes, we must first calculate \(u^+\) and \(u^-\) at nodes \(x_l\) using the properties of Legendre polynomials

$$\begin{aligned} P_k(1) =1 ,\quad P_k(-1)=(-1)^k, \end{aligned}$$
(26)

and the Legendre basis functions

$$\begin{aligned} \phi _k(0)=(-1)^k \sqrt{2k+1}, \quad \phi _k(1)=\sqrt{2k+1}. \end{aligned}$$
(27)

Thus for \(l= 1,2,3,\ldots ,2^n-2\), we have

$$\begin{aligned} u^+(x_l)=u^+(x_{l+1})&=C_l^T(t)\Phi _l(x_{l+1}=(l+1)/2^n)\nonumber \\&= 2^{n/2} C_l^T(t)[1,-\sqrt{3},...,(-1)^k\sqrt{2k+1}...,(-1)^{p-1}\sqrt{2p-1}]\nonumber \\&= 2^{n/2} C_l^T(t) \Phi _{-k}, \end{aligned}$$
(28)

where \(\Phi _{-k} = [1,-\sqrt{3},...,(-1)^k\sqrt{2k+1}...,(-1)^{p-1}\sqrt{2p-1}]\). Similarly we obtain

$$\begin{aligned} u^-(x_l)=u^-(x_{l+1})&= 2^{n/2} C_l^T(t)[1,-\sqrt{3},...,\sqrt{2k+1}...,\sqrt{2p-1}]\nonumber \\&= 2^{n/2} C_l^T(t)\Phi _{k}. \end{aligned}$$
(29)

Additionally, for \(l = 0\) and \(l = 2^n-1\), the boundary conditions are substituted into these computations.

Using Eqs. (28) and (29), we have [3]

$$\begin{aligned}&\frac{\partial u_h^+}{\partial x}\bigg|_{x_l} = \frac{\partial u_h^+}{\partial x}\bigg|_{x_{l+1}} = 2^{3n/2}C_l^T(t) r_0^T \Phi _{-k}, \end{aligned}$$
(30)
$$\begin{aligned}&\frac{\partial u_h^-}{\partial x}\bigg|_{x_l} = \frac{\partial u_h^-}{\partial x}\bigg|_{x_{l+1}} = 2^{3n/2}C_l^T(t) r_0^T \Phi _{k}, \end{aligned}$$
(31)
$$\begin{aligned}&\frac{\partial ^2 u_h^+}{\partial x^2}\bigg|_{x_l} = \frac{\partial ^2 u_h^+}{\partial x^2}\bigg|_{x_{l+1}} = 2^{5n/2}C_l^T(t) (r_0^T)^{2} \Phi _{-k}, \end{aligned}$$
(32)
$$\begin{aligned}&\frac{\partial ^2 u_h^-}{\partial x^2}\bigg|_{x_l} = \frac{\partial ^2 u_h^-}{\partial x^2}\bigg|_{x_{l+1}} = 2^{5n/2}C_l^T(t) (r_0^T)^{2} \Phi _{k}. \end{aligned}$$
(33)

Now using Eqs. (28), (29), (30), (31), (32) and (33), we can compute the value of fluxes given in third and fourth term of Eq. (14).

The third term of Eq. (14) becomes

$$\begin{aligned}&(\hat{f})_{x_{l+1}}v^-_{h(l+1)}-(\hat{f})_{x_l}v^+_{h(l)}\nonumber \\&\quad = (\hat{f})_{x_{l}}(v^-_{h(l+1)}-v^+_{h(l)})\nonumber \\&\quad =(\hat{f})_{x_{l}}(1-(-1)^k)\sqrt{2k+1}\nonumber \\&\quad = \frac{\alpha }{2}\left[ \frac{(2^{n/2}C_l^T(t)\Phi _{-k})^{\delta +1}}{\delta +1} + \frac{(2^{n/2}C_l^T(t)\Phi _{k})^{\delta +1}}{\delta +1} \right. \nonumber \\&\qquad -\left. 2^{n/2}C_l^T(t)(\Phi _{-k}-\Phi {k})\right] (1-(-1)^k)\sqrt{2k+1}= A(t). \end{aligned}$$
(34)

Next, the fourth term of Eq. (14) is calculated as:

$$\begin{aligned}&(\hat{q})_{x_{l+1}}v^-_{h(l+1)}-(\hat{q})_{x_l}v^+_{h(l)}\nonumber \\&\quad = (\hat{q})_{x_{l}}(v^-_{h(l+1)}-v^+_{h(l)})\nonumber \\&\quad =(\hat{q})_{x_{l}}(1-(-1)^k)\sqrt{2k+1}\nonumber \\&\quad = 2^{3n/2}C_l^T\left[ \beta _0(\Phi _{-k}-\Phi _{k}) +\frac{r_0^T}{2}(\Phi _{-k}+\Phi _{k})\right. \nonumber \\&\qquad +\left. \beta _1(r_0^T)^2(\Phi _{-k}+\Phi _{k})\right] ((-1)^k-1)\sqrt{2k+1}=B(t). \end{aligned}$$
(35)

Finally, the fifth term of Eq. (14) is calculated as:

$$\begin{aligned} \beta \int _{I_{n,l}}u_h(1-u_h^\delta )\phi _{k,nl}{\mathrm{d}}x= & {} \beta \int _{I_{n,l}}u_h \phi _{k,nl}-\beta \int _{I_{n,l}}u_h^{\delta +1}\phi _{k,nl}{\mathrm{d}}x\nonumber \\= & {} \beta \int _{I_{n,l}}(C_{l}^T(t)\Phi _l(x)) \phi _{k,nl}-\beta \int _{I_{n,l}}u_h^{\delta +1}\phi _{k,nl}{\mathrm{d}}x\nonumber \\= & {} \beta c_{k,nl} - \beta \int _{I_{n,l}}u_h^{\delta +1}\phi _{k,nl}{\mathrm{d}}x. \end{aligned}$$
(36)

Now, we use Eqs. (24), (25), (34), (35) and (36) and obtain ODE system from the DLWG space discretization. For each k and l, where \(k=0,1,2,\ldots ,p-1, l = 0,1,\ldots ,2^n-1\), we have

$$\begin{aligned} \frac{{\mathrm{d}}c_{k,nl}}{{\mathrm{d}}t}= & {} \alpha \int _{I_{n,l} }\frac{u_h^{\delta +1}}{\delta + 1} \frac{\phi _{k,nl}(x)}{{\mathrm{d}}x}{\mathrm{d}}x-4^nC_l^T(t)r_0^Tr_0(:,k+1)-A(t)\nonumber \\&-B(t)+\beta c_{k,nl}-\beta \int _{I_{n,l}}u_h^{\delta +1}\phi _{k,nl}{\mathrm{d}}x. \end{aligned}$$
(37)

In addition, initial condition for the above system is given by

$$\begin{aligned} \int _{I_{n,l}}u(x,0) \phi _{k,nl}(x) &= {} \int _{I_{n,l}}u_h(x,0) \phi _{k,nl}(x)\nonumber \\ &= {} \int _{I_{n,l}}C_l^T(0)\Phi _l(x)\phi _{k,nl}(x)\nonumber \\ &= {} C_l^T(0)\int _{I_{n,l}}\Phi _l(x)\phi _{k,nl}(x)\nonumber \\&= {} c_{k,nl}(0). \end{aligned}$$
(38)

Equation (37) gives the first-order ODE system in the present DLWG method for \(k = 0,1,\ldots ,p-1\) and \(l = 0,1,\ldots ,2^n-1\); where \(c_{k,nl}(0)\) are the coefficients of the initial numerical solution given by Eq. (38).

Numerical experiment

The gBFE (1) with initial condition (2) is transformed to the system of ODE (37), along with initial condition Eq. (38). Now we solve Eqs. (37) and (38) by using MATLAB for different values of \(\alpha , \beta \) and \(\delta \) to exhibit the efficiency and appropriateness of the DLWG method.

Table 1 Comparison by absolute errors between exact and numerical solutions of Eq. (1) for \(\alpha = 0.1, \beta = 0.1 , \delta = 1\) and \(t = 0.1\) with \(n = 4\) and \(p = 4\)
Fig. 1
figure 1

a 2-D plot of exact and numerical solution of Eq. (1) for \(\alpha = 0.1, \beta = 0.1 , \delta = 1\) and \(t = 0.1\) with \(n = 4\) and \(p = 4\), b absolute error distribution for DLWG solution

Table 2 Comparison by absolute errors between exact and numerical solutions of Eq. (1) for \(\alpha = 0.01,\beta = 0.01 , \delta = 1\) and \(t = 0.1\) with \(n = 4\) and \(p = 4\)
Fig. 2
figure 2

a 2-D plot of exact and numerical solution of Eq. (1) for \(\alpha = 0.01, \beta = 0.01 , \delta = 1\) and \(t = 0.1\) with \(n = 4\) and \(p = 4\), b absolute error distribution for DLWG solution

Table 3 \(L_{\infty }\) error for \(\alpha =\beta =0.1\) and \(\delta =2\)  at  \(t = 20\)
Fig. 3
figure 3

3-D surface solution for \(\alpha = 0.1, \beta = 0.1, \delta = 2\) and \(0 \le t \le 20\) with \(p = 5\) and \(n = 5\)

Table 4 \(L_{\infty }\) error for \(\alpha =\beta =0.5\) and \(\delta =2\) at \( t =10\)
Fig. 4
figure 4

3-D surface solution for \(\alpha =\beta =0.5\), \(\delta =2\) and \(0 \le t \le 10\) with \(p = 5\) and \(n = 5\)

Tables 1 and 2 show the results of numerical solutions along with exact solutions and the corresponding absolute errors. Table 3 shows \(L_{\infty }\) error for \(0 \le t \le 20\) and \(0 \le x \le \) 1 and Table 4 shows \(L_{\infty }\) error for \(0 \le t \le 10\) and \(0 \le x \le 1\). Accuracy of DLWG method is directly proportional to the value of n and p which is clearly illustrated through Tables 3 and 4. Figures 1 and 2 depict the comparisons between exact solution with DLWG solution and also corresponding error distributions have been presented respectively. Also 3-D surface solutions of modified Burgers–Fisher equation have been displayed in Figs. 3 and 4 respectively.

Conclusion

The prominent advantage of the proposed method is that the differential operator, boundary conditions and numerical fluxes involved in the elementwise computation can be done with less computational overhead. The operational matrix representation of the differential operator is simpler because of the advantages of the Legendre wavelets.

In the present article, the DLWG method is used to find the numerical solution of gBFE (1) and initial condition (2). The DLWG method transforms (1) into the system of first-order ODE given in Eq. (37) and the initial condition converted into Eq. (38). It is quite plausible that the numerical results rendered by the proposed method are quite satisfactorily agree with the exact solutions. The numerical experiments presented in this paper well establish the efficiency and applicability of the proposed technique. In brief summary, the proposed DLWG scheme maintains the advantages of both the wavelet Galerkin method and the DG method, such as the sparse representations of operators, consistency, higher-order accuracy and thus significantly improves the traditional DG method. In future, the proposed method may be implemented to solve the space-time fractional advection–diffusion equation, the space-time fractional advection–diffusion equation, the space fractional-order diffusion equation, time-fractional fourth-order reaction diffusion model, time fractional Tricomi-type model and time fractional cable model [9,10,11,12,13,14].