ODE Solver with ApproxFun's that change over time




I’m looking for an ODE solver that can solve DE’s of the form:

dydt = f(t,y)

where the ‘y’ are themselves ApproxFun functions (i.e. Chebychev interpolations of a function.) A very simple example might be the function:

f(t,y) = 0.01;

which would simply say that the all the values of the function ‘y’ should increase at a constant rate of 0.01 each unit of time. Are there any ODE solvers in Julia that can handle such cases?

According to the docs for DifferentialEquations.jl, OrdinaryDiffEq.jl is compatible with ApproxFun types. However, the following code

using DifferentialEquations
using ApproxFun
u0 = Fun(identity, 0…1)
f(t,y) = 0.01
tspan = (0.0,1.0);
prob = ODEProblem(f,u0,tspan)
sol = solve(prob, Vern7()) #Vern7() is in OrdinaryDiffEq.jl, so is compatible with ApproxFun

gives the following error

ERROR: StackOverflowError:
in recursive_one(::ApproxFun.Fun{ApproxFun.Chebyshev{ApproxFun.Segment{Float64}},Float64}) at /Users/me/.julia/v0.5/RecursiveArrayTools/src/RecursiveArrayTools.jl:0
in recursive_one(::ApproxFun.Fun{ApproxFun.Chebyshev{ApproxFun.Segment{Float64}},Float64}) at /Users/me/.julia/v0.5/RecursiveArrayTools/src/RecursiveArrayTools.jl:72 (repeats 79999 times)



Check out the experimental

which aims to combine ApproxFun.jl and DifferentialEquations.jl, though some of the more powerful ideas are postponed til Julia v0.6.


Yes, I have given this a bit more work since we first started doing this, but I think I broke it a little bit so that way it can be fully compatible. That said, right now I am doing the DiffEq ecosystem 2.0 release, and then I’m going to get back to this. For example, all of the OrdinaryDiffEq stiff methods now take in very generic linear solver functions where the BCs can be imposed.

It’s going to split problems to the fixed length and variable length versions. It needs a slight makeover to match the API of the other addon codes. I’m remaking it over at DiffEqApproxFun and should have something ready “soon” (I’ll add you to the team). PDEs weren’t the focus of 2.0 which is why they got held back.