home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-02-20 | 4.0 KB | 116 lines |
- 1 ' UNLOADED Q FOR COPPER COAXIAL CAVITIES
- 2 '
- 3 ' Written for the Amiga computer by Robert F. Arnesen, P.E. 3/24/86
- 4 '
- 5 ' Re-written for IBM type machines 20 February 1987.
- 6 '
- 7 ' The unloaded Q for coaxial cavities of any material can be found
- 8 'simply by multiplying the value shown in the graph by the square root of
- 9 'the ratio of the resistivity of copper to that of the other material. If
- 10 'the copper is to be plated then the plating must be at least three skin
- 11 'depths in thickness.
- 12 '
- 13 ' It should also be noted that there is a 1/3 wavelength line drawn on
- 14 'the graph. The point at which this line crosses that of the cavity size
- 15 'defines the frequency at which that cavity diameter equals 1/3 of a
- 16 'wavelength. Cavities at and above this limit will generate spurious
- 17 'frequencies and waste power in doing so.
- 18 '
- 19 SCREEN 2: CLS
- 20 A = 120 'Y axis offset
- 21 B = 71 'Graph width sizing factor
- 22 C = 2.30258 'Ln to base 10 conversion
- 23 D = 171 'X axis location
- 24 E = A+375 'End of X axis
- 25 F = 160 'No. of horiz. lines in graph
- 26 G = 3.6 'Optimum cavity/post ratio
- 27 H = 30 'Graph height sizing factor
- 28 S = 1 'Initial cavity diameter in cm.
- 29 U = 3 'Number of log cycles
- 30 '
- 31 FOR K=1 TO 10
- 32 GOSUB 104 'Draw the lower Y axis cycle
- 33 NEXT K
- 34 '
- 35 FOR K=20 TO 100 STEP 10
- 36 GOSUB 104 'Draw the middle Y axis cycle
- 37 NEXT K
- 38 '
- 39 FOR K=200 TO 1000 STEP 100
- 40 GOSUB 104 'Draw the top Y axis cycle
- 41 NEXT K
- 42 '
- 43 FOR K=1 TO 10
- 44 GOSUB 108 'Draw the first X axis cycle
- 45 NEXT K
- 46 '
- 47 FOR K=20 TO 100 STEP 10
- 48 GOSUB 108 'Draw the middle X axis cycle
- 49 NEXT K
- 50 '
- 51 FOR K=200 TO 1000 STEP 100
- 52 GOSUB 108 'Draw the last X axis cycle
- 53 NEXT K
- 54 '
- 55 'Print the title & designations for the graph
- 56 LOCATE 1,16
- 57 PRINT "QUARTER WAVE COPPER COAXIAL CAVITIES - D/d = 3.6
- 58 LOCATE 22,12: PRINT "100";
- 59 LOCATE 15,10: PRINT "1,000";
- 60 LOCATE 9,9: PRINT "10,000";
- 61 LOCATE 2,8: PRINT "100,000";
- 62 LOCATE 23,15
- 63 PRINT ".01 0.1 1 10 f in gHz";
- 64 '
- 65 LOCATE 3,64: PRINT "16 cm.";
- 66 LOCATE 5,65: PRINT "8 cm.";
- 67 LOCATE 7,65: PRINT "4 cm.";
- 68 LOCATE 9,65: PRINT "2 cm.";
- 69 LOCATE 11,65: PRINT "1cm.";
- 70 '
- 71 A$ = "Cavity Diameter"
- 72 B$ = "Unloaded Q"
- 73 FOR K=1 TO LEN(A$)
- 74 LOCATE 1+K,73
- 75 PRINT MID$(A$,K,1);
- 76 NEXT K
- 77 '
- 78 FOR K=1 TO LEN(B$)
- 79 LOCATE 1+K,4
- 80 PRINT MID$(B$,K,1);
- 81 NEXT K
- 82 '
- 83 'Line plotting routine
- 84 FOR K=1 TO 5 'Plot the lines for 5 cavities
- 85 N = 1 'Frequency = 10 mHz.
- 86 GOSUB 112 'Calculate the starting point
- 87 L = X: M = Y 'Set up the line origin
- 88 N = 1000 'Frequency = 10 gHz.
- 89 GOSUB 112 'Calculate the end point
- 90 LINE (L,M)-(X,Y) 'Draw the Q line
- 91 S = S*2 'Double the cavity diameter
- 92 NEXT K 'Do the next line
- 93 '
- 94 LINE (150,12)-(E,85) 'Draw the limit line
- 95 LOCATE 3,18
- 96 PRINT "1/3 Wavelength width"
- 97 LOCATE 4,23
- 98 PRINT "limit line"
- 99 '
- 100 LOCATE 20,1 'Put BASICs OK here
- 101 '
- 102 END
- 103 '
- 104 Y = D-(H*C*LOG(K))/U 'This does the horiz. lines
- 105 LINE (A,Y)-(E,Y)
- 106 RETURN
- 107 '
- 108 X = A+(B*C*LOG(K))/U 'This does the vertical lines
- 109 LINE (X,D)-(X,12)
- 110 RETURN
- 111 '
- 112 X = A+INT((B*C*LOG(N))/U) 'This calculates the line ends
- 113 Q = 1329*S*SQR(0.01*N) 'This calculates the cavity Q
- 114 Y = D-INT((LOG(Q)/C-2)*53) 'This converts is to plot lines
- 115 RETURN
-