Dear all,
I have a stiff system of >100 equations (which I’m not allowed to post anywhere at the moment). I tried
solve(my_prob, Rodas5(autodiff=false),reltol=1e-8,abstol=1e-8,saveat=1.0) # let's call it method1
and
solve(my_prob, Rodas5(autodiff=false),reltol=1e-8,abstol=1e-8,saveat=1.0, dt=1e-5, adaptive=true ) # let's call it method 2
where
my_prob= ODEProblem(my_system!,u0,tspan_m,param)
In the very beginning I set
import Random;
Random.seed!(1234);
However, when I run simulation multiple times with the same initial conditions and same parameter sets, I get different output in a sense that sometimes I get the following errors:
- For method 1:
┌ Warning: Automatic dt set the starting dt as NaN, causing instability.
└ @ OrdinaryDiffEq /Users/polina/.julia/packages/OrdinaryDiffEq/LQQYm/src/solve.jl:456
┌ Warning: NaN dt detected. Likely a NaN value in the state, parameters, or derivative value caused this outcome.
└ @ DiffEqBase /Users/polina/.julia/packages/DiffEqBase/TjqaN/src/integrator_interface.jl:323
and
┌ Warning: Instability detected. Aborting
└ @ DiffEqBase /Users/polina/.julia/packages/DiffEqBase/TjqaN/src/integrator_interface.jl:349
- For method 2:
┌ Warning: Instability detected. Aborting
└ @ DiffEqBase /Users/polina/.julia/packages/DiffEqBase/TjqaN/src/integrator_interface.jl:349
Here is an example of how I found that:
du = similar(u0);
for i in 1:20
param = append!(param_sets[10,1:11],fixedForNowParam[1])
tspan_m = (0.0,1200.0)
my_prob = ODEProblem(my_system!,u0,tspan_m,param)
sol_m = solve(my_prob, Rodas5(autodiff=false),reltol=1e-8,abstol=1e-8,saveat=1.0, dt=1e-5, adaptive=true )
print(i)
end
I understand that my question may be not descriptive enough without the “my_system” defined here, but maybe someone encountered similar problem and knows where can I find info to understand why it happens. I am wondering may it be related to adaptive time step or some other parameters of Rodas5? Several other methods that I tried weren’t really efficient on my system.
Thank you very much for the help and insights!
Status ~/.julia/environments/v1.4/Project.toml
[6e4b80f9] BenchmarkTools v0.5.0
[31c91b34] DiffEqBenchmarks v0.1.0 #master (https://github.com/JuliaDiffEq/DiffEqBenchmarks.jl)
[f3b72e0c] DiffEqDevTools v2.21.0
[aae7a2af] DiffEqFlux v1.12.0
[1130ab10] DiffEqParamEstim v1.13.0
[41bf760c] DiffEqSensitivity v6.10.0
[ef61062a] DiffEqUncertainty v1.4.1
[0c46a032] DifferentialEquations v6.14.0
[31c24e10] Distributions v0.22.6
[587475ba] Flux v0.10.4
[7073ff75] IJulia v1.21.1
[7f56f5a3] LSODA v0.6.1
[c030b06c] ODE v2.8.0
[54ca160b] ODEInterface v0.4.6
[09606e27] ODEInterfaceDiffEq v3.7.0
[429524aa] Optim v0.20.1
[1dea7af3] OrdinaryDiffEq v5.39.1
[65888b18] ParameterizedFunctions v5.0.3
[91a5bcdd] Plots v0.29.9
[90137ffa] StaticArrays v0.12.1
[4c63d2b9] StatsFuns v0.9.5
[c3572dad] Sundials v3.9.0
[44d3d7a6] Weave v0.9.4
[0518478a] deSolveDiffEq v0.1.0