1. Introduction
Using a B-polynomial basis set, one can solve very complicated 2D partial differential equations which could appear in the fields of physics, engineering, chemistry, and computer science [
1,
2]. The flawless integration and differentiation are the nature of B-polys that aid in the use of symbolic programming languages, such as Mathematica or Maple. Over any closed interval, B-polys are smooth functions that provide the basis to represent an arbitrary function to desirable correctness [
1,
2,
3]. The specific details and properties of the B-polys are provided in our previous works [
1,
2,
3]. Briefly, B-polys of nth degree are defined as
, for
i = 0, 1, 2…
n, where binomial coefficients are given by
. The (
n + 1) B-polys form a complete basis set over the interval [
a,
b].
In the earlier years, various methods were employed to solve linear and nonlinear differential equations, including fractional-order differential equations [
4,
5,
6,
7,
8,
9,
10,
11,
12,
13]. In the articles [
1,
2,
3], the authors have solved various differential equations employing a concoction of operational matrix and B-poly basis set. In the earlier progression, the authors used B-poly technique to calculate solutions of the single-variable differential equations [
1]. In our recently extended task, two-variable dependent Hyperbolic Partial Differential (HPD) equations have been solved using the B-poly bases [
13]. In the year 2011, the B-polys were expressed in terms of Legendre basis that has been used to solve the linear differential equations [
14]. The authors, Bhatti and Hinojosa, have successfully applied similar progression to the linear partial differential equations and highly accurate solutions were reported [
13]. It is observed that the B-poly method provides better accuracy than finite difference method. For example, Kutluay et al. [
15] have presented a finite difference solution to the Burgers’ equation. It is shown that the accuracy of the solution depends on h
2 in the finite difference method, where h is the step size. This requires a very large number of grid points to accurately represent the solution in that region. In reference, Bhatti and Bhatta [
16], a combination of B-poly and fourth order Runge–Kutta method was applied to show that B-poly technique provided a higher order of accuracy (four orders of magnitude better) in the solution of the Burger equation.
In the present work, our goal is to apply an extended version of the technique for solving two variables (
x,
t) NPD equations by means of B-poly basis, operational matrix, and the Galerkin method [
17]. It is well known that the continuous and unitary property of B-poly help to determine semi-analytic and, in some cases, exact solutions in a much quicker way in terms of CPU time [
1]. The newly designed progression has been effectively used for solving two variables NPD equations in closed intervals, such as [
0,
R] and [
0,
T]. A complete basis set of polynomials in two variables (
x,
t) in terms of the product of B-poly sets has been utilized to figure out the solution of the NPDE. Two types of general second-order nonlinear partial differential equations are considered in this paper. These equations are used for modeling real-world physical phenomena in the fields of physics and mathematics. The equations have applications in various fields of science, like fluid dynamics, heat conduction, elasticity, traffic control simulations, and number theory [
16], also see references therein. Further, these equations can be converted into well-known Burgers’ equation if the right-hand side is set equal to zero and proper values of constants are chosen. The importance of these calculations is that sometimes they present exact solutions which can be used to judge algorithms as well as the accuracy of computational techniques [
13,
16]. These equations have nonlinear convective terms and second-order diffusion terms which act opposite to each other. Furthermore, these terms allow to admit distorted wave profile as a solution which is difficult to solve numerically.
The technique is explained step by step and applied to a more general two-dimensional NPDE,
where
could be constant or variables. A desired solution of the NPDE is expressed as a linear combination of B-poly basis set, as follows.
where
is the
i-th expansion unknown coefficient in Equation (2) that is a function of variable
t. In Equation (2), we impose the initial conditions on variables (
x,
t). The
is the
n-th degree B-poly in variable
x from the basis set. Furthermore, the coefficients
could be expressed in terms of the constant coefficients
and the B-polys
in variable
t that could have same or a different set of polynomials over the interval [
0,T], such as,
In Equation (3), the coefficients
could be subjected to initial and boundary conditions if required. We plan to present results by using a complete set of B-polys of the different degree to a few nonlinear partial differential equations. In the following sections, the procedure is applied to solve equations, and the results of the NPD equations are compared with the available 2D exact solutions. An excellent agreement has been found between the exact and estimated solutions. In the previous work, following the notation in [
1,
2,
3,
13], the work has been protracted to include complete B-poly bases sets that were involved to approximate results of a variety of differential equations [
13,
16].
The current technique is applied by substituting the approximate solution, Equation (2), into the NPDE (1) to separate out inner products in variables
and
. Both sides of the equations are multiplied by a product of B-polys,
, and integration over the closed intervals is carried out. The inner products of B-polys are multiplied to form an operational matrix with a nonzero determinant. Finally, the inverse of the operational matrix is carried out to determine the unknown coefficients of the linear combination. The coveted solution of the NPDE is assembled with the initial condition imposed on the operational matrix equation. In the following sections, we shall explain the process of how to find an appropriate solution, present plots of the solutions, and calculate semi analytic solutions for each of the four examples considered in this paper. Comparisons between exact and approximate solutions will be made in
Section 2 and, finally, error analysis of the final example will be presented in
Section 3.
2. Computations of Solutions of NPD Equations
As mentioned in the previous section, details of the B-polys will be left out to avoid duplication of the formulas. Furthermore, details on how to generate sets of B-poly basis and construct a solution from the sets are provided [
1,
2,
13]. To make things simpler, once the degree of B-poly basis set is chosen, we may neglect subscript
n representing the degree in B-polys
. The current technique to estimate solution,
, of the two-dimensional differential Equation (1) is outlined in this section. The solution is considered as a combination of the variables,
. The NPDE is solved by imposing an initial condition on Equation (3), employing the Galerkin method [
17], and taking the inverse of the operational matrix for calculating the unknown variables,
[
1,
13]. The approximate solution with the initial condition
is given by [
13],
Implementing this presumed solution, Equation (4), into a nonlinear partial differential Equation (1), we may transform NPDE into an operational matrix by calculating the inner products of B-poly in both variables
x and
t. The initial condition at
t = 0,
f(
x) =
y(
x,0) is added to the solution given in Equation (4). The solution is substituted into the differential Equation to convert it into operational matrix
X which is inverted to find the solution [
16]. Before we find its inverse to be applied for determining unknown coefficients, boundary/initial conditions are applied to the operational matrix and the right-hand side matrix in the interval [
a,
b]. This is done by deleting the first row and the first column of the operational matrix and the corresponding entry of the column matrix to ensure solution vanishes at the origin. Below, we have provided four examples of the NPD equations which are solved using the proposed technique and the initial condition
at
. Putting Equation (4) into the second order NPD Equation (1), we have equation,
where dot (·) and prime (′) denote derivatives with respect to
t and
x, respectively. The Equation (5) can be further simplified by moving some of the terms that do not depend on unknown coefficients
to the right-hand side of the equation,
The expansion of
coefficients can be used to convert Equation (6) in terms of constants,
. After multiplying both sides of the Equation (6) with the product of B-polys
on both sides and integrating with respect to
t and
x over the intervals
and
, the Equation (6) is transformed into Equation (7),
The terms
are factors that exhibit the nonlinear terms due to the appearance of the coefficients
in front of them. Using the initial condition and including the nonlinear terms, we can carry out calculations of the coefficients
. The converged coefficients are determined after a few iterations of the nonlinear terms in the above Equation (7). Sometimes, the initial guess to the nonlinear terms may be given zero in the first iteration. We also employ the Galerkin method [
17] to minimize the error in the solution of the nonlinear partial differential equations. In this method, the coefficients in Equation (4) are minimized by increasing or decreasing a certain degree and number of polynomials in the process.
We may consider another type of general nonlinear PDE of the form in which nonlinear term appears at a different place in the equation,
Notice that now the nonlinear term appears in the third term as opposed to the second term in Equation (1). Using similar steps as described above, we can change the above Equation (8) into an operational matrix,
where,
are the nonlinear terms which exhibit nonlinearity via the coefficients
. The results of the Equation (9) are further updated at each iteration when it is subjected to the initial condition and initial guess for the nonlinear term. The error in the solution of NPDE is minimized using the Galerkin method [
17]. The current technique is applied to four nonlinear differential examples. It is demonstrated that the technique is suitable to find an accurate solution to NPDE.
Example 1. Consider a NPDE which is obtained presuming parameters in the general Equation (8). The NPDE in two dimensions is given, The exact solution of the Equation (10) is
. For evaluating numerical solution using initial condition
in intervals
and
, an approximate solution to Equation (10) may be assumed as
After substituting this expansion into Equation (10), we get a similar equation as Equation (9) which restructures to the following equation,
where,
are the nonlinear terms which exhibit nonlinearity via the unknown coefficients
. This algorithm leads to an
by
system of equations
, in unknown variables
B =
, which are elements of matrix
B. The matrices
in terms of inner products of B-polys are provided below,
The nonlinear partial differential Equation (12) has been converted into an operational matrix form
X given in Equation (12), whose inverse is multiplied by the column matrix W to yield values of the unknown coefficients
by solving the equation
Before constructing the operational matrix equation,
, initial conditions are imposed by deleting rows and the corresponding columns of the Equation (12), so that the solution vanishes at
t = 0 and
x = 0. The resulting approximate solution is gathered from the B-poly basis set via Equations (3) and (4). After two iterations the converged values of the coefficients
were attained, {0, −1, 0, -1}. With the application of this technique, the solution of Equation (10) is obtained, which is given for intervals
and
x ,
As you may note, the above result is very accurate. To solve the NPD Equation (10), the B-polys of degree n=1 have been utilized in both variables
x and
t. The B-poly basis sets used are {1 −
t,
t} and {1 −
x,
x} which gave a 4 × 4 operational matrix by multiplying both sets. We have presented 3D plots of the exact and estimated results of Equation (13) for comparison, see
Figure 1, which shows exact agreement between both solutions at the level of machine precision. Note that when
is replaced in the Equation (13), the error can be seen of the order
representing the high quality of the resolution in one-dimension
x. The solution is essentially zero when
t =
x is replaced. In this example, the absolute error between the solutions is negligible, showing that both solutions are in perfect agreement.
Example 2. Another case of the NPDE with a distinct nonlinear term is considered. We replacein the general NPD Equation (1). This equation has a nonlinear term associated with the first term as opposed to the nonlinearity term associated with the second term of the first example. We want to show that the current technique can handle nonlinearity terms associated to any term in the NPDE. The second example adds another level of difficulty to be considered with nonhomogeneous terms on the right-hand side of Equation (14). The NPDE in two dimensions is given by, We are searching for a solution of Equation (14) in the intervals
and
with initial condition
y (
x, 0) =
at
t = 0. The exact solution to Equation (14) is known,
. An approximate solution to Equation (14) may be assumed to be
In the assumed solution
, the coefficient
is the
i-th coefficient in the expansion which depends on
t. By replacing the assumed solution into Equation (14) and multiplying both sides of Equation (14) with the product of B-polys
, we can separately perform integration over both variables
t and
x in the intervals
and
, respectively. Applying an additional approximation to the coefficients
, the Equation (3) and with substitution of the term
we attain Equation (15) given below:
where,
are the nonlinear terms linked via the unknown coefficients
. The Equation (15) leads to an
by
system of equations
, in the unknown variables
, elements of matrix
B, where the matrices
are given,
The operational matrix
X is provided in Equation (16), whose inversion yields values of unknown coefficients
through solving the equation
. Before the inverse of matrix
X is called for, initial conditions are imposed by deleting the appropriate rows and columns (deleted first row and first column so that the desired solutions vanish at the origin) of the matrices
X and
W to make the solution vanish at
t = 0 and
x = 0. Using a variational property with respect to the coefficients and carrying out several iterations of the nonlinear terms the converged solution of the Equation (14) is given,
The values of the coefficients are listed as
which are needed to construct the numerical solution via Equation (3). The B-poly basis sets used are {1 −
t,
t} and {1 −
x,
x} in both variables (
x,
t), respectively. The expected solution, in the closed intervals, e.g.,
, has the accuracy of the order of
. Again, only
n = 1-degree B-polys were required for solving the differential Equation (16) in both variables (
x,
t).
Figure 2 shows the level of agreement between both solutions at the machine precision. Note that when
is replaced in the Equation (17), the error can be seen to be zero, providing the high quality of the resolution in one-dimension
x as well as in 3D.
Example 3. Next, we consider a more complex second-order NPD equation with a distinct nonlinear term. By replacing parameters in the general NPD Equation (1), the NPD equation becomes, Again, we are searching for the solution in the intervals
and
. Here we are going to use a slightly different initial condition,
y (1,
t) =
f (
t) =
. The desired solution for Equation (18) can be assumed,
The unknown coefficient
is the
i-th coefficient as a function of variable
t in the evolution of expression,
. By inserting this approximate solution into Equation (18) and multiplying both sides of Equation (18) with the product of B-polys
, we perform integration separately over both variables x and t in the intervals
and
, respectively. Additional approximation to the coefficients
was also used to obtain the following equation,
where,
are the nonlinear terms which exhibit nonlinearity via the unknown coefficients
. This algorithm leads to an
by
order of matrix equation
, where unknown coefficients are
that represent elements of matrix
B, and the matrices
are given,
The NPDE is transformed into an operational matrix equation
, where the inversion of the matrix
X yields values of the unknown coefficients
in Equation (19) by solving equation
. The approximate result is constructed from the product of the B-poly basis set
and the coefficients
. The converged values of the coefficients for this example are,
. The initial condition is imposed on the matrices X and W defined in Equation (20) by deleting the first row and the corresponding first column because the solution must be zero at
t = 0 and
x = 0. This approach delivered a valid solution of the Equation (18) and the estimated result is provided,
The numerical result in Equation (21) is compared with the exact solution
Obviously, the approximate solution has high precision in the closed intervals
and
that matched the exact solution when contributions of the small terms of the order
were discounted. This kind of accuracy shown in Equation (21) was achieved with
n = 2-degree B-polys in both variables (
x,
t) which gave a 9 × 9 dimension operational matrix. To obtain such a high degree accuracy of the solution, we used three B-polynomials in
x-variable
and a set of three B-polynomials in
t-variable
To observe the accuracy level of the solution in only one variable
x, we replaced
t =
x in the approximate solution (
fx) and the exact solution (sol) of Equation (18), we essentially found overlays of graphs shown on the left-hand side of
Figure 3. We have also shown 3D graphs of both the exact and the estimated solutions on the right-hand side of
Figure 3. It is observed that there is no appreciable difference between the graphs of both solutions as the error is very small and hence indicating the technique works for calculating the solution of the NPDE.
Example 4. We shall now consider fourth example of the NPDE bysubstituting parametersinto the general NPD Equation (1). So, the NPDE that we want to solve looks, The exact solution of Equation (22) is well known,
We are seeking a solution in the closed intervals
and
by applying initial condition at
t = 0,
,
. As we have done in the previous examples, we would substitute the presumed solution Equation (4), into the NPD Equation (22) in order to convert it into matrix form. The projected solution to Equation (22) can be noted as
where in this expansion
is the
i-th coefficient which depends on variable
t. Putting this approximate solution into Equation (22) and multiplying both sides of Equation (22) with the product of B-polys
, we can perform integration separately over both variables
t and
x in the intervals
and
, respectively. Additional approximation to the coefficients
can also be applied to obtain the following equation,
where,
are the nonlinear terms that exhibit nonlinearity via the unknown coefficients
. This process leads to an
by
order of equation
, in terms of the unknown variables
where the operational matrix
and the column matrix
are,
It is tricky to choose the number of B-polys in both variable
x and
t for this example because the same degree set of B-polys can’t be chosen in both variable
x and
t. We decided to choose
n = 1 degree of B-polys in
x-variable and
n = 13-degree of B-polys in
t-variable. This choice gave us a total of 28 B-polys basis set because
n starts from 0. So, a large set of B-polys were used to calculate the solution of Equation (22). The composition of the exact solution shows that there is 1-degree of polynomials present in
x, {1 −
x,
x} and a series of the polynomials present in variable
t. This is the reason we chose the approximate solution in this manner so that we minimize the error in the solution. The result converged after 15 iterations to the desired accuracy. Converged values of the 28 coefficients of the expansion for this example are also provided,
, which are the elements of matrix
B needed to build the desired solution via Equation (24). Again, the accuracy and the quality of the results depend on the number of B-polys and the degree of polynomials used in the expansion of Equation (24). On the left side of
Figure 4, when
t =
x is substituted in both exact and the approximate solutions, we plotted a graph for comparison in linear dimension
x. The graph shows the absolute error is of the order of
between the solutions. As the number of B-poly increases from second degree through 13-degree polynomials in variable
t, the error between results (exact and approximate) was further decreased. This trend will be presented in the error analysis section. On the right-hand side of
Figure 4, we also present a 3D plot of both solutions, which exhibits the accuracy of results in both variables
x and
t. The converged approximate solution of Example-4 is,
Graphs as well as excellent results of all examples indicate that the current technique works for solving a variety of linear [
4] and nonlinear partial differential equations. We also present one B-polynomial used in
x-variable, {
x}, and 14 B-polynomials used in
t-variable to obtain the results in Equation (25),