# SDE noise term equal to zero

**URL:** <https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816>\
**Category:** New to Julia\
**Tags:** sde\
**Created:** [March 23, 2021, 7:15pm UTC](https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816 "2021-03-23T19:15:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuliaCantisan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliacantisan/32/21402_2.png) [@JuliaCantisan](https://discourse.julialang.org/u/JuliaCantisan)\
**Post date:** [March 23, 2021, 7:15pm UTC](https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816/1 "2021-03-23T19:15:53Z")

</div>

Hi everyone,  
I am dealing with a Stochastic Differential Equation which, in order to solve, I have divided in two:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/c/6c46fdf96f519b6c78ff53395947d6a1625563fd.png)

I was wondering if it is correct to set the noise term equal to zero in the first equation, this is:

```julia
function Helmholtz(du,u,p,t)
d=0.1;
α=6.0;
β=1.0;

du[1] = u[2]
du[2] = -d*u[2]-α*u[1]+β*u[1].^2
end

function σ_Helmholtz(du,u,p,t)
  du[1] = 0.0
  du[2] = 1.0
end

```

I know that matlab has issues with setting the delay=0 when using DDE solvers, I wonder if something similar occurs when setting the noise term=0 with a SDE solver. BTW, I am using the SRIW1() solver.

Thank you in advance for any help.

---

<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:** [March 24, 2021, 1:57am UTC](https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816/2 "2021-03-24T01:57:55Z")

</div>

Yes, this is fine. You can treat it as diagonal noise with only one noise term. Making it scalar noise could be good as well, though maybe a hyperoptimization. Using a solver for additive noise processes would be a good idea here.

---

<div class="post-metadata">

**Author:** ![JuliaCantisan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliacantisan/32/21402_2.png) [@JuliaCantisan](https://discourse.julialang.org/u/JuliaCantisan)\
**Post date:** [March 25, 2021, 9:06am UTC](https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816/5 "2021-03-25T09:06:29Z")

</div>

Thank you for the quick answer. It is interesting what you said about the solver. I’ve tried SOSRA, SRA3 and SRIW1. SRIW1 is by far the fastest of the three…

---

<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:** [March 25, 2021, 12:24pm UTC](https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816/6 "2021-03-25T12:24:42Z")

</div>

Was it more accurate?

---

<div class="post-metadata">

**Author:** ![JuliaCantisan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliacantisan/32/21402_2.png) [@JuliaCantisan](https://discourse.julialang.org/u/JuliaCantisan)\
**Post date:** [March 26, 2021, 11:19am UTC](https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816/7 "2021-03-26T11:19:57Z")

</div>

What I can say is that I was using SRIW1 with reltol=1e-3,abstol=1e-6. SOSRA is too slow for those tolerance values. I tried SOSRA with the default tolerance values (which I assume are less restrictive) and it is very very fast then. I did 10.000 realizations of the process and the average results are quite similar to the ones using SRIW1 with reltol=1e-3,abstol=1e-6.  
I am still working on an analitical solution for the SDE, so I can’t say which one is more accurate yet.

---

<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:** [March 26, 2021, 11:27am UTC](https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816/8 "2021-03-26T11:27:08Z")

</div>

> [@JuliaCantisan](#):
>
> reltol=1e-3,abstol=1e-6

That’s extremely low for strong SDE error. The defaults on SDEs are noted to be 1e-2,1e-2.

---

<div class="post-metadata">

**Author:** ![JuliaCantisan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliacantisan/32/21402_2.png) [@JuliaCantisan](https://discourse.julialang.org/u/JuliaCantisan)\
**Post date:** [March 26, 2021, 12:38pm UTC](https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816/9 "2021-03-26T12:38:04Z")

</div>

Ok, I was reading your paper “_Stability-Optimized High Order Methods and Stiffness Detection for Pathwise Stiff Stochastic Differential Equations_” trying to understand this a little bit better.  
I guess I’m safe using SOSRA with reltol=abstol=1e-2 (which is really fast). And if I ever need a lower tolerance I should use SRA3.

---

<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:** [March 26, 2021, 12:45pm UTC](https://discourse.julialang.org/t/sde-noise-term-equal-to-zero/57816/10 "2021-03-26T12:45:24Z")

</div>

Yes. SOSRA can hit higher tolerances more safely because it has a much larger stability region, but SRA3 has a higher weak convergence rate which can be useful as tolerances decrease.
