Created
October 31, 2010 21:27
-
-
Save alexg228/657173 to your computer and use it in GitHub Desktop.
should create a bifurcation diagram...but you know doesnt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
FILE *fp ; | |
int i ; | |
double r = 2.5 ; | |
double x[20000] ; | |
fp = fopen("logisticmap2.txt","w") ; | |
/* Initial condition */ | |
x[0] = 0.5 ; | |
i = 0 ; | |
/* Program -------------------------------------- */ | |
while ( r<= 4) | |
{ | |
for (i=0; i< 1500; i++) | |
{ | |
x[i+1] = r * x[i] * (1.0 - x[i]) ; | |
if (i> 500) | |
{ | |
fprintf(fp,"%4d %6.3lf %6.3lf\n", r, x[i]); | |
} | |
} | |
r=r+.02; | |
} | |
fclose(fp) ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment