I'm attempting to add noise to a set of ODE's with two state variables. $$\frac{dx}{dt} = 10 -(x-1)\left(1+\frac{exp\left(\frac{x-1}{5y}\right)}{50y}\right)$$ $$\frac{dy}{dt} = 2(1-y) -y\cdot exp\left(\frac{x-1}{5y}\right) $$
The numerical solution for the ODE is below
As u can see around $t=0.4$ there is a sharp drop in $y$ (orange curve) which causes the term $exp(\frac{x-1}{5y})$ to explode, nevertheless NDSolve
handles the integration well.
Before adding the noise, I'm attempting to solve the equations using RandomFunction
without any addition of noise, the result is below
As u can see, this solver does not integrate the solution properly, and the result diverges.
If I reduce $dt$ to be very small it sometimes works out the problem, however, my original problem is far more complex than here, and there is no way that solving with $dt=0.0000001$ or lower can work out (tried that).
I've attempting both ItoProcess
, StratanovichProcess
, all the integration methods and working precision possible of RandomFunction
.
Can anyone please advise on how to handle such a situation with mathematica?
I would like to keep $dt$ reasonably small, or maybe varying such that it is close to $n=0$ it will become small.
I don't see any reason why such a calculation will produce this result, without even having an additive noise.
here is the sample code below
f[x_, y_] := 10 - (x - 1) (1 + Exp[(x - 1)/(5 y)]/(50 y ));
g[x_, y_] := 2 (1 - y) - y Exp[(x - 1)/(5 y)];
sol = NDSolveValue[{x'[t] == f[x[t], y[t]], y'[t] == g[x[t], y[t]],
x[0] == 2.1, y[0] == 0.4}, {x[t], y[t]}, {t, 0, 0.5}];
sol2 = RandomFunction[
ItoProcess[{\[DifferentialD]x[t] ==
f[x[t], y[t]] \[DifferentialD]t, \[DifferentialD]y[t] ==
g[x[t], y[t]] \[DifferentialD]t}, {x[t],
y[t]}, {{x, y}, {2.1, 0.4}}, t,
w \[Distributed] WienerProcess[0, 1]], {0, 0.5, 0.00001}];
Plot[{sol[[1]], sol[[2]]}, {t, 0, 0.5}]
ListLinePlot[sol2, PlotRange -> All]