You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code is a small variation of the code that appear in the help of ODEProblem (One parameter of the ODE is different, the lorenz function is not inplace, and it does not specify the Tsit5() solver):
using DifferentialEquations
functionlorenz(u, p, t)
d1 =10.0(u[2] - u[1])
d2 = u[1] * (10.0- u[3]) - u[2]
d3 = u[1] * u[2] - (8/3) * u[3]
return [d1, d2, d3]
end
u0 = [1.0; 0.0; 0.0]
tspan = (0.0, 100.0)
prob =ODEProblem(lorenz, u0, tspan)
# Test that it worked
sol =solve(prob)
It crashes with MethodError: no method matching setindex(::Vector{Float64}, ::Float64, ::Int64). The error actually happens in the line 196 of the file jacobian.jl of the FiniteDiff.jl package. It seems that it is expecting a tuple (for which setindex is defined) but gets a Vector (for which only setindex! is defined). If I change setindex to setindex! in that point, the error disapears. But I am not sure whether the problem is in DifferentialEquations.jl that is sending a Vector in place of a Tuple of in FiniteDiff.jl.
The text was updated successfully, but these errors were encountered:
The following code is a small variation of the code that appear in the help of
ODEProblem
(One parameter of the ODE is different, the lorenz function is not inplace, and it does not specify theTsit5()
solver):It crashes with
MethodError: no method matching setindex(::Vector{Float64}, ::Float64, ::Int64)
. The error actually happens in the line 196 of the file jacobian.jl of the FiniteDiff.jl package. It seems that it is expecting a tuple (for whichsetindex
is defined) but gets a Vector (for which onlysetindex!
is defined). If I changesetindex
tosetindex!
in that point, the error disapears. But I am not sure whether the problem is in DifferentialEquations.jl that is sending a Vector in place of a Tuple of in FiniteDiff.jl.The text was updated successfully, but these errors were encountered: