Lyapunov exponents using ChaosTools and fortran radau solver

I am not sure if this is the right place to ask my question but I will try anyways.

I want to calculate Lyapunov exponents of a very stiff ODE using the fortran radau solver from ODEInterfaceDiffEq. My setup looks like the following for creating the tangent integrator:

using DifferentialEquations
using ODEInterfaceDiffEq

cds = ContinuousDynamicalSystem(f, x_start, params, jac)
integ = tangent_integrator(cds;alg=radau())

This errors with the following:

MethodError: no method matching __init(::ODEProblem{Array{Float64,2},Tuple{Float64,Float64},true,Array{Float64,1},ODEFunction{true,getfield(DynamicalSystemsBase, Symbol("##21#22")){6,typeof(f),typeof(jac)},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Nothing,DiffEqBase.StandardODEProblem}, ::radau{Nothing}; abstol=1.0e-6, reltol=1.0e-6, internalnorm=DynamicalSystemsBase._tannorm, save_everystep=false, alg=radau{Nothing}(nothing, nothing))
Closest candidates are:
__init(::ODEProblem, !Matched::SimpleDiffEq.SimpleTsit5; dt) at /home/goran/.julia/packages/SimpleDiffEq/sWpbw/src/tsit5/tsit5.jl:29 got unsupported keyword arguments “abstol”, “reltol”, “internalnorm”, “save_everystep”, “alg”
__init(::ODEProblem, !Matched::SimpleDiffEq.SimpleATsit5; dt, abstol, reltol, internalnorm, kwargs…) at /home/goran/.julia/packages/SimpleDiffEq/sWpbw/src/tsit5/atsit5.jl:49
__init(::DiffEqBase.AbstractODEProblem, !Matched::algType<:OrdinaryDiffEqAlgorithm) where algType<:OrdinaryDiffEqAlgorithm at /home/goran/.julia/packages/OrdinaryDiffEq/tat1c/src/solve.jl:62 got unsupported keyword arguments “abstol”, “reltol”, “internalnorm”, “save_everystep”, “alg”

What is the right way to set up the tangent integrator?

You cannot setup the tangent integrator with this method.

So I use create_tangent from DynamicalSystemsBase instead and define my own ODEProblem ?

Or what is the way to go?

the Fortran radau doesn’t have the right hooks to create the integrator type the way that this method needs it. It just won’t work and I’m not sure it ever will. If you want something similar, you can try OrdinaryDiffEq.RadauIIA instead.

1 Like

OK! I assume that OrdinaryDiffEq.RadauIIA is calling purely Julia code?

Yes it’s a pure Julia recreation of the RadauIIA method which conforms to the interface like the rest of OrdinaryDiffEq. There are a few things it’s still missing in terms of Jacobian handling, and it requires that the problem is defined on the reals (because it uses Hairer’s same complexification trick), but that’s about it.

it requires that the problem is defined on the reals

This is no problem in my case.

As far as I can see, RadauIIA5 is implemented in OrdinaryDiffEq - so 5. order, right?

Yes, the 5th order one is implemented but not the adaptive order one yet.

OK. So how would I use the ChaosTools package to setup a tangent integrator and calculate Lyapunov exponents with a specific solver algorithm? I can not figure that out right now - I am still new to Julia and the DiffEq/DynSystems enviromnent :slight_smile:

It should just be integ = tangent_integrator(cds;alg=RadauIIA())

1 Like

@ChrisRackauckas Sorry for the late response! Your last answer worked - thank you :slight_smile: