# Wiener Process Sampling

**URL:** <https://discourse.julialang.org/t/wiener-process-sampling/135498>\
**Category:** General Usage\
**Tags:** sde\
**Created:** [February 6, 2026, 11:25am UTC](https://discourse.julialang.org/t/wiener-process-sampling/135498 "2026-02-06T11:25:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![diffeqslvr](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@diffeqslvr](https://discourse.julialang.org/u/diffeqslvr)\
**Post date:** [February 6, 2026, 11:25am UTC](https://discourse.julialang.org/t/wiener-process-sampling/135498/1 "2026-02-06T11:25:30Z")

</div>

As a sanity check, I try to simulate a pure Wiener process `du = D dW`. However, when I plot the variable, it does not look like a random walk; rather, the curves follows line segments:

 ![Screenshot 2026-02-06 at 12.23.07](https://global.discourse-cdn.com/julialang/original/3X/f/f/ffd8dc85ad1da533fe158b310036721dc1e3b160.png)

Is that because I am doing something wrong or because the Wiener process is not sampled at every time step since it is scale invariant? If so, how does the solver decide when to sample?

My code:

```julia-auto
import StochasticDiffEq as SDE
D = 1
u₀ = 0
f(u, p, t) = 0
g(u, p, t) = D
tspan = (0.0, 10.0)
prob = SDE.SDEProblem(f, g, u₀, tspan)

sol = SDE.solve(prob, SDE.SRIW1(), abstol = 1e-3, reltol = 1e-3, saveat = 1e-4);

```

---

<div class="post-metadata">

**Author:** ![drandran12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drandran12/32/220647_2.png) [@drandran12](https://discourse.julialang.org/u/drandran12)\
**Post date:** [February 6, 2026, 1:49pm UTC](https://discourse.julialang.org/t/wiener-process-sampling/135498/2 "2026-02-06T13:49:04Z")

</div>

I remember hitting this once too. I think it is indeed the adaptive stepsize controllor. Can you try using a fixed stepsize using `dt` kwarg.

---

<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:** [February 6, 2026, 3:06pm UTC](https://discourse.julialang.org/t/wiener-process-sampling/135498/3 "2026-02-06T15:06:09Z")

</div>

Yeah use a smaller tolerance for fixed time steps if you want the picture you’re looking for. It’s a property of adaptivity + high tolerance.
