Hello,
I wrote a differential equation set as follows:
function seir!(du, u, p, t)
trans_rate, infect_rate, recovery_rate = p
λ = trans_rate * u[3] # force of infection βI
κ1 = λ * u[1] # λS
κ2 = infect_rate * u[2] # fE
κ3 = recovery_rate * u[3] # rI
#=
du[1] = susceptible (s)
du[2] = exposed (i)
du[3] = infected (r)
du[4] = recovered (d)
=#
du[1] = u[1] - κ1
du[2] = u[2] + κ1 - κ2
du[3] = u[3] + κ2 - κ3
du[4] = u[4] + κ3
end
# set parameters
β = 0.00001 # transmission rate
f = 0.5 # incibation time
r = 0.5 # illness time
N = 100000.0 # total population
s0 = N - 1 # initial population susceptible
e0 = 1 # initial population infected
i0 = 0 # initial population recovered
r0 = 0 # initial population deceased
tmax = 200 # time span 0-tmax
# set solver
u0 = [s0, e0, i0, r0] # initial population
p = [β, k, r, N] # parameters
tspan = (0.0, tmax) # time span
prob = ODEProblem(seir!, u0, tspan, p)
soln = solve(prob, Tsit5())
But when I launched it I got en error after the 20th cycle:
Warning: Interrupted. Larger maxiters is needed.
└ @ DiffEqBase ~/.julia/packages/DiffEqBase/KnYSY/src/integrator_interface.jl:329
How can I manage maxiters
?
Besides, since I could run similar equations with parameters in the order of 10^6 instead of 10^5, I think that must be something funny in the numbers: maybe the way they are formatted could affect solve
? Should I remove the u[j]
elements?