1. Introduction
Nonlinear reaction–diffusion partial differential equations (PDEs) have an important role in modeling different phenomena in many branches of science. We examine Huxley’s equation [
1] in this paper assuming the following format:
where
α and
β are real values that are not negative. We always assume that the initial
u function and the boundary conditions are given, and they will be explained later in this work. If
, then one has the linear diffusion equation, which is more often called the heat equation and used to model Fourier-type heat conduction as well, mostly in solid media. One can observe that Equation (1) resembles Fisher’s equation:
but Equation (1) is more nonlinear than Equation (2) since the nonlinear component is simply quadratic here. On the other hand, a somewhat expanded version of (1), commonly also referred to as the Huxley equation [
2], is
where γ is in the unit interval. In this work, we always take
to recover Equation (1). Equation (2) is also commonly referred to as the FitzHugh–Nagumo equation [
3], but this phrase is also used to refer to more generic equations. For instance, it was shown [
1] that equations like (1) or (3) that contain a cubic response term may be better to use to represent how a new, beneficial recessive gene spreads in a population that reproduces sexually than Equation (2) with a quadratic reaction term. In biological tissues, where the equation explains the passage of electrical impulses along nerve fibers, they are also appropriate [
4] for simulating the propagation of neural pulses.
Several clever methods are proposed to solve these and similar PDEs, such as the shifted Chebyshev spectral collocation method [
5], semi-analytical methods [
6,
7], the homotopy perturbation method [
8], different versions of physics-informed neural networks (PINNs) [
9,
10], the weighted average method [
11], and exact as well as nonstandard finite difference schemes (NSFD) [
12]. Most of these approaches are constructed and tested for specific circumstances where the media are homogeneous, and/or the number of space dimensions is small, and the spatial mesh is uniform and consists of not very many nodes. There are some counterexamples, e.g., when a partially implicit scheme [
13], coarse-grain models [
14], or the asymptotic theory [
15] were used in heterogeneous media, but these can be considered as exceptions. Nevertheless, under the mentioned specific circumstances, the weak points of the proposed algorithms do not always manifest. Moreover, some of these algorithms were developed aiming, most importantly, high accuracy. However, in most applications, there are non-negligible inaccuracies in the input data, and the models themselves contain simplifications that can cause even a few percent deviation from the measurements. Due to these limitations, the main goal should not be to press down the relative errors below, e.g., 10
−8, but to develop methods which are, on the one hand, fast in higher dimensions as well, and, on the other hand, robust, i.e., reliable for all possible parameter combinations.
Most explicit numerical algorithms have a severely constrained stability region [
16]. If the time step size is greater than a certain threshold, often called the Courant–Friedrichs–Lewy (CFL) limit, the solution is predicted to explode even for the linear diffusion or heat equation. The heterogeneity in the physical media implies a space-dependent α coefficient [
17], which results in a high stiffness ratio and a relatively small CFL limit for the explicit approaches. This is especially well-known when one uses the method of lines, where the PDE is first spatially discretized, and an ODE solver, such as a Runge–Kutta (RK) scheme, solves the resulting system of ODEs. This is true for low-order explicit schemes, such as the FTCS (forward-time central space) or semi-explicit [
18] methods, as well as higher order techniques, including the standard fourth-order RK method and Strong-Stability-Preserving Runge–Kutta Methods [
19,
20].
Although step size restrictions may occasionally be necessary, implicit approaches, such as the technique called shifted airfoil collocation, proposed by Anjuman et al. [
21] for nonlinear drift-diffusion–reaction equations, offer superior stability qualities [
22]. The most restricting problem is that implicit methods need the solution of a system of nonlinear algebraic equations, which can take a lot of time and memory if the system is big, which is typical in two or three space dimensions. Despite this, implicit techniques are frequently used to solve these and similar equations [
23], for example, backward implicit and Crank–Nicolson (CrN) schemes with and without linearization [
24]. Rufai et al. proposed a novel hybrid block method for the FitzHugh–Nagumo equation with time-dependent coefficients [
25]. Their method is also implicit, and the Newton method is used to handle the nonlinearity. Furthermore, in the case of high stiffness, the diffusion term is occasionally even considered exactly [
26]. Manaa and Sabawi [
27] solved Equation (3) using the CrN and explicit (Euler) methods. They found that although the explicit technique requires shorter execution times, the CrN method is more accurate and does not have significant stability problems, as was to be predicted. A finite-difference numerical scheme with good qualitative properties was proposed by Macías-Díaz for the Burgers–Huxley equation [
28]. However, his algorithm only has favorable features for short time step sizes below the CFL number since he employed the explicit Euler time discretization for the diffusion factor. This also applies to most NSFD algorithms, which were applied, for example, for the Fisher and Nagumo equations [
3,
29,
30] and for cross-diffusion equations [
31,
32]. Our research group constructs and tests explicit numerical methods possessing excellent stability properties. A couple of these methods have been known for a long time, but they have been used for nonlinear PDEs containing a diffusion term only a few times, much less than they deserve. For example, the Dufort–Frankel scheme was successfully applied for the two-dimensional Sine–Gordon equation [
33]. The nonlinear term is treated by a predictor–corrector-type operator-splitting. Gasparin et al. also applied the Dufort–Frankel scheme to nonlinear moisture transfer in porous materials [
34]. The odd–even hopscotch method was utilized to solve the Frank–Kamenetskii equation by Harley [
35]. These algorithms always showed a good performance; nevertheless, their investigations were usually not continued. Furthermore, in most scientific works, where the performance of numerical methods is tested, the parameters, such as the constants
α, β and the space and time step size
are fixed, and only a small number of numerical methods are compared. Our goal in this work is to extensively investigate the performance of some methods for Huxley’s equation under a large number of parameter combinations, for example, for less-stiff and very stiff systems. Hence, in
Section 2, the spatial discretization of Equation (1) is performed not only for the most basic one-dimensional system with constant α but also for the most general case. In
Section 3, we review four numerical methods that were proven to be very efficient when applied to the diffusion equation. All of these diffusion solvers are explicit and unconditionally stable in the linear case. In
Section 4, we construct numerous ways to handle the nonlinear reaction term, as well as briefly present methods that will be used for comparison purposes. With these, we gain more than 40 different numerical methods to test for Huxley’s equation. In
Section 5, we perform the first round of the numerical experiments, which constitutes five concrete case studies. Based on the comparison of the errors for several time step sizes, we exclude most of the methods from further investigation and keep only 13. In the second round of numerical experiments in
Section 6, three case studies are performed in large two-dimensional systems with running time measurement to choose the top seven most efficient methods. Only these seven methods are used in
Section 7 to examine how their performance depends on some parameters, such as the strength of the nonlinear reaction term and the CFL limit of the system.
Section 8 provides a summary of the findings and suggests methods that should be used under specific circumstances.
We do not know any other work in which so many methods are tested for such a large number of parameter combinations for any nonlinear PDE. The best few among these tested methods are very efficient and reliable, and they have never been applied to Huxley’s equation before. These are the main novelties in our work.
2. The Studied Equation and the Spatial Discretization
We start by discretizing the pure diffusion or heat equation because the reaction term is entirely local. The first step is the simplest and most standard discretization by equidistant nodes
of the space interval
. The second spatial derivatives are subjected to the well-known central difference approximation, leading to the well-known ODE system
for the nodes with index
. The
M matrix, which is tridiagonal in the one-dimensional example, contains only a few of nonzero elements as follows:
The boundary conditions (BCs) specify the first and last row. For example, the first and last nodes’ time development will be provided directly in the case of Dirichlet BCs; thus,
. The matrix form of the ODE system (4) can be reformulated as follows:
where
. Our goal includes performing experiments in general cases where the geometrical and material characteristics of the simulated system are different in different spatial regions. It is necessary to adapt space discretization and subsequent techniques to reflect this generality level. If the media property α is dependent on the space variable while we remain in 1D, the PDE
can be used. We can discretize the parameter α and, simultaneously,
to obtain
The average diffusivity between cell
i and its (left) neighbor may be denoted by α
i,i−1. In practice, it can be approximated by its value between these two nodes. With this, we have
This is a generalized version of Equation (4). We can build a highly adaptable resistance–capacitance model by taking cells into account rather than nodes. The volume of these cells can be expressed as
in the case of a one-dimensional equidistant mesh. A cell’s capacity is equal to its volume in the case of the most basic diffusion:
. Between two cells, the resistance may be calculated simply as
. A generalized ODE system for the time derivative of each cell variable
u in one space dimension can be obtained using these:
It is easy to see that this RC model with Equation (7) is indeed a generalization of the original model based on equidistant nodes, in which Equation (4) expressed the time development of the node variables. Hence, if a numerical method works for the general RC model, it will work for the special case as well. Furthermore, Equation (7) can be expressed in the same matrix form as Equation (6), but with entries that depend on the resistances and capacities.
We will also work in two space dimensions, where the numbering of the cells begins along the
x-directional (horizontal) rows starting from 1 to
and then along the
x-axis again from
to
, and so on. Now, an ODE system (7) can be straightforwardly generalized to two space dimensions as follows:
The last equation is valid since the resistances are infinity for non-adjacent cells. Additional information about the discretization using this resistance–capacitance model can be found, for example, in [
36].
In 2D numerical experiments, we usually take zero-Neumann BCs into account. The RC model will implement these in a straightforward manner: the matrix components that are responsible for conduction across the borders vanish when those resistances are regarded as infinite. In this instance, the conserved quantity is represented by the system matrix M’s zero eigenvalue. All other eigenvalues M are negative due to the Second Law of Thermodynamics. The eigenvalues with the (nonzero) least and highest absolute values, respectively, are indicated by λMIN and λMAX. The standard definition of the problem’s stiffness ratio is SR = λMAX/λMIN. In addition to it, the CFL limit provides an accurate estimate of the maximum time step size that can be used for the semi-discretized linear diffusion problem (4), (7), or (8) using the explicit Euler (first-order explicit RK) scheme. Similar threshold time step sizes can be obtained for higher-order explicit RK schemes, such as for the fourth-order RK schemes: . This CFL threshold and the stiffness ratio will be utilized in this paper to describe how difficult it is to solve the problem. We must emphasize again that the unconditionally stable schemes employed in this work have no time step size restrictions for the linear diffusion problem due to stability considerations.
The simplest uniform discretization
will always be used for the time variable.
3. The Examined Diffusion Solver Methods
We provide essential details regarding the algorithms that solve an equation without the nonlinear term. Since we mostly employ the more general forms in this study, only they are required.
For the 1D equidistant mesh, such as in Equation (1), the standard mesh ratio of
is used in many publications and textbooks. In the case of the general mesh, the following notations are going to be used:
While the second quantity reflects the status and influence of the neighbors of cell i, the first quantity is the generalization of the mesh ratio.
- 1.
The first method is called the CCL algorithm, which is the abbreviation for Constant–Constant–Linear neighbor. It is a one-step but three-stage method recently published by our group [
37], where the constant-neighbor (CNe) formula is applied in the first and second stages. The first stage is a predictor with a
h/3-sized time step:
Then, the first corrector stage comes
Finally, a full time step is taken with the linear-neighbor (LNe) formula in the third stage:
During the calculations, the quantities must be refreshed after each stage:
and , respectively. The CCL method has third-order temporal accuracy, and, similarly to the following three methods, it is proven to be unconditionally stable for the heat equation.
- 2.
The Dufort–Frankel (DF) method is a classic example of the explicit and stable methods [
38] (p. 313), which is second-order in time. We adapted it to the general case, where the following formula must be used:
As can be seen, it is a two-step, one-stage method (the formula includes
). Since it is not self-starting, the calculation
must be performed by another method. We use the so-called UPFD (unconditional finite difference) formula for this purpose:
- 3.
The original odd–even hopscotch (OOEH) method was discovered more than 50 years ago [
39]. It requires a special spatial and temporal structure. In essence, the mesh must be bipartite, i.e., it is divided into two parts, the so-called odd and even nodes (or cells), where the closest neighbor of the even cells is odd, and vice versa. First, the FTCS formula is applied to the odd cells, followed by the BTCS (Backward-time Central-space) formula, which is based on implicit Euler time discretization. After every time step, the odd and even labels are switched, as it is illustrated in
Figure 1. The equations used are as follows:
.
where the new concentration data are used to calculate
in the same manner as
Ai in Equation (12), essentially making the implicit formula explicit.
- 4.
The recently invented leapfrog–hopscotch (LH) approach [
40] also requires the odd–even space structure. Moreover, it has a structure made up of many full time steps and two half time steps. Using the initial values, the calculation begins by taking a half-sized time step for the odd nodes. Full time steps are then taken strictly alternately for the even and odd nodes until the last time step is reached, which should be halved for odd nodes to reach the same final time point as the even nodes, as shown in
Figure 1.
Figure 1.
The structures of original odd–even hopscotch (OOEH), leapfrog–hopscotch (LH), and Dufort–Frankel (DF) methods.
Figure 1.
The structures of original odd–even hopscotch (OOEH), leapfrog–hopscotch (LH), and Dufort–Frankel (DF) methods.
Since the first stage’s time step is halved, the following general formula is applied:
Next, for the even nodes, a full time step is made using
Full time steps, in the same manner, are then taken for the odd and even nodes in turn, where always the most recently obtained values of the neighbors are used to calculate the new
values. Lastly, the computations for the odd nodes must be closed using a half-length time step.
According to most of the numerical experiments in our previous works, the LH method is the most efficient among the explicit methods that are unconditionally stable to the linear diffusion equation.
The favorable properties of these algorithms are formulated in the following theorems, which were proved in the original papers.
Theorem 1. The CCL, OOEH, DF, and LH schemes are unconditionally stable when applied to the spatially discretized linear diffusion equation , which means that the solution is bounded for arbitrary values of α and the time step size.
Theorem 2. The OOEH, DF, and LH schemes have second-order while the CCL method has third-order convergence when applied to the spatially discretized linear diffusion equation
5. First Round of Numerical Experiments: Verification and Selection Based on Errors
The following formula is used to compare the numerical solutions
generated by the solver under examination with the analytical reference solution
at the final time
in order to determine the maximum numerical errors:
The average error is also very similar:
We refer to the third kind of error as the energy error as it has an energy dimension in the context of the heat conduction equation:
As we already mentioned, our goal is to assess the performance of the methods not only for one concrete time step size but for many. Hence, starting from a very large time step size, we calculate the above-defined errors for a series of decreasing time step sizes. This series of time step sizes usually starts from
T/4 and has
S elements, where the next element is obtained by taking half of the previous one. Then, we compute the three kinds of aggregated error,
,
, and
, as the mean of the logarithm of these errors as follows:
Finally, the average of the three different
AgErr errors is determined:
and this
Agerr quantity is used to evaluate the overall accuracy for the small, medium, and large time step sizes for many possible combinations. It should be noted that the method is very accurate when
AgErr is negative and has a big absolute value. In the case of instabilities, the
u values can be too large for MATLAB to handle, and ‘
NaN’ symbols appear instead of numbers. In these cases, the error is substituted by 10
10 as a penalty for unstable behavior. This ensures that the aggregated errors are numbers that can be comparable to other errors.
5.1. Experiment 1: One Space Dimension Using an Exact Solution
In this and the following experiment, PDE (1) with
will be solved on the domain
. The following analytical solution [
1] (p. 34) serves as the reference for validation.
By evaluating this function at the time and space locations that correspond to the initial time and the boundaries , respectively, the initial and Dirichlet boundary conditions are determined.
In Experiment 1,
, and the space step size ∆x = 0.004. The nonlinear coefficient is
, and
c = 19 in Equation (43).
Figure 2,
Figure 3 and
Figure 4 show the maximum errors as a function of time step size for different method combinations. The aggregated errors for different diffusion solvers and treatments of the Huxley term are shown in
Figure 5 and
Table 2. Since the errors go down with the time step size, the methods can be considered verified.
5.2. Experiment 2: One Space Dimension Using an Exact Solution, Larger Final Time
Here, PDE (1) is discretized on the
domain using the space step size ∆x = 0.005,
. The nonlinear coefficient is
and
c = 179 in Equation (43). The aggregated errors for different diffusion solvers and treatments of the Huxley term are shown in
Figure 6 and
Table 3. The maximum errors as a function of time step size for different method combinations are presented in the
Supplementary Materials (see Figures S1–S3).
The main conclusion of the first two experiments is that the operator-splitting treatments yield larger errors than the other (inside, PI, and mixed) treatments, with the exception of OOEH–inside. The NSFD schemes sometimes give very small errors, but they are completely unreliable. Since the systems are not stiff here, the implicit CrN method has no advantage compared to the other methods.
5.3. Experiment 3: Stiff 2D System
Employing the capacity–resistivity model described in
Section 2, we have two space dimensions from this point. Using a log-uniform distribution, we produce random values for the resistances and capacities as follows:
We create highly varied test problems by changing the
a and
b values. The variable
rand is MATLAB-generated random numbers within the unit interval. From this point, the reference solution is provided by the ode15s solver of MATLAB with a very stringent tolerance (10
−11) to ensure accuracy. The used mesh size and final time are
while
and
. These variables give
and
. The initial concentration function is the sum of a smooth function and some random numbers:
Figure 7 and
Figure 8 show the maximum errors as a function of time step size for different method combinations. The maximum errors for different operator-splitting treatments with Strang-splitting are presented in the
Supplementary Materials (Figure S4). The aggregated errors for different diffusion solvers and treatments of the Huxley term are presented in
Figure 9 and
Table 4.
One can see that the DF–inside combination shows the best performance since its convergence rate is the highest. On the other hand, the operator-splitting treatments behave much better than before, especially the t1, t3, and t3-Strang treatments.
5.4. Experiment 4: Non-Stiff System with Strong Nonlinearity
The used mesh size and final time are
while
, and
. These variables give
and
. The random component in the initial concentration function is slightly larger than before:
Figure 10 shows the maximum errors as a function of time step size for different operator-splitting treatments. These errors for different operator-splitting treatments with Strang-splitting and for the remaining methods are presented in the
Supplementary Materials (see Figures S5 and S6). The aggregated errors for different diffusion solvers and treatments of the Huxley term are shown in
Figure 11 and
Table 5. The results show that in this case, the treatment of the nonlinear term is much more important than that of the diffusion term. This is logical since the coefficient
is large, while the problem is easy to solve from the point of view of diffusion. The large value of
has another consequence: the “force” acting on
u towards its maximum value 1 is large. Since the final time is also quite large, the values of
u are getting very close to 1. When this happens, the importance of the diffusion process decreases, which further reinforces the previously mentioned effect and decreases the calculation errors below 10
−10 for short time step sizes. The DF–inside method, which was the most accurate in the previous experiment, is unstable here for almost all time step sizes, and that is why its error is large.
5.5. Experiment 5: Medium Stiffness and Nonlinear Coefficient
The used mesh size and final time are
while
, and
. These variables give
and
. The initial concentration function is:
Figure 12 shows the maximum errors as a function of time step size for different operator-splitting treatments. The maximum errors as a function of time step size for different operator-splitting treatments with Strang-splitting and for the remaining methods are presented in the
Supplementary Materials (see Figures S7 and S8). The aggregated errors for different diffusion solvers and treatments of the Huxley are presented in
Figure 13 and
Table 6.
5.6. The Summary of the Five Experiments
The simple sum of the aggregated errors for different diffusion solvers and treatments of the Huxley term are shown in
Figure 14 and
Table 7. Based on these results, we select the following 15 methods for further examination: LH-t1, LH-t1-Strang, LH-t3-Strang, LH-t8-Strang, LH–inside, LH-mix, DF-PI, DF–mixed, OOEH-PI, OOEH-t8-Strang, CCL-t1, CCL-t1-Strang, CCL-t8-Strang, CrN-t1, and CrN-t1-Strang. We note that since simple operator-splitting is calculated faster than Strang-splitting, we are slightly biased towards the simple splitting to give them a further chance in the next section, where running time will be measured.
8. Discussion and Conclusions
We performed extensive numerical tests to solve Huxley’s equation. The goal was to explore the performance of some algorithms about which unconditional stability is analytically proven for the linear diffusion equation; thus, excellent stability properties for the nonlinear case were expected. For some, but not all, of the methods, these expectations are fulfilled well.
LH-t1-Strang: According to the numerical tests, the LH with the t1 treatment and Strang-splitting is generally the most efficient and reliable among the examined methods. It provides relatively accurate results quite quickly for all the examined sets of parameters, and no signs of instability are detected, even for extremely stiff systems of strong nonlinearity. Hence, non-strict time step size restrictions are necessary only to reach the desired accuracy, but not for stability considerations.
LH-t1: This combination is usually slightly less accurate than LH-t1 with Strang-splitting. It can be recommended when the diffusion part of the problem is much harder to solve than the reaction part, e.g., due to small β or large stiffness.
LH-t3-Strang: This combination can also give very accurate results, and sometimes it is the most efficient. However, in some cases, for example, if the simulated time interval is long, it is not so reliable.
LH-t8-Strang: Usually slightly less accurate and efficient than the LH-t1-Strang and LH-t3-Strang combinations. If, however, the geometry of the physical system is complicated such that the construction of a bipartite mesh is hardly feasible, the hopscotch-type methods are contraindicated.
OOEH-t8-Strang: The original odd–even hopscotch method can be proposed only for an equidistant mesh with a constant diffusion parameter. In these cases, this method is simpler to code than the LH scheme, and its accuracy is roughly the same.
CCL-t1-Strang: This combination is the opposite of the OOEH method from the point of view that it has a relative disadvantage in the case of a physically homogeneous system with an equidistant mesh. It is relatively slow but reliable for stiff problems. It should be used only if the geometry is complicated and the odd–even division of the cells faces difficulties.
DF–mixed: This combination is much faster and may be beneficially used for complicated geometries. Its accuracy strongly fluctuates; thus, it should be combined with an error estimator.
CrN: In the studied cases where the geometry is simple and the mesh is rectangular, the Crank–Nicolson method with operator-splitting has no advantage against the LH method. Its execution time strongly increases with the system size, so we advise using it only when the number of nodes is small. However, in that case, the CrN method without operator-splitting, i.e., with standard Newton iterations, would be more accurate.
RK4: RK4 should be used if extreme accuracy is required; hence, the above-mentioned low-order methods are not favorable.
AB2: The performance of AB2 is quite similar to the RK4 method due to its similar conditional stability. It is a bit less accurate, but it is faster and requires less memory.
In the near future, we plan to compare the performance of our explicit methods with the following:
- (a)
Implicit methods (such as Crank–Nicolson) without operator-splitting;
- (b)
Semi-explicit, semi-implicit, and implicit–explicit schemes;
- (c)
Runge–Kutta–Chebyshev methods, which are explicit but have improved stability.
Our most important goal is, however, to extend these ideas to more complicated nonlinear diffusion–reaction PDEs (such as the FitzHugh–Nagumo equation) and systems of PDEs.