home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-02-21 | 2.5 KB | 60 lines |
- 1 ' Coupling Loop Location & Bandwidth Characteristics in Tunable
- 2 ' Coaxial Cavities
- 3 '
- 4 ' Written for the Amiga computer by Robert F. Arnesen, P.E. 3/28/86
- 5 '
- 6 ' Re-written for IBM type machines 20 February 1987.
- 7 '
- 8 ' The tuning range only requires one number, such as 2.5 for a two
- 9 'and a half to one range, since the minimum of one is assumed by the
- 10 'program. The program will then calculate and print the relative
- 11 'frequencies in one-tenth increments, together with the relative
- 12 'bandwidth at each increment. The angle shown for each increment is
- 13 'that at the center of the loop at that relative frequency. The
- 14 'simplest way to determine where to put it is to locate it at the
- 15 'number of degrees given for the highest frequency used. For instance,
- 16 'for a tuning range of 2.5 TO 1 the angle is 77.5 degrees, so the loop
- 17 'should be placed such that it's center is 77.5 degrees from the
- 18 'shorting plane at the highest frequency of interest.
- 19 '
- 20 SCREEN 2: CLS 'Clear the screen
- 21 '
- 22 INPUT "What is tuning range of interest (Enter only one number)"; R
- 23 '
- 24 CLS
- 25 PRINT "Hang on a bit while I think about it."
- 26 '
- 27 B=57.3 'Radian conversion factor
- 28 J=0 'Variable
- 29 '
- 30 FOR K=R TO 1 STEP -0.1 'Calculate the degree value at the
- 31 FOR A=45 TO 90 STEP 0.1 ' highest frequency
- 32 IF COS(A/(B*K))>=SQR(K^3)*COS(A/B) THEN 36
- 33 NEXT A
- 34 NEXT K
- 35 '
- 36 C=A/R 'Degree value at lowest frequency
- 37 E=(R-1)/2 'Center frequency factor
- 38 F=(A-C)/2 'Frequency range
- 39 G=1/COS(C/B)^2
- 40 M=1+E 'Mult. factor for center frequency
- 41 F2=C*M 'Angle at center frequency
- 42 '
- 43 ' Calculate the bandwidth normalization factor'
- 44 H=(M)^3*(COS(F2/B)^2)
- 45 '
- 46 CLS
- 47 ' Print the header
- 48 PRINT " Rel. f Theta Rel. Bw
- 49 PRINT "------- ------- ---------"
- 50 '
- 51 ' Print the rel. frequency, the phase angle, & rel. bandwidth
- 52 J=C 'Reset the variable
- 53 FOR K=1 TO R+0.01 STEP E
- 54 L=K^3*(COS(J/B)^2)
- 55 PRINT USING "##.## ";K,C*K,L/H
- 56 J=J+F
- 57 NEXT K
- 58 '
- 59 END
-