ODE: no method matching similar

(du,u,p,t) is in-place, modifying du. If you want to use scalars, use out-of-place:

function dudt(u,p,t)
  if rem(t,10) < 5
    pp = p[1]*t;
  end
  return pp*u
end

(the function doesn’t make sense of course because pp isn’t always defined). This is explained in the tutorial: Ordinary Differential Equations · DifferentialEquations.jl

1 Like