juliadifferential-equationsnoise

How to implement noise processes for RODE in Julia?


I'm trying to implement a RODE in Julia:

du/dt = [W[1] + W[2]]*u(t)

where W[1] is a random compex valued Gaussian field and W[2] is a real noise term.

I think the RODEProblemsolver can solve such problems

function f(du, u, p, t, W)
    du .= u * (W[1] + W[2])
end

prob = RODEProblem(f, u0, tspan, p)
sol = solve(prob, RandomEM(), dt = dt )

I have to define W first, because I do not want Gaussian white noise (default). I also cannot find the desired process in the DiffEqNoiseProcess library. What do I need to define W propertly?

My second question for the problem: How can I store W[1] and let RODE generate different solutions for fixed W[1] and varying W[2]?


Solution

  • What do I need to define W properly?

    It depends. You can use one of the AbstractNoiseProcess types described here:

    https://docs.sciml.ai/DiffEqNoiseProcess/stable/abstract_noise_processes/

    For example, if the best way to describe your noise is by a grid of values, then use NoiseGrid. Or with a function f(W,t) then use NoiseFunction. Etc. And when you have the noise process, just pass it in prob = RODEProblem(f, u0, tspan, p, noise = mynoiseprocess)

    My second question for the problem: How can I store W[1] and let RODE generate different solutions for fixed W[1] and varying W[2]?

    Easiest way to do this might be with NoiseFunction, depending on the way W[2] is generated.