# Cannot solve coupled stochastic differential equations and how to find correlation of solutions?

I am trying to solve the equations

$$x'[t] = y[t]$$,

$$y'[t]+(w^2+4*\gamma^2)x[t]+\gamma*y[t])=B[t]$$

with the initial conditions $$x=0,y=v_0$$

This is what I have tried.

1. $\[Omega] = Sqrt[w^2 + 4*\[Gamma]^2]$
2. System = {x'[t] - y[t], y'[t] + \[Omega]^2*x[t] + \[Gamma]*y[t]}
3. Dsolve[{x'[t] - y[t] == 0, y'[t] + \[Omega]^2*x[t] + \[Gamma]*y[t] == B[t]}, {x, y}, t]

But Mathematica 11.3 gives output Dsolve[{-y[t] + Derivative[x][t] == 0, (w^2 + 4 \[Gamma]^2) x[t] + \[Gamma] y[t] + Derivative[y][t] == B[t]}, {x, y}, t]

I would like to get expressions of $$x[t]$$,$$y[t]$$ in terms of $$B[t]$$, and later, would like to use the fact that $$ = a_0\delta(t-t')$$, (i.e. $$B[t]$$ is white noise) to calculate quantities like $$$$. Can that be done directly?

• It's DSolve[], not Dsolve[]. But if it's a stochastic DE, then I think you might want a different approach. – Michael E2 Jul 12 '19 at 4:05

As @MichaelE2 alluded to in his comment, DSolve isn't the best approach since you've got that noise term. Instead, take at Mathematica's stochastic differential equation functionality.

In particular, you can set up the system as an ItoProcess:

proc = ItoProcess[{
\[DifferentialD]x[t] == y[t] \[DifferentialD]t,
\[DifferentialD]y[t] == -((w^2 + 4 γ^2) x[t] + γ y[t]) \[DifferentialD]t
+ \[DifferentialD]W[t]},
{x[t], y[t]}, {{x, y}, {0, v0}}, t, W \[Distributed] WienerProcess[0, 1]]


Since it's linear, you can get some analytical results:

Mean[proc[t]] CovarianceFunction[proc, t′, t] That one takes more than a minute to run and is probably not too useful. If you assign some parameter values you get a more compact result:

w = 1; γ = 1;
cov = CovarianceFunction[proc, t′, t] which you can use for plotting:

Plot3D[Evaluate@cov[[1, 1]], {t, 0, 5}, {t′, 0, 5},
PlotRange -> All] Finally, you can simulate the dynamics with RandomFunction:

v0 = 1;
sol = RandomFunction[proc, {0, 10, 0.01}];
ListLinePlot[sol] Perhaps you can solve your problem using Green's Function .

That means, solve your problem with righthandside DiracDelta[t - \[Tau]] instead of B[t] (there is also a build in function GreenFunction ...)

G = DSolveValue[{(w^2 + 4 \[Gamma]^2) x[t] + \[Gamma] y[t] +Derivative[y][t] == DiracDelta[t - \[Tau]] /. y -> (x' [#] &), x == 0, x' == v}, x, t] // Simplify


Knowing G the general solution of your problem is

x[t]=Integrate[G[t] B[\[Tau] ],\[Tau]]


which might further be considered for "white noise"

• Can you please explain what the first command does? What does y -> (x' [#] &) do, and why you used Dirac delta in the first equation itself? The correlation of two noises is a Dirac delta, but the noise itself is probably not a Dirac delta. – Archisman Panigrahi Jul 12 '19 at 7:31
• This command substitutes your first ode into the second to create one ode of second order. Try x'[t] - y[t] == 0 /. y -> (x' [#] &) (*True*)to confirm. – Ulrich Neumann Jul 12 '19 at 7:35
• Ok. Would you please explain why you used Dirac Delta in the first equation itself? – Archisman Panigrahi Jul 12 '19 at 7:38
• Green's function is a method to evalaute the general solution of an ode .Knowing x[t] as an integral you can calculate something like autocorrelation of x[t] to get a relationship with white noise. – Ulrich Neumann Jul 12 '19 at 7:41