# Application of C-Bézier and H-Bézier basis functions to numerical solution of convection-diffusion equations

## Abstract

Convection-diffusion equation is widely used to describe many engineering and physical problems. The finite element method is one of the most common tools for computing numerical solution. In 2003, Wang et al. proposed C-Bézier and H-Bézier basis functions which are not only a generalization of classical Bernstein basis functions but also have a free shape parameter bringing a lot of flexibility to geometrical modeling. In this paper, we adopt C-Bézier and H-Bézier basis functions to construct test and trial function spaces of finite element method to get numerical solution of convection-diffusion equations. Compared with Lagrange basis functions, numerical accuracy is improved by $$1-3$$ order-of magnitudes which implies a much better approximation in simulating convection-diffusion problems. Several examples are presented to verify the feasibility and effectiveness of our method.

## Introduction

Convection-diffusion equation is a kind of partial differential equations (PDEs) widely used in gas dynamics , fluid mechanics , environmental science , and other physical fields. Since it is usually difficult to get analytic solutions, numerical analysis plays a vital role in solving convection-diffusion equations. There are several numerical methods, such as finite element method (FEM) , finite difference method (FDM) [5, 6], finite volume method (FVM) , finite analytic method (FAM) , spectral method (SM) , etc. [10, 11].

The finite element method is an important tool for solving PDEs in various fields of science and engineering. In 1943, Courant  firstly proposed the finite element method and used piecewise linear functions to construct the Galerkin projection space. In the 1960s, Feng  published the paper entitled “Based on The Difference Scheme of Variational Principle” regarded as the first proof of convergence of finite element method. In the 1970s, Babuska and Brezzi  presented the general theoretical framework of the mixed finite element method. Subsequently, Falk and Osborn  improved the mixed finite element method.

Based on the classical finite element method, some scholars have proposed several new methods to solve convection-diffusion equations numerically. In 2005, Adjerid and Klauser  constructed a local discontinuous Galerkin method for dimensional-one transient convection-diffusion problems and gave an asymptotically posterior error estimation. Maleknejad  gave stable numerical algorithms for heat convection and integral equations. In 2008, Liu et al.  studied a mixed time discontinuous space-time finite element method for convection-diffusion equation; this method lowered the order of equations. In 2016, Jin et al.  proposed a Petrov-Galerkin finite element method, which combined “shifted” fractional powers with continuous piecewise linear elements to construct the test and trial function spaces. To solve convection-diffusion problems in convective dominance, Baumann and Oden  presented a discontinuous hp finite element method; it was appropriate for unrestricted mesh composed of arbitrary convex polygons. This new method has the features of finite element and finite volume method; numerical simulations show that it is robust and capable of providing high accuracy. In 2020, Mirzaee proposed a new meshless method to solve 2D time fractional Tricomi equations and stochastic time-fractional sine-Gordon equations [21, 22].

Scholars have focused considerable attention on spline functions with excellent geometrical properties . For instance, Qin et al.  constructed a class of new polynomial basis functions with n local shape parameters in 2013. These spline functions satisfy the conditions required for $$G_{0}$$, $$G_{1}$$, $$G_{2}$$ continuity. Many kinds of spline basis functions can be used to construct function spaces of finite element method. In 1979, Shi  introduced spline finite element method to solve the equilibrium problem of the plate-beam composite elastic structures in regular regions and derived a unified computation scheme for various boundary conditions. In 2005, inspired by CAD, Hughes , Academician of The American Academy of Sciences, proposed a new spline finite element method which applies NURBS basis functions in finite element analysis for isometric analysis. In 2007, Bhatti and Bracken  suggested that the method combining Bernstein basis function and Galerkin method can achieve better results in solving partial differential equations.

The spline basis functions are widely applied in finite element method to get better numerical solutions, such as Bernstein, B-spline, and NURBS functions. Bernstein basis functions form bases of polynomial space, which can be used to construct function spaces of finite element method, but they fail to express transcendental curves, for instance, the cycloid and helix. In addition, NURBS model also has several weaknesses. On the one hand, the rational form is unstable. On the other hand, it increases the complexity for computing integrals and derivatives. For overcoming the disadvantages of rational Bernstein basis functions, scholars made a lot of efforts to construct basis functions. In 2003, Wang et al. [30, 31] applied an integral approach to construct C-Bézier basis functions for the space $$T=\operatorname{span} \{1,t,\ldots ,t^{n-2},\sin t,\cos t \}$$ that extended the spaces of mixed algebra and trigonometric polynomial. After that, Wang developed H-Bézier basis functions for the space $$T=\operatorname{span} \{\sinh t,\cosh t,t^{k-2}, t^{k-3},\ldots ,t,1 \}$$.

C-Bézier and H-Bézier basis functions are one kind of spline functions that have a non-rational form and are capable of expressing circular arc and polynomial curves of high order exactly. Furthermore, C-Bézier and H-Bézier basis functions are generalization of classical Bézier basis and keep their excellent properties. In addition, the free variable α can be utilized to change the shape and geometry of curves. In previous work, scholars obtained good approximate solutions by combining spline functions with the finite element method . Therefore, we consider using spline functions C-Bézier and H-Bézier basis to construct function spaces in the finite element method and expect the approximate solutions to be more accurate than the classical Lagrange basis function.

In this paper, we combine the Galerkin finite element method with C-Bézier and H-Bézier basis functions to solve convection-diffusion equation. C-Bézier and H-Bézier basis functions are selected to construct trial and test function spaces. The error analysis and numerical examples are given, and the numerical results indicate that our method has much better precision in solving convection-diffusion equations. The numerical solutions in this paper are generated in Matlab 2018a.

The rest of the paper is organized as follows. In Sect. 2, we recall the definitions and properties of C-Bézier and H-Bézier basis functions. In Sect. 3, we use C-Bézier and H-Bézier basis functions to construct the test and trial function spaces. Furthermore, the framework of the finite element method to solve convection-diffusion equations is presented. In Sect. 4, we discuss the stability of the difference scheme. In addition, error estimation of the finite element method with C-Bézier and H-Bézier basis functions is provided. In Sect. 5, several numerical examples are given to illustrate the theoretical results. In the final section, we not only summarize some comments on the overall work but also touch upon some avenues of future research.

## C-Bézier basis and H-Bézier basis functions

In this section, we recall C-Bézier and H-Bézier basis functions proposed by Wang et al. A free shape parameter is introduced in these basis functions to portray polynomial and circular curves of high degree precisely.

### Definition 1

The C-Bézier basis function $$\{C_{i}^{n}(t) \}_{i=0}^{n}$$ for the space $$T=\operatorname{span} \{1,t, \ldots ,t^{n-2}, \sin t, \cos t \}$$ of degrees n is defined as follows

\begin{aligned} &C_{0}^{n}(t)=1- \int _{0}^{t}\delta _{0}^{n-1}C_{0}^{n-1}(s)\,ds, \\ &C_{i}^{n}(t)= \int _{0}^{t}\delta _{i-1}^{n-1}C_{i-1}^{n-1}(s)\,ds- \int _{0}^{t}\delta _{i}^{n-1}C_{i}^{n-1}(s)\,ds, \quad i=1,2,\ldots ,n-1, \\ &C_{n}^{n}(t)= \int _{0}^{t}\delta _{n-1}^{n-1}C_{n-1}^{n-1}(s)\,ds, \end{aligned}
(1)

where $$n\geq 2$$, $$t\in [0,\alpha ]$$, $$\alpha \in (0,\pi ]$$, $$C_{0}^{1}(t)=\frac{\sin(\alpha -t)}{\sin\alpha}$$, $$C_{1}^{1}(t)=\frac{\sin t}{\sin\alpha}$$, $$\delta _{i}^{n}=(\int _{0}^{\alpha }C_{i}^{n}(t)\,dt)^{-1}$$, α is referred as shape parameter .

While $$n=2$$, C-Bézier basis function is expressed as follows.

\begin{aligned} &C_{0}^{2}(t)= \frac{1-\cos(\alpha -t)}{1-\cos\alpha}, \\ &C_{1}^{2}(t)=-\frac{1-\cos t+\cos\alpha -\cos(\alpha -t)}{1-\cos\alpha}, \\ &C_{2}^{2}(t)=\frac{1-\cos t}{1-\cos\alpha}, \end{aligned}
(2)

where $$t\in [0,\alpha ]$$, $$\alpha \in (0,\pi ]$$. Figure 1(a) shows the quadratic C-Bézier basis function at $$\alpha =\frac{\pi}{6}$$. Figure 1(b) presents the quadratic C-Bézier basis function at $$\alpha =\frac{3\pi}{4}$$.

C-Bézier basis functions are a generalization of classical Bernstein basis functions that pose a lot of common properties, such as affine invariance, endpoints interpolation, convex hull property. From the graph above, we can see that the C-Bézier basis functions have symmetry written by the mathematical formula as

$$C_{i}^{n}(t)=C_{n-i}^{n}(\alpha -t)\quad \text{for } t\in [0,\alpha ], i=0,1, \ldots ,n.$$

### Definition 2

A C-Bézier curve $$p(t)$$ is defined by

$$p(t)=\sum_{i=0}^{n}P_{i}C_{i}^{n}(t),\quad t \in [0,\alpha ],$$

here, $$P_{i}$$ ($$i=0,1,\ldots ,n$$) is called control point, $$C_{i}^{n}(t)$$ is the C-Bézier basis function for the space $$T=\operatorname{span} \{1,t,\ldots ,t^{n-2},\sin t,\cos t \}$$, α is the shape parameter.

Figure 2(a) provides the picture of quadratic curve with control points $$(0,0)$$, $$(1,5)$$, $$(3,2)$$ and $$\alpha =\frac{\pi}{4}$$. Figure 2(b) displays a cubic C-Bézier curve with $$\alpha =\pi$$, it’s control points are $$(0,0)$$, $$(2,5)$$, $$(3,1)$$, $$(4,4)$$. Figure 2(c) presents the figure of a quadratic C-Bézier curve with control points $$(0,8)$$, $$(2,4)$$, $$(4,2)$$, $$(6,3)$$, $$(8,8)$$ and $$\alpha =2$$.

### Definition 3

The H-Bézier basis function $$\{H_{i}^{n}(t) \}_{i=0}^{n}$$ for the space $$T=\operatorname{span} \{1,t, \ldots , t^{n-2}, \sinh t, \cosh t \}$$ of n degrees is defined by

\begin{aligned} &H_{0}^{n}(t)=1- \int _{0}^{t}\delta _{0}^{n-1}H_{0}^{n-1}(s)\,ds, \\ &H_{i}^{n}(t)= \int _{0}^{t}\delta _{i-1}^{n-1}H_{i-1}^{n-1}(s)\,ds- \int _{0}^{t}\delta _{i}^{n-1}H_{i}^{n-1}(s)\,ds,\quad i=1,2,\ldots ,n-1, \\ &H_{n}^{n}(t)= \int _{0}^{t}\delta _{n-1}^{n-1}H_{n-1}^{n-1}(s)\,ds, \end{aligned}
(3)

in which $$n\geq 2$$, $$t\in [0,\alpha ]$$, $$\alpha \in (0,+\infty )$$, $$H_{0}^{1}(t)=\frac{\sinh(\alpha -t)}{\sinh\alpha}$$, $$H_{1}^{1}(t)=\frac{\sinh t}{\sinh\alpha}$$, $$\delta _{i}^{n}=(\int _{0}^{\alpha}H_{i}^{n}(t)\,dt)^{-1}$$, α is called shape parameter .

While $$n=2$$, the H-Bézier basis function is expressed by Eq. (4).

\begin{aligned} &H_{0}^{2}(t)= \frac{1-\cosh(\alpha -t)}{1-\cosh\alpha}, \\ &H_{1}^{2}(t)=-\frac{1-\cosh t+\cosh\alpha}{1-\cosh\alpha}+ \frac{\cosh(\alpha -t)}{1-\cosh\alpha}, \\ &H_{2}^{2}(t) =\frac{1-\cosh t}{1-\cosh\alpha}, \end{aligned}
(4)

here, $$t\in [0,\alpha ]$$, $$\alpha \in (0,+\infty )$$. The quadratic H-Bézier basis functions at $$\alpha =\pi$$ and $$\alpha =8$$ are shown in Fig. 3. Basis functions at $$\alpha =\pi$$ and $$\alpha =8$$ are also shown in Fig. 3.

### Definition 4

An H-Bézier curve $$p(t)$$ is defined by

$$p(t)=\sum_{i=0}^{n}P_{i}H_{i}^{n}(t),\quad t \in [0,\alpha ].$$

Similarly to C-Bézier curve, $$P_{i}$$ ($$i=0,1,\ldots ,n$$) is control point, $$H_{i}^{n}(t)$$ is the H-Bézier basis function for the space $$T=\operatorname{span} \{\sinh t,\cosh t,t^{k-3},t^{k-4},\ldots ,t,1 \}$$, α is the shape parameter.

As shown in Fig. 4, the graph on the left demonstrates a quadratic H-Bézier curve with control points $$(0,5)$$, $$(2,2)$$, $$(4,7)$$ and $$\alpha =2$$. The image of a cubic curve with $$\alpha =3$$ is in the middle; its control points are $$(0,6)$$, $$(1,2)$$, $$(3,4)$$, $$(4,1)$$. A quadratic H-Bézier curve with control points $$(0,0)$$, $$(2,4)$$, $$(4,7)$$, $$(6,4)$$, $$(8,1)$$ and $$\alpha =1$$ is provided on the right.

The H-Bézier basis functions have many beneficial properties in common with Bernstein basis functions. Compared to classical Bernstein basis, C-Bézier and H-Bézier basis functions have a free variable allowing adjustment of the local or global shape and geometrical properties of the curves. In addition, even though shape parameter may change, the position and tangent direction of the curve’s endpoints do not alter . Furthermore, in the splicing of multiple C-Bézier curves, the shape parameter will not transform the original continuity between curves .

## Discrete model of convection-diffusion equation

In this section, we consider combining the Galerkin finite element approach with C-Bézier and H-Bézier basis functions to solve the following convection-diffusion equation .

$$\textstyle\begin{cases} \frac{\partial u}{\partial t}-\nabla \cdot (a\nabla u)+b\nabla u+cu=f, \quad \text{in } \Omega \times [0,T] , \\ u(x,0)=u_{0}(x),\quad \text{a.e. in } \Omega , \\ u|_{\partial \Omega}=g(x), \quad \text{a.e. in } \partial \Omega \times [0,T]. \end{cases}$$
(5)

Denote by Ω an open, bounded, connected subset of ${\mathbb{R}}^{1}$ and Ω the boundary of Ω. An initial condition $$u_{0}$$ and a boundary condition $$g(x)$$ on Ω for u are prescribed. $$a=a(x,t)$$ and $$b=b(x,t)$$ are the diffusion and convection coefficients; the right-hand side, $$f=f(x,t)$$ represents the source function . To solve the above model with the finite element method, C-Bézier and H-Bézier basis functions are selected to construct trial and test function spaces. We give the weak formulation of one-dimensional convection-diffusion in Eq. (5) and discrete the weak formulation with the Galerkin method. First of all, denoted by $$H^{1}_{0}(\Omega )$$ the subspace of the Sobolev space $$H^{1}(\Omega )$$:

$$H^{1}_{0}(\Omega )= \bigl\{ u \in H^{1}(\Omega ):u|_{\partial \Omega}=0 \bigr\} .$$

Multiplying the first equation of Eq. (5) by test function v yields

$$\biggl(\frac{\partial u}{\partial t},v\biggr)+\bigl(-\nabla \cdot (a\nabla u),v\bigr)+(b \nabla u,v)+(cu,v)=(f,v),\quad \forall v\in H^{1}_{0}(\Omega ).$$
(6)

Using Green formula and divergence theorem, one can obtain the following:

$$\int _{\Omega}\frac{\partial u}{\partial t}v\,dx+ \int _{\Omega}a \frac{\partial u}{\partial x}\frac{\partial v}{\partial x}\,dx+ \int _{ \Omega}b\frac{\partial u}{\partial x}v\,dx+ \int _{\Omega}cuv\,dx= \int _{ \Omega}fv\,dx,\quad \forall v\in H^{1}_{0}( \Omega ).$$
(7)

If we define two operators as

\begin{aligned} &A(u,v)= \int _{\Omega}a\frac{\partial u}{\partial x} \frac{\partial v}{\partial x}\,dx+ \int _{\Omega}b \frac{\partial u}{\partial x}v\,dx+ \int _{\Omega}cuv\,dx, \\ &(f,v)= \int _{\Omega}fv\,dx, \end{aligned}
(8)

then the variational scheme of Eq. (5) may be read as, looking for an $$u(x,t)$$ satisfies

$$\textstyle\begin{cases} (\frac{\partial u}{\partial t},v)+A(u,v)=(f,v), \quad \text{in } \Omega \times [0,T] , \\ u(x,0)=u_{0}(x), \quad \text{a.e. in }\Omega, \\ u|_{\partial \Omega}=g(x), \quad \text{a.e. in } \partial \Omega \times [0,T], \end{cases}$$
(9)

saying that u is the generalized solution of Eq. (5) .

Now, we divide Ω into mesh elements uniformly, denoted by $$\Omega _{h}$$, then define C-Bézier basis functions or H-Bézier basis functions on each element E of $$\Omega _{h}$$. The finite dimensional subspace $$U_{h}=\operatorname{span} \{\phi _{j} \}_{j=1}^{n}$$ of $$H_{0}^{1}(\Omega )$$ are constructed taking all the basis functions together, where $$\phi _{j}$$ are actually C-Bézier basis functions or H-Bézier basis functions.

Subsequently, the Galerkin formulation of the above problem is to find $$u_{h}\in U_{h}$$, such that

$$\textstyle\begin{cases} (\frac{\partial u_{h}}{\partial t},v_{h})+A(u_{h},v_{h})=(f,v_{h}), \quad \forall v\in U_{h},t\in [0,T], \\ (u(x,0),v_{h})=(u_{0}(x),v_{h}),\quad \forall v\in U_{h},t \in [0,T], \\ u|_{\partial \Omega}=g(x),\quad \text{a.e. in } \partial \Omega \times [0,T]. \end{cases}$$
(10)

As $$\phi _{j}$$, $$j =1,\ldots ,n$$ is base of finite dimensional space $$U_{h}$$, $$u_{h}(x,t)$$ and is expressed as

$$u_{h}(x,t)=\sum_{j=0}^{n}u_{j}(t) \phi _{j}(x).$$

Taking $$v_{i}=\phi _{i}$$, $$i =1,\ldots ,n$$, we get a system of ordinary differential equations for $$u_{1}(t),u_{2}(t), \ldots u_{n}(t)$$

$$\sum_{j=1}^{n} (\phi _{j},\phi _{i})\frac{d u_{j}}{dt}+\sum_{j=1}^{n}A( \phi _{j},\phi _{i})u_{j}=(f,\phi _{i}),\quad i=1,2,\ldots ,n.$$
(11)

System Eq. (11) is expressed in vector form as

$$M\vec{X}^{\prime }(t)+A(t)\vec{X}(t)=\vec{b}(t).$$
(12)

We assume $$\Omega =[0,L]$$, then

$$A(t)=[a_{ij}]_{i,j=1}^{n}=\biggl[ \int _{0}^{L}a\nabla \phi _{j}\cdot \nabla \phi _{i}\,dx+ \int _{0}^{L}b\nabla \phi _{j} \phi _{i}\,dx+ \int _{0}^{L}c \phi _{j}\phi _{i}\,dx\biggr]_{i,j=1}^{n}$$

is the stiffness matrix,

$$M=[m_{i,j}]_{i,j=1}^{n}= \int _{0}^{L} \phi _{j}\phi _{i}\,dx$$

is the mass matrix,

$$\vec{b}(t)=[b_{i}]_{i=1}^{n}=\biggl[ \int _{0}^{L}f\phi _{i} \biggr]_{i=1}^{n}$$

$$\vec{X}(t)=\bigl[u_{j}(t)\bigr]_{j=1}^{n}$$

is the unknown vector. So far, we gain a semi-discretization Galerkin function Eq. (11).

If we further discretize the space-time domain $$[0,T]$$, let $$0=t_{0}< t_{1}<\cdots <t_{N}=T$$, $$t_{k}=k\tau$$, where τ is the time step. Then obtain a completely discretized Galerkin equation. For instance, using the forward difference quotient

$$\frac{1}{\tau}\bigl(u_{h}^{k+1}-u_{h}^{k},v_{h} \bigr)+A\bigl(u_{h}^{k},v_{h} \bigr)=(f,v_{h}),\quad k=0,1, \ldots ,$$
(13)

using the backward difference quotient

$$\frac{1}{\tau}\bigl(u_{h}^{k+1}-u_{h}^{k},v_{h} \bigr)+A\bigl(u_{h}^{k+1},v_{h} \bigr)=(f,v_{h}),\quad k=0,1, \ldots ,$$
(14)

using the Crank–Nicolson format 

$$\frac{1}{\tau}\bigl(u_{h}^{k+1}-u_{h}^{k},v_{h} \bigr)+\frac{1}{2}A\bigl(u_{h}^{k+1}+u_{h}^{k},v_{h} \bigr)=\bigl(f(t_{k+ \frac{1}{2}}),v_{h}\bigr),\quad k=0,1,\ldots .$$
(15)

In which superscript k is the approximation at $$t=t_{k}=k\tau$$. We use the Crank–Nicolson format to discretize the space-time domain; its stability will be proved in the next chapter.

## Stability and error analysis

Our first goal is to present an error estimate in $$L^{2}$$ when equation (5) is semi-discrete.

### Lemma 1

Let u and $$u_{h}$$ be the solutions of equation (5) and equation (11), suppose $$u_{0}=0$$ on Ω. Then,

$$\bigl\Vert u_{h}(t)-u(t) \bigr\Vert \leq \Vert u_{0_{h}}-u_{0} \Vert +Ch^{r}\biggl( \Vert u_{0} \Vert _{r}+ \int _{o}^{t} \Vert u_{t} \Vert _{r}\,ds\biggr),\quad \textit{for } t \geq 0.$$

Here, we require the solution of the continuous problem has the regularity implicitly assumed by the presence of the norms on the right .

In this paper, the Crank–Nicolson format is applied to discrete time t. Here, the semi-discrete form is discretized in a symmetric fashion around the point $$t_{k+\frac{1}{2}}=(k+\frac{1}{2})\tau$$. This will generate a second order accurate in time. Below, we prove that this format is stable with initial values. Let $$v_{h}=u_{h}^{n+1}-u_{h}^{n}$$, $$f=0$$, we have

$$\frac{1}{\tau} \bigl\Vert u_{h}^{n+1}-u_{h}^{n} \bigr\Vert ^{2}+\frac{1}{2}A\bigl(u_{h}^{n+1}+u_{h}^{n},u_{h}^{n+1}-u_{h}^{n} \bigr)=0,$$
(16)

where $$\|\cdot \|$$ expresses $$L^{2}$$ norm. Taking advantage of the symmetry of $$a(\cdot ,\cdot )$$, we obtain

$$A\bigl(u_{h}^{n+1}+u_{h}^{n},u_{h}^{n+1}-u_{h}^{n} \bigr)=A\bigl(u_{h}^{n+1},u_{h}^{n+1} \bigr)-A\bigl(u_{h}^{n},u_{h}^{n}\bigr)= \bigl\vert u_{h}^{n+1} \bigr\vert _{1}^{2}- \bigl\vert u_{h}^{n} \bigr\vert _{1}^{2},$$

here, $$|\,|_{1}$$ is semi-norm, then

$$\bigl\vert u_{h}^{n+1} \bigr\vert _{1}\leq \bigl\vert u_{h}^{n} \bigr\vert _{1}\leq \cdots \leq \bigl\vert u_{h}^{0} \bigr\vert _{1}.$$

Therefore, the stability of format Eq. (15) is proved. Next, the error estimate reads as follows.

### Theorem 1

Let $$U^{k}$$ be the solution of problem (15). $$U^{k}$$ represents the value of $$u_{h}$$ at $$t=t_{k}$$. u is the solution of problem (5), and let $$\Vert u_{0_{h}}-u_{0}\Vert \leq Ch^{r}\Vert u_{0}\Vert _{r}$$ and $$u_{0}=0$$ on Ω. Then,

$$\bigl\Vert U^{k}-u(t_{k}) \bigr\Vert \leq Ch^{r}\biggl( \Vert u_{0} \Vert _{r}+ \int _{0}^{t_{k}} \Vert u_{t} \Vert _{r}\,ds\biggr)+Ch^{2} \int _{0}^{t_{k}}\bigl( \Vert u_{ttt} \Vert + \Vert \Delta u_{tt} \Vert \bigr)\,ds,$$

for $$k\geq 0$$.

Specific proof can be found in reference .

## Numerical examples

In this section, several numerical examples are given to solve convection-diffusion functions with C-Bézier and H-Bézier basis functions, which are used to construct test and trial function spaces of finite element method. In contrast to Lagrange basis functions, the accuracy of numerical solution is improved by $$1-3$$ order-of magnitudes, which implies a much better approximation in simulating convection-diffusion problems.

The errors for the finite element method shall be measured in three norms defined as follows.

\begin{aligned}& \Vert u-u_{h} \Vert _{\infty}=\sup _{x\in \Omega} \vert u-u_{h} \vert \quad \bigl(L^{\infty} \text{ norm error}\bigr),\\& \Vert u-u_{h} \Vert _{0}=\sqrt{ \int _{\Omega}(u-u_{h})^{2}\,dx}\quad \bigl(L^{2} \text{ norm error}\bigr),\\& \vert u-u_{h} \vert _{1}=\sqrt{ \int _{\Omega} \biggl( \frac{\partial (u-u_{h})}{\partial x} \biggr)^{2}\,dx} \quad \bigl(H^{1}\text{ semi-norm error}\bigr). \end{aligned}

### Example 1

Consider following convection-diffusion equation with Dirichlet conditions

$$\textstyle\begin{cases} u_{t}-\nabla \cdot (\nabla u)+t\nabla u=(4t+1)\sin x\cos x+t^{2}(\cos^{2}x-\sin^{2}x), \\ x\in (0,1),\quad t>0, \\ u(x,0)=0,\qquad x \in [0,1],\quad t=0, \\ u(0,t)=0,\qquad u(1,t)=t\sin1\cos1,\quad t>0. \end{cases}$$
(17)

Its exact solution is $$u=t \sin x\cos x$$.

In this example, we construct test and trial function spaces consisting quadratic C-Bézier basis function. Divide the $$[0,1]$$ into n elements, the ith element is denoted by $$E_{i}=[x_{i},x_{i+1}]$$. Finite element nodes include all the mesh nodes and the middle points of all the mesh elements. We firstly consider the reference C-Bézier basis function on the reference element $$[0,1]$$. As shown in Eq. (1), the range of t is $$[0,\alpha ]$$, let $$t=m\alpha$$, $$m\in [0,1]$$. Then the reference C-Bézier basis function on the reference element $$[0,1]$$ is

$$\textstyle\begin{cases} \phi _{1} =\frac{1-\cos(\alpha -m\alpha )}{1-\cos\alpha}, \\ \phi _{2} =- \frac{1-\cos(m\alpha )+\cos\alpha -\cos(\alpha -m\alpha )}{1-\cos\alpha}, \\ \phi _{3} =\frac{1-\cos(m\alpha )}{1-\cos\alpha}. \end{cases}$$
(18)

Here, $$m\in [0,1]$$, $$\alpha \in (0,\pi ]$$. Next, we use the affine mapping between an arbitrary interval $$[x_{i},x_{i+1}]$$ and the reference interval $$[0,1]$$ to construct the local basis functions from the reference. Equation (19) is the quadratic C-Bézier basis function on $$E_{i}=[x_{i},x_{i+1}]$$.

$$\textstyle\begin{cases} \phi _{i1}=\frac{1-\cos(\frac{x_{i+1}-x}{h}\alpha )}{1-\cos\alpha}, \\ \phi _{i2}=- \frac{1-\cos(\frac{x-x_{i}}{h}\alpha )+\cos\alpha -\cos(\frac{x_{i+1}-x}{h}\alpha )}{1-\cos\alpha}, \\ \phi _{i3} =\frac{1-\cos(\frac{x-x_{i}}{h}\alpha )}{1-\cos\alpha}. \end{cases}$$
(19)

Where $$x\in [x_{i},x_{i+1}]$$, $$\alpha \in (0,\pi ]$$. A finite dimensional subspace will be constructed by putting these local basis functions together.

The comparison of the errors in $$L^{\infty}$$ norm with quadratic C-Bézier and quadratic Lagrange basis functions is indicated in Fig. 5(a) ($$h= \frac{1}{4}$$, $$t=1$$). Figure 5(b) presents the corresponding colormap of convection diffusion when $$0\leq x \leq 1$$, $$0\leq t \leq 1$$. The numerical errors obtained from C-Bézier and Lagrange basis functions are set out in Table 1.

In Table 1, h is the step size of subdivision, and α is the shape parameter. It stands out that the precision of numerical solutions with C-Bézier basis function is one order-of magnitude higher than Lagrange basis function with the same step size h.

### Example 2

In this example, the convection-diffusion function with Dirichlet conditions is given as

$$\textstyle\begin{cases} u_{t}-\nabla \cdot (\nabla u)+\pi \nabla u+(\sin x)u \\ \quad =t\sin(\pi x)(2+t\sin x) \\ \qquad {} +\pi ^{2}t^{2}(\sin(\pi x)+\cos(\pi x)), \quad x\in (0,1),t>0, \\ u(x,0)=0,\quad x \in [0,1], t=0, \\ u(0,t)=0,\qquad u(1,t)=0,\quad t>0. \end{cases}$$
(20)

The exact solution of the above problem is $$u=t^{2}\sin(\pi x)$$; we use quadratic C-Bézier and Lagrange basis functions to create trail space and test space. Figure 6(a) compares the errors in $$L^{\infty}$$ norm of C-Bézier and Lagrange basis functions.

The table below illustrates the specific data of errors.

Comparing the errors of numerical solution obtained by C-Bézier and Lagrange basis functions with h unchanged, it stands out in Table 2 that the numerical solutions of C-Bézier basis function are $$4-7$$ order-of magnitudes more accurate than Lagrange basis function.

### Example 3

Considering the following equation

$$\textstyle\begin{cases} u_{t}-\nabla \cdot (\nabla u)+t\nabla u=\cosh x(1-t)+t^{2}\sinh x,\quad x\in (0,1), t>0, \\ u(x,0)=0, \quad x \in [0,1],t=0, \\ u(0,t)=t,\qquad u(1,t)=t \cosh1,\quad t>0, \end{cases}$$
(21)

where the exact solution is $$u=t \cosh x$$. We make quadratic H-Bézier and Lagrange basis functions construct trail space and test space. The errors in $$L^{\infty}$$ norm got from Lagrange and H-Bézier basis functions can be compared in Fig. 7(a) ($$h=\frac{1}{4}$$, $$t=1$$). Figure 7(b) provides the picture of convection diffusion when $$0\leq x \leq 1$$, $$0\leq t \leq 1$$. Numerical values for the errors are given in Table 3.

What is striking about the figures in this table is the precision of numerical solutions with H-Bézier basis function is $$5-6$$ order-of magnitudes higher than Lagrange basis function.

### Example 4

In this example, we consider

$$\textstyle\begin{cases} u_{t}-\nabla \cdot (2\nabla u)+\frac{1}{4} u=4\cosh^{2}(\frac{x}{4})-t \sinh^{2}( \frac{x}{4}),\quad x\in [0,1],t>0, \\ u(x,0)=0,\quad x \in [0,1],t=0, \\ u(0,t)=4t,\qquad u(1,t)=4t \cosh^{2}(\frac{1}{4}),\quad t>0. \end{cases}$$
(22)

The exact solution for above problem is $$u=4t\cosh^{2}(\frac{x}{4})$$. The quadratic H-Bézier and Lagrange basis functions are used to solve Example 4. Figure 8(a) shows the comparison of errors in $$L^{\infty}$$ norm, which obtained by Lagrange and H-Bézier basis functions ($$h=\frac{1}{4}$$, $$t=1$$), numerical errors are given in Table 4.

The difference of errors between H-Bézier and Lagrange basis functions is highlighted in Table 4. Compared to the numerical results obtained by Lagrange basis function, the accuracy of numerical results got by H-Bézier basis function is improved by $$2-5$$ order-of magnitudes.

### Example 5

In this example, we verify the effectiveness of H-Bézier basis function with shape parameter $$\alpha \ge 1$$. Consider the following equation

$$\textstyle\begin{cases} u_{t}-\nabla \cdot (\nabla u)+u=\sinh x,\quad x\in [-4,4],t>0, \\ u(x,0)=0,\quad x \in [-4,4],t=0, \\ u(-4,t)=t \sinh(-4), \qquad u(1,t)=t\sinh(4),\quad t>0, \end{cases}$$
(23)

with exact solution $$u(x,t)=t\sinh x$$, quadratic H-Bézier and Lagrange basis functions are used to solve the above problem. Figure 9 shows the numerical errors in $$L^{\infty}$$ norm ($$h=\frac{1}{8}$$, $$t=1$$) and convection diffusion diagram. Table 5 provides the rate of convergence of H-Bézier and Lagrange basis functions in $$L^{\infty}$$, $$L^{2}$$, and $$H^{1}$$ norm on uniform rectangular mesh with size h.

From the date in the Table 5, it can be seen that while Lagrange basis function and H-Bézier basis function have the same rate of convergence, the mesh size h for Lagrange basis function is much smaller, which implies that the computational complexity of Lagrange basis function is far greater than that of H-Bézier basis function.

From the above examples, it is surprising that the accuracy of numerical solutions with H-Bézier and C-Bézier functions is higher than Lagrange basis function. Consequently, we have verified the effectiveness and feasibility of our method.

## Conclusions and future work

In this contribution, we adopt C-Bézier and H-Bézier basis functions to construct the test and trial function spaces of the finite element method. In contrast to classical Lagrange basis functions, our scheme gets much better approximation precision for convection-diffusion equations. The limitation of this paper is that there is no systematic method to obtain the optimal shape parameters to minimize the error between the numerical solution and the exact solution.

There are two interesting aspects to be explored in future research. Firstly, how to get better shape parameter for solving PDEs numerically. Secondly, how to analyze the error of exact results and numerical solutions generated by C-Bézier and H-Bézier basis functions theoretically.

## Availability of data and materials

No data were used to support this study.

## References

1. Zhang, Q., Sheng, W.: A random choice method based on the generalized Riemann problem for the Euler equations in gas dynamics. J. Comput. Phys. 441(15), 1–15 (2021)

2. Rasoulizadeh, M.N., Ebadi, M.J., Avazzadeh, Z.: An efficient local meshless method for the equal width equation in fluid mechanics. Eng. Anal. Bound. Elem. 131(C), 258–268 (2021)

3. Zhao, D., Xin, Y., Zhang, H., Wang, X.: Effect of environmental conditions on Pb(II) adsorption on β-MnO 2. Chem. Eng. J. 164(1), 49–55 (2010)

4. Massing, A., Schott, B., Wall, W.A.: A stabilized Nitsche cut finite element method for the Oseen problem. Comput. Methods Appl. Mech. Eng. 328(1), 262–300 (2018)

5. Mirzaee, F., Rezaei, S., Samadyar, N.: Application of combination schemes based on radial basis functions and finite difference to solve stochastic coupled nonlinear time fractional sine-Gordon equations. Comput. Appl. Math. 41(1), 1–16 (2022)

6. Mirzaee, F., Rezaei, S., Samadyar, N.: Solution of time-fractional stochastic nonlinear sine-Gordon equation via finite difference and meshfree techniques. Math. Methods Appl. Sci. 45(7), 3426–3428 (2021)

7. Erath, C., Schorr, R.: Stable non-symmetric coupling of the finite volume method and the boundary element method for convection-dominated parabolic-elliptic interface problems. Comput. Methods Appl. Math. 20(2), 251–272 (2020)

8. Zhang, Z., Wang, W., Gong, C.: Finite analytic method for modeling variably saturated flows. Sci. Total Environ. 621(15), 1151–1162 (2018)

9. Li, J., Ma, H., Li, H.: A triangular spectral element method for elliptic and Stokes problems. Appl. Math. Comput. 321(1), 195–208 (2018)

10. Mirzaee, F., Samadyar, N.: Implicit meshless method to solve 2D fractional stochastic Tricomi-type equation defined on irregular domain occurring in fractal transonic flow. Numer. Methods Partial Differ. Equ. 37(2), 1781–1799 (2020)

11. Mirzaeek, F., Samadyar, N.: Numerical solution of time fractional stochastic Korteweg-de Vries equation via implicit meshless approach. Iran. J. Sci. Technol. Trans. A, Sci. 43(6), 2905–2912 (2019)

12. Courant, R.L.: Variational methods for the solution of problems of equilibrium and vibration. Bull., New Ser., Am. Math. Soc. 49, 1–23 (1943)

13. Feng, K.: Difference scheme based on variational principle. Appl. Math. Comput. 2(4), 238–262 (1965)

14. Babuka, I.: Error-bounds for finite element method. Numer. Math. 16(4), 322–333 (1971)

15. Falk, R.S., Osborn, J.E.: Error estimates for mixed finite element methods. RAIRO. Anal. Numér. 14(3), 249–277 (1980)

16. Adjerid, S., Klauser, A.: Superconvergence of discontinuous finite element solutions for transient convection–diffusion problems. J. Sci. Comput. 22(1), 5–24 (2005)

17. Maleknejad, K., Mirzaee, F.: Numerical solution of stochastic linear heat conduction problem by using new algorithms. Appl. Math. Comput. 163(1), 97–106 (2005)

18. Liu, Y., Li, H., He, S.: Mixed time discontinuous space-time finite element method for convection diffusion equations. Appl. Math. Mech. 29(12), 1579–1586 (2008)

19. Jin, B., Lazarov, R., Zhou, Z.: A Petrov–Galerkin finite element method for fractional convection-diffusion equations. SIAM J. Numer. Anal. 54(1), 481–503 (2016)

20. Baumann, C.E., Oden, J.T.: A discontinuous hp finite element method for convection-diffusion problems. Comput. Methods Appl. Mech. Eng. 175(3/4), 311–341 (2015)

21. Mirzaee, F., Rezaei, S., Samadyar, N.: Solving one-dimensional nonlinear stochastic sine-Gordon equation with a new meshfree technique. Int. J. Numer. Model. 34(4), e2856 (2020)

22. Mirzaee, F., Rezaei, S., Samadyar, N.: Numerical solution of two-dimensional stochastic time-fractional sine-Gordon equation on non-rectangular domains using finite difference and meshfree methods. Eng. Anal. Bound. Elem. 127, 53–63 (2021)

23. Bibi, S., Misro, M.Y., Abbas, M.: Smooth path planning via cubic GHT-Bézier spiral curves based on shortest distance, bending energy and curvature variation energy. AIMS Math. 6(8), 8625–8641 (2021)

24. Ammad, M., Misro, M.Y., Ramli, A.: A novel generalized trigonometric Bézier curve: properties, continuity conditions and applications to the curve modeling. Math. Comput. Simul. 194, 744–763 (2022)

25. Said Mad Zain, S.A.A.A., Misro, M.Y., Miura, K.T.: Generalized fractional Bézier curve with shape parameters. Mathematics 9(17), 1–32 (2021)

26. Qin, X., Hu, G., Zhang, N., Shen, X., Yang, Y.: A novel extension to the polynomial basis functions describing Bézier curves and surfaces of degree n with multiple shape parameters. Appl. Math. Comput. 223, 1–16 (2013)

27. Shi, Z.: Spline finite element. Numer. Math. 1(1), 50–72 (1979)

28. Hughes, T., Cottrell, J.A., Bazilevs, Y.: Isogeometric analysis: CAD, finite elements, NURBS, exact geometry and mesh refinement. Comput. Methods Appl. Mech. Eng. 194(39–41), 4135–4195 (2005)

29. Bhatti, M.I., Bracken, B.P.: Solutions of differential equations in a Bernstein polynomial basis. J. Comput. Appl. Math. 205(1), 272–280 (2007)

30. Lü, Y., Wang, G., Yang, X.: Uniform hyperbolic polynomial B-spline curves. Comput. Aided Geom. Des. 19(6), 379–393 (2002)

31. Chen, Q., Wang, G.: A class of Bézier-like curves. Comput. Aided Geom. Des. 20(1), 29–39 (2003)

32. Hajduka, H., Kuzmina, D., Kolevb, D., Abgrallc, R.: Matrix-free subcell residual distribution for Bernstein finite element discretizations of linear advection equations. Comput. Methods Appl. Mech. Eng. 359, 1–43 (2020)

33. Vadlamani, S., Arun, C.O.: A stochastic B-spline wavelet on the interval finite element method for beams. Comput. Struct. 233, 1–16 (2020)

34. Sun, L., Su, F.: Application of C-Bézier and H-Bézier basis in solving heat conduction problems. J. Xinyang. Norm Univ: Nat. Sci. Ed. 35(3), 1–6 (2022)

35. Hussain, M.Z., Shakeel, A., Hussain, M.: $$G^{2}$$-Approximation of Circular Arcs by C-Bézier Curve: An Alternate Approach. IEEE Comput. Soc., Los Alamitos (2018)

36. Nguyen, G., Zhong, S.S., Odawara, S.: Numerical analysis on iron loss of reactor core under hysteresis B-H curve using play model for DC-DC converter. IEEE Trans. Ind. Appl. 9(2), 159–167 (2020)

37. Wang, C., Zikatanov, L.: Low regularity primal-dual weak Galerkin finite element methods for convection-diffusion equations. J. Comput. Appl. Math. 394(228), 113543–113554 (2021)

38. Liu, Y., Feng, Y., Zhang, R.: A high order conservative flux optimization finite element method for steady convection-diffusion equations. J. Comput. Phys. 425(5), 1–42 (2021)

39. Cao, W., Wang, C.: New primal-dual weak Galerkin finite element methods for convection-diffusion problems. Appl. Numer. Math. 162(5), 171–191 (2021)

40. Nasrin, S., Yadollah, O., Farshid, M.: The couple of Hermite-based approach and Crank–Nicolson scheme to approximate the solution of two dimensional stochastic diffusion-wave equation of fractional order. Eng. Anal. Bound. Elem. 118, 285–294 (2020)

41. Thomée, V.: Galerkin Finite Element Method for Parabolic Problems. World, Cleveland (2013)

## Acknowledgements

The authors are very grateful to the editor and anonymous referees for their valuable comments and constructive suggestions, which helped to improve the paper significantly.

## Funding

This work is partly supported by Program for Science Technology Innovation Talents in Universities of Henan Province (No. 22HASTIT021), the Science and Technology Project of Henan Province (No. 212102210394), the National Natural Science Foundation of China (Nos. 11801490, 12001327), and the Graduate Innovation Fund Project of Xinyang Normal University (No. 2021KYJJ48).

## Author information

Authors

### Contributions

LS carried out the program and conceived the paper. FS helped to draft and revise the manuscript. LS and FS supplied significant information about current research to the introduction and conclusion. The final manuscript was read and approved by all authors.

### Corresponding author

Correspondence to Lanyin Sun.

## Ethics declarations

Not applicable.

### Competing interests

The authors declare no competing interests.

## Rights and permissions 