Category : C Source Code
Archive   : DYNAM_S1.ZIP
Filename : YCOMB.C

 
Output of file : YCOMB.C contained in archive : DYNAM_S1.ZIP

/********************************* YCOMB.C *********************************/
/************************* BASIN COMMANDS AND MENU ***************************/
/********************* (C) 1986,7,8 by JAMES A. YORKE ************************/


#include "yinclud.h"

int caseBs(CodeName)
char *CodeName;
{
int oldpreiter,
level0;
int AccessBS(), BasinStraddle(), SaddleStraddle();
/* needed for use as a pointer */

TEST("bm") {
BasinMenu();
return(1);
}

TEST("sm") { /* straddle orbit menu */
StraddleMenu();
return(1);
}

TEST("ra") {
rad_attr = Entervalue(rad_attr, CHECKSET);
if (SCREEN && printer >= 2)
{
PRINT
"Additional commands for experts:\n");
PRINT
"\nCommands RA2 and RA5 allow radii for y2 and y5 to be set independently\n");
}
return(1);
}
TEST("ra2") {
ra2 = Entervalue(ra2, SETVALUE);
return(1);
}
TEST("ra5") {
ra5 = Entervalue(ra5, SETVALUE);
return(1);
}
TEST("sdist") {
IsClose = Entervalue(IsClose, CHECKSET);
return(1);
}
TEST("triple") {
PRINT "The distance between ya and yb is tripled \n");
triple();
return(1);
}
TEST("bstswitch") {
if(SCREEN)
PRINT "set to 1 to randomize midpoint\n");
BST_switch = (int) Entervalue((double) BST_switch, CHECKSET);
return(1);
}
TEST("mc") {
MaxChecks = (int) Entervalue((double) MaxChecks, CHECKSET);
return(1);
}
TEST("w") {
if(level >= PROCESS)
scr_rowcol(3, 0);
whenAndWhere();/* tells where the tajectory thru y1 goes and
how long it takes to get there; for
interrupt W and command W; in YBASINS.C */
return(1);
}
TEST("div") {
divisions = (int) Entervalue((double) divisions, CHECKSET);
return(1);
}
if(strcmp(CodeName, "sst") == 0
|| strcmp(CodeName, "rsst") == 0
|| strcmp(CodeName, "asst") == 0
|| strcmp(CodeName, "rasst") == 0
|| strcmp(CodeName, "game") == 0
|| strcmp(CodeName, "rgame") == 0) {

if(CodeName[0] == 'r') {
boot = 1;
}
/* the flags are to tell us what type of instruction has been entered;
game or rgame set the game flag(=YES) while asst or rasst set the
access flag; these are used in YBASINS.C */
gameFlag = NO;
accessFlag = NO;
if(CodeName[0] == 'a' || CodeName[1] == 'a') {
accessFlag = YES;
}
if(CodeName[0] == 'g' || CodeName[1] == 'g') {
gameFlag = YES;
}

level0 = level++;
oldpreiter = preiter;
if(preiter == 0) {
preiter = 1;/* prevents plotting a spurious point */
}
initSadStraddle();
/* initialize SaddleStraddle(); it can reset
"level" */
if(level == level0)
/* this would happen only if we dropped down in
level via Interrupt() */
return(1);
StraddleIteratee = iteratee;
ChkTrajIteratee = iteratee;

iteratee = SaddleStraddle;
level = level0; /* caseT elevates the level */
caseT();
iteratee = StraddleIteratee;/* restores old destination */
preiter = oldpreiter;
return(1);
}
if(strcmp(CodeName, "bst") == 0
|| strcmp(CodeName, "rbst") == 0) {
if(CodeName[0] == 'r') {
boot = 1;
}
if(refreshFlag == NO)
dot = -1;
/* this will be set = 0 anyway but it prevents
printing out of lyapunov exponents while
initial steps are being carried out to see
if initial points are well defined */
level0 = level++;
oldpreiter = preiter;
if(preiter == 0) {
preiter = 1;/* prevents plotting a spurious point */
}
initBasStraddle();/* initialize BasinStraddle(); it can reset
"level" */
if(level == level0)
/* this would happen only if we dropped down in
level via Interrupt() */
return(1);
StraddleIteratee = iteratee;
ChkTrajIteratee = iteratee;

iteratee = BasinStraddle;
/* this means Trajectory() will iterate
BasinStraddle */
level = level0; /* caseT elevates the level */
caseT();
iteratee = StraddleIteratee;/* restores old destination */
preiter = oldpreiter;
return(1);
}
if(strcmp(CodeName, "abst") == 0/* AccessibleBasinStradTraj */
|| strcmp(CodeName, "rabst") == 0) {
if(CodeName[0] == 'r') {
boot = 1;
}

level0 = level++;
initBasStraddle();/* initialize BasinStraddle(); it can reset
"level" */
if(level == level0)
/* this would happen only if we dropped down in
level via Interrupt() */
return(1);
StraddleIteratee = iteratee;
ChkTrajIteratee = iteratee;

iteratee = AccessBS;/* this means Trajectory() will iterate
AccessBS */
level = level0; /* caseT elevates the level */
caseT();
iteratee = StraddleIteratee;/* restores old destination */
return(1);
}
if(strcmp(CodeName, "bl") == 0 || strcmp(CodeName, "rbl") == 0) {
if(CodeName[0] == 'r') {
boot = 1;
}
xpixels = 100;
ypixels = 100;

BasinBoundary();
return(1);
}
if(strcmp(CodeName, "bmed") == 0 || strcmp(CodeName, "rbmed") == 0) {
if(CodeName[0] == 'r') {
boot = 1;
}

xpixels = 320;
ypixels = 200;

BasinBoundary();
return(1);
}
if(strcmp(CodeName, "bh") == 0 || strcmp(CodeName, "rbh") == 0) {
if(CodeName[0] == 'r') {
boot = 1;
}

xpixels = 960;
ypixels = 68 * 8;

BasinBoundary();
return(1);
}
if(strcmp(CodeName, "bmh") == 0 || strcmp(CodeName, "rbmh") == 0) {
if(CodeName[0] == 'r') {
boot = 1;
}

xpixels = 320;
ypixels = 68 * 4;

BasinBoundary();
return(1);
}

if (strncmp(CodeName,"bega",20)==0 || strncmp(CodeName,"rbega",20)==0)
{
if (CodeName[0] == 'r')
{
boot = 1;
}

xpixels = 640;
ypixels = 360;

BasinBoundary();
return(1);
}
if (strncmp(CodeName,"bvga",20)==0 || strncmp(CodeName,"rbvga",20)==0)
{
if (CodeName[0] == 'r')
{
boot = 1;
}

xpixels = 640;
ypixels = 480;

BasinBoundary();
return(1);
}
return(0);
}

BasinMenu() {
if(level == SETPARAM)
scr_clr(); /* in desmets pcio.a */
scr_rowcol(0, 0);

PRINT
" BASIN OF ATTRACTION MENU \n\n");
PRINT
"The following routine is implicit in all Basin and Straddle calculations. \n"
);
PRINT
" W: checks Where the trajectory through y1 goes and When it gets there;\n");
PRINT
" whether it comes within RA of y2...y7 or diverges within MC iterates\n"
);
PRINT
" \"diverges\" means goes more than SD diameters from the screen\n");

PRINT
" MC: the Maximum number of Checks per Initial point; (now %d)\n"
,MaxChecks);
PRINT
" RA: minimum acceptable Radius of Attraction for storage vecs; now=%lf\n\n"
,rad_attr);

PRINT
"BASIN PLOTS: each grid point is plotted if its trajectory comes within RA of"
);
PRINT
"\n y2,y3, or y4 before y5,y6,or y7 or if it diverges\n");
PRINT
" OR is plotted IF the trajectory diverges AND y2[%d] is not set)\n"
,zeroth);
PRINT
" Vectors y2...y7 can be set using interrupt m while plotting\n\n");
PRINT
" BASIN WARNING: start with BL; even BL is slow(>10 min for maps on an XT)"
);
PRINT
"\n BL: to compute basin in Low resolution 100X100 grid\n");
PRINT
" BMED: to compute basin in Medium resolution 320X200 grid\n");
PRINT
" BH: to compute basin in High resolution 960X544 grid\n");

/* PRINT
"Program checks dist. of y[] from storage vectors every %d iterate(s) \n\n"
,its_per_plot);
*/
PRINT
" RBL,RBM, and RBH work like BL,BM, and BH but are added to previous picture\n"
);
PRINT
" Enter *BM and possibly *SM for help and YM for setting y's\n");
}




  3 Responses to “Category : C Source Code
Archive   : DYNAM_S1.ZIP
Filename : YCOMB.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/