home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / tech / design4 / databas.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1987-02-21  |  2.5 KB  |  60 lines

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