Newbie in stochastic differential equations

Hello everyone,

I am new to stochastic differential equations, and I don’t understand the formalism of g and dW. I need to solve the differential equation system with the noise which enters in multiple equations and then extract some averages from the solution.

For example, lets consider an example system with a noise \xi(t):
\begin{cases} \dot x = 1 - \xi(t) \\ \dot y = x + \xi(t) \end{cases}
where the noise is white \langle \xi(t) \xi(t') \rangle = \delta(t-t'). How can I formulate the system for DifferentialEquations.jl?

From the solution, I need to extract averages \langle x \rangle (t) and \langle y \rangle (t) as well as average of some arbitrary function \langle f(x,y) \rangle (t). Additionally, I would need an average of functional \langle F([x(t)],[y(t)] ) \rangle. Is it possible to do thoose things with DifferentialEquations.jl?

You might want to take a look at the stochastic differential equation tutorial. Specifically, this one shows how to solve with scalar noise terms:

For your case, you’d do:

function f(du,u,p,t)
  du[1] = 1
  du[2] = u[1]

function g(du,u,p,t)
  du[1] = -1
  du[2] = 1

since du = f*dt + g*dW where we now make W scalar:

W = WienerProcess(0.0,0.0,0.0)
prob = SDEProblem(f,g,u0,(0.0,1.0),noise=W)
sol = solve(prob,SRIW1())

Take a look at this part of the tutorial:

Other documentation on ensemble simulations describes more about generating other averages.

1 Like