I’ve been solving this equation for a lot of different parameters, but suddenly I am getting occasional
┌ Warning: Interrupted. Larger maxiters is needed.
└ @ DiffEqBase /home/torkelloman/.julia/packages/DiffEqBase/V7P18/src/integrator_interface.jl:329
for certain inputs. See this example:
using StochasticDiffEq
function sys_f(du,u,p,t)
σ,A = u
S,D,τ,v0,n,η = p
du[1] = v0+(S*σ)^n/((S*σ)^n+(D*A)^n+1) - σ
du[2] = τ*(σ-A)
end
function sys_g(du,u,p,t)
σ,A = u
S,D,τ,v0,n,η = p
du[1,1] = η*sqrt(max(v0+(S*σ)^n/((S*σ)^n+(D*A)^n+1),0.))
du[1,2] = -η*sqrt(max(σ,0.))
du[1,3] = 0
du[1,4] = 0
du[2,1] = 0
du[2,2] = 0
du[2,3] = η*sqrt(max(τ*σ,0.))
du[2,4] = -η*sqrt(max(τ*A,0.))
end
u0 = [0.025, 0.025]
tspan = (0.,200.)
p = [28.48035868435802, 0.2527461586781728, 0.05, 0.025, 3.0, 0.1]
sde_prob = SDEProblem(sys_f,sys_g,u0,tspan,p,noise_rate_prototype=zeros(2,4));
sol = solve(sde_prob,ImplicitEM(),seed=4963697075065472807);
Solving without this seed, things are mostly fine:
for repeat = 1:1000
sol = solve(sde_prob,ImplicitEM())
end
yields maybe only 1 such error per run.
Even increasing maxiters a bit, I receive no benefit:
sol = solve(sde_prob,ImplicitEM(),seed=4963697075065472807,maxiters=10000000);
still errors. Finally, I am attaching an image of bad/good simulation.
This is the output of Pkg.status()
[717857b8] DSP v0.6.8
[0c46a032] DifferentialEquations v6.15.0
[5ab0869b] KernelDensity v0.6.1
[91a5bcdd] Plots v1.6.8
[f27b6e38] Polynomials v1.1.10
[10745b16] Statistics