# Solving same DiffEq repeatedly but with different initial conditions

**URL:** <https://discourse.julialang.org/t/solving-same-diffeq-repeatedly-but-with-different-initial-conditions/49402>\
**Category:** Performance\
**Tags:** diffeq\
**Created:** [November 1, 2020, 7:34am UTC](https://discourse.julialang.org/t/solving-same-diffeq-repeatedly-but-with-different-initial-conditions/49402 "2020-11-01T07:34:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [November 1, 2020, 10:59am UTC](https://discourse.julialang.org/t/solving-same-diffeq-repeatedly-but-with-different-initial-conditions/49402/2 "2020-11-01T10:59:17Z")

</div>

> [@ash](#):
>
> Currently I just do this in a loop. I’m sure there’s a smarter way but I haven’t quite found it in the documentation yet. This is very inefficient of course since I need to keep setting up the problem again every time.

You can use the integrator interface with `reinit`.

[https://diffeq.sciml.ai/stable/basics/integrator/](https://diffeq.sciml.ai/stable/basics/integrator/)

Or you can use the ensemble interface to auto-parallelize it.

[https://diffeq.sciml.ai/stable/features/ensemble/](https://diffeq.sciml.ai/stable/features/ensemble/)

This includes automated GPU parallelism with DiffEqGPU.jl

> **[GitHub - SciML/DiffEqGPU.jl: GPU-acceleration routines for...](https://github.com/SciML/DiffEqGPU.jl)**
>
> GPU-acceleration routines for DifferentialEquations.jl and the broader SciML scientific machine learning ecosystem

---

_[View the full topic](https://discourse.julialang.org/t/solving-same-diffeq-repeatedly-but-with-different-initial-conditions/49402)._
