Hello,
I have this model of bacteria and phage interactions:
using DifferentialEquations
function payneJansenODE!(du, u, p, t)
μ , φ, η, β, ω = p
H = h = 0
du[1] = (μ * u[1]) - (φ * u[1] * u[3]) - (H * u[1])
du[2] = (μ * u[2]) + (φ * u[1] * u[3]) - (η * u[2]) - (H * u[2])
du[3] = (η * β * u[2]) - (φ * u[1] * u[3]) - (ω * u[3]) - (h * u[3])
end
mu = 0.5 # growth rate, a
phi = 1e-7 # adsorption rate, b
eta = 5 # lysis rate, k
beta = 100 # burst size, L
omega = 5 # outflow, m
s0 = 1000 # initial susceptible population, x0
i0 = 0.0 # initial infected population, y0
v0 = 0.0 # initial phage population
tϕ = 2.5 # time of inoculum, tφ
vϕ = 1e9 # amount of inoculum, vφ
tmax = 20.0 # duration
u0 = [s0, i0, v0]
parms = [mu, phi, eta, beta, omega]
tspan = (0.0, tmax)
condition(u, t, integrator) = t==tϕ # time of inoculum
affect!(integrator) = integrator.u[3] += vϕ # amount of inoculum
cb = DiscreteCallback(condition, affect!)
prob = ODEProblem(payneJansenODE!, u0, tspan, parms)
soln = solve(prob, AutoVern7(Rodas5()), callback=cb, tstops=[tϕ])
The model works but from the plot (the horizontal line is y=1):
It is possible to force u[1] to zero (which will bring also u[2] = 0) when a condition is reached? (in this case, when u[1] <1).
Thank you