; Electronic Calculations ; Requires float.ipl and floatext.ipl ; Updated 7/21/07 to add L and noise calcs ; Updated 8/25/07 to add L C F calcs, better constants OCTAL DEFINE ECAL DO CRLF "[A] C from Z and F" $PRINT CRLF ;C=1/(2piZF) "[B] L from Z and F" $PRINT CRLF ;L=Z/(2piF) "[C] Z from C and F" $PRINT CRLF ;Z=1/(2piCF) "[D] Z from L and F" $PRINT CRLF ;Z=2piLF "[E] F from C and Z" $PRINT CRLF ;F=1/(2piCZ) "[F] R from V and P" $PRINT CRLF ;R=V^2/P "[G] P from V and R" $PRINT CRLF ;P=V^2/Z "[H] V from P and R" $PRINT CRLF ;V=SQR(PR) "[I] F from L and C" $PRINT CRLF ;F=1/(2piSqrt(LC)) "[J] C from L and F" $PRINT CRLF ;C(uf)=2.53303E7/(F^2L(mH)) "[K] L from C and F" $PRINT CRLF ;L(mh)=2.53303E7/(F^2C(uf)) "[L] Class-A Tran.Z" $PRINT CRLF "[M] Parallel R's" $PRINT CRLF "[N] Noise Voltage" $PRINT CRLF ;V=SQR(4kTFR) "Select >" $PRINT CHRIN CRLF CRLF CASE = 101 #0 ;A C=1/(2piZF) "Z ohms ? " $PRINT $IN $>FP "F hz ? " $PRINT $IN $>FP FP* "6.28319" $>FP FP* #1 FLT DSWAP FP/ "1E6" $>FP FP* FP>$ "C =" $PRINT $PRINT " uF" $PRINT CRLF = 102 #0 ;B L=Z/(2piF) "Z ohms ? " $PRINT $IN $>FP "F hz ? " $PRINT $IN $>FP "6.28319" $>FP FP* FP/ "1E3" $>FP FP* FP>$ "L =" $PRINT $PRINT " mH" $PRINT CRLF = 103 #0 ;C Z=1/(2piCF) "C uF ? " $PRINT $IN $>FP "1E-6" $>FP FP* "F hz ? " $PRINT $IN $>FP FP* "6.28319" $>FP FP* #1 FLT DSWAP FP/ FP>$ "Ohms =" $PRINT $PRINT CRLF = 104 #0 ;D Z=2piLF "L mH ? " $PRINT $IN $>FP "1E-3" $>FP FP* "F hz ? " $PRINT $IN $>FP FP* "6.28319" $>FP FP* FP>$ "Ohms =" $PRINT $PRINT CRLF = 105 #0 ;E F=1/(2piCZ) "C uF ? " $PRINT $IN $>FP "1E-6" $>FP FP* "Z ohms ? " $PRINT $IN $>FP FP* "6.28319" $>FP FP* #1 FLT DSWAP FP/ FP>$ "F =" $PRINT $PRINT " hz" $PRINT CRLF = 106 #0 ;F R=V^2/P "Volts? " $PRINT $IN $>FP OVER OVER FP* "Watts? " $PRINT $IN $>FP FP/ FP>$ "Ohms =" $PRINT $PRINT CRLF = 107 #0 ;G P=V^2/Z "Volts ? " $PRINT $IN $>FP OVER OVER FP* "R ohms? " $PRINT $IN $>FP FP/ FP>$ "Watts =" $PRINT $PRINT CRLF = 110 #0 ;H V=SQR(PR) "Watts ? " $PRINT $IN $>FP "R ohms? " $PRINT $IN $>FP FP* FSQR FP>$ "Volts =" $PRINT $PRINT CRLF = 111 #0 ;I F=1/(2piSqrt(LC)) #1 FLT "6.28319" $>FP "C uF ? " $PRINT $IN $>FP "1E-6" $>FP FP* "L mH ? " $PRINT $IN $>FP "1E-3" $>FP FP* FP* FSQR FP* FP/ FP>$ "F =" $PRINT $PRINT " hz" $PRINT CRLF = 112 #0 ;J C(uf)=2.53303E7/(F^2L(mH)) "2.53303E7" $>FP "F ? " $PRINT $IN $>FP OVER OVER FP* "L mH ? " $PRINT $IN $>FP FP* FP/ FP>$ "C =" $PRINT $PRINT " uF" $PRINT CRLF = 113 #0 ;K L(mh)=2.53303E7/(F^2C(uf)) "2.53303E7" $>FP "F ? " $PRINT $IN $>FP OVER OVER FP* "C uF ? " $PRINT $IN $>FP FP* FP/ FP>$ "L =" $PRINT $PRINT " mH" $PRINT CRLF = 114 #0 ;L ;class-A transformer calculations... ;V=Vsup-Vsat, Z=(.707107V)/I, P=((.707107V)^2)/Z "Supply V ? " $PRINT $IN $>FP "Saturation V ? " $PRINT $IN $>FP FP- ".707107" $>FP FP* OVER OVER "Bias in amps ? " $PRINT $IN $>FP FP/ OVER OVER FP>$ "Trans.Z =" $PRINT $PRINT " ohms" $PRINT CRLF DSWAP OVER OVER FP* DSWAP FP/ FP>$ "Output watts =" $PRINT $PRINT CRLF = 115 #0 ;M ; Rtotal = 1/(1/R1+1/R2+1/Rn ...) "Enter R's, just enter to calc" $PRINT CRLF #0 FLT DO $IN $TRIM $LEN IFNZ #1 FLT $>FP FP/ FP+ #0 ELSE $DROP #1 ENDIF UNTIL #1 FLT DSWAP FP/ FP>$ "PAR R =" $PRINT $PRINT CRLF = 116 #0 ;N ;NoiseV=SQR(4kTFR) where k=1.38065E-23, T=Kelvins (C+273.15) ;F=frequency bandwidth and R=resistance in ohms "R in ohms ? " $PRINT $IN $>FP "Bandwidth Hz ? " $PRINT $IN $>FP "Temperature C ? " $PRINT $IN $>FP "273.15" $>FP FP+ FP* FP* "5.5226E-23" $>FP FP* FSQR "1E6" $>FP FP* FP>$ "Noise =" $PRINT $PRINT " uV" $PRINT CRLF DEFAULT #1 ENDCASE UNTIL ;invalid key pressed END CONSOLE