I am trying to solve the equations

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


with the initial conditions $x[0]=0,y[0]=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[1][x][t] == 0, (w^2 + 4 \[Gamma]^2) x[t] + \[Gamma] y[t] + Derivative[1][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 $<B[t]B[t']> = a_0\delta(t-t')$, (i.e. $B[t]$ is white noise) to calculate quantities like $<x[t]x[t']>$. Can that be done directly?

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

2 Answers 2


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:


Mathematica graphics

CovarianceFunction[proc, t′, t]

Mathematica graphics

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]

Mathematica graphics

which you can use for plotting:

Plot3D[Evaluate@cov[[1, 1]], {t, 0, 5}, {t′, 0, 5}, 
 PlotRange -> All]

Mathematica graphics

Finally, you can simulate the dynamics with RandomFunction:

v0 = 1;
sol = RandomFunction[proc, {0, 10, 0.01}];

Mathematica graphics


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[1][y][t] == DiracDelta[t - \[Tau]] /. y -> (x' [#] &), x[0] == 0, x'[0] == 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"

  • $\begingroup$ 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. $\endgroup$ Jul 12, 2019 at 7:31
  • $\begingroup$ 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. $\endgroup$ Jul 12, 2019 at 7:35
  • $\begingroup$ Ok. Would you please explain why you used Dirac Delta in the first equation itself? $\endgroup$ Jul 12, 2019 at 7:38
  • $\begingroup$ 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. $\endgroup$ Jul 12, 2019 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.