# ItoProcess and/or RandomFunction numerical failure for coupled SDEs

I'm trying to simulate a physical system including noise using the ItoProcess command, the system is governed by two coupled differential equations. The potential is

pot = 1/2k(x[t]-v t)^2+(c1+c2 q[t]^2)(1-Cos[2Pi(x[t]-c4 q[t])/a])+ c3 q[t]^4;


The resulting coupled system is

s =
NDSolve[{-mx x''[t] - D[pot, x[t]] - mx nx (x'[t]) == 0, -mq q''[t] -
D[pot, q[t]] - mq nq (q'[t]) == 0, x == 0, x' == 0, q == 0,
q' == 0}, {x[t], q[t]}, {t, 0, tmax}];


which is readily solved by NDSolve. However, adding noise to the system, it is transformed into a system of coupled stochastic differential equations, and we need(?) to use an Ito Process in order to simulate it in Mathematica.

The corresponding Ito Process is

s =
ItoProcess[{
\[DifferentialD]x[t] == \[DifferentialD]t xx[t],
\[DifferentialD]q[t] == \[DifferentialD]t qq[t],
\[DifferentialD]xx[t] == \[DifferentialD]t/(-mx) (D[pot, x[t]]
+ mx nx (xx[t])) + \[DifferentialD]xnoise,
\[DifferentialD]qq[t] == \[DifferentialD]t/(-mq) (D[pot, q[t]]
+ mq nq (qq[t])) + \[DifferentialD]qnoise},
{x[t], xx[t], q[t], qq[t]}, {{x, xx, q, qq}, {0, 0, 0, 0}},
{t, 0}, {xnoise \[Distributed] WienerProcess[0, 1*^-7],
qnoise \[Distributed] WienerProcess[0, 1*^-8]}]

randsamp = RandomFunction[s, {0, 5*^-9, 1*^-11}]


However, when I run the above command I get the errors

General::ovfl: Overflow occurred in computation.

and

ExperimentalNumericalFunction::nlnum: The function value {4.203331994982121*10^537,Overflow[],-4.353127001287732*10^1169869785968746,Overflow[]} is not a list of numbers with dimensions {4} at {t,x,xx,q,qq,RandomProcessesSimulationDumpdt$151646,RandomProcessesSimulationDumpdw$151646$151647,RandomProcessesSimulationDumpdw$151646\$151648} = {6.8*10^-10,2.143699317440867*10^539,4.203331994982092*10^548,-5.344814277012275*10^694021436388771,-4.353127001287702*10^1169869785968757,1.*10^-11,-0.329753,-0.163157}.


For reference, the parameter values used are

k = 1.0*^0;
v = 1*^0;
c1 = 1.3*^-20;
c2 = 0.2*^0;
c3 = 8*^18;
c4 = 1*^0;
a = 2.5*^-10;
mx = 1*^-23;
mq = 5*^-22;
nx = 3*^12;
nq = 3*^12;
h = 1*^-15;
tmax = 5000000 h;


and the x[t] solution should look like I fail to see why such humongous numbers should appear. Especially, since everything seems fine when using NDSolve. I've tried removing the noise part by multiplying the xnoise and qnoise by 0, that doesn't work. My best guess is that the problem has to do with the exponents of the parameters being very far apart. Still, they work fine for NDSolve, and increasing WorkingPrecision does not solve the issue.

• Just a marginal comment: why do you need the copies xx[t], qq[t] ? Feb 8, 2018 at 13:58
• I'm not quite sure that I understand the question, or rather what you mean by "copies"? xx[t] and qq[t] is x'[t] and q'[t] in Ito notation, which are physically interesting variables, is that an answer to your question? Feb 8, 2018 at 15:51
• Yes, my misunderstanding, thanks. Feb 8, 2018 at 18:36

From your ODE solution, it looks like there are brief bursts when x changes rapidly. This suggests a simple solution: make your step size much smaller.

s = ItoProcess[{
\[DifferentialD]x[t] == \[DifferentialD]t xx[t],
\[DifferentialD]q[t] == \[DifferentialD]t qq[t],
\[DifferentialD]xx[t] == \[DifferentialD]t (-D[pot, x[t]]/mx - nx xx[t]) + \[DifferentialD]xnoise[t],
\[DifferentialD]qq[t] == \[DifferentialD]t (-D[pot, q[t]]/mq - nq qq[t]) + \[DifferentialD]qnoise[t]},
{x[t], xx[t], q[t], qq[t]}, {{x, xx, q, qq}, {0, 0, 0, 0}}, t,
{xnoise \[Distributed] WienerProcess[0, 10^6],
qnoise \[Distributed] WienerProcess[0, 10^6]}];

randsamp = RandomFunction[s, {0, 5*^-9, 1*^-13}];

ListPlot[randsamp["PathComponent", 1]] (* x[t] vs t *)
ListPlot[randsamp["PathComponent", 2], PlotRange -> All] (* xx[t] vs t *)
`  Note that I had to really crank up the noise amplitude to even see any effect of noise.

• Well, that's a bit anti-climatically simple, and here I thought I had come up with some involved stuff, haha! The noise being so significantly increased is a bit weird to me at this moment, but I'll look into that... Feb 7, 2018 at 23:34
• I'm not an expert in this area, but I suspect the need for large noise is because your time of integration is so short. Feb 8, 2018 at 0:08