Skip to content

Instantly share code, notes, and snippets.

View behaeghe's full-sized avatar

JR Behaeghel behaeghe

View GitHub Profile
## Feigenbaum.R
library(compiler) ## requires R >= 2.13.0
logistic.map <- function(r, x, N, M){
## r: bifurcation parameter, x: initial value
## N: number of iterations, M: iterations to be returned
z <- 1:N
z[1] <- x
for(i in c(1:(N-1))){
z[i+1] <- r *z[i] * (1 - z[i])
}