```julia
using DifferentialEquations
using Plots
gr()
g = @ode_def LorenzE…xample begin
dx = σ*(y-x)
dy = x*(ρ-z) - y
dz = x*y - β*z
end σ ρ β
u0 = [1.0,0.0,0.0]
tspan = (0.0,10.0)
p = [10.0,28.0,8/3]
prob = ODEProblem(g,u0,tspan,p)
function periodic(integrator)
integrator.u[2] += 10
end
cb = PeriodicCallback(periodic, 2::Number)
sol = solve(prob, callback = cb)
plot(sol)
```
fails, but
```julia
cb = PeriodicCallback(periodic, 2.0)
sol = solve(prob, Tsit5(), callback = cb)
plot(sol)
```
works. It should know to upconvert but it fails in the `push!` for the binary heap.
```julia
> sol = solve(prob, Tsit5(), callback = cb)
ERROR: MethodError: no method matching push!(::DataStructures.BinaryHeap{Float64,DataStructures.LessThan}, ::Int64)
Closest candidates are:
push!(::Any, ::Any, ::Any) at abstractarray.jl:1940
push!(::Any, ::Any, ::Any, ::Any...) at abstractarray.jl:1941
push!(::Array{Any,1}, ::ANY) at array.jl:653
...
Stacktrace:
[1] add_tstop!(::OrdinaryDiffEq.ODEIntegrator{OrdinaryDiffEq.Tsit5,Array{Float64,1},Float64,Array{Float64,1},Float64,Float64,Float64,Array{Array{Float64,1},1},DiffEqBase.ODESolution{Float64,2,Array{Array{Float64,1},1},Void,Void,Array{Float64,1},Array{Array{Array{Float64,1},1},1},DiffEqBase.ODEProblem{Array{Float64,1},Float64,true,Array{Float64,1},LorenzExample,Void,Void,UniformScaling{Int64},DiffEqBase.StandardODEProblem},OrdinaryDiffEq.Tsit5,OrdinaryDiffEq.InterpolationData{LorenzExample,Array{Array{Float64,1},1},Array{Float64,1},Array{Array{Array{Float64,1},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}}}},LorenzExample,Void,OrdinaryDiffEq.Tsit5Cache{Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}},OrdinaryDiffEq.DEOptions{Float64,Float64,Float64,Float64,DiffEqBase.#ODE_DEFAULT_NORM,DiffEqBase.CallbackSet{Tuple{},Tuple{DiffEqBase.DiscreteCallback{DiffEqCallbacks.##40#43{Base.RefValue{Int64}},DiffEqCallbacks.##41#44{#periodic,Int64,Base.RefValue{Int64}},DiffEqCallbacks.##42#45{DiffEqBase.#INITIALIZE_DEFAULT,Bool,Int64,Base.RefValue{Int64},DiffEqCallbacks.##41#44{#periodic,Int64,Base.RefValue{Int64}}}}}},DiffEqBase.#ODE_DEFAULT_ISOUTOFDOMAIN,DiffEqBase.#ODE_DEFAULT_PROG_MESSAGE,DiffEqBase.#ODE_DEFAULT_UNSTABLE_CHECK,DataStructures.BinaryHeap{Float64,DataStructures.LessThan},DataStructures.BinaryHeap{Float64,DataStructures.LessThan},Void,Void,Int64,Array{Float64,1},Array{Float64,1},Array{Float64,1}},Array{Float64,1}}, ::Int64) at C:\Users\Chris\.julia\v0.6\OrdinaryDiffEq\src\integrators\integrator_interface.jl:73
```