Skip to main content

Theory and Modern Applications

Normalized Bernstein polynomials in solving space-time fractional diffusion equation

Abstract

In this paper, we solve a time-space fractional diffusion equation. Our methods are based on normalized Bernstein polynomials. For the space domain, we use a set of normalized Bernstein polynomials and for the time domain, which is a semi-infinite domain, we offer an algebraic map to make the rational normalized Bernstein functions. This study uses Galerkin and collocation methods. The integrals in the Galerkin method are established with Chebyshev interpolation. We implemented the proposed methods for some examples that are presented to demonstrate the theoretical results. To confirm the accuracy, error analysis is carried out.

1 Introduction

Fractional calculus allows mathematicians and engineers better modeling of a wide class of systems with anomalous dynamic behavior and better understanding of the facets of both physical phenomena and artificial processes. Hence the mathematical models derived from differential equations with noninteger/fractional order derivatives or integrals are becoming a fundamental research issue for scientists and engineers [1].

The fractional advection-diffusion equation is presented as a useful approach for the description of transport dynamics in complex systems. The time, space and time-space fractional advection-diffusion equations have been used to describe important physical phenomena that occur in amorphous, colloid, geophysical and geological processes [2].

Bernstein polynomials play an important role in many branches of mathematics, such as probability, approximation theory and computer-aided geometric design [3]. Also, in recent decades, the authors discovered some new analytic properties and some applications for these polynomials. For example, the rate of convergence of these polynomials derived by Cheng [4] for a certain class of functions. Farouki [5] showed that the Bernstein polynomial basis is an optimal stable basis among non-negative bases on the desired interval. Alshbool [6] approximated solutions of fractional-order differential equations with estimation error by using fractional Bernstein polynomials. Also, he applied a new modification of the Bernstein polynomial method called multistage Bernstein polynomials to solve fractional order stiff systems [7].

In this paper, the normalized Bernstein polynomials with collocation and Galerkin methods are applied to turn the problem into an algebraic system. The fractional diffusion equation with variable coefficients is considered

$$ \frac{\partial^{\beta} u(x,t)}{\partial t^{\beta}} = d(x,t) \frac {\partial^{\alpha} u(x,t)}{\partial x^{\alpha}} + b(x,t) \frac {\partial^{\gamma} u(x,t)}{\partial x^{\gamma} }+ s(x,t), \quad 0 < x < b, t \geq0. $$
(1)

In this equation \(u(x,t)\) is the unknown function, \(s(x,t)\) is called the source-term and \(d(x,t)\) and \(b(x,t)\) are the diffusion and advection coefficients, \(1<\alpha\leq2\) and \(0 < \gamma\leq1\) are the orders of space fractional derivatives and \(0 < \beta\leq1\) is the time fractional order. We also consider the initial condition

$$ u(x,0) = u_{0}(x),\quad 0 < x < b, $$
(2)

and the boundary conditions

$$ u(0,t)=g_{0}(t),\qquad u(b,t)= g_{1}(t), \quad t \geq0. $$
(3)

The existence and uniqueness of solutions for such problems are guaranteed in [8, 9]. Note that problem (1) for \(\alpha= 2\), \(\beta= 1\) and \(\gamma= 1\) is the classical advection-diffusion equation. Problem (1) is discussed from the view of some scholars like Gao and Sun [10] who propose a numerical algorithm based on the finite difference method for \(\gamma= 1\), \(\alpha= 2\) and Deng [4] who discussed in the case \(\beta=1 \) a finite element method with Riemann-Liouville space fractional derivatives.

The structure of this paper is as follows. In Section 2, some definitions are presented. In Section 3, normalized Bernstein polynomials and their required properties are given. In Section 4, we introduce the rational Bernstein functions and also describe some useful properties of these basis functions. In Section 5, the relation between the Legendre polynomials and orthonormal Bernstein is demonstrated. In Section 6, to estimate the integrals, we introduce a rational Chebyshev interpolation. In Section 7, Galerkin and collocation methods to approximate the unknown function \(u (x, t) \) are applied. In Section 8, we offer error bounds for integer and fractional derivatives. To show the effectiveness of the proposed method, we report our numerical findings in Section 9; and finally, in Section 10, we give a brief conclusion.

2 Fundamentals of fractional calculus

There are various definitions for fractional derivative and integration. The widely-used definition for a fractional derivative is the Caputo sense and a fractional integration is the Riemann-Liouville definition.

Definition 2.1

([9])

The Riemann-Liouville fractional integral operator of order \(\alpha\geq0 \) is defined as follows:

$$\begin{aligned}& J^{\alpha} f(x)= \frac{1}{\Gamma(\alpha)} \int_{0}^{x} (x-t)^{\alpha -1} f(t) \,dt = \frac{1}{\Gamma(\alpha)} x^{\alpha-1} \ast f(x),\quad \alpha> 0 , x > 0, \end{aligned}$$
(4)
$$\begin{aligned}& J^{0 } f(x) = f(x). \end{aligned}$$
(5)

Definition 2.2

([9])

The Caputo definition of a fractional derivative operator is given by

$$ D^{\alpha} f(x) = J^{m-\alpha} D^{m} f(x)= \frac{1}{\Gamma(m-\alpha)} \int_{0}^{x} (x-t)^{m-\alpha-1} f^{(m)}(t) \,dt, $$
(6)

where \(m - 1 < \alpha\leq m\), \(m \in\mathbb{N} \), \(x > 0\). It has the following two basic properties:

$$ \begin{aligned} &D^{\alpha}J^{\alpha}f(x)= f(x), \\ &J^{\alpha}D^{\alpha}f(x)= f(x)-\sum_{k=0}^{m-1} f^{(k)}\bigl(0^{+}\bigr) \frac {x^{k}}{k!},\quad x > 0. \end{aligned} $$
(7)

For simplicity, we denote \(\frac{\partial^{\alpha_{i}}}{\partial z^{\alpha_{i}}} \) by \(D^{\alpha_{i}}_{z}\) which \(\alpha_{i}\) denotes the Caputo derivative with respect to z, note that \(\alpha_{i}\) may be β, γ or α and z can be x or t.

According to Definition 2.2, the Caputo time and space fractional derivatives of the function u are given as follows.

Definition 2.3

([11])

The Caputo time-fractional derivative operator of order \(\beta> 0 \) is defined as

$$ D_{t}^{\beta} u(x,t) = \textstyle\begin{cases} \frac{1}{\Gamma(m - \beta)} \int_{0}^{t} (t-\xi)^{m-\beta-1} \frac {\partial^{m} u(x,\xi) }{\partial\xi^{m}} \,d\xi, & \mbox{if } m-1< \beta< m, \\ \frac{\partial^{m} u(x,t) }{\partial t ^{m}}, & \beta= m \in\mathbb{N}, \end{cases} $$

and the space-fractional derivative operator of order \(\alpha> 0 \) is defined as

$$ D^{\alpha} _{x} u(x, t) = \textstyle\begin{cases} \frac{1}{\Gamma(m - \alpha)} \int_{0}^{x} (x-\theta)^{m-\alpha-1} \frac{\partial^{m} u(\theta,t) }{\partial\theta^{m}}\, d\theta, & \mbox{if } m-1< \alpha< m, \\ \frac{\partial^{m} u(x,t) }{\partial x ^{m}}, & \alpha= m \in\mathbb{N}. \end{cases} $$

One of the properties of fractional operators is linearity, i.e.,

$$ \xi\bigl(\eta f(x)+ \lambda g(x)\bigr) = \eta \xi\bigl(f(x)\bigr) + \lambda \xi\bigl(g(x)\bigr), $$
(8)

where ξ is the Riemann-Liouville fractional integral operator or Caputo fractional derivative and η and λ are real numbers.

3 Bernstein polynomials

The Bernstein polynomials of degree n on the interval \([0,1]\) are defined as

$$ B_{i,n}(x)= \binom{n}{i} x^{i} (1-x)^{n-i},\quad i=0,1,2,\ldots,n. $$
(9)

According to [12], Bernstein polynomials form a complete basis over the interval \([0,1]\) where they can be produced by the recursive relation

$$ B_{i,n}(x)=(1-x) B_{i,n-1}(x)+ x B_{i-1,n-1}(x), \quad i=0,\ldots,n, $$
(10)

with \(B_{-1,n-1}(x)=0 \) and \(B_{n,n-1}(x)=0 \). Any Bernstein polynomial of degree n can be written in terms of the power basis directly calculated by using the binomial expansion of \((1-x)^{n-i}\) as follows:

$$ B_{i,n}(x)= \sum_{j=i}^{n} (-1)^{j-i} \binom{n}{i} \binom{n-i}{j-i} x^{j},\quad i=0,\ldots,n. $$
(11)

The product of Bernstein polynomials is defined as

$$ B_{i,n}(x) B_{j,m}(x)= \frac{\binom{n}{i} \binom{m}{j}}{\binom {m+n}{j+i}} B_{i+j,m+n}(x),\quad i=0,\ldots,n, j=0,\ldots,m, $$
(12)

and the definite integral of Bernstein polynomials is defined by

$$ \int_{0}^{1} B_{i,n}(x) \,dx = \frac{1}{n+1},\quad i=0,\ldots,n. $$
(13)

The interesting properties of Bernstein polynomials can be found in [13]. By applying the Gram-Schmidt process on the set of Bernstein polynomials of degree n, the explicit representation of orthonormal Bernstein polynomials is obtained as follows [14]:

$$ b_{i,n}(x)= \bigl(\sqrt{2(n-i)+1}\bigr) (1-x)^{n-i} \sum_{k=0}^{i}(-1)^{k} \binom {2n+1-k}{ i-k} \binom{i}{k} x^{i-k}. $$
(14)

In addition, the orthonormal polynomials can be written in terms of non-orthonormal Bernstein functions

$$ b_{i,n} (x)= \bigl(\sqrt{2(n-i)+1}\bigr) \sum _{k=0}^{i}(-1)^{k} \frac{ \binom{2n+1-k}{ i-k} \binom{i}{k} }{ \binom{n-k}{ i-k} } B_{i-k,n-k}(x). $$
(15)

With regard to the weight function \(w_{s}(x)=1 \) on the interval \([0,1]\), these polynomials have the orthogonality relation

$$ \int_{0}^{1} b_{i,n}(x) b_{j,n}(x) w_{s} (x) \,dx = \delta_{ij}. $$
(16)

A function square integrable in \([0, 1]\) may be approximated in terms of the normalized Bernstein basis (14). In practice, the first \((n+1) \) term Bernstein polynomials are considered [14]

$$ f(x) \simeq\sum_{j=0}^{n} c_{j,n} b_{j,n}(x)= C^{T} \Phi(x), $$
(17)

where

$$\begin{aligned}& c_{j,n} = (f,b_{j,n})= \int_{0}^{1} f(x) b_{j,n}(x) \,dx,\quad j=0,1,\ldots,n, \\& C=[c_{0,n},c_{1,n},\ldots,c_{n,n}]^{T}, \\& \Phi(x)=\bigl[ b_{0,n}(x),b_{1,n}(x), \ldots , b_{n,n}(x)\bigr]^{T}. \end{aligned}$$
(18)

4 Rational normalized Bernstein functions

For the problems with a semi-infinite domain, we offer an algebraic map according to [15] to make a new class of functions which are called rational normalized Bernstein functions shown in the following form:

$$x = \frac{t}{t+L} \leftrightarrow t = \frac{x L }{1-x} , $$

with \(x\in[0,1]\), \(t\in[0,+\infty)\) and L is a constant parameter. Here we take \(L=1\). For every fixed L, the semi-infinite interval \([0,+\infty)\) into \([0, 1]\) is mapped by the presented algebraic map. Thus, a great variety of the new basis sets \(R_{i,n}(t)\) which are the images under the change-of-coordinate of normalized Bernstein polynomials \(\phi(t)=\frac{t}{t+L}\) are generated. The rational normalized Bernstein functions are denoted by

$$ R_{i,n}(t)= b_{i,n}\bigl(\phi(t)\bigr). $$
(19)

Let \(\Lambda= \{ t | 0 \leq t < \infty\} \) and consider that the non-negative function \(w_{r}:[0,+\infty)\rightarrow\mathbb{R} \) is defined by \(w_{r}(t)= w_{s}(t) \frac{d}{dt} \phi(t)=\frac{L}{(t+L)^{2}} \) on Λ [15]. The Banach space \(L_{w_{r}}^{2}(\Lambda)\) is defined as follows:

$$ L_{w_{r}}^{2} = \bigl\{ f : \Lambda\rightarrow \mathbb{R} | f \mbox{ is measurable and } \Vert f \Vert _{L_{w_{r}}^{2}}< \infty\bigr\} , $$
(20)

where

$$ \|f\| _{L_{w_{r}}^{2}} =\biggl( \int_{0}^{\infty} \bigl\vert f(t) \bigr\vert ^{2} w_{r}(t) \,dt \biggr)^{1/2}. $$
(21)

The orthogonality of the rational normalized Bernstein functions on \(L_{w_{r}}^{2}( \Lambda)\) is given by

$$ (R_{i,n},R_{j,n})_{w_{r}}= \int_{0}^{\infty} R_{i,n}(t) R_{j,n}(t) w_{r}(t) \,dx= \delta_{ij}. $$
(22)

Any function \(f \in L_{w_{r}}^{2}(\Lambda)\) may be approximated by rational normalized Bernstein functions as follows:

$$ f(t)= \sum_{j=0}^{n} k_{j,n} R_{j,n}(t)= K^{T} \Psi(t), $$
(23)

where

$$\begin{aligned}& k_{j,n}=(f,R_{j,n})_{w_{r}} = \int_{ \Lambda} f(t) R_{j,n}(t) w_{r}(t) \,dt, \quad j=0,1,\ldots,n, \end{aligned}$$
(24)
$$\begin{aligned}& K=[k_{0,n},k_{1,n},\ldots,k_{n,n}]^{T}, \end{aligned}$$
(25)
$$\begin{aligned}& \Psi(t)= \bigl[R_{0,n}(t),R_{1,n}(t),\ldots ,R_{n,n}(t)\bigr]^{T}. \end{aligned}$$
(26)

5 Relation between Legendre and normalized Bernstein polynomials

First, we provide a brief description of Legendre polynomials, and then we try to find the relation between the Legendre polynomials and the normalized Bernstein polynomials by introducing the transformation matrices W and G. The Legendre polynomials constitute an orthonormal basis on the interval \([0, 1]\) as follows:

$$ \begin{aligned} &L_{0}(x)=1,\qquad L_{1}(x)=2x-1, \\ &L_{i+1}(x) = \frac{(2i+1)(2x-1)}{i+1} L_{i}(x) - \frac{i}{i+1} L_{i-1}(x),\quad i=1,2,\ldots . \end{aligned} $$
(27)

The orthogonality relation is

$$ \int_{0}^{1} L_{i}(x) L_{j}(x) \,dx = \textstyle\begin{cases} 0 & \text{for }i\neq j, \\ \frac{1}{2i+1} & \text{for }i= j. \end{cases} $$
(28)

A polynomial \(P_{n}(x)\) of degree n can be expressed as

$$ P_{n}(x)= \sum_{j=0}^{n} s_{j} L_{j}(x) = S^{T} \varphi(x), $$
(29)

where the shifted Legendre coefficient vector S and the shifted Legendre vector \(\varphi(x)\) are given by

$$ S = [s_{0},s_{1}, \ldots , s_{n}]^{T}, \qquad \varphi(x)=\bigl[L_{0}(x),L_{1}(x), \ldots, L_{n}(x)\bigr]^{T}. $$
(30)

Now, the transformation of the Legendre polynomials into nth degree orthonormal Bernstein basis functions on \([0,1]\) can be written as follows:

$$ L_{k}(x) = \sum_{i=0}^{n} w_{k,i} b_{i,n}(x) ,\quad k=0,1,\ldots,n. $$
(31)

The coefficients \(w_{k,i}\), \(k, i = 0, 1, \ldots, n\), form an \((n+1)\times (n+1)\) basis conversion matrix W

$$ w_{k,j}= \int_{0}^{1} L_{k}(x) b_{j,n}(x) \,dx. $$
(32)

\(L_{k}(x)\) can be written as [16]

$$ L_{k}(x)=\sum_{j=0}^{n} h_{k,j} B_{j,n}(x), $$
(33)

where

$$h_{k,j} =\frac{1}{\binom{n}{j}} \sum_{i= \max(0,j+k-n)}^{\min(j,k)} (-1)^{k+j} \binom{k}{i} \binom{k}{i} \binom{n-k}{j-i}. $$

To get \(w_{k,j}\), replace \(b_{i,n}(x)\) and \(L_{k}(x)\) with (15) and (33), respectively, then by using (12), (13), we have

$$ w_{k,j}= \sum_{j=0}^{n} \sum_{k_{1}=0}^{i} h_{k,j} \sqrt{2(n-i)+1} (-1)^{k_{1}} \frac{\binom{n}{j} \binom{2n+1-k_{1}}{i-k_{1}} \binom {i}{k_{1}}}{(2n-k_{1} +1) \binom{2n-k_{1}}{i+j-k_{1}}}, $$
(34)

where the matrix form of this relation is

$$ \varphi(x) = W \Phi(x). $$
(35)

We write the transformation of the orthonormal Bernstein basis functions into Legendre polynomials on \([0, 1]\) as

$$ b_{k,n}(x) = \sum_{i=0}^{n} g_{k,i} L_{i}(x) , \quad k=0,1,\ldots,n. $$
(36)

The coefficients \(g_{k,i}\), \(k, i = 0, 1, \ldots, n\), form an \((n+1)\times (n+1)\) basis conversion matrix G

$$ g_{k,j}=(2j+1) \int_{0}^{1} b_{k,n}(x) L_{j}(x) \,dx. $$
(37)

Again, for orthonormal Bernstein put (15) and for non-orthonormal Bernstein use the following relation [16]:

$$ B_{k,n}(x)= \sum_{j=0}^{n} l_{k,j} L_{j}(x) \,dx, $$
(38)

where

$$l_{k,j}= \frac{2j+1}{n+j+1} \binom{n}{k} \sum _{i=0}^{j} (-1)^{j+i} \frac {\binom{j}{i} \binom{j}{i}}{\binom{n+j}{k+i}}, \quad k,j=0,1,\ldots,n. $$

The properties of Legendre polynomials lead to

$$ g_{k,j}=(2j+1)^{2} \sqrt{2(n-k)+1} \sum _{p=0}^{k} (-1)^{p} \frac{\binom {2n+1-p}{k-p} \binom{k}{p}}{\binom{n-p}{k-p}} l_{k-p,i}. $$
(39)

The matrix form of the equation can be expressed as follows:

$$ \Phi(x) = G \varphi(x). $$
(40)

6 Rational Chebyshev interpolation approximation

The Gauss-Radau integration is introduced in [17, 18]. Further rational Chebyshev-Gauss-Radau points are defined in [19]. Let \(\Upsilon_{n} = \operatorname{span} \{R_{0}, R_{1},\ldots, R_{n}\}\) be the space of rational Chebyshev functions and

$$ x_{j} = \cos\biggl(\frac{2 j \pi}{2n + 1}\biggr),\quad j=0,1,\ldots,n, $$
(41)

be the \((n+1)\) Chebyshev-Gauss-Radau points in \([-1,1]\), thus we define

$$ t_{j} = L \frac{ 1+ x_{j}}{1-x_{j}},\quad j = 0, 1, \ldots, n, $$
(42)

as rational Chebyshev-Gauss-Radau nodes. The relations between rational Chebyshev orthogonal systems and rational Gauss-Radau integrations are as follows:

$$ \int_{0}^{\infty} u(t) w(t) \,dt = \int_{-1}^{1} u\biggl( L \frac{1+x}{1-x}\biggr) \rho(x) \,dx = \sum_{j=0}^{n} u(t_{j}) w_{j}, $$
(43)

where \(\rho(x)= \frac{1}{\sqrt{1-x^{2}}}\), \(w_{0}=\frac{\pi}{2n+1} \) and \(w_{j} = \frac{ \pi}{n+1}\), \(1\leq j \leq n\).

7 Function approximation by normalized Bernstein polynomials and rational normalized Bernstein functions

Generally, we approximate any real-valued function \(u(x,t)\) defined on \([0,b]\times[0,+ \infty) \) by Bernstein polynomials and rational Bernstein functions as [20, 21]

$$ u(x,t)= \sum_{i=0}^{+\infty} \sum _{j=0}^{+\infty} \lambda_{ij} b_{i,n}(x) R_{j,n}(t), $$
(44)

where

$$\lambda_{ij} = \int_{0}^{b}{ \int_{0}^{+\infty} {u(x,t) b_{i,n}(x) w_{s}(x) R_{j,n}(t) w_{r}(t) \,dt \,dx}},\quad i=0,1,\ldots, n, j=0,1,\ldots,m. $$

Let the approximation of \(u(x,t)\) be obtained by truncating the series (44) as

$$ u_{n,m}(x,t)\simeq\sum_{i=0}^{n} \sum_{j=0}^{m} \lambda_{ij} b_{i,n}(x) R_{j,m}(t)= \Phi^{T}(x) U \Psi(t), $$
(45)

where \(\Phi(x)\) is \((n+1)\) column vector defined in (18) and \(\Psi(t)\) is \((m+1)\) vector corresponding in (26), \(U=[\lambda_{ ij}]\) is a matrix of size \((n+1)\times(m+1)\). In most cases, we take \(n=m\).

We can also approximate the derived functions by applying the linear property (8) as follows:

$$\begin{aligned}& D_{x}^{\alpha}u(x,t) \approx\bigl(D_{x}^{\alpha} \Phi(x)\bigr)^{T} U \Psi(t), \end{aligned}$$
(46)
$$\begin{aligned}& D_{t}^{\beta}u(x,t) \approx \Phi(x)^{T} U \bigl(D_{t}^{\beta}\Psi(t)\bigr). \end{aligned}$$
(47)

For calculating \(D_{x}^{\alpha}\Phi(x)\) and \(D_{t}^{\beta}\Psi(t)\), use the Caputo definition

$$ D_{x}^{\alpha}b_{i,n}(x) = \frac{1}{\Gamma(\lceil{\alpha}\rceil- \alpha)} \int_{0}^{x} \frac{1}{(x-z)^{\alpha+ 1 - \lceil{\alpha}\rceil }} D_{z}^{\lceil{\alpha}\rceil}\bigl(b_{i,n}(z)\bigr) \,dz, $$
(48)

and

$$ D_{t}^{\beta}R_{j,n}(t) = \frac{1}{\Gamma(\lceil{\beta}\rceil- \beta )} \int_{0}^{t} \frac{1}{(t-z)^{\beta+ 1 - \lceil{\beta}\rceil}} D_{z}^{\lceil{\beta}\rceil}\bigl( R_{j,n}(z)\bigr) \,dz. $$
(49)

\(D_{x}^{\alpha}\Phi(x)\) and \(D_{t}^{\beta}\Psi(t)\) are \([ D_{x}^{\alpha}b_{i,n}(x)]\) and \([D_{t}^{\beta}R_{j,n}(t) ]\) vectors, respectively. Note when \(0\leq t\leq1\), we use the usual normalized Bernstein polynomials because these functions are defined in \([0,1]\). It means \(\psi(t) = \Phi(t)\).

7.1 Collocation method

Now, we consider problem (1) with initial and boundary conditions (2) and (3), by using Eqs. (44)-(47). Problem (1) becomes

$$\begin{aligned} H(x,t) =& \Phi(x)^{T} U D^{\beta}_{t} \Psi(t) - d(x,t) \bigl(D^{\alpha}_{x} \Phi (x) \bigr)^{T} U \Psi(t) \\ &{}- b(x,t) \bigl(D^{\gamma}_{x} \Phi(x)\bigr)^{T} U \Psi(t) - s(x,t) = 0. \end{aligned}$$
(50)

Relation (50) gives \((n^{2} - n)\) independent equations:

$$ H(x_{i},t_{j})=0,\quad i=1,\ldots,n-1, j=1, \ldots,n, $$
(51)

where \(x_{j}\) are shifted-Chebyshev-Gauss-Radau points in \([0,b]\) and \(t_{j}\) are rational Chebyshev-Gauss-Radau nodes. We can also approximate the initial and boundary conditions in (2), (3) as follows:

$$\begin{aligned}& \rho(x) = \Phi(x)^{T} U \Psi(0) - u_{0}(x)=0 , \quad 0 < x < b, \end{aligned}$$
(52)
$$\begin{aligned}& \Omega_{1}(t) = \Phi(0)^{T} U \Psi(t) - g_{0}(t)=0, \end{aligned}$$
(53)
$$\begin{aligned}& \Omega_{2} (t) = \Phi(b)^{T} U \Psi(t) - g_{1}(t)=0,\quad t \geq0. \end{aligned}$$
(54)

By choosing n equations \(\rho(x)=0\) and \(\Omega_{i}(t)=0\) (\(i=1,2\)), we get \((3n+1)\) more equations, i.e.,

$$\begin{aligned}& \rho(x_{i})=0 ,\quad i=0,\ldots,n, \end{aligned}$$
(55)
$$\begin{aligned}& \Omega_{k}(t_{j})=0,\quad k=1,2 j=1,\ldots,n. \end{aligned}$$
(56)

Equations (51), (55), (56) give a system of \((n+1)^{2}\) equations, which can be solved for \(u_{ij}\), \(i,j=0,1,\ldots,n\).

7.2 Galerkin method

To formulate the Galerkin method, we take the inner product with basis polynomials

$$\bigl(\bigl( H(x,t),\phi(x)\bigr)_{w_{s}} , \psi(t)\bigr)_{w_{r}} = 0. $$

We multiply (50) by \(b_{i,n}(x)\) and \(R_{j,n}(t)\), integrate the resulting equation over \([0,b]\) and \([0,+\infty)\):

$$\begin{aligned} p[i,j] :=& \int_{0}^{b} \int_{0}^{+\infty}{H(x,t) b_{i,n}(x) R_{j,n}(t) w_{s}(x) w_{r}(t) \,dt \,dx} \\ =& 0,\quad i=1,\ldots,n-1, j=1,\ldots,n. \end{aligned}$$
(57)

We use the initial and boundary conditions (52)-(54) with an inner product

$$\begin{aligned}& \bigl(\rho(x),\phi(x)\bigr)_{w_{s}} = 0 \quad \Rightarrow\quad p[i,1]:=\bigl(\rho (x),b_{i,n}(x)\bigr)_{w_{s}} = 0,\quad i=0,1,\ldots,n, \end{aligned}$$
(58)
$$\begin{aligned}& \bigl(\Omega_{k}(t),\psi(t)\bigr)_{w_{r}}=0 \quad \Rightarrow\quad p[k,j]:=\bigl(\Omega _{k}(t),R_{j,n}(t) \bigr)_{w_{r}} = 0,\quad k=1,2, j=1,2,\ldots,n. \end{aligned}$$
(59)

Equations (57)-(59) are solved with Chebyshev-Gauss-Radau integration in the infinite interval \((0,+\infty)\), so we have a system of \((n+1)^{2}\) equations, which can be solved for \(u_{ij}\), \(i,j=0,1,\ldots,n\).

8 Error estimates

We begin this section with the basic error bound for an integer derivative, and then we refer to fractional derivatives, which are important for the main result (see [22] for more details). So, for fractional time-space fractional diffusion equations like Eq. (1), an approach to the convergence analysis of the Bernstein method is presented.

Definition 8.1

Suppose that \(\mathbb{P}_{N} = \operatorname{span}\{ b_{0,N},b_{1,N}, \ldots , b_{N,N}\}\). We define \(\Pi_{N} : L^{2}(I) \rightarrow\mathbb{P}_{N}\) the \(L^{2}\)-orthogonal projection such that

$$(\Pi_{N} u -u , v) = 0,\quad \forall v \in\mathbb{P}_{N}, $$

where

$$(\Pi_{N} u ) (x)= \sum_{j=0}^{N} a_{j} b_{j,N}(x) . $$

A general procedure in error analysis is to compare the numerical solution \(u_{N}\) with an orthogonal projection \(\Pi_{N} u\) of the exact solution u and use the inequality

$$\|u - u_{N} \| \leq\|u - \Pi_{N} u \|+ \| \Pi_{N} u - u_{N} \|. $$

We know (from Theorem 3.14 of [15]) that \(\Pi_{N} u\) is the best polynomial approximation of u, so we just need to measure the truncation error \(\|u- \Pi_{N} u\|\). We introduce the Sobolev space

$$H^{m} (I) = \biggl\{ u : \frac{\partial^{k} u}{\partial x^{k}} \in L^{2}(I),0 \leq k \leq m \biggr\} ,\quad m \in\mathbb{N}. $$

To measure the truncation error \(\Pi_{N} u -u\), the inner product, the norm and the semi-norm are equipped as

$$\begin{aligned}& (u,v)_{H^{m}} = \sum_{j=0}^{m} \biggl(\frac{\partial^{j} u}{\partial x^{j}} ,\frac {\partial^{j} v }{\partial x^{j}}\biggr), \\& \|u\|_{H^{m}} = (u,u)_{H^{m}}^{1/2} ,\qquad |u|_{H^{m}} = \biggl\Vert \frac{\partial^{m} u}{\partial x^{m}} \biggr\Vert . \end{aligned}$$

Theorem 8.1

Let \(0 \leq l < m_{1} \leq N+1 \). For any \(u \in H^{m_{1}}(I)\),

$$\bigl\Vert \partial^{l}_{x}(u - \Pi_{N} u) \bigr\Vert \leq C_{1} \sqrt{\frac {(N-m_{1}+1)!}{(N-l+1)!}} (N+m_{1})^{(l-m_{1})/2} \| u\|_{H^{m_{1}}} , $$

where \(C_{1}\) is constant.

Proof

According to (36), we have

$$\begin{aligned} (\Pi_{N} u ) (x) =& \sum_{j=0}^{N} a_{j} b_{j,N}(x) = \sum_{j=0}^{N} a_{j} \sum_{i=0}^{N} g_{j,i} L_{i}(x) \\ =& \sum_{i=0}^{N} \Biggl(\sum _{j=0}^{N} a_{j} g_{j,i}\Biggr) L_{i}(x) = \sum_{i=0}^{N} q_{i} L_{i}(x), \end{aligned}$$

where \(q_{i}=\sum_{j=0}^{N} a_{j} g_{j,i} \). This means that \(\Pi_{N} u\) is also the best polynomial approximation of u in \(L^{2} (I)\) for Legendre polynomials, and due to [15] (see Section 3.5, Theorem 3.35 of [15]) for Legendre polynomials, we have

$$\bigl\Vert \partial^{l}_{x}(u - \Pi_{N} u) \bigr\Vert \leq C_{2} \sqrt{\frac {(N-m_{1}+1)!}{(N-l+1)!}} (N+m_{1})^{(l-m_{1})/2} \bigl\Vert \partial^{m_{1}}_{x} u \bigr\Vert , $$

where \(C_{2}\) is constant. By using the definition \(H^{m_{1}}(I)\), we have

$$\bigl\Vert \partial^{l}_{x}(u - \Pi_{N} u) \bigr\Vert \leq C_{2} \sqrt{\frac {(N-m_{1}+1)!}{(N-l+1)!}} (N+m_{1})^{(l-m_{1})/2} \Vert u \Vert _{H^{m_{1}}} . $$

Because of the relation between Legendre and Bernstein in Section 5, we just have \(C_{1} = c C_{2}\). □

It is shown that a valid projection property for any basis of the space, and in fact any element, means that they are basis-free. So, we do not present the proof for other theorems.

Through examining the temporal domain in the interval \(\Lambda= (0, +\infty)\), we also have definitions and theorems where they are fundamental results with the mapped orthonormal Bernstein approximations as follows.

Definition 8.2

Define the \(L^{2}\)-orthogonal projection \(\hat{\Pi}_{M}: L^{2}(\Lambda) \rightarrow\mathbb{P}_{M}\) supposing that the space \(\tilde{H}^{m}(\Lambda) := L^{2}_{w_{r}} \) and \(\mathbb{P}_{M} = \operatorname{span}\{R_{0,M},R_{1,M},\ldots, R_{M,M}\}\) such that

$$(\hat{\Pi}_{M} u -u , v) = 0,\quad \forall v \in\mathbb{P}_{M}, $$

where

$$(\hat{\Pi}_{M} u ) (t)= \sum_{j=0}^{M} k_{j} R_{j,M}(t). $$

For this space \(\tilde{H}^{m}(\Lambda)\),

$$\tilde{H}^{m} (\Lambda) = \biggl\{ u : \frac{\partial^{k} u}{\partial x^{k}} \in L^{2}(\Lambda),0 \leq k \leq m \biggr\} , \quad m \in\mathbb{N}, $$

the norm and the semi-norm are defined as

$$\Vert u \Vert _{\tilde{H}^{m}} = \Biggl( \sum_{j=0}^{m} \biggl\Vert \frac{\partial^{j} u}{\partial t^{j}} \biggr\Vert ^{2} \Biggr)^{1/2} , \qquad |u|_{\tilde{H}^{m}} = \biggl\Vert \frac{\partial^{m} u}{\partial t^{m}} \biggr\Vert . $$

Theorem 8.2

([15])

Let \(l = 0 \textit{ or } 1\) and \(l \leq m_{2} \leq M+1 \), for any \(u \in\tilde{H}^{m_{2}}(\Lambda)\), we have

$$\bigl\Vert \partial^{l}_{t}( u - \hat{ \Pi}_{M} u ) \bigr\Vert \leq C_{3} \sqrt{ \frac {(M-m_{2}+1)!}{(M-l+1)!}} (M+m_{2})^{(l-m_{2})/2} \Vert u \Vert _{\tilde{H}^{m_{2}}} , $$

where \(C_{3} \) is constant.

Definition 8.3

We define

$$H^{r,s}(\Omega) = H^{s}\bigl(I_{t} ; H^{r} (I_{x})\bigr)= \biggl\{ u \in L^{2}(\Omega) \Big| \frac {\partial^{i+j} u }{ \partial x^{i}\, \partial t^{j}} \in L^{2} (\Omega), 0 \leq i \leq r, 0 \leq j \leq s\biggr\} $$

as a Hilbert space, and in this space the inner product and norm are defined as

$$\begin{aligned}& (u,v)_{r,s} = \sum_{i=0}^{r} \sum_{j=0}^{s} \int_{0}^{+ \infty} \int _{0}^{1} \frac{\partial^{i+j} u(x,t) }{\partial x^{i}\, \partial t^{j}} \frac {\partial^{i+j} v(x,t) }{\partial x^{i}\, \partial t^{j}} \,dx \,dt, \\& \Vert u \Vert _{H^{r,s}} = \Biggl(\sum_{i=0}^{r} \sum_{j=0}^{s} \biggl\Vert \frac{\partial ^{i+j} u(x,t) }{ \partial x^{i}\, \partial t^{j}} \biggr\Vert ^{2}_{L^{2}(\Omega)} \Biggr)^{1/2}, \end{aligned}$$

where \(\Omega= I_{x} \times I_{t} = (0, 1)\times(0,+\infty)\) is the two-dimensional domain.

The space of the measurable functions \(u : \Omega\rightarrow\mathbb {R}\) is considered, and we denote \(H^{r,0} = L^{2} (I_{t} ; H^{r} (I_{x} ))\) such that

$$\Vert u \Vert _{H^{r,0}} =\biggl( \int_{0}^{+ \infty} \bigl\Vert u(\cdot,t) \bigr\Vert ^{2}_{H^{r}(I_{x})} \,dt\biggr)^{1/2} < + \infty. $$

On the other hand, \(H^{0,s}\) for any positive integer s can be defined as

$$H^{0,s} = H^{s}\bigl(I_{t} ; L^{2} (I_{x})\bigr)= \biggl\{ u \in L^{2}(\Omega) \Big| \frac{\partial ^{j} u }{\partial t^{j}} \in L^{2} (\Omega), 0 \leq j \leq s\biggr\} , $$

with the given norm

$$\Vert u \Vert _{H^{0,s}} = \Biggl(\sum_{j=0}^{s} \biggl\Vert \frac{\partial^{j} u }{\partial t^{j}} \biggr\Vert ^{2}_{L^{2}(\Omega)} \Biggr)^{1/2}. $$

Theorem 8.3

Consider \(\Pi_{N,M} = \operatorname{span} \{b_{i,N}(x) R_{j,M}(t), i=0,1,\ldots,N, j=0,1,\ldots,M \}\) if \(\Pi_{N,M}u \) is the projection of u upon \(\mathbb{P}_{N,M}\), i.e.,

$$(\Pi_{N,M} u) (x,t)=u_{N,M}(x,t), $$

which means \(\Pi_{N,M} u(x,t)\) is the best polynomial approximation of \(u_{N,M}(x,t)= \sum_{i=0}^{N} \sum_{j=0}^{M}\lambda_{ij} b_{i,N}(x) R_{j,M}(t)\) in \(L^{2} (\Omega)\). For any function \(u \in L^{2}(\Omega)\), there are constants \(C_{6}\), \(C_{7}\) for all \(0\leq m_{1} \leq N+1\) and \(0 \leq m_{2} \leq M+1\), where \(m_{1} , m_{2} \in\mathbb{N}\),

$$\begin{aligned} \begin{aligned} \| u - \Pi_{N,M} u \| _{L^{2}(\Omega)} \leq{}& C_{6} \sqrt{ \frac {(N-m_{1}+1)!}{(N+1)!}} (N+m_{1})^{-m_{1} /2}\|u\|_{H^{m_{1},0}} \\ &{}+ C_{7} \sqrt{\frac{(M-m_{2}+1)!}{(M+1)!}} (M+m_{2})^{-m_{2} /2} \| u \| _{H^{0,m_{2}}}. \end{aligned} \end{aligned}$$

Proof

One-dimensional orthogonal projections defined in Definitions 8.1 and 8.2 are assumed to be \(\Pi_{N}\), \(\hat{\Pi}_{M}\). Then

$$\Pi_{N,M} u = \Pi_{N} \hat{\Pi}_{M}u. $$

Given Theorems 8.1 and 8.2, we have

$$\begin{aligned} \|u-\Pi_{N,M}u\|_{L^{2}(\Omega)} \leq& \|u-\Pi_{N}u \|_{L^{2}(\Omega)} + \bigl\Vert \Pi_{N} ( u-\hat{ \Pi}_{M}u) \bigr\Vert _{L^{2}(\Omega)} \\ \leq& \|u-\Pi_{N}u\|_{L^{2}(\Omega)} + C_{5} \|u-\hat{ \Pi}_{M}u\| _{L^{2}(\Omega)} \\ \leq& C_{6} \sqrt{\frac{(N-m_{1}+1)!}{(N+1)!}} (N+m_{1})^{-m_{1}/2} \|u\| _{H^{m_{1},0}} \\ &{}+ C_{7} \sqrt{\frac{(M-m_{2}+1)!}{(M+1)!}} (M+m_{2})^{-m_{2}/2} \| u \| _{H^{0,m_{2}}}, \end{aligned}$$

where \(C_{5}\) is constant and \(C_{7}=C_{5} C_{3}\). □

The error function \(e(x, t)\) of the approximation \(u_{N,M}(x,t)\) for the exact solution \(u(x,t)\) of Eq. (1) is defined as

$$ e(x,t)=u(x,t)-u_{N,M}(x,t), $$
(60)

and corresponding with the best approximation, we have

$$ e_{N,M}(x,t)=u(x,t)-\Pi_{N,M}u(x,t), $$
(61)

where, according to Theorem 8.3, when \(N,M \rightarrow\infty\), \(\| e_{N,M} \| \rightarrow0\); and consequently,

$$\bigl( \Vert e \Vert =\|u - u_{N,M} \| \leq\| u- \Pi_{N,M} u \|+ \|\Pi_{N,M} u - u_{N,M} \| \bigr) \rightarrow 0 . $$

We have also error bounds for the fractional derivatives as follows.

Theorem 8.4

Suppose \(u \in L^{2}(\Omega)\), if \(n-1<\alpha \leq n \), \(n=\lceil\alpha\rceil\), and \(n< m_{1}<N+1\), \(m_{1} \in\mathbb {N}\), then we have

$$\begin{aligned} \begin{aligned} &\bigl\Vert D^{\alpha}_{x} u - D^{\alpha}_{x}( \Pi_{N,M}u) \bigr\Vert _{L^{2}(\Omega)} \\ &\quad \leq \frac{C_{8} \sqrt{\frac{(N-m_{1}+1)!}{(N-n+1)!}} (N+m_{1})^{(n-m_{1})/2}}{ (\Gamma[n-\alpha+1])^{2}} \bigl\Vert u(x,t) - \bigl(\Pi _{N,M}u(x,t)\bigr) \bigr\Vert ^{2}_{H^{m_{1},0}(\Omega)} , \end{aligned} \end{aligned}$$

where \(C_{8}\) is constant.

Proof

Due to [23], we have

$$\|f \ast g \|_{p} \leq\|f\|_{1} \|g\|_{p}. $$

By using Definitions 2.1 and 2.2,

$$\begin{aligned}& \bigl\Vert D^{\alpha}_{x} u - D^{\alpha}_{x}( \Pi_{N,M}u) \bigr\Vert ^{2}_{L^{2}(\Omega)} \\ & \quad = \bigl\Vert J_{x}^{n-\alpha}\bigl(D^{n}_{x} u(x,t) - D^{n}_{x}\bigl(\Pi_{N,M}u(x,t)\bigr) \bigr) \bigr\Vert ^{2}_{L^{2}(\Omega)} \\ & \quad = \biggl\Vert \frac{1}{x^{1+\alpha-n} \Gamma[n-\alpha]} \ast\bigl(D^{n}_{x} u(x,t) - D^{n}_{x}\bigl(\Pi_{N,M}u(x,t)\bigr) \bigr) \biggr\Vert ^{2}_{L^{2}(\Omega)} \\ & \quad \leq \biggl\Vert \frac{1}{x^{1+\alpha-n} \Gamma[n-\alpha]} \biggr\Vert _{1}^{2} \bigl\Vert D^{n}_{x} u(x,t) - D^{n}_{x} \bigl(\Pi_{N,M}u(x,t)\bigr) \bigr\Vert ^{2}_{L^{2}(\Omega)}, \end{aligned}$$

and applying Theorem 8.1,

$$\begin{aligned} &\bigl\Vert D^{\alpha}_{x} u - D^{\alpha}_{x}( \Pi_{N,M}u) \bigr\Vert ^{2}_{L^{2}(\Omega)} \\ &\quad \leq\biggl(\frac{1}{ \Gamma[n-\alpha+1]}\biggr)^{2} C_{8} \sqrt{\frac {(N-m_{1}+1)!}{(N-n+1)!}} (N+m_{1})^{(n-m_{1})/2} \\ &\qquad {}\times\bigl\Vert u(x,t) - \Pi_{N,M}u(x,t) \bigr\Vert ^{2}_{H^{m_{1},0}(\Omega)}, \end{aligned}$$

the proof is complete. □

So when \(N,M \rightarrow\infty\), \((\|D^{\alpha}_{x}(e_{N,M})\|=\| D^{\alpha}_{x} u - D^{\alpha}_{x}(\Pi_{N,M}u) \|) \rightarrow0 \).

Theorem 8.5

Suppose \(u \in L^{2}(\Omega)\), and \(h-1<\beta \leq h < m_{2} \leq M+1\), \(m_{2} \in\mathbb{N}\), \(h=\lceil\beta\rceil\), then

$$\begin{aligned}& \bigl\Vert D^{\beta}_{t} u - D^{\beta}_{t}( \Pi_{N,M}u) \bigr\Vert _{L^{2}(\Omega)} \\ & \quad \leq \frac{C_{9} \sqrt{\frac{(M-m_{2}+1)!}{(M-h+1)!}} (M+m_{2})^{(h-m_{2})/2}}{ (\Gamma[h-\beta+1])^{2}} \bigl\Vert u(x,t) - \Pi_{N,M}u(x,t) \bigr\Vert ^{2}_{H^{0,m_{2}}(\Omega)}, \end{aligned}$$

where \(C_{9}\) is constant.

Proof

The proof is similar to Theorem 8.4. □

This theorem shows that, when \(N,M \rightarrow\infty\), \((\|D^{\beta }_{t}(e_{N,M})\|=\|D^{\beta}_{t} u - D^{\beta}_{t}(\Pi_{N,M}u) \| )\rightarrow0 \).

For the proposed method, the error assessment relying on the residual error function is presented [24].

Take the following problem with the initial and boundary conditions:

$$\begin{aligned}& L\bigl[u_{N,M}(x,t)\bigr]=D^{\beta}_{t} u_{N,M}(x,t) - d(x,t) D^{\alpha}_{x} u_{N,M}(x,t) - b(x,t) D^{\gamma}_{x} u_{N,M}(x,t) \\ & \hphantom{L\bigl[u_{N,M}(x,t)\bigr]}= s(x,t)+ R_{N,M}(x,t), \end{aligned}$$
(62)
$$\begin{aligned}& u_{N,M}(x,0) = u_{0}(x),\qquad u_{N,M}(0,t)=g_{0}(t),\qquad u_{N,M}(b,t)= g_{1}(t). \end{aligned}$$
(63)

\(R_{N,M}(x, t)\) is the residual function which is obtained by subtracting (1)-(3) from (62)-(63) as follows:

$$ D^{\beta}_{t}e_{N,M}(x,t) - d(x,t) D^{\alpha}_{x} e_{N,M}(x,t) - b(x,t) D^{\gamma}_{x} e_{N,M}(x,t)= -R_{N,M}(x,t), $$
(64)

with homogeneous initial and boundary conditions. By using Theorem 8.4 for \(\alpha, \gamma\) and Theorem 8.5 for β, when \(N,M \rightarrow\infty\), we have \(R_{N,M} \rightarrow0 \).

9 Numerical examples

In this section, we carry out numerical examples for a time-space fractional diffusion equation of the proposed numerical methods. All our tests are done in Mathematica 9.1. We use the discrete \(L_{\infty}\) error for \(x\in[0,1]\) and \(t=T\) for different T in examples, which is obtained by suitable source term \(s(x,t)\) in (1). The rate of convergence of the coefficient matrix with condition number as compared with the condition number of the Hilbert matrix H is provided with respect to the infinity norm, i.e.,

$$R_{\infty} = \frac{C_{\infty}(A)}{C_{\infty}(H)}, $$

that \(C_{\infty}(A) := \operatorname{Cond}_{\infty}(A)\).

Example 9.1

([25])

Consider problem (1) with the initial condition \(u(x,0) = x^{2} (1-x)^{2} \), homogeneous boundary conditions, diffusion and advection coefficients \(d(x,t) = 0.001\), \(b(x,t) = 2\), respectively. Suppose that the exact solution is \(u(x,t)= x^{2}(1-x)^{2}e^{-t}\) for suitable source term. For \(n=5\), the normalized Bernstein polynomials are

$$ \Phi(x)= \left ( \textstyle\begin{array}{@{}c@{}} \sqrt{11} (1-x)^{5}\\ 3 (1-x)^{4} (-1+11 x)\\ \sqrt{7} (1-x)^{3} (1-20 x+55 x^{2}) \\ \sqrt{5} (1-x)^{2} (-1+27 x-135 x^{2}+165 x^{3}) \\ \sqrt{3} (1-x) (1-32 x+216 x^{2}-480 x^{3}+330 x^{4})\\ -1+35 x-280 x^{2}+840 x^{3}-1\text{,}050 x^{4}+462 x^{5} \end{array}\displaystyle \right ), $$
(65)

and the corresponding rational normalized Bernstein polynomials are

$$ \Psi(t)= \left( \textstyle\begin{array}{@{}c@{}} \sqrt{11} (1-\frac{t}{t+1})^{5}\\ 3 (1-\frac{t}{t+1})^{4} (-1+11 \frac{t}{t+1}) \\ \sqrt{7} (1-\frac{t}{t+1})^{3} (1-20 \frac{t}{t+1}+\frac {55t^{2}}{(t+1)^{2}}) \\ \sqrt{5} (1-\frac{t}{t+1})^{2} (-1+\frac{27t}{t+1}- \frac{135 t^{2}}{(t+1)^{2}}+\frac{165 t^{3}}{(t+1)^{3}}) \\ \sqrt{3} (1-\frac{t}{t+1}) (1-\frac{32t}{t+1}+\frac{216 t^{2}}{(t+1)^{2}}-\frac{480t^{3}}{(t+1)^{3}}+\frac{330 t^{4}}{(t+1)^{4}}) \\ -1+ \frac{35t}{t+1}-\frac{280 t^{2}}{(t+1)^{2}}+\frac{840 t^{3}}{(t+1)^{3}}-\frac{1\text{,}050 t^{4}}{(t+1)^{4}}+\frac{462 t^{5}}{(t+1)^{5}} \end{array}\displaystyle \right). $$
(66)

We take U as an unknown matrix \(6*6\) like

$$\left ( \textstyle\begin{array}{@{}c@{\quad}c@{\quad}c@{\quad}c@{\quad}c@{\quad}c@{}} u_{0,0} & u_{0,1} & u_{0,2} & u_{0,3} & u_{0,4} & u_{0,5} \\ u_{1,0} & u_{1,1}& u_{1,2} & u_{1,3} & u_{1,4} & u_{1,5} \\ u_{2,0} & u_{2,1}& u_{2,2} & u_{2,3} & u_{2,4} & u_{2,5} \\ u_{3,0} & u_{3,1}& u_{3,2} & u_{3,3} & u_{3,4} & u_{3,5} \\ u_{4,0} & u_{4,1}& u_{4,2} & u_{4,3} & u_{4,4} & u_{4,5} \\ u_{5,0} & u_{5,1}& u_{5,2} & u_{5,3} & u_{5,4} & u_{5,5} \end{array}\displaystyle \right ). $$

Now we approximate the unknown function \(u(x,t)\) by Bernstein polynomials and rational Bernstein functions as follows:

$$ u_{5,5}(x,t)\simeq\sum_{i=0}^{5} \sum_{j=0}^{5} \lambda_{ij} b_{i,5}(x) R_{j,5}(t)= \Phi^{T}(x) U \Psi(t). $$
(67)

We also approximate the derived functions by (46), (47), where to obtain \(D_{t}^{\beta}\Psi(t)\), \(D_{x}^{\alpha}\Phi(x)\) and \(D_{x}^{\gamma}\Phi(x)\), we must use (48), (49) and calculate \([D_{t}^{\beta}R_{j,n}(t) ]\), \([ D_{x}^{\alpha}b_{i,n}(x)]\) and \([ D_{x}^{\gamma}b_{i,n}(x)]\) vectors of size 6. With replacing (65)-(67) and derived functions in (50), we have

$$\begin{aligned} H(x,t) &= \Phi(x)^{T} U D_{t}^{\beta} \Psi(t) - 0.01 \bigl(D_{x}^{\alpha} \Phi(x)\bigr)^{T} U \Psi(t) - 2\bigl(D_{x}^{\gamma} \Phi(x)\bigr)^{T} U \Psi(t)- s_{\alpha,\beta ,\gamma}(x,t) \\ &=0. \end{aligned}$$
(68)

The initial and boundary conditions are also approximated as follows:

$$\begin{aligned}& \rho(x) = \Phi(x)^{T} U \Psi(0) -x^{2} (1-x)^{2} =0 ,\quad 0 < x < 1, \end{aligned}$$
(69)
$$\begin{aligned}& \Omega_{1}(t) = \Phi(0)^{T} U \Psi(t) =0, \end{aligned}$$
(70)
$$\begin{aligned}& \Omega_{2} (t) = \Phi(1)^{T} U \Psi(t) =0, \quad t \geq0. \end{aligned}$$
(71)

For the collocation method, by substituting collocation points in Eqs. (68)-(71), we have a system of 36 equations, which can be solved for \(u_{ij}\), \(i,j=0,\ldots,5\).

To formulate the Galerkin method, we take the inner product with basis polynomials as follows:

$$\bigl(\bigl( H(x,t),\phi(x)\bigr)_{w_{s}} , \psi(t)\bigr)_{w_{r}} = 0, $$

that leads to

$$p[i,j]:= \int_{0}^{1}{ \int_{0}^{+\infty}{H(x,t) b_{i,5}(x) R_{j,5}(t) w_{s}(x) w_{r}(t) \,dt \,dx}} = 0, \quad i=1,\ldots,4, j=1,\ldots,5, $$

where inner products are solved with Chebyshev-Gauss-Radau integration (43) as follows:

$$ p[i,j]= \sum_{k=0}^{5} \sum _{l=0}^{5} H(x_{k},t_{l}) b_{i,5}(x_{k}) R_{j,5}(t_{l}) w_{k} w_{l} ,\quad i=1,\ldots,4, j=1,\ldots,5. $$
(72)

Initial and boundary conditions are

$$\begin{aligned}& \bigl(\rho(x),\phi(x)\bigr)_{w_{s}} = 0 \\& \quad \Rightarrow \quad p[i,1]:=\bigl(\rho (x),b_{i,5}(x)\bigr)_{w_{s}} = \sum _{k=0}^{5}\rho(x_{k}) b_{i,5}(x_{k}) w_{k} =0,\quad i=0,1,\ldots,5, \end{aligned}$$
(73)
$$\begin{aligned}& \bigl(\Omega_{k}(t),\psi(t)\bigr)_{w_{r}}=0 \\& \quad \Rightarrow\quad p[k,j]:=\bigl(\Omega _{k}(t),R_{j,n}(t) \bigr)_{w_{r}} = \sum_{l=0}^{5} \Omega_{k}(t_{l}) R_{j,5}(t_{l}) w_{l} ,\quad k=1,2, j=1,2,\ldots,5. \end{aligned}$$
(74)

Finally, Eqs. (72)-(74) give a system of 36 equations, which can be solved for \(u_{ij}\), \(i,j=0,1,\ldots,5\). Tables 1 and 2 show the maximum absolute error for collocation and Galerkin methods, respectively, for \(n=5\) and \(\beta =0.6\) and different α and γ.

Table 1 The maximum absolute error with \(\pmb{\alpha=1.4}\) for Example  9.1 , the collocation method
Table 2 The maximum absolute error with \(\pmb{\gamma=0.4}\) for Example  9.1 , the Galerkin method

Example 9.2

([20, 21])

We consider the fractional diffusion equation (1) with the coefficient functions \(d(x,t)=\Gamma(1.2) x ^{1.8} \) (where Γ is Euler’s gamma function), \(b(x,t)=0\) (hence \(\gamma=0\)) with the initial boundary conditions

$$u(x,0)=x^{2}(1 - x), \qquad u(0,t)=u(1,t)=0. $$

Suppose that the exact solution is \(u(x,t)= x^{2}(1-x)e^{-t}\) for suitable source term. The maximum errors \(L_{\infty}\) for different values of T and n are listed in Table 3 for the collocation method and in Table 4 for the Galerkin method. The results in both tables show that the proposed methods have good approximation accuracy for the relatively long time domain. To investigate the convergence of the methods, we apply our method to different values of fractional orders. Table 5 shows the residual errors for \(n=8\) with \(\alpha\in (1,2) \) and \(\beta\in(0,1)\) in the collocation method that converge to the exact solution. Also, this converges to the exact solution for different values of α, which has been shown in Figures 1-4. We have a similar situation for different β. The comparisons between the proposed method and the method described by Alavizadeh in [21] are listed in Table 6. The numerical results of this example demonstrate that our methods are more accurate than the Legendre approximation method in [21] at \(t=1\) for \(n=5\).

Figure 1
figure 1

The residual error for Example  9.2 with \(\pmb{\beta =1}\) and \(\pmb{n=8}\) for different α , and the collocation method for \(\pmb{t=2}\) .

Figure 2
figure 2

The residual error for Example  9.2 with \(\pmb{\beta =1}\) and \(\pmb{n=8}\) for different α , and the collocation method for \(\pmb{t=10}\) .

Figure 3
figure 3

The residual error for Example  9.2 with \(\pmb{\beta =1}\) and \(\pmb{n=8}\) for different α , and the collocation method for \(\pmb{t=50}\) .

Figure 4
figure 4

The residual error for Example  9.2 with \(\pmb{\beta =1}\) and \(\pmb{n=8}\) for different α , and the collocation method for \(\pmb{t=100}\) .

Table 3 The \(\pmb{L_{\infty}}\) error for Example  9.2 with \(\pmb{\alpha=1.8}\) and \(\pmb{\beta=1}\) , the collocation method
Table 4 The \(\pmb{L_{\infty}}\) error for Example  9.2 with \(\pmb{\alpha=1.8}\) and \(\pmb{\beta=1}\) , the Galerkin method
Table 5 Maximum residual errors for \(\pmb{n=8}\) for Example  9.2 , the collocation method
Table 6 The absolute error at \(\pmb{t=1}\) with \(\pmb{\alpha=1.8}\) , \(\pmb{\beta =1}\) and \(\pmb{n=5}\) for Example  9.2

Example 9.3

([26])

We consider the fractional diffusion equation (1) with the coefficient functions \(d(x,t)=\frac{\Gamma(2.2)}{6} x ^{2.8} \), \(b(x,t)=0\) (hence \(\gamma =0\)) with the initial boundary conditions

$$u(x,0)=x^{3},\qquad u(0,t)= 0,\qquad u(1,t)=\exp{(-t)}. $$

Suppose that the exact solution is \(u(x,t)= x^{3}e^{-t}\) for suitable source term. The maximum errors \(L_{\infty}\) for different values of T and n are listed in Tables 7 and 8 for collocation and Galerkin methods. Note that in these tables we provide CPU time (in seconds) consumed in the algorithms for obtaining the numerical solution, and when we compare these together for one problem, we see the collocation method acting in a shorter time compared with the Galerkin method. Table 9 shows the maximum residual errors for \(n=8\) when \(\alpha\in (1,2)\) and \(\beta\in(0,1)\). The convergence to the exact solution in the Galerkin method is obvious from this table. Also, this converges to the exact solution for different values of β which tends to 1 for the Galerkin method, which has been shown in Figures 5-8. When α tends to 2, we will have a similar figure. For the collocation method in \(t=1\), Table 10 compares the absolute error with the Chebyshev-spectral-Tau method in [26]. This shows our collocation method acting better than the method in [26]. Figures 9-11 show the absolute error at \(t = 1\) for \(\alpha=1.8\), \(\beta=1\) and \(n = 5\) in the interval \(x\in[0,1]\) in the collocation, Chebyshev spectral-Tau and Galerkin methods, respectively.

Figure 5
figure 5

The residual error for Example  9.3 with \(\pmb{\alpha =1.8}\) and \(\pmb{n=5}\) for different β , and the Galerkin method for \(\pmb{t=2}\) .

Figure 6
figure 6

The residual error for Example  9.3 with \(\pmb{\alpha =1.8}\) and \(\pmb{n=5}\) for different β , and the Galerkin method for \(\pmb{t=10}\) .

Figure 7
figure 7

The residual error for Example  9.3 with \(\pmb{\alpha =1.8}\) and \(\pmb{n=5}\) for different β , and the Galerkin method for \(\pmb{t=50}\) .

Figure 8
figure 8

The residual error for Example  9.3 with \(\pmb{\alpha =1.8}\) and \(\pmb{n=5}\) for different β , and the Galerkin method for \(\pmb{t=100}\) .

Figure 9
figure 9

The absolute error at \(\pmb{t = 1}\) for \(\pmb{\alpha=1.8}\) , \(\pmb{\beta=1}\) and \(\pmb{n=5}\) in the interval \(\pmb{0< x <1 }\) for Example  9.3 by the collocation method.

Figure 10
figure 10

The absolute error at \(\pmb{t = 1}\) for \(\pmb{\alpha=1.8}\) , \(\pmb{\beta=1}\) and \(\pmb{n=5}\) in the interval \(\pmb{0< x <1 }\) for Example  9.3 by the method of [ 26 ].

Figure 11
figure 11

The absolute error at \(\pmb{t = 1}\) for \(\pmb{\alpha=1.8}\) , \(\pmb{\beta=1}\) and \(\pmb{n=5}\) in the interval \(\pmb{0< x <1 }\) for Example  9.3 by the Galerkin method.

Table 7 The \(\pmb{L_{\infty}}\) error for Example  9.3 with \(\pmb{\alpha =1.8}\) and \(\pmb{\beta=1}\) , the collocation method
Table 8 The \(\pmb{L_{\infty}}\) error for Example  9.3 with \(\pmb{\alpha =1.8}\) and \(\pmb{\beta=1}\) , the Galerkin method
Table 9 Maximum residual errors with \(\pmb{n=8}\) for Example  9.3 , the Galerkin method
Table 10 The absolute error at \(\pmb{t=1}\) with \(\pmb{\alpha=1.8}\) , \(\pmb{\beta =1}\) and \(\pmb{n=5}\) for Example  9.3

Example 9.4

We consider the fractional diffusion equation (1) with \(\alpha= 1.5\), \(\beta= 0.6\), \(\gamma= 0.8\) and the coefficient functions \(d(x,t)=t\), \(b(x,t)=x \) and the source term \(s(x,t)\) such that the exact solution is \(u(x,t) = x(2-x) \exp{(-t)}+ t \exp{(-t)}\) with the initial boundary conditions

$$u(x,0)=x(2-x),\qquad u(0,t)= t \exp{(-t)},\qquad u(1,t)=\exp{(-t)}+ t\exp{(-t)}. $$

The maximum errors \(L_{\infty}\) for different values of T and n are listed in Table 11 for the collocation method, and the results in \(x \in(0,1)\) for \(n=8\) are presented in Table 12 at \(t=1\) for both methods.

Table 11 The \(\pmb{L_{\infty}}\) error for Example  9.4 , the collocation method
Table 12 The absolute error at \(\pmb{t=1}\) and \(\pmb{n=8}\) for Example  9.4

10 Conclusion

In this article, we presented effective numerical methods for solving a space-time fractional diffusion equation with initial boundary conditions. For these problems defined in the unbounded time domain, we use the rational normalized Bernstein functions as basis functions to approximate the exact solution. We compared the execution of the collocation and Galerkin methods using normalized Bernstein basis for solving a given problem. We have presented some numerical experiments to confirm the theoretical analysis. Precision increases with the increase in the number of terms in the normalized Bernstein expansion. However, for the same number of terms, the collocation method yields relatively more accurate results in a comparatively shorter time compared with the Galerkin method. On the other hand, the collocation method is very sensitive to the collocation points. Generally, the most significant property of the collocation method is its fluency in the application; e.g., matrix elements of the given equation are evaluated directly rather than by numerical integration as in the Galerkin procedure. Generally, the results show that the proposed methods achieve better approximation accuracy than other methods, especially for the long time domain.

References

  1. Elwakil, AS: Fractional-order circuits and systems: an emerging interdisciplinary research area. IEEE Circuits Syst. Mag. 10(4), 40-50 (2010)

    Article  Google Scholar 

  2. Xing, Y, Wu, X, Xu, Z: Multiclass least squares auto-correlation wavelet support vector machines. ICIC Express Lett. 2(4), 345-350 (2008)

    Google Scholar 

  3. Farin, GE, Hoschek, J, Kim, MS: Handbook of Computer Aided Geometric Design. Elsevier, Amsterdam (2002)

    MATH  Google Scholar 

  4. Farouki, RT, Rajan, VT: Algorithms for polynomials in Bernstein form. Comput. Aided Geom. Des. 5, 1-26 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  5. Farouki, RT, Goodman, TNT: On the optimal stability of the Bernstein basis. Math. Comput. 64, 1553-1566 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  6. Alshbool, MHT, Bataineh, AS, Hashim, I, Isik, OR: Solution of fractional-order differential equations based on the operational matrices of new fractional Bernstein functions. J. King Saud Univ., Sci. 29(1), 1-18 (2017)

    Article  Google Scholar 

  7. Alshbool, MHT, Hashim, I: Multistage Bernstein polynomials for the solutions of the fractional order stiff systems. J. King Saud Univ., Sci. 28(4), 280-285 (2016)

    Article  Google Scholar 

  8. Kemppainen, J: Existence and uniqueness of the solution for time-fractional diffusion equation with Robin boundary condition. Abstr. Appl. Anal. 2011, Article ID 321903 (2011)

    Article  MATH  MathSciNet  Google Scholar 

  9. Podlubny, I: Fractional Differential Equations: An Introduction to Fractional Derivatives, Fractional Differential Equations, to Methods of Their Solution and Some of Their Applications, vol. 198. Academic Press, San Diego (1998)

    MATH  Google Scholar 

  10. Maleknejad, K, Basirat, B, Hashemizadeh, E: A Bernstein operational matrix approach for solving a system of high order linear Volterra-Fredholm integro-differential equations. Math. Comput. Model. 55, 1363-1372 (2012)

    Article  MATH  MathSciNet  Google Scholar 

  11. Akinlar, MA, Secer, A, Bayram, M: Numerical solution of fractional Benney equation. Appl. Math. Inf. Sci. 8, 1-5 (2014)

    MathSciNet  Google Scholar 

  12. Tadjeran, C, Meerschaert, MM, Scheffer, HP: A second-order accurate numerical approximation for the fractional diffusion equation. J. Comput. Phys. 213(1), 205-213 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  13. Alipour, M, Rostamy, D, Baleanu, D: Solving multi-dimensional FOCPs with inequality constraint by BPs operational matrices. J. Vib. Control 19(16), 2523-2540 (2013)

    Article  MATH  MathSciNet  Google Scholar 

  14. Bellucci, MA: On the explicit representation of orthonormal Bernstein polynomials, Department of Chemical Engineering, Massachusetts Institute of Technology, Cambridge, Massachusetts 02139, USA

  15. Shen, J, Tang, T, Wang, L: Spectral Methods: Algorithms, Analysis and Applications. Springer, Berlin (2010)

    Google Scholar 

  16. Rostamy, D, Karimi, K: Bernstein polynomials for solving fractional heat-and wave-like equations. Fract. Calc. Appl. Anal. 15(4), 556-571 (2012)

    Article  MATH  MathSciNet  Google Scholar 

  17. Canuto, C, Hussaini, MY, Quarteroni, A, Zang, TA: Spectral Methods in Fluid Dynamic. Prentice Hall, Englewood Cliffs (1987)

    MATH  Google Scholar 

  18. Gottlieb, D, Hussaini, MY, Orszag, S: In: Voigt, R, Gottlieb, D, Hussaini, MY (eds.) Theory and Applications of Spectral Methods in Spectral Methods for Partial Differential Equations. SIAM, Philadelphia (1984)

    Google Scholar 

  19. Guo, BY, Shen, J, Wang, ZQ: Chebyshev rational spectral and pseudospectral methods on a semi-infinite interval. Int. J. Numer. Methods Eng. 53, 65-84 (2000)

    Article  MATH  MathSciNet  Google Scholar 

  20. Ren, R, Li, H, Jiang, W, Song, M: An efficient Chebyshev-tau method for solving the space fractional diffusion equations. Appl. Math. Comput. 224, 259-267 (2013)

    MATH  MathSciNet  Google Scholar 

  21. Alavizadeh, SR, Maalek Ghaini, FM: Numerical solution of fractional diffusion equation over a long time domain. Appl. Math. Comput. 263, 240-250 (2015)

    MathSciNet  Google Scholar 

  22. Bhrawy, AH, Zaky, MA, Van Gorder, RA: A Space-Time Legendre Spectral Tau Method for the Two-Sided Space-Time Caputo Fractional Diffusion-Wave Equation. Springer, New York (2015)

    MATH  Google Scholar 

  23. Bass, RF: Real Analysis for Graduate Students, 2nd edn. (2011)

    Google Scholar 

  24. Bhrawy, AH, Zaky, MA: A method based on the Jacobi tau approximation for solving multi-term time-space fractional partial differential equations. J. Comput. Phys. 281, 876-895 (2015)

    Article  MATH  MathSciNet  Google Scholar 

  25. Javadi, S, Babolian, E, Jani, M: A numerical scheme for space-time fractional advection-dispersion equation (2015). arXiv:1512.06629v1 [math.NA]

  26. Doha, EH, Bhrawy, AH, Ezz-Eldien, SS: Numerical approximations for fractional diffusion equations via a Chebyshev spectral-tau method. Cent. Eur. J. Phys. (2013). doi:10.2478/s11534-013-0264-7

    MATH  Google Scholar 

Download references

Acknowledgements

The authors would like to thank the referee for his valuable comments and suggestions which improved the paper into its present form.

Author information

Authors and Affiliations

Authors

Contributions

Effective numerical methods for solving space-time fractional diffusion equation with initial boundary conditions are proposed. The rational normalized Bernstein functions as basis functions to approximate the exact solution are used in the unbounded time domain. Some numerical experiments to confirm the theoretical analysis are provided. In our examples we found that the collocation method yields relatively more accurate results in a comparatively shorter time compared with the Galerkin method; on the other hand, the collocation method is very sensitive to the collocation points. All authors read and approved the final manuscript.

Corresponding author

Correspondence to S Abbasbandy.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Baseri, A., Babolian, E. & Abbasbandy, S. Normalized Bernstein polynomials in solving space-time fractional diffusion equation. Adv Differ Equ 2017, 346 (2017). https://doi.org/10.1186/s13662-017-1401-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s13662-017-1401-1

Keywords