home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-02-20 | 3.6 KB | 83 lines |
- 1 ' INSERTION LOSS FOR 1/4 WAVE COAXIAL CAVITIES AS A
- 2 ' FUNCTION OF LOADED TO UNLOADED Q
- 3 '
- 4 ' Written for the Amiga computer using a Sweet-P pen plotter.
- 5 'Robert F. Arnesen P.E., 9340 E. Magdalena Drive, Tucson, Ariz. 85710.
- 6 '23 May 1986. Line numbers added for other BASICs 20 February 1987.
- 7 '
- 8 ' This is a pen-plotting routine which will draw the plot in black
- 9 'on a red grid, pausing to permit pen changes.
- 10 '
- 11 A=250 'X origin
- 12 B=A+2000 'Right side of graph
- 13 C=150 'Y origin
- 14 D=C+1600 'Top of graph
- 15 E=160 'Horizontal line spacing
- 16 F=3.6 'Optimum D/d ratio
- 17 G=0 'Variable
- 18 H=2.30258 'Log to base 10 conversion
- 19 J=377.22 'Horiz. corr. factor
- 20 L=0 'Variable
- 21 M=0 'Flag
- 22 U=2 'Number of cycles
- 23 '
- 24 LPRINT "RE; RO 0;" 'Reset the plotter
- 25 '
- 26 PRINT "INSERT RED PEN THEN ENTER 'CONT'": STOP
- 27 '
- 28 G=D 'Initialize the variable
- 29 FOR K=0 TO 10 'Draw the horizontals
- 30 LPRINT "LN"; B; ","; G; ","; A; ","; G; ";"
- 31 G=G-E
- 32 NEXT K
- 33 '
- 34 FOR K=1 TO 10
- 35 GOSUB 72 'Draw the verticals - 1st cycle
- 36 NEXT K
- 37 '
- 38 FOR K=20 TO 100 STEP 10
- 39 GOSUB 72 'Draw the verticals - 2nd cycle
- 40 NEXT K
- 41 '
- 42 LPRINT "PU;"
- 43 '
- 44 PRINT "INSERT BLACK PEN THEN ENTER 'CONT'": STOP
- 45 '
- 46 LPRINT "MA 220,110; TX ;.01; MA 525,110; TX ;.02; MA 700,110; TX ;.03;"
- 47 LPRINT "MA 920,110; TX ;.05; MA 1065,105; TX ;.07; MA 1220,110; TX ;0.1;"
- 48 LPRINT "MA 1525,110; TX ;0.2; MA 1700,110; TX ;0.3; MA 1920,110; TX ;0.5;"
- 49 LPRINT "MA 2065,110; TX ;0.7; MA 2220,110; TX ;1.0;"
- 50 '
- 51 LPRINT "MA 930,70; TX ;RATIO OF LOADED TO UNLOADED Q;"
- 52 LPRINT "MA 600,10; TX ;FIGURE 3. INSERTION LOSS OF 1/4 WAVE COAXIAL CAVITY;"
- 53 LPRINT "RO 90; MA 130,800; TX ;ATTENUATION IN DB; RO 0;"
- 54 '
- 55 LPRINT "MA 200,1740; TX ;0; MA 180,1580; TX ;-1; MA 180,1420; TX ;-2;"
- 56 LPRINT "MA 180,1260; TX ;-3; MA 180,1100; TX ;-4; MA 180,940; TX ;-5;"
- 57 LPRINT "MA 180,780; TX ;-6; MA 180,620; TX ;-7; MA 180,460; TX ;-8;"
- 58 LPRINT "MA 180,300; TX ;-9; MA 160,140; TX ;-10;"
- 59 '
- 60 M=0 'Set the Flag
- 61 FOR K=1 TO 10 STEP 0.2
- 62 GOSUB 76 'Draw response in 1st cycle
- 63 NEXT K
- 64 '
- 65 FOR K=10 TO 69
- 66 GOSUB 76 'Draw response in 2nd cycle
- 67 NEXT K
- 68 '
- 69 LPRINT "PU;" 'Pen up
- 70 '
- 71 END
- 72 '
- 73 X = A+INT((J*H*LOG(K))/U) 'Figure the interval
- 74 LPRINT "LN"; X; ","; C; ","; X; ","; D; ";" 'Draw the vertical
- 75 RETURN
- 76 '
- 77 X=A+INT((J*H*LOG(K))/U)
- 78 Y=D-INT(E*20*LOG(1/(1-K/100))/H)
- 79 IF M=0 THEN LPRINT "MA"; X "," Y; ";": M=1: GOTO 81
- 80 LPRINT "DA"; G; "," L; ";" 'Draw the segment
- 81 G=X: L=Y 'Shift the coordinates
- 82 RETURN
-