Method Error when using solve in DifferentialEquations.jl

I’m working through the first example in the Ordinary Differential Equations section of DifferentialEquations.jl documentation, and when I call solve(prob,Tsit5(),reltol=1e-8,abstol=1e-8), I get

MethodError: no method matching f(::Float64, ::DiffEqBase.NullParameters, ::Float64)

I’ve tried uninstalling and reinstalling.

My package status reads:

C:\Users\jmurp.julia\environments\v1.5\Project.toml`
[c52e3926] Atom v0.12.19
[2b5f629d] DiffEqBase v6.45.0
[0c46a032] DifferentialEquations v6.15.0
[e5e0dc1b] Juno v0.8.3
[1dea7af3] OrdinaryDiffEq v5.42.3
[91a5bcdd] Plots v1.6.0

Any help would be appreciated.

What does your definition of f look like?

(Side note: If you put your code in a block surrounded by triple back-ticks it will be easier to read.)

Here is my code.

using DifferentialEquations
using Plots

f(t,u) = 1.01*u
u0 = .5
tspan = (0.0, 1.0)

prob = ODEProblem(f, u0, tspan)
sol = solve(prob,Tsit5(),reltol=1e-8,abstol=1e-8)

The function should be:

f(u,p,t) = 1.01*u

I think at one point, the function signature looked like f(t,u), similar to the MATLAB convention, but it has since changed to f(u,p,t) (or f(du,u,p,t) for the in-place version). If you’re looking at documentation that still has f(t,u), it’s out of date.

That fixed it, thank you.

It looks like it was old documentation, must have clicked on some old link somewhere.

Thanks again

1 Like

Yeah… I think that was 2017. How was the old link found? I think Google is the only thing that still digs up those old docs.

It was from google, when I searched “Julia Diffeq Uncertainty” it was the first link.