home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-02-20 | 4.0 KB | 104 lines |
- 1 ' COUPLING LOOP CENTER LOCATION & BANDWIDTH CORRECTION FACTOR
- 2 ' FOR TUNABLE COAXIAL CAVITIES
- 3 '
- 4 ' Written for the Amiga computer by Robert F. Arnesen, P.E. 5/7/86
- 5 '
- 6 ' Re-written for IBM type machines 20 February 1987.
- 7 '
- 8 ' This is a program for plotting the placement, in degrees from the
- 9 'shorting plane at the highest frequency of interest, of the coupling
- 10 'loop (or loops) in a tunable coaxial cavity. It also plots the
- 11 'correction factor to be used for determining the minimum bandwidth
- 12 'at the frequency extremes. The actual bandwidths at the extremes
- 13 'can be found by multiplying the real bandwidth at the center of the
- 14 'tuning range by the appropriate correction factor given by the graph.
- 15 '
- 16 DATA 59.3,61.7,63.8,65.7,67.4,68.9,70.2,71.5,72.6,73.6
- 17 DATA 74.5,75.4,76.2,76.9,77.5,78.1,78.7,79.2,79.7,80.2
- 18 DATA .995,.96,.915,.87,.82,.77,.72,.67,.62,.58
- 19 DATA .54,.5,.46,.43,.4,.37,.34,.32,.3,.28
- 20 '
- 21 DIM P(40)
- 22 '
- 23 SCREEN 2: CLS
- 24 A = 75 'Y axis offset
- 25 B = 171 'X axis location
- 26 C = 479 'Graph width in pixels
- 27 D = 160 'Graph height in lines
- 28 E = A+C 'End of X axis
- 29 F = B+1-D 'Top of graph
- 30 G = 0 'Flag
- 31 H = 20 'No. of horiz. & vert. boxes
- 32 J = (C+1)/H 'No. of pixels between verticals
- 33 L = D/H 'No. lines between horizontals
- 34 M = 0 'Variable
- 35 N = 0 'Variable
- 36 '
- 37 A$ = "THETA in degrees"
- 38 B$ = "Relative Bw in percent"
- 39 '
- 40 FOR K=1 TO 40
- 41 READ P(K) 'Read data into the matrix
- 42 NEXT K
- 43 '
- 44 FOR K=B TO 5 STEP -L
- 45 LINE (A,K)-(E,K) 'Draw the horizontals
- 46 NEXT K
- 47 '
- 48 FOR K=1 TO 21
- 49 LINE (A,B)-(A,12) 'Draw the verticals
- 50 A = A+J
- 51 NEXT K
- 52 '
- 53 'Print the titles & designations for the graph
- 54 LOCATE 1,20
- 55 PRINT "LOOP CENTER LOCATION & RELATIVE BANDWIDTH"
- 56 LOCATE 14,19: PRINT "Theta"
- 57 LOCATE 12,49: PRINT "Delta Bw"
- 58 LOCATE 23,9
- 59 PRINT "1.0"; SPC(12) "1.5"; SPC(12) "2.0"; SPC(12) "2.5 f2/f1 3.0";
- 60 LOCATE 2,8: PRINT "80";: LOCATE 7,8: PRINT "75";
- 61 LOCATE 12,8: PRINT "70";: LOCATE 17,8: PRINT "65";
- 62 LOCATE 22,8: PRINT "60";
- 63 '
- 64 FOR K=1 TO LEN(A$)
- 65 LOCATE 2+K,4
- 66 PRINT MID$(A$,K,1); 'Print the Theta plot title
- 67 NEXT K
- 68 '
- 69 FOR K=0 TO 20 STEP 2
- 70 LOCATE 22-K,71
- 71 PRINT K/H 'Print Relative Bandwidth nos.
- 72 NEXT K
- 73 '
- 74 FOR K=1 TO LEN(B$)
- 75 LOCATE 1+K,76
- 76 PRINT MID$(B$,K,1) 'Print Rel. B'width plot title
- 77 NEXT K
- 78 '
- 79 'Angular distance plotting routine
- 80 M = 123: N = 0: G = 0 'Set up to shift segment origins
- 81 FOR K=2 TO 20 'Use the first 20 sets of data
- 82 Y = INT(B+1-L*(P(K)-60))
- 83 IF G=0 THEN 86 'If first pair then don't plot
- 84 LINE (M,N)-(M+J,Y) 'Draw the segment
- 85 M = M+J 'Increment the X axis
- 86 G = 1 'Set the Skip Flag
- 87 N = Y 'Change the segment origen
- 88 NEXT K
- 89 '
- 90 'Relative Bandwidth correction factor
- 91 M = 99: N = 0: G = 0 'Reset all starting constants
- 92 FOR K=21 TO 40 'Use the last 20 sets of data
- 93 Y = INT(B+1-D*P(K))
- 94 IF G=0 THEN 97 'If first time then don't plot
- 95 LINE (M,N)-(M+J,Y) 'Draw the segment
- 96 M = M+J 'Increment the X axis
- 97 G = 1 'Set the Skip Flag
- 98 N = Y 'Change the segment origen
- 99 NEXT K
- 100 '
- 101 LOCATE 21,1 'Put BASICs OK here
- 102 '
- 103 END
-