# Geometric Integrators for SDE problems

**URL:** <https://discourse.julialang.org/t/geometric-integrators-for-sde-problems/87961>\
**Category:** Modelling & Simulations\
**Created:** [September 29, 2022, 5:26am UTC](https://discourse.julialang.org/t/geometric-integrators-for-sde-problems/87961 "2022-09-29T05:26:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![simoneb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simoneb/32/43744_2.png) [@simoneb](https://discourse.julialang.org/u/simoneb)\
**Post date:** [September 29, 2022, 5:26am UTC](https://discourse.julialang.org/t/geometric-integrators-for-sde-problems/87961/1 "2022-09-29T05:26:47Z")

</div>

Hi,  
I am trying to figure out how to use an SDE solver for matrix-valued Stochastic Differential Equations. It looks like the packages GeometricIntegrators.jl, and StochasticIntegrators.jl might have the functionality but I don’t understand how to use them. I have been using DifferentialEquations.jl for univariate SDEs with good success but this fails:

```julia
using DifferentialEquations, GeometricIntegratorsDiffEq
prob = SDEProblem(drift, diff, u0, tspan, p=p)
sol = solve(prob,GIEuler())

```

throws this error:

ERROR: Incompatible problem+solver pairing.  
For example, this can occur if an ODE solver is passed with an SDEProblem.  
Solvers are only capable of handling specific problem types. Please double  
check that the chosen pairing is capable for handling the given problems.

Problem type: SDEProblem  
Solver type: GIEuler  
Problem types compatible with the chosen solver: ODEProblem

So is there a way to use Geometric Integrators on SDEs in Julia? If so, could someone share a toy example with the correct syntax?

Thanks,  
Simone.

---

<div class="post-metadata">

**Author:** ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Post date:** [September 29, 2022, 6:38am UTC](https://discourse.julialang.org/t/geometric-integrators-for-sde-problems/87961/2 "2022-09-29T06:38:54Z")

</div>

The solvers from the package are only for ODEs.

But you could use some of these solvers: [SDE Solvers · DifferentialEquations.jl](https://diffeq.sciml.ai/stable/solvers/sde_solve/#Stiff-Methods)  
with the keyword `symplectic=true`.

---

<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:** [September 29, 2022, 6:50am UTC](https://discourse.julialang.org/t/geometric-integrators-for-sde-problems/87961/3 "2022-09-29T06:50:58Z")

</div>

> [@simoneb](#):
>
> Problem type: SDEProblem  
> Solver type: GIEuler  
> Problem types compatible with the chosen solver: ODEProblem
> 
> So is there a way to use Geometric Integrators on SDEs in Julia?

None of those ones are for SDEs, you chose methods for SDEs. As @SteffenPL said, the only geometric integrators in the package are the symplectic form of the midpoint explicit methods. There are many more methods that could be implemented here, but sadly they are not.

---

<div class="post-metadata">

**Author:** ![simoneb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simoneb/32/43744_2.png) [@simoneb](https://discourse.julialang.org/u/simoneb)\
**Post date:** [September 29, 2022, 6:54am UTC](https://discourse.julialang.org/t/geometric-integrators-for-sde-problems/87961/4 "2022-09-29T06:54:33Z")

</div>

OK, thanks! Not sure if the symplectic methods are apporpriate for my problem, but I will definitely explore them. Thanks again for your help and answers.

Simone.
