DiffEqBase.jl icon indicating copy to clipboard operation
DiffEqBase.jl copied to clipboard

EnsembleSummary fails for semi-unstable EnsembleProblem

Open metanoid opened this issue 5 years ago • 2 comments

I have an EnsembleSolution sol for which the retcodes are a mix of :Success and :MaxIters.

EnsembleSummary(sol) fails with error: ERROR: Solution interpolation cannot extrapolate past the final timepoint. Either solve on a longer timespan or use the local extrapolation from the integrator interface.

I think this is because not all trajectories have the same length t.

I would propose that instead of failing, the EnsembleSummary should provide the mean and quantiles up until the last shared timepoint across the EnsembleSolution, with a warning that not all timesteps have values.

metanoid avatar Jun 13 '20 08:06 metanoid

yeah this is a tough one. I think it's best to just throw a better error if the t's don't line up, because then what does it even mean to take the mean and variance? You cannot always rely on the interpolation (unless dense=true), so I think the safest behavior is to just throw an error telling the user they should make sure the saves are the same across the different trajectories (i.e. use saveat) if you want a summary. Otherwise I'm not sure how to calculate the summary.

ChrisRackauckas avatar Jun 13 '20 08:06 ChrisRackauckas

I guess, yeah. Just to clarify, this issue can still happen, even if you are using saveat = 0.1, because there's no guarantee that there are an equal number of saved points in each trajectory.

metanoid avatar Jun 13 '20 09:06 metanoid