Web pdp-10.trailing-edge.com

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0020/adist3.eng
```100'  NAME--ADIST3
110'
120'  DESCRIPTION--SIMULATES A BINARY BATCH DISTILLATION IN A PACKED
130'  TOWER.
140'
150'  SOURCE--A.O. CONVERSE, THAYER SCHOOL
160'
170'  INSTRUCTIONS--HOLDUP IS NEGLECTED AND THE RELATIVE VOLILITY,
180'  D2, IS CONSTANT. THE VAPOR BOIL-UP RATE IS CONSTANT BOTH WITH
190'  RESPECT TO TIME AND POSITION IN THE COLUMN. THE LIQUID RATE
200'  IS INDEPENDENT OF THE DISTILLATE DRAW-OFF RATE WHICH IS SET BY THE
210'  USER BY THE FOLLOWING EQUATION:D1=J1+J2*T+J3*T*T, WHERE D1 IS
220'  THE DISTILLATE RATE, T THE TIME. THE CONSTANTS ARE SUPPLIED
230'  BY THE USER IN LINE 1180. THE ABOVE EXPRESSION CAN BE CHANGED
240'  BY MODIFICATION OF LINE 460. THE DATA ARE INPUT AS FOLLOWS:
250'       1160  DATA T3 (DURATION OF OPERATION)
260'       1170  DATA D2,D3,N (REL. VOLITILITY), XS(0) (HEIGHT OF COLUMN)
270'       1180  DATA J1,J2,J3  (SEE ABOVE)
280'       1190  T1 (TIME INCREMENT IN INTEGRATION)
290'       1200  Z2 (PRINT OUT OCCURS ENERY Z2 STEPS IN THE INTREGRATION)
300'
310'
320'  *  *  *  *  *  *  *  *  MAIN PROGRAM  *  *  *  *  *  *  *  *  *  *
330'
340 LET S1=1
350 LET Q1=.05
360 LET Q2=2
390 LET D5=0
400 LET D6=0
410 LET T2=0
420 PRINT "HEIGHT OF COLUMN:"N
430 PRINT"D1="J1"+"J2"*T2+"J3"*T2*T2"
440 PRINT"PRINT OUT EVERY",Z2,"INCREMENTS"
450 PRINT"DIST. RATE","Y-OVHD","Y-ACCUM","X-STILL","AMT IN STILL"
460 LET D1 = J1+J2*T2+J3*T2*T2
470 GO SUB 650
480 LET S1 = S1-D1*T1
490 LET Z1 = Z1+1
500 LET D3=D3+(D3-Y1)*D1*T1/S1
510 LET D5 = D5+Y1*D1*T1
520 LET D6=D6+D1*T1
530 LET Y5=D5/D6
540  IF Z1 < Z2-.1 THEN 570
550 PRINT D1,Y1,Y5,D3,S1
560 LET Z1=0
570 LET T2=T2+T1
580 LET Q1=.05
590 IF T2<T3 THEN 460
600 GO TO 1210
610 REM LINES 620-1120 COMPUTE OVERHEAD COMPOSITION GIVEN DISTILLATE
620 REM RATE, STILL COMPOSITION, AND TOWER HEIGHT AS FOLLOWS
630 REM N1 IS COMPUTED GIVEN Y1 AND COMPARED WITH THE SPECIFIED N.
640 REM Y1 IS VARIED UNTIL N2=ABS(N-N1) IS AS SMALL AS DESIRED.
650 LET Y4=(D2*D3)/(1+D3*(D2-1))
660 LET N4=0
670 LET K=0
680 LET Y1=Y4
690 LET Y2=Y1
700 LET K=K+1
710 LET K1 = -.5
720 LET K1 = K1+1
730 LET A=-(D2-1)/(1-D1)
740 LET B=(D2-1+D1+Y2*D1*(D2-1))/(1-D1)
750 LET C=-D2*Y2*D1/(1-D1)
760 LET C1=B^2
770 LET C2=4*A*C
780 IF C1>C2 THEN 900
790 LET E1=SQR(C2-C1)
800 LET E2=(2*A*Y1+B)/E1
810 LET E3=2*ATN(E2)/E1
820 LET E4=B*(D2-1)/(2*A*(1-D1))
830 LET E5=D1*(D2-1)/(1-D1)
840 IF K1>1 THEN 880
850 LET F2=F1
860 LET Y1=D2*D3/(1+D3*(D2-1))
870 GO TO 720
880 LET F3=F2-F1
890 GO TO 990
900 LET E1 = SQR(C1-C2)
910 LET E2=ABS((2*A*Y1+B-E1)/(2*A*Y1+B+E1))
920 LET E3=LOG(E2)/E1
930 LET E4=B*(D2-1)/(2*A*(1-D1))
940 LET E5=D1*(D2-1)/(1-D1)
950 LET E6 = (1-Y2*E5-E4)*E3
960 LET E7=ABS(A*Y1*Y1+B*Y1+C)
970 LET F1=(E4*LOG(E7)/B)+E6
980 GO TO 840
990 LET N1=F3
1000 LET N2=N1-N
1010 IF Q2<2.5 THEN 1030
1020 IF N2<N4 THEN 1040
1030 IF N2<0 THEN 1100
1040 LET Q2=1
1050 LET Y2=Y2-Q1*(1.05+D1*1.5)
1060 IF Y2>Y4 THEN 1080
1070 LET Y2=Y4
1080 LET Q1=Q1/10
1090 IF Q1<.00005 THEN 1140
1100 LET Y1=Y2+Q1
1110 LET N4=N2
1120 LET Q2=Q2+1
1130 GO TO 690
1140 LET Y1=Y2+10*Q1
1150 RETURN
1160 DATA 1
1170 DATA 1.2,.5,10
1180  DATA .2,0,0
1190 DATA .05
1200 DATA 1
1210 END

```