home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-02-20 | 3.3 KB | 86 lines |
- 1 ' Coupling Loop Location & Bandwidth Characteristics in Tuneable
- 2 ' Coaxial Cavities
- 3 '
- 4 ' Written for the Amiga computer by Robert F. Arnesen, P.E. 09/01/86
- 5 '
- 6 ' Re-written for IBM type machines 20 February 1987.
- 7 '
- 8 ' This program asks for all necessary cavity parameters then calculates
- 9 'and prints all of the bandwidths, and phase angles at the minimum,
- 10 'center, and maximum frequencies, in columnar form. This will take a
- 11 'little time because of their complexity, how much depends on the computer
- 12 'being used. It will then print out the loop radius, it's area, and the
- 13 'distance between the loop center and the shorting plane.
- 14 '
- 15 '
- 16 INPUT "What is the minimum frequency of interest (in gHz) "; F1
- 17 INPUT "What is the maximum frequency of interest (in gHz) "; F3
- 18 INPUT "What is the desired loaded Q value "; Q
- 19 INPUT "What is the proposed cavity diameter in millimeters "; S
- 20 INPUT "What is the impedance of the connections to the cavity in ohms "; Z1
- 21 INPUT "What is the characteristic impedance of the cavity in ohms"; Z2
- 22 INPUT "Is unit single or double loaded ? Answer with S or D "; N$
- 23 IF N$ = "D" OR N$ = "d" THEN N = 0.25 ELSE N = 0.5
- 24 '
- 25 SCREEN 2: CLS 'Clear the screen
- 26 B = 57.3 'Radian conversion factor
- 27 PI = 3.14159
- 28 U = 2*PI
- 29 R = F3/F1
- 30 J = 0 'Variable
- 31 '
- 32 PRINT "Please hold on a bit while I think about it."
- 33 '
- 34 ' Calculate the degree value at the highest frequency
- 35 FOR K=R TO 1 STEP -0.1
- 36 FOR A=45 TO 90 STEP 0.1
- 37 IF COS(A/(B*K)) >= SQR(K^3)*COS(A/B) THEN 41
- 38 NEXT A
- 39 NEXT K
- 40 '
- 41 C = A/R 'Degree value at lowest frequency
- 42 E = (R-1)/2 'Center frequency factor
- 43 F = (A-C)/2 'Frequency range
- 44 G = 1/COS(C/B)^2
- 45 H= N*Z1*Z2 'For convenience
- 46 M = 1+E 'Mult. factor for center frequency
- 47 A2 = M*C 'Angle at center frequency
- 48 F2 = M*F1 'True center frequency
- 49 '
- 50 ' Calculate loop A/R ratio at the Center Frequency
- 51 X = SQR(H/Q)/(F2*COS(A2/B))
- 52 V = X^2
- 53 '
- 54 CLS
- 55 '
- 56 ' Print the header
- 57 PRINT " F gHz Bw in mHz Theta Degrees "
- 58 PRINT "------- ----------- ---------------"
- 59 '
- 60 ' Print the frequencies, the bandwidths, and the phase angles
- 61 J = C 'Reset the variable
- 62 FOR K=1 TO R+0.01 STEP E
- 63 L=K^3*(COS(J/B)^2)
- 64 PRINT USING "###.## ";K*F1,(V*(K*F1)^3)*(COS((C*K)/B)^2)*1000/H,K*C
- 65 J = J+F
- 66 NEXT K
- 67 '
- 68 ' Calculate the loop radius
- 69 Y = SQR(X/(2*U)^2 + (X*S)/U) - X/U
- 70 '
- 71 ' Calculate the loop area
- 72 Z = PI* Y^2
- 73 '
- 74 ' Calculate the loop distance from shorting plane
- 75 T = (0.8333*A2)/F2
- 76 '
- 77 ' Convert to single decimal place & print them out
- 78 Y = INT(Y*10)/10: Z = INT(Z*10)/10: T = INT(T*10)/10
- 79 PRINT
- 80 '
- 81 PRINT "Loop radius should be "; Y; " mm."
- 82 PRINT "Loop area should be "; Z; " sq. mm."
- 83 PRINT "Loop center should be "; T; "mm. from the shorting plane."
- 84 '
- 85 END
-