Solvers

Numerical integrators for fractional and integer order systems.

The solvers module contains the numerical integration routines for both fractional-order and classical integer-order differential equations.

Solvers Overview

Solver ClassTypeOrder TypeSpeedBest For
EFORKSolverExplicitFractionalVery FastHigh-throughput fractional sweeps, general use.
ABMSolverPredictor-CorrectorFractionalSlowerHigh-accuracy verification of fractional trajectories.
RK4SolverExplicitInteger (q=1q=1)Extremely FastClassical integer-order analysis and benchmarking.

Fractional-Order: EFORK

EFORK (Extended Fractional-Order Runge-Kutta) is an explicit integration scheme for systems defined with the Caputo fractional derivative. It is the workhorse of this library.

from hidden_attractors.solvers import EFORKSolver

solver = EFORKSolver(
    rhs=lambda x, t: rhs_nonsmooth(x, params),
    q=0.98,          # Fractional order
    dt=0.01,         # Step size
    memory=500       # Memory length
)

t_span = (0, 100)
x0 = [0.1, 0, 0]
t, x = solver.integrate(x0, t_span)

The Memory Parameter

Because fractional derivatives are non-local operators, the derivative at time tt depends on the entire history from t=0t=0. The memory parameter limits how far back in time the solver looks (in terms of integration steps). A memory of 500 with dt=0.01 means the solver looks back 5.05.0 seconds.

Larger memory increases accuracy but significantly slows down the computation.

Fractional-Order: ABM

The Adams-Bashforth-Moulton (ABM) predictor-corrector method is a standard, highly accurate solver for fractional calculus. However, it is computationally heavier than EFORK.

from hidden_attractors.solvers import ABMSolver

solver = ABMSolver(
    rhs=lambda x, t: rhs_nonsmooth(x, params),
    q=0.98,
    dt=0.01,
    memory=500
)
t, x = solver.integrate(x0, t_span)

Integer-Order: RK4

For classical chaotic systems (q=1.0q=1.0), the library includes a standard 4th-order Runge-Kutta solver.

from hidden_attractors.solvers import RK4Solver

solver = RK4Solver(
    rhs=lambda x, t: rhs_nonsmooth(x, params),
    dt=0.01
)
t, x = solver.integrate(x0, t_span)

Note: RK4 does not require a q or memory parameter.

C Backend Acceleration

If you have a supported C compiler, EFORKSolver, ABMSolver, and RK4Solver will automatically compile a highly optimized C extension on their first run. This is completely transparent to the Python API.

The C backends use OpenMP to parallelize the integration loop when multiple initial conditions are evaluated simultaneously.

See Platform Notes for compilation requirements.