@jacob-roth wrote:
When passing parameters
p
to the functionf
of anODEProblem
(or any problem type in the DiffEq universe), doesp
always have to be an array? Is there a “best practices” reason for why I shouldn’t useDict
s to hold my parameters in my function definitionf
?As a concrete example, I tried modifying the ODE tutorial
p = Dict() p[:c] = 1.01 f(u,p,t) = p[:c]*u u0 = 1/2 tspan = (0.0,1.0) prob = ODEProblem(f,u0,tspan) sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8)
but I get
ERROR: MethodError: no method matching getindex(::Nothing, ::Symbol)
related top
on thesolve
, so I was curious why parameters have to be “list”-like.
Posts: 4
Participants: 2