Open sfogarty opened 1 year ago
removed
Look at the use of the image function, as seen in simbains and sim-map-period
library(dsmodels)
model <- dsmodel(function(X0,Y0) {
list(X0*exp(2.6-X0-6.45/(1+4.5*X0)),
Y0*exp(2.6-Y0-0.15*X0-6.25/(1+4.5*Y0)))
})
model+dsrange(0:3,0:3,discretize =.08)
#model+simattractors(col=c("red","blue","green","purple"))
#model+simbasins(iters = 3, missingCol = "white")
grid <- model$range$centers(discretize=.08,xlim=model$xlim, ylim=model$ylim)
colsMap <- mapply(function(X,Y) {if (X < Y) {1} else {2}}, grid$X0, grid$Y0)
colMatrix <- matrix(unlist(colsMap), nrow=length(grid$x))
image(grid$x, grid$y, colMatrix, col=c("blue","red"),add=TRUE)
simbasins defines colmaps with:
colsMap <- mapply(findFixedPoint, self$grid$X0, self$grid$Y0, MoreArgs=list(model=model, points=self$fps, tolerance=self$tolerance, eps=self$epsilon, stride=self$stride))