# Partition EnsembleSolution before using EnsembleSummary

**URL:** https://discourse.julialang.org/t/partition-ensemblesolution-before-using-ensemblesummary/43541
**Category:** General Usage
**Tags:** question, diffeq
**Created:** [July 23, 2020, 5:23am UTC](https://discourse.julialang.org/t/partition-ensemblesolution-before-using-ensemblesummary/43541 "2020-07-23T05:23:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jedforrest](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jedforrest/32/37502_2.png) [@jedforrest](https://discourse.julialang.org/u/jedforrest)
#### Post date: [July 23, 2020, 5:23am UTC](https://discourse.julialang.org/t/partition-ensemblesolution-before-using-ensemblesummary/43541/1 "2020-07-23T05:23:04Z")

</div>

I’ve started using `EnsembleProblem` in DifferentialEquations.jl and I like how simple it is to use with `EnsembleSummary` to create nice summary statistics and plots.

However, I would like to partition `EnsembleSolution` into different groups before summarising. For example, partition into two groups based on whether the solution reached a steady state or not.

This is what I’m imagining:

```julia
ensemble_prob = EnsembleProblem(prob, prob_func=prob_func)
sim = solve(ensemble_prob, trajectories=100)

sim_groupA = ... # e.g. solution reached a steady state
sim_groupB = ... # e.g. solution did not reach a steady state

summ_groupA = EnsembleSummary(sim_groupA)
summ_groupB = EnsembleSummary(sim_groupB)

plot(summ_groupA)
plot(summ_groupB)

```

Is there a simple way to do this? I couldn’t find anything online that explained if this was possible. The only thing I can think of looking at `sim.u` directly and not using `EnsembleSummary` at all.

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [July 23, 2020, 11:21am UTC](https://discourse.julialang.org/t/partition-ensemblesolution-before-using-ensemblesummary/43541/2 "2020-07-23T11:21:43Z")

</div>

you can use `sim[i].retcode` to know if it converged or not. Now, generating the summaries from that… I need to work on that part of the interface first.
