Corrigé du § 2.3.3.3 : simulation du modèle de Verhulst
Courbe représentative
N0 <- 100
K <- 8000
r0 <- 0.85
# courbe représentative d'une fonction
# x représente ici le temps
curve(K/(1+(K/N0-1)*exp(-r0*x)), from = 0, to = 15, las = 1, main = "Le modèle logistique", xlab = "Temps (h)", ylab= "Population bactérienne (UFC/ml)", ylim = c(0,10000))
abline(h = K/2, lty = 2, col = "red")
legend("topleft", legend = c("Courbe théorique","Point d'inflexion"), lty = c(1,2), col = c(1,2))
text(0,4800, labels = "K/2", col = "red")
# from et to correspondent à l'étendue sur l'axe des x
# l'argument 'las' correspond au sens d'écriture des étiquettes de l'axe vetical.
Variation de \(K\)
N0 <- 100
K <- 9000
r0 <- 0.85
curve(K/(1+(K/N0-1)*exp(-r0*x)), from = 0, to = 15, las = 1, main = "Le modèle logistique : variation de K", xlab = "Temps (h)", ylab = "Population bactérienne (UFC/ml)")
K <- 8000
curve(K/(1+(K/N0-1)*exp(-r0*x)), add = TRUE, col = 2)
K <- 7000
curve(K/(1+(K/N0-1)*exp(-r0*x)), add = TRUE, col = 3)
K <- 6000
curve(K/(1+(K/N0-1)*exp(-r0*x)), add = TRUE, col = 4)
legend("bottomright", legend = c("K = 9000","K = 8000","K = 7000","K = 6000"), col = c(1,2,3,4), lty = 1, bty = "n")
Variation de \(r_0\)
N0 <- 100; K <- 9000; r0 <- 0.85
curve(K/(1+(K/N0-1)*exp(-r0*x)), from = 0, to = 15, las = 1, main = "Le modèle logistique : variation de r0", xlab = "Temps (h)", ylab = "Population bactérienne (UFC/ml)")
r0 = 3
curve(K/(1+(K/N0-1)*exp(-r0*x)), add = TRUE, col = 2)
r0 = 1
curve(K/(1+(K/N0-1)*exp(-r0*x)), add = TRUE, col = 3)
r0 = 0.5
curve(K/(1+(K/N0-1)*exp(-r0*x)), add = TRUE, col = 4)
legend("bottomright", legend = c("r0 = 3","r0 = 1","r0 = 0.85","r0 = 0.5"), col = c(2,3,1,4), lty = 1, bty = "n")
Variation de \(N_0\)
N0 <- 100; K <- 9000; r0 <- 0.85
curve(K/(1+(K/N0-1)*exp(-r0*x)), ylim = c(0, 10000),from = 0, to = 15, las = 1, main = "Le modèle logistique : variation de N0", xlab = "Temps (h)", ylab = "Population bactérienne (UFC/ml)")
N0 = 3000
curve(K/(1+(K/N0-1)*exp(-r0*x)), add = TRUE, col = 2)
N0 = 5000
curve(K/(1+(K/N0-1)*exp(-r0*x)), add = TRUE, col = 3)
N0 = 10000
curve(K/(1+(K/N0-1)*exp(-r0*x)), add = TRUE, col = 4)
legend("bottomright", legend = c("N0 = 10000","N0 = 5000","N0 = 3000","N0 = 100"), col = c(4,3,2,1), lty = 1, bty = "n")
Représentation de données simulées
data <- read.table("logistique.txt", header = TRUE)
plot(data$Temps, data$Nbcol, xlim = c(0,25), ylim = c(0,max(data$N)), pch = 4, las = 1, main = "Croissance d'E. coli 25°C", xlab = "Temps (h)", ylab = "Population bactérienne (UFC/ml)", col = "green")
K = 9000;N0 = 100;r0 = 0.85
curve(K/(1+(K/N0-1)*exp(-r0*x)), ylim = c(0, 10000),from = 0, to = 25, las = 1, add = T)
legend("bottomright", legend = c("Modèle théorique", "Données simulées"), lty = c(1,NA), pch = c(NA,4), bty = "n", col = c("black","green"))
Corrigé du § 2.3.3.4 : portrait de phase du modèle de Verhulst
par(mar = c(0,0,0,0))
plot(0,0, xlim = c(-1,1), ylim = c(-0.25,0.25), xaxt = "n", yaxt = "n", xlab = "", ylab = "", bty = "n")
text(1,0.1, labels = expression(N(t)))
arrows(-1,0,1,0)
points(c(-1,0), c(0,0), pch = 19)
text(c(-1,0), c(-0.1,-0.1), labels = c("0","K"))
arrows(-0.6,0,-0.5,0, length = 0.1, col = "red", lwd = 2)
arrows(0.6,0,0.5,0, length = 0.1, col = "red", lwd = 2)