1. Introduction
In this work, we study Huxley’s equation [
1] in the following form
where α and β are non-negative real numbers. The initial and boundary conditions will be described later in this paper. A slightly generalized form of (1), which is often called the Huxley equation [
2], is
where
, and we always take
in this paper. Equation (2) is sometimes called the FitzHugh–Nagumo equation [
3], but more general equations also appear under that name. These equations are members of the important family of nonlinear diffusion-reaction partial differential equations (PDEs) used to model various phenomena in biology and physics. For example, it was demonstrated [
1] that equations with a cubic reaction term, such as (1) or (2), are useful to describe the propagation of a new, useful recessive gene in a population which reproduces itself sexually. They are also suitable [
4] to model nerve pulse propagation in biological tissues, where the equation describes the transmission of electrical signals along nerve fibers. We note that Equation (1) is similar to Fisher’s equation
where the nonlinear term is only quadratic, and thus it is nonlinear to a lesser degree than Huxley’s equation.
It is well known that the correct solution of the diffusion or heat equation always adheres to the minimum and maximum principles, which reflect the second law of thermodynamics. The minimum principle guarantees that the equation does not produce negative values if the initial and boundary values are non-negative, which is called the positivity-preserving property. When there is a reaction or other source term in the equation, these criteria are not always applicable. However, the reaction term in Equation (1) has the special property that its limit value is zero both in the and the cases. Therefore, a similar principle, which will be called dynamical consistency, is valid: if the initial and boundary values of the u variable are in the unit interval, then u remains in this interval for any non-negative values of the parameter β. We note that this property holds for Equation (2) for , but the dynamics of the time development strongly depend on the value of γ. For example, if γ is 0, then is the only stable steady state while is an unstable steady state. On the other hand, if , then the cases are the other way around.
Unfortunately, the plausible requirement that the applied numerical schemes should preserve this quality of the solution is rarely guaranteed, with a very few exceptions, such as a few exact or nonstandard finite difference (NSFD) schemes [
5]. Due to the discretization, the solutions produced by standard finite difference methods can contain meaningless (negative or two large) values, causing oscillations and even numerical instabilities. The widespread explicit methods have a severely limited stability region [
6], even for the pure diffusion- or heat equation: the solution is expected to blow up if the time-step size exceeds the so-called CFL (Courant–Friedrichs–Lewy) limit. In the case of a heterogeneous media, one has a space-dependent α coefficient [
7], and thus the CFL limit for the explicit methods is rather small, and the stiffness ratio is high. The problem of restricted stability persists in the case of the most frequent explicit methods, which work via the method of lines: the PDE is first spatially discretized, and then the obtained system of ordinary differential equations (ODEs) is solved by a well-established ODE solver. If this solver is the forward Euler method, then one has the FTCS (forward time central space) scheme, the stability limit of which will be used in this work to characterize the difficulty level of the problem. Higher-order methods, such as the strong stability-preserving Runge–Kutta (RK) methods [
8,
9], also suffer from stability issues.
Implicit methods, such as the so-called shifted airfoil collocation method applied by Anjuman et al. [
10] for nonlinear drift-diffusion-reaction equations, have better stability properties, although sometimes step-size limitations can be required [
11]. However, they demand the solution of a nonlinear algebraic equation system, which can be time- and memory-consuming if the size of the equation system is large. In spite of this, diffusion-reaction equations are often solved by implicit methods. Moreover, the diffusion term is sometimes even treated exactly [
12] in the case of a stiff problem.
El-Danaf et al. solved the time-fractional Huxley equation by the variational iteration and the Adomian decomposition methods [
13]. A semi-analytical reduced differential transform method (RDTM) [
14] was utilized by Patel and Dhodiya. Bai et al. employed a physics-informed neural network (PINN) and an improved PINN, called IPINN [
15]. They observed that the latter one more accurately reproduces the different dynamic behaviors of the equation. However, this new method still has a limitation that, with the increase in the order and the increase in the nonlinear term of the PDEs, it cannot obtain the proper numerical solution of the PDEs. Manaa and Sabawi [
16] used the explicit (Euler) and the Crank–Nicolson (CN) methods to solve Equation (2). They observed that the explicit method is faster, but as expected, the CN scheme is more accurate and does not suffer from serious stability issues. Dynamically consistent or at least unconditionally positive methods to solve these or similar equations are investigated by a few scholars [
17,
18,
19]. Macías-Díaz constructed a finite-difference numerical scheme for the Burgers–Huxley equation with dynamical consistency [
20]. However, he used the explicit Euler time-discretization for the diffusion term, and thus his method possesses good properties only for small time-step sizes below the CFL number. The same is true for the positivity-preserving scheme proposed by Chertock and Kurganov [
21] for advection-diffusion-reaction equation-system modeling chemotaxis/haptotaxis problems, the nonstandard finite difference schemes (NSFDs) of the group of Appadu [
3,
22,
23] for the Fisher and Nagumo equations, and that of Songolo [
24] and Chapwanya et al. [
25] for cross-diffusion equations.
Our goal in this work is to investigate numerical schemes which are unconditionally stable and dynamically consistent. A similar study, but with a smaller number of methods, has been carried over in our recent work [
26] for Fisher’s equation. We also constructed efficient methods for Huxley’s equation [
27], but none of them had the property of dynamical consistency. For us, the word unconditional always means that the desirable properties hold for arbitrary non-negative coefficients α and β, arbitrary positive time-step sizes, and arbitrary mesh for space discretization. Therefore, in
Section 2, the spatial discretization of Equation (1) is considered not only in the simplest, one-dimensional case, but in a very general case as well. Since operator-splitting is applied, first the treatment of the diffusion term and then the nonlinear reaction term is discussed. In
Section 3, we first briefly recall 13 numerical algorithms which, when applied to the pure diffusion equation, follow the maximum and minimum principle. Then, in
Section 4, five different treatments of the reaction term are constructed, and the dynamical consistency property, valid for all of the
algorithm combinations, is analytically proved. In
Section 5, we perform the verification using an analytical reference solution. Based on this, we immediately exclude one of the five treatments of the Huxley term from further examination. After this, via the Strang-splitting technique, we construct further versions of the methods, and we test the obtained algorithm combinations. The results of these tests help us to select the 28 combinations which we think are worth testing further. In
Section 6, the performance of these 28 combinations with running-time measurements is carried out for two different two-dimensional systems to select the top nine methods. The last three further numerical case studies in
Section 7 use only these nine combinations. There are two parameter sweeps for the nonlinear coefficient β (with a stiff and a non-stiff system) and one sweep for the stiffness ratio. The final conclusions and recommendations are summarized in
Section 8.
2. The Spatial Discretization of the Diffusion Equation Using Uniform and Non-Uniform Meshes
In this section, the pure diffusion equation is discretized. First, the simple equidistant discretization
of the interval
is constructed. The well-known central difference approximation is applied to the second spatial derivatives leading to the ODE system
for the nodes
. A matrix denoted by
M is defined as containing a lot of zeros and the following nonzero elements:
In the one-dimensional case,
M is tridiagonal. The first and the last rows depend on the boundary conditions (BCs). For example, the time development of the first and the last nodes will be determined by the analytical solution in
Section 5 in the case of Dirichlet BCs. Thus, the appropriate elements of
M can be set to zero since they will not be used. The ODE system (4) may be rephrased in the following matrix form:
where
. We are going to deal with more general problems where the material and geometrical properties of the studied system have a space dependence. The space discretization, and later, the methods should be extended to reflect this level of generality. If α (which is a property of the media) depends on the space variable, but we are still in 1D, the PDE
can be used. In this equation, it is possible to simultaneously discretize the function α and
, which gives
The average diffusivity between cell
i and its (left) neighbor may be denoted by
, which, in practice, can be approximated by its value between these two nodes. With this, we have
which is a generalized form of Equation (2). Our goal is to introduce a very flexible resistance–capacitance model by considering cells instead of nodes. These cells have finite volumes, which can be given as
in the one-dimensional equidistant case. We have to interject that our methods are not finite volume methods (FVMs), but they are much closer to the finite difference methods. In the case of the simplest diffusion, the capacity of each cell equals its volume:
. The resistance between two cells can be given simply as
. Using these, one can obtain the ODE system for the time derivative of each cell variable
u in one spatial dimension:
Equation (7) can be written in the same matrix form as (6), where the non-diagonal elements have the form and , while the diagonal elements are the negative sum of the non-diagonal ones: .
We will also work in two spatial dimensions, where the numbering of the cells begins along the
x-directional (horizontal) rows running from 1 to
, then along the
x axis again from
to
, and so on. The ODE system (7) can now be straightforwardly generalized to the case with two spatial dimensions:
One can find further details on the discretization via this resistance–capacitance model, e.g., in [
28,
29].
When performing numerical experiments in 2D, we always consider zero Neumann BCs. These will be implemented in the RC model very simply: the appropriate resistances are considered to be infinity, which means that the matrix elements responsible for conduction across the boundaries vanish. In this case, the system matrix M has a zero eigenvalue corresponding to the conserved quantity. All other eigenvalues are negative, which is true without exception for the case of zero Dirichlet BCs. Let us denote by λMIN and λMAX the eigenvalues with the (nonzero) smallest and largest absolute values, respectively. The stiffness ratio of the problem is usually defined as SR = λMAX/λMIN. On the other hand, the CFL limit accurately gives the maximum time-step size that the explicit Euler (first-order explicit RK) scheme can employ for the pure (linear) diffusion problem (4), (7), or (8). From stability polynomial analysis, one can obtain similar time-step size thresholds for higher-order explicit RK methods. For example, for the second-, third-, and fourth-order RK schemes, one has , , and , respectively. If the user exceeds these limits, the solutions blow up due to the instability. The two numbers SR and characterize the degree of difficulty of the linear part of the problem. We have to stress once more that the unconditionally stable methods used in this work have no CFL limits, as we will see soon.
3. The 13 Examined Methods for the Diffusion Equation with the Convex-Combination Property
The numerical algorithms for the linear diffusion equation are briefly described here, and the treatments of the Huxley term will be presented in the next section. The time variable is always discretized uniformly using the following notations:
In the special case of an equidistant one-dimensional mesh with constant diffusivity α, the mesh ratio is usually defined as
. Since the general case of space-dependent α and non-uniform mesh contains this special case, only the generalized formula of the numerical algorithms is presented. Let us define the quantity
which is the generalization of the mesh ratio
r, since, in the 1D special case,
. We also introduce a quantity to collect the effect of the neighbors of the cell with index
i as follows:
In the special 1D case, . Using these relations, one can easily obtain the formulas applicable in the 1D special case from their generalized variants. The application of the methods is very similar to that of the standard explicit Euler or RK methods, with only the formulas used being different. For the two exceptions, we will display a flowchart to make understanding easier.
1. The simplest method we use is called the unconditionally positive finite difference (UPFD) scheme. This was introduced by Chen-Charpentier and Kojouharov [
17] for the linear diffusion-advection-reaction equation discretized by an equidistant mesh. We do not have the advection term, and we adapt the formula to our general Equations (7) and (8) as follows:
2. In the case of the CNe, or constant neighbor method [
30], the positive
quantities containing the time-step size are in the exponent with a negative sign:
This ensures the outstanding stability properties of the methods built on this CNe formula.
In this work, we test two different odd–even hopscotch-type algorithms. To do this, we need a special checkerboard-like characterization of the cells, where the neighbors of the cells with the label ‘odd’ are labeled as ‘even’ and vice versa. The time-marching for the u values goes alternately for the set of the odd and the even cells. When one set is calculated, the latest values of the neighbors belonging to the other set are always used in the formula for . We note that only one function evaluation is required per cell per time step, so these solvers are quite fast.
3. OOEH-CNe method: The original odd–even hopscotch time-space structure is applied, as one can see in the flowchart in
Figure 1. It means that the odd values are refreshed first, and then the even values. However, after each time step, the odd–even labels are interchanged. The length of the time steps is always the full
h, and the CNe formula (11) is employed in each stage.
4. The LH-CNe algorithm: The leapfrog–hopscotch (LH) structure contains time steps with length not only with integer h, but with h/2. The solution begins with a half time step for, e.g., the odd cells, after which full-length time steps are allowed for the set of the even and the odd cells, strictly alternately. This goes until we reach the last time step, which must have the length of h/2 for the set of the odd cells again to precisely reach the final time . The LH-CNe method investigated in this paper always employs the CNe formula (11) with the appropriate full or half time-step size.
5. The CpC method [
29] first calculates new predictor
u values applying the CNe formula (11), but with a halved time step:
These predictor values are used to obtain the new
quantities. Then the second, corrector stage constitutes a full time step with (11) again:
6. The LNe (or sometimes LNe2, meaning two-stage linear-neighbor) algorithm is a predictor–corrector method [
30], too. The first stage uses the above given CNe formula with full time-step size, and it gives the new
predictor values. Using these, one can use Equation (13) and then calculate the corrector values:
7-8-9. The corrector values given by Equation (15) are used to calculate
with (13) again, and thus one repeats (15) to obtain refined
u values. This increases the total number of stages in one time step to three, and hence, the seventh algorithm is called LNe3 [
30]. This iteration can be continued to obtain the LNe4 (LNe5) method, which has four (five) stages altogether. These are obtained by repeating (13) and (15). These iterations, although they yield slightly larger accuracy, unfortunately do not improve the order.
10. The three-stage constant-linear-quadratic neighbor (CLQ) method [
31] is a bit more complicated than the previous ones, since it also employs the quadratic-neighbor approximation. Its first two stages are similar to those of the LNe algorithm:
is calculated at the beginning of the first stage, and then one full-size time step with (10) is performed. After using (12), the LNe stage (15) comes with a full as well as a half-length time step, to obtain the sets
and
, respectively. Using these, one can repeat Equation (13) to calculate
and
, both without dividing
h by 2 in (13). Two new quantities,
and
, must then be calculated. The new
u values are given by
11-12-13. We can add one more stage by using the values in (16). In this case, besides (16) at the third stage, the midpoint values must also be calculated by a similar formula:
Using these, one can calculate
and
values by (12) at the fourth stage, with which one repeats the calculations of the third stage, including those of
S and
W. With these, one has four stages altogether, which constitute the CLQ2 algorithm. One can further repeat this iteration by re-calculating
and
, then applying (16) and (17) again, etc. If one has three or four quadratic stages (five or six stages altogether), we call the obtained methods CLQ3 and CLQ4, respectively [
31].
Properties of the methods when solving the space-discretized diffusion equation: The orders of temporal accuracy are the following: one for the UPFD and the CNe, two for the OOEH-CNe, LH-CNe, CpC, and LNe-LNe5, three for the CLQ, and four for the CLQ2-4. All of these algorithms are unconditionally stable when applied to the linear diffusion equation; therefore, the previously mentioned CFL limit cannot confine their stability. This outstanding stability comes from the following property.
Theorem 1. If methods 1–13 solve the spatially discretized linear diffusion Equation (4), then the new values are the convex combinations of the initial values . The statement is true in the case of the general Equation (7) or (8), when the 1–9 methods are applied.
These statements have been analytically proved in the original papers. According to all of the numerical tests, the convex combination property holds when the CLQ-CLQ4 algorithms solve the generalized Equations (7) and (8), but we have not been able to prove this analytically. Furthermore, the truncation errors of the methods for the linear diffusion equation are calculated in our previous paper [
32].
4. The Operator-Splitting Treatments of the Nonlinear Term
During a time step, we independently take into account the effect of the linear diffusion term and the nonlinear Huxley term. The diffusion term is treated by the 13 methods listed in the previous subsection. After fully considering the diffusion term by those schemes, we obtain a concentration value
, which we temporarily denote as
p for brevity. The reaction term is local and can be written into the form
. A very efficient way to take into account this nonlinear term is to solve the initial value problem
analytically, as in [
26]. However, we were not able to solve this, even with the help of Maple 18 software. Hence, we choose an approach which starts with a selective replacement of
u by the
p values in all twelve possible ways:
Three of these ways, namely,
,
, and
, can be considered as a kind of linearization, while the last one without
u is the equivalent to the explicit Euler treatment. After inserting each of the expressions (19) into the right-hand side of (18), we try to solve the obtained initial value problems, for example,
again analytically. If the solution is found, we first check whether the obtained analytical solutions guarantee dynamical consistency by plotting it as a function of
p and
. We observed that there are two cases when there is no analytical solution, six cases (including the linearization
) where the solution exists but it can be larger than one, and four cases when the solution is in the unit interval. These latter four cases will be used to treat the nonlinear term, and they are listed in the following
Table 1.
Table 1.
Four treatments of the nonlinear term.
We have an extra treatment, where the effect of the Huxley term is calculated using an approach which we call the “pseudo-implicit” trick [
31]. In this case, we replace
u on the right-hand side of (17) with not only the
values but also the new, unknown value
with the goal of eliminating the negative terms from the right-hand side of this formula. In this way, we obtain
This can be simply rearranged to take on a completely explicit form:
This will be the fifth treatment of the Huxley term, denoted by PI. Using the short, temporary notations, it has the form
Lemma 1. If , then
holds for the following five different functions
for arbitrary . Furthermore, if , then , and u is monotonously increasing with increasing b. Proof. We clearly have , , and , which will be used below, when the five functions are individually examined, as follows.
1. The term
is non-negative, and thus the denominator
cannot be smaller than
p; hence,
. On the other hand, the denominator is majorated by unity:
Therefore, the denominator cannot be larger than one, and thus .
2. Since , the same argument as in point 1 can be repeated for this denominator as well.
3. Both and the tanh function are majorated by one, and thus also their product; hence, . Moreover, the tanh is a monotonously increasing function, and thus , which implies .
4. Since
is non-negative,
. On the other hand,
and thus, we obtain
.
5. The denominator
cannot be greater than the numerator
, and thus
. Additionally,
The last statements of the lemma can be immediately obtained by the substitution. □
Simple operator-splitting means that a time step starts with the treatment of the diffusion by any of the algorithms displayed in
Section 3, and after that, the treatment of the nonlinear term following one of the five ways above is conducted as a substitutional step. On the other hand, Strang-splitting means that one of the operations (20)–(25) is performed once before and a second time after the calculation of the effect of diffusion, both with halved time-step sizes. This means that the substitution
must be performed in (20) –(25). Note that in the case of Strang-splitting, the first and the second formulas for the nonlinear term are not necessarily the same; i.e., the treatments (20)–(25) can be hybridized. For example, it is possible to perform (20) with a halved
h before and (22) after any of the methods 1–13 for the diffusion term.
Theorem 2. (The methods’ dynamical consistency) Suppose one applies Methods 1–13 combined with treatments (20)–(25) with or without Strang-splitting to Huxley’s Equation (1). If the initial and boundary values of the concentration are in the unit interval , then the calculated concentration values will also be in this interval, i.e., for any values of the coefficients α > 0, β > 0 and time-step size h > 0. Furthermore, increasing β can yield only the increase, and never the decrease, of the concentration values.
Proof of Theorem 2. Due to the operator-splitting strategy, the procedure of the numerical solution consists of performing steps which treat the diffusion term and the nonlinear term subsequently. Theorem 1 and Lemma 1 imply that none of these steps can yield any concentration value outside of the unit interval, which immediately gives the first statement.
The last statement of Lemma 1 means that increasing β can yield only the increase in the concentration values calculated by any of the nonlinear steps given in
Table 1. The convex combination property in Theorem 1 means that the steps which treat the diffusion term calculate linear combinations of the
values with coefficients in the unit interval
. The non-negativity of these coefficients implies that if the
u values are increased in the nonlinear step due to increasing β, that can yield only increased values after the diffusion step as well. □
The first statement of Theorem 2 is analogous to the maximum and minimum principles being valid for the pure (linear) diffusion equation.
Corollary 1. If the conditions of Theorem 2 hold, the numerical solution is unconditionally stable, since the difference between the true and the numerical solutions cannot be larger than 1.
We note that a small fraction of the statements of Theorem 2 have been published in our paper [
31].
5. Verification in 1D
Now PDE (1) with
is going to be solved in the domain
. The analytical solution [
1] (p. 34)
is used as the reference. The initial and the Dirichlet boundary conditions are obtained by evaluating this function at the time and space points belonging to the initial time
, and with the boundaries
, respectively. The maximum numerical errors are calculated by comparing the numerical solutions
produced using the examined method with the analytical reference solution
at the final time
using the formula
The average error is very similar:
The third type of error has an energy dimension in the case of the heat conduction equation, and hence we call it the energy error:
We would like to assess the error not only for a specific time-step size but also for a wide range of time-step sizes. Hence, we start using the maximum possible time-step size
, calculate the errors defined above, and then repeat this calculation for subsequently decreasing time-step sizes. The time-step size is always divided by two, and the total number of different time-step sizes is denoted by
P. We calculate the average of the logarithm of the obtained errors, which will be called the aggregated error (AgE). In the case of the maximum errors, it is given by the following formula
where the summation is going for the different time-step sizes. The final step is to calculate the average of the three different AgE errors:
Note that when the AgE is negative with a large absolute value, the method is very accurate. In this section, we calculated the aggregated error for P = 13 different time-step sizes for all the studied methods.
We perform two case studies using the analytical solution (26), with completely different parameter values.
Case Study 1: Medium nonlinear coefficient, equidistant mesh
PDE (1) is discretized on the domain using space step size. The nonlinear coefficient is , while c = 1 in Equation (26).
Case Study 2: Large nonlinear coefficient, non-equidistant mesh
The equation is solved on the interval with . A non-equidistant spatial mesh is used with slowly increasing cell diameters from to . The nonlinear coefficient is quite large, , and c = 3.6.
In order to verify the algorithm combinations, we set
P = 18, and plot the errors as a function of the time-step size. However, instead of displaying the
curves for each case study, we select those using the PI reaction-term treatment in Case Study 1 with all the diffusion-solvers in
Figure 2, while choosing three different diffusion-solvers combined with all the reaction-term treatments in
Figure 3. Very similarly, for Case Study 2, we present the error curves for all diffusion-solvers using the t2 reaction-treatment, and then the five reaction-treatments combined with only three diffusion-solvers, in
Figure 4 and
Figure 5, respectively.
The numerical order of convergence has been calculated for the two cases displayed in
Figure 2 and
Figure 4 and presented in
Table 2 and
Table 3, respectively. For this, we chose two values of the errors belonging to two subsequent time-step sizes using the formula
The values of the first time-step size
and the subsequent time-step size
have been chosen in such a way as to obtain the maximal value for
NO. The exception is the first (and largest) time-step size, where the observed significant drop of the error does not reflect the order of the methods (see the top-right corner of
Figure 2 and
Figure 4), and hence this
k = 1 case is not sampled. One can observe that the numerical orders are not far from the theoretical orders which were calculated for the pure diffusion equation.
Very similar error curves have been obtained for other values of the parameters
β,
, Δ
x and for the remaining algorithm combinations as well. The methods converge smoothly, and unstable behavior or unphysical oscillations are not produced. The only exception is treatment 3, which does not converge; therefore, we omit it from further investigations. The remaining four reaction-treatments are organized with halved time steps by Strang-splitting as well. In this way, 12 treatments are constructed and tested with the 13 diffusion-solvers, i.e., 12 × 13 = 156 algorithm combinations are tested. Considering that we have two test problems and
P = 13 different time-step sizes, we performed 4056 runs with error calculations. The AgE values are tabulated in
Table 4 and
Table 5 and visualized in
Figure 6 and
Figure 7 for Case Study 1 and 2, respectively. We note that the errors of the different treatments are sometimes very close to each other, so the difference between them is only in the third or fourth decimals.
Based on
Figure 6 and
Figure 7 and
Table 4 and
Table 5, and further results we do not present here for brevity, we intend to remove those combinations which were clearly outperformed by others. First, we can conclude that the t1 treatment with Strang-splitting is the most accurate, while the PI treatment is the least accurate. Strang-splitting yields a significant increase in accuracy, typically for the higher-order schemes, e.g., for the CLQ3 and CLQ4 schemes, which are more accurate for the diffusion equation. For the first-order UPFD and CNe solvers, the difference in accuracy between the reaction-treatments is very small. The mixing of the treatments by Strang-splitting does not yield any substantial improvement. Moreover, they require more effort to code, so we exclude them from future investigations. However, when we select the methods for further investigation, including running time tests, we have to be careful: not only the accuracy but also the speed has to be considered. The multi-stage diffusion-solvers are more accurate, but slower as well, and thus we keep both low- and high-order solvers. On the other hand, the formula of the t1–t4 treatments contains the calculation of the exponential function in each time step for each cell, e.g.,
, while the PI treatment contains cheaper operations. Furthermore, Strang-splitting also consumes time. Therefore, although we select mainly the t1 and t1-Strang treatments, we keep the PI treatment combined with the simplest UPFD and CNe solver, hoping that the speed gain can dominate the loss in the accuracy, at least in some cases. To summarize, we decided to keep the following 28 combinations:
UPFD-PI | OOEH-CNe-t1-Strang | LNe3-t1 | CLQ-t1-Strang |
UPFD-t1 | LH-CNe-t1 | LNe3-t1-Strang | CLQ2-t1 |
UPFD-t1-Strang | LH-CNe-t1-Strang | LNe4-t1 | CLQ2-t1-Strang |
CNe-PI | CpC-t1 | LNe4-t1-Strang | CLQ3-t1 |
CNe-t1 | CpC-t1-Strang | LNe5-t1 | CLQ3-t1-Strang |
CNe-t1-Strang | LNe-t1 | LNe5-t1-Strang | CLQ4-t1 |
OOEH-CNe-t1 | LNe-t1-Strang | CLQ-t1 | CLQ4-t1-Strang |
6. Testing the Performance with Running Time Measurements in 2D
The capacity-resistivity model, introduced in
Section 2, will be used for the simulations in two spatial dimensions here and in the next section. This means that the ODE system (8), supplemented with the Huxley reaction term, is solved by the selected 28 algorithm combinations. The CFL limit and the stiffness ratio can be adjusted by generating random values for the
C and
R quantities following a log-uniform distribution:
Here, rand are random numbers, uniformly distributed in the unit interval by MATLAB R2021b. We assume that if our methods work in the case of random systems, they will work in other cases as well. We construct two completely different systems and via running-time measurements, try to obtain the methods with the best performance. In all 2D cases, the reference solutions are calculated by the MATLAB built-in ode15 solver using a very strict absolute and relative error tolerance. The tic-toc command of MATLAB is utilized to measure the running times, which are good approximations of the CPU times if no other tasks are given to the computer, which has a 13th Gen Intel Core i7-13700 CPU and 64GB RAM. We tried to minimize the running-time measurement errors appearing as random fluctuations by repeating the calculations more times subsequently, and then taking the average of the measured running times.
Case Study 3: A moderately stiff system with stronger nonlinearity
The mesh size and final time used are
while
, and
. These parameters yield
and
, which means that the system is mildly stiff. The initial concentrations are random numbers:
. The errors as a function of the time-step size and running times are presented in
Figure 8 and
Figure 9, respectively.
Case Study 4: A stiff system with weaker nonlinearity
The size of the system is
the final time is
the coefficient of the reaction term is
, while the exponents are
. The problem we obtained using these parameters is characterized by the
and
numbers, and hence the system is rather stiff. The initial concentration function is smooth:
. The errors as a function of the time-step size and running times are presented in
Figure 10 and
Figure 11, respectively.
Using the results accumulated up to this point, we further reduce the number of methods, and we keep only the top nine of them. These are the OOEH-CNe-t1-Strang, LH-CNe-t1, LH-CNe-t1-Strang, CpC-t1-Strang, and LNe-t1-Strang, as well as four higher-order combinations: the CLQ-CLQ4 series with the t1 treatment and Strang-splitting.
7. Parameter-Sweep for Further Testing of the Performance of the Top 9 Methods
Case Study 5: Errors as a function of the β parameter, non-stiff case
The following series is used for the values of the nonlinear coefficient:
. To construct a system with the lowest possible stiffness ratio, all
a and
b exponents are set to zero, i.e.,
for all cells. The system size is set to
and
, and the final time is
. The initial concentration function is given by
.
Figure 12 shows the
AgE errors as a function of the square root of the
β coefficient. One can observe that the errors increase when the level of nonlinearity is increasing until
. If
β surpasses this region, the solution function is extremely close to 1; therefore, the errors become smaller and smaller again. In this region, the diffusion-solver has no significance, while the Strang-splitting yields a slight but noticeable advantage.
Case Study 6: Errors as a function of the β parameter, stiff case
The following series is used for the values of the nonlinear coefficient:
. The
a and
b exponents are larger:
. The system size is set to
and
, and the final time is
. The initial concentration function is given by
.
Figure 13 shows the
AgE errors as a function of
. One can see that the accuracy of the methods deteriorates when the β parameter is increasing, but the higher-order diffusion-solvers lose their advantage at a much slower rate than for a non-stiff system.
Case Study 7: Errors as a function of the CFL limit
A series of test problems with a decreasing CFL limit and increasing stiffness ratio has been set up by gradually increasing the
a and
b exponents in (30), as
Table 6 shows. All other parameters are kept fixed, such as
,
and
, and
. The initial values were generated only once for all the cases using the formula
.
P = 15 different time-step sizes have been used in the definitions (28) and (29) of the aggregated error.
The AgE errors for different CFL limits are presented in
Figure 14 and
Table 7. As was expected, the accuracy of the methods deteriorates with a decreasing CFL limit and increasing stiffness ratio. The high-order CLQ family has a large relative advantage for a small CFL limit. The error of the OOEH scheme increases faster than those of the other schemes with a decreasing CFL limit and exceeds the error of the LH-CNe without Strang-splitting.
8. Discussion and Summary
The numerical solution of a special form of the nonlinear Huxley equation is examined, for which the true solution remains in the unit interval. We constructed numerous algorithm combinations with operator-splitting and showed that they preserve this property for arbitrary spatial mesh, the time-step size, and values of the nonlinear coefficient β. The numerical experiments confirmed these results and helped us to gradually tighten the large set of the examined methods to find the best choices for different circumstances. We can propose the LH-CNe diffusion-solver combined with t1 treatments and Strang-splitting if any of the following conditions are fulfilled:
Speed is more important than the accuracy of the result.
The CFL limit is moderate or the stiffness is not high.
The nonlinear parameter β is large: larger than 1 for an equidistant mesh or larger than 5 for a stiff case.
However, if high accuracy is required in a stiff case, the CLQ family combined with t1 treatments and Strang-splitting is the best choice. Furthermore, if the nonlinearity is very low, Strang-splitting is redundant, but in all other cases, it is worth coding. If one has a physical system with a complicated geometry, the odd–even hopscotch structure may be hard to construct. In those cases, the CpC-t1-Strang solver can be recommended if high speed is required, since the diffusion-solver CpC contains only two stages, and it usually yields an acceptable accuracy.