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

  1. 1  '      COUPLING LOOP CENTER LOCATION & BANDWIDTH CORRECTION FACTOR
  2. 2  '                FOR TUNABLE 1/4 WAVE COAXIAL CAVITIES
  3. 3  '
  4. 4  '    Written for the Amiga computer Using a Sweet-P pen plotter. 
  5. 5  'Robert F. Arnesen P.E., 9340 E Magdalena Drive, Tucson, Ariz. 85710
  6. 6  '7 May 1986.  Line numbers added for other BASICs 20 February 1987.
  7. 7  '
  8. 8  '    This is a pen-plotting routine which will draw the plots in black
  9. 9  'and green on a red grid, pausing to permit pen changes.
  10. 10  '
  11. 11  DATA 59.3,61.7,63.8,65.7,67.4,68.9,70.2,71.5,72.6,73.6
  12. 12  DATA 74.5,75.4,76.2,76.9,77.5,78.1,78.7,79.2,79.7,80.2
  13. 13  DATA .995,.96,.915,.87,.82,.77,.72,.67,.62,.58
  14. 14  DATA .54,.5, .46,.43,.4,.37,.34,.32,.3,.28
  15. 15  '
  16. 16  DIM R(40)
  17. 17  FOR K=1 TO 40
  18. 18  READ R(K)
  19. 19  NEXT K
  20. 20  '
  21. 21  A=250                                   'X axis origin in bits
  22. 22  B=150                                   'Y axis origin in bits
  23. 23  C=2000                                  'Graph width in bits 
  24. 24  D=1600                                  'Graph height in bits
  25. 25  E=A+C                                   'End of graph
  26. 26  F=B+D                                   'Top of graph
  27. 27  G=0                                     'Flag 
  28. 28  H=10                                    'Tick length
  29. 29  J=D*2/100                               'Tick spacing
  30. 30  L=20                                    'No. of X axis spaces
  31. 31  M=C/L                                   'No. bits between vert. lines
  32. 32  N=10                                    'No. of Y axis spaces
  33. 33  P=D/N                                   'No. bits between horiz. lines
  34. 34  V=0                                     'Variable
  35. 35  '
  36. 36  LPRINT "RE; RO 0;"                      'Reset the plotter
  37. 37  '
  38. 38  PRINT "INSERT RED PEN THEN ENTER 'CONT'": STOP
  39. 39  '
  40. 40  LPRINT "MA"; E; "," F; ";"              'Draw the outline
  41. 41  LPRINT "DA"; E; "," B; ";"
  42. 42  LPRINT "DA"; A; "," B; ";"
  43. 43  LPRINT "DA"; A; "," F; ";"
  44. 44  LPRINT "DA"; E; "," F; ";"
  45. 45  '
  46. 46  V=F                                     'Initialize the variable      
  47. 47  FOR K=1 TO 10                           'Left side ticks
  48. 48      FOR Z=1 TO 4
  49. 49        LPRINT "LN"; E; "," V-J; ","E-H","; V-J; ";
  50. 50      V=V-J                                'Decrement the variable
  51. 51      NEXT Z
  52. 52   V=V-J                                 'Skip one tick
  53. 53  NEXT K
  54. 54  '
  55. 55  FOR K=1 TO 10                           'Right side ticks
  56. 56      FOR Z=1 TO 4
  57. 57        LPRINT "LN"; A; ","; V+J; ","; A+H; ","; V+J; ";"
  58. 58        V=V+J
  59. 59      NEXT Z
  60. 60    V=V+J
  61. 61  NEXT K
  62. 62  '
  63. 63  V=F-P                                   'Start 1 down from the top
  64. 64  FOR K=0 TO 8                                  'Draw the horizontals
  65. 65    LPRINT "LN"; A; ","; V; ","; E; ","; V; ";"
  66. 66    V=V-P                                      'Decrement the variable
  67. 67  NEXT K  
  68. 68  '
  69. 69  V=E-M                                   'Initialize the variable
  70. 70  FOR K=0 TO 18                                 'Draw the verticals
  71. 71    LPRINT "LN"; V; ","; B; ","; V; ","; F; ";"       
  72. 72    V=V-M                                      'Decrement the variable
  73. 73  NEXT K
  74. 74  '
  75. 75  LPRINT "PU;"
  76. 76  '
  77. 77  PRINT "INSERT BLACK PEN THEN ENTER 'CONT'": STOP
  78. 78  '
  79. 79  LPRINT "MA 220,110; RO 0; TX ;1.0; MA 720,110; TX ;1.5; MA 1220,110;"
  80. 80  LPRINT "TX ;2.0; MA 1720,110; TX ;2.5; MA 2220,110; TX ;3.0;"
  81. 81  LPRINT "MA 1120,70; TX ;TUNING RANGE;"
  82. 82  LPRINT "MA"; A+250; ",10; TX ;FIGURE 4.  LOOP PLACEMENT & RELATIVE;"
  83. 83  LPRINT "MA"; A+1070; ",10; TX ;BW'S OF 1/4 WAVE COAXIAL CAVITIES;"
  84. 84  '     
  85. 85  LPRINT "PU;"
  86. 86  '
  87. 87  LPRINT "RO 90; MA 130,650; TX ;LOOP CENTER LOCATION IN DEGREES; RO 0;"
  88. 88  '                                                
  89. 89  V=A-110                                 'Initialize the variable
  90. 90  FOR K=55 TO 81 STEP 5                               
  91. 91    LPRINT "MA 170,"; V "; TX"; ";" K ";"  'Print the angles
  92. 92    V=V+2*P                               'Increment the variable
  93. 93  NEXT K
  94. 94  '
  95. 95  V=A+100                                 'Initialize the variable
  96. 96  FOR K=1 TO 20                           'Do the THETA plot
  97. 97     Y=INT(B+(R(K)-55)*2*J)
  98. 98       IF G=0 THEN LPRINT "MA"; V "," Y ";": GOTO 100
  99. 99      LPRINT "DA"; V "," Y ";"
  100. 100     G=1                                 'Set the Flag
  101. 101     V=V+M                               'Increment the variable
  102. 102  NEXT K
  103. 103  '
  104. 104  LPRINT "PU; RO 270;"                     'Pen up & rotate text 270 deg's.
  105. 105  '
  106. 106  PRINT "INSERT THE GREEN PEN AND ENTER 'CONT'": STOP
  107. 107  '
  108. 108  LPRINT "MA 2400,1500; TX ;MINIMUM RELATIVE BANDWIDTH AT TUNING EXTREMES;"
  109. 109  '
  110. 110  LPRINT "RO 0; MA 2280,140; TX ;0.0; MA 2280,300; TX ;0.1; MA 2280,460;"
  111. 111  LPRINT "TX ;0.2; MA 2280,620; TX ;0.3; MA 2280,780; TX ;0.4; MA 2280,940;"
  112. 112  LPRINT "TX ;0.5; MA 2280,1100; TX ;0.6; MA 2280,1260; TX ;0.7;" 
  113. 113  LPRINT "MA 2280,1420; TX ;0.8; MA 2280,1580; TX ;0.9; MA 2280,1740;"
  114. 114  LPRINT "TX ;1.0;"
  115. 115  '
  116. 116  V=A+100: G=0                            'Initialize the variable & Flag
  117. 117  FOR K=21 TO 40                          'Plot relative bandwidth
  118. 118      Y=INT(B+R(K)*D)
  119. 119      IF G=0 THEN LPRINT "MA"; V "," Y ";": GOTO 121
  120. 120      LPRINT "DA"; V "," Y ";"
  121. 121      G=1                                 'Set the Flag
  122. 122  '
  123. 123  LPRINT "PU;"                            'Pen up
  124. 124  '
  125. 125  END
  126.