/* Simulation of the discrete logistic map. x[i+1] = h*x[i](1.0 - x[i]) Last Modified: August 23, 1999 by Bill Goodwine */ #include #include main(int argc, char *argv[]) { int i,steps; double x,h; char str[255]; FILE *fp; if(argc != 4) { printf("Usage: %s h xinit steps\n",*argv); exit(1); } h = atof(argv[1]); x = atof(argv[2]); steps = atoi(argv[3]); fp = fopen(".store.d","w"); for(i=0;i<=steps;i++) { fprintf(fp,"%f\n",x); x = x*h*(1-x); } fclose(fp); strcpy(&str[0],"gnuplot <