|
WA2ISE > TECH 10.12.20 20:57l 99 Lines 3472 Bytes #999 (0) @ WW
BID : 10881_AL0Y
Read: GUEST
Subj: L, C, Reactance and Frequency Calculator html code
Path: IW8PGT<IZ3LSV<IK5FKA<IK5FKA<PE1RRR<W0ARP<AL0Y
Sent: 201210/1956Z 10881@AL0Y.#NNJ.NJ.USA.NOAM BPQ6.0.20
This html code below is an LC Reactance and Frequency calculator good for selecting LC values, caps for a desired reactance, or determining the resonant frequency of specific inductance and capacitance values.
Copy and paste the below html code and save it as an html file, like lcrf.htm on your computer. Then use your browser, like Firefox, to run it.
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252"></head><body bgcolor="#FED286">
<center>
<h1>L, C, Reactance and Frequency Calculator</h1>
</center>
<blockqoute><blockquote>
Enter any two known values and press "Calculate" to solve for the others.
For example, a 1000pF capacitor or a 25.3 μH inductor will have 159Ω
of reactance at a frequency of 1 MegaHertz. Fields should be reset to 0 using the reset button
before doing a new calculation.
<p></p><h4><b></b><center>
<b>Inductive Reactance (Xℓ) = 2πFL
<br>
Capacitive Reactance (Xc) = 1 / ( 2πFC )
<br>
Resonant Frequency (Fo) = 1 / ( 2π√<span style="text-decoration: overline">LC</span> )
</b></center></h4>
</blockquote>
<script language="Javascript">
var PI=3.14159
var C
var L
var F
var X
function Process(form)
{
L=L*1
F=F
C=C/1000000
if (C > 0 && F > 0) { X = (1/(2*PI*F*C)); L=X/(2*PI*F)}
if (L > 0 && F > 0) { X = (2*PI*F*L); C=1/(2*PI*X*F) }
if (C > 0 && X > 0) { F = 1/(2*PI*X*C); L= X/(2*PI*F) }
if (L > 0 && X > 0) { F = X/(2*PI*L); C=1/(2*PI*X*F) }
if (F > 0 && X > 0) { L = X/(2*PI*F); C=1/(2*PI*X*F) }
if (C > 0 && L > 0) {
X=Math.sqrt((L*C),2)
F=(1/(2*PI*X))
X=2*PI*F*L
}
L=Math.round(L*1000)
L=L/1000
F=Math.round(F*100000000)
F=F/100000000
C=Math.round(C*10000000)
C=C/10
X=Math.round(X*1000)
X=X/1000
form.C.value = C
form.L.value = L
form.F.value = F
form.X.value = X
}
function SetC(C1) { C = C1.value }
function SetL(L1) { L = L1.value }
function SetX(X1) { X = X1.value }
function SetF(F1) { F = F1.value }
function ClearForm(form){
C=0
L=0
X=0
F=0
form.C.value = 0
form.L.value = 0
form.X.value = 0
form.F.value = 0
}
</script>
<center>
<form method="post">
<font size="11">
</font><table bordercolor="BLUE" border="5">
<tbody><tr>
<td><div align="center"><b>Capacitance<br>(picofarads)</b></div></td>
<td><div align="center"><b>Inductance<br>(microhenrys)</b></div></td>
<td><div align="center"><b>Reactance<br>(Ohms)</b></div></td>
<td><div align="center"><b>Frequency<br>(MegaHertz)</b></div></td>
<td><input onclick="Process(this.form)" value="Calculate" style="background-color:#070; color:#fff;" type="button"></td>
</tr>
<tr><td><div align="center"><input name="C" size="12" onchange="SetC(this)" style="background-color:#fec; color:#017;" type="text"></div></td>
<td><div align="center"><input name="L" size="12" onchange="SetL(this)" style="background-color:#fec; color:#017;" type="text"></div></td>
<td><div align="center"><input name="X" size="12" onchange="SetX(this)" style="background-color:#fec; color:#017;" type="text"></div></td>
<td><div align="center"><input name="F" size="12" onchange="SetF(this)" style="background-color:#fec; color:#017;" type="text"></div></td>
<td><div align="center"><input value=" Reset " onclick="ClearForm(this.form)" style="background-color:#c00; color:#fff;" type="button"></div>
</td></tr>
</tbody></table>
</form>
Adapted from Bill Bowden's XLC.htm file</center></blockqoute></body></html>
Read previous mail | Read next mail
| |