1. Introduction
Many problems in science and engineering are modeled by partial differential equations that are often difficult to solve for an exact solution and, in some cases, impossible. Numerical methods are a good alternative in providing approximate solutions close to the exact solution. As a result, several accurate numerical methods, such as the Crank–Nicolson [
1], finite element [
2], finite volume [
3], spectral [
4], and nonstandard finite difference [
5,
6] methods were developed. Developing better numerical methods continues to stimulate much interest among researchers. Motivated by the continued need for better-performing numerical methods, in this work, we propose a novel hybrid method that is based on combining elements of the unconditionally positive finite difference method (UPFD) and the proper orthogonal decomposition method (POD), called the enhanced unconditionally positive finite difference method (EUPFD).
The UPFD was developed by Chen-Charpentier and Kojouharov [
7] for the advection–diffusion–reaction equation (ADR), and has since been used by several other researchers [
8,
9,
10]. It is a finite difference-based method that guarantees the positivity of solutions independent of time step and mesh size. Numerical schemes that preserve the positivity of solutions are important in physical applications. To have significant meaning, quantities such as chemical species concentration, population sizes, and neutron numbers require positive solutions. On the other hand, the POD is a powerful technique widely used in statistics and image processing [
11,
12] to reduce a large number of interdependent variables to a much smaller number of uncorrelated variables while retaining as much possible of the variation in the original variables. By utilizing the POD, the EUPFD involves the extraction of a set of basis functions from the UPFD solution called the snapshot matrix; then, it uses a small subset of leading basis functions to construct state variable approximations. One of the most persistent challenges faced by several numerical methods when solving PDEs is that they require many grid points and numerous iterations to converge to the exact solution. That significantly affects their efficiency in terms of computational speed and memory requirement. The POD has been used to reduce the dimensions of numerical methods, such as the Crank–Nicolson method [
13,
14,
15,
16,
17,
18]. The POD is useful when it is impossible to perform numerical simulations due to large-scale computing requirements.
The POD modes are updated until the EUPFD satisfies the theoretical accuracy requirements. Luo and Sun [
19] combined the POD with the finite volume, the finite element, and the finite difference methods to solve Navier–Stokes, Sobolev, Burger’s, and hyperbolic equations. In this work, we extend the POD coupling by hybridising it with the UPFD to obtain a novel numerical method that exhibits higher accuracy with less computing time, fewer degrees of freedom in numerical computations, and reduced truncation error, ensuring the positivity of the solutions.
We test the applicability of the EUPFD on the nonlinear ADR equations given below:
where
is the advection coefficient,
D is the diffusion coefficient,
is the rate at which the concentration of substances changes over time,
is the advection term,
is the diffusion term, and
is the reaction term or the source [
20]. The ADR equation governs the process of advection and diffusion simultaneously. It is used to model exponential travelling waves, absorption of pollutants in soil, semiconductors, modelling of biological systems, and diffusion of neutrons [
21,
22,
23,
24]. Among other numerical methods, the UPFD method has been used to solve ADR equations, is stable, accurate, and consistent in rectangular domains, and it guarantees the positivity of the solution that is independent of the step sizes [
25]. The Rosenbrock scheme is another interesting approach that preserves solution accuracy and is mostly used to solve stiff ODEs problems. Al’shin, Al’shina, Kalitkin, and Koryagina [
26] proposed the complex Rosenbrock schemes for the numerical integration of differential algebraic systems by the
-embedding method. The method converges quadratically, and the scheme applies even to superstiff systems. The method enables computations to be performed with guaranteed accuracy. However, as always, numerical methods need to be refined and improved to converge faster to the exact solution.
The rest of the paper is organised as follows. In
Section 2, we present the UPFD method, and illustrate how it is used to solve linear and nonlinear ADR equations. We also provide the stability and consistency analysis of the UPFD scheme. In
Section 3, we formulate the POD basis to optimise the UPFD scheme and this results in the EUPFD method. In
Section 4, numerical results are presented to illustrate the efficiency and effectiveness of the EUPFD method to solve the discussed problems.
Section 5 provides the conclusion of the study.
2. Unconditionally Positive Finite Difference Method
In this section, we present details of the unconditionally positive finite difference method (UPFD), and illustrate how it is utilized to solve linear and nonlinear ADR equations.
The discretization of the linear and nonlinear ADR equation is obtained by using the derivative schemes given below to obtain the UPFD schemes [
7],
where the spatial step size
, and the grid points are given as
,
. Time step size
with the corresponding grid points are given as
,
.
When approximating the first and second space derivatives, the terms in the finite difference schemes are evaluated at different time levels
n and
. This is required to preserve the positivity of the solution. Equation (
2) is used when the coefficient of the first space derivative is negative, while Equation (
3) is used when the derivative is positive. On the other hand, Equation (
5) is used whether the coefficient of the second space derivative is positive or negative.
2.1. Linear Advection–Diffusion–Reaction Equation
In this section, we set
,
, and
in Equation (
1) to obtain the equation given below.
subject to the following initial and boundary conditions:
with the exact solution given by
[
7].
Since the coefficient of
in Equation (
6) is positive, we used Equation (
3) to find the UPFD scheme. Therefore, the UPFD discretization of Equation (
6) is given by
Equation (
8) can be written as
where
and
.
2.1.1. Stability
To obtain the region of stability of the UPFD scheme, we used the Fourier series analysis of the form
on Equation (
9). The amplification factor is then given by
where
is the phase angle,
where
is the wave number, and
is the spatial step size, and
.
By using the
in (
10), where
, the following is obtained.
The UPFD method presented here guarantees the positivity of the solutions independent of the time step and mesh size. The UPFD method works with terms that are the sum of a positive and negative function of the unknown, and one or both may be zero. The scheme is positive definite for all values of , hence, the scheme is unconditionally stable for all .
2.1.2. Consistency
In this section, we investigate the consistency of Equation (
6). We use the Taylor expansion to approximate the
,
,
, thus
The UPFD scheme terms are approximated by using Equation (
12), which are then substituted into Equation (
8) to obtain the truncation error for the UPFD method. After simplification, we obtain the following.
The above scheme is not consistent when
,
; as a result,
to obtain the following equation.
when
,
, Equation (
14) reduces to Equation (
6); hence, the UPFD scheme is consistent when
.
2.2. Nonlinear Advection–Diffusion–Reaction Equation
In this section, we set
, and
in Equation (
1) to obtain the nonlinear reaction diffusion equation given below.
with initial and boundary conditions given by
where
[
7].
With the exact solution given as
where
.
The discretization of the nonlinear ADR Equation (
15) using Equation (
5) is given below.
where
.
2.2.1. Stability
By applying Fourier series analyses of the form
, and freezing coefficient technique [
27] to Equation (
18), we obtain the following amplification factor.
where by the freezing coefficient technique,
is replace by
, and
u is frozen to a constant
, which represents the maximum value of the solution
u.
The scheme is unconditionally stable for all , .
2.2.2. Consistency
Through the consistency of the UPFD scheme [
25] by the Taylor expansion to Equation (
18), we obtain the following.
As
and
, Equation (
20) reduces to Equation (
15); therefore, the scheme is consistent.
3. Formulation of the POD Basis
In this section, we discuss the POD basis that reduces the degree of freedom for numerical methods [
28].
The POD is used to reduce the computational time accumulated in the UPFD method. The EUPFD method is built by extracting a snapshot matrix from the matrix solution of the UPFD method. The snapshot matrix is then used to construct a small subset of leading basis functions, which is an eigenvector generated by singular value decomposition (SVD), to approximate state variables
. The SVD technique is used to decompose a matrix into several component matrices, exposing many of the original matrix’s useful and interesting properties [
29]. The POD method seeks a low-dimensional basis that could be used to approximate the state variables well. POD basis functions are typically the left singular vectors of the matrix.
From the standard UPFD solution, denoted by
, where
,
, we extract the first
L sequence of solutions
, and
as snapshots, yielding the formulated
snapshot matrix shown below.
where
m and
L are the mesh points of the snapshot. When the snapshot is tall and skinny, the method of snapshot is an efficient alternative way to compute the POD basis. The POD modes are computed by using the method of snapshots developed by Sirovich [
30].
The SVD is then used to factorise snapshot matrix
A.
where
l =
,
=
is a diagonal matrix that is generated from the SVD of
A as arranged from the decreasing order
,
is an
orthogonal matrix consisting of the eigenvectors of
, whereas
is an
orthogonal matrix consisting of the orthogonal eigenvectors of
and
O is a zero matrix [
31].
The eigenvalues of
and
are identical and satisfy
. Therefore, we may first find the eigenvalues
for matrices
and corresponding eigenvectors
. That means that the following relationship applies.
Eigenvectors
that correspond to the nonzero eigenvalues for matrix
are obtained. Therefore,
where
represents the diagonal matrix that consists of the first
M positive singular values of diagonal matrix
. The 2-norm of matrix
A is defined as follows:
( where
is the
norm for vector
u).
Theorem 1. Let consist of the first M eigenvectors ; then, we have Proof. Thus, by the relationship between the matrix norm and its spectral radius, we have
where
consist of the first
M eigenvectors
.
If the
L column vectors of
A are denoted by
we have
where
which represents the projection of
onto
is the inner product of
and
, and
denotes the unit vector with the nth component being 1. Inequality (
33) shows that
is an optimal approximation
whose error is no more than
; thus,
is just an orthogonal optimal POD base of A. □
3.1. Formulation of the POD to Reduce the Order of the Finite Difference Scheme for the Advection–Diffusion–Reaction Equations
The EUPFD method is built on the basis of POD. The solution vector of the UPFD method is given by
and have a finite difference scheme, as follows:
where
and
Matrix
B is a tridiagonal matrix with the following eigenvalues:
Taking the norm of matrix
B, we obtain the following.
Replacing
in Equation (
35) with
, which is
, where
, we obtain the EUPFD scheme as follows.
where
are vectors that are yet to be determined.
Using orthogonal vectors in
multiplied by (
39), we obtain
We obtain the
from Equation (
40); then, we obtain the EUPFD solution as follows.
Therefore, the EUPFD solution component of Equation (
6) is given as follows.
3.2. Error Estimates of the EUPFD for the Advection–Diffusion–Reaction Equation
By finding the norm of Equations (
39) and (
40), we obtain the following.
Theorem 2 (Accuracy).
The errors between solutions from the UPFD scheme and solution from the EUPFD scheme satisfy the following estimates: where .The errors between exact solution and solution from the POD-reduced-order FD scheme satisfy the following estimates [31] Proof. Equation (
39) is rewritten as follows.
By putting
, we obtain the following simplified equation of Equation (
45).
□
Remark 1. The error terms containing are caused by the POD-based reduced-order for the classical FD scheme, which could be used to select the number of the POD basis, i.e., it is necessary to take M such that . Whereas are caused by extrapolating iterations that could be used as the guide for renewing the POD basis, i.e., if it is necessary to update the POD basis. If we take that satisfies , then the EUPFD scheme converges; thus, we did not have to update the POD basis [31]. 3.3. Implementation of the EUPFD Scheme Algorithm for Advection–Diffusion–Reaction Equations
In order to facilitate the use of the EUPFD scheme for the linear and nonlinear ADR equation, the following implementation steps of the algorithm for the EUPFD scheme are useful [
31].
Step 1: Standard UPFD computation and extraction of snapshots:
Write the standard UPFD scheme in vector form and find solution vectors at the few L steps.
Step 2: Snapshot matrix A and eigenvalues of : Formulate snapshot matrix and compute eigenvalues Rank and eigenvectors of matrix .
Step 3: Choice of POD basis: For error tolerance , decide the numbers of POD basis, such that , and formulate the POD bases (where ).
Step 4: Solve or compute the EUPFD model:
Solve Equation (
40) and use (
41) to obtain the reduced-order solution vectors of the EUPFD given in a form of
, further obtain the component forms
, where
.
Step 5: Check accuracy and renew POD basis to continue:
Set . If , then is the solution vectors for the EUPFD scheme that satisfy the accuracy requirement. Else, if , put and return to step 2.
4. Numerical Results
This section presents solutions to the linear and nonlinear ADR equations using the UPFD and EUPFD. Exact solutions are also used for comparison purposes. Convergence rates, absolute errors, and computational time were calculated to evaluate the methods’ performance. The numerical and analytical solutions are denoted by
and
, respectively. The error is denoted by
, and its magnitude is measured by the
-norm given by the formula below.
The convergence rate is calculated by using the formula below.
The accuracy of the EUPFD relies on the size of the snapshot,
L. Therefore, finding the best snapshot size such that the accuracy is maximal is paramount. To determine the best snapshot size, we first set
and found the solution. We then produced increments of 1 on
L until there was no significant change in the solution. For this, we set up a tolerance as follows.
where
is the exact solution, and
is the solution at the specific value of
L. The first value of
L that satisfies (
51) is the optimal value of
In this work, we set
to be
.
4.1. Numerical Results for the Linear Advection–Diffusion–Reaction Equation
The convergence rates of the UPFD and the EUPFD with respect to the time and spatial steps are shown in
Table 1 and
Table 2. The convergence rates of UPFD and EUPFD decreased with a decrease in time and spatial step sizes.
Table 3 compares the exact, UPFD, and the EUPFD solutions at
and
, as well as the computational times for the UPFD and EUPFD methods. EUPFD took less computational time to converge to the solution of the linear ADR equation compared to the UPFD.
In
Table 4, we compare the infinity norms of the proposed EUPFD with the Crank–Nicolson method in solving the linear ADR equation. For this example, results show that Crank–Nicolson achieved better accuracy. However, Crank–Nicolson did not preserve the positivity of solutions, which is the main focus of this work.
Figure 1a shows the contribution of each POD basis mode. The first 12 modes contained the predominant information where the EUPFD met the theoretical accuracy requirement. The 12 modes were significant in optimizing the linear ADR equation.
Figure 1b shows the decreasing error when the number of modes increased.
Figure 2a,b and
Figure 3a show the surface plots of the exact, UPFD and EUPFD solutions of linear ADR.
Figure 3b shows the increase in error when the POD modes increased.
Figure 4a,b show the absolute errors between the exact solution and EUPFD solution for the linear ADR against time and space, respectively.
4.2. Numerical Results for the Nonlinear Reaction Diffusion Equation
Table 5 and
Table 6 show the convergence rates of the UPFD and EUPFD for the nonlinear reaction–diffusion equation with respect to time and spatial steps. In these tables, the convergence rate of the UPFD and the EUPFD decreases with the increasing time step, and increases with the increasing spatial step sizes.
Table 7 shows the comparison of the exact, UPFD, and EUPFD solutions obtained at
, and
, and the computational times taken by the UPFD and EUPFD methods. The EUPFD took less computational time to converge to the solution of the nonlinear reaction–diffusion equation than the UPFD did.
In this example, the infinity norms of the EUPFD and Crank–Nicolson errors are shown in
Table 8. Results show that EUPFD was slightly more accurate than Crank–Nicolson.
Figure 5a,b and
Figure 6 shows the surface plots of the exact, UPFD and EUPFD solutions of the nonlinear ADR equation.
Figure 6b shows the increase in CPU time when the number with the increase in POD modes.
Figure 7a shows the contribution of each of the POD basis modes. The first 9 modes contain the predominant information where the EUPFD met the theoretical accuracy requirement. The 9 modes were significant in optimising the nonlinear ADR equation.
Figure 7b and
Figure 8 shows the absolute error between the exact and EUPFD solutions for the nonlinear ADR against time and space, respectively.
5. Conclusions
In this paper, we presented a new method, the enhanced unconditionally positive finite difference (EUPFD) method. The method uses the POD in conjunction with the unconditionally positive finite difference (UPFD) scheme. We used it to investigate the solutions to the linear and nonlinear diffusion reaction equations. The POD’s goal is to find the UPFD’s low-dimensional approximated solution. Results show that the EUPFD gives a good approximation to the solutions of these problems, and this validated its efficiency and effectiveness. Another remarkable result of the EUPFD is the reduced computational time compared to that of the UPFD. Besides the reduction in computational time and solution positivity that the EUPFD guarantees, only a small number of modes containing the predominant information are required to meet the theoretical accuracy. As the POD modes increased, the error of EUPFD measured against the exact solution significantly decreased. The spatial steps were taken to be and , while the time step was and . We had ; thus, we next took 50 snapshots from the UPFD. By performing POD on UPFD, we achieved and for the linear and nonlinear ADR equations, respectively. As long as the first 9 and 12 POD bases were used, the theoretical accuracy requirement could be met. Since the EUPFD only used 9 and 12 POD modes from the selected 50 classical solutions of the UPFD as the snapshot, this would mean that EUPFD saves computational time, reduces degrees of freedom in numerical computations, alleviates truncation error accumulation, and it preserves the positivity of the solution. These render the EUPFD more efficient and effective in solving linear and nonlinear PDEs. However, the accuracy of the EUPFD was less than that of Crank–Nicolson when solving the linear ADR equation.