home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacker Chronicles 2
/
HACKER2.BIN
/
165.LL.ASC
< prev
next >
Wrap
Text File
|
1988-03-23
|
9KB
|
253 lines
'LL.BAS: true line-loss program..Module 6
MENU:
CLS
PRINT "╔═══════════════════════════════════════════════════════════════╗"
PRINT "║ TRUE TRANSMISSION LINE LOSS & VSWR CALCULATIONS - MODULE 7 ║"
PRINT "╚═══════════════════════════════════════════════════════════════╝"
PRINT "CHOOSE:"
PRINT
PRINT " 1. CONVERT BETWEEN VSWR AND REFLECTED POWER.
PRINT " 2. FIND RATED LINE LOSS AT OPERATING FREQUENCY"
PRINT " FROM RATED VALUE AT ANOTHER FREQUENCY.
PRINT " 3. CALCULATIONS, USING CONDITIONS AT TRANSMITTER END."
PRINT " 4. CALCULATIONS, USING CONDITIONS AT ANTENNA END."
PRINT " 5. QUIT - EXIT MODULE."
PRINT " ENTER CHOICE 1-5:";
INPUT CHOICE
ON CHOICE GOTO CONVERT, COAX, SOURCE, LOAD, ENDING
CONVERT:
CLS
PRINT "╔═══════════════════════════════════════════════════════════════╗"
PRINT "║ TRUE TRANSMISSION LINE LOSS & VSWR CALCULATIONS - MODULE 7 ║"
PRINT "╚═══════════════════════════════════════════════════════════════╝"
PRINT
PRINT "CHOOSE:"
PRINT
PRINT " 1. FIND VSWR FROM FORWARD AND REFLECTED POWER."
PRINT " 2. FIND REFLECTED POWER FROM VSWR AND FORWARD POWER."
PRINT " 3. FIND FORWARD POWER FROM VSWR AND REFLECTED POWER."
PRINT " 4. RETURN TO MAIN MENU."
PRINT " ENTER CHOICE 1,2,3 OR 4:";
INPUT CHOICE
ON CHOICE GOTO CONVERT1, CONVERT2, CONVERT3,MENU
GOTO CONVERT 'catch incorrect choice
CONVERT1:
PRINT
INPUT "ENTER FORWARD POWER (WATTS): ";PF
PRINT
INPUT "ENTER REFLECTED POWER (WATTS): ";PR
RHOP=PR/PF
RHO=SQR(RHOP)
RL=20*LOG(RHO)/LOG(10)
S=(1+RHO)/(1-RHO)
PRINT
PRINT USING "VSWR = ##.##";S
PRINT USING "REFLECTION COEFFICIENT = 0.###";RHO
PRINT USING "RETURN LOSS = +##.# DB.";RL
PRINT
PRINT "CHOOSE:"
PRINT
PRINT " 1. ANOTHER CALCULATION."
PRINT " 2. RETURN TO MAIN MENU."
PRINT " ENTER CHOICE 1 OR 2:";
INPUT CHOICE
ON CHOICE GOTO CONVERT, MENU
GOTO CONVERT 'catch incorrect choice
CONVERT2:
PRINT
INPUT "ENTER FORWARD POWER (WATTS): ";PF
PRINT
INPUT "ENTER VSWR: ";S
PRINT
RHO=(S-1)/(S+1)
RHOP=RHO^2
PR=RHOP*PF
PRINT
PRINT USING "REFLECTED POWER (WATTS) = ####.# ";PR
PRINT
PRINT "CHOOSE:"
PRINT
PRINT " 1. ANOTHER CALCULATION."
PRINT " 2. RETURN TO MAIN MENU."
PRINT " ENTER CHOICE 1 OR 2: ";
INPUT CHOICE
ON CHOICE GOTO CONVERT, MENU
GOTO CONVERT 'catch incorrect entry
CONVERT3:
PRINT
INPUT "ENTER REFLECTED POWER (WATTS): ";PR
PRINT
INPUT "ENTER VSWR: ";S
PRINT
RHO=(S-1)/(S+1)
RHOP=RHO^2
PF=PR/RHOP
PRINT
PRINT USING "FORWARD POWER (WATTS) = ####.# ";PF
PRINT
PRINT "CHOOSE:"
PRINT
PRINT " 1. ANOTHER CALCULATION."
PRINT " 2. RETURN TO MAIN MENU."
PRINT " ENTER CHOICE 1 OR 2: ";
INPUT CHOICE
ON CHOICE GOTO CONVERT, MENU
GOTO CONVERT 'catch incorrect entry
COAX: 'line loss caclulation from mfg data
CLS
PRINT "╔═══════════════════════════════════════════════════════════════╗"
PRINT "║ TRUE TRANSMISSION LINE LOSS & VSWR CALCULATIONS - MODULE 7 ║"
PRINT "╚═══════════════════════════════════════════════════════════════╝"
PRINT
PRINT "You will be asked to enter, from manufacturer's data, the rated"
PRINT "line loss in dB/100 feet -or- dB/100 meters for the transmission"
PRINT "line being used. You will also have to enter the frequency (MHz)"
PRINT "at which this rated loss is given (typically 10 or 100 MHz)."
PRINT "Then you will be asked for the actual length of transmission "
PRINT "line in the same units (feet or meters). Finally, you will enter"
PRINT "the actual frequency of operation (in MHz)."
PRINT
PRINT "The program will then compute the RATED line loss in dB for"
PRINT "the conditions specified. This is NOT the actual line loss."
PRINT "To get actual (true) line loss, select option 3 or 4 "
PRINT "from the Main Menu."
PRINT
INPUT "ENTER RATED LINE LOSS (dB/100 ft-OR-dB/100 meters): ";R
INPUT "ENTER ACTUAL LINE LENGTH (in same units, ft or meters): ";L
INPUT "ENTER FREQUENCY (MHz) AT WHICH RATING IS GIVEN: ";FR
INPUT "ENTER ACTUAL FREQUENCY OF OPERATION (MHz): ";FA
PRINT
RL=R*L/100
ALL=RL*SQR(FA/FR)
PRINT USING "RATED LINE LOSS FOR CONDITIONS SPECIFIED = ##.# dB.";ALL
PRINT
PRINT "CHOOSE:"
PRINT
PRINT " 1. ANOTHER CALCULATION."
PRINT " 2. RETURN TO MAIN MENU."
PRINT " ENTER CHOICE 1 OR 2: ";
INPUT CHOICE
ON CHOICE GOTO COAX, MENU
GOTO MENU 'catch incorrect entry
SOURCE: 'true line loss, entering condx at xmtr end of line
CLS
PRINT "╔═══════════════════════════════════════════════════════════════╗"
PRINT "║ TRUE TRANSMISSION LINE LOSS & VSWR CALCULATIONS - MODULE 7 ║"
PRINT "╚═══════════════════════════════════════════════════════════════╝"
PRINT
D=0:S=1:SP=1:DP=0:ADDL=0 'reset variables
INPUT "ENTER RATED LINE LOSS (dB) FOR LENGTH OF LINE USED: ";D
INPUT "ENTER ANY ADDITIONAL LOSSES (FILTERS, ETC.) IN dB: ";ADDL
INPUT "ENTER VSWR AT TRANSMITTER END OF LINE: ";S
RHO=(S-1)/(S+1)
D=D+ADDL
RHOP=RHO*EXP(.2303*D)
SP=(1+RHOP)/(1-RHOP)
N=(S-(1/S))/(SP-(1/SP))
DP=10*(LOG(N))/LOG(10)
PRINT
PRINT USING "TRUE VSWR AT ANTENNA END OF LINE = ##.##";SP
PRINT USING "TRUE OVERALL LOSS IN dB = +##.##";DP
PRINT USING "TRUE TRANSMISSION LINE OPERATING EFFICIENCY = ###.# PERCENT";N*100
PRINT
PRINT "CHOOSE:"
PRINT
PRINT " 1. ANOTHER CALCULATION."
PRINT " 2. RETURN TO MAIN MENU."
PRINT " ENTER CHOICE 1 OR 2: ";
INPUT CHOICE
ON CHOICE GOTO SOURCE, MENU
GOTO MENU 'catch incorrect choice
LOAD:
CLS
PRINT "╔═══════════════════════════════════════════════════════════════╗"
PRINT "║ TRUE TRANSMISSION LINE LOSS & VSWR CALCULATIONS - MODULE 7 ║"
PRINT "╚═══════════════════════════════════════════════════════════════╝"
PRINT
D=0:S=1:SP=1:DP=0:ADDL=0 'reset variables
INPUT "ENTER RATED LINE LOSS (dB) FOR LENGTH OF LINE USED: ";D
INPUT "ENTER ANY ADDITIONAL LOSSES (FILTERS, ETC.) IN dB: ";ADDL
INPUT "ENTER VSWR AT ANTENNA END OF LINE: ";S
RHO=(S-1)/(S+1)
D=D+ADDL
RHOP=RHO*EXP(-.2303*D)
SP=(1+RHOP)/(1-RHOP)
N=(SP-(1/SP))/(S-(1/S))
DP=10*LOG(N)/LOG(10)
PRINT
PRINT USING "VSWR AT TRANSMITTER END OF LINE = ##.##";SP
PRINT USING "TRUE OVERALL LOSS IN dB = +##.##";DP
PRINT USING "TRUE TRANSMISSION LINE OPERATING EFFICIENCY = ###.# PERCENT";N*100
PRINT
PRINT "CHOOSE:"
PRINT
PRINT " 1. ANOTHER CALCULATION."
PRINT " 2. RETURN TO MAIN MENU."
PRINT " ENTER CHOICE 1 OR 2: ";
INPUT CHOICE
ON CHOICE GOTO LOAD, MENU
GOTO MENU 'catch incorrect choice
ENDING:
PRINT
PRINT " ≡≡≡ PROGRAM COMPLETED ≡≡≡"
END
'╔═══════════════════════════════════════════════════════════╗
'║ Program Authorship Notice ║
'║ ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡ ║
'║ ║
'║ Jacob Z. Schanker, P.E. ║
'║ ║
'║ Scientific Radio Systems, Inc. ║
'║ 367 Orchard Street ║
'║ Rochester, NY 14606 ║
'║ (716) 235-2040 ║
'║ ║
'║ Last revised: March 1988 ║
'║ ║
'╚═══════════════════════════════════════════════════════════╝