"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"C1 = 1000e-12;# IN fARADS\n",
"C2 = 500e-12;# IN fARADS\n",
"fr1 = 92500;# in Hz\n",
"fr2 = 127800;# in Hz\n",
"\n",
"#calculation:\n",
" #For a series R\u2013L\u2013C circuit the resonant frequency fr is given by:\n",
" #fr = 1/(2pi*(L*C)**2)\n",
"Cs = ((C1 - C2)/((fr2/fr1)**2 - 1)) - C2\n",
"L = 1/((C1 + Cs)*(2*math.pi*fr1)**2)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)stray capacitance, Cs is \",round(Cs*1E12,2),\"pF\\n\"\n",
"print \"\\n (b)inductance, L is \",round(L*1000,2),\"mH\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)stray capacitance, Cs is 50.13 pF\n",
"\n",
"\n",
" (b)inductance, L is 2.82 mH\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 4, page no. 497
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"R = 10;# in ohms\n",
"C = 5e-6;# IN fARADS\n",
"rv = 20;#in volts\n",
"thetav = 0;# in degrees\n",
"f = 318.3;# in Hz\n",
"\n",
"#calculation:\n",
"wr = 2*math.pi*f\n",
" #The maximum voltage across the resistance occurs at resonance when the current is a maximum. \n",
" #At resonance,L = 1/c*wr**2\n",
"L = 1/(C*wr**2)\n",
" #voltage\n",
"V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
" #Current at resonance Ir\n",
"Ir = V/R\n",
" #p.d. across resistance, VR\n",
"VR = Ir*R\n",
" #inductive reactance, XL\n",
"XL = wr*L\n",
" #p.d. across inductance, VL\n",
"VL = Ir*(1j*XL)\n",
" #capacitive reactance, Xc\n",
"Xc = 1/(wr*C)\n",
" #p.d. across capacitor, Vc\n",
"Vc = Ir*(-1j*Xc)\n",
" #Q-factor at resonance, Qr\n",
"Qr = VL.imag/V\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)inductance, L is \",round(L*1000,2),\"mH\\n\"\n",
"print \"\\n (b)p.d. across resistance, VR is \",VR,\" V, p.d. across inductance, VL \",round( VL.imag,2),\"j V \"\n",
"print \"and p.d. across capacitor, VC \",round(Vc.imag,2),\" V\\n\"\n",
"print \"\\n (c)Q-factor at resonance, Qr is \",round(abs(Qr),2),\" \\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)inductance, L is 50.0 mH\n",
"\n",
"\n",
" (b)p.d. across resistance, VR is (20+0j) V, p.d. across inductance, VL 200.01 j V \n",
"and p.d. across capacitor, VC -200.01 V\n",
"\n",
"\n",
" (c)Q-factor at resonance, Qr is 10.0 \n",
"\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 5, page no. 502
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"R = 80;# in ohms\n",
"C = 0.4e-6;# IN fARADS\n",
"L = 0.020;# IN Henry\n",
"Vm = 12;#in volts\n",
"\n",
"#calculation:\n",
" #Resonant frequency,\n",
"fr = 1/(2*math.pi*((L*C)**0.5))\n",
"wr = 2*math.pi*fr\n",
" #Q = wr*L/R\n",
"Q = wr*L/R\n",
"Vc = Q*Vm\n",
" #the frequency f at which VC is a maximum value,\n",
"f = fr*(1 - (1/(2*Q*Q)))**0.5\n",
" #the maximum value of the p.d. across the capacitor is given by:\n",
"Vcm = Vc/((1 - (1/(2*Q*Q)))**0.5)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)The resonant frequency is \",round(fr,2),\" Hz\\n\"\n",
"print \"\\n (b)the value of the p.d. across the capacitor at the resonant frequency \",round(Vc,2),\" V\\n\"\n",
"print \"\\n (c)the frequency f at which Vc is a maximum value, is \",round(f,2),\" Hz\\n\"\n",
"print \"\\n (d)the maximum value of the p.d. across the capacitor is \",round(Vcm,2),\" V\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)The resonant frequency is 1779.41 Hz\n",
"\n",
"\n",
" (b)the value of the p.d. across the capacitor at the resonant frequency 33.54 V\n",
"\n",
"\n",
" (c)the frequency f at which Vc is a maximum value, is 1721.52 Hz\n",
"\n",
"\n",
" (d)the maximum value of the p.d. across the capacitor is 34.67 V\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"