Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0087/lan7.bas
There is 1 other file named lan7.bas in the archive. Click here to see a list.
00010 '  LAN7
00020 '  DUANE MOORE    D I G I T A L
00030 '  READS THE FILE GAIN.LAN AND SELECTED FUNCTIONS ARE PLOTTED
00040 '  IN A FILE:  GRAPH.LAN.  SCALES ARE LOG FOR AV, AI, AND G, IF
00050 '  SO SELECTED.  SCALING IS AUTOMATIC IF SO SELECTED.
00060 '
00070 PRINT "OUTPUT FILE:  GRAPH.LAN"
00080 PRINT
00090 DIM X(5),G(21)
00100 FILES GAIN.LAN,LAN.BAK,GRAPH.LAN
00110 MARGIN #3,110
00120 SCRATCH #2,#3
00130 MAT S=ZER(3)
00140 LET S(1)=15
00150 PRINT
00160 PRINT "TYPE H FOR HELP"
00170 PRINT "*";
00180 INPUT A$
00190 IF A$="SYS" GOTO 3210
00200 IF A$="DIS" GOTO 390
00210 IF A$="H" GOTO 650
00220 IF A$="TABLE" GOTO 380
00230 IF A$="YPARAM" GOTO 440
00240 IF A$="G" GOTO 510
00250 IF A$="AV" GOTO 530
00260 IF A$="ZIN" GOTO 550
00270 IF A$="AI" GOTO 570
00280 IF A$="ZOUT" GOTO 590
00290 IF A$="AVSL" GOTO 610
00300 IF A$="STA" GOTO 630
00310 IF A$="EXIT" GOTO 3210
00320 IF A$="DB" GOTO 450
00330 IF A$="NL" GOTO 470
00340 IF A$="LIN" GOTO 490
00350 IF A$="AUTO" GOTO 400
00360 IF A$="SEL" GOTO 420
00370 GOTO 160
00380 CHAIN LAN6
00390 CHAIN LAN,200
00400 LET S(2)=0
00410 GOTO 170
00420 LET S(2)=1
00430 GOTO 170
00440 CHAIN LAN5
00450 LET S(0)=1
00460 GOTO 170
00470 LET S(1)=0
00480 GOTO 170
00490 LET S(0)=0
00500 GOTO 170
00510 LET P9=20
00520 GOTO 2460
00530 LET P9=4
00540 GOTO 2460
00550 LET P9=2
00560 GOTO 2460
00570 LET P9=0
00580 GOTO 2460
00590 LET P9=6
00600 GOTO 2460
00610 LET P9=8
00620 GOTO 2460
00630 LET P9=18
00640 GOTO 2460
00650 PRINT
00660 PRINT "COMMAND","DESCRIPTION"
00670 PRINT "AV","VOLTAGE GAIN PLOT"
00680 PRINT "AI","CURRENT GAIN PLOT"
00690 PRINT "AVSL","VOLTAGE GAIN (TAKING INTO ACCOUNT SOURCE AND LOAD) PLOT"
00700 PRINT "G","POWER GAIN"
00710 PRINT "ZIN","INPUT IMPEDANCE PLOT"
00720 PRINT "ZOUT","OUTPUT IMPEDANCE PLOT"
00730 PRINT "STA","PLOT OF LINVILL AND STERN STABILITY FACTORS"
00740 PRINT "LIN","ORDINATE IS LINEAR*"
00750 PRINT "DB","ORDINATE IS IN DB"
00760 PRINT "NL","NO LABLING OF FREQUENCY"
00770 PRINT "AUTO","AUTOMATIC ORDINATE SCALING*"
00780 PRINT "SEL","SELECT ORDINATE SCALE FACTORS"
00790 PRINT "YPARAM","PLOT OF THE Y PARAMETERS OF THE NETWORK"
00800 PRINT "TABLE","OUTPUT DATA IN TABULAR FORM"
00810 PRINT "EXIT","EXIT BACK TO BASIC"
00820 PRINT "DIS","RETURN TO DISPATCHER"
00830 PRINT
00840 PRINT ,"*  INITIAL CONDITION."
00850 PRINT
00860 GOTO 170
00870 IF END #1, GOTO 1020
00880 INPUT #1,X(0),X(1),X(2),X(3),X(4),X(5)
00890 INPUT #1,F
00900 IF F<0 GOTO 970
00910 FOR I=0 TO 17
00920 INPUT #1,G(I)
00930 NEXT I
00940 INPUT #1,G(20),G(18),G(19)
00950 GOSUB 2910
00960 GOTO 890
00970 INPUT #1,A$
00980 GOSUB 1040
00990 RESTORE #2
01000 SCRATCH #2
01010 GOTO 870
01020 RESTORE #1
01030 GOTO 170
01040 MAT Q=ZER(61)
01050 RESTORE #2
01060 GOTO 2050
01070 RESTORE #2
01080 IF S(2)=0 GOTO 3030
01090 PRINT "'*' RANGES FROM "Y0"TO "Y1
01100 PRINT "'+' RANGES FROM "Z0"TO "Z1
01110 PRINT "OK";
01120 INPUT Z9$
01130 IF Z9$="Y" GOTO 1180
01140 IF Z9$="YES" GOTO 1180
01150 IF Z9$="1" GOTO 1180
01160 PRINT "ENTER VALUES OF *(MIN),*(MAX),+(MIN),+(MAX)";
01170 INPUT Y0,Y1,Z0,Z1
01180 IF Y0<>Y1 GOTO 1260
01190 IF Y0=0 GOTO 1230
01200 IF Y0>0 GOTO 1250
01210 LET Y1=0
01220 GOTO 1260
01230 LET Y1=1
01240 GOTO 1260
01250 LET Y0=0
01260 IF Z0<>Z1 GOTO 1340
01270 IF Z0=0 GOTO 1310
01280 IF Z0>0 GOTO 1330
01290 LET Z1=0
01300 GOTO 1340
01310 LET Z1=1
01320 GOTO 1340
01330 LET Z0=0
01340 PRINT #3 TAB(22+S(1))"***"D$"***"
01350 PRINT #3
01360 LET M2=Y0
01370 GOSUB 2330
01380 PRINT#3 TAB(S(1)) M2 TAB(20+S(1));
01390 LET M2=Y1
01400 GOSUB 2330
01410 PRINT#3 B$,"'*'"TAB(57+S(1))M2
01420 PRINT#3
01430 IF P9=20 GOTO 1510
01440 LET M2=Z0
01450 GOSUB 2330
01460 PRINT#3 TAB(S(1))  M2 TAB(20+S(1));
01470 LET M2=Z1
01480 GOSUB 2330
01490 PRINT#3 C$,"'+'"TAB(57+S(1))M2
01500 IF S(1)=0 GOTO 1520
01510 PRINT #3," FREQ (HZ)";
01520 GOSUB 1890
01530 LET L=0
01540 IF END #2,GOTO 2380
01550 INPUT #2,F,Y,Z
01560 LET Q0=INT(60*(Y-Y0)/(Y1-Y0)+.5)+1
01570 IF Q0>61 GOTO 1590
01580 IF Q0>0 GOTO 1600
01590 LET Q0=0
01600 LET Q(Q0)=1
01610 LET Q1=INT(60*(Z-Z0)/(Z1-Z0)+.5)+1
01620 IF Q1>61 GOTO 1640
01630 IF Q1>0 GOTO 1650
01640 LET Q1=0
01650 LET Q(Q1)=2+Q(Q1)
01660 LET Q2=Q1
01670 IF Q2>Q0 GOTO 1690
01680 LET Q2=Q0
01690 GOSUB 1950
01700 PRINT #3 TAB(S(1));
01710 FOR I=1 TO Q2
01720 LET Q=Q(I)
01730 IF Q=0 GOTO 1830
01740 IF Q=1 GOTO 1810
01750 GOTO 1790
01760 IF P9=20 GOTO 1830
01770 PRINT#3 "O";
01780 GOTO 1840
01790 PRINT #3 "+";
01800 GOTO 1840
01810 PRINT#3 "*";
01820 GOTO 1840
01830 PRINT#3 " ";
01840 NEXT I
01850 PRINT#3
01860 LET Q(Q0)=0
01870 LET Q(Q1)=0
01880 GOTO 1540
01890 PRINT#3 TAB(S(1)) " I";
01900 FOR I=1 TO 6
01910  PRINT#3  ".........I";
01920 NEXT I
01930 PRINT#3
01940 RETURN
01950 IF INT(L/10)=L/10 GOTO 2010
01960 IF S(1)=0 GOTO 1980
01970 PRINT #3,F;
01980 PRINT #3,TAB(S(1))".";
01990 LET L=L+1
02000 RETURN
02010 IF S(1)=0 GOTO 2030
02020 PRINT #3,F;
02030 PRINT #3,TAB(S(1))"-";
02040 GOTO 1990
02050 LET Y0=1E35
02060 LET Z0=Y0
02070 LET Y1=-1E35
02080 LET Z1=Y1
02090 IF END #2,GOTO 1070
02100 INPUT #2,X,Y,Z
02110 IF Y>Y0 GOTO 2130
02120 LET Y0=Y
02130 IF Y<Y1 GOTO 2150
02140 LET Y1=Y
02150 IF Z>Z0 GOTO 2170
02160 LET Z0=Z
02170 IF Z<Z1 GOTO 2190
02180 LET Z1=Z
02190 GOTO 2090
02200 LET M2=Y0
02210 GOSUB 2330
02220 LET Y0=M2
02230 LET M2=Y1
02240 GOSUB 2330
02250 LET Y1=M2
02260 LET M2=Z0
02270 GOSUB 2330
02280 LET Z0=M2
02290 LET M2=Z1
02300 GOSUB 2330
02310 LET Z1=M2
02320 GOTO 1270
02330 IF M2=0 GOTO 2370
02340 LET M3=ABS(M2)
02350 LET M1=10^(INT(LOG(M3)/LOG(10)))
02360 LET M2=INT(100*M2/M1+.5)*M1/100
02370 RETURN
02380 GOSUB 1890
02390 PRINT #3
02400 PRINT #3
02410 PRINT #3 ,,"RESISTANCE","CAPACITANCE","INDUCTANCE"
02420 PRINT #3 , "SOURCE",X(0),X(1),X(2)
02430 PRINT #3 ,"LOAD",X(3),X(4),X(5)
02440 PRINT #3,<PA>
02450 RETURN
02460 IF P9=4 GOTO 2570
02470 IF P9=2 GOTO 2610
02480 IF P9=0 GOTO 2630
02490 IF P9=6 GOTO 2670
02500 IF P9=8 GOTO 2790
02510 IF P9=18 GOTO 2750
02520 IF P9=20 GOTO 2690
02530 LET B$=""
02540 LET C$=""
02550 LET D$=""
02560 GOTO 870
02570 IF S(0)=0 GOTO 2870
02580 LET D$="LOGARITHMIC VOLTAGE GAIN"
02590 LET B$="MAGNITUDE (DB)"
02600 GOTO 2890
02610 LET D$="INPUT IMPEDANCE"
02620 GOTO 2880
02630 IF S(0)=0 GOTO 2850
02640 LET D$="LOGARITHMIC CURRENT GAIN"
02650 LET B$="MAGNIUTDE (DB)"
02660 GOTO 2880
02670 LET D$="OUTPUT IMPEDANCE"
02680 GOTO 2880
02690 LET D$="POWER GAIN"
02700 LET B$="G      (DB)    "
02710 LET C$=""
02720 IF S(0)<>0 GOTO 870
02730 LET B$="G              "
02740 GOTO 870
02750 LET D$="STABILITY FACTORS"
02760 LET B$="LINVILL  "
02770 LET C$="STERN    "
02780 GOTO 870
02790 IF S(0)<>0 GOTO 2820
02800 LET D$="VOLTAGE GAIN (SOURCE-LOAD)"
02810 GOTO 2880
02820 LET D$="LOGARITHMIC VOLTAGE GAIN (SOURCE-LOAD)"
02830 LET B$="MAGNITUDE (DB)"
02840 GOTO 2890
02850 LET D$="CURRENT GAIN"
02860 GOTO 2880
02870 LET D$="VOLTAGE GAIN"
02880 LET B$="MAGNITUDE"
02890 LET C$="PHASE    "
02900 GOTO 870
02910 IF P9=0 GOTO 2970
02920 IF P9=8 GOTO 2970
02930 IF P9=4 GOTO 2970
02940 IF P9=20 GOTO 3000
02950 PRINT #2,F,G(P9),G(P9+1)
02960 RETURN
02970 IF S(0)=0 GOTO 2950
02980 PRINT #2,F,20*CLOG(G(P9)),G(P9+1)
02990 RETURN
03000 IF S(0)=0 GOTO 2950
03010 PRINT #2,F,10*CLOG(G(P9)),G(P9+1)
03020 RETURN
03030 IF S(0)=0 GOTO 1180
03040 IF P9=0 GOTO 3090
03050 IF P9=4 GOTO 3090
03060 IF P9=8 GOTO 3090
03070 IF P9=20 GOTO 3090
03080 GOTO 1180
03090 LET Y1=(INT((Y1-.01)/5)+1)*5
03100 LET Y2=Y0
03110 LET Y0=Y1-15
03120 IF Y1-Y2<15.01 GOTO 3180
03130 IF Y1-Y2<30.01 GOTO 3170
03140 IF Y1-Y2<60.01 GOTO 3160
03150 LET Y0=Y0-60
03160 LET Y0=Y0-30
03170 LET Y0=Y0-15
03180 LET Z0=0
03190 LET Z1=360
03200 GOTO 1180
03210 END