home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-02-20 | 5.1 KB | 126 lines |
- 1 ' COUPLING LOOP CENTER LOCATION & BANDWIDTH CORRECTION FACTOR
- 2 ' FOR TUNABLE 1/4 WAVE COAXIAL CAVITIES
- 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 '7 May 1986. Line numbers added for other BASICs 20 February 1987.
- 7 '
- 8 ' This is a pen-plotting routine which will draw the plots in black
- 9 'and green on a red grid, pausing to permit pen changes.
- 10 '
- 11 DATA 59.3,61.7,63.8,65.7,67.4,68.9,70.2,71.5,72.6,73.6
- 12 DATA 74.5,75.4,76.2,76.9,77.5,78.1,78.7,79.2,79.7,80.2
- 13 DATA .995,.96,.915,.87,.82,.77,.72,.67,.62,.58
- 14 DATA .54,.5, .46,.43,.4,.37,.34,.32,.3,.28
- 15 '
- 16 DIM R(40)
- 17 FOR K=1 TO 40
- 18 READ R(K)
- 19 NEXT K
- 20 '
- 21 A=250 'X axis origin in bits
- 22 B=150 'Y axis origin in bits
- 23 C=2000 'Graph width in bits
- 24 D=1600 'Graph height in bits
- 25 E=A+C 'End of graph
- 26 F=B+D 'Top of graph
- 27 G=0 'Flag
- 28 H=10 'Tick length
- 29 J=D*2/100 'Tick spacing
- 30 L=20 'No. of X axis spaces
- 31 M=C/L 'No. bits between vert. lines
- 32 N=10 'No. of Y axis spaces
- 33 P=D/N 'No. bits between horiz. lines
- 34 V=0 'Variable
- 35 '
- 36 LPRINT "RE; RO 0;" 'Reset the plotter
- 37 '
- 38 PRINT "INSERT RED PEN THEN ENTER 'CONT'": STOP
- 39 '
- 40 LPRINT "MA"; E; "," F; ";" 'Draw the outline
- 41 LPRINT "DA"; E; "," B; ";"
- 42 LPRINT "DA"; A; "," B; ";"
- 43 LPRINT "DA"; A; "," F; ";"
- 44 LPRINT "DA"; E; "," F; ";"
- 45 '
- 46 V=F 'Initialize the variable
- 47 FOR K=1 TO 10 'Left side ticks
- 48 FOR Z=1 TO 4
- 49 LPRINT "LN"; E; "," V-J; ","E-H","; V-J; ";
- 50 V=V-J 'Decrement the variable
- 51 NEXT Z
- 52 V=V-J 'Skip one tick
- 53 NEXT K
- 54 '
- 55 FOR K=1 TO 10 'Right side ticks
- 56 FOR Z=1 TO 4
- 57 LPRINT "LN"; A; ","; V+J; ","; A+H; ","; V+J; ";"
- 58 V=V+J
- 59 NEXT Z
- 60 V=V+J
- 61 NEXT K
- 62 '
- 63 V=F-P 'Start 1 down from the top
- 64 FOR K=0 TO 8 'Draw the horizontals
- 65 LPRINT "LN"; A; ","; V; ","; E; ","; V; ";"
- 66 V=V-P 'Decrement the variable
- 67 NEXT K
- 68 '
- 69 V=E-M 'Initialize the variable
- 70 FOR K=0 TO 18 'Draw the verticals
- 71 LPRINT "LN"; V; ","; B; ","; V; ","; F; ";"
- 72 V=V-M 'Decrement the variable
- 73 NEXT K
- 74 '
- 75 LPRINT "PU;"
- 76 '
- 77 PRINT "INSERT BLACK PEN THEN ENTER 'CONT'": STOP
- 78 '
- 79 LPRINT "MA 220,110; RO 0; TX ;1.0; MA 720,110; TX ;1.5; MA 1220,110;"
- 80 LPRINT "TX ;2.0; MA 1720,110; TX ;2.5; MA 2220,110; TX ;3.0;"
- 81 LPRINT "MA 1120,70; TX ;TUNING RANGE;"
- 82 LPRINT "MA"; A+250; ",10; TX ;FIGURE 4. LOOP PLACEMENT & RELATIVE;"
- 83 LPRINT "MA"; A+1070; ",10; TX ;BW'S OF 1/4 WAVE COAXIAL CAVITIES;"
- 84 '
- 85 LPRINT "PU;"
- 86 '
- 87 LPRINT "RO 90; MA 130,650; TX ;LOOP CENTER LOCATION IN DEGREES; RO 0;"
- 88 '
- 89 V=A-110 'Initialize the variable
- 90 FOR K=55 TO 81 STEP 5
- 91 LPRINT "MA 170,"; V "; TX"; ";" K ";" 'Print the angles
- 92 V=V+2*P 'Increment the variable
- 93 NEXT K
- 94 '
- 95 V=A+100 'Initialize the variable
- 96 FOR K=1 TO 20 'Do the THETA plot
- 97 Y=INT(B+(R(K)-55)*2*J)
- 98 IF G=0 THEN LPRINT "MA"; V "," Y ";": GOTO 100
- 99 LPRINT "DA"; V "," Y ";"
- 100 G=1 'Set the Flag
- 101 V=V+M 'Increment the variable
- 102 NEXT K
- 103 '
- 104 LPRINT "PU; RO 270;" 'Pen up & rotate text 270 deg's.
- 105 '
- 106 PRINT "INSERT THE GREEN PEN AND ENTER 'CONT'": STOP
- 107 '
- 108 LPRINT "MA 2400,1500; TX ;MINIMUM RELATIVE BANDWIDTH AT TUNING EXTREMES;"
- 109 '
- 110 LPRINT "RO 0; MA 2280,140; TX ;0.0; MA 2280,300; TX ;0.1; MA 2280,460;"
- 111 LPRINT "TX ;0.2; MA 2280,620; TX ;0.3; MA 2280,780; TX ;0.4; MA 2280,940;"
- 112 LPRINT "TX ;0.5; MA 2280,1100; TX ;0.6; MA 2280,1260; TX ;0.7;"
- 113 LPRINT "MA 2280,1420; TX ;0.8; MA 2280,1580; TX ;0.9; MA 2280,1740;"
- 114 LPRINT "TX ;1.0;"
- 115 '
- 116 V=A+100: G=0 'Initialize the variable & Flag
- 117 FOR K=21 TO 40 'Plot relative bandwidth
- 118 Y=INT(B+R(K)*D)
- 119 IF G=0 THEN LPRINT "MA"; V "," Y ";": GOTO 121
- 120 LPRINT "DA"; V "," Y ";"
- 121 G=1 'Set the Flag
- 122 '
- 123 LPRINT "PU;" 'Pen up
- 124 '
- 125 END
-