I modified as you suggested, but how do I write the solver?
julia> condition1(u, t, integrator) = t==integrator.p[4] ###
condition1 (generic function with 1 method)
julia> affect1!(integrator) = integrator.u[3] += integrator.p[5] ###
affect1! (generic function with 1 method)
julia> cb1 = DiscreteCallback(condition1, affect1!)
DiscreteCallback{typeof(condition1),typeof(affect1!),typeof(DiffEqBase.INITIALIZE_DEFAULT),typeof(DiffEqBase.FINALIZE_DEFAULT)}(condition1, affect1!, DiffEqBase.INITIALIZE_DEFAULT, DiffEqBase.FINALIZE_DEFAULT, Bool[1, 1])
...
julia> prob = ODEProblem(growth!, u0, tspan, parms)
ODEProblem with uType Array{Float64,1} and tType Float64. In-place: true
timespan: (0.0, 4000.0)
u0: [1.0e7, 0.0, 0.0]
julia> EnsembleProblem(prob;
output_func = (sol,i) -> (sol,false),
prob_func= (prob,i,repeat)->(prob),
reduction = (u,data,I)->(append!(u,data),false),
u_init = [], safetycopy = prob_func !== DEFAULT_PROB_FUNC)
ERROR: UndefVarError: prob_func not defined
Stacktrace:
[1] top-level scope at none:1
julia> solve(ensembleprob,alg,EnsembleThreads();trajectories=1000)
ERROR: UndefVarError: ensembleprob not defined
Stacktrace:
[1] top-level scope at none:1
Here I think the problem is that I do not need prob_func
but simply pass an array with the values to test for both p[4] and p[5]… How would I do that? Thanks