Analysis of ensembles of different solution lengths (DiffEq)

I’m solving some ensembles where each trajectory is going to have a wildly different length due to a termination callback. I’d like to be able to, e.g using the EnsembleSolution/EnsembleSummary methods visualize how this ensemble evolves over time. Pretty much what I want to do is:

  1. solve Ensemble
  2. use something like componentwise_vectors_timestep() to get the position of every solution at some timesteps/points of interest
  3. plot them

Using the timestep/timepoint methods on the whole ensemble is clearly going to be limited to the length of the shortest trajectory, as it’ll throw an error if I try to look at timestep N+1 when the ensemble contains a trajectory of length N.

Is there a nice way to manipulate the EnsembleSolution object to, e.g, filter out trajectories by length? Or to have the methods like componentwise_vectors_timestep() behave in the way I describe?

Loop through them.

Use the methods that are by time not by time step if time steps don’t align. That’s the reason for the difference.