AAMINO BAS LKBAKSEED BASW @BODA BASa#@\BODE BAS<ECHROMO BAS9mzCHROMO FOR_ CHROMO RUNX2\COMPET BAS 8DELAY BASDELAY2 BAS-7FEDBAT BAS 5 FERMT BAS0FERMT DATFERMT FOR&INOC BASuKLA BAS LAM DOC%>LEACH FOR*kLOTKA BAS; MONIBM BASEMONOD BASKNICH BASO99OXLIM BASU 'PREDAT BASaQPRY1 BASh 2RECYCL BASrhRECYCLE BASySIM4 FOR*o2SIMBAS BAS QSIMBAS DOC4@STAGE2 BASEzSTERIL FOR:STREAM BASBSTREAM FOR &§STRIBM BAS0ƙSUGAR BASAXSUGAR DOCSYNCH BAS 3TANKS2 BAS ׉TWOIBM BAS WREAD-ME DOC(10 REM AMINO ACIDS AND PROTEINS, H.BUNGAY 1985 20 RANDOMIZE 30 CLS 40 KEY OFF 50 SCREEN 1,1 60 REM JUMP LOCATION************* 70 PRINT "AMINO ACIDS AND PROTEINS." 80 PRINT 90 PRINT "THE AMINO GROUP IS -NH2 ." 100 PRINT "CARBOXYL GROUPS ARE THE USUAL" 110 PRINT "ORGANIC ACIDS : -COOH ." 120 PRINT 130 PRINT "AN AMINO ACID HAS BOTH THESE FUNCTIONS." 140 PRINT 150 PRINT "FOR EXAMPLE, GLYCINE : 160 PRINT " H2N-CH2-COOH" 170 PRINT 180 PRINT "TYPING LIMITS THE WAY OF REPRESENTATION." 190 PRINT "THIS IS ALSO GLYCINE: NH2" 200 PRINT " CH2-COOH" 210 PRINT "AS IS THIS : NH2" 220 PRINT " CH2" 230 PRINT " COOH" 240 PRINT 250 PRINT "OR THIS : H H OH" 260 LINE (117,158)-(120,155) 270 PRINT " N-C-C=O" 280 PRINT " H H" 290 PRINT 300 INPUT "TYPE ENTER (RETURN) KEY";A$ 310 PRINT 320 PRINT "PLEASE USE THE CAPS LOCK KEY BECAUSE" 330 PRINT "ALL LOWER CASE ANSWERS WILL BE" 340 PRINT "TREATED AS WRONG." 350 PRINT 360 PRINT "YOU WILL NEED A GUIDE SHEET WITH" 370 PRINT "THE NAMES AND STRUCTURES OF AMINO ACIDS." 380 PRINT 390 PRINT "PICK THE AMINO ACID WITH 2 CARBON ATOMS." 400 GOSUB 3030 410 IF A$="GLY" THEN 440 420 PRINT "THE CORRECT ANSWER WAS GLY, GLYCINE." 430 PRINT "IT IS THE SIMPLEST AMINO ACID." 440 PRINT 450 PRINT "NAME AN AMINO ACID WITH NO AMINO GROUP." 460 PRINT 470 INPUT A$ 480 IF A$="PRO" THEN 520 490 PRINT "THE ANSWER IS PRO FOR PROLINE." 500 PRINT "ITS AMINO FUNCTION IS IN A RING," 510 PRINT "BUT ITS PROPERTIES ARE QUITE NORMAL." 520 INPUT "TYPE RETURN";A$ 530 X=60 540 Y=75 550 Z=15 560 CLS 570 LOCATE 10,16 580 PRINT "-CH2-CH-COOH" 590 PRINT " NH2" 600 GOSUB 3140 610 PRINT 620 PRINT "NAME THIS ONE (AROMATIC RING)" 630 GOSUB 3030 640 IF A$="PHE" THEN 660 650 PRINT "CORRECT ANSWER IS PHENYL ALANINE." 660 PRINT 670 INPUT "TYPE RETURN";A$ 680 PRINT "IT IS CONVENIENT TO CONSIDER THE" 690 PRINT "TWO CARBONS COMMON TO ALL AMINO" 700 PRINT "ACIDS AND TO USE R TO STAND FOR" 710 PRINT "THE OTHER PORTION." 720 PRINT "FOR EXAMPLE, IN THE FORMULA:" 730 PRINT 740 PRINT " R-CH-COOH" 750 PRINT " NH2" 760 PRINT 770 PRINT "IF THIS IS GLYCINE, R=H ." 780 PRINT 790 PRINT "IF THIS IS VALINE, R= -CH-(CH3)2 800 PRINT 810 PRINT "SORRY ABOUT THE DISTORTIONS OF TYPING." 820 PRINT 830 PRINT "IF R= CH3-CH-" 840 PRINT " OH" 850 PRINT 860 PRINT "PLEASE TYPE THE CODE FOR THE AMINO ACID" 870 GOSUB 3030 880 IF A$="THR" THEN 900 890 PRINT "CORRECT ANSWER IS THREONINE." 900 PRINT 910 PRINT "LET'S TRY ANOTHER." 920 PRINT " R = -CH2-COOH" 930 INPUT "PLEASE TYPE ITS CODE:";A$ 940 IF A$="ASP" THEN 1550 950 PRINT "THE ANSWER WAS ASPARTIC ACID." 960 INPUT "TYPE RETURN ";A$ 970 PRINT 980 PRINT "AMINO ACIDS HAVE A SPECIAL ISOMERISM." 990 PRINT "A CARBON WITH 4 DIFFERENT GROUPS" 1000 PRINT "ATTACHED IS ASYMMETRIC. THIS MEANS" 1010 PRINT "THAT IT CAN HAVE D- OR L- ISOMERS." 1020 PRINT "OPTICAL ISOMERS IS ALSO USED AS A NAME" 1030 PRINT "BECAUSE THESE ISOMERS CAN ROTATE THE" 1040 PRINT "PLANE OF POLARIZED LIGHT. YOU CAN" 1050 PRINT "THINK OF RIGHT OR LEFT HANDEDNESS." 1060 INPUT "TYPE RETURN";A$ 1070 CLS 1080 PRINT "PLEASE CONSIDER :" 1090 LINE ( 99,33)-( 99,58) 1100 LINE (227,33)-(227,58) 1110 LOCATE 4,12 1120 PRINT " X X" 1130 LOCATE 6,9 1140 PRINT "Z - C - Y Y - C - Z" 1150 LOCATE 8,12 1160 PRINT " Q Q" 1170 PRINT 1180 PRINT "CARBON IS OFTEN PICTURED AS THE" 1190 PRINT "CENTRAL ATOM IN A PYRAMID WITH" 1200 PRINT "OTHER ATOMS AT EACH APEX." 1210 INPUT "TYPE RETURN";A$ 1220 CLS 1230 LOCATE 4,12 1240 PRINT " X " 1250 LOCATE 6,9 1260 PRINT "Z C Y " 1270 LOCATE 8,12 1280 PRINT " Q" 1290 LINE (99,32)-(75,43) 1300 LINE -(99,55) 1310 LINE -(125,43) 1320 LINE -(99,32) 1330 LINE (99,32)-(99,55) 1340 FOR I= 75 TO 125 STEP 3 1350 PSET (I,43) 1360 NEXT 1370 PRINT 1380 PRINT "CONSIDER LOOKING DOWN AT A PYRAMID" 1390 PRINT "THAT HAS X UP. THE BASE WILL HAVE" 1400 PRINT "Z, Y, Q IN CLOCKWISE ORDER. IF THE" 1410 PRINT "ORDER WERE Y, Z, Q, IT WOULD BE AN" 1420 PRINT "ISOMER." 1430 INPUT "TYPE RETURN";A$ 1440 PRINT "ALL AMINO ACIDS BUT ONE HAVE AN" 1450 PRINT "ASYMMETRIC CARBON ATOM." 1460 PRINT "SOME HAVE SEVERAL." 1470 PRINT "NAME THE AMINO ACID THAT CAN" 1480 PRINT "HAVE NO D- OR L- FORM." 1490 GOSUB 3030 1500 IF A$="GLY" THEN 1550 1510 PRINT "GLYCINE HAS 2 H'S ON THE" 1520 PRINT "AMINO CARBON AND A DOUBLE BOND" 1530 PRINT "ON THE OTHER. NO ISOMERS" 1540 INPUT "TYPE RETURN";A$ 1550 CLS 1560 PRINT "AMINO ACIDS REACT WITH EACH OTHER." 1570 PRINT 1580 PRINT "OBSERVE THE ELIMINATION OF WATER :" 1590 LOCATE 14,2 1600 PRINT " R-CH-COOH HN-CH-COOH" 1610 PRINT " NH2 H R" 1620 FOR N=19 TO 9 STEP -1 1630 FOR D=1 TO 20 :M=SIN(D):NEXT 1640 LOCATE 14,N 1650 PRINT "H " 1660 NEXT 1670 LOCATE 12,2 1680 PRINT " O + H20" 1690 PRINT 1700 PRINT " R-CH-C- " 1710 LINE (58,97)-(58,101) 1720 LINE (61,97)-(61,101) 1730 LOCATE 18,1 1740 PRINT "NOW THE AMIDE BOND FORMS:" 1750 FOR N=18 TO 10 STEP -1 1760 FOR D= 1 TO 18 :M=SIN(D):NEXT 1770 LOCATE 14,N 1780 PRINT "N-CH-COOH " 1790 LOCATE 15,N 1800 PRINT "H R " 1810 NEXT 1820 LOCATE 19,1 1830 INPUT "TYPE A TO SEE THIS AGAIN";A$ 1840 IF A$="A" THEN 1550 1850 PRINT 1860 PRINT "SUCH COMPOUNDS ARE PEPTIDES." 1870 PRINT "MANY AMINO ACIDS LINKED IN THIS" 1880 PRINT "WAY CONSTITUTE A PROTEIN." 1890 INPUT "TYPE RETURN";A$ 1900 CLS 1910 PRINT"THERE IS AN ASTRONOMICAL NUMBER" 1920 PRINT"OF PERMUTATIONS FOR A SEQUENCE OF" 1930 PRINT"AMINO ACIDS IN A PROTEIN CHAIN." 1940 PRINT 1950 PRINT"CHAINS CAN BE SEVERAL HUNDRED" 1960 PRINT"AMINO ACIDS AND THERE ARE ABOUT" 1970 PRINT"20 CHOICES AT EACH POSITION." 1980 PRINT 1990 PRINT"YOU MIGHT EXPECT A CHAIN TO HAVE" 2000 PRINT"RANDOM SHAPE." 2010 PRINT 2020 INPUT"STRIKE RETURN TO SEE A RANDOM CHAIN.";A$ 2030 CLS 2040 X1=30 2050 Y1=35 2060 FOR N=1 TO 45 2070 Q=RND(Q) 2080 X1=X1+10*Q 2090 Y1=Y1+7 *(1-2*Q)+1 2100 CIRCLE (X1,Y1),5 2110 NEXT 2120 LOCATE 19,1 2130 INPUT"TYPE A TO SEE ANOTHER.";A$ 2140 IF A$="A" THEN 2030 2150 CLS 2160 PRINT"IN FACT, THE CHAINS ARE NOT RANDOM." 2170 PRINT 2180 PRINT"THERE IS SOME TENDENCY TO FORM A" 2190 PRINT"HELIX, BUT STERIC FACTORS AND" 2200 PRINT"ATTRACTIONS OF THE R GROUPS USUALLY" 2210 PRINT"IMPART A DEFINITE 3-DIMENSIONAL" 2220 PRINT"STRUCTURE. HERE IS A HELIX :" 2221 X1=30 2222 Y1=75 2223 FOR N=1 TO 45 2224 X1=X1+6 2225 Y1=Y1+12*SIN(N) 2226 CIRCLE (X1,Y1),5 2227 NEXT 2228 INPUT A$ 2230 LOCATE 16,1 2240 PRINT"THE AMINO ACID SEQUENCE IS TERMED" 2250 PRINT"THE PRIMARY STRUCTURE. 2260 PRINT 2270 PRINT"THE THREE-DIMENSIONAL ARRANGEMENT" 2280 PRINT"OF A CHAIN IS TERMED SECONDARY" 2290 PRINT"STRUCTURE." 2300 PRINT"BINDING OF ONE CHAIN TO ANOTHER" 2310 PRINT"IS TERTIARY STRUCTURE, AND" 2320 PRINT"GROUPING OF ORDERED PROTEINS IS" 2330 PRINT"QUATERNARY STRUCTURE." 2340 PRINT 2350 INPUT"STRIKE RETURN";A$ 2360 CLS 2370 PRINT "CHAIN BINDING IS VERY IMPORTANT" 2380 PRINT "IN THE PROTEIN HORMONE INSULIN." 2390 A=.5 2400 X=152 2410 Y=105 2420 R=60 2430 FOR N=1 TO 84 2440 GOSUB 2960 2450 NEXT 2460 LOCATE 22,13 2470 PRINT "S" 2480 LOCATE 21,14 2490 PRINT "S" 2500 LOCATE 20,26 2510 PRINT "S" 2520 LOCATE 19,15 2530 PRINT "S" 2540 LOCATE 22,24 2550 PRINT "S" 2560 LOCATE 20,17 2570 PRINT "S" 2580 LINE (102,170)-(104,166) 2590 LINE (190,170)-(198,158) 2600 LINE (204,150)-(204,145) 2610 LINE (119,150)-(125,153) 2620 LINE (106,148)-(111,146) 2630 LINE (135,157)-(138,164) 2640 LINE (183,182)-(183,176) 2650 INPUT A$ 2660 CLS 2670 PRINT "WHEN THE S-S LINKS ARE REDUCED" 2680 PRINT "TO -SH GROUPS, A SMALLER FRAGMENT" 2690 PRINT "IS FORMED. THE A CHAIN: ACTIVE INSULIN." 2700 R=60 2710 A=.5 2720 FOR N=1 TO 21 2730 GOSUB 2960 2740 NEXT 2750 A=A+.2 2760 FOR N=1 TO 63 2770 GOSUB 2960 2780 NEXT 2790 LOCATE 18,18 2800 PRINT "A" 2810 LOCATE 24,1 2820 INPUT"TYPE RETURN.";Q 2830 CLS 2840 PRINT"MOST PROTEINS HAVE A 3-DIMENSIONAL," 2850 PRINT"ELIPSOIDAL, GLOBULAR STRUCTURE." 2860 PRINT"FOR EXAMPLE :" 2870 CIRCLE (160, 50),60,,,,5/18 2880 CIRCLE (160,110),60,,,,10/18 2890 CIRCLE (160,170),60,,,,3/18 2900 LOCATE 24,1 2910 INPUT"TYPE RETURN";Q 2920 CLS 2930 PRINT"ENZYMES OFTEN HAVE MORE INTERESTING" 2940 PRINT"THAT AID THEIR FUNCTIONING." 2950 PRINT"NOTE THE CLEFT :" 2951 CIRCLE (160,100),80,.5 ,3.2,2 2953 CIRCLE ( 30,43),90,4.7,5.3 2959 STOP 2960 REM DRAWS CHAIN 2970 X1=X+R*COS(A) 2980 Y1=Y+R*SIN(A) 2990 CIRCLE (X1,Y1),4 3000 R=SQR((R*R)+ 64) 3010 A=A+ATN(8/R) 3020 RETURN 3030 PRINT "THE CHOICES ARE :" 3040 REM AMINO ACID SELECTION 3050 PRINT 3060 PRINT "GLY ALA VAL LEU ILE SER THR" 3070 PRINT 3080 PRINT "ASP ASN GLU GLN LYS HIS ARG" 3090 PRINT 3100 PRINT "PHE TYR TRY CySH MET PRO" 3110 PRINT 3120 INPUT "TYPE YOUR ANSWER :";A$ 3130 RETURN 3140 REM DRAW 6-MEMBER RING 3150 XX=X+3*Z 3160 LINE (X,Y)-(X+Z,Y-Z) 3170 LINE -(X+3*Z,Y-Z) 3180 LINE(X+3*Z,Y-Z)- (X+4*Z,Y) 3190 LINE -(X+3*Z,Y+Z) 3200 LINE -(X+Z,Y+Z) 3210 LINE -(X,Y) 3220 RETURN 3230 REM DELAY SUBROUTINE 3240 FOR J=1 TO D 3250 Q=SIN(Q) 3260 NEXT 3270 RETURN 3280 REM DRAW 5-MEMBER RING 3290 XX=X+2*Z 3300 LINE (X,Y)-(X-7+2*Z,B(5)) 3310 LINE (X+6+2*Z,B(5))-(A(1),Y) 3320 GOTO 3190 3330 REM DRAW STICK FORMULA 3340 LINE(X,Y+Z)-(X,Y) 3350 LINE -(X-Z/8,Y+Z/8) 3360 LINE (X,Y)-(X+Z/8,Y+Z/8) 3370 XX=X 3380 B(5)=Y+Z+5 3390 Q=Z/(C-1) 3400 P=Y+Z/12 3410 FOR I=2 TO C-1 3420 P=P+Q 3430 LINE (X,P)-(X+L(I)*Z/5,P) 3440 NEXT 3450 GOTO 3120 3460 PRINT 2 REM BACK SEED SIMULATION 20 DIM I(50),O(50),T0(50),T6(50) 30 REM D IS DEATH COEFF., P+1 IS HARVEST PERIOD 40 D=.01 41 P=9 50 PRINT "TIME X S PLOT OF X" 51 PRINT 56 T1=.2 57 T2=60 58 T3=1 80 LET N=2 86 O(1)=1 88 O(2)=50 98 T=INT(T2/T1+.5):T1=T2/T:T=INT(T3/T1+.5):T3=T*T1:T=0:T4=0 99 T8=1:GOTO1000 100 IF(T-T4+T1/10)<0 THEN 125 110 T4=T4+T3:T5=INT(T/T1+.5):T=T5*T1:GOSUB 2000 115 IF(T-T2+T1/10)<0 THEN 125 120 PRINT:PRINT"END":STOP 125 ON T8 GOTO 300,400,500,600 145 PRINT"** ERROR **":STOP 300 FOR T5=1 TO N 305 T0(T5)=T1*I(T5):T6(T5)=O(T5):O(T5)=O(T5)+T0(T5)/2 320 NEXT T5 330 T=T+T1/2:T8=2:GOTO1000 400 FOR T5=1 TO N 410 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7/2 420 NEXT T5 430 T8=3:GOTO1000 500 FOR T5=1 TO N 510 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7 520 NEXT T5 530 T8=4:T=T+T1/2:GOTO1000 600 FOR T5=1 TO N 605 O(T5)=T6(T5)+(T0(T5)+T1*I(T5))/6 610 NEXT T5 620 T8=1:GOTO 1000 1000 I(1)=O(1)*(M-D) 1010 I(2)=-2*M*O(1) 1020 M=.5*O(2)/(4+O(2)) 1999 GOTO 100 2000 B=30+O(1) 2010 PRINT T;O(1);O(2);TAB(B);"*" 2020 IF T>P THEN GOTO 2050 2045 RETURN 2050 P=P+10 2060 O(1)=O(1)/10 2075 T6(1)=O(1) 2080 O(2)=41 2095 T6(2)=O(2) 2999 RETURN T>P THEN GOTO 2050 2045 RETURN 2050 P=P+10 2060 O(110 REM GOES WITH BODE PROGRAM, H. BUNGAY 1985 20 REM PLOT BODE 30 DIM Q1(5000) 40 CLS 50 SCREEN 1,1 60 KEY OFF 70 PRINT"TIME RELATIONSHIPS CAN BE GRAPHED TO SHOW GAIN AND PHASE." 80 PRINT"INPUT CAN BE GREATER OR SMALLER IN AMPLITUDE THAN THE OUTPUT." 90 PRINT 100 PRINT"THE RATIO OF OUTPUT TO INPUT IS CALLED GAIN." 110 PRINT 120 PRINT"THE LAG OF OUTPUT IS CALLED PHASE SHIFT." 130 PRINT"PHASE SHIFT IS EASILY SEEN AS THE TIME DISPLACEMENT FOR CROSSING THE AXIS." 140 PRINT"IT IS EXPRESSED AS DEGREES OF THE SINE." 150 PRINT 160 PRINT"OBSERVE THE RESPONSE TO A SINUSOIDAL INPUT :" 170 INPUT"TYPE RETURN.";A 180 CLS 190 LINE(20,20)-(20,160) 200 LINE -(280,160) 210 LINE(20,90)-(280,90) 220 LOCATE 22,15 230 PRINT"TIME" 240 LOCATE 5,15 250 PRINT"A INPUT" 260 LOCATE 8,22 270 PRINT"B" 280 LOCATE 9,34 290 PRINT"OUTPUT" 300 LINE(20,90)-(21,90) 310 X1=20 : Y1=120 320 FOR X=20 TO 280 330 Y=90 +50*SIN(X/10 ) 340 LINE(X1,Y1)-(X,Y) 350 Y1=Y 360 Y=90 +30*SIN((X+10)/10) 370 PSET(X,Y) 380 X1=X 390 NEXT 400 LINE(100,40)-(130,40) 410 LINE(140,60)-(170,60) 420 LINE(115,40)-(115,90) 430 LINE(155,60)-(155,90) 440 LOCATE 23,1 450 PRINT"THE GAIN RATIO IS DISTANCE B OVER DISTANCE A." 460 PRINT"THE PHASE LAG IS C." 470 LINE(126,60)-(126,135) 480 LINE(178,60)-(178,135) 490 LINE(126,130)-(178,130) 500 LOCATE 17,20 510 PRINT"C" 520 INPUT A 530 CLS 540 PRINT"GAIN AND PHASE SHIFT AS FUNCTIONS OF FREQUENCY ARE SHOWN AS A BOD DIAGRAM." 550 PRINT"THE MAN'S NAME RHYMES WITH CODE, BUT MOST PEOPLE RHYME IT WITH COD ." 560 PRINT 570 PRINT"THE ABSCISSA IS LOGARITHM OF FREQUENCY." 580 PRINT"GAIN IS ALSO LOGARITHM BUT PHASE IS ARITHMETIC (SEMI-LOG PLOT)." 590 PRINT : INPUT"TYPE RETURN";A 600 CLS 610 GOSUB 860 620 X=1.1 630 X=1.09 *X 640 Y=12+20*LOG((X*X*.0001)+1) 650 PL=20 + 40*LOG(X) 660 PSET(PL,Y) 670 TH=ATN(X*.01) 680 YL=104+ 25*TH 690 PSET (PL,YL) 700 IF X<999 THEN 630 710 INPUT"RETURN TO CONTINUE";A 720 CLS 730 PRINT"These are standard shapes." 740 PRINT"The phase shift is alway 0 at low" 750 PRINT"frequencies and approaches -90 degrees" 760 PRINT"at high frequencies." 770 PRINT 780 PRINT"Gain is 1 (relative to total gain)" 790 PRINT"and falls with the slope shown at" 800 PRINT"high frequencies." 810 PRINT 820 INPUT"TYPE A TO SEE DIAGRAM AGAIN, other to go on.";A$ 830 IF A$="A" THEN 570 840 GOTO 1140 850 REM DRAW GRIDS AND LABELS 860 LINE(20,10)-(20,198) 870 LOCATE 25,16 880 PRINT"FREQUENCY" 890 LOCATE 2,1 900 PRINT"1.0" 910 LOCATE 13,1 920 PRINT"0.1" 930 PRINT" 0" 940 PRINT : PRINT" 45" 950 LOCATE 7,1 :PRINT"GAIN" 960 LOCATE 17,1 :PRINT"PHASE" 970 PRINT" 90" 980 PRINT :PRINT : PRINT" 135" 990 PRINT : PRINT" 180" 1000 PRINT" 1 10 100 1000" 1010 FOR C=1 TO 10:GOSUB 1110 :GOSUB 1530 : NEXT 1020 FOR C=20 TO 90 STEP 10 :GOSUB 1110 :NEXT 1030 FOR C=100 TO 1000 STEP 100 1040 GOSUB 1110 : NEXT 1050 FOR C= 1 TO 5 1060 PL=104 + 20*C 1070 LINE(20,PL)-(320,PL) 1080 NEXT 1090 GET (0, 7)-(311,199),Q1 1100 RETURN 1110 X=20 + 40*LOG(C) 1120 LINE(X, 0)-(X,198) 1130 RETURN 1140 REM 2ND ORDER 1150 CLS 1160 PRINT"LET'S SEE BODE DIAGRAMS FOR 2ND ORDER SYSTEMS." 1170 PRINT 1180 PRINT"ALL 1ST ORDER SYSTEMS HAD THE SAME SHAPE." 1190 PRINT"DAMPING FACTOR DETERMINES SHAPE FOR 2ND ORDER SYSTEMS." 1200 INPUT A$ 1210 CLS 1220 LOCATE 1,1 1230 INPUT"SPECIFY THE DAMPING FACTOR (.2 TO 5).";Z 1240 IF Z<0 THEN 1280 1245 IF Z=0 THEN 1210 1250 IF Z<.1 THEN Z=1 1260 GOSUB 1390 1270 GOTO 1220 1280 CLS 1290 PRINT"For a given damping coefficient, the" 1300 PRINT"shapes are standard." 1310 PRINT"Gain eventually falls at twice the" 1320 PRINT"slope as for a 1st-order system." 1330 PRINT 1340 PRINT"Phase shift approaches -180 degrees" 1350 PRINT"at high frequency." 1360 PRINT :PRINT"There are characteristic BODE" 1370 PRINT"diagrams for other blocks." 1380 PRINT :PRINT"THIS IS ENOUGH FOR NOW." : STOP 1390 PUT(5, 7),Q1 1400 X=1.1 1410 X=1.09 *X 1420 X1=1-X*X*.0001 1430 Y=LOG((X1*X1)+.0004*Z*Z*X*X) 1440 Y=12 + 20*Y 1450 PL=20 + 40*LOG(X) 1460 PSET(PL,Y) 1470 TH=ATN(2*Z*X*.01/X1) 1480 IF TH<0 THEN TH=3.1417+TH 1490 YL=104+ 25*TH 1500 PSET (PL,YL) 1510 IF X<999 THEN 1410 1520 RETURN 1530 Y= 104-40*LOG(C) 1540 LINE(20,Y)-(320,Y) 1550 RETURN 10 REM PROCESS DYNAMICS TUTORIAL, H.BUNGAY 1985 20 DIM I(50),O(50),T0(50),T6(50) 30 DIM Q1(400),Q2(400),Q3(400),Q5(400) 40 DIM Q(400) 50 SCREEN 1,1 60 KEY OFF 70 CLS 90 PRINT"This is a quick introduction to" 100 PRINT"frequency response analysis." 110 PRINT"Let's first consider process dynamics." 120 PRINT 130 PRINT"Very often, the rate of response is" 140 PRINT"proportional to the driving force." 150 PRINT"A mathematical expression is:" 160 PRINT 170 PRINT" dR/dt = K * ( F - R ) 180 PRINT 190 PRINT" where dR/dt = rate of response" 200 PRINT" K = coefficient" 210 PRINT" F = final value" 220 PRINT" R = present value" 230 PRINT 240 INPUT"HIT RETURN TO MOVE ON.";A 250 CLS 260 PRINT"Consider the indication of a thermometer." 270 PRINT"It takes time for the reading to" 280 PRINT"adjust when the thermometer is" 290 PRINT"placed in a new environment." 300 PRINT 310 PRINT"Please answer the following:" 320 PRINT" T for TRUE, F for FALSE" 330 PRINT 340 PRINT"The rate of change of the reading:" 350 INPUT"depends on the thickness of glass.";A$ 360 IF A$ = "T" THEN 380 370 PRINT :PRINT"THICKER GLASS MEANS SLOWER CHANGE." 380 PRINT :INPUT"depends on the mass of mercury.";A$ 390 IF A$="T" THEN 410 400 PRINT"MORE MASS MEANS SLOWER CHANGE." 410 LOCATE 20,1 420 PRINT"LET'S LUMP ALL THE PHYSICAL FACTORS" 430 PRINT"AND CALL THEM THERMAL CONDUCTIVITY." 440 INPUT"MINUS NUMBERS MOVE YOU ON. TYPE RETURN";A 450 CLS 460 GOSUB 1990 470 LINE(250,150)-(320,190),,BF 480 LOCATE 1,1 490 INPUT"SPECIFY THERMAL CONDUCTIVITY";K 500 Z=1 510 IF K=0 THEN 450 520 IF K<0 THEN 580 530 N=1 540 GOSUB 2510 550 GOSUB 2110 560 GOSUB 2600 570 GOTO 470 580 CLS 581 PRINT"You now realize that a small" 582 PRINT"constant means slow response." 583 PRINT 584 PRINT"If you were trying to control a very" 585 PRINT"touchy process, a sluggish thermometer" 586 PRINT"may be no good." 587 PRINT 590 PRINT"THE BARE THERMOMETER IS NEARLY AN" 600 PRINT"IDEAL 1ST ORDER SYSTEM." 610 PRINT :PRINT"All have the greatest RATE of" 620 PRINT"response to a step at time = 0." 630 PRINT 631 PRINT"DRIVING FORCE IS GREATEST JUST AFTER" 632 PRINT"PLUNGING, SO RATE OF RESPONSE IS MAX." 634 PRINT 640 PRINT"LET'S CONSIDER A THERMOMETER WITH SHEATH." 650 INPUT"HIT RETURN.";A 660 CLS 670 N=2 680 GOSUB 1990 690 Z=2 700 LINE(250,150)-(320,190),,BF 710 LINE(275,100)-(295,125),,B 720 LOCATE 1,1 730 INPUT "THERMOMETER CONDUCTIVITY ";K 740 IF K<0 THEN 830 750 IF K=0 THEN 660 760 INPUT "CONDUCTIVITY OF SHEATH ";K1 770 GOSUB 2510 780 LINE(275,140)-(295,168),0,B 790 GOSUB 2110 800 GOSUB 2600 810 LINE(275,107)-(295,132),,B 820 GOTO 720 830 LOCATE 22,1 840 PRINT"THIS IS TWO 1ST-ORDER SYSTEMS IN SERIES." 842 PRINT"TWO 1st-ORDER MAKE A 2nd-ORDER." 850 PRINT"SECOND ORDER SYSTEMS ALWAYS HAVE" 860 PRINT"A LAG AT TIME = 0 PRIOR TO THE" 870 PRINT"MAXIMUM RATE OF RESPONSE TO A STEP." 880 INPUT"TYPE RETURN ";A 890 CLS 900 PRINT"Truly second-order systems have" 910 PRINT"damping, a property not seen for two" 920 PRINT"first-order systems in series." 930 PRINT :PRINT"A weight hanging on a spring is 2nd" 940 PRINT"order because force changes with" 950 PRINT"displacement and force determines accelleration." 960 PRINT :PRINT"Consider this system :" 970 LINE (60,100)-(150,100) 980 FOR X=60 TO 140 STEP 10 990 LINE (X+3,100)-(X+12,90) 1000 CIRCLE(105, 46+X),6 1010 NEXT 1020 LINE (80,150)-(130,195),,BF 1030 INPUT A 1040 CLS 1050 GOSUB 2030 1060 LOCATE 9,2 1070 PRINT"POSITION " 1080 LOCATE 1,1 1090 PRINT"THE BLOCK HAS AN INITIAL DISPLACEMENT." 1100 INPUT"TYPE DAMPING COEFFICIENT";K1 1110 IF K1=0 THEN 1040 1120 IF K1<0 THEN 1230 1130 U=1 1140 K1=K1*2 1150 O(1)=0 1160 O(2)=-60 1170 T3=1 1180 N=2 1190 T2=20 1200 T1=.25 1210 GOSUB 2170 1220 GOTO 1080 1230 CLS 1240 LINE (40,45)-(70,55),,B 1250 LINE (50,41)-(62,45),,B 1260 CIRCLE (42,58),4 1270 CIRCLE (68,58),4 1280 GET (38,30)-(72,62),Q1 1290 LINE (100,30)-(150,55),,B 1300 LINE (85, 40)-(100,55),,B 1310 CIRCLE (104,59),5 1320 CIRCLE (146,59),5 1330 CIRCLE (92,59),5 1340 GET (85,30)-(152,65),Q2 1350 CLS 1360 PRINT"FOR RAPID DISTURBANCES, THE SYSTEM" 1370 PRINT"MAY NOT HAVE TIME TO RESPOND." 1380 PRINT"CONSIDER A SPORTS CAR AND A TRUCK." 1390 PRINT"SEE THEM MOVING ON THE ROAD." 1400 PRINT :PRINT"THE CAR IS RESPONSIVE." 1410 PRINT"THE TRUCK IS SLUGGISH." 1420 PUT (80,57),Q1 1430 PUT (140,57),Q2 1440 N=0 1450 GOSUB 1820 1460 GOSUB 1860 1470 N=N+1 1480 IF N<15 THEN 1460 1490 CLS 1500 A1=25 1510 S=.3 1520 A2=25 1530 PRINT"CONSIDER MOVING THE ACCELLERATOR PEDAL SLOWLY IN A SINUSOIDAL MANN R." 1540 PRINT"EACH VEHICLE RESPONDS WELL." 1550 PRINT"THE DISTANCE BETWEEN STAYS CONSTANT." 1560 N=10 1570 GOSUB 1920 1580 CLS 1590 PRINT"AT HIGHER FREQUENCY, THE LIGHT CAR" 1600 PRINT"CONTINUES TO RESPOND WELL, BUT THE" 1610 PRINT"HEAVY TRUCK RESPONDS POORLY." 1620 PRINT :PRINT"SEPARATION CHANGES DURING THE SINE CYCLE." 1630 A1=20 1640 A2=3 1650 S=.9 1660 N=20 1670 GOSUB 1920 1680 CLS 1690 PRINT"AT HIGH FREQUENCY, NEITHER RESPONDS." 1700 PRINT"EACH APPEARS TO HAVE CONSTANT VELOCITY" 1710 PRINT"EVEN THOUGH THE PEDAL OSCILLATES." 1720 N=0 1730 PUT (80,57),Q1 1740 PUT (140,57),Q2 1750 N=0 :GOSUB 1820 1760 GOSUB 1860 1770 N=N+1 1780 IF N<12 THEN 1760 1790 INPUT A 1800 RUN "BODC" 1810 REM MOVING ROAD 1820 FOR X= 10 TO 300 STEP 20 1830 LINE (X,90)-(X+10,90) 1840 NEXT X 1850 GET (1,90)-(300,91),Q3 1860 FOR X= 1 TO 10 1870 LINE (1,90)-(310,90),0 1880 M=X+1 1890 PUT (M,90),Q3 1900 NEXT 1910 RETURN 1920 FOR Z=.1 TO N STEP S 1930 P=SIN(Z) : M1=90+P*A1 : M2=190+P*A2 1940 PUT(M1,58),Q1 : PUT(M2,55),Q2 1950 GOSUB 1860 1960 PUT(M1,58),Q1 : PUT(M2,55),Q2 1970 NEXT 1980 RETURN 1990 LINE(280,10)-(290,120),,BF 2000 LINE(250,135)-(250,160) 2010 LINE(319,135)-(319,160) 2020 CIRCLE(285,125), 8 2030 LINE(100,20)-(100,180) 2040 LINE -(280,180) 2050 GET(277,10)-(293,135),Q 2060 LOCATE 10,2 2070 PRINT "Temperature" 2080 LOCATE 25,22 2090 PRINT "Time" 2100 RETURN 2110 REM SPEEDED UP SIMBAS 2120 LET T1=.2 2130 LET T2=18 2140 LET T3=1! 2150 O(1)=20 2160 O(2)=20 2170 T=INT(T2/T1+.5):T1=T2/T:T=INT(T3/T1+.5):T3=T*T1:T=0:T4=0 2180 T8=1:GOTO 2410 2190 IF(T-T4+T1/10)<0 THEN 2230 2200 T4=T4+T3:T5=INT(T/T1+.5):T=T5*T1 2210 IF(T-T2+T1/10)<0 THEN 2230 2220 RETURN 2230 ON T8 GOTO 2250,2290,2330,2370 2240 PRINT"** ERROR **":STOP 2250 FOR T5=1 TO N 2260 T0(T5)=T1*I(T5):T6(T5)=O(T5):O(T5)=O(T5)+T0(T5)/2 2270 NEXT T5 2280 T=T+T1/2:T8=2:GOTO 2410 2290 FOR T5=1 TO N 2300 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7/2 2310 NEXT T5 2320 T8=3:GOTO 2410 2330 FOR T5=1 TO N 2340 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7 2350 NEXT T5 2360 T8=4:T=T+T1/2:GOTO 2410 2370 FOR T5=1 TO N 2380 O(T5)=T6(T5)+(T0(T5)+T1*I(T5))/6 2390 NEXT T5 2400 T8=1 2410 IF U=1 THEN 2670 2420 I(1)=K*(100-O(1)) 2430 I(2)=K1*(O(1)-O(2)) 2440 PL=180-O(Z)*1.4 2450 AX=100+4*T 2460 PSET(AX,PL) 2470 PL=140-.4*O(Z) 2480 LINE(282,PL)-(288,150),0,B 2490 GOTO 2190 2500 REM END OF SIMBAS SUBROUTINE 2510 REM PLUNGE THERMOM 2520 LOCATE 2,1 2530 INPUT"RETURN TO PLUNGE THERMOMETER.";A 2540 LINE(275, 2)-(295,149),0,BF 2550 PUT (277,50),Q,OR 2560 FOR C=1 TO 7 2570 CIRCLE (285,160),C,0 2580 NEXT 2590 RETURN 2600 REM THEMO DRAW 2610 LINE(277,10)-(293,185),0,BF 2620 LINE(250,150)-(320,190),,BF 2630 LOCATE 2,1 2640 PRINT" " 2650 PUT(277,10),Q 2660 RETURN 2670 I(1)=-O(2)-K1*O(1) 2680 I(2)=O(1) 2690 AX=100+8*T 2700 PL=100-O(2) 2710 PSET(AX,PL) 2720 GOTO 2190 10 REM CHROMATOGRAPHY GAME, H.BUNGAY 1979 20 CLS 30 DIM V(20),S(3),B(20),C(20),D(20),M(3) 40 DIM Q1(4000), Q2(400) 50 SCREEN 1,1 60 KEY OFF 70 LOCATE 2,7 80 PRINT"CHROMATOGRAPHY SCALE-UP GAME" 90 LINE(20,15)-(20,170) 100 LINE -(260,170) 110 LOCATE 23,3 120 PRINT"0 20 40 60 80 100" 130 PRINT" AMMONIUM SULFATE CONCENTRATION" 140 REM INIT. VARIABLES TO PREVENT /0 150 FOR I= 14 TO 20 160 V(I)=.00001 170 NEXT I 180 LOCATE 6,2 190 PRINT"C" 200 PRINT" O" 210 PRINT" N" 220 PRINT" C" 230 PRINT" E" 240 PRINT" N" 250 PRINT" T" 260 PRINT" R" 270 PRINT" A" 280 PRINT" T" 290 PRINT" I" 300 PRINT" O" 310 PRINT" N" 320 GET (5,15)-(20,165),Q2 330 LOCATE 6,2 340 PRINT"Y" 350 PRINT" I" 360 PRINT" E" 370 PRINT" L" 380 PRINT" D" 390 PRINT" " 400 PRINT" P" 410 PRINT" U" 420 PRINT" R" 430 PRINT" I" 440 PRINT" T" 450 PRINT" Y" 460 PRINT" " 470 LOCATE 10,22 480 PRINT"YIELD" 490 LOCATE 12,4 500 PRINT"PURITY" 510 LINE (20,162)-(21,162) 520 FOR C= 30 TO 99 530 Y=162-42.91*(C-30)^.4+.00028*C*C*C 540 IF Y>162 THEN Y=162 550 X=20+2*C 560 LINE -(X,Y) 570 NEXT 580 LINE (20,162)-(21,162) 590 FOR C=30 TO 99 600 GOSUB 2320 610 Y=162-(150*S2/(S1+S2+S3)) 620 X=20+2*C 630 LINE -(X,Y) 640 NEXT 650 GET ( 7,10)-(270,185),Q1 651 LOCATE 24,1 652 INPUT"ARE YOU CONTINUING FROM A PREVIOUS SESSION (Y OR N)";A$ 654 IF A$ = "Y" THEN 6000 656 IF A$ = "y" THEN 6000 660 LOCATE 24,1 670 INPUT"KG. OF LIVER TO BE PROCESSED ";K 680 INPUT"PER CENT AMMONIUM SULFATE ";C 690 GOSUB 2320 700 PRINT "YIELD = ";K*S2;" MG.",100*S2/138;"PER CENT" 710 PRINT "PURITY IN PER CENT =";100*S2/(S1+S2+S3) 720 PRINT:PRINT"COST OF PREPARATION :" 730 IF K>100 THEN GOTO 800 740 C4=2.48*K+.003*K*C 750 PRINT "COST OF LIVER = $ ";2.48*K 760 PRINT "COST OF AMMONIUM SULFATE = $ ";.003*K*C 770 V(20)=V(20)+C4+475.05 780 PRINT"LABOR AND EQUIPMENT = $ ";475.05 790 GOTO 910 800 IF K>850 THEN GOTO 870 810 C4=2.31*K+.0028*K*C 820 PRINT:PRINT "COST OF LIVER = $ ";2.31*K 830 PRINT "COST OF AMMONIUM SULFATE = $ ";.0028*K*C 840 V(20)=V(20)+C4+902.38 850 PRINT "LABOR AND EQUIPMENT = $ ";902.38 860 GOTO 910 870 C4=2.17*K 880 PRINT:PRINT"COST OF LIVER = $ ";C4 890 V(20)=C4 + V(20) + 1409.82 900 PRINT"LABOR AND EQUIPMENT = $ ";1409.82 910 N=1 920 PRINT 930 IF B(N)<.05 THEN GOTO 980 940 N=N+1 : IF N<21 THEN GOTO 930 950 PRINT"TOO MANY BATCHES. THIS WILL BE POOLED WITH BATCH 20." 960 B(20)=B(20)+K*S2:C(20)=C(20)+K*S1:D(20)=D(20)+K*S3 970 GOTO 1020 980 PRINT"THIS IS ASSIGNED AS BATCH ";N 990 B(N)=K*S2:C(N)=K*S1:D(N)=K*S3 1000 S1=0:S2=0:S3=0 1010 T1=0:T2=0:T3=0 1020 PRINT "YOU NOW HAVE THE FOLLOWING BATCHES:" 1030 FOR N= 1 TO 20 1040 IF B(N) <.1 THEN 1060 1050 PRINT "BATCH ";N;" MG. =";B(N);" PURITY =";B(N)/(B(N)+C(N)+D(N)) 1060 NEXT N 1070 PRINT:INPUT"TYPE A MINUS NUMBER TO MAKE MORE BATCHES,0 TO CONTINUE,OR TWO NUMBERS TO POOL";A 1080 IF A>-.1 THEN 1090 1082 CLS 1084 PUT (7,10),Q1 1086 GOTO 660 1090 IF A<1 THEN GOTO 1130 1100 IF A>20 THEN GOTO 1070 1110 INPUT B:B(A)=B(A)+B(B):C(A)=C(A)+C(B):D(A)=D(A)+D(B) 1120 B(B)=0:GOTO 1020 1130 PRINT:INPUT"SELECT BATCH AS FEEDSTOCK FOR CHROMATOGRAPHY";N 1140 IF N>20 THEN GOTO 1130 1150 INPUT"MG. OF ENZYME APPLIED TO COLUMN ";V(9) 1160 IF (B(N)-V(9))>0 THEN GOTO 1180 1170 PRINT"INSUFFICIENT ENZYME IN BATCH":GOTO 1130 1180 V(11)=V(9)*C(N)/B(N) 1190 V(12)=V(9) 1200 V(13)=V(9)*D(N)/B(N) 1210 P=B(N)/(B(N)+C(N)+D(N)) 1220 B(N)=B(N)-V(9) 1230 C(N)=C(N)-V(11) 1240 D(N)=D(N)-V(13) 1250 V(7)=.001*V(9)*(B(N)+C(N)+D(N))/B(N) 1260 PRINT"THIS MUCH ENZ. IS ";V(7);" G. OF PROTEIN." 1270 PRINT 1280 INPUT "DIAM. OF COLUMN ";D 1290 REM G/L OF RESIN 1300 C=V(7)/(.05*D*D) 1310 PRINT"LOADING IS ";C;" G. PER L. OF PROTEIN." 1320 INPUT "TYPE ANYTHING BUT 2 TO CONTINUE";A 1330 IF A=2 THEN 1280 1340 INPUT "SELECT ADSORBENT (1-6)";A 1345 CLS 1350 REM >6=6 AND <1=1 1360 A=INT(A) 1370 IF A>6 THEN A=6 1380 IF A<2 THEN 1440 1390 M=7*(A-1) 1400 REM DUMMY READ TO COUNT TO DATA 1410 FOR I=1 TO M 1420 READ Y 1430 NEXT I 1440 READ S(1),S(2),S(3),M(1),M(2),M(3),R 1450 RESTORE 1460 IF R-C>0 THEN 1500 1470 PRINT "COLUMN OVERLOADED WITH PROTEIN." 1480 V(8)=1.2+C-R 1490 GOTO 1520 1500 V(8)=1+.06*D/(R-C) 1510 REM ADJ. FOR CAPACITY AND DIAM. 1512 PUT (5,15),Q2 1513 LINE (20,162)-(220,162) 1514 LOCATE 22,9 1515 PRINT"FRACTION NUMBER" 1520 FOR I=1 TO 3 1530 S(I)=S(I)*V(8) 1540 NEXT I 1550 V(4)=0 1560 V(10)=0 1570 REM SET X, FRACT. NO., =0 1580 X=0 1590 X=X+1 1592 X1=20+8*X 1600 IF X>20 THEN 1920 1630 REM NORMAL DIST. EQN. 1640 F=20+2*SQR(.1*C) 1650 FOR I=1 TO 3 1660 A=.5*(X-M(I))*(X-M(I))/(S(I)*S(I)) 1670 V(I)=.001*F*V(I+10)*EXP(-A/S(I)) 1680 NEXT I 1690 REM V(4) IS ENZYME,V(5) IS TOTAL STUFF,V(10) IS PRODUCT 1700 V(4)=V(4)+V(2) 1710 V(5)=V(1)+V(2)+V(3)+.000001 1720 T1=T1+V(1) 1730 T2=T2+V(2) 1740 T3=T3+V(3) 1760 Y=162-5*V(5) 1762 IF Y<1 THEN Y=1 1810 IF V(2)/V(5)>.94 THEN 1900 1825 LINE(X1,Y)-(X1+5,162),,B 1840 REM ACCUMULATE ENZ. IN BAD FRACT. 1850 IF V(2)/V(5)<.4 THEN 1590 1860 S1=S1+V(1) 1870 S2=S2+V(2) 1880 S3=S3+V(3) 1890 GOTO 1590 1900 LINE(X1,Y)-(X1+5,162),,BF 1902 V(10)=V(10)+V(2) 1910 GOTO 1590 1920 LOCATE 24,1 1925 INPUT"TYPE RETURN ";A 1927 CLS 1930 Y=V(9)*V(10)/V(4) 1940 PRINT "YIELD =";Y;"MILLIGRAMS.",100*V(10)/V(4);"PER CENT" 1950 V(19)=V(19)+Y 1960 C2=400+55*D 1970 C3=35*D*D 1980 C5=C2+C3 1990 V(17)=V(14)+V(15)+V(16) 2000 V(18)=V(18)+V(15)*V(9)/V(4) 2010 S1=S1*V(11)/T1 2020 S2=S2*V(12)/T2 2030 S3=S3*V(13)/T3 2040 PRINT 2050 PRINT "COSTS : $ ";C2,"FOR LABOR AND ASSAYS" 2060 PRINT TAB(10);C3,"FOR MATERIALS" 2070 PRINT "TOTAL $";TAB(10);C5 2080 V(20)=V(20)+C5 2090 IF Y<.01 THEN 2140 2100 PRINT 2110 PRINT "PER MG. COST $";C5/Y 2120 PRINT "TOTAL MG. COLLECTED =";V(19),"AT $";V(20)/V(19);"PER MG." 2130 PRINT "INCLUDING ALL BATCH COST FOR AMM. SULFATE STEP." 2140 PRINT 2150 PRINT"SIDE FRACTIONS OF REASONABLE PURITY HAVE BEEN POOLED." 2155 INPUT"TYPE C TO CONTINUE, TYPE S TO QUIT AND SAVE.";S$ 2157 IF S$="S" THEN 5000 2160 K=1 2170 GOTO 910 2180 IF V(9)=0 THEN 260 2190 IF V(9)=>V(18) THEN 2150 2200 V(7)=V(9)*V(17)/V(15) 2210 FOR I=1 TO 3 2220 V(I+10)=V(I+13)/V(17) 2230 V(I+13)=0 2240 NEXT I 2250 V(18)=V(18)-V(9) 2260 C4=0 2270 GOTO 1280 2280 END 2290 DATA 1.2,1.2,1.18,3.1,9.12,14.1,8.8,1.3,1.2,1.3,3,9.100001,14.9,9 2300 DATA 1.3,1.2,1.2,5.1,11,16.1,12,1.19,1.29,1.3,2.9,5,13.1,9 2310 DATA 1.1,1.1,1.2,2.4,8.3,15,5,1.2,1.3,1.25,4.6,8,13.7,12 2320 S1=490-ABS(.5*(65-C)*(65-C)) 2330 S2=42.91*(C-30)^.4-.00028*C*C*C 2340 S3=401!-.21*(80-C)*(80-C) 2350 IF S1<1 THEN S1=2.21 2355 IF C<30 THEN S2=0 2360 IF S2<0 THEN S2=0 2370 IF S3<7 THEN S3=8.1234 2380 RETURN 5000 OPEN "CSAVE" FOR OUTPUT AS #1 5010 PRINT #1, V(19), V(20) 5020 FOR N= 1 TO 20 5030 IF B(N) < .1 THEN 5100 5040 PRINT #1, B(N), C(N), D(N) 5100 NEXT 5104 PRINT #1,0,0,0,0,0,0,0,0 5110 CLOSE 1 5120 STOP 6000 OPEN "CSAVE" FOR INPUT AS #1 6010 INPUT #1, V(19), V(20) 6020 PRINT V(19), V(20) 6030 N=0 6032 N=N+1 6040 INPUT #1, B(N) 6050 IF B(N)<.1 THEN 6070 6055 INPUT #1, C(N),D(N) 6060 GOTO 6032 6070 CLOSE 1 6110 GOTO 1000 C CHROMOTOGRAPHY GAME, H. BUNGAY 1979 C C FORTRAN VERSION C BY MARC S. PALLER C C ALTERED BY JAMES GASTON C TO PLOT TOTAL OUTPUT C % PURITY C AND 94% PURE LINE. C C MAJOR REVISION FOR AMMONIUM SULFATE PRECIP. BUNGAY , JULY 1982 C FIXED UP COEFFICIENTS 12/22/82 REAL Y2(20),Y(20),Y1(20),X1(20),PURITY,DIAMET,V(20),K,S(42), * TOTAL, YIELD,EQUIP,FEEDST,KG,LABOR,AMSUL,PERCNT,SOL(3),LIVER(3), * CAKE(3),BATCH(20),B(20),BC(20),BD(20) DATA S(1)/1.2/,S(2)/1.2/,S(3)/1.18/,S(4)/3.1/,S(5)/9.1/ *,S(6)/14.1/,S(7)/8.8/,S(8)/1.3/,S(9)/1.2/,S(10)/1.3/,S(11)/ *3.0/,S(12)/9.1/,S(13)/14.9/,S(14)/9.0/,S(15)/1.1/, *S(16)/1.1/,S(17)/1.2/,S(18)/2.4/,S(19)/8.3/,S(20)/15.0/, *S(21)/5.0/,S(22)/1.2/,S(23)/1.3/,S(24)/1.4/,S(25)/4.6/, *S(26)/8.0/,S(27)/13.7/,S(28)/12.0/,S(29)/1.1/, *S(30)/1.19/,S(31)/1.28/,S(32)/3.0/,S(33)/9.3/,S(34)/14.4/, *S(35)/5.2/,S(36)/1.18/,S(37)/1.21/,S(38)/1.25/, *S(39)/4.9/,S(40)/9.0/,S(41)/15.2/,S(42)/15.1/ WRITE(1,1) 1 FORMAT('1',/,/,/,10X,'CHROMATOGRAPHY SCALE-UP GAME', */,'YOU MUST ACCUMULATE CRUDE ENZYME FROM AMMONIUM SULFATE STEPS', */,'LIVER COSTS $2.48/KG UP TO 100, THEN $2.14',/, *'LABOR COST DEPENDS ON BATCH SIZE',/,'ONE PERSON FOR <100KG', */,'TWO PERSONS FOR <850, 3 FOR V. LARGE BATCHES.') C C INITIALIZING SPECIFIC VARIABLES C C SUBSCRIPT V( ) FOR EASE OF HANDLING ? C B(I) FOR ENZYME STOCKPILE, BC( ), BD( ) FOR IMPURITIES DO 31 I=1,20 C=0.0 Y(I)=0.0 Y1(I)=0.0 B(I)=0.0 BC(I)=0.0 BD(I)=0.0 X1(I)=0.0 31 CONTINUE IFLAG=0 WRITE(1,1241) 1241 FORMAT(/,'YOU MAY ENTER CRUDE BATCHES FROM PREVIOUS RUNS.', */,'TYPE 0 TO OMIT OR QUIT.',/,'ENTER BATCH NO:',/, *'MG. OF ENZYME:',/,'PURITY:') READ(1,*) N IF (N.LT.1) GO TO 1108 READ(1,*) B(N) READ(1,*) PURITY BD(N)=(B(N)-PURITY*B(N))/(3.0*PURITY) BC(N)=2.0*BD(N) GO TO 31 1108 I=C/4.0 S1=499.0-ABS(0.5*(65.0-C)*(65.0-C)) C THIS CALC THE SOLUBILITIES OF THREE MAJOR COMPONENTS S2=138.0-ABS(0.12*(60.0-C)*(60.0-C)) S3=401.0-0.21*(80.0-C)*(80.0-C) IF(S1-30.) 1102,1102,1103 C A SMALL AMOUNT OF THE IMPURITIES ALWAYS PPTS., GOODIES CAN=0 1102 S1=30.1 1103 IF(S2) 1104,1105,1105 1104 S2=0.0 1105 IF(S3-15.) 1106,1106,1107 1106 S3=15.123 1107 CONTINUE X1(I)=C Y1(I)=S2/139.0 Y2(I)=S2/(S1+S2+S3) C=C+4.0 IF (C-81.0) 1108,1101,1101 C PLOT YIELD AND PURITY OF ENZYME 1101 CALL GRESET CALL ENTGRA CALL SET2D CALL INIT(-1.0,-1.0) CALL QCALE(0.0,75.0,6.0,0) CALL QCALE(0.0,0.9,4.0,1) CALL XLINAX('PER CENT AMMONIUM SULFATE',25,6.0) CALL YLINAX('YIELD , PURITY',15,4.0) CALL DATLIN(X1,Y1,20,2,1,1) CALL DATLIN(X1,Y2,20,4,1,1) CALL EXITGR JFLAG=0 C SET V() TO V. SMALL NO. DO 2 I=14,20 V(I)=1.0E-05 2 CONTINUE 1269 WRITE(1,3) 3 FORMAT(/,2X,'KG. OF LIVER TO BE PROCESSED ?') READ(1,*)K 4 FORMAT(F10.2) WRITE(1,1210) 1210 FORMAT(/,2X,'PER CENT AMMONIUM SULFATE TO ADD ?') READ(1,*) C CALL GRESET S1=490.0-ABS(0.5*(65.0-C)*(65.0-C)) IF (S1.LT.0.0) S1=2.21 S2=138.8-ABS(0.12*(60.0-C)*(60.0-C)) IF (S2.LT.0.0) S2=0.0 S3=401.1-0.21*(80.0-C)*(80.0-C) IF (S3.LT.0.0) S3=9.123 YIELD=S2*K CL=902.38 C CL IS COST OF LABOR IF (K.LT.100.0) CL=475.05 IF (K.GT.850.0) CL=1409.82 CG=2.38*K IF (K.LT.100.0) CG=2.48*K IF (K.GT.850.0) CG=2.14*K C CA IS COST OF AMMONIUM SLFATE CA=0.00283*C*K C4=CG+CA+CL C COSTS ARE FUNCTIONS OF SCALE, LARGER AMTS OF LIVER COST LESS WRITE(1,1400) CG,CA,CL,C4 1400 FORMAT(/,20X,'COSTS',/,2X,'LIVER',12X,F10.2,/,2X,'AMMONIUM SULFATE * ',F10.2,/,2X,'LABOR',12X,F10.2,/,2X,'TOTAL',10X,F12.2) V(20)=V(20)+C4 P=100.0*S2/138.1 PURITY=S2/(S1+S2+S3) WRITE(1,1220) YIELD,P,PURITY 1220 FORMAT(/,2X,'YIELD = ',F12.1,' MG. OR ',F6.2,' PER CENT', */,2X,'PURITY = ',F5.4) C C ADJUST AMOUNTS OF MAJOR COMPONENTS N=1 1130 IF (B(N)-.9) 1140,1140,1150 1150 N=N+1 IF (N-20) 1130,1130,1160 1160 WRITE(1,1230) 1230 FORMAT(/,2X,'TOO MANY BATCHES. WILL BE POOLED WITH BATCH 20.') B(20)=B(20)+K*S2 BC(20)=BC(20)+K*S1 BD(20)=BD(20)+K*S3 GO TO 1170 1140 WRITE(1,1240) N 1240 FORMAT(/,2X,'THIS IS ASSIGNED AS BATCH ',I2) B(N)=K*S2 BC(N)=K*S1 BD(N)=K*S3 1170 S1=0.0 S2=0.0 S3=0.0 T1=0.0 T2=0.0 T3=0.0 1271 WRITE(1,1250) 1250 FORMAT(/,2X,'YOU NOW HAVE THE FOLLOWING BATCHES :') DO 1180 N=1 ,20 IF(B(N)-0.9) 1180,1180,1171 1171 PURITY=B(N)/(B(N)+BC(N)+BD(N)) WRITE(1,1260) N,B(N),PURITY 1260 FORMAT(/,2X,'BATCH ',I2,' MG. = ',F10.1,' PURITY = ',F5.4) 1180 CONTINUE C WRITE(1,603) 603 FORMAT(/,/,2X,'DO YOU WISH TO TERMINATE THIS SESSION' *,/,50X,' (YES OR NO)') JFLAG=0 READ(1,111) ANS 111 FORMAT(A3) IF(ANS.EQ.'YES')GO TO 1000 WRITE(1,1264) 1264 FORMAT(/,2X,'TYPE A MINUS NO. TO MAKE MORE BATCHES, TYPE 0 TO *',/,2X,'CONTINUE TO CHROMATOGRAPHY, OR TWO NO. TO POOL BATCHES.') READ(1,1263) N IF (N) 1101,1267,1268 1268 READ(1,*) N1 B(N)=B(N)+B(N1) BC(N)=BC(N)+BC(N1) BD(N)=BD(N)+BD(N1) B(N1)=0.0 GO TO 1271 1267 WRITE(1,1262) 1262 FORMAT(/,2X,'TYPE BATCH NO. FOR CHROMATOGRAPHY') READ(1,1263) N IF(N.GT.20) GOTO 1271 IF(B(N).LT.1.0) GOTO 1271 1263 FORMAT(I2) 332 WRITE(1,5) 5 FORMAT(/,2X,'ENTER MG. OF ENZYME APPLIED TO COLUMN (F FORMAT)') READ(1,*)V(9) IF(B(N)-V(9)) 340,341,341 340 WRITE(1,1265) 1265 FORMAT('INSUFFICIENT ENZYME IN THIS BATCH.') GO TO 332 341 CONTINUE V(11)=V(9)*BC(N)/B(N) V(12)=V(9) P=B(N)/(B(N)+BC(N)+BD(N)) V(13)=V(9)*BD(N)/B(N) V(7)=0.001*V(9)/P B(N)=B(N)-V(9) BC(N)=BC(N)-V(11) BD(N)=BD(N)-V(13) WRITE(1,7)V(7) 7 FORMAT(/,/,11X,'THIS IS ',F7.3,' GRAMS OF PROTEIN.') 100 WRITE(1,8) 8 FORMAT(/,2X,'ENTER THE DIAMETER OF THE COLUMN (F FORMAT) IN CM') READ(1,*)DIAMET C C GRAMS PER LITER OF RESIN C C=V(7)/(0.05*DIAMET*DIAMET) WRITE(1,10)C 10 FORMAT(/,/,11X,'THE LOADING IS ',F9.4,' GRAMS/LITER OF PROTEIN *',/,/,11X,'DO YOU WISH TO USE THIS LOADING (YES OR NO)') READ(1,11)ANS 11 FORMAT(A3) IF(ANS.EQ.'NO')GO TO 100 WRITE(1,1242) 1242 FORMAT(/,/,'ADSORBENT PRICE DOES NOT RELATE TO PERFORMANCE', */,'BUT PRICES PER L ARE:',/,2X,'ADSORBENT PRICE') DO 41 N=1,6 CRESIN=N CRESIN=104.13*SQRT(CRESIN) WRITE(1,1243) N,CRESIN 1243 FORMAT(4X,I1,4X,'$',F7.2) 41 CONTINUE WRITE(1,12) 12 FORMAT(/,/,'SELECT ADSORBENT FROM 1 TO 6 (I FORMAT)') READ(1,13) NADSOR 13 FORMAT(I1) C IF ADSORBANT IS LESS THAN 1 IT IS SET EQUAL TO 1 C IF ADSORBANT IS GREATER THAN 6 IT IS SET EQUAL TO 6 C C IF(NABSOR.GT.6)NADSOR=6 M=1+7*(NADSOR-1) IF(NADSOR.LE.1)M=1 C C DUMMY DATA ASSIGNED THROUGH DATA STATEMENT C TEMP4=S(M+6)-C IF(TEMP4.GT.0.0)GO TO 300 IFLAG=1 V(8)=1.2-TEMP4 GO TO 200 300 V(8)=1.0+0.06*DIAMET/(TEMP4+0.7) C ABOVE CORRECTS FOR DIAM AND LOADING, 0.7 PREVENTS SMALL DIVIDE C C ADJUST FOR CAPACITY AND DIAMETER C 200 DO 21 I=1,3 S(I+M-1)=S(I+M-1)*V(8) 21 CONTINUE V(4)=0.0 V(10)=0.0 C C SET X, FRACTION NUMBER EQUAL TO ZERO C LL IS FLOAT FOR INDEXING AND TO SET ABSCISSA FOR PLOT C X=0.0 650 X=X+1.0 IF(X.GT.20.0)GO TO 400 LL=IFIX(X) X1(LL)=FLOAT(LL) C C NORMAL DISTRIBUTION EQUATION C F=20.0+2.0+SQRT(0.1*C) DO 22 I=1,3 A=0.5*(X-S(M+2+I))*(X-S(M+2+I))/(S(M+I-1)*S(M+I-1)) V(I)=0.001*F*V(I+10)*EXP(-A/S(M+I-1)) 22 CONTINUE C C V(4) IS THE ENZYME, V(5) IS THE TOTAL STUFF, AND V(10) IS PRODUCT. C V(4)=V(4)+V(2) V(5)=V(1)+V(2)+V(3)+1.0E-06 N=0 T1=T1+V(1) T2=T2+V(2) T3=T3+V(3) Y(LL)=V(1)+V(2)+V(3) Y1(LL)=V(2)/V(5) IF(V(2)/V(5).LT.0.94)GO TO 500 V(10)=V(10)+V(2) GO TO 650 500 IF(V(2).LT.0.25)GO TO 650 C C ACCUMULATE ENZYME IN BAD FRACTION. C IF(V(2)/V(5).LT.0.4)GO TO 650 S1=S1+V(1) S2=S2+V(2) S3=S3+V(3) GO TO 650 C C Y IS TOTAL OF 1,2,3 C C Y1 IS THE % PURITY C Y2 IS THE 94%C C C 400 CONTINUE CM11=AMAX1(Y(1),Y(2),Y(3),Y(4),Y(5),Y(6),Y(8),Y(9),Y(10), *Y(11),Y(12),Y(13),Y(14),Y(15),Y(16),Y(17),Y(18),Y(19),Y(20)) CM21=AMAX1(Y1(1),Y1(2),Y1(3),Y1(4),Y1(5),Y1(6),Y1(7),Y1(8), *Y1(9),Y1(10),Y1(11),Y1(12),Y1(13),Y1(14),Y1(15),Y1(16), *Y1(17),Y1(18),Y1(19),Y1(20)) CM3=1.0 DO 101 I=1,20 Y2(I)=.94*CM3 Y(I)=Y(I)/CM11 101 CONTINUE CALL GRESET CALL ENTGRA CALL SET2D CALL INIT(-4.5,-1.0) CALL QCALE(1.,20.0,4.5,0) CALL QCALE(0.,CM3,5.0,1) CALL XLINAX('FRACTION NUMBER',15,4.5) CALL YLINAX('PER CENT',8,5.0) JKL=20 CALL DATLIN(X1,Y,JKL,2,1,1) CALL DATLIN(X1,Y2,JKL,2,1,1) CALL DATLIN(X1,Y1,JKL,4,1,1) C CALL HDCOPY(ICOP) CALL EXITGR DO 39 I=1,20 Y1(I)=0.0 Y(I)=0.0 39 CONTINUE IF(IFLAG.EQ.0)GO TO 262 WRITE(1,20) 20 FORMAT(/,/,21X,10('*'),' COLUMN IS OVERLOADED WITH PROTEIN', *1X,10('*')) IFLAG=0 262 YIELD=V(9)*V(10)/V(4) YIELD1=100.0*(V(10)/V(4)) WRITE(1,250)YIELD,YIELD1 250 FORMAT(/,/,/,/,/,/,/,47X,'YIELD = ',F7.3,' MG..',3X,F7.3, *1X,'PER CENT') V(19)=V(19)+YIELD C2=400.0+55.0*DIAMET CRESIN=NADSOR C3=DIAMET*DIAMET*30.1*SQRT(CRESIN) C5=C2+C3 V(17)=V(14)+V(15)+V(16) V(18)=V(18)+V(15)*V(9)/V(4) S1=S1*V(11)/T1 S2=S2*V(12)/T2 S3=S3*V(13)/T3 WRITE(1,1405) 1405 FORMAT(/,45X,'OVERALL COSTS INCLUDE ALL LIVER PROCESSING.') WRITE(1,251)C2,C3,C5 251 FORMAT(/,/,47X,'COSTS : $ ',F9.3,' FOR LABOR AND ASSAYS', */,57X,F9.3,' FOR MATERIALS', */,47X,'TOTAL $',1X,F9.3) V(20)=V(20)+C5 IF(YIELD.LT.0.01)GO TO 600 TEMP7=C5/YIELD TEMP8=V(20)/V(19) WRITE(1,260)TEMP7,V(19),TEMP8 260 FORMAT(/,/,47X,'PER MG. COST IS $ ',F9.3, */,44X,'TOTAL MG. COLLECTED = ',F9.3,' AT $ ',F9.3,' PER MG.') 600 TEMP9=V(15)*100.0/V(17) WRITE(1,602) 602 FORMAT(/,43X,'SIDE FRACTIONS OF REASONABLE PURITY ARE POOLED.') K=1.0 WRITE(1,1246) 1246 FORMAT(/,/,/,43X,'TYPE ANY NUMBER TO MOVE ON.') READ(1,*) N N=1 CALL GRESET GO TO 1130 1000 WRITE(1,1225) 1225 FORMAT(/,'WRITE DOWN BATCH INFO IF YOU PLAN TO RETURN.') STOP END SIDE FRACTIONS OF REASONABLE PURITY ARE POOLED. TYPE ANY NUMBER TO MOVE ON. 1 THIS IS ASSIGNED AS BATCH 3 YOU NOW HAVE THE FOLLOWING BATCHES : BATCH 1 MG. = 1576.8 PURITY = .2422 BATCH 2 MG. = 10108.4 PURITY = .4546 BATCH 3 MG. = 8729.9 PURITY = .8059 DO YOU WISH TO TERMINATE THIS SESSION (YES OR NO) YES WRITE DOWN BATCH INFO IF YOU PLAN TO RETURN. ) /L2/ /m/Figure 7.4 TYPICAL SESSION OF CHROMO/-m/ /a/ CHROMATOGRAPHY SCALE-UP GAME YOU MUST ACCUMULATE CRUDE ENZYME FROM AMMONIUM SULFATE STEPS LIVER COSTS $2.48/KG UP TO 100, THEN $2.14 LABOR COST DEPENDS ON BATCH SIZE ONE PERSON FOR <100KG TWO PERSONS FOR <850, 3 FOR V. LARGE BATCHES. YOU MAY ENTER CRUDE BATCHES FROM PREVIOUS RUNS. TYPE 0 TO OMIT OR QUIT. ENTER BATCH NO: MG. OF ENZYME: PURITY: 0 KG. OF LIVER TO BE PROCESSED ? 444. PER CENT AMMONIUM SULFATE TO ADD ? 44. COSTS LIVER 1056.72 AMMONIUM SULFATE 55.29 LABOR 902.38 TOTAL 2014.39 YIELD = 47987.5 MG. OR 78.26 PER CENT PURITY = .2134 THIS IS ASSIGNED AS BATCH 1 YOU NOW HAVE THE FOLLOWING BATCHES : BATCH 1 MG. = 47987.5 PURITY = .2134 DO YOU WISH TO TERMINATE THIS SESSION (YES OR NO) NO TYPE A MINUS NO. TO MAKE MORE BATCHES, TYPE 0 TO CONTINUE TO CHROMATOGRAPHY, OR TWO NO. TO POOL BATCHES. 0 TYPE BATCH NO. FOR CHROMATOGRAPHY 01 ENTER MG. OF ENZYME APPLIED TO COLUMN (F FORMAT) 20000. THIS IS 93.731 GRAMS OF PROTEIN. ENTER THE DIAMETER OF THE COLUMN (F FORMAT) IN CM 20. ) /l2/ /m/Figure continued/-m/ /s/ /a/ THE LOADING IS 4.6865 GRAMS/LITER OF PROTEIN DO YOU WISH TO USE THIS LOADING (YES OR NO) YES ADSORBENT PRICE DOES NOT RELATE TO PERFORMANCE BUT PRICES PER L ARE: ADSORBENT PRICE 1 $ 104.13 2 $ 147.26 3 $ 180.36 4 $ 208.26 5 $ 232.84 6 $ 255.07 SELECT ADSORBENT FROM 1 TO 6 (I FORMAT) 5 YIELD = 0.000 MG.. 0.00 PER CENT OVERALL COSTS INCLUDE ALL LIVER PROCESSING COSTS : $ 1500.00 FOR LABOR AND ASSAYS 26922.25 FOR MATERIALS TOTAL $ 28422.25 SIDE FRACTIONS OF REASONABLE PURITY ARE POOLED. TYPE ANY NUMBER TO MOVE ON. 1 THIS IS ASSIGNED AS BATCH 2 YOU NOW HAVE THE FOLLOWING BATCHES : BATCH 1 MG. = 27987.5 PURITY = .2134 BATCH 2 MG. = 10108.4 PURITY = .4546 DO YOU WISH TO TERMINATE THIS SESSION (YES OR NO) NO TYPE A MINUS NO. TO MAKE MORE BATCHES, TYPE 0 TO CONTINUE TO CHROMATOGRAPHY, OR TWO NO. TO POOL BATCHES. 0 TYPE BATCH NO. FOR CHROMATOGRAPHY 01 ) /l2/ /m/Figure continued/-m/ /s/ /a/ ENTER MG. OF ENZYME APPLIED TO COLUMN (F FORMAT) 10000. THIS IS 46.865 GRAMS OF PROTEIN. ENTER THE DIAMETER OF THE COLUMN (F FORMAT) IN CM 20. THE LOADING IS 2.3433 GRAMS/LITER OF PROTEIN DO YOU WISH TO USE THIS LOADING (YES OR NO) YES ADSORBENT PRICE DOES NOT RELATE TO PERFORMANCE BUT PRICES PER L ARE: ADSORBENT PRICE 1 $ 104.13 2 $ 147.26 3 $ 180.36 4 $ 208.26 5 $ 232.84 6 $ 255.07 SELECT ADSORBENT FROM 1 TO 6 (I FORMAT) 6 YIELD = 4756.2 MG. 47.563 PER CENT 46.563 % OVERALL COSTS INCLUDE LIVER PROCESSING. COSTS : $ 1500.00 FOR LABOR AND ASSAYS 29491.85 FOR MATERIALS TOTAL $ 30991.85 PER MG. COST IS $ 6.516 TOTAL MG. COLLECTED = 4756.296 AT $ 12.92 PER MG. SIDE FRACTIONS OF REASONABLE PURITY ARE POOLED. TYPE ANY NUMBER TO MOVE ON. 1 ) /L2/ /m/Figure continued/-m/ /s/ /a/ THIS IS ASSIGNED AS BATCH 3 YOU NOW HAVE THE FOLLOWING BATCHES : BATCH 1 MG. = 17987.5 PURITY = .2134 BATCH 2 MG. = 10108.4 PURITY = .4546 BATCH 3 MG. = 3589.3 PURITY = .7499 DO YOU WISH TO TERMINATE THIS SESSION (YES OR NO) NO TYPE A MINUS NO. TO MAKE MORE BATCHES, TYPE 0 TO CONTINUE TO CHROMATOGRAPHY, OR TWO NO. TO POOL BATCHES. 01 03 YOU NOW HAVE THE FOLLOWING BATCHES : BATCH 1 MG. = 21576.8 PURITY = .2422 BATCH 2 MG. = 10108.4 PURITY = .4546 DO YOU WISH TO TERMINATE THIS SESSION (YES OR NO) NO TYPE A MINUS NO. TO MAKE MORE BATCHES, TYPE 0 TO CONTINUE TO CHROMATOGRAPHY, OR TWO NO. TO POOL BATCHES. 0 TYPE BATCH NO. FOR CHROMATOGRAPHY 01 ENTER MG. OF ENZYME APPLIED TO COLUMN (F FORMAT) 20000. THIS IS 82.575 GRAMS OF PROTEIN. ENTER THE DIAMETER OF THE COLUMN (F FORMAT) IN CM 22. ) /l2/ /m/Figure continued/-m/ /s/ /a/ THE LOADING IS 3.4122 GRAMS/LITER OF PROTEIN DO YOU WISH TO USE THIS LOADING (YES OR NO) YES ADSORBENT PRICE DOES NOT RELATE TO PERFORMANCE BUT PRICES PER L ARE: ADSORBENT PRICE 1 $ 104.13 2 $ 147.26 3 $ 180.36 4 $ 208.26 5 $ 232.84 6 $ 255.07 SELECT ADSORBENT FROM 1 TO 6 (I FORMAT) 02 YIELD = 8238.0 MG. 41.190 PER CENT OVERALL COSTS INCLUDE ALL LIVER PROCESSING COSTS : $ 1610.00 FOR LABOR AND ASSAYS 0.00 FOR MATERIALS TOTAL $ 1610.00 PER MG. COST IS $ 0.195 TOTAL MG. COLLECTED = 12994.322 AT $ 4.851 PER MG. SIDE FRACTIONS OF REASONABLE PURITY ARE POOLED. TYPE ANY NUMBER TO MOVE ON. 1 THIS IS ASSIGNED AS BATCH 3 YOU NOW HAVE THE FOLLOWING BATCHES : BATCH 1 MG. = 1576.8 PURITY = .2422 BATCH 2 MG. = 10108.4 PURITY = .4546 BATCH 3 MG. = 8729.9 PURITY = .8059 DO YOU WISH TO TERMINATE THIS SESSION (YES OR NO) YES WRITE DOWN BATCH INFO IF YOU PLAN TO RETURN. ) /L2/ /m/Figure 7.4 TYPICAL SESSION OF CHROMO/-m/ 1 REM CHEMOSTAT CONTAMINATED AT 5 HR. 20 DIM I(50),O(50),T0(50),T6(50) 30 D=.2 32 F=25 51 PRINT 56 LET T1=.2 57 T2=50 58 LET T3=1! 80 N=3 82 O(1)=10 84 O(2)=0 86 O(3)=3 98 T=INT(T2/T1+.5):T1=T2/T:T=INT(T3/T1+.5):T3=T*T1:T=0:T4=0 99 T8=1:GOTO1000 100 IF(T-T4+T1/10)<0 THEN 125 110 T4=T4+T3:T5=INT(T/T1+.5):T=T5*T1:GOSUB 2000 115 IF(T-T2+T1/10)<0 THEN 125 120 PRINT:PRINT"END":STOP 125 ON T8 GOTO 300,400,500,600 145 PRINT"** ERROR **":STOP 300 FOR T5=1 TO N 305 T0(T5)=T1*I(T5):T6(T5)=O(T5):O(T5)=O(T5)+T0(T5)/2 320 NEXT T5 330 T=T+T1/2:T8=2:GOTO1000 400 FOR T5=1 TO N 410 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7/2 420 NEXT T5 430 T8=3:GOTO1000 500 FOR T5=1 TO N 510 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7 520 NEXT T5 530 T8=4:T=T+T1/2:GOTO1000 600 FOR T5=1 TO N 605 O(T5)=T6(T5)+(T0(T5)+T1*I(T5))/6 610 NEXT T5 620 T8=1:GOTO 1000 1000 I(1)=O(1)*(M-D) 1010 I(2)=O(2)*(G-D) 1020 I(3)=D*(F-O(3))-2.1*M*O(1)-2.05*G*O(2) 1030 M=.3*O(3)/(2+O(3)) 1040 G=.8*O(3)/(1.5+O(3)) 1999 GOTO 100 2000 PRINT T,O(1),O(2),O(3) 2020 IF T=5 THEN T6(2)=1 2045 RETURN *O(3)/(2+O(3)) 1040 G=.8*O(3)/(1.5+O(3)) @* ͡. ;ͣW!E# ¡ # ¬# ·@ʴʥzʖ=ʐ=|zJz?4)z z10 REM DELAY FOR 25 STEPS 20 DIM D(30) 30 PRINT 40 PRINT "TIME VALUE IN VALUE OUT" 50 T=0 60 T=T+1 70 D(27)=0 80 IF T>5 THEN D(27)=T-5 90 FOR I=1 TO 26 100 D(I)=D(I+1) 110 NEXT I 120 PRINT T, D(27), D(1) 130 IF T<35 THEN 60 10 REM IMPROVED DELAY EXAMPLE 20 REM INDEX MOVES, NOT NUMBERS 30 REM I IS INPUT VALUE, D IS DELAY SIZE 40 DIM W(50) 50 INPUT "DELAY SIZE = ";D 60 FOR J=1 TO 50 70 W(J)=0 80 NEXT J 90 T=0 100 PRINT 110 PRINT "TIME VALUE IN VALUE OUT" 120 T=T+1 130 I=0 140 IF T>5 THEN I=T-5 150 J=J+1 160 IF J>D THEN J=1 170 N=J+1 180 W(J)=I 190 IF J=D THEN N=1 200 PRINT T,I,W(N) 210 GOTO 120 1 REM SPEEDED UP SIMBAS 20 DIM I(50),O(50),T0(50),T6(50) 51 PRINT 53 LPRINT"TIME X S PLOT OF S" 54 K2=1 55 K3=5:F=1:Y=.55 56 T1=.02 57 LET T2=18 58 LET T3=1! 80 LET N=2 86 O(1)=1 88 O(2)=4 98 T=INT(T2/T1+.5):T1=T2/T:T=INT(T3/T1+.5):T3=T*T1:T=0:T4=0 99 T8=1:GOTO1000 100 IF(T-T4+T1/10)<0 THEN 125 110 T4=T4+T3:T5=INT(T/T1+.5):T=T5*T1:GOSUB 2000 115 IF(T-T2+T1/10)<0 THEN 125 120 PRINT:PRINT"END":STOP 125 ON T8 GOTO 300,400,500,600 145 PRINT"** ERROR **":STOP 300 FOR T5=1 TO N 305 T0(T5)=T1*I(T5):T6(T5)=O(T5):O(T5)=O(T5)+T0(T5)/2 320 NEXT T5 330 T=T+T1/2:T8=2:GOTO1000 400 FOR T5=1 TO N 410 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7/2 420 NEXT T5 430 T8=3:GOTO1000 500 FOR T5=1 TO N 510 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7 520 NEXT T5 530 T8=4:T=T+T1/2:GOTO1000 600 FOR T5=1 TO N 605 O(T5)=T6(T5)+(T0(T5)+T1*I(T5))/6 610 NEXT T5 620 T8=1:GOTO 1000 1000 I(1)=K1*O(1) 1010 I(2)=F-I(1)/Y 1020 K1=K2*O(2)/(K3+O(2)) 1999 GOTO 100 2000 LET B=25+O(2) 2005 F=0 2007 IF O(2)<2 THEN F=40 2010 PRINT T;O(1);O(2);TAB(B);"*" 2015 LPRINT T;O(1);O(2);TAB(B);"*" 2045 RETURN O(2)@* ͡. ;ͣW!E# ¡ # ¬# ·@ʴʥzʖ=ʐ=|zJz?4)z z10 DIM N(71) 20 LPRINT 30 LPRINT TAB(19),"FERMENTATION GAME" 40 FOR J=1 TO 8 50 INPUT"INOC. ";N(J) 60 INPUT"SUGAR ";N(J+10) 70 INPUT"OIL ";N(J+20) 80 INPUT"SOYMEAL ";N(J+30) 90 INPUT"DIST. SOL";N(J+40) 100 INPUT"AIR ";N(J+50) 110 INPUT"VITAMINS";N(J+60) 120 PRINT 130 NEXT J 132 C=0 133 CO=0 135 LPRINT 140 FOR J=1 TO 8 150 LPRINT"RUN INOC. SUGAR OIL SOYMEAL DIST.SOL. AIR VIT." 160 LPRINT J;TAB(5);N(J);TAB(13);N(J+10);TAB(21);N(J+20);TAB(29); 162 LPRINT N(J+30);TAB(37);N(J+40);TAB(45);N(J+50);TAB(53);N(J+60) 170 FOR K= 0 TO 60 STEP 10 180 IF N(J+K)>0 THEN 220 190 LPRINT"RUN CONTAMINATED" 210 GOTO 690 220 IF N(J+K)>10 THEN 190 230 NEXT K 240 LET C=50*N(J+10)+20*N(J)+10*N(J+50)+15*N(J+30)+18*N(J+40) 250 LET C=C+200*N(J+60) 260 LET P3=N(J+30) 270 LET S=N(J+10)+1.1*N(J+20)+.05*N(J+30)+.06*N(J+40) 280 LET T=0 285 LET G=N(J+20) 290 LET X=.02*N(J) 300 LET A4=N(J+50)^4 310 V=N(J+60)+.05*N(J+30)+.09*N(J+40) 320 LET P1=P3+.3*N(J+40) 330 LET P2=N(J+40)+.2*N(J+30) 340 LET G1=.12*S/(.4+S) 350 LET A1=G*V/((G+.5)*(V+.02+V*V*300)) 360 LET D1=G1*X 370 IF X<3*N(J+50) THEN 400 380 LET D1=D1*3*N(J+50)/X 400 LET X=X+D1 410 LET T=T+1 420 LET G=G+.03*A4 430 LET S=S-1.3*D1+.02*A4 440 IF S<.05 THEN 500 450 IF T<96 THEN 340 500 LPRINT"PRODUCT FORMATION BEGAN AT";T;"HOURS." 510 LET G=G+.03*A4*(96-T) 520 LET C0=C+100*G 530 LET A2=1 540 IF X<5*N(J+50) THEN 600 550 LET A2=4*N(J+50)/X 600 LET Y7=(2+G)/(3*G) 610 LET Y1=1.6*P1/(.01+.3*P1*P1+.8*P1*P2) 620 LET Y2=P2/(.014+P2*P2+.5*P1*P2) 630 LET Y8=V/(1E-03+.1*V+10*V*V) 650 LET Y=Y8*Y1*Y2*X*A2*(96-T) 660 LET P8=100*Y-C0 670 LPRINT"TOTAL GROWTH =";X,"TOTAL OIL =";G 680 LPRINT"YIELD =";Y,"PROFIT = $";P8 690 LPRINT 700 NEXT J 720 LPRINT"END OF EXPERIMENT." 730 STOP =";X,"TOTAL OIL =";G 680 LPRINT"YIELD =";Y,"PROFIT = $";P8 690 LPRINT 700 NEXT J 720 LPRINT"END OF EXPERIMENT." 730 STOâê ö  - Ð f  "J*"!"!"2O!" "]""!1!++""M>28!"9:] !í 11. 4. 1. .15 .15 1. .01 2. 4. 1. .15 .15 1. .01 5. 9. 1. .25 .2 .9 .0005 5. 8. 1. .2 .2 .9 .005 10. 5. 1. .2 .2 .9 .0005 8. 6. .5 .05 .05 .7 .01 9. 8. .5 .19 .1 .7 .01 1. 5. .1 .1 .1 1. .02 C FERMT GAME, THIS VERSION READS A FILE OF DATA DIMENSION A(10) C COMMANDS ARE FOR CP/M SYSTEMS, READ DATA FROM FLOPPY DISK FILE C NEVADA FORTRAN C SEE REFERENCE FOR ORIGINAL VERSION, IT HAS COMMENTS C BUNGAY, PROCESS BIOCHEM. 6: 38 (1971) CALL OPEN(4,'FERMT.DAT') CALL OPEN(5,'FERMT.OUT') WRITE(5,15) C=0.0 CO=0.0 1 DO 80 I=1,7 READ (4,*,END=999) A(I) IF(A(I).LT.0.)GO TO 60 IF(A(I).GT.10.) GO TO 60 80 CONTINUE WRITE(5,50) WRITE(5,30) A(1),A(2),A(3),A(4),A(5),A(6),A(7) C=50*A(2)+2543*A(1)+10*A(6)+15*A(4) C=C+18*A(5)+200*A(7) P3=A(4) S=A(2)+1.1*A(3)+0.05*A(4)+0.06*A(5) T=0 G=A(3) X=0.02*A(1) A4=A(6)**4 V=A(7)+0.05*A(4)+0.09*A(5) P1=P3+0.3*A(5) P2=A(5)+0.2*A(4) 110 G1=0.12*S/(0.4+S) A1=G*V/((G+0.5)*(V+0.02+V*V*300)) D1=G1*X D2=3*A(6) IF(X.LT.D2)GO TO 90 D1=D1*3*A(6)/X 90 X=X+D1 T=T+1 G=G+0.03*A4 S=S-1.3*D1+0.02*A4 IF(S.LT.0.05)GO TO 10 IF(T.LT.96) GO TO 110 10 WRITE(5,120)T G=G+0.03*A4*(96-T) CO=C+100*G A2=1 D3=5*A(6) IF(X.LT.D3) GO TO 130 A2=4*A(6)/X 130 Y7=(2+G)/(3*G) Y1=1.6*P1/(0.01+0.3*P1*P1+0.8*P1*P2) Y8=V/(0.003+0.1*V+10*V*V) Y=Y8*Y1*Y7*X*A2*(96-T) P8=(183*Y)-(9.1*CO)-48531 WRITE(5,140)X,G,Y,P8 GO TO 40 60 WRITE(5,160) 40 CONTINUE GO TO 1 WRITE(5,150) 15 FORMAT(25X,' FERMENTATION GAME') 30 FORMAT(7F10.4) 50 FORMAT(/,' INOCULUM SUGAR OIL SOYMEAL DIST 1SOL AIR VITAMINS ') 120 FORMAT(,'PRODUCT FORMATION BEGAN AT ',F5.2 ,'HOURS',) 140 FORMAT(/,'TOTAL GROWTH=',F10.3,5X,'TOTAL OIL =',F10.3, 1 5X,'YIELD =',F10.3,//,30X,,'PROFIT = $',F12.2,) 150 FORMAT(30X,'*** END OF EXPERIMENT ***') 160 FORMAT(20 X,'RUN CONTAMINATED!',) 999 CALL CLOSE(4) CALL CLOSE(5) STOP END APPENDIX 2A FORTRAN LISTING OF FERMT GAME FERMENTATION GAME INOCULUM SUGAR OIL SOYMEAL DISTSOL AIR VITAMINS 1.0000 4.0000 1.0000 0.1500 0.1500 1.0000 0.0100 PRODUCT FORMATION BEGAN AT 56.00HOURS TOTAL GROWTH= 4.802 TOTAL OIL = 3.880 YIELD = 1207.092 PROFIT = $ 143720.52 INOCULUM SUGAR OIL SOYMEAL DISTSOL AIR VITAMINS 2.0000 4.0000 1.0000 0.1500 0.1500 1.0000 0.0100 PRODUCT FORMATION BEGAN AT 49.00HOURS TOTAL GROWTH= 4.711 TOTAL OIL = 3.880 YIELD = 1391.375 PROFIT = $ 154302.94 INOCULUM SUGAR OIL SOYMEAL DISTSOL AIR VITAMINS 5.0000 9.0000 1.0000 0.2500 0.2000 0.9000 0.0005 PRODUCT FORMATION BEGAN AT 52.00HOURS TOTAL GROWTH= 8.386 TOTAL OIL = 2.890 YIELD = 867.259 PROFIT = $ -12403.27 INOCULUM SUGAR OIL SOYMEAL DISTSOL AIR VITAMINS 5.0000 8.0000 1.0000 0.2000 0.2000 0.9000 0.0050 PRODUCT FORMATION BEGAN AT 50.00HOURS TOTAL GROWTH= 7.606 TOTAL OIL = 2.890 YIELD = 930.109 PROFIT = $ -448.19 INOCULUM SUGAR OIL SOYMEAL DISTSOL AIR VITAMINS 10.0000 5.0000 1.0000 0.2000 0.2000 0.9000 0.0005 PRODUCT FORMATION BEGAN AT 36.00HOURS TOTAL GROWTH= 5.248 TOTAL OIL = 2.890 YIELD = 1289.020 PROFIT = $ -49100.67 INOCULUM SUGAR OIL SOYMEAL DISTSOL AIR VITAMINS 8.0000 6.0000 0.5000 0.0500 0.0500 0.7000 0.0100 PRODUCT FORMATION BEGAN AT 42.00HOURS TOTAL GROWTH= 5.335 TOTAL OIL = 1.191 YIELD = 2185.693 PROFIT = $ 162409.32 INOCULUM SUGAR OIL SOYMEAL DISTSOL AIR VITAMINS 9.0000 8.0000 0.5000 0.1900 0.1000 0.7000 0.0100 PRODUCT FORMATION BEGAN AT 47.00HOURS TOTAL GROWTH= 6.911 TOTAL OIL = 1.191 YIELD = 1802.017 PROFIT = $ 68117.89 INOCULUM SUGAR OIL SOYMEAL DISTSOL AIR VITAMINS 1.0000 5.0000 0.1000 0.1000 0.1000 1.0000 0.0200 PRODUCT FORMATION BEGAN AT 56.00HOURS TOTAL GROWTH= 4.805 TOTAL OIL = 2.980 YIELD = 1530.322 PROFIT = $ 203232.34 FIGURE 3-1 TYPICAL RESULTS FOR FERMT GAME 10 REM TWO-CULTURE CHEMOSTAT 20 MU=2! 30 KS=1 40 S0=50 50 Y=.45 60 YZ=.42 70 MZ=1.75 80 KZ=1.1 90 INPUT "INIT. CONC. OF Z ";IZ 95 LPRINT"INIT. CONC. OF Z =";IZ 100 PRINT "D X Z S" 110 D=1E-04 120 S=KS*D/(MU-D) 130 IF S>S0 OR S<0 THEN S=S0 140 GZ=MZ*S/(KZ+S) 150 Z=D*IZ/(D-GZ) 160 IF Z<0 THEN Z=0 170 X=Y*S0-S*Y-Y*GZ*Z/(D*YZ) 180 IF X<0 THEN GOTO 230 190 LPRINT D,X,Z,S 200 D=D+.05 210 IF D6 THEN K1=.2 1010 I(1)=K1*(K2-O(1))-K3*X 1999 GOTO 100 2000 B=10+10*O(1) 2010 LPRINT T;O(1);TAB(B);"*" 2045 RETURN IF T>6 THEN K1=.2 1010 I(1)=K1*(K2-O(1))-K3*X 1999 GOTO 100 2000 B=10+10*O(1) 2010 LPRINT T;O(@* ͡. ;ͣW!E# ¡ # ¬# ·@ʴʥzʖ=ʐ=|zJz?4)z zPP550000 .NULL. USERS' MANUAL 1. General Description This manual describes the use of the IGPMSC program. The name is an acronym for Interactive Graphics Program for Multi-Stage Chemostat. The IGPMSC program allows the user to specify the number of stages and the reactor configuration. The specification of adjustabble parameters is accomplished by responding to prompt statements. After the parameters have been specified, plots of the steady state cell and substrate concentrations and productivity vs dilution rate can be obtained. After the system outputs have been viewed, the user may quickly change the system and the view the new outputs. The majority of program interaction is handled through the use of the light pen sensitive graphics functions. To select a function on the screen simply touch the light pen to the appropriate figure. A slight flash of the screen indicates a successful hit. The user should then use the Function keys f3 to confirm or f7 to reject. The user can erase the graphics from the screen by pressing and f2 simultaneously. To increase the memory size, press , and f7 simultaneously, an ' should appear beside the 11 at the top of the screen. 2. Program Features 2.1 Inputs N = number of stages, <=4 X0 = initial cell concentration added to stage 1, <10 g/l S0 = initial substrate concentration added to stage 1, <20 g/l KS = substrate constant, 0.0001-1.0 g/l MUM= maximum growth rate, 0.001--5.0 1/hr Y = yield constant, 0.1--1.0 g/g V = volumn of chemostat, l R = ratio of fresh feed flow to main feed flow SA = fresh feed substrate concentration, < 20 g/l EM = maintenance energy, <0.2 1/hr RF = recycle ratio CF = cell concentration factor in recycle RF*CF < 1+RF 2.2 Outputs 2.2.1 Reactor Block Diagram Interactive features HDCOPY - this command is used to generate a paper copy of the current screen contents. When this command is selected the message 'HARDCOPY ACTIVE' will appear in the upper right corner of the screen. This message indicates that the screen contents are being transferred to the Versatec plot file. On successful transfer the message will disappear and the program is restored to its state before the hardcopy command was given QUIT - selection of this command at any part of the program will cause an immediate termination of the program. The above two features are common to both parts of the program (Fig. 1 & 2) RESET - this will reinitialize the program and proceed to give prompts. RUN - this will cause the program to calculate the results and produce the output plots as shown in Fig.2 CHANGE - this will allows user to change parameters in individual stages, after all the changes have been made, the program will redraw Fig.1 2.2.2 Plots Interactive features BLOCK - this will cause the program to return to the block diagram as describe above. CHANGE - this will allow the user to change parameters temporarily; upon selection of BLOCK the program will return to the original block diagram without any changes in the values of the parameters. RECALL - this cause to program to plot the original results without rerunning the calculations. Explanations of plots S is the exit substrate concentration from stage specified, g/l X is the exit cell concentration from the stage specified, g/l P is the net productivity for the stage concerned, g/l/hr i.e. P = D * (X - XI) where X and XI are the output & input cell concentration to the reactor unit concerned. D is the dilution rate of individual stage, i.e. the flow rate into the stage (without recycle) over the volumn, 1/hr In the plot labelled as OVERALL :- S is the exit substrate conc from the last stage X is the exit cell conc from the last stage D is the overall dilution rate calculated total flow rates over total volumn P is the overall productivity {D*(X of last stage - X0)} USEFUL COMMANDS 1. TO COMPILE A PROGRAM: R COMP filename 2. TO RUN A PROGRAM: SEG filename 3. TO EDIT A PROGRAM: R EDIT filename 4. TO RUN LOGIN FILE: CO CO.LOG 5. FILENAME HAS TO BE: filename.FTN BOTTOM AM: R EDIT filename 4. TO RUN LOGIN FILE: CO CO.LOG 5C STAGEWISE LEACHING PROCESS PROGRAM C C PROGRAM WRITTEN BY HARRY G. FOLSTER, NEW MEXICO STATE UNIVERSITY, AND C MODIFIED BY LYNN CULOTTA TO CALCULATE THE OVERALL MATERIAL BALANCE C AND STAGEWISE MATERIAL BALANCES FOR A LEACHING PROCESS IN WHICH SOLUTE C IS REMOVED FROM THE SOLID. C C TWO DIFFERENT CASES MAY BE SOLVED C 1. THE NUMBER OF EQUILIBRIUM STAGES REQUIRED TO EFFECT THE DESIRED C RECOVERY. C 2. GIVEN THE RECOVERY AND THE NUMBER OF SEPARATION STAGES AVAILBLE. C THE QUANTITY OF SOLVENT REQUIRED IS CALCULATED. C C************************************************************* C C VARIABLES C FEED FRESH FEED C SOLVT FRESH SOLVENT FEED C XSOLU MASS FRACTION SOLUTE IN FEED C XSOLV MASS FRACTION SOLVENT IN FEED C XSOLID MASS FRACTION SOLID IN FEED C YSOLU MASS FRACTION SOLUTE IN FRESH SOLVENT C YSOLV MASS FRACTION SOLVENT IN FRESH FEED C YEXTL MASS FRACTION SOLUTE IN PRODUCT EXTRACT C FRAC FRACTION OF SOLUTE IN FEED RECOVERED C RATIO WEIGHT RATIO OF WATER TO SOLID C NO NUMBER OF AVAILABLE STAGES C C************************************************************** C C ENTER THE INPUT INFORMATION BY FREE FORMAT (ONE VARIABLE PER LINE). C C FOR CASE #1: THE NUMBER OF SEPARATION STAGES, NO, MUST BE ZERO. C C FOR CASE #2: THE ESTIMATION OF THE SOLVENT RATE (SOLVT) AND THE C THE NUMBER OF AVAILABLE STAGES (NO) MUST BE SPECIFIED C IN THE INPUT. C C AFTER ONE RUN, THE PROGRAM PROMPTS THE USER TO TYPE O TO TERMINATE C THE PROGRAM OR TYPE 2 TO INPUT ANOTHER SET OF INPUT CONDITIONS. C DIMENSION FRRFI(20),FREXO(29),RAFFI(20),EXTRO(20),RAFFO(20) DIMENSION EXTRI(20),FRRFO(20),FREXI(20),DIFF(200) 1 WRITE(1,*) 'INPUT DATA' READ(0,*)FEED,SOLVT,XSOLU,XSOLV,XSOLID,YSOLU,YSOLV,YEXTL,FRAC, 1RATIO,NO C WRITE OUTPUT TO FLOPPY DISK FILE CALL LOPEN(7,'OUTPUT') WRITE(7,118)FEED,SOLVT,XSOLU,XSOLV,XSOLID,YSOLU,YSOLV,YEXTL, 1FRAC,RATIO,NO C C TOTAL MATERIAL BALANCE CALCULATIONS C SOLID=XSOLID*FEED SOLUT=XSOLU*FEED SOLV=XSOLV*FEED SOLUR=FRAC*SOLUT SOLLO=SOLUT-SOLUR RAFFS=SOLID*(1.+RATIO) RAFF=RAFFS+SOLLO XRAFF=SOLLO/RAFF K=0 IF(NO)20,20,511 511 NO=NO+1 9 SOLVT=2.*SOLVT 10 EXTRL=FEED+SOLVT-RAFF IF(EXTRL)9,9,12 12 CONTINUE WRITE(1,*)EXTRL YEXTL=(SOLUR+YSOLU*SOLVT)/EXTRL K=K+1 SNO=SOLVT GO TO 30 20 CONTINUE EXTRL=SOLUR/YEXTL SOLVT=EXTRL+RAFF-FEED 30 N=1 FRRFI(N-1)=XSOLU FREXO(N)=YEXTL RAFFI(N-1)=FEED EXTRO(N)=EXTRL C C END OF TOTAL MATERIAL BALANCE CALCULATIONS C C STAGEWISE MATERIAL BALANCE CALCULATIONS C 40 CONTINUE SOLFO=(SOLID*RATIO/(1.-FREXO(N)))*FREXO(N) RAFFO(N)=RAFFS+SOLFO EXTRI(N+1)=RAFFO(N)+EXTRO(N)-RAFFI(N-1) FRRFO(N)=SOLFO/RAFFO(N) SOLFI=RAFFI(N-1)*FRRFI(N-1) SOLXO=EXTRO(N)*FREXO(N) SOLXI=SOLXO+SOLFO-SOLFI FREXI(N+1)=SOLXI/EXTRI(N+1) RAFFI(N)=RAFFO(N) FRRFI(N)=FRRFO(N) EXTRO(N+1)=EXTRI(N+1) FREXO(N+1)=FREXI(N+1) N=N+1 IF(SOLFO-SOLLO)50,50,40 C C END OF STAGEWISE MATERIAL BALANCE CALCULATIONS C 50 CONTINUE N=N-1 IF(NO)90,90,60 60 CONTINUE IF(K-100)61,61,89 61 IF(N-NO)70,62,80 C C NEWTON METHOD TO CONVERGE ON SPECIFIED SOLUTE RECOVERY BY C ADJUSTING SOLVT C 62 DIFF(K)=SOLFO-SOLLO IF(ABS(DIFF(K))-0.001)90,90,63 63 FACT=SOLVT+FEED-RAFF-SOLUR SN1=SNO+(DIFF(K)*FACT*FACT)/(SOLID*RATIO*SOLUR) SOLVT=SN1 IF(ABS(SN1-SNO)-0.01)90,90,10 C C END OF NEWTON METHOD C SOLVENT RATE ITERATIONS TO OBTAIN SPECIFIED NUMER OF SEPATATION STAGES C 70 SOLVT=0.9*SOLVT GO TO 10 80 SOLVT=1.10*SOLVT GO TO 10 89 WRITE(7,119) 90 WRITE(7,120) J=0 WRITE(7,130)J,FEED,XSOLU,RAFF,XRAFF,SOLVT,YSOLU,EXTRL,YEXTL DO 100 J=1,N JM1=J-1 JP1=J+1 WRITE(7,130)J,RAFFI(JM1),FRRFI(JM1),RAFFO(J),FRRFO(J), 1EXTRI(JP1),FREXI(JP1),EXTRO(J),FREXO(J) 100 CONTINUE WRITE(7,140) J=N-1 IF(NO) 101,101,102 101 WRITE(7,150)J,N GO TO 159 102 WRITE(7,155)SOLVT,FEED C110 FORMAT(2F7.2,7F7.4,F7.3,7X,I3) 118 FORMAT(2X,10HINPUT DATA,/,2F7.2,7F7.4,F7.3,7X,I3,///) 119 FORMAT(16X,66HNUMBER OF ITERATION LOOPS EXCEEDED 100, COMPUTATIONS D 1ISCONTINUED...,//) 120 FORMAT(20X,43HSTAGEWISE CALCULATIONS FOR LEACHING PROCESS,//,32X,1 16HMATERIAL BALANCE,//,20X,9HRAFFINATE,26X,7HEXTRACT,/,1X,5HSTAGE,1 2(4X,5HINPUT,3X,4HFRAC,4X,6HOUTPUT,3X,4HFRAC,),5X,5HINPUT,4X,4HFRAC, 45X,5HOUPUT,4X,4HFRAC/,5X,4(2X,8HTONS/DAY,2X,6HSOLUTE,),/,) 130 FORMAT(2X,I3,1X,4(2X,F7.2,F9.4)/) 140 FORMAT(2X,50HNOTE.. STAGE O REPRESENTS OVERALL MATERIAL BALANCE,/) 150 FORMAT(2X,I3,2X,2HTO,I3,32H THEORETICAL STAGES ARE REQUIRED,) 155 FORMAT(2X,F7.2,35H TONS/DAY OF WATER ARE REQUIRED PER,F7.2,17H TONS 1/DAY OF FEED,///) 159 CONTINUE WRITE(1,*)'TYPE 0 TO QUIT OR 2 TO CONTINUE' READ(0,*)IDUM IF(IDUM.EQ.0)GO TO 160 IF(IDUM.EQ.2)GO TO 1 GO TO 159 160 WRITE(7,*)'END OF CALCULATIONS.' CALL CLOSE(7) STOP END 20 REM LOTKA-VOLTERRA MODEL 30 D=.25 32 MU=1.05 51 PRINT 52 PRINT"TIME A B PLOT OF B" 54 K1=.3 55 K2=.03 56 LET T1=.2 57 T2=100 58 LET T3=1! 80 LET N=2 86 O(1)=50 88 O(2)=5 98 T=INT(T2/T1+.5):T1=T2/T:T=INT(T3/T1+.5):T3=T*T1:T=0:T4=0 99 T8=1:GOTO1000 100 IF(T-T4+T1/10)<0 THEN 125 110 T4=T4+T3:T5=INT(T/T1+.5):T=T5*T1:GOSUB 2000 115 IF(T-T2+T1/10)<0 THEN 125 120 PRINT:PRINT"END":STOP 125 ON T8 GOTO 300,400,500,600 145 PRINT"** ERROR **":STOP 300 FOR T5=1 TO N 305 T0(T5)=T1*I(T5):T6(T5)=O(T5):O(T5)=O(T5)+T0(T5)/2 320 NEXT T5 330 T=T+T1/2:T8=2:GOTO1000 400 FOR T5=1 TO N 410 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7/2 420 NEXT T5 430 T8=3:GOTO1000 500 FOR T5=1 TO N 510 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7 520 NEXT T5 530 T8=4:T=T+T1/2:GOTO1000 600 FOR T5=1 TO N 605 O(T5)=T6(T5)+(T0(T5)+T1*I(T5))/6 610 NEXT T5 620 T8=1:GOTO 1000 1000 I(1)=MU*O(1)-D*O(1)-K1*O(1)*O(2) 1010 I(2)=K2*O(1)*O(2)-D*O(2) 1999 GOTO 100 2000 LET B=25+O(2)/3 2010 PRINT T,O(1),O(2) 2045 RETURN D*O(1)-K1*O(1)*O(2) 1010 I(2)=K2*O(1)*O(2)-D*O(2) 1999 GOTO 100 2000 LET B=25+O(2)/3 2010 PRI@* ͡. ;ͣW!E# ¡ # ¬# ·@ʴʥzʖ=ʐ=|zJz?4)z z10 REM MONOD FOR IBM-PC. H. BUNGAY 1984 20 KEY OFF 30 SCREEN 1,1 40 CLS 50 LINE (20,30)-(20,160) 60 LINE -(260,160) 70 LOCATE 1,1 80 INPUT"MUMAX";MU 90 IF MU<0 THEN STOP 100 IF MU=0 THEN 40 110 INPUT"KS ";KS 120 INPUT "Y ";Y 130 INPUT"SZERO";S0 140 INPUT"M.ENG";EM 150 LOCATE 8,1 160 PRINT "100" 170 LOCATE 12,1 180 PRINT "X" 190 PRINT "OR" 200 PRINT "S" 210 LOCATE 22,1 220 PRINT " 0 1 2 3 4" 230 PRINT " DILUTION RATE" 240 D=.0001 250 S=KS*D/(MU-D) 260 IF S>S0 OR S<0 THEN S=S0 270 X=D*Y*(S0-S)/(D+EM*Y) 280 IF X<0 THEN X=0 290 IF X>Y*S0 THEN X=Y*S0 300 A=160-X 310 B=160-S 320 P=20+57*D 330 PSET (P,A) 340 PSET (P,B) 350 D=D+.02 360 IF D>MU+1 THEN 70 370 GOTO 250 S0 300 A=160-X 310 B=160-10 REM ORIGINAL MONOD GAME 20 PRINT " PLOT OF X AND S VERSUS D" 30 INPUT"MUMAX";MU 40 INPUT"KS ";KS 50 INPUT"Y ";Y 60 INPUT"SZERO";S0 70 INPUT"M.ENG";EM 80 D=1E-04 90 S=KS*D/(MU-D) 100 IF S>S0 OR S<0 THEN S=S0 110 X=D*Y*(S0-S)/(D+EM*Y) 120 IF X<0 THEN X=0 130 IF X>Y*S0 THEN X=Y*S0 140 A=X 150 B=S 160 IF B>A THEN GOTO 210 170 PRINT TAB(B);"S";TAB(A);"X" 180 D=D+.05 190 IF D0 THEN T(J)=T(J)-180 220 PRINT G(J),P(J),S(J),T(J) 230 NEXT 240 PRINT 250 STOP 539 200 P(J)=180*P(J)/3.1417 2!ͷ’P͌Q!ͷªP}QxQ!ͷ͓G@Q! ͷ y͓Gþ!ͷ ͓Q!ͷ10 REM SIMBAS FOR OXYGEN TRANSFER 20 DIM I(50),O(50),T0(50),T6(50) 40 PRINT 42 PRINT "TIME ORGANICS OXYGEN PLOT OF OXYGEN" 50 C=7! :REM SATURATION VALUE OF OXYGEN 52 K1=.1 :REM COEFF. FOR DECAY OF ORGANICS 54 K2=.05:REM COEFF. WHEN LIMITED BY OXYGEN 56 K3=.15:REM KLA 57 T2=18 58 T3=1 59 T1=.2 80 N=2 86 O(1)=20! 88 O(2)=4! 98 T=INT(T2/T1+.5):T1=T2/T:T=INT(T3/T1+.5):T3=T*T1:T=0:T4=0 99 T8=1:GOTO1000 100 IF(T-T4+T1/10)<0 THEN 125 110 T4=T4+T3:T5=INT(T/T1+.5):T=T5*T1:GOSUB 2000 115 IF(T-T2+T1/10)<0 THEN 125 120 PRINT:PRINT"END":STOP 125 ON T8 GOTO 300,400,500,600 145 PRINT"** ERROR **":STOP 300 FOR T5=1 TO N 305 T0(T5)=T1*I(T5):T6(T5)=O(T5):O(T5)=O(T5)+T0(T5)/2 320 NEXT T5 330 T=T+T1/2:T8=2:GOTO1000 400 FOR T5=1 TO N 410 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7/2 420 NEXT T5 430 T8=3:GOTO1000 500 FOR T5=1 TO N 510 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7 520 NEXT T5 530 T8=4:T=T+T1/2:GOTO1000 600 FOR T5=1 TO N 605 O(T5)=T6(T5)+(T0(T5)+T1*I(T5))/6 610 NEXT T5 620 T8=1:GOTO 1000 1000 I(2)=K3*(C - O(2)) + I(1) 1005 IF O(2)<0 THEN O(2)=1E-03 1010 IF O(2)<.4 THEN GOTO 1050 1020 I(1)=-K1*O(1) 1030 GOTO 100 1050 I(1)=-K2*O(2) 1999 GOTO 100 2000 B=25 + 5*O(2) 2010 PRINT T;O(1);O(2);TAB(B);"*" 2045 RETURN 1*O(1) 1030 GOTO 100 1050 I(1)=-K2*O(2) 1999 GOTO 100 2000 B=25 + 5*O(2) 2010 PRINT T;O(1);O(2);TAB(B);"*" 2045 RE;,!Ù!;qz8O! !;,z;qyO! ͣͣW_͕qyO! ͣ͒qy1 REM FIG. 5-8 10 REM PREY-PREDATOR WITH MONOD RELATIONSHIPS 20 DIM I(50),O(50),T0(50),T6(50) 30 D=.25 :REM DILUTION RATE 32 MX=1.2 :REM MAX GROWTH COEFF FOR PREY 34 KS=4 :REM MONOD COEFF FOR PREY 36 PX=.5 :REM MAX GROWTH COEFF FOR PREDATORS 38 KP=2 :REM MONOD COEFF FOR PREDATORS 40 Y=.55 :REM YIELD COEFF 42 F=100 :REM FLOW RATE 50 PRINT"TIME PREY PREDATORS MUV MUP 51 PRINT 56 T1=.2 57 T2=200 58 T3=1 80 N=3 86 O(1)=5 :REM PREY 87 O(3)=5 :REM SUBSTRATE 88 O(2)=1 :REM PREDATORS 1000 I(1)=MU*O(1)-D*O(1)-MP*O(2)*3 1005 IF O(1)<0 THEN O(1)=.01 1010 I(2)=MP*O(2)-D*O(2) 1020 I(3)=D*(F-O(3))-MU*O(1)/Y 1025 IF O(3)<0 THEN O(3)=.1 1030 MU=MX*O(3)/(KS+O(3)) 1040 MP=PX*O(1)/(KP+O(1)) 1999 GOTO 100 2000 LET B=25+O(2)/3 2010 PRINT T;O(1);O(2);O(3);MU;MP 2045 RETURN 1 REM MONOD ONLY FOR PREY AND S 20 DIM I(50),O(50),T0(50),T6(50) 51 PRINT 52 D=.1 53 F=50 54 K1=.5 55 K3=.04 56 T1=.2 57 T2=100 58 T3=1 59 K2=.12 80 N=3 84 O(1)=3 86 O(2)=1 88 O(3)=10 98 T=INT(T2/T1+.5):T1=T2/T:T=INT(T3/T1+.5):T3=T*T1:T=0:T4=0 99 T8=1:GOTO1000 100 IF(T-T4+T1/10)<0 THEN 125 110 T4=T4+T3:T5=INT(T/T1+.5):T=T5*T1:GOSUB 2000 115 IF(T-T2+T1/10)<0 THEN 125 120 PRINT:PRINT"END":STOP 125 ON T8 GOTO 300,400,500,600 145 PRINT"** ERROR **":STOP 300 FOR T5=1 TO N 305 T0(T5)=T1*I(T5):T6(T5)=O(T5):O(T5)=O(T5)+T0(T5)/2 320 NEXT T5 330 T=T+T1/2:T8=2:GOTO1000 400 FOR T5=1 TO N 410 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7/2 420 NEXT T5 430 T8=3:GOTO1000 500 FOR T5=1 TO N 510 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7 520 NEXT T5 530 T8=4:T=T+T1/2:GOTO1000 600 FOR T5=1 TO N 605 O(T5)=T6(T5)+(T0(T5)+T1*I(T5))/6 610 NEXT T5 620 T8=1:GOTO 1000 1000 I(1)=M*O(1)-D*O(1)-K2*O(1)*O(2) 1010 I(2)=K3*O(1)*O(2)-D*O(2) 1020 I(3)=F*D-D*O(3)-2.1*M*O(1) 1030 M=K1*O(3)/(2+O(3)) 1999 GOTO 100 2000 LET B=25+O(2)/3 2010 PRINT T,O(1),O(2),O(3) 2045 RETURN *D-D*O(3)-2.1*M*O(1) 1030 M=K1*O(3)/(2+O(3@* ͡. ;ͣW!E# ¡ # ¬# ·@ʴʥzʖ=ʐ=|zJz?4)z z10 REM SINGLE-STAGE RECYCLE, BUNGAY 1985 20 KEY OFF 30 SCREEN 1,1 40 CLS 50 INPUT"KS ";KS 60 INPUT"Y ";Y 70 INPUT"INPUT SUBSTRATE CONC. (20 - 120)";S0 80 CLS 90 LOCATE 8,1 100 PRINT"100" 110 LOCATE 12,1 120 PRINT "OR" 130 PRINT "S" 140 LOCATE 22,1 150 PRINT " 0 1 2 3 4" 160 PRINT " DILUTION RATE" 170 LINE (20,30)-(20,160) 180 LINE -(260,160) 190 MU=1 200 LOCATE 1,1 210 INPUT"CONC. FACTOR ";C 220 IF C<.001 THEN 40 230 INPUT"FRACTION RECYCLED ";A1 240 A=1+A1-A1*C 250 DF=(MU*S0)/(KS*A + SO*A) 260 D=.0001 270 S=KS*D*A/(MU-D*A) 280 IF S>S0 OR S<0 THEN S=S0 290 X=Y*(S0-S)/A 300 IF X<0 THEN X=0 310 P1=160-X 320 B=160-S 330 P=20+57*D 340 PSET (P,P1) 350 PSET (P,B) 360 D=D+.02 370 IF D<4 THEN 270 380 GOTO 200 =0 310 P1=160-X 320 B=160-S 330 P=20+57*D 340 PSET (P,P1) 350 PSET (P,B) 360 D=D+.02 370 IF D<4 THEN 210 REM ENZYME RECYCLE CALCULATIONS FOR IOTECH PROCESS 20 DIM C(10),E(10),FS(10),YS(10),YL(10) 25 DIM D(10) 30 REM GET DESIRED LEVELS PER G. OF WOOD 40 READ D(1),D(2),D(3) 90 REM GET RECOVERY YIELDS 100 FOR N=1 TO 2:READ YS(N),YL(N),FS(N):NEXT 110 PRINT "ACTIVITY % ON SOLIDS RECO./ RESIDUE RECOVERY/ LIQUID" 120 FOR N=1TO2 130 PRINT "CELLULASE";N,FS(N),YS(N),YL(N) 140 NEXT 150 PRINT 180 REM GET COMPOSITION OF FRESH ENZYME 190 FOR N=1TO2:READ E(N):NEXT 195 INPUT "FILTER PAPER ACT. OF FRESH ENZYME/G. OF WOOD";F 197 PRINT "ACTIVITY OF FRESH ENZ., FPA";F 200 REM SUM INPUTS OF ENZYME 205 PRINT "FRACTION DESIRED ACTUAL" 210 FOR N=1TO3 220 C(N)=F*E(N)/(1-FS(N)*YS(N)-YL(N)+FS(N)*YL(N)) 230 PRINT "CELLULASE";N,D(N),C(N) 299 NEXT 990 PRINT 999 GOTO 195 5000 REM DESIRED LEVELS 5010 DATA 5,4,1 5020 REM % ON SOLIDS, REC/SOLIDS, REC/LIQ 5030 DATA .51,.5,.7,.18,.1,.83,1,1,1,1 5040 REM COMPOSITION OF FRESH ENZYME 5050 DATA .9,1,1,1,1,1,1, 50105 ,4,1  REC/LIQ 5030 DATA .51,.5,.7,.18,./J5/ /A/ C SIMBAS IN FORTRAN WITH R.P.I. GRAPHICS CALLS C ORIGINAL TRANSLATION BY BRUCE LOGAN C REVISED DECEMBER 1979 BY JAMES SALES C O IS X, THE OUTPUT OF THE INTEGRATION OF DX/DT C OIC IS THE INITIAL CONDITION OF THE OUTPUT O C K( ) IS A CONSTANT C Y IS AN ARRAY THAT CONTAINS THE VALUES OF THE OUTPUT (O) C WHERE Y1 WOULD CONTAIN THE OUTPUT OF O(1) AND C WHERE Y2 WOULD CONTAIN THE OUTPUT OF O(2),ETC. C ONE Y IS NEEDED FOR EACH OUTPUT (O( )) THAT IS TO BE PLOTTED C N IS THE NUMBER OF DIFFERENTIAL EQUATIONS C TO1 IS THE INTEGRATION INTERVAL C TO2 IS THE TOTAL TIME C TO3 IS THE PRINT OR PLOT INTERVAL C QCALE IS THE X OR Y AXIS SCALING FACTOR C XLINAX IS THE X AXIS LABEL C YLINAX IS THE Y AXIS LABEL C DATLIN PLOTS THE OUTPUT AS A FUNCTION OF TIME C CALL HDCOPY(ICOP) COPIES THE PLOT ON THE SCREEN TO THE PLOTTER REAL I(100),K(100) DIMENSION O(100),T0(100),T6(100),TM(100),OIC(100) DIMENSION Y1(100),Y2(100),Y3(100),Y4(100),X(100) C ZERO ARRAYS SO NO CRAZY PTS. (VALUES OF EACH ARRAY ARE SET TO ZERO) DO 10 J=0,100 X(J)=J Y1(J)=0. Y2(J)=0. Y3(J)=0. 10 Y4(J)=0. C ERASE SCREEN AND INIT. GRAPHICS CALL GRESET C STARTING CONDITIONS C NUMBER OF EQUATIONS N=2 C CONDITIONS OF TIME TO1=.1 TO2=20. TO3=1. C INITIAL CONDITIONS OIC(1)=100. OIC(2)=0. ) /L2/ /m/Appendix 1, continued on next page/-m/ /S/ /A/ C INTERNAL PROGRAM STATEMENTS (DO NOT TOUCH) WRITE(1,25) C ASKS FOR CONSTANTS IN D.E.'S, USED IN STATEMENTS AT 1000 25 FORMAT('HOW MANY CONSTANTS ?') READ(1,26) IEQ 26 FORMAT(I2) 8 DO 11 J=1,IEQ WRITE(1,31) J 31 FORMAT('K',I2,'=') READ(1,32) K(J) 32 FORMAT(F10.5) 11 CONTINUE 19 T1=TO1 T2=TO2 T3=TO3 DO 18 J=1,N O(J)=OIC(J) 18 CONTINUE Y1(0)=OIC(1) Y2(0)=OIC(2) T=INT(T2/T1+0.5) IC=0 T1=T2/T T=INT (T3/T1+0.5) T3=T1*T T=0. T4=0. IT8=1 GO TO 1000 100 IF ((T-T4+T1/10.).LT.0.) GO TO 125 T4=T4+T3 IT5=INT (T/T1+.5) T=FLOAT(IT5)*T1 GO TO 2000 115 IF ((T-T2+T1/10.).LT.0.) GO TO 125 WRITE (1,20) 20 FORMAT (/5X,'END OF PROGRAM') CALL ENTGRA CALL SET2D CALL INIT(-3.,-4.) C END OF INTERNAL PROGRAM STATEMENTS ) /l2/ /m/Appendix 1, continued on next page/-m/ /s/ /a/ C PLOTTING OF OUTPUT C QCALE(LOWEST OUTPUT VALUE,HIGHEST VALUE, AXIS LENGTH (INCHES), C 0=ABSCISSA,1=ORDINATE) C OUTPUT VALUES AND AXIS LENGTH ARE EXPRESSED IN DECIMAL FORM CALL QCALE(0.,T2,8.,0) CALL QCALE(0.,OIC(1),8.,1) C X OR YLINAX(LABEL IN PARENTHESES, NO. OF CHAR IN LABEL,TYPE SIZE) CALL XLINAX('TIME',4,8.) CALL YLINAX('CONC.',5,8.) C DATLIN(ARRAY ON X, ON Y,NO OF PTS.,LINE TYPE, SYM., WHEN USE SYMBOL) C NEED A DATLIN FOR EACH LINE TO BE PLOTTED C BE CAREFUL WITH NUMBER OF POINTS IN DATLIN CALL DATLIN(X,Y1,21,2,1,1) CALL DATLIN(X,Y2,21,4,1,1) C INTERNAL PROGRAM STATEMENTS (DO NOT TOUCH) CALL EXITGR 13 CALL TNOUA('ENTER CODE:',11) CALL TIDEC(IAN) IF(IAN) 1,2,3 3 IF(IAN-2) 4,5,6 6 IF(IAN-4) 7,8,9 4 WRITE(1,33) IAN C CODE MINUS=QUIT,0=ERASE,1=T1,2=T2,3=T3,4=CONSTS.,5=IC'S C 6=HARD COPY 33 FORMAT('T',I1,'=') READ(1,32) TO1 GO TO 19 5 WRITE(1,33) IAN READ(1,32) TO2 GO TO 19 7 WRITE(1,33) IAN READ(1,32) TO3 GO TO 19 9 IF (IAN.EQ.6) GO TO 38 DO 12 J=1,N WRITE(1,34) J 34 FORMAT('IC',I2,'=') 12 READ(1,32) OIC(J) GO TO 19 1 CALL EXIT 2 CALL GRESET GO TO 13 38 CALL ENTGRA CALL HDCOPY(ICOP) CALL EXITGR GO TO 13 999 CALL EXIT ) /l2/ /m/Appendix 1, continued on next page/-m/ /s/ /a/ 125 IF (IT8.EQ.1) GO TO 300 IF (IT8.EQ.2) GO TO 400 IF (IT8.EQ.3) GO TO 500 IF (IT8.EQ.4) GO TO 600 WRITE (1,30) 30 FORMAT (///3X,'ERROR') CALL EXIT 300 DO 320 IT5=1,N T0(IT5)=T1*I(IT5) T6(IT5)=O(IT5) 320 O(IT5)=O(IT5)+T0(IT5)/2. T=T+T1/2. IT8=2 GO TO 1000 400 DO 420 IT5=1,N T7=T1*I(IT5) T0(IT5)=T0(IT5)+2.*T7 420 O(IT5)=T6(IT5)+T7/2. IT8=3 GO TO 1000 500 DO 520 IT5=1,N T7=T1*I(IT5) T0(IT5)=T0(IT5)+2.*T7 520 O(IT5)=T6(IT5)+T7 IT8=4 T=T+T1/2 GO TO 1000 600 DO 620 IT5=1,N O(IT5)=T6(IT5)+(T0(IT5)+T1*I(IT5))/6. 620 CONTINUE IT8=1 C END OF INTERNAL PROGRAM STATEMENTS C EQUATIONS AND COMPUTATIONS C FIRST STATEMENT MUST HAVE THE STATEMENT LABEL 1000 1000 I(1)=-K(1)*O(1) I(2)=K(1)*O(1)-K(2)*O(2) GO TO 100 C OUTPUT, FILL PLOTTING ARRAYS 2000 IC=IC+1 X(IC)=T C PUTTING THE OUTPUT (O( )) INTO THE Y ARRAYS C ONE Y ARRAY NEEDED FOR EACH OUTPUT PLOTTED Y1(IC)=O(1) Y2(IC)=O(2) C PRINTING OF THE OUTPUT WRITE(1,29) T,O(1),O(2) 29 FORMAT(F3.0,2X,F10.3,2X,F10.3) GO TO 115 END C C ) /l2/ /m/APPENDIX 1, LISTING OF SIM4/-m/ 10 REM SIMULATION OF ORDINARY D.E.'S 15 REM EXAMPLE COULD BE CELLULOSE HYDROLYSIS 16 REM REQUEST TO BUNGAY FOR FULL INSTRUCTION SHEETS 20 DIM I(20),O(20),T0(20),T6(20) 51 PRINT 52 PRINT"TIME A B PLOT OF B" 54 K1=.2 55 K2=.1 56 T1=.2 57 T2=18 58 T3=1 80 N=2 86 O(1)=100 88 O(2)=0 98 T=INT(T2/T1+.5):T1=T2/T:T=INT(T3/T1+.5):T3=T*T1:T=0:T4=0 99 T8=1:GOTO1000 100 IF(T-T4+T1/10)<0 THEN 125 110 T4=T4+T3:T5=INT(T/T1+.5):T=T5*T1:GOSUB 2000 115 IF(T-T2+T1/10)<0 THEN 125 120 PRINT:PRINT"END":STOP 125 ON T8 GOTO 300,400,500,600 145 PRINT"** ERROR **":STOP 300 FOR T5=1 TO N 305 T0(T5)=T1*I(T5):T6(T5)=O(T5):O(T5)=O(T5)+T0(T5)/2 320 NEXT T5 330 T=T+T1/2:T8=2:GOTO1000 400 FOR T5=1 TO N 410 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7/2 420 NEXT T5 430 T8=3:GOTO1000 500 FOR T5=1 TO N 510 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7 520 NEXT T5 530 T8=4:T=T+T1/2:GOTO1000 600 FOR T5=1 TO N 605 O(T5)=T6(T5)+(T0(T5)+T1*I(T5))/6 610 NEXT T5 620 T8=1:GOTO 1000 1000 I(1)=-K1*O(1) 1010 I(2)=K1*O(1)-K2*O(2) 1999 GOTO 100 2000 B=25+O(2)/3 2010 PRINT T;O(1);O(2);TAB(B);"*" 2045 RETURN  DESCRIPTION OF PROGRAM SIMBAS is programmed in BASIC to solve simultaneous, ordinary differential equations; these differential equations can be highly non-linear and do not have to be first-order. The integration scheme is a 4th-order Runge-Kutta. The independent variable (usually time) is T. Names beginning with T and followed by an integer are reserved for the program and may not be used in the differential equations, e.g. T1, T2. Standard BASIC operations as shown in Table 1 are available as are the functions in Table 2. Table 1 Arithmetic Operations Symbol Example Meaning + A + B Add B to A - A - B Subtract B from A * A * B Multiply B by A / A/B Divide A by B X 2 Take X to the second power = A = A + 1 Increase A by one Table 2 Functions Function SIN(x) Sine COS(x) Cosine ART(x) Arctangent EXP(x) Exponentiation, raise e to x power LOG(x) Natural logarithm ABS(x) Absolute value SQR(x) Square root Parentheses must be used with the functions and are commonly used to group portions of an equation together. All of the operations inside the parentheses are completed and the result is used as an entity. INSTRUCTIONS SIMBAS is set up with an example of two simultaneous equations. See Figure 1. After loading SIMBAS, you can execute the example by typing RUN (then strike the return key). For new equations, use the example as a guide and replace with the desired equations and values as follows: 1. equations: one per line starting at Line 1000 2. coefficients: use Lines 20 through 55 1 3. initial conditions: use Lines in the 80's 4. specify N, the number of differential equations, Line 80. 5. specify T1, the integration interval, Line 56 6. specify T2, the total time, Line 57 7. specify T3, the print interval, Line 58 8. ouput, see Line 52 for headings and Line 2000 for variables. A line is automatically replaced by typing a new line with the same number. The example is a series of chemical reactions where A produces B which is a transient intermediate which reacts further. The rate equations are: dA/dt = -K1 A dB/dt = K1 A - K2 B BASIC notation is used with a special way of showing variables and derivatives. Derivatives (inputs to the integration operation) are denoted I (1), I(2), I(3), etc. (The letter I stands for IN). Dependent variables (outputs from integration) are denoted O(1), O(2), O(3), etc. (The letter O stands for OUT) In the example, I(1) stands for dA/dt and O(1) for A. Similarly, I(2) represents dB/dt and O(2) represents B. Thus, Statement 1000 is the dA/dt equation: 1000 LET I(1) = -K1 * O(1) Statement 1010 is the dB/dt equation: 1010 LET I(2) = K1 * O(1) - D2 * O(2) A second-order differential equation must be integrated twice to find the variable. For example, d2x/dt2= -32.2 would require the following: 1000 LET I(1) = -32.2 1010 LET I(2) = O(1) Where I(1) = d2x/dt2 I(2) = dx/dt O(1) = dx/dt O(2) = x Returning to our example, on Line 54 K1 is set to 0.2. On Line 55, K2 is set to 0.1. The reactions take place when a chemical, A, is added to water. The initial concentration of A is 100 millimolar and B is initially zero. This is specified in Lines 86 and 88. Time control of the solution depends upon the particular set 2 of equations and on the portion of the solution which is of interest. Specifying a smaller integration interval, T1 in line 56, would give greater accuracy but at an increased cost of computer time and a longer wait for the answers. Different integration intervals, run times, and print intervals can be tried until satisfactory solutions are obtained. In general, select a small integration interval when variables are changing rapidly. Output is controlled by two portions of the program. The headings are printed early in the program in Line 52 because they are wanted only once. The results are printed by Line 2000. In this case, time T,A, and B are written out at each print interval. Also shown is a TAB feature for plotting B; this works differently in some versions of BASIC. Those who can program in BASIC can devise means for getting the terminal to make crude graphs of several variables. When all of the example lines have been replaced with new equations, coefficients, and values, a solution is initiated by typing RUN and carriage return. To halt a solution before completion, depress CNTRL while typing C. This may be slow in acting. Lines can be modified and replaced before trying RUN again. There are easier ways for modifying lines in BASIC than replacement, but the methods given here are sufficient for beginners. To save a program consult your BASIC manual. The independent variable, T, may be accessed merely by using T in an equation. Sources of Error Small errors arise from numerial approximation of continuous functions, and these may propagate as the solution is extended. Furthermore, it is possible to introduce phase errors with SIMBAS. The user should exercise care in the order in which equations are written because a value needed in one equaton may not be calculated until a later equation. The computer will use its last value from the previous integration interval thus risking error from the value being slightly out of phase with its use. 3 unctions in Table 2. .SP 1 .CE 3 Table10 REM TWO-STAGE CHEMOSTAT, 1ST IS OLD MONOD GAME 20 X=0:Y=0:D=0:KS=0:S=0:S0=0:EM=0 30 INPUT"MUMAX";MU 40 INPUT"KS ";KS 50 INPUT"Y ";Y 60 INPUT"SZERO";S0 70 INPUT"M.ENG";EM 80 INPUT "RATIO OF D2 / D1 ";R 90 D=1E-04 100 LPRINT" D X1 S1 X2 S2" 110 LPRINT 120 S=KS*D/(MU-D) 130 IF S>S0 OR S<0 THEN S=S0 140 X=D*Y*(S0-S)/(D+EM*Y) 150 IF X<0 THEN X=0 160 IF X>Y*S0 THEN X=Y*S0 170 IF X>0 THEN GOTO 210 180 S2=S0 190 X2=0 200 GOTO 290 210 D2=R*D 220 A=MU*Y-D2*Y 230 B=-Y*S*MU+Y*S*D2-D2*KS*Y-MU*X 240 C=Y*S*D2*KS 250 Q=SQR(B*B-4*A*C) 260 S2=(-B-Q)/2*A 270 IF S2<0 THEN S2=0 280 X2=X+Y*(S-S2) 290 LPRINT D,X,S,X2,S2 300 PRINT D,X,S,X2,S2 310 D=D+.1 320 IF D60 THEN600 580 PRINT A$(I); 590 GOTO 610 600 L=0:PRINT A$(I) 610 NEXT 620 PRINT 630 RETURN 640 FOR I=1TO10 650 PRINT A$(I);S(I),A$(I+10);S(I+10),A$(I+20);S(I+20) 660 NEXT I 670 L=0:CO=.5*N+5*TM+40 680 PRINT:PRINT"COST = $";.5*N+20*TM 690 RETURN S(I),A$(I+10);S(I+10),A$(I+20);S(I+20) 660 NEXT I 670 L=0:CO=.5*N+5*TM+40 680 PRINT:PRINT"COST = $";.5*N+20*TM 690 RETUC TRANSLATION IN FORTRAN OF BASIC VERSION OF STREAM DIMENSION A(30),AN(30),BR(30),BI(30),S(30) INTEGER S REAL N DATA A/'A','B','C','D','E','F','G','H','I', +'J','K','L','M','N','O','P','Q','R','S','T','U', +'V','W','X','Y','Z','!','#','$','%','&','*'/ WRITE(1,100) 100 FORMAT(' POPULATION DYNAMICS GAME',/,/,'PRIOR TO + TESTING, YOU NEED A BASELINE.',/,'SPECIFY THE NUMBER + OF ORGANISM TO BE COUNTED',/,'FOR THE UNPOLLUTED + STREAM.') READ(0,*) N CO=0.0 T=0.0 DO 200 I=1,30 S(I)=0 R=RAND(0) AN(0)=R*R X=R AN(I)=R T=T+X BI(I)=T 200 CONTINUE R=RAND(0) DO 201 I=1,30 BI(I)=BI(I)/T BR(I)=BI(I) 201 CONTINUE WRITE(1,101) 101 FORMAT(/,15X,'INITIAL DISTRIBUTION',/) 210 DO 202 I=1,30 S(I)=0.0 202 CONTINUE DO 203 J=1,N 301 R=RAND(0) I=0 300 I=I+1 IF (I.EQ.31) GO TO 301 IF (BI(I).LT.R) GO TO 300 S(I)=S(I)+1 L=L+1 IF (L.GT.60) GO TO 303 WRITE(1,102) A(I) 102 FORMAT(A1,Z) GO TO 203 303 L=0 WRITE(1,103) A(I) 103 FORMAT(A1) 203 CONTINUE WRITE(1,109) 109 FORMAT(/,12X,'TABULATION',/) DO 220 I=1,10 C=A(I+10) C1=A(I+20) J=S(I+10) K=S(I+20) WRITE(1,107) A(I),S(I),C,J,C1,K 107 FORMAT(A1,2X,I4,3X,A1,2X,I4,3X,A1,2X,I4) 220 CONTINUE L=0 C=0.61*N+5.1*TIME+40.0 WRITE(1,108) C 108 FORMAT(/,'COST OF THIS INFORMATION = $ ',F10.2) WRITE(1,104) 104 FORMAT(/,'AMOUNT OF POLLUTION ?') READ(0,*) P IF (P) 204,204,205 205 WRITE(1,105) 105 FORMAT(/,'DAYS UNTIL SAMPLE IS TAKEN ?') READ(0,*) TIME WRITE(1,106) 106 FORMAT(/,'NUMBER OF ORGANISMS TO IDENTIFY ?') READ(0,*) N IF(N.LT.0) GO TO 250 T=0 DO 206 I=1,30 BI(I)=AN(I)*EXP(SQRT(P)*AN(I-1)*TIME/(TIME+20)) T=T+BI(I) BI(I)=T 206 CONTINUE DO 230 I=1,30 BI(I)=BI(I)/T 230 CONTINUE GO TO 210 C GET ORIG. DIST. IF P=0 204 DO 240 I=1,30 BI(I)=BR(I) 240 CONTINUE GO TO 210 250 STOP END TOP END C TRANSLATION IN FORTRAN OF BASIC VERSION OF STREAM DIMENSION A(30),AN(30),BR(30),BI(30),S(30) INTEGER S REAL N DATA A/'A','B','C','D','E','F','G','H','I', +'J','K','L','M','N','O','P','Q','R','S','T','U', +'V','W','X','Y','Z','!','#','$','%','&','*'/ WRITE(1,100) 100 FORMAT(' POPULATION DYNAMICS GAME',/,/,'PRIOR TO + TESTING, YOU NEED A BASELINE.',/,'SPECIFY THE NUMBER + OF ORGANISM TO BE COUNTED',/,'FOR THE UNPOLLUTED + STREAM.') READ(0,*) N CO=0.0 T=0.0 DO 200 I=1,30 S(I)=0 R=RAND(0) AN(0)=R*R X=R AN(I)=R T=T+X BI(I)=T 200 CONTINUE R=RAND(0) DO 201 I=1,30 BI(I)=BI(I)/T BR(I)=BI(I) 201 CONTINUE WRITE(1,101) 101 FORMAT(/,15X,'INITIAL DISTRIBUTION',/) 210 DO 202 I=1,30 S(I)=0.0 202 CONTINUE DO 203 J=1,N 301 R=RAND(0) I=0 300 I=I+1 IF (I.EQ.31) GO TO 301 IF (BI(I).LT.R) GO TO 300 S(I)=S(I)+1 L=L+1 IF (L.GT.60) GO TO 303 WRITE(1,102) A(I) 102 FORMAT(A1,Z) GO TO 203 303 L=0 WRITE(1,103) A(I) 103 FORMAT(A1) 203 CONTINUE WRITE(1,109) 109 FORMAT(/,12X,'TABULATION',/) DO 220 I=1,10 C=A(I+10) C1=A(I+20) J=S(I+10) K=S(I+20) WRITE(1,107) A(I),S(I),C,J,C1,K 107 FORMAT(A1,2X,I4,3X,A1,2X,I4,3X,A1,2X,I4) 220 CONTINUE L=0 C=0.61*N+5.1*TIME+40.0 WRITE(1,108) C 108 FORMAT(/,'COST OF THIS INFORMATION = $ ',F10.2) WRITE(1,104) 104 FORMAT(/,'AMOUNT OF POLLUTION ?') READ(0,*) P IF (P) 204,204,205 205 WRITE(1,105) 105 FORMAT(/,'DAYS UNTIL SAMPLE IS TAKEN ?') READ(0,*) TIME WRITE(1,106) 106 FORMAT(/,'NUMBER OF ORGANISMS TO IDENTIFY ?') READ(0,*) N IF(N.LT.0) GO TO 250 OK TO WRITE TO "A:STREAM FOR"? y DO 206 I=1,30 BI(I)=AN(I)*EXP(SQRT(P)*AN(I-1)*TIME/(TIME+20)) T=T+BI(I) BI(I)=T 206 CONTINUE DO 230 I=1,30 BI(I)=BI(I)/T 230 CONTINUE GO TO 210 C GET ORIG. DIST. IF P=0 204 DO 240 I=1,30 BI(I)=BR(I) 240 CONTINUE GO TO 210 250 STOP END 10 REM STREAM GAME FOR IBM-PC, H.BUNGAY 1985 20 DIM A$(30),IN(30),BI(30),S(30) 30 KEY OFF 40 PRINT 50 PRINT "BE SURE PRINTER IS TURNED ON." 60 RANDOMIZE 70 T=0 80 A$(1)="A":A$(2)="B":A$(3)="C":A$(4)="D":A$(5)="E":A$(6)="F" 90 A$(7)="G":A$(8)="H":A$(9)="I":A$(10)="J":A$(11)="K" 100 A$(12)="L":A$(13)="M":A$(14)="N":A$(15)="O":A$(16)="P" 110 A$(17)="Q":A$(18)="R":A$(19)="S":A$(20)="T":A$(21)="U" 120 A$(22)="V":A$(23)="W":A$(24)="X":A$(25)="Y":A$(26)="Z" 130 A$(27)="#":A$(28)="$":A$(29)="&":A$(30)="!" 140 FOR I =1 TO 30 150 S(I)=0 160 X=RND(X) 170 IN(I)=X 180 T=T+X 190 BI(I)=T 200 NEXT 210 IN(0)=RND(X) 220 FOR I=1 TO 30 230 BI(I)=BI(I)/T 240 NEXT 250 INPUT "TYPE NO. OF ORGANISMS TO BE KEYED OUT ";N 260 LPRINT "NUMBER OF ORGANISMS = ";N 270 LPRINT:LPRINT" INITIAL DISTRIBUTION":LPRINT 280 PRINT:PRINT" INITIAL DISTRIBUTION":PRINT 290 GOSUB 580 300 PRINT:GOSUB 790 310 LPRINT : LPRINT 320 PRINT : PRINT 330 INPUT"NUMBER OF ORGANISMS";N 340 LPRINT "NUMBER OF ORGANISMS = ";N 350 PRINT "NUMBER OF ORGANISMS = ";N 360 PRINT:INPUT"AMT. OF POLN.";PO:PRINT 370 INPUT"DAYS UNTIL SAMPLE";TM 380 LPRINT "POLLUTION = ";PO,"TIME = ";TM 390 PRINT "POLLUTION = ";PO,"TIME = ";TM 400 LPRINT : LPRINT 410 PRINT : PRINT 420 IF PO=<0 THEN 520 430 T=0 440 FOR I=1 TO 30 450 BI(I)=IN(I)*EXP(SQR(PO)*IN(I-1)*TM/(TM+20)) 460 T=T+BI(I) 470 BI(I)=T 480 NEXT 490 FOR I=1 TO 30 500 BI(I)=BI(I)/T 510 NEXT 520 PRINT 530 LPRINT : GOSUB 580 540 PRINT 550 LPRINT:GOSUB 790 560 GOTO 360 570 STOP 580 REM SUBROUTINE FOR GEN. POP 590 FOR I=1 TO 30 600 S(I)=0 610 NEXT I 620 FOR J=1 TO N 630 X=RND(X) 640 I=0 650 I=I+1 660 IF I=31 THEN 630 670 IF BI(I)60 THEN 730 700 LPRINT A$(I); 710 PRINT A$(I); 720 GOTO 750 730 L=0:LPRINT A$(I) 740 PRINT A$(I) 750 NEXT 760 LPRINT 770 PRINT 780 RETURN 790 FOR I=1 TO 10 800 LPRINT A$(I);S(I),A$(I+10);S(I+10),A$(I+20);S(I+20) 810 PRINT A$(I);S(I),A$(I+10);S(I+10),A$(I+20);S(I+20) 820 NEXT I 830 L=0:CO=.5*N+5*TM+40 840 LPRINT:LPRINT"COST = $";.5*N+20*TM 850 PRINT:PRINT"COST = $";.5*N+20*TM 860 RETURN 10 REM H. BUNGAY, NYSERDA AND RPI, 1984 20 KEY OFF 30 DIM L(9),A(6),B(6) 40 X=2 : Y=40 : Z=80 50 CLS 60 C=6 70 FOR I= 1 TO 5 80 READ L(I) 90 NEXT 100 H=2+INT(Z/10) 110 SCREEN 1,1 120 REM******JUMP LOCATION******** 130 PRINT "I AM GOING TO INTRODUCE YOU TO " 140 PRINT "CARBOHYDRATE STRUCTURES." 150 PRINT "YOU WILL LEARN THE FOLLOWING WAYS" 160 PRINT "OF DRAWING GLUCOSE :" 170 PRINT 180 LINE (35,45)-(35,120) 190 GOSUB 6070 200 X=135 210 GOSUB 6670 220 X=180 : Y=80 : Z=20 230 GOSUB 5960 240 GOSUB 5800 250 GOSUB 6810 260 LOCATE 18,1 270 PRINT "YOU WILL ALSO LEARN TO RECOGNIZE" 280 PRINT "THE NEXT STRUCTURE AS STARCH." 290 GOSUB 5920 300 Y=50 : Z=11 310 A1=2:A2=252:GOSUB 6520 320 GOSUB 5920 330 PRINT "SUGARS ARE POLYHYDROXY ALDEHYDES AND" 340 PRINT "KETONES. PLEASE TYPE THE NUMBER OF" 350 PRINT "THE HYDROXL GROUP :" 360 PRINT "1. -COOH" 370 PRINT "2. -C-OH" 380 PRINT "3. -OH" 390 PRINT "4. -CH=O" 400 PRINT "5. -C=0-" 410 INPUT Q 420 IF Q=3 THEN 460 430 PRINT "MAYBE YOU NEED TO CONSULT AN ORGANIC" 440 PRINT "CHEMISTRY BOOK. PLEASE TRY AGAIN." 450 GOTO 350 460 PRINT "FINE. NOW PLEASE TYPE Y FOR EACH OF" 470 PRINT "THE FOLLOWING IF IT IS A SUGAR." 480 PRINT "OTHERWISE TYPE N." 490 INPUT " HO-CH2-CH=O ";Q$ 500 IF Q$="y" THEN 520 510 IF Q$<>"Y" THEN 540 520 PRINT "MAYBE, BUT IT ONLY HAS ONE OH," 530 PRINT "SUGARS ARE POLYHYDROXY." 540 PRINT "O.K., HOW ABOUT :" 550 PRINT "HO-CH2-CH(OH) - CH=O" 560 INPUT Q$ 570 IF Q$="y" THEN 620 580 IF Q$="Y" THEN 620 590 PRINT "SORRY ABOUT THE LIMITATIONS OF TYPING," 600 PRINT "BUT THIS IS A SUGAR. PLEASE PUZZLE" 610 PRINT "IT OUT." 620 PRINT "O.K., LET'S TRY ONE MORE:" 630 PRINT "HO-CH2-CH (OH)-CH (OH)-COOH" 640 INPUT Q$ 650 IF Q$="y" THEN 670 660 IF Q$<>"Y" THEN 700 670 PRINT "DEFINITELY NOT A SUGAR, BUT IT IS" 680 PRINT "A SUGAR DERIVITIVE." 690 GOSUB 5920 700 CLS 710 PRINT "A SUGAR WITH 5 CARBON ATOMS IS A" 720 PRINT "PENTOSE. IS THIS ONE ?" 730 C=5 740 LINE (35,43)-(35,100) 750 X=2 760 LOCATE 5,1 770 GOSUB 6070 780 INPUT Q$ 790 IF Q$="y" THEN 820 800 IF Q$= "Y" THEN 820 810 PRINT "WHY NOT. COUNT 'EM : 5 CARBONS." 820 PRINT 830 PRINT "A SUGAR WITH 6 CARBON ATOMS IS A" 840 PRINT "HEXOSE. FEW NATURAL SUGARS HAVE" 850 PRINT "OTHER THAN 5 OR 6 CARBON ATOMS." 860 GOSUB 5920 870 PRINT 880 PRINT "SUGARS ARE COMPLICATED BY ISOMERISM." 890 PRINT "A CARBON WITH 4 DIFFERENT GROUPS" 900 PRINT "ATTACHED IS ASYMETRIC. THIS MEANS" 910 PRINT "THAT IT CAN HAVE D- OR L- ISOMERS." 920 PRINT "OPTICAL ISOMERS IS ALSO USED AS A NAME" 930 PRINT "BECAUSE THESE ISOMERS CAN ROTATE THE" 940 PRINT "PLANE OF POLARIZED LIGHT. YOU CAN" 950 PRINT "THINK OF RIGHT OR LEFT HANDEDNESS." 960 GOSUB 5920 970 CLS 980 PRINT "PLEASE CONSIDER :" 990 LINE ( 99,33)-( 99,58) 1000 LINE (227,33)-(227,58) 1010 LOCATE 4,12 1020 PRINT " X X" 1030 LOCATE 6,9 1040 PRINT "Z - C - Y Y - C - Z" 1050 LOCATE 8,12 1060 PRINT " Q Q" 1070 PRINT 1080 PRINT "CARBON IS OFTEN PICTURED AS THE" 1090 PRINT "CENTRAL ATOM IN A PYRAMID WITH" 1100 PRINT "OTHER ATOMS AT EACH APEX." 1110 PRINT 1120 PRINT "ALL THE REPRESENTATIONS OF SUGAR" 1130 PRINT "STRUCTURES ARE DISTORTIONS AS" 1140 PRINT "THE SPATIAL ARRANGEMENTS ARE FORCED" 1150 PRINT "TO THE PLANE OF THE COMPUTER TERMINAL." 1160 GOSUB 5920 1170 LOCATE 4,12 1180 PRINT " X " 1190 LOCATE 6,9 1200 PRINT "Z C Y " 1210 LOCATE 8,12 1220 PRINT " Q" 1230 LINE (99,32)-(75,43) 1240 LINE -(99,55) 1250 LINE -(125,43) 1260 LINE -(99,32) 1270 LINE (99,32)-(99,55) 1280 FOR I= 75 TO 125 STEP 3 1290 PSET (I,43) 1300 NEXT 1310 PRINT 1320 PRINT "CONSIDER LOOKING DOWN AT A PYRAMID" 1330 PRINT "THAT HAS X UP. THE BASE WILL HAVE" 1340 PRINT "Z, Y, Q IN CLOCKWISE ORDER. IF THE" 1350 PRINT "ORDER WERE Y, Z, Q, IT WOULD BE AN" 1360 PRINT "ISOMER." 1370 GOSUB 5920 1380 PRINT "SUGARS HAVE SEVERAL ASYMETRIC CARBON" 1390 PRINT "ATOMS. SUGARS DIFFER IN REACTIVITY," 1400 PRINT "AND IN PROPERTIES SUCH AS SOLUBILITY" 1410 PRINT "AND SWEETNESS. LET'S LEARN A QUICK" 1420 PRINT "WAY TO DRAW SUGARS. A STICK WILL" 1430 PRINT "REPRESENT THE CHAIN OF CARBONS." 1440 PRINT "AN ARROW HEAD STANDS FOR THE ALDEHYDE" 1450 PRINT "GROUP. A CIRCLE STANDS FOR THE CH2OH." 1460 PRINT "A PROJECTING LINE = AN OH." 1470 GOSUB 5920 1480 C=3 1490 LOCATE 5,5 1500 LINE (67,40)-(67,97) 1510 PRINT " CH=O" 1520 LOCATE 9,5 1530 PRINT "H - C- OH =" 1540 LOCATE 13,5 1550 PRINT " CH2- OH" 1560 X=160 : Y=32 : Z=65 1570 GOSUB 6670 1580 GOSUB 5920 1590 PRINT "WE CAN SIMPLIFY THE SYSTEM BY" 1600 C=5 1610 PRINT "DEFINING ALL SUGARS WITH THE" 1620 PRINT "THE NEXT TO LAST OH ON THE" 1630 PRINT "RIGHT AS D- SUGARS." 1640 X=40 1650 LOCATE 11,2 1660 PRINT "** **" 1670 GOSUB 6670 1680 X=180 1690 L(4)=-1 1700 GOSUB 6670 1710 LOCATE 17,2 1720 PRINT "A D- SUGAR AN L- SUGAR" 1730 GOSUB 5920 1740 PRINT "LXAR (SOUNDS LIKE ELIXER)," 1750 PRINT "A WAY TO REMEMBER PENTOSES !!" 1760 PRINT "FIRST, WE WILL CONSIDER ONLY D- SUGARS." 1770 FOR I= 1 TO 5 1780 READ L(I) 1790 NEXT 1800 C=5 1810 X=150 1820 Y=50 1830 Z=80 1840 GOSUB 6680 1850 LOCATE 5,1 1860 PRINT "THE NEXT TO LAST OH IS ON THE RIGHT;" 1870 PRINT "IT IS A D-SUGAR. 1880 GOSUB 5920 1890 PRINT "WE NEED ONLY CONSIDER CARBONS #2 AND #3." 1900 PRINT "FROM LXAR, R STANDS FOR RIBOSE AND RIGHT" 1910 FOR I= 1 TO 5 1920 READ L(I) 1930 NEXT 1940 GOSUB 6680 1950 LOCATE 4,1 1960 PRINT 1970 PRINT "THE OH GROUPS OF INTEREST" 1980 PRINT "AT 2 & 3 POINT TO THE RIGHT." 1990 LOCATE 10,17 2000 PRINT "2" 2010 LOCATE 13,17 2020 PRINT "3" 2030 GOSUB 5920 2040 FOR I= 1 TO 5 2050 READ L(I) 2060 NEXT 2070 PRINT "THE L IN LXAR STANDS FOR LYXOSE" 2080 PRINT "OR #2 AND #3 ON THE LEFT." 2090 GOSUB 6680 2100 GOSUB 5920 2110 PRINT "X IN LXAR STANDS FOR CROSS." 2120 PRINT "X IS ALSO FOR XYLOSE." 2130 PRINT "THE OH GROUPS CROSS BACK AND FORTH." 2140 FOR I= 1 TO 5 2150 READ L(I) 2160 NEXT 2170 GOSUB 6680 2180 GOSUB 5920 2190 PRINT "A IN LXAR STANDS FOR ARABINOSE." 2200 PRINT "USE THE PROCESS OF ELIMINATION." 2210 PRINT "IT IS THE REMAINING POSSIBILITY." 2220 FOR I= 1 TO 5 2230 READ L(I) 2240 NEXT 2250 GOSUB 6680 2260 GOSUB 5920 2270 PRINT "NOW LET'S HAVE A QUIZ." 2280 C=5 2290 X=150 2300 Y=50 2310 Z=80 2320 RESTORE 2330 FOR I= 1 TO 5 2340 READ L(I) 2350 NEXT 2360 GOSUB 6680 2370 GOSUB 6930 2380 IF Q=1 THEN 2420 2390 LOCATE 20,1 2400 INPUT "WRONG, TRY AGAIN.";Q 2410 GOTO 2380 2420 CLS 2430 PRINT "CORRECT. PLEASE TRY ANOTHER." 2440 FOR I= 7 TO 2 STEP -1 2450 READ L(I) 2460 NEXT 2470 GOSUB 6680 2480 GOSUB 6930 2490 IF Q=4 THEN 2530 2500 LOCATE 20,1 2510 INPUT "WRONG, TRY AGAIN.";Q 2520 GOTO 2490 2530 CLS 2540 PRINT "CORRECT. PLEASE TRY ANOTHER." 2550 L(4)=-1 2560 GOSUB 6680 2570 GOSUB 6930 2580 IF Q=7 THEN 2660 2590 LOCATE 20,1 2600 PRINT "THIS IS AN L- SUGAR." 2610 PRINT "REVERSE ALL THE OH'S," 2620 PRINT "IDENTIFY THE RESULTING D- SUGAR," 2630 PRINT "THEN CHANGE THE NAME TO L." 2640 INPUT "NOW TRY AGAIN : ";Q 2650 GOTO 2580 2660 CLS 2670 PRINT "CORRECT. LET'S TRY ANOTHER." 2680 FOR I= 7 TO 2 STEP -1 2690 READ L(I) 2700 NEXT 2710 GOSUB 6680 2720 GOSUB 6930 2730 IF Q=2 THEN 2770 2740 LOCATE 20,1 2750 INPUT "WRONG, TRY AGAIN.";Q 2760 GOTO 2730 2770 CLS 2780 PRINT "SOME OTHER IMPORTANT SUGARS ARE ;" 2790 RESTORE 2800 C=6 2810 Y=40 2820 X=20 2830 FOR I= 1 TO 6 2840 READ L(I) 2850 NEXT 2860 GOSUB 6670 2870 X=100 2880 L(2)=-1 2890 GOSUB 6670 2900 LOCATE 18,1 2910 PRINT "GLUCOSE MANNOSE GALACTOSE FRUCTOSE" 2920 PRINT 2930 PRINT "FRUCTOSE IS A KETO SUGAR." 2940 X=180 2950 L(2)=1 2960 L(3)=-1 2970 L(4)=-1 2980 GOSUB 6670 2990 X=260 3010 L(2)=0 3020 L(4)=1 3030 GOSUB 6710 3040 LINE(260,55)-(260,120) 3050 XX=260 3060 B(5)=50 3070 GOSUB 5900 3080 LINE (260,65)-(270,65) 3090 LINE (260,68)-(270,68) 3100 XX=277 3110 B(5)=67 3120 GOSUB 5900 3130 GOSUB 5920 3140 CLS 3150 PRINT "ALDEHYDES AND HYDROXYLS CAN REACT ;" 3160 PRINT "THE H FROM THE OH JOINS THE ALDEHYDE O," 3170 PRINT "AND THE O FROM THE OH BONDS TO THE C." 3180 PRINT "THE NEWLY FORMED OH CAN POINT TO THE" 3190 PRINT "RIGHT OR LEFT." 3200 LOCATE 19,1 3210 PRINT "ALDEHYDE OH ON CARBON CHAIN" 3220 GOSUB 6220 3230 INPUT "TYPE A TO SEE THIS AGAIN.";A$ 3240 IF A$= "A" THEN 3140 3250 IF A$="a" THEN 3140 3260 CLS 3270 RESTORE 3280 X=50 3290 Y=50 3300 C=6 3310 PRINT "LET'S SEE WHAT HAPPENS WHEN" 3320 PRINT "THE ALDEHYDE AND OH ARE ON THE" 3330 PRINT "SAME SUGAR MOLECULE :" 3340 PRINT 3350 LOCATE 8,1 3360 A2=246 3370 FOR I= 1 TO 6 3380 READ L(I) 3390 NEXT 3400 LINE (99,60)-(99,140) 3410 GOSUB 6070 3420 PRINT 3430 INPUT "TYPE RETURN.";Q 3440 LOCATE 8,1 3450 D=50 3460 FOR I= 16 TO 23 3470 GOSUB 6470 3480 LOCATE 16,I 3490 PRINT " H" 3500 NEXT 3510 LOCATE 16,I 3520 PRINT " " 3530 FOR I= 16 TO 8 STEP -1 3540 LOCATE I,24 3550 PRINT "H" 3560 GOSUB 6470 3570 A1=114 3580 LOCATE I,24 3590 PRINT " " 3600 NEXT 3610 FOR I= 24 TO 16 STEP -1 3620 LOCATE 8,I 3630 PRINT "H " 3640 GOSUB 6470 3650 NEXT 3660 LOCATE 8,14 3670 PRINT " " 3680 LOCATE 6,13 3690 PRINT "H" 3700 LOCATE 7,13 3710 PRINT "O" 3720 LOCATE 20,1 3730 PRINT "NOW THE C-O AT 5 JOINS THE C AT 1." 3740 D=300 3750 GOSUB 6470 3760 D=40 3770 FOR I= 125 TO 170 STEP 3 3780 PSET (I,125) 3790 GOSUB 6470 3800 NEXT 3810 FOR I= 125 TO 59 STEP -3 3820 GOSUB 6470 3830 PSET (170,I) 3840 NEXT 3850 FOR I= 170 TO 100 STEP -3 3860 PSET (I,59) 3870 GOSUB 6470 3880 NEXT 3890 LOCATE 20,1 3900 PRINT "THIS MUST BE REDRAWN TO BE CLOSER" 3910 PRINT "TO SCALE FOR THE BOND LENGTHS." 3920 GOSUB 5920 3930 X=60 3940 Y=70 3950 Z=20 3960 GOSUB 5960 3970 GOSUB 5800 3980 GOSUB 6810 3990 LOCATE 10,19 4000 PRINT "1" 4010 LOCATE 13,17 4020 PRINT "2" 4030 LOCATE 13,11 4040 PRINT "3" 4050 LOCATE 9,7 4060 PRINT "4" 4070 LOCATE 8,11 4080 PRINT "5" 4090 LOCATE 5,9 4100 PRINT "6" 4110 LOCATE 15,1 4120 PRINT "CARBONS 1 - 5 ARE IN THE" 4130 PRINT "RING. CARBON #6 PROJECTS." 4140 PRINT "RING CLOSURE CAN HAVE CARBON 4150 PRINT "#1 WITH AN OH UP OR DOWN." 4160 PRINT 4170 PRINT "DOWN IS CALLED ALPHA :" 4180 PRINT "UP IS CALLED BETA." 4190 GOSUB 5920 4200 PRINT "THERE IS AN EQUILIBRIUM BETWEEN" 4210 PRINT "RING AND OPEN FORMS." 4220 PRINT 4230 PRINT "THE OPEN FORM ALLOWS THE ALDEHYDE" 4240 PRINT "OR KETONE GROUP TO REACT." 4250 PRINT 4260 PRINT "A SUGAR WITH A CARBONYL FREE" 4270 PRINT "TO REACT IS A REDUCING SUGAR." 4280 GOSUB 5920 4290 PRINT "SUGARS CAN LINK TO EACH OTHER" 4300 PRINT "BY LOSING WATER FROM OH'S." 4310 PRINT "THE NOMENCLATURE IS :" 4320 PRINT "ONE RING - MONOSACCHARIDE" 4330 PRINT "TWO RINGS - DISACCHARIDE" 4340 PRINT "THREE RINGS- TRISACCHARIDE" 4350 PRINT "MANY RINGS - POLYSACCHARIDE" 4360 PRINT "LET'S EXAMINE LACTOSE." 4370 Y=110 : Z=20 4380 X=120 4390 GOSUB 5960 4400 GOSUB 5800 4410 GOSUB 6810 4420 X=30 : L(4)=-1 : GOSUB 5960 4430 GOSUB 5800 4440 GOSUB 6810 4450 XX=115 4460 B(5)=119 4470 GOSUB 5880 4480 LOCATE 19,1 4490 PRINT " GALACTOSE GLUCOSE" 4500 PRINT "THIS DISACCHARIDE IS ALPHA LACTOSE." 4510 PRINT "THE RING ON THE RIGHT IS REDUCING" 4520 PRINT "BECAUSE IT OPENS TO REACT." 4530 PRINT "THE LEFT RING IS A LOCKED HEMIACETAL." 4540 GOSUB 5920 4550 PRINT "GALACTOSE IS PART OF NERVE AND" 4560 PRINT "BRAIN BIOCHEMICALS, SO MILK IS" 4570 PRINT "ESSENTIAL TO INFANTS." 4580 GOSUB 5920 4590 PRINT "HERE IS CANE SUGAR," 4600 PRINT "THE DISACCHARIDE SUCROSE." 4610 PRINT 4620 PRINT "BOTH RINGS ARE LOCKED." 4630 PRINT "THIS IS A NON-REDUCING SUGAR." 4640 LOCATE 21,1 4650 PRINT 4660 PRINT "SUCROSE IS SWEET, BUT FRUCTOSE IS" 4670 PRINT "THE SWEETEST SUGAR." 4680 L(4)=1 : X=30 4690 L(1)=-1 4700 GOSUB 5960 4710 GOSUB 5800 4720 GOSUB 6810 4730 X=120 : C=5 4740 Y=80 4750 GOSUB 5960 4760 GOSUB 6620 4770 LINE (200, 82)-(200, 94) 4780 LINE (140,100)-(140,108) 4790 LINE (120, 57)-(120, 96) 4800 LINE (180, 99)-(180, 86) 4810 XX=115 :B(5)= 98 4820 LOCATE 13,26 4830 GOSUB 5880 4840 PRINT "CH2OH" 4850 LOCATE 7,16 4860 PRINT "CH2OH" 4870 LOCATE 19,1 4880 PRINT " GLUCOSE FRUCTOSE" 4890 PRINT 4900 PRINT "NOTE THE 5-MEMBER RING." 4910 GOSUB 5920 4920 L(1)=1 4930 FOR X=30 TO 120 STEP 90 4940 GOSUB 5960 4950 GOSUB 5800 4960 GOSUB 6810 4970 NEXT 4980 XX=115 4990 B(5)= 93 5000 LOCATE 1,1 5010 PRINT "THIS IS THE DISACCHARIDE MALTOSE." 5020 PRINT 5030 PRINT "IT IS THE REPEATING UNIT IN STARCH." 5040 GOSUB 5880 5050 LOCATE 16,1 5060 PRINT " GLUCOSE GLUCOSE" 5070 PRINT 5080 PRINT "THE LINK IS ALPHA 1-4." 5090 PRINT "THE RING ON THE RIGHT CAN OPEN," 5100 PRINT "SO THIS IS A REDUCING SUGAR." 5110 PRINT "NOTE THAT MALTOSE IS THE" 5120 PRINT "REPEATING UNIT IN STARCH." 5130 GOSUB 5920 5140 Y=50 5150 Z=11 5160 A1=2 5170 A2=252 5180 GOSUB 6520 5190 LOCATE 14,1 5200 PRINT "STARCH IS A POLYSACCHARIDE" 5210 PRINT "OF GLUCOSE UNITS." 5220 PRINT "THE #1 CARBON OH IS ALPHA." 5230 PRINT "THE OTHER OH LINK IS AT CARBON #4." 5240 PRINT "STARCH HAS ALPHA 1-4 LINKS." 5250 PRINT "LET'S SEE ANOTHER FORM OF STARCH." 5260 GOSUB 5920 5270 Y=130 5280 A1=2 5290 A2=252 5300 GOSUB 6520 5310 A1=16 5320 A2=216 5330 Y=80 5340 GOSUB 6520 5350 Y=30 5360 A1=30 5370 A2=130 5380 GOSUB 6520 5390 LOCATE 14,36 5400 PRINT " " 5410 LINE(262, 99)-(262,102) 5420 LOCATE 8,26 5430 PRINT " " 5440 LINE (179,49)-(179,52) 5450 LOCATE 1,1 5460 PRINT "THERE ARE BRANCHES; NOTE THE 1,6 LINKS." 5470 GOSUB 5920 5480 PRINT "UNBRANCHED STARCH IS CALLED AMYLOSE." 5490 PRINT "BRANCHED STARCH IS AMYLOPECTIN." 5500 PRINT 5510 PRINT "GLYCOGEN (ANIMAL STARCH) IS BRANCHED." 5520 PRINT "LET'S SEE CELLULOSE." 5530 GOSUB 5920 5540 Z=11 : Y=160 : L(1)=-1 5550 FOR X= 2 TO 242 STEP 48 5560 GOSUB 5960 5570 GOSUB 5800 5580 GOSUB 6810 5590 Y=Y-24 5600 XX=X+47 5610 B(5)=Y+13 5620 GOSUB 5880 5630 NEXT 5640 LOCATE 1,1 5650 PRINT "NOTE THE BETA AT 1." 5660 PRINT "NOTE THE 1,4 LINKS." 5670 PRINT 5680 PRINT "CELLULOSE IS NEVER BRANCHED." 5690 GOSUB 5920 5700 PRINT "THERE IS A BIG DIFFERENCE BETWEEN" 5710 PRINT "ALPHA 1-4 AND BETA 1-4 LINKS." 5720 PRINT "STARCH IS READILY HYDROLYZED." 5730 PRINT "CELLULOSE IS HIGHLY RESISTANT." 5740 PRINT "ENZYMES FOR STARCH ARE CALLED AMYLASES." 5750 PRINT "CELLULASES HYDROLYZE CELLULOSE." 5760 PRINT 5770 PRINT "THIS IS ENOUGH FOR YOUR" 5780 PRINT "INTRODUCTION TO CARBOHYDRATES." 5790 STOP 5800 REM DRAW PYRANOSE RING 5810 XX=X+3*Z 5820 LINE (X,Y)-(X+Z,Y-Z) 5830 LINE -(A(2)-6,B(5)) 5840 LINE(X+5+3*Z,Y-Z+5)- (A(1),Y) 5850 LINE -(X+3*Z,Y+Z) 5860 LINE -(X+Z,Y+Z) 5870 LINE -(X,Y) 5880 Q=2+Z/10 5890 IF Q>5 THEN Q=5 5900 CIRCLE (XX,B(5)),Q 5910 RETURN 5920 LOCATE 24,1 5930 INPUT "TYPE ENTER KEY (RETURN)";Q 5940 CLS 5950 RETURN 5960 A(1)=X+4*Z 5970 B(1)=Y 5980 A(2)=X+3*Z 5990 B(2)=Y+Z 6000 A(3)=X+Z 6010 B(3)=Y+Z 6020 A(4)=X 6030 B(4)=Y 6040 A(5)=X+Z 6050 B(5)=Y-Z 6060 RETURN 6070 REM DRAW MOLECULES 6080 PRINT TAB(X);" HC=O 1" 6090 N=1 6100 N=N+1 6110 PRINT 6120 IF L(N)=O THEN 6200 6130 IF L(N) < 0 THEN 6170 6140 PRINT TAB(X);" H-C-OH";TAB(X+10);N 6150 IF N2L͐ ! =« f }ʫ +"MD Å D  !  #10 REM SYNCHRONOUS CULTURE, X INCREASES IN STEPS 20 DIM I(50),O(50),T0(50),T6(50) 40 X=1 51 PRINT 52 PRINT "TIME X S" 54 K1=.4 56 T1=.2 57 T2=25 58 T3=1 59 Y=5 80 N=1 86 O(1)=100 98 T=INT(T2/T1+.5):T1=T2/T:T=INT(T3/T1+.5):T3=T*T1:T=0:T4=0 99 T8=1:GOTO1000 100 IF(T-T4+T1/10)<0 THEN 125 110 T4=T4+T3:T5=INT(T/T1+.5):T=T5*T1:GOSUB 2000 115 IF(T-T2+T1/10)<0 THEN 125 120 PRINT:PRINT"END":STOP 125 ON T8 GOTO 300,400,500,600 145 PRINT"** ERROR **":STOP 300 FOR T5=1 TO N 305 T0(T5)=T1*I(T5):T6(T5)=O(T5):O(T5)=O(T5)+T0(T5)/2 320 NEXT T5 330 T=T+T1/2:T8=2:GOTO1000 400 FOR T5=1 TO N 410 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7/2 420 NEXT T5 430 T8=3:GOTO1000 500 FOR T5=1 TO N 510 T7=T1*I(T5):T0(T5)=T0(T5)+2*T7:O(T5)=T6(T5)+T7 520 NEXT T5 530 T8=4:T=T+T1/2:GOTO1000 600 FOR T5=1 TO N 605 O(T5)=T6(T5)+(T0(T5)+T1*I(T5))/6 610 NEXT T5 620 T8=1:GOTO 1000 1000 I(1)=-K1*X 1999 GOTO 100 2000 IF TS0 OR S<0 THEN S=S0 220 GZ=MZ*S/(KZ+S) 230 Z=D*IZ/(D-GZ) 240 X=Y*S0-S*Y-Y*GZ*Z/(D*YZ) 250 IF Z<0 THEN 400 260 IF X<0 THEN GOTO 310 270 GOSUB 570 280 D=D+.05 290 IF D<4 THEN 200 300 GOTO 160 310 A=-YZ*MZ+YZ*D 320 X=0 330 B=S0*YZ*D-S0*YZ*MZ-YZ*D*KZ-MZ*IZ 340 B=-B 350 C=-S0*YZ*D*KZ 360 T=B*B-4*A*C 370 S=(-B+SQR(T))/(2*A) 380 GOSUB 570 390 GOTO 280 400 PRINT "YOU HAVE SELECTED COEFF. SO THAT Z" 410 PRINT "GROWS FASTER THAN X" 420 STOP 430 LINE (20,30)-(20,160) 440 LINE -(260,160) 450 LOCATE 1,1 460 LOCATE 8,1 470 PRINT "100" 480 LOCATE 12,1 490 PRINT "X" 500 PRINT"Z" 510 PRINT "OR" 520 PRINT "S" 530 LOCATE 22,1 540 PRINT " 0 1 2 3 4" 550 PRINT " DILUTION RATE" 560 GOTO 90 570 A=160-X 580 C=160-Z 590 B=160-S 600 P=20+57*D 610 PSET (P,A) 620 PSET (P,B) 630 PSET (P,C) 640 RETURN 560 GOTO 90 570 A=160-X 580 C=160-Z 590 B=160-S 600 P=20+57*D 610 PSET (P,A) Computer Programs in Book: Henry R. Bungay Computer Games and Simulation for Biochemical Engineering Wiley-Interscience, 1985 Figure Title File Name on this Disk 2-1 Listing of SIMBAS SIMBAS.BAS 2-4 Portion:Oxygen Dynam. KLA.BAS 2-6 Portion:Two Tanks TANKS2.BAS 2-8 Portion:Oxygen Limit. OXLIM.BAS 3-3 SIMBAS for Synchronous SYNCH.BAS Culture 3-3 Portion:Fed Batch FEDBAT.BAS 3-8 Portion:Back Seed BAKSEED.BAS 5-2 Portion:Competition COMPET.BAS 5-5 Portion:Lotka-Volterra LOTKA.BAS 5-8 Portion:Predation PREDAT.BAS 5-10 Listing of Inferior DELAY.BAS Delay 5-11 Listing of Good Delay DELAY2.BAS 6-4 Listing of STREAM STREAM.BAS STREAM.FOR (for IBM-PC) STRIBM.BAS 7-9 Listing of Leaching LEACH.FOR Program 8-9 Listing for Nichols NICH.BAS Appendix Listing for SIM4 SIM4.FOR Listing for FERMT FERMT.FOR .DAT .OUT and FERMT.BAS Listing for Monod Game MONOD.BAS Another for Monod Game MONIBM.BAS This version for IBM-PC is better than the one in the book. Listing for Recycle RECYCLE.BAS Another for recycle RECYCL.BAS Improved over version in book. Listing for 2-Stage STAGE2.BAS Chemostat. Listing for Continuous INOC.BAS Inoculation. Another for IBM-PC TWOIBM.BAS Listing for STERIL STERIL.FOR Listing for CHROMO CHROMO.FOR .RUN is terminal session New, improved version for IBM-PC is CHROMO.BAS SIMBAS.DOC Instructions for SIMBAS OTHERS NOT IN BOOK PRY1.BAS Another Prey-Predator SIMBAS program SUGAR.BAS Tutorial for Carbohydrate Structures, in graphics suited to IBM-PC SUGAR.DOC Manuscript about SUGAR, published in BINARY, newsletter of Soc. Gen. Micro. Computer Club March 1985. BODE.BAS Interactive tutorial about dynamic analysis. BODA.BAS Second part of BODE and called from it. AMINO.BAS Interactive tutorial about amino acids and proteins. Not quite finished.