Just now I finished drawing another Logistic equation plot, using incremental factor starting from -2.
Following is R code to perform the drawing, includes the 2 pics before:
iterate = 300Rinit = -2Rrun = RinitRarr = numeric(iterate)step = 0.02testrun = 100arr = array(0,dim=c(iterate,testrun))arr[,1] = 0.1for(i in 1:iterate){ for(j in 2:testrun){ arr[i,j] = Rrun * arr[i,j-1] * (1-arr[i,j-1]) } Rarr[i] = (arr[i,j]+arr[i,j-1])/2 Rrun = Rinit + step*i}matplot(seq(from=Rinit,by=step,length.out=iterate),arr,type="l")
No comments:
Post a Comment