Skip to content

Instantly share code, notes, and snippets.

@alexg228
Created October 31, 2010 21:27
Show Gist options
  • Save alexg228/657173 to your computer and use it in GitHub Desktop.
Save alexg228/657173 to your computer and use it in GitHub Desktop.
should create a bifurcation diagram...but you know doesnt
{
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