I have a simple 3-species food chain that I would like to run for 200 steps so the system stabilizes. I would then like to start harvesting and show how populations fluctuate. Is there a way to do this?
The natural/non-harvested system is:
using DifferentialEquations
f = @ode_def_bare Pristine begin
dBB = r*(1- BB/K)BB -xIyIBBI((BB^h/(B0^h + BB^h))/eIB)
dBI = -xIBI + xIyIBBI(BB^h/(B0^h + BB^h))-xT yTIBT*((BI^h/(B0^h + BI^h))/eTI)
dBT = -xTBT + xTyTIBT(BI^h/(B0^h + BI^h))-qBTE
end K r yIB yTI eIB eTI B0 h xI xT q E
u0 = [155.0,107.0,93.0]
tspan = (0.0,1000.0)
p = (700, 1.1, 10, 10, 0.66, 0.85, 80, 1.2, 0.15, 0.06, 0, 0)
prob = ODEProblem(f,u0,tspan,p)
sol=solve(prob,Rosenbrock23())
And it looks like this (sorry at the moment I haven’t figured out how to add a main title to the plots and not for each subplot):
Plot code is
using Plots
plot(sol,xlabel = “Time” ,ylabel = “Density”, title = “Food Chain Pristine”, lw=0.5, layout = (3,1))
Then I would like to start harvesting after 200 steps so q = 0.01 and E = 50 (instead of both 0 in the pristine scenario).
Is this possible?