A <- matrix(c(0, 0.5, 20, 0.3, 0, 0, 0, 0.5, 0.9), nr = 3, byrow = TRUE)
nt <- matrix(c(100, 250, 50), ncol = 1)
years=10
n.projections <- matrix(0, nrow = nrow(A), ncol = years + 1)
n.projections[, 1] <- nt
for (i in 1:years){
n.projections[, i + 1] <- A %*% n.projections[,i]
n.projections[2,] <- 0
}
n.projections
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
## [1,] 100 1125 3400 3060.0 2754.00 2478.600 2230.7400 2007.66600
## [2,] 0 0 0 0.0 0.00 0.000 0.0000 0.00000
## [3,] 50 170 153 137.7 123.93 111.537 100.3833 90.34497
## [,9] [,10] [,11]
## [1,] 1806.89940 1626.20946 1463.58851
## [2,] 0.00000 0.00000 0.00000
## [3,] 81.31047 73.17943 65.86148
## Esta es la gráfica de la matrix si en todas las generaciones eliminamos los adultos pequenos de la poblacion
matplot(0:years, t(n.projections), type = "l", lty = 1:3,col = 1, ylab = "Stage Abundance", xlab = "Year", main = "grafica si en todas las generaciones eliminamos adulto peque?o de la poblacion")
legend("topleft", legend = c("Semillas", "Adulto pequeño", "Adulto grande"),lty = 1:3, col = 1, bty = "n")
