home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-02-20 | 3.6 KB | 84 lines |
- 1 ' UNLOADED Q CORRECTION FACTOR FOR COAXIAL CAVITIES HAVING
- 2 ' CAVITY/POST DIAMETER RATIOS OTHER THAN 3.6 TO 1
- 3 '
- 4 ' Written for the Amiga computer using a Sweet-P pen plotter.
- 5 'Robert F. Arnesen P.E., 9340 E. Magdalena Drive, Tucson, Ariz. 85710.
- 6 '23 May 1986. Line numbers added for other BASICs 20 February 1987.
- 7 '
- 8 ' This is a pen-plotting routine which will draw the plot in black
- 9 'on a red grid, pausing to permit pen changes.
- 10 '
- 11 A=250 'X origin
- 12 B=A+2000 'Right side of graph
- 13 C=150 'Y origin
- 14 D=C+1600 'Top of graph
- 15 E=160 'Horizontal line spacing
- 16 F=3.6 'Optimum D/d ratio
- 17 G=0 'Variable
- 18 H=2.30258 'Log to base 10 conversion
- 19 J=377.22 'Horiz. corr. factor
- 20 L=0 'Variable
- 21 U=2 'Number of cycles
- 22 '
- 23 LPRINT "RE; RO 0;" 'Reset the plotter
- 24 '
- 25 PRINT "INSERT RED PEN THEN ENTER 'CONT'": STOP
- 26 '
- 27 G=D 'Initialize the variable
- 28 FOR K=0 TO 10 'Draw the horizontals
- 29 LPRINT "LN"; B; ","; G; ","; A; ","; G; ";"
- 30 G=G-E
- 31 NEXT K
- 32 '
- 33 FOR K=1 TO 10
- 34 GOSUB 75 'Draw the verticals - 1st cycle
- 35 NEXT K
- 36 '
- 37 FOR K=20 TO 100 STEP 10
- 38 GOSUB 75 'Draw the verticals - 2nd cycle
- 39 NEXT K
- 40 '
- 41 LPRINT "PU;"
- 42 '
- 43 PRINT "INSERT BLACK PEN THEN ENTER 'CONT'": STOP
- 44 '
- 45 LPRINT "MA 245,110; TX ;1; MA 545,110; TX ;2; MA 720,110; TX ;3; MA 840,110;"
- 46 LPRINT "TX ;4; MA 940,110; TX ;5; MA 1095,105; TX ;7; MA 1235,110; TX ;10;"
- 47 LPRINT "MA 1535,110; TX ;20; MA 1710,110; TX ;30; MA 1930,110; TX ;50;"
- 48 LPRINT " MA 2075, 110; TX ;70; MA 2220,110; TX ;100;"
- 49 '
- 50 LPRINT "MA 600,70; TX ;RATIO OF CAVITY TO TUNING POST DIAMETER - OPTIMUM = 3.6;"
- 51 '
- 52 LPRINT "MA 800,10; TX ;FIGURE 2. UNLOADED Q CORRECTION FACTOR;"
- 53 '
- 54 LPRINT "MA 160,140; TX ;0.0; MA 160,300; TX ;0.1; MA 160,460; TX ;0.2;"
- 55 LPRINT "MA 160,620; TX ;0.3; MA 160,780; TX ;0.4; MA 160,940; TX ;0.5;"
- 56 LPRINT "MA 160,1100; TX ;0.6; MA 160,1260; TX ;0.7; MA 160,1420; TX ;0.8;"
- 57 LPRINT "MA 160,1580; TX ;0.9; MA 160,1740; TX ;1.0;"
- 58 LPRINT "MA 150,1780; DA 230,1780;"
- 59 LPRINT "MA 180,1795; TX ;K;"
- 60 '
- 61 G=A: L=C 'Initialize the variables
- 62 LPRINT "MA"; G; "," C; ";" 'Move pen to the origin
- 63 FOR K=1 TO 10 STEP 0.2
- 64 GOSUB 79 'Draw response in 1st cycle
- 65 NEXT K
- 66 '
- 67 FOR K=10 TO 100
- 68 GOSUB 79 'Draw response in 2nd cycle
- 69 NEXT K
- 70 '
- 71 LPRINT "PU;" 'Pen up
- 72 '
- 73 END
- 74 '
- 75 X = A+INT((J*H*LOG(K))/U) 'Figure the interval
- 76 LPRINT "LN"; X; ","; C; ","; X; ","; D; ";" 'Draw the vertical
- 77 RETURN
- 78 '
- 79 X=A+INT((J*H*LOG(K))/U)
- 80 Y=C+INT((D-C)*((1+F)/LOG(F))*(LOG(K))/(1+K))
- 81 LPRINT "DA"; G; "," L; ";" 'Draw the segment
- 82 G=X: L=Y 'Shift the coordinates
- 83 RETURN
-