1 Introduction

Consider the two-dimensional Burgers equation

$$\begin{aligned} \frac{\partial u}{\partial t}+\mu \frac{\partial u}{\partial x}+\mu \frac{\partial u}{\partial y}=\xi \frac{\partial ^2u}{\partial x^2}+\xi \frac{\partial ^2u}{\partial y^2} \quad (x,y,t)\in \Omega \times (t_0 ,t_{out} ] \end{aligned}$$
(1)

where \(\Omega =\left\{ {(x,y)\left| {a\prec x\prec b,c\prec y\prec d} \right. } \right\} \)

With exact solution

$$\begin{aligned} u(x,y,t)=\frac{1}{1+e^{\frac{x+y-t}{2\xi }}}, \end{aligned}$$
(2)

Subject to the initial condition

$$\begin{aligned} \varvec{u(x,y,t_0 )=u_0 (x,y)},\nonumber \\ (x,y,t)\in \Omega \times (t_0 ,t_{out}] \end{aligned}$$
(3)

The Burgers equation is a fundamental pde from fluid mechanics. It occurs in various areas of applied mathematics such as modeling of gas dynamics and traffic flow.

In 1915, Bateman [1] introduced the one-dimensional Burgers equation and metioned. The steady solution is worth of the study. It was later treated by Burger [2] as a mathematical model for turbulence and after whom such an equation is widely referred to as Burgers’ equation many researchers have used various numerical methods to solve the Burgers equation [36].

In these methods fall into the following classes: finite difference method [7, 8], finite volume method [9], finite element method [10], boundary element method [11], and etc.

In this paper, we discuss the development of two numerical algorithms based on B-spline collocation for solving the Burgers’ equation. We consider B-spline collocation in a tensor product framework to discretize both spatial domains. We presented an algorithm that uses a fast block LU scheme with modified alternate row and column elimination.

R. D. Russell and his colleagues [13] suggested a fast algorithm upon a matrix block eigenvalue decomposition to solve spline collocation matrices. In this research, the matrices that arise with this method have two important advantages:

A similar fast algorithm based upon LU decomposition with amendment.

Alternate row and column elimination with partial pivoting to take advantage of the structure of matrices that arise and also it was used just one collocation point per subinterval, the linear system that arise are the smallest among all type of piecewise polynomial collocation method for this problem.

2 Collocation method

We consider a 2D rectangular grid based on a mesh of \(N + 1\) points

(N > 1) in [a, b] and a mesh of M + 1 points (M \(>\) 1) in [c, d] such that

$$\begin{aligned} a=x_0 \prec x_1 \prec \cdots \prec x_N =b, \quad c=y_0 \prec y_1 \prec \cdots \prec y_M =d \end{aligned}$$
(4)

We associate with the mesh on the x domain, \(C^1\)-continuous piecewise polynomials of degree p, i.e., we have a polynomial of degree p for the ith subinterval, \([x_{i-1} ,x_i ]\), \(i=1,\ldots ,N, \)with \(C^1\)- continuity imposed at the internal mesh points. Consequently the dimension of this piecewise polynomial subspace is \({KF }= {K(p-1) }+ 2.\) Similarly, in the y domain, we have a polynomial of degree q for the ith subinterval, \([y_{i-1} ,y_i ]\), \(i=1,\ldots ,N\), with \(C^1\)-continuity imposed at the internal mesh points. Consequently the dimension of this piecewise polynomial subspace is \({ LF = L(q-1)} + 2.\)

To represent the piecewise polynomials, we employ B-spline bases. Let \(\left\{ {\rho _i } \right\} _{i=1}^N , \left\{ {\eta _j } \right\} _{j=1}^M \) be the B-splines bases associated with the above meshes. Thus an approximation \(U_N (x,y,t)\) to the exact solution U(xyt) can be expressed as a linear combination of the tensor product of the B-spline bases functions in x and y with time-dependent coefficients, \(\delta _{ij} (t)\) as follows:

$$\begin{aligned} U_N (x,y,t)=\sum \limits _{i=1}^M {\sum \limits _{j=1}^N {\delta _{ij} (t)} } \rho _i (x)\eta _j (y) \end{aligned}$$
(5)

We define \(\left\{ {\alpha _i } \right\} _{i=1}^{p-1} \)and\(\left\{ {\beta _j } \right\} _{j=1}^{q-1} \) to be the canonical Gaussian points on [0,1] with \(0\prec \alpha _1 \prec \cdots \prec \alpha _{p-1} \prec 1\), and \(0\prec \beta _1 \prec \cdots \prec \beta _{q-1} \prec 1\). The collocation points in the x domain are then defined by

$$\begin{aligned} \begin{array}{l} \lambda _1 =a \\ \lambda _t =x_{i-1} +h_i \alpha _j ,t=1+(i-1).(p-1)+j, \quad i=1,\ldots ,N, j=1,\ldots ,p-1\\ \lambda _{NC} =b \\ \end{array} \end{aligned}$$
(6)

where \(h_i =x_i -x_{i-1}, \quad i=1,\ldots ,N\)

The collocation points in the y domain are defined to be

$$\begin{aligned} \begin{array}{l} \omega _1 =c \\ \omega _t =x_{i-1} +k_i \beta _j ,t=1+(i-1).(q-1)+j, \quad i=1,\ldots ,M, j=1,\ldots ,q-1\\ \omega _{MC} =d \\ \end{array} \end{aligned}$$
(7)

where \(k_i =y_i -y_{i-1}, \quad i=1,\ldots ,M\)

The Burgers’ equation is discretized over the spatial domain by simultaneously collocating at the points \(\left\{ {\lambda _i } \right\} _{i=1}^{KF-1} \) in x and the points \(\left\{ {\omega _j } \right\} _{j=1}^{LF-1} \) in y. The collocation conditions yield the following ODEs in time:

$$\begin{aligned} u_t (\lambda _i ,\omega _j ,t)+\mu u_x (\lambda _i ,\omega _j ,t)+\mu \frac{\partial u}{\partial y}(\lambda _i ,\omega _j ,t)=\xi u_{xx} (\lambda _i ,\omega _j ,t)+\xi u_{yy} (\lambda _i ,\omega _j ,t) \end{aligned}$$
(8)

where \(i=2,\ldots ,KF-1\), and \(j=2,\ldots ,LF-1\).

The boundary conditions are

$$\begin{aligned}&u(a,y,t)-\frac{1}{1+e^{\frac{a+y-t}{2\xi }}}=0,\quad t\in (t_0 ,t_{out} ),y\in (c,d),\quad (\lambda _1 =a)\end{aligned}$$
(9)
$$\begin{aligned}&u(b,y,t)-\frac{1}{1+e^{\frac{b+y-t}{2\xi }}}=0,\quad t\in (t_0 ,t_{out} ),y\in (c,d),\quad (\lambda _{KF} =b)\end{aligned}$$
(10)
$$\begin{aligned}&u(x,c,t)-\frac{1}{1+e^{\frac{x+c-t}{2\xi }}}=0,\quad t\in (t_0 ,t_{out} ),x\in (a,b),\quad (\omega _1 =c)\end{aligned}$$
(11)
$$\begin{aligned}&u(x,d,t)-\frac{1}{1+e^{\frac{d+x-t}{2\xi }}}=0,\quad t\in (t_0 ,t_{out} ),x\in (a,b).\quad (\omega _{LF} =c) \end{aligned}$$
(12)

By substituting (5) into (8)–(11), we get equations in the terms of the unknowns \(\varvec{p}_{ij} (\varvec{t})\). We can then rewrite these equations in matrix Form:

$$\begin{aligned} \varvec{G(\bar{P}(t))=\bar{F}(t,\bar{p}(t))} \end{aligned}$$
(13)

In (13), \(\bar{p}(t)\) is the B-spline coefficient vector, it has the form,

$$\begin{aligned} P(t)=\left[ {{\begin{array}{c} {\bar{p}_1 (t)} \\ {\bar{p}_2 (t)} \\ \vdots \\ {\bar{p}_{KF} (t)} \\ \end{array} }} \right] , \quad \text { where } \bar{P}_i (t)=\left[ {{\begin{array}{c} {p_{i1} (t)} \\ {p_{i2} (t)}\\ \vdots \\ {p_{iKF} (t)} \\ \end{array} }} \right] \end{aligned}$$
(14)

The right hand side vector

$$\begin{aligned} \bar{F}(t,\bar{P}(t))=\left[ {{\begin{array}{c} {F_1 (t,\bar{P}(t))} \\ {F_2 (t,\bar{P}(t))} \\ \vdots \\ {F_{KF} (t,\bar{P}(t))} \\ \end{array} }} \right] \end{aligned}$$
(15)

where each \(F_i (t,\bar{P}(t)) \)has LF components. The expressions for \(F_i (t,\bar{P}(t)),i=1,\ldots ,KF,\)

The matrix G in, can be written as

$$\begin{aligned} G=G_x \otimes G_y \end{aligned}$$
(16)

3 2D B-spline

The B-spline coefficients characterize the projection of the approximate solution onto the B-spline tensor product basis. We can rewrite this 2D

B-spline projection in matrix form as:

$$\begin{aligned} \bar{U}(\bar{\lambda },\bar{\omega },t)=(N_x \otimes N_y )\bar{P}(t)=Q\bar{P}(t) \end{aligned}$$
(17)

where \(\bar{U}(\bar{\lambda },\bar{\omega },t)\) is the evaluation of \(\varvec{U (x, y, t)}\) and

$$\begin{aligned} \lambda =\left[ {{\begin{array}{c} {\lambda _1 } \\ {\lambda _2 } \\ \vdots \\ {\lambda _{KF} } \\ \end{array} }} \right] \otimes e_{LF} ,\quad \omega =e_{KF} \otimes \left[ {{\begin{array}{c} {\omega _1 } \\ {\omega _2 } \\ \vdots \\ {\omega _{LF} } \\ \end{array} }} \right] \end{aligned}$$
(18)

where \(e_{LF} \) is the vector of Is of length LF, \(e_{KF} \) is the vector of Is of length KF.

A fast block matrix system solution algorithm

The algorithm we use is as follows. We assume that \(N_x \) and \(N_y \) are :

$$\begin{aligned} \begin{array}{l} N_x =L_x U_x \\ N_y =L_y U_y \\ \end{array} \end{aligned}$$
(19)

where \(L_x ,L_y \) are lower triangular matrices, and \(U_x ,U_y \) are upper triangular matrices.

Let us simplify the notation by writing (4.12) as

$$\begin{aligned} (N_x \otimes N_y )p=c \end{aligned}$$
(20)

where \(p=P(t)\) and \(c=\bar{U}(\lambda ,\omega ,t). \)The above system can then be rewritten as

$$\begin{aligned} ((L_x U_x )\otimes (L_y U_y ))p=c \end{aligned}$$
(21)

Based on a property of the Kronecker product, we can rewrite the above system as

$$\begin{aligned} ((L_x \otimes L_y )(U_x \otimes U_y ))p=c \end{aligned}$$
(22)

This system can then be solved in 4 steps:

  • Step 1: Solve \((L_x \otimes I_{LF} )\tilde{v}=c\) for \(\tilde{v}\)

  • Step 2: Then solve \((I_{KF} \otimes L_y )v=\tilde{v}\) for \(\varvec{v}\)

  • Step 3: Then solve \((U_x \otimes I_{LF} )\tilde{w}=v\) for \(\varvec{\tilde{w}}\)

  • Step 4: Then solve \((I_{KF} \otimes U_y )w=\tilde{w}\) for \(\varvec{w}\)

where \(\varvec{I}_{LF} \) is the \(LF\times LF\) identity matrix and \(\varvec{I}_{KF} \) is the \(KF\times KF\) identity matrix.

Based on the analysis given in [12]. The cost for step 1 is \(O(N^2p^3)\), the cost of step 2 is \(O(N^2p^3)\), the cost of step 3 \(O(N^2p^3)\) is and the cost of step 4 is \(O(N^2p^3)\). Thus the total cost of for the algorithm is \(O(N^2p^3)\).

If we were to solve (16) simply by the coefficient matrix as a blocks of size \(O(\text{ p }(\text{ LF }\times \text{ LF }))=O(\text{ NP }^2\times \text{ NP }^2)\), the cost of this almost block diagonal with block of this size is \(O(\text{ N }(\text{ NP }^2)^3)=O(\text{ N }^4\text{ P }^6)\) thus by using this algorithm, we have substantial saving.

steps (1) and (2) solve the system

$$\begin{aligned} (L_x \otimes L_y )v=c \end{aligned}$$
(23)

for v.

substitute from step (2) into step (1); we have

$$\begin{aligned} (L_x \otimes I_{LF} )(I_{KF} \otimes L_y )v=c \end{aligned}$$
(24)

Then we can rewrite this equation by using the property of the Kronker product as

$$\begin{aligned} (L_x \otimes L_y )v=c \end{aligned}$$
(25)

A similar argument can be used to show that steps (3) and (4) solve the linear System

$$\begin{aligned} (U_x \otimes U_y )w=v \end{aligned}$$
(26)

At certain points in the algorithm, we know the B-spline coefficients, \(\bar{P}(t)\) and We should evaluate the approximate solution at the collocation points \(\bar{U}(\lambda ,\omega ,t). \)That is, we compute\((N_x \otimes N_y )p=c\), where we know \(N_x ,N_y \)and p . We compute cwith using a matrix multiplication.

4 Numerical implementation of algorithm

We consider the 2D Burgers’ equation (1) the problem domain is \((x,y)\in (0,1)\times (0,1),t\succ 0\)

The exact solution is

$$\begin{aligned} u(x,y,t)=\frac{1}{1+e^{\frac{x+y-t}{2\xi }}} \end{aligned}$$

We set \(\xi =0.01\), and the boundary conditions is

$$\begin{aligned}&u(0,y,t)-\frac{1}{1+e^{\frac{y-t}{2\xi }}}=0,\quad t\in (0,1),y\in (0,1) \\&u(1,y,t)-\frac{1}{1+e^{\frac{1+y-t}{2\xi }}}=0,\quad t\in (0,1),y\in (0,1) \\&u(x,0,t)-\frac{1}{1+e^{\frac{x-t}{2\xi }}}=0,\quad t\in (0,1),x\in (0,1) \\&u(x,1,t)-\frac{1}{1+e^{\frac{x+1-t}{2\xi }}}=0,\quad t\in (0,1),x\in (0,1) \end{aligned}$$

and initial condition is

$$\begin{aligned} u(x,0)=\frac{1}{1+e^{\frac{x+y}{2\xi }}},(x,y)\in [0,1]\times [0,1] \end{aligned}$$

The following notation will be used in numerical result.

  • NCOLL : The number of collocation points per subinterval

  • NUM : The number of subintervals

  • AERR : The absolute error

  • RERR : The relative error

  • TERR : The true error

  • RATE: The rate of convergence

5 Conclusion

A new numerical method, which is based on 2D B-spline collocation algorithm. This leads to an approximation of Burgers’ equation by a large system of time-dependent differential algebraic equation, we then solve using a high quality differential algebraic equation solver. The amount of computation and memory is substantially reduced. In Tables 1, 2, for the collocation solutions we compute at t = 1, the observed AERR, RERR, TERR, and corresponding approximate convergence rates. From the two tables we observe that the expected rates of convergence are indeed observed in the 2D case.

Table 1 The numerical result for (1) equation and corresponding approximate convergence rate
Table 2 The numerical result for (1) equation and corresponding approximate convergence rate