To test the validity of the ODE-FT algorithm, we have performed two numerical experiments on two series of ODEs.
For the first experiment, we have chosen five non-trivial problems with known exact solution; this allows comparison of the one obtained by ODE-FT with the exact one.
In the second experiment we solve other five typical well-known ODEs and we compare our solutions with the ones obtained by well-established routines in MATLAB, like ode45 (based on explicit single step Runge–Kutta method of orders 4 and 5 with step-size control), ode113 (a variable-step and variable-order method based on Adams–Bashforth–Moulton discretizations of orders 1 to 13) or ode15i (an implicit variable-step and variable-order solver of orders 1 to 5, particularly efficient for stiff problems).
4.1. ODEs with Known Exact Solutions
The five ODEs for the first experiment are denoted Ex1 (single equation, ) and Ex2, Ex3, Ex4, Ex5 (systems of two equations, ).
For all the examples, we provide the following MATLAB output:
- -
MFT = … number M of points where the solution is computed;
- -
N = Number of nodes in the partition ;
- -
hstep = … step size h used on each subinterval , ;
- -
FunctionEvaluations = total number of function evaluations required by algorithm ODE-FT.
- -
Final FT value = …(final value found for at , ;
- -
AveErrFT = Average absolute error , ;
- -
MaxErrFT = Maximum absolute error , ;
- -
Final Exact value = …(final value of at , ;
- -
Error in Final value = (, )
Problem Ex1 (Logistic equation with unitary carrying capacity): Solution interval is
;
The exact solution is (, ).
The first run with MFT = 101 and N = 2 (corresponding step size ) produced the following results:
AveErrFT = 3.131431926296436 , MaxErrFT = 8.708952653480040
Final FT: = 6.905591487503622 ,
Final Exact: = 6.905678577030157 ,
Final Error: Errx( 1) = -8.708952653480040 .
The second run uses MFT = 101 and N = 41, corresponding to a step size , produces the following better result, with a final error of the order 5 :
MFT = 101, N = 41, hstep = 2.5 , FunctionEvaluations = 14,798.
AveErrFT = 1.957156456839409 , MaxErrFT = 5.443002715210810 .
Final FT: = 6.905678522600129 ,
Final Exact: = 6.905678577030157 and
Final Error: Errx( 1) = -5.443002715210810 .
Problem Ex2: (non-autonomous nonlinear system): Solution interval is
;
The exact solution is .
The solution is first computed using MFT = 101, N = 41, hstep = 2.50 , FunctionEvaluations = 15,988, with the following results:
AveErrFT = 1.0 * (0.057812917960167, 0.117536307911936),
MaxErrFT = 1.0 * (0.208599681972288, 0.491491372045516),
Final FT: = 8.414709639479283 , = 1.557407773804039 ,
Final Exact: = 8.414709848078965 , = 1.557407724654902 ,
Final Error: Errx(1) = −2.085996819722880 , Errx(2) = 4.914913720455161
If the step size is reduced to the error decreases significantly,
MFT = 1001, N = 101, hstep = 1.0 , FunctionEvaluations = 301,000.
AveErrFT = 1.0 * (0.091807074367543, 0.186150663977414),
MaxErrFT = 1.0 * (0.333676419828066, 0.786386511464343),
Final FT: = 8.414709847745289 , = 1.557407724733541 .
Problem Ex3 (stiff, linear, see [
24], Section 6.5): Solution interval is
;
The exact solution is .
The first run uses MFT = 51, N = 11, hstep = 0.001 and FunctionEvaluations = 550, with:
AveErrFT = 1.0 * (0.173411281358034, 0.170428606844124),
MaxErrFT = 1.0 * (0.853912256957301, 0.853928757786893),
Final FT: = 2.426122537762081 , = −1.213061268881040 ,
Final Exact: = 2.426122638850534 , = -1.213061319425267 and
Final Error: Errx(1) = −1.010884531638112 , Errx(2) = 5.054422635986100 .
By reducing the step size, i.e., MFT = 501, N = 101, hstep = 0.00001, FunctionEvaluations = 50,500, we obtain:
AveErrFT = 1.0 * (0.459480472441389, 0.459450580577288),
MaxErrFT = 1.0 * (0.919708563218436, 0.919708564739441),
Final FT:
Final Exact: and
Final Error: Errx(1) = , Errx(2) = .
Problem Ex4: (Lotka–Volterra system, see, e.g., [
14]) Solution interval is
;
The exact solution is .
In this case, the first run with MFT = 21, N = 6, hstep = 0.01, FunctionEvaluations = 820, produced:
AveErrFT =
MaxErrFT = (0.004132636807097, 0.000295217766130),
Final FT:
Final Exact:
Final Error: Errx(1) = Errx(2) =
while in the second run with MFT = 201, N = 41, hstep = 1.25 , FunctionEvaluations = 32,200, the results are significantly better:
AveErrFT =
MaxErrFT =
Final FT:
Final Exact:
Final Error: Errx(1) = Errx(2) =
Problem Ex5: (linear, see [
14]) Solution interval is
;
The exact solution is .
The first run is executed with MFT = 11, N = 2, hstep = 0.1, FunctionEvaluations = 20 and produced a solution with
AveErrFT = (0.000949321158793, 0.003176265306333),
MaxErrFT = (0.001690735853275, 0.008258267736959),
Final FT:
Final Exact:
Final Error: Errx(1) = Errx(2) =
By reducing the step size to 0.01 (MFT = 11, N = 11, FunctionEvaluations = 110), the errors reduce to AveErrFT = MaxErrFT =
Finally, using MFT = 101, N = 201, hstep = , FunctionEvaluations = 20,100, the result is
Final FT:
Final Exact: , with
AveErrFT =
MaxErrFT =
4.2. ODEs without Known Closed-Form Solution
The five ODEs for the second experiment are nonlinear d-dimensional systems denoted No1 (), No2 (), No3 (), No4 () and No5 ().
These ODEs are generally considered to be numerically difficult to solve and are frequently used to test ODE solvers, in comparison with existing well-performing procedures. We have executed algorithm ODE-FT using MATLAB in parallel with well-established routines in MATLAB, in particular with routine ode45 (based on explicit single step Runge–Kutta method of orders 4 and 5 with step-size control) and, in one case, with routines ode113 (a variable-step and variable-order method based on Adams–Bashforth–Moulton discretization of orders 1 to 13) and ode15i (an implicit variable-step and variable-order solver of orders 1 to 5, particularly efficient for stiff problems).
Now, as we have explained in
Section 2, the performance of algorithm ODE-FT depends essentially on the step size
h resulting from the two parameters MFT and N; on the other hand, our simple implementation of ODE-FT does not consider variable step size, designed to control adaptively the local discretization and/or approximation errors. For this reason, we have first executed routine
ode45 to compute the solution at an appropriate number M of points
and, from the output of
ode45, we have computed the number N of nodes for the fuzzy partition in such a way that
is of the same order as the optimal step size
determined by
ode45. In this way, the two routines produce solutions by using a step size of the same magnitude and the comparison does not depend on this element; for example, suppose that in solving an ODE on time domain
at
M uniform points
,
, routine
ode45 returns, e.g., an optimal step size
, we then execute algorithm ODE-FT with MFT = M and with N
so that
.
We remark that to determine the step size
for ODE-FT, we can freely play with the two parameters MFT and N; in our experiment, in order to balance the number of Equation (
29) to solve and the memory requirements, we have limited values of N between 11 and 501, so determining M to obtain the required step size, eventually by increasing M to take N in the range above.
Problem No1: Solution interval is
;
Routine ode45 solves this ODE with optimal step size and final solution vector
We execute ODE-FT with MFT = 10,001, N = 21 so that hstep = 7.853981633974483 , with final solution
At the MFT points where the solution is approximated, the average and the maximum absolute differences between the FT solution and the RK solution for each are:
AveDiffFTRK =
MaxDiffFTRK =
See
Figure 1 for the graphical representation of the found solutions. For this example,
Figure 2 pictures the differences
between the FT solution and the RK solution for the three components
,
at the MFT points. It is interesting to observe that the differences oscillate in sign, showing that in absolute value the differences are not systematically diverging.
Problem No2: (
Van der Pol equations) Solution interval is
;
The parameters are , , .
This system is considered to be a hard ODE and requires very small step size to determine points where the solution changes suddenly (see
Figure 3). To capture this phenomenon, we use M = 30,001. The solution by
ode45 has optimal step size
and final solution vector
.
With MFT = 30,001, we choose N = 501 to have hstep = 2.0 and ODE-FT finds the final value . The comparison gives AveDiffFTRK = 1.398228278980211 and MaxDiffFTRK = 0.397462807473403.
Problem No3: (
Rössler’s equations) Solution interval is
;
The parameters are , , .
The third equation is nonlinear, but this problem is considered to be not numerically hard. The solution by ode45 has optimal step size and final solution vector
With MFT = 101, we choose N = 41 to have hstep = 0.005 and ODE-FT finds the final value
The comparison (see
Figure 4) gives
AveDiffFTRK =
MaxDiffFTRK =
Problem No4: (
Lorenz’s system) Solution interval is
;
The parameters are , , .
It is well known that this nonlinear system is hard to solve numerically as it exhibits chaotic trajectories. Routine
ode45 solves the Lorenz system by optimal step size
and computes the final value
Taking M = 30,001 the step size hstep = 1.0
is obtained with N = 1001; the found final value using ODE-FT is
with AveDiffFTRK = (0.004740929429043, 0.006537238822312, 0.008150973471168) and MaxDiffFTRK = (0.149405722393993, 0.285676182819206, 0.328764820957794). See
Figure 5 for the trajectories of components
,
and
Figure 6 for the 3D representations of the solutions.
We have also solved this system by a run of ODE-FT with MFT = 30,001, N = 101 and by running the two MATLAB routines
ode113 and
ode15i; the resulting solutions are visualized in
Figure 7 and we see that all the routines tend to generate trajectories with very different behavior for large values of time
t.
Problem No5: (Periodic system with period
, see [
24], Section 6.8): Solution interval is
;
The parameters are , ; we remark that from periodicity, the exact solution has , .
The initial condition is
With MFT = 801, N = 201 and the step size hstep = 5.0
, the final solution found by ODE-FT is
, and the one computed by
ode45 is
; comparatively (see
Figure 8), we get
AveDiffFTRK =
MaxDiffFTRK =