Hello,
I have a set of ODEs to model the invasion of a bacterium in presence of phages. I have inserted the invading bacterium at t=1000 using a delay.
function multiInfect!(du, u, p, t)
μ, ν, κ, φ, ψ, ω, β, Β, ρ, τ, η, Η = p
#=
du[1] = resident susceptible
du[2] = resident infected
du[3] = resident phage
du[4] = invader susceptible
du[5] = invader infected
du[6] = invader phage
=#
TOT = u[1]+u[2]+u[4]+u[5]
du[1] = (μ * u[1]) * (1 - TOT/κ) - (φ * u[1] * u[3]) - (ω * u[1])
du[2] = (φ * u[1] * u[3]) - (η * u[2]) - (ω * u[2])
du[3] = (β * η * u[2]) - (ρ * φ * u[1] * u[3]) - (ω * u[3])
du[4] = (ν * u[4]) * (1 - TOT/κ) - (ψ * u[4] * u[6]) - (ω * u[4])
du[5] = (ψ * u[4] * u[6]) - (Η * u[5]) - (ω * u[5])
du[6] = (Β * Η * u[5]) - (ρ * ψ * u[4] * u[6]) - (ω * u[6])
end
# parameters
mu = 0.47 # maximum growth rate susceptible (B. longum)
nu = 0.72 # maximum growth rate resistant (E. coli)
kappa = 2.2*10^7 # maximum population density
phi = 10.0^-9 # adsorption rate
psi = 10.0^-9 # adsorption rate alternative
omega = 0.05 # outflow
eta = 1.0 # lyse rate
Eta = 1.0 # lyse rate alternative
beta = 50.0 # burst size
Beta = 50.0 # burst size alternative
rho = 0.6 # reinfection rate
tau = 3.62 # latency time
tmax = 4000.0 # time span 0-tmax
s0 = 50000.0 # initial susceptible population
i0 = 0.0 # initial infected population
v0 = 80.0 # initial phage population
r_s0 = 50000.0 # initial resident susceptible population
r_i0 = 0.0 # initial resident infected population
r_v0 = 1000.0 # initial resident phage population
i_s0 = 0.0 # initial invader susceptible population
i_i0 = 0.0 # initial invader infected population
i_v0 = 100.0 # initial invader phage populationh
# implement
tspan = (0.0, tmax)
u0 = [r_s0, r_i0, r_v0, i_s0, i_i0, i_v0]
parms = [mu, nu, kappa, phi, psi, omega, beta, Beta, rho, tau, eta, Eta]
# delay infection
condition(u, t, integrator) = t==1000 # time of inoculum
affect!(integrator) = integrator.u[4] += 500 # amount of inoculum
cb = DiscreteCallback(condition,affect!)
# instantiate model
prob = ODEProblem(multiInfect!, u0, tspan, parms)
soln = solve(prob, AutoVern7(Rodas5()), callback=cb, tstops=[1000])
which gives:
Would be possible to add a second delay so that the phage of the invader is activated let’s say at t=2000? What would be the syntax?
Thank you