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] == 0, x'[0] == 0, q[0] == 0,
q'[0] == 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
Experimental`NumericalFunction::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,RandomProcesses`SimulationDump`dt$151646,RandomProcesses`SimulationDump`dw$151646$151647,RandomProcesses`SimulationDump`dw$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.
xx[t], qq[t]
? $\endgroup$