home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / include / main_kaos_init.h < prev    next >
Encoding:
Text File  |  1990-01-31  |  30.1 KB  |  554 lines

  1. /*
  2. ***************************************************************************
  3.             Kaos main global variables
  4.  
  5.         Swan Kim and John Guckenheimer, POSTECH & Cornell U. 11/1/89
  6.  
  7. ***************************************************************************
  8.     Initialized variables are almost always customizable to
  9.     change defaults.
  10.     All path names and the printer name need to be changed to reflect
  11.     the local environments.
  12.     (This is automaically taken care of the shell script "kaos_install")
  13. ****************************************************************************
  14. */
  15.  
  16. /*--------------------------------------------------------------------------
  17.     Initialization of sytsem labels (do not touch)
  18. ---------------------------------------------------------------------------*/
  19. char tmp[20]="";    /* temporary label */
  20. char base_frame_label[80] = "kaos - Swan Kim & John Guckenheimer - phase space";    /* Base frame label */
  21. char startup_message[200] = "kaos written by Swan Kim & John Guckenheimer, POSTECH and Cornell U, pre alpha release 1.0 1/1990. All Copyrights Reserved.";    /* startup message */
  22.  
  23. /*-------------------------------------------------------------------------
  24.     pathname initializations (local environment dependent)
  25. ---------------------------------------------------------------------------*/
  26. char source_dir[MAX_LENGTH] = "/marcy/kim/kaos"; /* source directory (used to locate the source code */
  27. char help_dir[MAX_LENGTH] = "/marcy/kim/kaos/helplib"; /* help file directory (used to locate the source code */
  28. char graph_label[MAX_LENGTH] = "/marcy/kim/kaos/bin/kgraph";    /* a local graphic filter (modification of UNIX graph) */
  29. char raster_label[MAX_LENGTH] = "/marcy/kim/kaos/bin/psraster -i"; /* a raster to postscript fileter */
  30. char lpr_label[MAX_LENGTH] = "lpr -h -Plaser"; /* a line printer filter (lpr -Pprinter_name) */
  31. char dir_name[MAX_LENGTH] = "/marcy/kim/kaos/examples"; /* directory where files for saving and loading  resides */
  32. char colormap_dir_name[MAX_LENGTH] = "/marcy/kim/kaos/cmaplib"; /* directory where colormap files are stored */
  33. char preproc_label[MAX_LENGTH] = "/marcy/kim/kaos/bin/kpic X 2 3"; /* a preprocessor which ouputs two column data from multicolumn input */
  34. char batch_name[] = "/marcy/kim/kaos/kaos_batch"; /* a batch executable to be executed when a job is batched */
  35. char file_name[MAX_LENGTH] = "tmp.dat"; /* file for saving and loading */
  36. char tmp_name[MAX_LENGTH] = "tmp.dat"; /* temporary file */
  37.  
  38. /*------------------------------------------------------------------------
  39.     font file names of various sizes (local environment dependent)
  40.  *-------------------------------------------------------------------------*/
  41. char font_file24[] = "/usr/lib/fonts/fixedwidthfonts/screen.b.16";
  42. char font_file12[] = "/usr/lib/fonts/fixedwidthfonts/screen.b.12";
  43. char font_file10[] = "/usr/lib/fonts/fixedwidthfonts/cour.b.10";
  44.  
  45. /*-------------------------------------------------------------------------
  46.     Window configuration (customizable)
  47.  -------------------------------------------------------------------------
  48.     Full screen size: xwindow = 1152, ywindow = 900
  49.     All drawing operations are done in my coordinates (bottom-left
  50.     origin) and converted to Sun coordinates. (Top-left origin)
  51.  *-------------------------------------------------------------------------*/
  52. int xwindow = 650; int ywindow = 800;    /* base window width and height */
  53. int xcanvas; int ycanvas;    /* phase space (base) canvas width and height */
  54. int xwidth; int ywidth;    /* phase space box width and height */ 
  55. int l_margin = 10; int b_margin = 20;    /* phase space box left and bottom margin */
  56. int margin = 30; int margin_small = 10;    /* general purpose large and small
  57. margins */
  58. int colormap_height = 13; int colormap_width = 9; /* height and width of the colormap squares in a colormap strip displayed in the canvas */
  59. int colormap_spacing= 8;/* spacing between the colormap strips */
  60. int colormap_max_bands = 64; /* maximal number of colormap squares in a single strip */
  61. int y_message=0;    /* top-left y coord for system messages */
  62. int y_line_height = 14; /* height of each system message line */
  63. int y_title_label=70;    /* top-left y coord for a title label */
  64. int p_xwindow = 420; int p_ywindow = 420; /* width and height of the parameter space window */
  65. int p_xwidth; int p_ywidth; /* width and height of the parameter space box */
  66. int p_xcanvas; int p_ycanvas; /* width and height of the parameter space canvas */
  67. int p_l_margin=10; int p_b_margin=20; /* left and bottom margins of the parameter space box */
  68.  
  69. /*-------------------------------------------------------------------------
  70.     colormap file names (customizable)
  71.     (they resides in the colormap directory specified by colormap_dir[].
  72.     Colormaps are read by load_colormap())
  73. -------------------------------------------------------------------------*/
  74. /* White background */
  75. char colormap_fname0[] = "cmap.x11r2.128";
  76. char colormap_fname1[] = "cmap.depth.128";
  77. char colormap_fname2[] = "cmap.nldepth.128";
  78. char colormap_fname3[] = "cmap.alternating.128";
  79. char colormap_fnameu[] = "cmap.user.128";
  80. /* Black background */
  81. char colormap_fname0i[] = "cmap.x11r2.128.i";
  82. char colormap_fname1i[] = "cmap.depth.128.i";
  83. char colormap_fname2i[] = "cmap.nldepth.128.i";
  84. char colormap_fname3i[] = "cmap.alternating.128.i";
  85. char colormap_fnameui[] = "cmap.user.128.i";
  86.  
  87. /*-------------------------------------------------------------------------
  88.     global variables for colormap (customizable)
  89.  *-------------------------------------------------------------------------*/
  90. int my_colormap_size = MY_COLORMAP_SIZE;    /* total size of my colormap */
  91. int var_colormap_size = VAR_COLORMAP_SIZE;    /* size of variable colormap */
  92. unsigned char red[MY_COLORMAP_SIZE];    /* red intensity */
  93. unsigned char green[MY_COLORMAP_SIZE];    /* green intensity */
  94. unsigned char blue[MY_COLORMAP_SIZE];    /* blue intensity */
  95. int bt_color = Orange;    /* color for backward transient orbits */    
  96. int b_color = Red;    /* color for backward aymptotic orbits */
  97. int ft_color = Green;    /* color for forward transient orbits */
  98. int f_color = Blue;    /* color for forward asymptotic orbits */
  99. int default_color = Black;    /* color chosen by default when it is not clear to which case orbits belong*/ 
  100. int panel_colormap_on = 1;    /* turn on and off colormaps of panels */
  101.  
  102. /*-------------------------------------------------------------------------
  103.     main data variables
  104. ---------------------------------------------------------------------------
  105.     data0_* = parameter space data
  106.     data1_* = phase space data
  107.     data2_* = combined space data
  108.     fp_* = periodic orbit data
  109. -------------------------------------------------------------------------*/
  110. int *data0_color,*data1_color,*data2_color;    /* color indices */
  111. double **data0_x,**data1_x,**data2_x;        /* coordinates */
  112.  
  113. int *fp_period;    /* period of a periodic orbit */
  114. double **fp_x;    /* coordinate of a single member of a periodic orbit */
  115. double ***fp_eval;    /* eigenvalues of a periodic orbit */
  116. double ***fp_evec;    /* eigenvectors of a periodic orbit */
  117. double *fp_xerr;    /* error estimate of a periodic orbit */
  118.  
  119. /*-------------------------------------------------------------------------
  120.     memory allocation dimensions for main data (customizable)
  121. -------------------------------------------------------------------------*/
  122. int mdim0_init = 500;    /* initial memory allocation dimension for data0 */
  123. int mdim0_crit = 5000;    /* critical memory allocation dimension for data0 */
  124. int mdim0_step = 2000;    /* incremental memory allocation dimension for data0 */
  125. int mdim1_init = 20000;    /* initial memory allocation dimension for data1 */
  126. int mdim1_crit = 50000;    /* critical memory allocation dimension for data1 */
  127. int mdim1_step = 20000;    /* incremental memory allocation dimension for data1 */
  128. int mdim2_init = 1000;    /* initial memory allocation dimension for data2 */
  129. int mdim2_crit = 2000;    /* critical memory allocation dimension for data2 */
  130. int mdim2_step = 1000;    /* incremental memory allocation dimension for data2 */
  131. int mdim_fp_init = 100;    /* initial memory allocation dimension for data_fp */
  132. int mdim_fp_crit = 500;    /* critical memory allocation dimension for data_fp */
  133. int mdim_fp_step = 100;    /* incremental memory allocation dimension for data_fp*/
  134. int mdim0;    /* current memory allocation dimension for data0 */
  135. int mdim1;    /* current memory allocation dimension for data1 */
  136. int mdim2;    /* current memory allocation dimension for data2 */
  137. int mdim_fp;    /* current memory allocation dimension for data_fp */
  138.  
  139. /*-------------------------------------------------------------------------
  140.     major variables defining individual dynamical systems
  141. ---------------------------------------------------------------------------*/
  142. int var_dim;    /* dimension of phase space */
  143. int func_dim;    /* dimension of function space */
  144. int param_dim;    /* dimension of parameter space */
  145. int full_dim;    /* dimension of full space (phase space + (function space)) */
  146. char *title_label;    /* title label of a dynamical system */
  147. char *model_label;    /* id label of the model */
  148. int mapping_on;        /* 1: mapping, 0: vector field */
  149. int inverse_on;        /* 1: explicit inverse exist, 0: otherwise */  
  150. int fderiv_on;        /* 1: explicit jacobian exist, 0: otherwise */
  151. int enable_polar;    /* 1: use secondary coords, 0: otherwise */
  152. int enable_period;    /* 1: enable periodicity, 0: otherwise */
  153. char **var_label;    /* label for primary phase space variables */
  154. char **var_polar_label;    /* label for secondary phase space variables */
  155. char **param_label;    /* label for parameters */
  156. char **func_label;    /* label for functions */
  157. char **all_label;    /* label for combined space data */
  158.  
  159. double *param;    /* parameters of the dynamical system */
  160. double *param_min,*param_max;    /* lower and upper bounds of the parameter space box */
  161. double *var_i,*var_polar_i;    /* initial starting values of primary and secondary phase space variables */
  162. double var_min,*var_max;    /* lower and upper bounds of primary phase space variables */
  163. double *var_polar_min,*var_polar_max; /* lower and upper bounds of secondary
  164. phase space variables */
  165. double *func;    /* function values */
  166. double *func_min,*func_max;    /* lower and upper bounds of function space */
  167. double *period_len;    /* length of a period of each variable */
  168. double *func_min_top;    /* lower bound of function values */
  169. double *func_max_top;    /* upper bound of funtion values */
  170. double *param_min_top;    /* lower bound of parameter values */
  171. double *param_max_top;    /* upper bound of parameter values */
  172. double time;            /* current time or independent variable for integration */
  173.  
  174. /*-------------------------------------------------------------------------
  175.     miscellaneous flags (customizable)
  176.  *-------------------------------------------------------------------------*/
  177. /* customizable system flags */
  178. int clipping = 0;    /* 1: clip (not record) data outside the box */
  179. int func_on = 1;        /* function mode toggle */
  180. int show_error_mess= 1;    /* 1: show error message, 0: otherwise */
  181. int more_digits_on = 0;    /* display more digits (achieve more accuracy) in text items */
  182. int text_input_mode = 0;    /* 1: can enter texts inside the canvas */
  183. int draw_mode = 0;    /* 0: dot mode, 1: symbol mode (during plotting) */
  184. int symp_int_on = 0;    /* 1: if symplectic algorithm is invoked, 0: othewise (This is automatically set by int_driver_proc() and int_algorithm_proc()) */
  185. int batch_on = 0;     /* 0: always for main program,  1: for a batch program*/
  186. int record_on = 1;    /* enable and disable recording of data */
  187. int batch_count = 0;    /* counting the number of batch jobs submitted (used to index batch jobs) */
  188. int new_data_format = 0;    /* 1: data in a new format, 0: old format */
  189. int lock_interval = 100;    /* an interval between successive locking */
  190. int nice_number = 18;    /* nice number for a batch job and other processes */
  191. int auto_option = 0;    /* auto86 mode choice */
  192. double cutoff = 1.e20;    /* maximal value of the coordinate considered to be not diverging. Kaos will stop if the coordinate value exceeds this. */
  193.  
  194. /* customizable graphic flags */
  195. int pixel_depth = 8;        /* depth of a pixel (1: monochrome, 8: 8bit, 24: 24bit) */
  196. int slide_mode = 0;    /* 1: mode for making slides of pictures from kaos */
  197. int bell_on = 1;    /* activate the bell sound for error messages */
  198. int boxes_on = 1;    /* 1: show boxes */
  199. int grids_on = 1;    /* 1: show grids, if grids_on>=1, it is a # of grids*/
  200. int axis_label_on = 1;    /* 1: show axis labels */
  201. int title_label_on = 1;    /* 1: show title */
  202. int colormap_strip_on = 1;    /* 1: show colormap strip */
  203.  
  204. /* non-customizable flags */
  205. int continue_toggle = 0;    /* 1: continue orbits, 0: otherwise */
  206. int forward_toggle = 1;     /* 1: forward in time, 0: backward in time */
  207. int nok=0;        /* # of good steps (defition of "good" may vary from
  208. algorithm to algorithm) */
  209. int nbad=0;        /* # of bad steps */
  210. int rescale = 0;        /* rescale mode toggle */
  211. int stop = 0;        /* stop toggle, 1: stop immediately and exit the loop*/
  212. int region_index=1;     /* data type, 0: parameter space data, 1: phase space data, 2: combined space data */
  213. int pixel_depth_entered=0;
  214. int section_count = 0;        /* counter for poincare sections */ 
  215. int n_stored_data0=0;        /* # of stored data for data0 */
  216. int n_stored_data1=0;        /* # of stored data for data1 */
  217. int n_stored_data2=0;        /* # of stored data for data2 */
  218. int n_stored_data0_save=0;    /* # of formerly stored data for data0 */
  219. int n_stored_data1_save=0;    /* # of formerly stored data for data1 */
  220. int n_stored_data2_save=0;    /* # of formerly stored data for data2 */
  221. int i_stop;    /* # of iteration when the computational loop is stopped */
  222. int lock_count;    /* counter of plotting operations (to be used for locking) */
  223. int error_result; /* result of error testing */
  224. int segment_count0 = 0;        /* data segment counter for data0 */
  225. int segment_count1 = 0;        /* data segment counter for data1 */
  226. int segment_count2 = 0;        /* data segment counter for data2 */
  227. int n_stored_data_segment0[500];    /* # of data in each data segment for data0 */
  228. int n_stored_data_segment1[500];    /* # of data in each data segment for data1 */
  229. int n_stored_data_segment2[500];    /* # of data in each data segment for data2 */
  230.  
  231. /*-------------------------------------------------------------------------
  232.     window (or panel) to be created??? (customizable)
  233.     (Intially: determine if window is created as a default
  234.      Later: determine if window is already created or not)
  235.  *-------------------------------------------------------------------------*/
  236. short main_panel_show = 1;
  237. short options_panel_show = 0;
  238. short section_panel_show = 0;
  239. short window_size_panel_show = 1;
  240. short system_info_panel_show = 0;
  241. short save_load_panel_show = 1;
  242. short param_window_show = 1;
  243.  
  244. /*-------------------------------------------------------------------------
  245.     Main panel (customizable)
  246.  *-------------------------------------------------------------------------*/
  247. int i_start = 500;    /* orbit is regarded as transient up to i_start */
  248. int i_max = 1000;    /* maximal number of iteration or integration */
  249. int i_step = 1;        /* plot every other i_step'th orbits computed */
  250. double time_step = 0.01;    /* time step for integration. Not used for maps */
  251. int symbol_type=0;    /* type of a current symbol to be displayed */
  252. int symbol_size=4;    /* size of a current symbol */
  253. int cur_color=1;    /* currently selected color */
  254. int pix_type=0;        /* pixrect operation type: 0 for regular plot, 1 for exclusive or combination */
  255.  
  256. /*-------------------------------------------------------------------------
  257.     Options window  (customizable)
  258.  *-------------------------------------------------------------------------*/
  259. int model = 6;     /* index for a currently selected model  */
  260. /* 0: use primary coordinates (used for defining vector fields),
  261.    1: use secondary coordinates (typically polar coordinates) */
  262. int polar_coord = 0;
  263. int draw_all = 1;     /* 1: projecting all orbits, 0: poincare sections */
  264. int show_transient = 1;    /* 1: show transients, 0: otherwise */
  265. int dot_size = 2;    /* size of dots plotted */
  266. int invert_background = 1;    /* 1: invert background to black, 0: otherwise */
  267. int colormap_option = 3;     /* index for a currently selected colormap */
  268. int colorcode_depth_index = 2;    /* an index for a coordinate to be used for depth cueing */
  269. double colorcode_min = -5;    /* lower bound of a depth-cued coordinate */
  270. double colorcode_max = 5;    /* upper bound of a depth-cued coordinate */
  271.  
  272. /*-------------------------------------------------------------------------
  273.     System info window (customizable)
  274.  *-------------------------------------------------------------------------*/
  275. int n_displayed_data0 = 0;    /* number of data0 displayed in a box */
  276. int n_displayed_data1 = 0;    /* number of data1 displayed in a box */
  277. int n_displayed_data2 = 0;    /* number of data2 displayed in a box */
  278. double average_return_time = 0;    /* average return time between poincare sections */
  279. double *func_i,*func_f;    /* initial and final values of functions */
  280.  
  281. /*-------------------------------------------------------------------------
  282.     section window (customizable)
  283.  *-------------------------------------------------------------------------*/
  284. int polar_section = 0;    /* 1: section in terms of secondary coordinates, 0: otherwise */
  285. int linear_interpolation = 1;    /* 1: linear interpolation to get a section, 0: picard iteration */
  286. int section_index = 2;    /* an index of a coordinate used to define a secton surface */
  287. double section_constant = 0; /* a value of a section coordinate: section
  288. surface is defined by x[section_index] = section_constant */
  289. int n_poincare = 100000;    /* number of maximum poincare section to be computed */
  290.  
  291. /*-------------------------------------------------------------------------
  292.     Save-Load window (customizable)
  293.  *-------------------------------------------------------------------------*/
  294. int save_option = 0;    /* index for choosing variety of saving and loading options */
  295.  
  296. /*-------------------------------------------------------------------------
  297.     projection window (customizable)
  298.  *-------------------------------------------------------------------------*/
  299. int param_cur_index[2] = {0,1};    /* x and y indices for a currently selected
  300. projection of parameter space data (data0) */
  301. int var_cur_index[2] = {0,1};    /* x and y indices for a currently selected
  302. projection of phase space data (data1) */
  303. double *all_min;    /* lower bound of a current box for combined data */
  304. double *all_max;    /* upper bound of a current box for combined data */
  305. double *all_min_top;    /* lower bound of a top box for combined data */
  306. double *all_max_top;    /* upper bound of a top box for combined data */
  307.  
  308. /*-------------------------------------------------------------------------
  309.     auxiliary (or combined space) window initializations (customizable)
  310. -------------------------------------------------------------------------*/
  311. /* window configuration */
  312. int aux_win_i = 0;        /* index for an auxiliary window */
  313. int aux_panel_height = 70;    /* y coord of an auxiliary panel */
  314. int aux_xwindow = 350;    /* width of an auxiliary window */
  315. int aux_ywindow = 350;    /* height of an auxiliary window */
  316. int aux_xcanvas;    /* width an auxiliary canvase */
  317. int aux_ycanvas;    /* height of an auxiliary canvas */
  318. int aux_xwidth;    /* width of an auxiliary space box */
  319. int aux_ywidth;    /* height of an auxiliary space box */
  320. int aux_l_margin = 0;    /* left margin of an auxiliary space box */
  321. int aux_b_margin = 0;    /* bottom margin of an auxiliary space box */
  322. int *aux_win_mode;    /* auxiliary window display mode, 0: simultaneous display of data1, 1: display of data2 */
  323. int *aux_on;        /* 1: if auxiliary window is created, 0: otherwise */
  324. int *aux_rescale;    /* 1: if rescale mode is on, 0: otherwise */
  325. int **aux_cur_index;    /* x and y indices for a projection plane */
  326. double **aux_x_min,**aux_x_max; /* lower and upper bounds of auxiliary space
  327. box */
  328.  
  329.  
  330. /*-------------------------------------------------------------------------
  331.     integration window initializations (customizable)
  332. -------------------------------------------------------------------------*/
  333. char int_frame_label[MAX_LENGTH] = "integration";    /* window label */
  334. short int_panel_show = 0;    /* 1: if integration window is created */
  335. int int_driver = 0;        /* index for an integration driver */
  336. int int_algorithm = 1;        /* index for an integration algorithm */
  337. int int_option=0;        /* index for an iteration method */
  338. int int_nstep = 1000;        /* number of integration steps */
  339. int int_max_nstep = 1000000;    /* maximal number of integration steps to avoid a disaster*/
  340. double int_start=0,int_end=1;    /* starting and endting time */
  341. double int_period=1;        /* period of an integration */
  342. double int_eps=1.e-10;        /* tolerated error */
  343. double int_guessed_step=0.01;    /* guessed step size */
  344. double int_min_step=0;        /* minimum step size */
  345. double *int_yscal;        /* scaling factor for errors */
  346.  
  347. /*-------------------------------------------------------------------------
  348.     periodic orbit (fixed point) window initializations (customizable)
  349. -------------------------------------------------------------------------*/
  350. char fp_frame_label[MAX_LENGTH] = "Fixed Point Panel";    /* window label */
  351. short fp_panel_show = 0;    /* 1: if periodic orbit window is created */
  352. int fp_show_toggle=1;        /* 1: show periodic orbits, 0: otherwise */    
  353. int fp_display_option=1;    /* index for periodic orbit display options */ 
  354. int fp_go_option=1;        /* index for periodic orbit computation options */
  355. int fp_algorithm=1;        /* iteration algorithm index */
  356. int ir=0;            /* period of a periodic orbit */
  357. int n_stored_fp=0;        /* number of stored periodic orbits */
  358. int n_mc=10;            /* # of Monte Carlo computations */
  359. int ms=200,mu=200;         /* maximal steps for stable and unstable manifolds */
  360. int msf=1,muf=1;        /* # of filling bwtween two points of stable and unstable manifolds */
  361. int iskip=1;            /* # of skips between plotting */
  362. int sqzex_maxsq=30;        /* # of iteration for finding periodic
  363. orbits */
  364. int fi_maxsq=30;        /* # of iteration for finding an inverse */
  365. double gp_delm=1.e-6;        /* distance from a periodic orbit to a
  366. starting point on a manifold */
  367. double mc_eps=1.e-8;        /* tolerated error for non-duplicacy check */
  368. double sqzex_eps=1.e-14;    /* tolerated error in x of periodic orbit computation */
  369. double sqzex_epsf=1.e-16;    /* tolerated error in f of periodic orbit computation */
  370. double sqzex_epsm=10;        /* tolerated jump in intermediate values of iteration */
  371. double fi_eps=1.e-10;    /* tolerated error in x of inverse computation */
  372. double fi_epsf=1.e-10;    /* tolerated error in f of inverse computation */
  373. double fi_epsm=10;        /* tolerated jump in intermediate values of iteration */
  374. double *xoffset;    /* offset values of x in periodic orbit equation,
  375. i.e., f(x) = x + xoffset is solved */
  376.  
  377. /*-------------------------------------------------------------------------
  378.     print window initializations (customizable)
  379. -------------------------------------------------------------------------*/
  380. char print_frame_label[MAX_LENGTH] = "print";    /* window label */
  381. short print_panel_show = 0;    /* 1: if print window is created */
  382. int print_option=1;    /* option index for printing */
  383. int print_region=1;    /* index for region and data type to be printed */
  384.  
  385. /*-------------------------------------------------------------------------
  386.     AUTO86 initializations (see AUTO manual for details) 
  387. -------------------------------------------------------------------------*/
  388. short auto_panel_show = 0;     /* 1: if auto panel is created */
  389. char auto_dir_name[MAX_LENGTH] = "/marcy/kim/src/lib/autos/AUTO86/examples"; /* directory name where auto executable resides */
  390. char auto_file_name[MAX_LENGTH] = "@autod^pp2";    /* auto executable file name with arguments (arguments are seperated by ^ not white spaces) */
  391. char auto_input_name[MAX_LENGTH] = "autpp2_init.f";    /* file which is read onto auto text window and edited */
  392.  
  393. /* auto variables (see AUTO manual for details) */
  394. int auto_ibr,auto_ntot,auto_itp,auto_lab;
  395. int auto_ndim,auto_ips,auto_irs,auto_ilp;
  396. int auto_ntst,auto_ncol,auto_iad,auto_isp,auto_isw,auto_iplt;
  397. int auto_nbc,auto_nint,auto_nmx,auto_npr,auto_mxbf,auto_iid;
  398. int auto_itmx,auto_itnw,auto_nwtn,auto_jac,auto_nuzr;
  399. int auto_n1,auto_n2,auto_nfpar,auto_icp[AUTO_NFPAR_MAX];
  400. double auto_rl0,auto_rl1,auto_a0,auto_a1,auto_par[AUTO_ALL_PARAM_DIM];
  401. double auto_epsu,auto_epss,auto_epsl[2],auto_ds,auto_dsmin,auto_dsmax;
  402. double auto_thetau,auto_thetal[2];
  403.  
  404. /*-------------------------------------------------------------------------
  405.     execution window (customizable)
  406. -------------------------------------------------------------------------*/
  407.  
  408. short exec_panel_show = 0; /* 1 if execution window is created, 0: otherwise */
  409. char exec_dir_name[MAX_LENGTH] = "/marcy/kim/kaos/companionlib"; /* directory where an external executable resides */ 
  410. char exec_file_name[MAX_LENGTH] = "bifseta"; /* filename of an external executable */
  411. char exec_input_name[MAX_LENGTH] = "bifseta.inp"; /* input filename from which an external executable reads parameters */
  412.  
  413. /*-------------------------------------------------------------------------
  414.     time series window (customizable)
  415. -------------------------------------------------------------------------*/
  416.  
  417. short tser_panel_show = 0; /* 1 if timeseries window is created, 0: otherwise */
  418. int tser_data_option = 0;
  419. int tser_algorithm_option = 0;
  420. int tser_len=0;
  421. int tser_mdim=0;
  422. double *tser;
  423.  
  424. /*-------------------------------------------------------------------------
  425.     fft window (customizable)
  426. -------------------------------------------------------------------------*/
  427.  
  428. short fft_panel_show = 0; /* 1 if fft window is created, 0: otherwise */
  429. int fft_algorithm_option=0;
  430. int fft_mdim=0;
  431. double *fft;
  432.  
  433. /*-------------------------------------------------------------------------
  434.     lyapunov window (customizable)
  435. -------------------------------------------------------------------------*/
  436.  
  437. short lyap_panel_show = 0; /* 1 if lyapunov window is created, 0: otherwise */
  438. int lyap_algorithm_option=0;
  439.  
  440. /*-------------------------------------------------------------------------
  441.     dimensions window (customizable)
  442. -------------------------------------------------------------------------*/
  443.  
  444. short dims_panel_show = 0; /* 1 if dimensions window is created, 0: otherwise */
  445. int dims_type_option=0;
  446. int dims_algorithm_option=0;
  447. int dims_scale_max = 20;
  448. int dims_lsf_start = 0;
  449. int dims_lsf_end = 20;
  450. double dims_scale_factor=2.0;
  451.  
  452. /*-------------------------------------------------------------------------
  453.     scan window (customizable)
  454. -------------------------------------------------------------------------*/
  455.  
  456. short scan_panel_show = 0; /* 1 if dimensions window is created, 0: otherwise */
  457. int scan_list_type=0;
  458. int scan_grid_dim=0;
  459. int scan_algorithm_option=0;
  460. int scan_n_max=0;
  461. int scan_xgrid[3]={1,1,1};
  462. int scan_cur_index[3]={0,1,2};
  463. int scan_mdim=0;
  464. int scan_mdim_init=100;
  465.  
  466. int scan_col_dim=0;
  467. int scan_region_index=0;
  468. int scan_n_stored=0;
  469. int *scan_type;
  470. double scan_xmin[3],scan_xmax[3];
  471. double **scan_x;
  472.  
  473. /*-------------------------------------------------------------------------
  474.     help window 
  475. -------------------------------------------------------------------------*/
  476. short help_panel_show = 0; /* 1 if help window is created, 0: otherwise */
  477. int help_option=0;
  478.  
  479. /*-------------------------------------------------------------------------
  480.     window variables
  481.     (take either values of primary or secondary coordinates
  482.     depending on the polar coordinate flag)
  483.  *-------------------------------------------------------------------------*/
  484. double *win_var_f;    /* final values of window variables */
  485. double *win_var_i;    /* starting values of window variables */
  486. double *win_var_i_old;    /* temporary window varibles */
  487. char **win_var_label;    /* label for window variables (either primary or
  488.  
  489. /*-------------------------------------------------------------------------
  490.     Miscelleneous constants, file pointers, temporary strings
  491.  *-------------------------------------------------------------------------*/
  492. double pi = 3.1415926535897932;        /* Pi */
  493. double twopi =6.2831853071795864 ;    /* 2 * Pi */
  494. FILE *fp, *fopen(),*ffp;        /* file pointers */
  495. char string[MAX_LENGTH];        /* temporay strings */
  496. char string2[MAX_LENGTH];        /* temporay strings */
  497. char lstring[BIG_LENGTH];        /* temporay strings */
  498. char lstring2[BIG_LENGTH];        /* temporay strings */
  499. char full_path[MAX_LENGTH] = "";    /* path name string for a file to be saved and loaded */
  500. char *error_mess[MAX_LENGTH] = {"Error:"};    /* error message string */
  501. char error_yes[MAX_LENGTH] = {"Confirm"};    /* error message confirm string */
  502. char error_no[MAX_LENGTH] = {"Cancel"};        /* error message disapproval string */
  503. double **dmatrix();    /* matrix memory allocation routine */
  504. void free_dmatrix();    /* matrix memory free routine */
  505.  
  506. /*-------------------------------------------------------------------------
  507.  * Temporary variables. (USE ONLY LOCALLY WITHIN A SUBROUTINE)
  508.  * (Introduced not to dynamically allocate memory within
  509.  * frequently called programs)
  510.  *-------------------------------------------------------------------------*/
  511. double *v;    /* dim=var_dim */
  512. double *t_v;    /* dim=var_dim */
  513. double *t_vf;    /* dim=full_dim */
  514. double *t_va;    /* dim=all_dim */
  515.  
  516. /*-------------------------------------------------------------------------
  517.  * flags saved temporarily for resetting panels 
  518.  *-------------------------------------------------------------------------*/
  519. int func_on_old,save_option_old,model_old,polar_section_old,colormap_option_old,invert_background_old,polar_coord_old,enable_polar_old,ds_class_old,draw_all_old;
  520.  
  521.  
  522. /*-------------------------------------------------------------------------
  523.  * initializing global variables from global constants (global constants
  524.  * will be removed eventually)
  525.  *-------------------------------------------------------------------------*/
  526. int aux_max = AUX_MAX;
  527. int var_dim_max = VAR_DIM_MAX;
  528. int param_dim_max = PARAM_DIM_MAX;
  529. int func_dim_max = FUNC_DIM_MAX;
  530. int full_dim_max = FULL_DIM_MAX;
  531. int all_dim_max = ALL_DIM_MAX;
  532. int max_length = MAX_LENGTH;
  533. int big_length = BIG_LENGTH;
  534.  
  535. /*-------------------------------------------------------------------------
  536.  * frame parameters (currently not used and commented out)
  537.  *-------------------------------------------------------------------------*/
  538. /*
  539. int frame_argc = 11;
  540. char *frame_argv[11] = { "dummy","-Wb","255","255","0","-Wf","0","0","255","-Wl","kaos - Swan Kim & J. Guckenheimer, POSTECH and Cornell U., pre alpha 1.8 9/1989"};
  541. */
  542.  
  543. /*-------------------------------------------------------------------------
  544.     temporary variable which will be removed from the package in future
  545. -------------------------------------------------------------------------*/
  546. int algorithm_dim = 4; /* The number of installed integration algorithms */
  547.  
  548. /*-------------------------------------------------------------------------
  549.     partially implemented options to be fully installed in future
  550. -------------------------------------------------------------------------*/
  551. int nofrill = 1;    /* nofrill algorithm toggle */
  552. int resize=0;        /* temporay variable used by resize_proc() */
  553. int large_system_on=0;
  554.