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

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