# How to Use Real and Complex Noises in One Problem?

**URL:** <https://discourse.julialang.org/t/how-to-use-real-and-complex-noises-in-one-problem/114718>\
**Category:** New to Julia\
**Tags:** question, differentialequation\
**Created:** [May 25, 2024, 12:33pm UTC](https://discourse.julialang.org/t/how-to-use-real-and-complex-noises-in-one-problem/114718 "2024-05-25T12:33:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sepanta-Mssvn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sepanta-mssvn/32/209502_2.png) [@Sepanta-Mssvn](https://discourse.julialang.org/u/Sepanta-Mssvn)\
**Post date:** [May 25, 2024, 12:33pm UTC](https://discourse.julialang.org/t/how-to-use-real-and-complex-noises-in-one-problem/114718/1 "2024-05-25T12:33:19Z")

</div>

I would like to use both real and complex Weiner processes in one problem. For a simple example, suppose we have:

```julia
using DifferentialEquations
function Eq(du,u,p,t)
    du[1] = u[1] + u[2]
    du[2] = 2 * u[1]
end

function Eq_sigma(du, u, p, t)
    du[1] = u[1] + u[2]
    du[2] = u[2]
end 

u_0 = [1.0 + 0.0im, 0.0 + 1.0im]

prob = SDEProblem(Eq, Eq_sigma, u_0, (0, 1))
sol = solve(prob, EM(), dt = 1e-4, saveat = 1e-3)

```

I understand that this results in a diagonal noise dW = [dW\_1,dW\_2] so that:

- du\_1=(u\_1 + u\_2)dt + (u\_1+u\_2)dW\_1
- du\_2=(2u\_1)dt + (u\_2)dW\_2

Now if I want dW\_1 to be a complex Weiner process while dW\_2 is a real Weiner process, how can I go about specifying this? My understanding is that, by default, both noise processes would be complex.

---

<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:** [May 25, 2024, 4:02pm UTC](https://discourse.julialang.org/t/how-to-use-real-and-complex-noises-in-one-problem/114718/2 "2024-05-25T16:02:06Z")

</div>

> [@Sepanta-Mssvn](#):
>
> Now if I want dW\_1dW1dW\_1 to be a complex Weiner process while dW\_2dW2dW\_2 is a real Weiner process, how can I go about specifying this? My understanding is that, by default, both noise processes would be complex.

Yeah currently we don’t have a good way of doing this without defining a custom noise process. You can define custom noise processes though as a way to do this by defining distributions, and you can see how the real and complex noise processes are done for that.
