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

  1. 1  '     UNLOADED Q CORRECTION FACTOR FOR COAXIAL CAVITIES HAVING
  2. 2  '         CAVITY/POST DIAMETER RATIOS OTHER THAN 3.6 TO 1
  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  '23 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 plot in black 
  9. 9  'on a red grid, pausing to permit pen changes.
  10. 10  '
  11. 11  A=250                                          'X origin
  12. 12  B=A+2000                                       'Right side of graph
  13. 13  C=150                                          'Y origin
  14. 14  D=C+1600                                       'Top of graph
  15. 15  E=160                                          'Horizontal line spacing
  16. 16  F=3.6                                          'Optimum D/d ratio  
  17. 17  G=0                                            'Variable
  18. 18  H=2.30258                                     'Log to base 10 conversion
  19. 19  J=377.22                                       'Horiz. corr. factor
  20. 20  L=0                                            'Variable
  21. 21  U=2                                            'Number of cycles
  22. 22  '
  23. 23  LPRINT "RE; RO 0;"                             'Reset the plotter
  24. 24  '
  25. 25  PRINT "INSERT RED PEN THEN ENTER 'CONT'": STOP
  26. 26  '
  27. 27  G=D                                            'Initialize the variable
  28. 28  FOR K=0 TO 10                                  'Draw the horizontals
  29. 29    LPRINT "LN"; B; ","; G; ","; A; ","; G; ";"
  30. 30    G=G-E
  31. 31  NEXT K  
  32. 32  '         
  33. 33  FOR K=1 TO 10
  34. 34    GOSUB 75                                    'Draw the verticals - 1st cycle
  35. 35  NEXT K                                         
  36. 36  '
  37. 37  FOR K=20 TO 100 STEP 10
  38. 38    GOSUB 75                                    'Draw the verticals - 2nd cycle
  39. 39  NEXT K
  40. 40  '
  41. 41  LPRINT "PU;"
  42. 42  '
  43. 43  PRINT "INSERT BLACK PEN THEN ENTER 'CONT'": STOP
  44. 44  '
  45. 45  LPRINT "MA 245,110; TX ;1; MA 545,110; TX ;2; MA 720,110; TX ;3; MA 840,110;"
  46. 46  LPRINT "TX ;4; MA 940,110; TX ;5; MA 1095,105; TX ;7; MA 1235,110; TX ;10;"
  47. 47  LPRINT "MA 1535,110; TX ;20; MA 1710,110; TX ;30; MA 1930,110; TX ;50;"
  48. 48  LPRINT " MA 2075, 110; TX ;70; MA 2220,110; TX ;100;"
  49. 49  '
  50. 50  LPRINT "MA 600,70; TX ;RATIO OF CAVITY TO TUNING POST DIAMETER - OPTIMUM = 3.6;"
  51. 51  '
  52. 52  LPRINT "MA 800,10; TX ;FIGURE 2.  UNLOADED Q CORRECTION FACTOR;"
  53. 53  '
  54. 54  LPRINT "MA 160,140; TX ;0.0; MA 160,300; TX ;0.1; MA 160,460; TX ;0.2;"
  55. 55  LPRINT "MA 160,620; TX ;0.3; MA 160,780; TX ;0.4; MA 160,940; TX ;0.5;"
  56. 56  LPRINT "MA 160,1100; TX ;0.6; MA 160,1260; TX ;0.7; MA 160,1420; TX ;0.8;"
  57. 57  LPRINT "MA 160,1580; TX ;0.9; MA 160,1740; TX ;1.0;"
  58. 58  LPRINT "MA 150,1780; DA 230,1780;"
  59. 59  LPRINT "MA 180,1795; TX ;K;"
  60. 60  '                                 
  61. 61  G=A: L=C                                       'Initialize the variables
  62. 62  LPRINT "MA"; G; "," C; ";"                     'Move pen to the origin
  63. 63  FOR K=1 TO 10 STEP 0.2                          
  64. 64    GOSUB 79                                    'Draw response in 1st cycle
  65. 65  NEXT K
  66. 66  '
  67. 67  FOR K=10 TO 100                                
  68. 68    GOSUB 79                                    'Draw response in 2nd cycle
  69. 69  NEXT K  
  70. 70  '
  71. 71  LPRINT "PU;"                                   'Pen up
  72. 72  '
  73. 73  END
  74. 74  '
  75. 75    X = A+INT((J*H*LOG(K))/U)                    'Figure the interval
  76. 76    LPRINT "LN"; X; ","; C; ","; X; ","; D; ";"  'Draw the vertical
  77. 77  RETURN
  78. 78  '
  79. 79    X=A+INT((J*H*LOG(K))/U)
  80. 80    Y=C+INT((D-C)*((1+F)/LOG(F))*(LOG(K))/(1+K))
  81. 81    LPRINT "DA"; G; "," L; ";"                   'Draw the segment
  82. 82    G=X: L=Y                                     'Shift the coordinates
  83. 83  RETURN 
  84.