Created
March 18, 2024 15:52
-
-
Save jebyrnes/9572012063599110d3decb68dcc3154e to your computer and use it in GitHub Desktop.
playing with sublinear growth rate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sublinear | |
library(deSolve) | |
# adapted from | |
# https://hankstevens.github.io/Primer-of-Ecology/DDgrowth.html | |
sublinear <- function(t, y, p){ | |
bi <- y[1] | |
dN.dt <- with(as.list(p), | |
r*b0^(1-k)*bi^k - z*bi | |
) | |
return(list( dN.dt )) | |
} | |
p <- c(r = 1, k = 3/4, b0 = 1, z = 0.5) | |
y0 <- c(N=1) | |
tsteps = 0:50 | |
out <- ode(y=y0, times=tsteps, func=sublinear, parms=p) | |
plot(N ~ time, data = out) | |
# equilibrium | |
with(as.list(p), | |
(z/r*b0^(1-k))^(1/(k-1))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment