# Why is the solution length calculated using EnsembleProblem different?

**URL:** https://discourse.julialang.org/t/why-is-the-solution-length-calculated-using-ensembleproblem-different/100089
**Category:** New to Julia
**Tags:** question, package
**Created:** [June 9, 2023, 9:10am UTC](https://discourse.julialang.org/t/why-is-the-solution-length-calculated-using-ensembleproblem-different/100089 "2023-06-09T09:10:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![chen\_yuan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chen_yuan/32/50640_2.png) [@chen\_yuan](https://discourse.julialang.org/u/chen_yuan)
#### Post date: [June 9, 2023, 9:10am UTC](https://discourse.julialang.org/t/why-is-the-solution-length-calculated-using-ensembleproblem-different/100089/1 "2023-06-09T09:10:34Z")

</div>

I use EnsembleProblem to calculate 100 trajectories of a sde,why the length of every trajectories are different?

```julia
using DifferentialEquations

# Simulate SDE
function f_fn(dx, x, p, t)
    ω₀, α, γ, β = p
    dx[1] = x[2]
    dx[2] = -ω₀*x[1]-α*x[2]-γ*x[1]^2*x[2]-β*x[2]^3
end

function σ_fn(dx, x, p, t)
    dx[1] = 0
    dx[2] = sqrt(2*pi)*x[1]
end

ω₀ = 1
α = -1
γ = 0.1
β = 0.1
prob = SDEProblem(f_fn,σ_fn, [0.01, 0.01], (0.0, 60), [ω₀, α, γ, β])
ensembleprob = EnsembleProblem(prob)
sol = solve(ensembleprob, EnsembleThreads(), trajectories = 100, tspan=(0.0,60), dt=0.01)

```

---

<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: [June 9, 2023, 10:31am UTC](https://discourse.julialang.org/t/why-is-the-solution-length-calculated-using-ensembleproblem-different/100089/2 "2023-06-09T10:31:26Z")

</div>

Because you’re using an adaptive solver, and so it’s adapting the solution based on the new Brownian path for each solution.
