Benchmark of Error-Free Transforms for ODE IVP#

This benchmark compares accuracy and efficiency of several summation algorithms in floating point arithmetics for initial value problems of ordinary differential equations

eq_names = [
    "y'' = -y"          ,
    "y'' = - exp(y)"    ,
    "y'' = xy"          ,
    "y' = Az; z' = By"  ,
]

implicit_methods = {
    f'{rk_name} {order}' : choreo.scipy_plus.multiprec_tables.ComputeImplicitRKTable_Gauss(order, method=rk_name) for rk_name, order in itertools.product(["Gauss"], [2,4,6,8])
}

explicit_methods = {
    rk_name : getattr(globals()['precomputed_tables'], rk_name) for rk_name in [
            'McAte4'    ,
            'McAte5'    ,
            'KahanLi8'  ,
            'SofSpa10'  ,
    ]
}

The following plots give the measured relative error as a function of the number of quadrature subintervals

plt.show()
Relative error on integrand y'' = -y, Relative error on integrand y'' = - exp(y), Relative error on integrand y'' = xy, Relative error on integrand y' = Az; z' = By

Error as a function of running time

plt.show()
Computational cost (s) as a function of number of iterations for equation y'' = -y, Computational cost (s) as a function of number of iterations for equation y'' = - exp(y), Computational cost (s) as a function of number of iterations for equation y'' = xy, Computational cost (s) as a function of number of iterations for equation y' = Az; z' = By

Total running time of the script: (0 minutes 3.406 seconds)

Gallery generated by Sphinx-Gallery