# MethodError when trying to follow DiffEq tutorial

**URL:** <https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996>\
**Category:** New to Julia\
**Tags:** diffeq\
**Created:** [February 11, 2018, 3:36pm UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996 "2018-02-11T15:36:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mentrelli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mentrelli/32/3407_2.png) [@mentrelli](https://discourse.julialang.org/u/mentrelli)\
**Post date:** [February 11, 2018, 3:36pm UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/1 "2018-02-11T15:36:00Z")

</div>

Hallo, I was trying to follow the tutorial on differential equations available on Juliabox (ODEintroduction), on a brand new installation of JuliaPro (v…6.2.1), but I have troubles:

```julia
using DifferentialEquations
f(u,p,t) = 0.98u
u0 = 1.0
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)

```

ERROR: MethodError: objects of type Float64 are not callable  
Stacktrace:  
[1] alg\_cache(::OrdinaryDiffEq.Tsit5, ::Float64, ::Float64, ::Type{T} where T, ::Type{T} where T, ::Float64, ::Float64, ::Function, ::Float64, ::Float64, ::Float64, ::Type{Val{true}}) at /opt/JuliaPro-0.6.2.1/JuliaPro/pkgs-0.6.2.1/v0.6/OrdinaryDiffEq/src/caches/low\_order\_rk\_caches.jl:406  
[2] #init#1831(::Int64, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Void, ::Bool, ::Void, ::Bool, ::Bool, ::Bool, ::Bool, ::Float64, ::Bool, ::Rational{Int64}, ::Void, ::Void, ::Int64, ::Rational{Int64}, ::Int64, ::Int64, ::Rational{Int64}, ::Bool, ::Int64, ::Rational{Int64}, ::Rational{Int64}, ::Int64, ::Float64, ::Float64, ::DiffEqBase.#ODE\_DEFAULT\_NORM, ::DiffEqBase.#ODE\_DEFAULT\_ISOUTOFDOMAIN, ::DiffEqBase.#ODE\_DEFAULT\_UNSTABLE\_CHECK, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Int64, ::String, ::DiffEqBase.#ODE\_DEFAULT\_PROG\_MESSAGE, ::Void, ::Void, ::Bool, ::Bool, ::Array{Any,1}, ::DiffEqBase.#init, ::DiffEqBase.ODEProblem{Float64,Float64,true,#f,Void,UniformScaling{Int64},DiffEqBase.StandardODEProblem}, ::OrdinaryDiffEq.Tsit5, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type{Val{true}}) at /opt/JuliaPro-0.6.2.1/JuliaPro/pkgs-0.6.2.1/v0.6/OrdinaryDiffEq/src/solve.jl:217  
[3] (::DiffEqBase.#kw##init)(::Array{Any,1}, ::DiffEqBase.#init, ::DiffEqBase.ODEProblem{Float64,Float64,true,#f,Void,UniformScaling{Int64},DiffEqBase.StandardODEProblem}, ::OrdinaryDiffEq.Tsit5, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type{Val{true}}) at ./:0  
[4] #solve#1830(::Array{Any,1}, ::Function, ::DiffEqBase.ODEProblem{Float64,Float64,true,#f,Void,UniformScaling{Int64},DiffEqBase.StandardODEProblem}, ::OrdinaryDiffEq.Tsit5, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type{Val{true}}) at /opt/JuliaPro-0.6.2.1/JuliaPro/pkgs-0.6.2.1/v0.6/OrdinaryDiffEq/src/solve.jl:6  
[5] (::DiffEqBase.#kw##solve)(::Array{Any,1}, ::DiffEqBase.#solve, ::DiffEqBase.ODEProblem{Float64,Float64,true,#f,Void,UniformScaling{Int64},DiffEqBase.StandardODEProblem}, ::OrdinaryDiffEq.Tsit5, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type{Val{true}}) at ./:0 (repeats 2 times)  
[6] #solve#2(::Bool, ::Array{Any,1}, ::Function, ::DiffEqBase.ODEProblem{Float64,Float64,true,#f,Void,UniformScaling{Int64},DiffEqBase.StandardODEProblem}, ::Void) at /opt/JuliaPro-0.6.2.1/JuliaPro/pkgs-0.6.2.1/v0.6/DifferentialEquations/src/default\_solve.jl:14  
[7] (::DiffEqBase.#kw##solve)(::Array{Any,1}, ::DiffEqBase.#solve, ::DiffEqBase.ODEProblem{Float64,Float64,true,#f,Void,UniformScaling{Int64},DiffEqBase.StandardODEProblem}, ::Void) at ./:0  
[8] #solve#1(::Bool, ::Array{Any,1}, ::Function, ::DiffEqBase.ODEProblem{Float64,Float64,true,#f,Void,UniformScaling{Int64},DiffEqBase.StandardODEProblem}) at /opt/JuliaPro-0.6.2.1/JuliaPro/pkgs-0.6.2.1/v0.6/DifferentialEquations/src/default\_solve.jl:5  
[9] solve(::DiffEqBase.ODEProblem{Float64,Float64,true,#f,Void,UniformScaling{Int64},DiffEqBase.StandardODEProblem}) at /opt/JuliaPro-0.6.2.1/JuliaPro/pkgs-0.6.2.1/v0.6/DifferentialEquations/src/default\_solve.jl:2

---

<div class="post-metadata">

**Author:** ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Post date:** [February 11, 2018, 4:44pm UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/2 "2018-02-11T16:44:41Z")

</div>

Can you post the output of `Pkg.status("DifferentialEquations")`?

See here: [http://docs.juliadiffeq.org/stable/tutorials/ode\_example.html#Example-1-:-Solving-Scalar-Equations-1](http://docs.juliadiffeq.org/stable/tutorials/ode_example.html#Example-1-:-Solving-Scalar-Equations-1)

---

<div class="post-metadata">

**Author:** ![mentrelli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mentrelli/32/3407_2.png) [@mentrelli](https://discourse.julialang.org/u/mentrelli)\
**Post date:** [February 11, 2018, 10:54pm UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/3 "2018-02-11T22:54:23Z")

</div>

Hallo, I had v3.0.2:

```julia
julia > Pkg.status("DifferentialEquations")
 - DifferentialEquations 3.0.2

```

After a Pkg.update(), I have now version 3.1.0:

```julia
julia> Pkg.status("DifferentialEquations")
 - DifferentialEquations 3.1.0

```

… but I am not able to further update to v4.0.0:

```julia
julia> Pkg.update("DifferentialEquations")
INFO: Updating METADATA...
INFO: Computing changes...
INFO: Package DifferentialEquations was set to version 3.1.0, but a higher version 4.0.0 exists.
      To install the latest version, you could try doing a full update with `Pkg.update()`.
INFO: No packages to install, update or remove

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove

```

How can I update to v4.0.0? Thanks!

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 12, 2018, 2:46am UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/4 "2018-02-12T02:46:41Z")

</div>

> [@mentrelli](#):
>
> brand new installation of JuliaPro (v…6.2.1)

My guess is that’s the problem. @avik when’s the next JuliaPro update coming and can we make sure it is compatible with DiffEq 4.0?

---

<div class="post-metadata">

**Author:** ![yha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yha/32/3502_2.png) [@yha](https://discourse.julialang.org/u/yha)\
**Post date:** [February 21, 2018, 1:00am UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/5 "2018-02-21T01:00:12Z")

</div>

I also have JuliaPro 0.6.2.1, with DifferentialEquations 3.1.0, so I tried the version of the tutorial in the documentation for 3.0 ([http://docs.juliadiffeq.org/release-3.0/tutorials/ode\_example.html](http://docs.juliadiffeq.org/release-3.0/tutorials/ode_example.html). There seems to be documentation for 3.0 and 3.2.0, but not for 3.1.0. The basic tutorial is identical in 3.0 and 3.2):

```julia
using DifferentialEquations
f(t,u) = 1.01*u
u0=1/2
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)
sol = solve(prob,Tsit5(),reltol=1e-8,abstol=1e-8)

```

This yields

```julia
MethodError: no method matching ODE_DEFAULT_UNSTABLE_CHECK(::Float64, ::Float64, ::Float64)

```

Any hints on how to use this version?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 21, 2018, 1:39am UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/6 "2018-02-21T01:39:57Z")

</div>

Something looks out of sync here. What’s `Pkg.status("OrdinaryDiffEq")` and `Pkg.status("DiffEqBase")`?

But I think that passing `unstable_check = (dt,u,t) -> false, isoutofdomain = (t,u)->false` would do the trick. I would recommend just finding out what’s holding the package back and upgrading though.

---

<div class="post-metadata">

**Author:** ![yha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yha/32/3502_2.png) [@yha](https://discourse.julialang.org/u/yha)\
**Post date:** [February 21, 2018, 1:50am UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/7 "2018-02-21T01:50:08Z")

</div>

```julia
julia> Pkg.status("OrdinaryDiffEq")
 - OrdinaryDiffEq 2.26.0

julia> Pkg.status("DiffEqBase")
 - DiffEqBase 3.6.0

julia> Pkg.status("DifferentialEquations")
 - DifferentialEquations 3.1.0

```

> I would recommend just finding out what’s holding the package back and upgrading though.

Not sure how to do that. `Pkg.update()` just says “No packages to install, update or remove” rather than complaining that it can’t upgrade.

Before installing `DifferentialEquations`, I had installed `OrdinaryDiffEq` (thinking I don’t need the whole thing). Only after I couldn’t get it to work, and seeing the documentation about the API changes, I tried adding `DifferentialEquations` just to find what version number I get. So perhaps the problem is with the installation of `OrdinaryDiffEqs` on the current JuliaPro. I’ll try a fresh JuliaPro installation with `Pkg.add("DifferentialEquations")`.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 21, 2018, 2:29am UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/8 "2018-02-21T02:29:26Z")

</div>

> [@yha](#):
>
> So perhaps the problem is with the installation of OrdinaryDiffEqs on the current JuliaPro. I’ll try a fresh JuliaPro installation with Pkg.add(“DifferentialEquations”).

I think the issue is JuliaPro. It pins a version of Optim that is old, which holds back all of JuliaNLSolvers, which holds back NLsolve.jl, which holds back a lot of DiffEq stuff. JuliaNLSolvers (Optim, NLsolve, etc.) did the upgrade the same time as us, so you’re getting weird versions at this point since JuliaPro hasn’t updated. @avik knows about this issue.

---

<div class="post-metadata">

**Author:** ![luis\_munoz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luis_munoz/32/8146_2.png) [@luis\_munoz](https://discourse.julialang.org/u/luis_munoz)\
**Post date:** [May 23, 2018, 11:44am UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/9 "2018-05-23T11:44:20Z")

</div>

Hi, I have a similar issue when trying to update the DifferentialEquations package except that I run Julia from the terminal and no JuliaPro

```julia
  _ _ _(_)_ | A fresh approach to technical computing
  (_) | (_) (_) | Documentation: https://docs.julialang.org
   _ _ _| |_ __ _ | Type "?help" for help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 0.6.2 (2017-12-13 18:08 UTC)
 _/ |\ __'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-apple-darwin14.5.0

julia> Pkg.status("DifferentialEquations")
 - DifferentialEquations 3.1.0

julia> Pkg.update("DifferentialEquations")
INFO: Updating METADATA...
INFO: Computing changes...
INFO: Package DifferentialEquations was set to version 3.1.0, but a higher version 4.5.0 exists.
      To install the latest version, you could try doing a full update with `Pkg.update()`.
INFO: No packages to install, update or remove

```

Removing the package and reinstalling a specific version results in the following:

```julia
julia> Pkg.add("DifferentialEquations",v"4.5.0")
ERROR: resolve is unable to satisfy package requirements.
  The problem was detected when trying to find a feasible version
  for package DiffEqUncertainty.
  However, this only means that package DiffEqUncertainty is involved in an
  unsatisfiable or difficult dependency relation, and the root of
  the problem may be elsewhere.

```

Increasing ENV[“JULIA\_PKGRESOLVE\_ACCURACY”] does not solve the problem.

Thank you for any suggestions

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 23, 2018, 1:34pm UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/10 "2018-05-23T13:34:52Z")

</div>

Check `Pkg.status("OrdinaryDiffEq")`. That’s likely held back. The problem is because there was a package in the statistics ecosystem which put an upper bound that broke the package resolver.

[https://github.com/JuliaLang/METADATA.jl/pull/14613](https://github.com/JuliaLang/METADATA.jl/pull/14613)

I think it requires a clean wipe of the packages to get around it…

---

<div class="post-metadata">

**Author:** ![luis\_munoz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luis_munoz/32/8146_2.png) [@luis\_munoz](https://discourse.julialang.org/u/luis_munoz)\
**Post date:** [May 23, 2018, 4:44pm UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-follow-diffeq-tutorial/8996/11 "2018-05-23T16:44:00Z")

</div>

Indeed, I can see similarities to  
[https://github.com/JuliaDiffEq/DifferentialEquations.jl/issues/292](https://github.com/JuliaDiffEq/DifferentialEquations.jl/issues/292)  
and `julia> Pkg.status("OrdinaryDiffEq")` gives ` - OrdinaryDiffEq 2.26.0` instead of the current version.

I did the package wipe and it works now! Thank you
