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

  1. 1  '    COUPLING LOOP CENTER LOCATION & BANDWIDTH CORRECTION FACTOR
  2. 2  '                  FOR TUNABLE COAXIAL CAVITIES
  3. 3  '
  4. 4  '   Written for the Amiga computer by Robert F. Arnesen, P.E. 5/7/86
  5. 5  '
  6. 6  '   Re-written for IBM type machines 20 February 1987.
  7. 7  '
  8. 8  '  This is a program for plotting the placement, in degrees from the
  9. 9  'shorting plane at the highest frequency of interest, of the coupling
  10. 10  'loop (or loops) in a tunable coaxial cavity.  It also plots the
  11. 11  'correction factor to be used for determining the minimum bandwidth
  12. 12  'at the frequency extremes.  The actual bandwidths at the extremes
  13. 13  'can be found by multiplying the real bandwidth at the center of the
  14. 14  'tuning range by the appropriate correction factor given by the graph.
  15. 15  '
  16. 16  DATA 59.3,61.7,63.8,65.7,67.4,68.9,70.2,71.5,72.6,73.6
  17. 17  DATA 74.5,75.4,76.2,76.9,77.5,78.1,78.7,79.2,79.7,80.2
  18. 18  DATA .995,.96,.915,.87,.82,.77,.72,.67,.62,.58
  19. 19  DATA .54,.5,.46,.43,.4,.37,.34,.32,.3,.28
  20. 20  '
  21. 21  DIM P(40)
  22. 22  '
  23. 23  SCREEN 2: CLS
  24. 24  A = 75                              'Y axis offset
  25. 25  B = 171                             'X axis location
  26. 26  C = 479                             'Graph width in pixels
  27. 27  D = 160                             'Graph height in lines
  28. 28  E = A+C                             'End of X axis
  29. 29  F = B+1-D                           'Top of graph
  30. 30  G = 0                               'Flag
  31. 31  H = 20                              'No. of horiz. & vert. boxes
  32. 32  J = (C+1)/H                         'No. of pixels between verticals
  33. 33  L = D/H                             'No. lines between horizontals
  34. 34  M = 0                               'Variable
  35. 35  N = 0                               'Variable
  36. 36  '
  37. 37  A$ = "THETA in degrees"
  38. 38  B$ = "Relative Bw in percent"
  39. 39  '
  40. 40  FOR K=1 TO 40
  41. 41    READ P(K)                         'Read data into the matrix
  42. 42  NEXT K
  43. 43  '
  44. 44  FOR K=B TO 5 STEP -L
  45. 45    LINE (A,K)-(E,K)                  'Draw the horizontals
  46. 46  NEXT K
  47. 47  '
  48. 48  FOR K=1 TO 21
  49. 49    LINE (A,B)-(A,12)                 'Draw the verticals
  50. 50    A = A+J
  51. 51  NEXT K
  52. 52  '
  53. 53              'Print the titles & designations for the graph
  54. 54  LOCATE 1,20
  55. 55  PRINT "LOOP CENTER LOCATION & RELATIVE BANDWIDTH"
  56. 56  LOCATE 14,19: PRINT "Theta"
  57. 57  LOCATE 12,49: PRINT "Delta Bw"
  58. 58  LOCATE 23,9
  59. 59  PRINT "1.0"; SPC(12) "1.5"; SPC(12) "2.0"; SPC(12) "2.5   f2/f1    3.0";
  60. 60  LOCATE 2,8: PRINT "80";: LOCATE 7,8: PRINT "75";
  61. 61  LOCATE 12,8: PRINT "70";: LOCATE 17,8: PRINT "65";
  62. 62  LOCATE 22,8: PRINT "60";
  63. 63  '
  64. 64  FOR K=1 TO LEN(A$)
  65. 65    LOCATE 2+K,4
  66. 66    PRINT MID$(A$,K,1);               'Print the Theta plot title
  67. 67  NEXT K
  68. 68  '
  69. 69  FOR K=0 TO 20 STEP 2
  70. 70    LOCATE 22-K,71
  71. 71    PRINT K/H                         'Print Relative Bandwidth nos.
  72. 72  NEXT K
  73. 73  '
  74. 74  FOR K=1 TO LEN(B$)
  75. 75    LOCATE 1+K,76
  76. 76    PRINT MID$(B$,K,1)                'Print Rel. B'width plot title
  77. 77  NEXT K
  78. 78  '
  79. 79              'Angular distance plotting routine
  80. 80  M = 123: N = 0: G = 0               'Set up to shift segment origins
  81. 81  FOR K=2 TO 20                       'Use the first 20 sets of data
  82. 82    Y = INT(B+1-L*(P(K)-60))
  83. 83    IF G=0 THEN 86                    'If first pair then don't plot
  84. 84    LINE (M,N)-(M+J,Y)                'Draw the segment
  85. 85    M = M+J                           'Increment the X axis
  86. 86    G = 1                             'Set the Skip Flag
  87. 87    N = Y                             'Change the segment origen
  88. 88  NEXT K
  89. 89  '
  90. 90              'Relative Bandwidth correction factor
  91. 91  M = 99: N = 0: G = 0                'Reset all starting constants
  92. 92  FOR K=21 TO 40                      'Use the last 20 sets of data
  93. 93    Y = INT(B+1-D*P(K))
  94. 94    IF G=0 THEN 97                    'If first time then don't plot
  95. 95    LINE (M,N)-(M+J,Y)                'Draw the segment
  96. 96    M = M+J                           'Increment the X axis
  97. 97    G = 1                             'Set the Skip Flag
  98. 98    N = Y                             'Change the segment origen
  99. 99  NEXT K
  100. 100  '
  101. 101  LOCATE 21,1                        'Put BASICs OK here
  102. 102  '
  103. 103  END
  104.