Introduction

We consider the following Burgers–Fisher equation of the form

$$\begin{aligned}&\frac{\partial v}{\partial t} - \frac{\partial ^2 v}{\partial x^2} + \alpha v\frac{\partial v}{\partial x} + \beta v(1-v) = 0 , \\&\quad a\le x\le b \quad {\hbox {and}} \quad t\ge 0 \end{aligned}$$
(1)

where \(\alpha \) and \(\beta \) are advection and source/sink constants.

Initial and boundary conditions are as follows:

$$\begin{aligned} v(x,0)= f(x) \quad {\hbox {for}} \quad a\le x\le b \end{aligned}$$
(2)
$$\begin{aligned} v(a,t)= g_0(t)\end{aligned}$$
(3)
$$\begin{aligned} v(b,t)= g_1(t) \end{aligned}$$
(4)

This manuscript deals with the numerical solution of Burgers–Fisher equation, which is nonlinear and parabolic in nature. It describes the mathematical model of many physical situations occurring in various fields of science and engineering such as heat conduction, gas dynamics, chemical physics and nonlinear optics. For example, it models velocity profile of viscous fluid in fluid dynamics [1], gas dynamics in an exhaust pipe [2], etc. It represents a prototypical model for relating the interaction between the convection effect, reaction mechanism and diffusion transport. It plays a significant role in nonlinear physics and thus has a great practical importance. Proposed by Fisher [3], it models population dynamics explaining the spatial spread of an advantageous allele and discussing its traveling wave solutions, and the equation originated as

$$\begin{aligned} \frac{\partial v}{\partial t} - D\frac{\partial ^2 v}{\partial x^2} = kv(1-v) \end{aligned}$$
(5)

Fisher’s equation in its initial stages is extensively worked upon, and its solutions are given by various analytical and numerical methods [4,5,6,7,8,9,10]. The Burgers’ equation, which was proposed by Burgers [11] modeling various physical phenomena such as gas dynamics, fluid mechanics, traffic flow and nonlinear acoustics, is given as

$$\begin{aligned} \frac{\partial v}{\partial t} - D\frac{\partial ^2 v}{\partial x^2} + v\frac{\partial v}{\partial x} = 0 \end{aligned}$$
(6)

Various numerical and analytical solutions of this equation are available in the literature [12,13,14,15,16,17,18,19]. Various noble methods were developed to numerically solve Fisher’s reaction–diffusion equation shown in the papers [20,21,22]. The combination of these two equations is commonly known as the Burgers–Fisher equation given by (6).

Recently, various numerical and analytical methods have been used by various researchers to deal with the Burgers–Fisher equation. In 2004, Kaya and El-Sayed numerically simulated the generalized Burgers–Fisher equation [23] and came up with its explicit solutions. Ismail et al. [24] applied Adomian decomposition method (ADM), Javidi [25] employed modified pseudospectral method, Rashidi et al. [26] used homotopy perturbation method (HPM), Khattak [27] employed collocation-based radial basis functions method (CBRBF) and Xu and Xian [28] applied Exp-function method to find the analytic as well as numerical solutions of the generalized Burgers–Fisher equation. Also many other authors used different methods to obtain the analytical and numerical solution of the generalized Burgers–Fisher equation; for example, Zhu and Kang [29] used the B-spline quasi-interpolation method, Zhang and Yan [30] used a lattice Boltzmann model, Sari et al. [31] used the compact finite difference method, Sari et al. [32] developed the polynomial-based differential quadrature method, Zhang et al. [33] used the local discontinuous Galerkin (LDG) methods and Nawaz et al. [34] employed optimal homotopy asymptotic method (OHAM).

Very recently, Yadav and Jiwari [35] employed Galerkin’s finite element method to analyze and approximate the Burgers–Fisher equation. S Malik, Qureshi, Amir, A Malik and Haq [36] used the Exp-function method hybridized with heuristic computation for the numerical simulation of the Burgers–Fisher equation. In 2015, Mittal and Tripathi developed a collocation method using cubic B-splines to numerically solve generalized Burgers–Fisher and generalized Burgers–Huxley equations [37].

Recently, B-spline functions have gained popularity as a powerful tool in the field of image processing, approximation theory and numerical simulation of boundary and initial value problems. B-splines as basis functions have been used in various numerical methods such as B-spline differential quadrature method and B-spline collocation method to deal with the partial differential equations. Cubic B-spline collocation method is used by Goh et al. [38] to solve heat and advection diffusion equations in one dimension. Dag and Saka [39] used the B-spline collocation method for equal-width equation. B-spline collocation method has been also used by Kadalbajoo and Arora [40] to deal with the singular perturbation problems and by Zahra [41] to study PHI-four and Allen–Cahn equations. Ersoy and Dag [42] applied this method to solve Kuramoto–Sivashinsky equation. Khater et al. [43] obtained numerical solution of the Burgers-type equations by using cubic spline collocation method.

In the proposed work, the fourth-order cubic B-spline collocation method is adopted to solve Burgers–Fisher equation. Fourth-order approximation for both single and double derivatives is employed. It has been done by using different end conditions and taking one more term in the Taylor series expansion, thus resulting in very accurate and efficient numerical solutions. Moreover, the present method does not require any involvement of integrals to get the final set of equations, thus reducing the computational efforts to a great extent.

The aim of this work is to investigate the numerical solutions of the Burgers–Fisher equation for different parametric values using collocation method with cubic B-splines as basis functions.

To the best of our knowledge, nobody has yet dealt with the Burgers–Fisher equation with the scheme considered in this work. The present scheme gives the approximate solution at any point of the solution domain. Our work is compared with the previous literature, and results are found to be better in terms of accuracy and efficiency. The proposed method is quite simple and produces highly accurate results for considerably lesser grid size, hence reducing complexity and computational cost.

The organization of this paper is as follows. “Mathematical formulation” section gives a description of the cubic B-spline collocation method. In “Implementation of the method” section, the method is applied to the Burgers–Fisher equation with the treatment of boundary conditions. In “Stability of the scheme” section, stability analysis of the method is carried out. “Numerical experiments and discussions” section presents some test examples of the Burgers–Fisher equation. A summary is given at the end of the paper in “Conclusion” section.

Mathematical formulation

Let us consider an equal partition of the domain \(\Omega \) by the knots \(x_{j}, j=0, 1, 2, \ldots , N\), such that \(h = x_{j}-x_{j-1}\) is the length of each interval. The third-degree B-splines termed as cubic B-splines are given as:

$$\begin{aligned} B_{i,3}(x)= \frac{1}{h^3}\left\{ \begin{array}{l l} (x - x_{i-2})^3 &{} \quad x \in [x_{i-2}, x_{i-1}) \\ (x - x_{i-2})^3-4(x - x_{i-1})^3 &{} \quad x \in [x_{i-1}, x_{i}) \\ (x_{i+2}-x)^3-4(x_{i+1}-x)^3 &{} \quad x \in [x_{i}, x_{i+1}) \\ (x_{i+2}-x)^3 &{} \quad x \in [x_{i+1}, x_{i+2}) \\ 0 &{} \quad \text{ otherwise } \end{array} \right. \end{aligned}$$
(7)

where \([ B_{-1}(x), B_{0}(x), B_{1}(x),\ldots , B_{N}(x), B_{N+1}(x) ]\) forms a basis over the interval.

In cubic B-spline collocation method, exact solution v(xt) is approximated by K(xt) in the form:

$$\begin{aligned} K(x,t) =\displaystyle \sum _{j=-1}^{N+1}a_{j}(t)B_{j}(x) , \end{aligned}$$
(8)

where \(a_{j}(t)\)’s are unknown quantities that are time dependent which we find using boundary conditions and collocation method. It is considered that K(xt) satisfies the following interpolatory and end conditions

$$\begin{aligned} K(x_{j},t)= v(x_{j},t) ,\qquad 0\le j\le N \end{aligned}$$
(9)
$$\begin{aligned} K''(x_{j},t)= v''(x_{j},t) - \frac{1}{12}h^2 v^{(4)}(x_{j},t) ,\quad j=0,N \end{aligned}$$
(10)

If v(xt) is a smooth function and K(xt) is a unique cubic spline interpolant which satisfies the above boundary conditions, then from [44], we have:

$$\begin{aligned} K'(x_{j},t)= v'(x_{j},t) + O(h^4) , \qquad 0\le j\le N \end{aligned}$$
(11)
$$\begin{aligned} K''(x_{j},t)= v''(x_{j},t) - \frac{1}{12}h^2 v^{(4)}(x_{j},t) + O(h^4) , \quad 0\le j\le N \end{aligned}$$
(12)

The approximate values K(xt) and their first-order derivatives at the knots are defined using Taylor expansions and finite difference as follows:

For \(j=0\),

$$\begin{aligned} v^{(4)}(x_{j},t)&=\frac{2K''(x_{0},t)-5K''(x_{1},t)+4K''(x_{2},t)-K''(x_{3},t)}{h^2}\\&\quad + O(h^2) \end{aligned}$$
(13)

For \(1\le j\le N-1\),

$$\begin{aligned} v^{(4)}(x_{j},t)&=\frac{K''(x_{j-1},t)-2K''(x_{j},t)+K''(x_{j+1},t)}{h^2}\\&\quad + O(h^2) \end{aligned}$$
(14)

For \(j=N\),

$$\begin{aligned} v^{(4)}(x_{j},t)&=\frac{2K''(x_{N},t)-5K''(x_{N-1},t)+4K''(x_{N-2},t)-K''(x_{N-3},t)}{h^2}\\&\quad +O(h^2) \end{aligned}$$
(15)

Using Eqs. (13), (14) and (15) in (11), (12), we get

$$\begin{aligned} v'(x_{j},t) = K'(x_{j},t) + O(h^4) , \quad 0\le j\le N \end{aligned}$$
(16)

For \(j=0\),

$$\begin{aligned} v''(x_{0},t)&=\frac{14K''(x_{0},t)-5K''(x_{1},t)+4K''(x_{2},t)-K''(x_{3},t)}{12}\\&\quad +O(h^4) \end{aligned}$$
(17)

For \(1\le j\le N-1\),

$$\begin{aligned} v''(x_{j},t)=\frac{K''(x_{j-1},t)+10K''(x_{j},t)+K''(x_{j+1},t)}{12}+ O(h^4) \end{aligned}$$
(18)

For \(j=N\),

$$\begin{aligned} v''(x_{N},t)&=\frac{14K''(x_{N},t)-5K''(x_{N-1},t)+4K''(x_{N-2},t)-K''(x_{N-3},t)}{12}\\&\quad + O(h^4) \end{aligned}$$
(19)

Using Eqs. (7) and (8), Eqs. (17), (18), (19) can be simplified to be written as

For \(j=0\),

$$\begin{aligned} v''(x_{0},t)=\frac{14a_{-1}-33a_{0}+28a_{1}-14a_{2}+6a_{3}-a_{4}}{2h^2} \end{aligned}$$
(20)

For \(1\le j\le N-1\),

$$\begin{aligned} v''(x_{j},t)=\frac{a_{j-2}+8a_{j-1}-18a_{j}+8a_{j+1}+a_{j+2}}{2h^2} \end{aligned}$$
(21)

For \(j=N\),

$$\begin{aligned} v''(x_{N},t)=\frac{14a_{N+1}-33a_{N}+28a_{N-1}-14a_{N-2}+6a_{N-3}-a_{N-4}}{2h^2} \end{aligned}$$
(22)

Implementation of the method

We discretize Burgers–Fisher equation (1) by Crank–Nicolson scheme to get

$$\begin{aligned}&\frac{v^{(n+1)}-v^{(n)}}{\Delta t}-\frac{v^{(n+1)}_{xx} + v^{(n)}_{xx}}{2} + \alpha \frac{(vv_x)^{(n+1)}+(vv_x)^{(n)}}{2}\\&\quad +\beta \frac{(v(1-v))^{(n+1)}+(v(1-v))^{(n)}}{2}=0 \end{aligned}$$
(23)

Separating the terms of nth and \((n+1)\)th time levels, we get

$$\begin{aligned}&v^{(n+1)}\left[ 1+\frac{\alpha \Delta t}{2}v^{(n)}_{x} + \frac{\beta \Delta t}{2}- \beta \Delta t v^{(n)}\right] \\&\qquad + v^{(n+1)}_{x}\left[ \frac{\alpha \Delta t}{2}v^{(n)}\right] -\frac{\Delta t}{2}v^{(n+1)}_{xx}\\&\quad = v^{(n)}\left[ 1-\frac{\beta \Delta t}{2}\right] +\frac{\Delta t}{2}v^{(n)}_{xx} \end{aligned}$$
(24)

For \(j=0\),

$$\begin{aligned}&\left[ a^{(n+1)}_{-1}+4a^{(n+1)}_{0}+a^{(n+1)}_{1}\right] \left( 1+\frac{\alpha \Delta t}{2}u^{(n)}_{x} + \frac{\beta \Delta t}{2}\right. \\&\qquad \left. - \beta \Delta t u^{(n)}\right) +\left[ a^{(n+1)}_{1}-a^{(n+1)}_{-1}\right] \left( \frac{3\alpha \Delta t}{2h}u^{(n)}\right) \\&\qquad - \frac{\Delta t}{4h^2}\left[ 14a^{(n+1)}_{-1} -33a^{(n+1)}_{0}+28a^{(n+1)}_{1}\right. \\&\qquad \left. -14a^{(n+1)}_{2}+6a^{(n+1)}_{3}-a^{(n+1)}_{4}\right] \\&\quad =\left[ a^{(n)}_{-1}+4a^{(n)}_{0}+a^{(n)}_{1}\right] \left( 1-\frac{\beta \Delta t}{2}\right) +\frac{\Delta t}{4h^2}\\&\;\qquad \left[ 14a^{(n)}_{-1} -33a^{(n)}_{0}+28a^{(n)}_{1}-14a^{(n)}_{2}\right. \\&\qquad \left. +6a^{(n)}_{3}-a^{(n)}_{4}\right] \end{aligned}$$
(25)

We may write it as

$$\begin{aligned}&s_{1}a^{(n+1)}_{-1}+s_{2}a^{(n+1)}_{0}+s_{3}a^{(n+1)}_{1}+s_{4}a^{(n+1)}_{2}\\&\quad +s_{5}a^{(n+1)}_{3}+s_{6}a^{(n+1)}_{4}=b_{1}a^{(n)}_{-1}+b_{2}a^{(n)}_{0}\\&\quad +b_{3}a^{(n)}_{1}+b_{4}a^{(n)}_{2}+b_{5}a^{(n)}_{3}+b_{6}a^{(n)}_{4} \end{aligned}$$
(26)

For \(1\le j\le N-1\),

$$\begin{aligned}&\left[ a^{(n+1)}_{j-1}+4a^{(n+1)}_{j}+a^{(n+1)}_{j+1}\right] \left( 1+\frac{\alpha \Delta t}{2}u^{(n)}_{x}+\frac{\beta \Delta t}{2} \right. \\&\qquad \left. - \beta \Delta t u^{(n)}\right) +\left[ a^{(n+1)}_{j+1}-a^{(n+1)}_{j-1}\right] \left( \frac{3\alpha \Delta t}{2h}u^{(n)}\right) - \frac{\Delta t}{4h^2} \\&\qquad \left[ a^{(n+1)}_{j-2}+8a^{(n+1)}_{j-1}-18a^{(n+1)}_{j}+8a^{(n+1)}_{j+1}+a^{(n+1)}_{j+2}\right] \\&\quad = \left[ a^{(n)}_{j-1}+4a^{(n)}_{j}+a^{(n)}_{j+1}\right] \left( 1-\frac{\beta \Delta t}{2}\right) +\frac{\Delta t}{4h^2}\\&\qquad \left[ a^{(n)}_{j-2}+8a^{(n)}_{j-1}-18a^{(n)}_{j}+8a^{(n)}_{j+1}+a^{(n)}_{j+2}\right] \end{aligned}$$
(27)

We may write it as

$$\begin{aligned}&t_{1}a^{(n+1)}_{j-2}+t_{2}a^{(n+1)}_{j-1}+t_{3}a^{(n+1)}_{j}+t_{4}a^{(n+1)}_{j+1}+t_{1}a^{(n+1)}_{j+2}\\&\quad = p_{1}a^{(n)}_{j-2}+p_{2}a^{(n)}_{j-1}+p_{3}a^{(n)}_{j}+p_{2}a^{(n)}_{j+1}+p_{1}a^{(n)}_{j+2} \end{aligned}$$
(28)

For \(j=N\),

$$\begin{aligned}&\left[ a^{(n+1)}_{N-1}+4a^{(n+1)}_{N}+a^{(n+1)}_{N+1}\right] \left( 1+\frac{\alpha \Delta t}{2}u^{(n)}_{x} + \frac{\beta \Delta t}{2}- \beta \Delta t u^{(n)}\right) \\&\qquad +\left[ a^{(n+1)}_{N}-a^{(n+1)}_{N-2}\right] \left( \frac{3\alpha \Delta t}{2h}u^{(n)}\right) - \frac{\Delta t}{4h^2}\left[ 14a^{(n+1)}_{-1}\right. \\&\qquad \left. -33a^{(n+1)}_{N}+28a^{(n+1)}_{N-1}-14a^{(n+1)}_{N-2}+6a^{(n+1)}_{N-3}-a^{(n+1)}_{N-4}\right] \\&\quad = \left[ a^{(n)}_{N-1}+4a^{(n)}_{N}+a^{(n)}_{N+1}\right] \left( 1-\frac{\beta \Delta t}{2}\right) +\frac{\Delta t}{4h^2}\left[ 14a^{(n)}_{N+1}\right. \\&\qquad \left. -33a^{(n)}_{N}+28a^{(n)}_{N-1}-14a^{(n)}_{N-2}+6a^{(n)}_{N-3}-a^{(n)}_{N-4}\right] \end{aligned}$$
(29)

We may write it as

$$\begin{aligned}&v_{1}a^{(n+1)}_{N-4}+v_{2}a^{(n+1)}_{N-3}+v_{3}a^{(n+1)}_{N-2}+v_{4}a^{(n+1)}_{N-1}+v_{5}a^{(n+1)}_{N}\\&\quad +v_{6}a^{(n+1)}_{N+1}=d_{1}a^{(n)}_{N-4}+d_{2}a^{(n)}_{N-3}+d_{3}a^{(n)}_{N-2}\\&\quad +d_{4}a^{(n)}_{N-1}+d_{5}a^{(n)}_{N}+d_{6}a^{(n)}_{N+1} \end{aligned}$$
(30)

Hence, we get the following system of linear equations:

$$\begin{aligned} AC^{(n+1)}=BC^{(n)} \end{aligned}$$
(31)

where

$$\begin{aligned} C= [a_{-1},a_{0},a_{1},\ldots ,a_{N+1}]^\mathrm{T}\end{aligned}$$
(32)
$$\begin{aligned} A= \left[\begin{array}{llllllll} s_1&\quad s_2&\quad s_3&\quad s_4&\quad s_5&\quad s_6&\quad \ldots&\quad \ldots \\ t_1&\quad t_2&\quad t_3&\quad t_4&\quad t_1&\quad \ldots&\quad \ldots&\quad \ldots \\&\quad t_1&\quad t_2&\quad t_3&\quad t_4&\quad t_1&\quad \ldots&\quad \ldots \\&\quad \ldots&\quad \ldots&\quad \ldots&\quad \ldots&\quad \ldots&\quad&\quad \\&\quad \ldots&\quad \ldots&\quad \ldots&\quad \ldots&\quad \ldots&\quad&\quad \\&\quad \ldots&\quad \ldots&\quad t_1&\quad t_2&\quad t_3&\quad t_4&\quad t_1\\&\quad \ldots&\quad v_1&\quad v_2&\quad v_3&\quad v_4&\quad v_5&\quad v_6 \\ \end{array}\right] \end{aligned}$$
(33)
$$\begin{aligned} B= \left[ \begin{array}{llllllll} b_1&\quad b_2&\quad b_3&\quad b_4&\quad b_5&\quad b_6&\quad \ldots&\quad \ldots \\ p_1&\quad p_2&\quad p_3&\quad p_2&\quad p_1&\quad \ldots&\quad \ldots&\quad \ldots \\&\quad p_1&\quad p_2&\quad p_3&\quad p_2&\quad p_1&\quad \ldots&\quad \ldots \\&\quad \ldots&\quad \ldots&\quad \ldots&\quad \ldots&\quad \ldots&\quad&\quad \\&\quad \ldots&\quad \ldots&\quad \ldots&\quad \ldots&\quad \ldots&\quad&\quad \\&\quad \ldots&\quad \ldots&\quad p_1&\quad p_2&\quad p_3&\quad p_2&\quad p_1\\&\quad \ldots&\quad d_1&\quad d_2&\quad d_3&\quad d_4&\quad d_5&\quad d_6 \\ \end{array}\right] \end{aligned}$$
(34)

Here, we can see that there are \(N+1\) equations in \(N+3\) unknowns. Dirichlet or Neumann boundary conditions \(a_{-1}\) and \(a_{N+1}\) can be eliminated to get \(N+1\) equations in \(N+1\) unknowns. After eliminating \(a_{-1}\) and \(a_{N+1}\), system of equations can be solved with the initial vector \([a^{(0)}_{0}, a^{(0)}_{1}, a^{(0)}_{2}, \ldots , a^{(0)}_{N}]^\mathrm{T}\) at any desired time level. B-spline approximation of initial condition helps to get the initial vector.

Stability of the scheme

In Eq. (24), let us assume

$$\begin{aligned} v^{n}= k, \quad p_{1}=1+\frac{\alpha \Delta t}{2}v^{(n)}_{x} + \frac{\beta \Delta t}{2}- \beta \Delta t v^{(n)},\end{aligned}$$
(35)
$$\begin{aligned} p_{2}= \frac{3\alpha \Delta t}{2h}v^{(n)}, \quad p_{3}=1-\frac{\beta \Delta t}{2} \end{aligned}$$
(36)

Then,

$$\begin{aligned}&\left[ a^{(n+1)}_{j-1}+4a^{(n+1)}_{j}+a^{(n+1)}_{j+1}\right] p_{1} + \left[ a^{(n+1)}_{j+1}-a^{(n+1)}_{j-1}\right] p_{2}\\&\qquad - \frac{\Delta t}{4h^2}\left[ a^{(n+1)}_{j-2}+8a^{(n+1)}_{j-1}-18a^{(n+1)}_{j}+8a^{(n+1)}_{j+1}+a^{(n+1)}_{j+2}\right] \\&\quad = \left[ a^{(n)}_{j-1}+4a^{(n)}_{j}+a^{(n)}_{j+1}\right] p_{3}\\&\qquad +\frac{\Delta t}{4h^2}\left[ a^{(n)}_{j-2}+8a^{(n)}_{j-1}-18a^{(n)}_{j}+8a^{(n)}_{j+1}+a^{(n)}_{j+2}\right] \end{aligned}$$
(37)

Assume \(\frac{\Delta t}{h^2}=L\)

$$\begin{aligned}&\frac{-L}{4}a^{(n+1)}_{j-2}+[p_{1}-p_{2}-2L]a^{(n+1)}_{j-1}+\left[ 4p_{1}+\frac{9L}{2}\right] a^{(n+1)}_{j}\\&\qquad +[p_{1}+p_{2}-2L]a^{(n+1)}_{j+1}-\frac{L}{4}a^{(n+1)}_{j+2}=\frac{L}{4}a^{(n)}_{j-2}\\&\qquad +[p_{3}+2L]a^{(n)}_{j-1} +\left[ 4p_{3}-\frac{9L}{2}\right] a^{(n)}_{j}\\&\qquad +[p_{3}+2L]a^{(n)}_{j+1}+\frac{L}{4}a^{(n)}_{j+2} \end{aligned}$$
(38)

Substituting \(a^{(n)}_{j}=D\xi ^{(n)}\exp (ij\psi h)\), where \(i=\sqrt{-1}\), h is step length, D is amplitude and \(\psi \) is mode number, we have

$$\begin{aligned}&D\xi ^{(n+1)}\left( \frac{-L}{4}e^{-2i\psi h}+[p_{1}-p_{2}-2L]e^{-i\psi h}\right. \\&\quad \left. +\left[ 4p_{1}+\frac{9L}{2}\right] +[p_{1}+p_{2}-2L]e^{i\psi h}-\frac{L}{4}e^{2i\psi h}\right) \\&=D\xi ^{(n)}\left( \frac{L}{4}e^{-2i\psi h}+[p_{3}+2L]e^{-i\psi h}+\left[ 4p_{3}-\frac{9L}{2}\right] \right. \\&\quad \left. +[p_{3}+2L]e^{i\psi h}+\frac{L}{4}e^{2i\psi h}\right) \end{aligned}$$
(39)
$$\begin{aligned}&\xi =\frac{\frac{L}{4}e^{-2i\psi h}+[p_{3}+2L]e^{-i\psi h}+\left[ 4p_{3}-\frac{9L}{2}\right] +[p_{3}+2L]e^{i\psi h}+\frac{L}{4}e^{2i\psi h}}{\frac{-L}{4}e^{-2i\psi h}+[p_{1}-p_{2}-2L]e^{-i\psi h}+\left[ 4p_{1}+\frac{9L}{2}\right] +[p_{1}+p_{2}-2L]e^{i\psi h}-\frac{L}{4}e^{2i\psi h}} \end{aligned}$$
(40)
$$\begin{aligned}&\xi =\frac{\frac{L}{2}\cos (2\psi h)+2[p_{3}+2L]\cos (\psi h)+\left[ 4p_{3}-\frac{9L}{2}\right] }{\frac{-L}{2}\cos (2\psi h)+2[p_{1}-2L]\cos (\psi h)+2ip_{2}\sin (\psi h)+\left[ 4p_{1}+\frac{9L}{2}\right] } \end{aligned}$$
(41)

or

$$\begin{aligned} \xi =\frac{A}{B+Ci} \end{aligned}$$
(42)

where

$$\begin{aligned} A&=\frac{L}{2}\cos (2\psi h)+2[p_{3}+2L]\cos (\psi h)\\&\quad +\left[ 4p_{3}-\frac{9L}{2}\right] \\ B&=\frac{-L}{2}\cos (2\psi h)+2[p_{1}-2L]\cos (\psi h)\\&\quad +\left[ 4p_{1}+\frac{9L}{2}\right] \\ C&=2p_{2}\sin (\psi h) \end{aligned}$$
(43)

For stability of the present scheme, we should have

$$\begin{aligned}&\mid {\xi }\mid ^2<1 \end{aligned}$$
(44)
$$\begin{aligned}&\implies \left| \frac{A}{B+Ci}\right| ^2<1 \end{aligned}$$
(45)
$$\begin{aligned}&\implies \left| \frac{B+Ci}{A}\right| ^2>1 \end{aligned}$$
(46)
$$\begin{aligned}&\implies \frac{B^2 + C^2}{A^2}>1 \end{aligned}$$
(47)

We need to show

$$\begin{aligned} B^2 + C^2 - A^2>0 \end{aligned}$$
(48)

For minimum value of \(B^2+C^2-A^2, \hbox {cos}(\psi \hbox {h})=1\). Thus, on putting values of A, B, C from Eq. (43) in \(B^2+C^2-A^2\), we get \(36\beta \Delta t~(1-k)(2-\beta \Delta t ~k)\) which is obviously positive.

Hence, the proposed collocation method using B-splines as basis function is unconditionally stable.

Numerical experiments and discussions

The exact solution of the Burgers–Fisher equation (1) over the domain \([0,1] \times [0,T]\) is given by [24, 26, 34, 45]

$$\begin{aligned} v(x,t)=\frac{1}{2}+\frac{1}{2}\tanh \left( \frac{-\alpha }{4}\left[ x-\left( \frac{\alpha }{2}-\frac{2\beta }{\alpha }\right) t\right] \right) \end{aligned}$$
(49)

Initial and boundary conditions are as follows:

$$\begin{aligned} v(x,0)= \frac{1}{2}+\frac{1}{2}\tanh \left( \frac{-\alpha x}{4}\right) \end{aligned}$$
(50)
$$\begin{aligned} v(0,t)= \frac{1}{2}+\frac{1}{2}\tanh \left( \frac{\alpha }{4}\left[ \frac{\alpha }{2}-\frac{2\beta }{\alpha }\right] t\right) \end{aligned}$$
(51)
$$\begin{aligned} v(1,t)= \frac{1}{2}+\frac{1}{2}\tanh \left( \frac{-\alpha }{4}\left[ 1-\left[ \frac{\alpha }{2}-\frac{2\beta }{\alpha }\right] t\right] \right) \end{aligned}$$
(52)

In order to test the accuracy and efficiency of the proposed scheme, comparisons of the obtained results are made with the above exact solution and traditional methods such as [26, 31, 32, 35, 36]. MATLAB 8.1 has been utilized in this work for simulations.

Example 1

Here, results are computed for \(\alpha =-1\) and \(\beta =-1\) for different times. Table 1 makes comparison of absolute errors of the present scheme with FEM [35] at different times T. The absolute errors at grid points at times \(T=0.001\), 0.005 and 0.01 are shown in Table 2. Error decreases as time reduces. Method is highly accurate at middle grid points. Figure 1 shows computed solutions in 3D form for \(T=0.01\). Figure 2 depicts error profiles.

Fig. 1
figure 1

Evolution of computed solutions of Example 1 with space and time variables for \(T=0.01\)

Fig. 2
figure 2

Absolute errors of Example 1 for \(\alpha =-1\) and \(\beta =-1\) at different times T

Table 1 Absolute error comparison of the present method with FEM [35] for \(\alpha =-1\) and \(\beta =-1\)
Table 2 Absolute errors at grid points for \(\alpha =-1, \beta =-1\) at different times T

Example 2

Taking \(\alpha =0.001\) and \(\beta =-0.001\), the obtained results of present scheme are compared with FEM [35], EFM [36], OHAM [34] and CFDM [31] at different times in Table 3. The absolute errors at grid points at times \(T=0.001\), 0.005 and 0.01 are shown in Table 4. CPU-time (s) has been calculated for all time levels and is shown in Table 3. Accuracy and low computational cost are the advantages of the method. In Table 5, the absolute errors at grid points for \(T=0.1\) are compared with EFM [36]. Error profiles are depicted in Fig. 3.

Fig. 3
figure 3

Absolute errors of Example 2 for \(\alpha =0.001\) and \(\beta =-0.001\) at different times T

Table 3 Absolute error comparison of the present scheme with different schemes for \(\alpha =0.001\) and \(\beta =-0.001\)
Table 4 Absolute errors at grid points for \(\alpha =0.001, \beta =-0.001\) at different times T
Table 5 Comparison of absolute errors with EFM [36] for time T = 0.1 and \(\alpha =0.001, \beta =-0.001\)

Example 3

The comparison of the present scheme results is made with the results of analytic solutions given by HPM [26] at a different set of values of \(\alpha \) and \(\beta \): Firstly, we take \(\alpha =0.1\) and \(\beta =-0.1\) and then we take \(\alpha =0.5\) and \(\beta =-0.5\) for times \(T=0.1\), 0.4, 0.8 in Table 6. It can be noticed that accuracy of the present method is better than the method used by HPM [26] for the former case and the accuracy gets better as time increases for the latter case. Evolution of computed solutions with space and time variables for \(\alpha =0.5\) and \(\beta =-0.5\) at \(T=1\) is shown in Fig. 4. Comparison of the results obtained by the present method with the analytical solutions reveals the accuracy and ease of implementation of the new method.

Fig. 4
figure 4

Evolution of computed solutions of Example 3 with space and time variables for \(\alpha =0.5\) and \(\beta =-0.5\) at \(T=1\)

Table 6 Comparison of numerical solutions of the present method with analytic solutions of HPM [26] at a different set of values of \(\alpha \) and \(\beta \)

Example 4

Numerical results are obtained for \(\alpha =0.01, \beta =-0.01\) and \(\alpha =0.0001, \beta =-0.0001\) at different times. Table 7 makes comparison of absolute errors \(E_\mathrm{A}\) and relative errors \(E_\mathrm{R}\) of the present scheme with PDQM [32] at different times T. It is noticed that the order of errors is the same for small as well as large times and thus maintains accuracy to a far greater extent. For \(\alpha =0.0001\) and \(\beta =-0.0001\), it can be seen from Table 8 that the same order is maintained for times \(T=1\), 10 and 50 and the results maintain excellent accuracy by just taking \(n=16\). For the same \(\alpha \) and \(\beta \), CPU-time (s) of the present method is calculated and shown in Table 8. Thus, it can be inferred that the present scheme gives an easily computable numerical solution, which needs low storage, minimal computational effort and cost. Hence, it can be resolved that present method is easy and simpler to apply in comparison with other existing methods, e.g., finite volume, finite element, spectral collocation methods, etc. Figure 5 shows error profiles for \(\alpha =0.0001\) and \(\beta =-0.0001\) at time \(T=50\). Computed solutions of the present method for \(\alpha =0.0001\) and \(\beta =-0.0001\) at different times T are depicted in Fig. 6.

Fig. 5
figure 5

Absolute errors of Example 4 for \(\alpha =0.0001\) and \(\beta =-0.0001\) at time \(T=50\)

Fig. 6
figure 6

Computed solutions of the present method in Example 4 for \(\alpha =0.0001\) and \(\beta =-0.0001\) at different times T

Table 7 Comparison of \(E_\mathrm{A}\) and \(E_\mathrm{R}\) of the present method with PDQM [32] at different times T for different parametric values
Table 8 Absolute errors at grid points for \(\alpha =0.0001, \beta =-0.0001\) at different times T

Example 5

Now, we take a different set of values of \(\alpha \) and \(\beta \) as \(\alpha =-0.1, \beta =-0.1\) and \(\alpha =-0.01, \beta =-0.01\). The absolute and relative errors of the obtained results have been presented for \(T=0.01\), 0.1 and 1 in Table 9 and compared with PDQM [32]. Figure 7 depicts approximate solutions of the present method for \(\alpha =-0.1\) and \(\beta =-0.1\) at different times T. We also calculated CPU-time (s) of the present method. When \(\alpha =-0.1\) and \(\beta =-0.1\), CPU-time (s) for \(T=0.01\) is 0.1546, \(T=0.1\) is 0.6453 and \(T=1\) is 5.4911. This shows that computational cost of the present method is low. Hence, it can be clearly seen that the present method is more efficient, accurate and reliable.

Fig. 7
figure 7

Computed solutions of the present method in Example 5 for \(\alpha =-0.1\) and \(\beta =-0.1\) at different times T

Table 9 Comparison of \(E_\mathrm{A}\) and \(E_\mathrm{R}\) of the present method with PDQM [32]

Conclusion

  • The fourth-order cubic B-spline method has been adopted to numerically solve nonlinear Burgers–Fisher equation.

  • Crank–Nicholson for discretization and quasi-linearization to deal with the nonlinear nature of the equation are used.

  • Five examples with varying parameters have been taken to elaborate the efficacy of the method.

  • The numerical results obtained comply with the nature of solution of Burgers–Fisher equation and are better than results available in the literature.

  • Method is very efficient, less complex and can be extended to higher dimensional partial differential equations.