如何在Julia中为RODE实现噪声过程?

huangapple go评论72阅读模式
英文:

How to implement noise processes for RODE in Julia?

问题

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

其中,W[1] 是一个随机复值高斯场,W[2] 是一个实数噪声项。

我认为 RODEProblemSolver 可以解决这样的问题。

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)

我需要先定义 W,因为我不想使用高斯白噪声(默认值)。而且我也找不到 DiffEqNoiseProcess 库中所需的过程。我需要如何正确定义 W?

对于我的第二个问题:
如何存储 W[1] 并让 RODE 为固定的 W[1] 和不同的 W[2] 生成不同的解决方案?

英文:

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]?

答案1

得分: 2

> 我需要如何正确定义 W?

这取决于情况。您可以使用此处描述的 AbstractNoiseProcess 类型之一:

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

例如,如果最佳方式是通过一组值来描述您的噪声,那么请使用 NoiseGrid。或者如果通过函数 f(W,t) 来描述噪声,则可以使用 NoiseFunction。等等。当您有了噪声过程后,只需将它传递给 prob = RODEProblem(f, u0, tspan, p, noise = mynoiseprocess)

> 我对这个问题的第二个问题是:如何存储 W[1] 并让 RODE 生成固定 W[1] 和不同 W[2] 的解决方案?

最简单的方法可能是使用 NoiseFunction,具体取决于如何生成 W[2]。

英文:

> 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.

huangapple
  • 本文由 发表于 2023年7月20日 20:08:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76729689.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定