home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-02-20 | 2.3 KB | 72 lines |
- 1 ' INSERTION LOSSES OF COAXIAL CAVITIES
- 2 '
- 3 ' Written for the Amiga computer by Robert F. Arnesen, P.E. 3/24/86
- 4 '
- 5 ' Re-written for IBM type machines 20 February 1987.
- 6 '
- 7 ' This is a program for finding the insertion loss of a quarter wave
- 8 'coaxial cavity as a function of its loaded to its unloaded Q.
- 9 '
- 10 SCREEN 2: CLS
- 11 A = 40 'Y axis offset
- 12 B = 100 'Y axis multiplier
- 13 C = 2.30258 'Ln to base 10 conversion
- 14 D = 171 'X axis location
- 15 E = A+530 'End of X axis
- 16 F = 160 'No. of horiz. lines in graph
- 17 U = 2 'No. of log cycles desired
- 18 '
- 19 FOR K=D TO 5 STEP -8
- 20 LINE (A,K)-(E,K) 'Draw the 20 horizontals
- 21 NEXT K '(one for every eighth line)
- 22 '
- 23 FOR K=1 TO 10
- 24 GOSUB 62 'Draw the first cycle
- 25 NEXT K
- 26 '
- 27 FOR K=20 TO 100 STEP 10
- 28 GOSUB 62 'Draw the second cycle
- 29 NEXT K
- 30 '
- 31 'Print the title & designations for the graph
- 32 LOCATE 1,1: PRINT "dB Atten."
- 33 LOCATE 1,15
- 34 PRINT "INSERTION LOSS IN dB versus LOADED/UNLOADED Q"
- 35 '
- 36 LOCATE 22,73: PRINT "QL"; 'Print X axis title
- 37 LINE (590,180)-(600,170)
- 38 LOCATE 23,76: PRINT "QU";
- 39 '
- 40 LOCATE 23,5 'The X axis numbers
- 41 PRINT ".01 .02 .03 .05 .07 .1 .2 .3 .5 .7 1"
- 42 '
- 43 FOR K=0 TO 20 STEP 2
- 44 LOCATE (K+2),2
- 45 PRINT K/2; 'The Y axis numbers
- 46 NEXT K
- 47 '
- 48 'Line plotting routine
- 49 PSET (A,12) 'Set up line origin
- 50 FOR K=1 TO 10 STEP 0.2
- 51 GOSUB 67 'Calculate the first segment
- 52 NEXT K
- 53 '
- 54 FOR K=10 TO 68
- 55 GOSUB 67 'Keep going
- 56 NEXT K
- 57 '
- 58 LOCATE 19,1 'Put BASIC's OK here
- 59 '
- 60 END
- 61 '
- 62 X = A+(B*C*LOG(K))/U 'The U makes it 2 cycles
- 63 N = INT(X/8)
- 64 LINE (X,D)-(X,11) 'This draws the vertical lines
- 65 RETURN
- 66 '
- 67 X = A+(B*C*LOG(K))/U
- 68 W = 20*C*LOG(1/(1-K/100))
- 69 Y = 11+INT(3*W)
- 70 LINE -(X,Y) 'Draw the line segment
- 71 RETURN
-