summaryrefslogtreecommitdiff
path: root/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER2.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER2.ipynb')
-rwxr-xr-xElectronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER2.ipynb1765
1 files changed, 1765 insertions, 0 deletions
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER2.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER2.ipynb
new file mode 100755
index 00000000..d2b818c6
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER2.ipynb
@@ -0,0 +1,1765 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2:Electronics Instruments"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1,Page no:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "currentt through the PMMC meter is 2.5 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "gm = 0.005; #transconductance in siemens\n",
+ "RQ1 = 100*10**3; #FET resistance in KΩ\n",
+ "RQ2 = 100*10**3; #FET resistance in KΩ\n",
+ "RQ = 100*10**3; #FET resistance in KΩ\n",
+ "Rm = 50; #meter's resistance in Ω\n",
+ "RD = 10*10**3; #drain resistance in KΩ\n",
+ "v1 = 1; \n",
+ "\n",
+ "#calculations\n",
+ "x = (RQ*RD)/float(RQ+RD);\n",
+ "i = (gm*x*v1)/float((2*x)+Rm); #print'currentt through the PMMC meter(mA)\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'currentt through the PMMC meter is %3.1f'%(i*10**3),'mA';\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.2,Page no:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error -3.9 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration \n",
+ "e = 150; #in V\n",
+ "t = 3; #time in s\n",
+ "Kfsin = 1.11; #form factor\n",
+ "\n",
+ "#calculations\n",
+ "#the sawtooth waveform can be expressed as e = mt\n",
+ "m = e/float(t);\n",
+ "\n",
+ "#e = 50*t;\n",
+ "#now integration of (50*t)**2 will be 2500*((t**3)/3) with limits ranging 0 to 3 ,solving we get\n",
+ "\n",
+ "Erms = math.sqrt((1/float(9))*((2500)*(t**3)-(0))); #Erms in V\n",
+ "#now integration of (50*t) will be (50/2)*((t**2)/2) with limits ranging 0 to 3 ,solving we get\n",
+ "Eav = (1/float(6))*((50)*((t**2)-0)); #Eav in V\n",
+ "Kfsaw = Erms/float(Eav); #form factor \n",
+ "x = (Kfsin)/float(Kfsaw); #ratio of two form factors\n",
+ "e = ((x-1)/float(1))*100; #percentage error \n",
+ "\n",
+ "#result\n",
+ "print'percentage error %3.1f'%e,'%'\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.3,Page no:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error 11.00 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#vaariable declaration\n",
+ "Kfsin = 1.11; #form factor of sine wave\n",
+ "\n",
+ "#calculation\n",
+ "#Erms = math.sqrt((1/T)*(integration(e**2)dt)) with limits from 0 to T is math.sqrt((1/T)*(Emax**2(T-0)))=Emax\n",
+ "#Erms = Emax;\n",
+ "#Erms = math.sqrt((1/T)*(integration(e*dt)) with limits from 0 to T is math.sqrt((2/T)*(Emax(T/2-0)))=Emax\n",
+ "#Eav = Emax;\n",
+ "#Kfsquare = Erms/float(Emax); #form factor of squarewave\n",
+ "Kfsquare = 1;\n",
+ "x = Kfsin/float(Kfsquare); #ratio of form factors\n",
+ "e = ((x-1)/float(1))*100; #percentage error in %\n",
+ "\n",
+ "#result\n",
+ "print'percentage error %3.2f'%e,'%';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4,Page no:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input voltage 1 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Va = 2000; #anode voltage in V\n",
+ "Id = 0.02; #length of parallel plates in m\n",
+ "d = 0.005; #distance between plates in m\n",
+ "L = 0.3; #distance between screen and plates in m\n",
+ "D = 0.03; #deflect of beam in m\n",
+ "g = 100; #overall gain\n",
+ "\n",
+ "#calculations\n",
+ "Vd = (2*d*Va*D)/float(L*Id); #voltage in V\n",
+ "Vi = Vd/float(g); #input voltage in V\n",
+ "\n",
+ "#result\n",
+ "print'input voltage %d'%Vi,'V';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.5,Page no:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "deflection sensitivity 0.2 mm/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Va = 2500; #potential difference in V\n",
+ "Id = 0.025; #length of parallel plates in m\n",
+ "d = 0.005; #distance between plates in m\n",
+ "L = 0.2; #distance between screen and plates in m\n",
+ "D = 0.03; #deflect of beam in m\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "Vd = (2*d*Va*D)/float(L*Id); #voltage in V\n",
+ "Vi = D/float(Vd); #deflection sensitivity in mm/V\n",
+ "\n",
+ "#result\n",
+ "print'deflection sensitivity %2.1f'%(Vi*10**3),'mm/V';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.6,Page no:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "deflection sensitivity 0.16 mm/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Id = 0.02; #length of horizontal plates in m\n",
+ "d = 0.005; #distance between plates in m\n",
+ "L = 0.2; #distance between screen and plates in m\n",
+ "Va = 2500; #accelerating voltage in V\n",
+ "\n",
+ "#calculations\n",
+ "S = (L*Id)/float(2*d*Va); #deflection sensitivityin mm/V\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'deflection sensitivity %3.2f'%(S*10**3),'mm/V';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7,Page no:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "beam speed 29.65 m/s\n",
+ "deflection sensitivity 0.3 mm/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variabledeclaration\n",
+ "va = 2500; #anode to cathode voltage in V\n",
+ "Id = 0.015; #length of parallel plates in m\n",
+ "d = 0.005; #distance between plates in m\n",
+ "L = 0.5; #distance between plates and screen in m\n",
+ "m = 9.109*10**-31; #mass of electron in kg\n",
+ "e = 1.602*10**-19; #charrge of electron in C\n",
+ "\n",
+ "#calculations\n",
+ "v = math.sqrt((2*e*va)/float(m)); #beam speed in m/s\n",
+ "S = (L*Id)/float(2*d*va); #deflection sensitivity in mm/V\n",
+ "\n",
+ "#calculatons\n",
+ "print'beam speed %3.2f'%(v*10**-6),'m/s';\n",
+ "print'deflection sensitivity %3.1f'%(S*10**3),'mm/V';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.8,Page no:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "density of magnetic field 1.584 m Wb/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "L = 0.22; #distance between screen and plates in m\n",
+ "l = 0.033; #width of uniform magnetuc field in m\n",
+ "Va = 6000; #anode potential in V\n",
+ "D = 0.044; #deflection on the screen in m\n",
+ "m = 9.107*10**-31; #mass of electron in kg\n",
+ "e = 1.6*10**-19; #charge of electron in m\n",
+ "\n",
+ "#calculations\n",
+ "X = math.sqrt(e/float(2*m*Va)); #density of magnetic field in Wb/m**2\n",
+ "B = D/float(L*l*X);\n",
+ "\n",
+ "#result\n",
+ "print'density of magnetic field %3.3f'%(B*10**3),'m Wb/m**2';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.9,Page no:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "voltage applied to Y deflection 30.179 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "B = 1.8*10**-4; #flux density in Wb/m**2\n",
+ "Va = 800; #final anode voltage in V\n",
+ "d = 0.01; #distance ebetween plates in m\n",
+ "m = 9.107*10**-31; #mass of electron in kg\n",
+ "e = 1.6*10**-19; #charge of electron in C\n",
+ "\n",
+ "#calculations\n",
+ "#we have D = B*L*I*(math.sqrt((e/float(2*m*Va)))\n",
+ "#let us assume x = B*(math.sqrt((e/float(2*m*Va)))\n",
+ "#thus D = x*L*I\n",
+ "#we also have D = L*Vd*l/float(2*d*Va)\n",
+ "#let us assume y = 1/float(2*d*Va) \n",
+ "#thus D = L*Vd*l*y\n",
+ "#comparing both D equations we get\n",
+ "x = B*(math.sqrt((e)/float(2*m*Va)));\n",
+ "y = 1/float(2*d*Va) ;\n",
+ "Vd = x/float(y); #voltage applied to Y deflection in V\n",
+ " \n",
+ "#result\n",
+ "print'voltage applied to Y deflection %3.3f'%Vd,'V';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.10,Page no:207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Peak-to-peak value 15.6 mV\n",
+ "Amplitude 7.8 mV\n",
+ "R.m.s value 5.515 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "a = 3; #vertical attenuation in mV/div\n",
+ "x = 5; #one part is sub divided in units\n",
+ "\n",
+ "#callculations\n",
+ "s = 1/float(x); #1 subdivision in units\n",
+ "pp = 2+(a*s); #positive peak in units\n",
+ "Vpp = pp+pp; #peak to peak voltage in divisions\n",
+ "Vpp1 = a*Vpp; #peak to peak voltage in mV\n",
+ "Vmax = Vpp1/float(2); #amplitude in mV\n",
+ "Vrms =Vmax/float(math.sqrt(2)); #R.m.s value in mV\n",
+ "\n",
+ "#result\n",
+ "print'Peak-to-peak value %3.1f'%Vpp1,'mV';\n",
+ "print'Amplitude %3.1f'%Vmax,'mV';\n",
+ "print'R.m.s value %3.3f'%Vrms,'mV';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.11,Page no:210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "possible phases are 30.00 ° or 330.00 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "#from figure we note this values\n",
+ "y1 = 1.25; #vertical axis in divisions\n",
+ "y2 = 2.5; #maximum vertical value in divisions\n",
+ "\n",
+ "#calculations\n",
+ "x = y1/float(y2); \n",
+ "phi = math.asin(x); #sinphi value \n",
+ "phi1 = 360-((phi*180)/float(math.pi)); #possible phases\n",
+ "\n",
+ "#result\n",
+ "print'possible phases are %3.2f'%((phi*180)/float(math.pi)),'°','or %3.2f'%phi1,'°';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.12,Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance 120 kΩ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 20; #resistance in kΩ\n",
+ "R2 = 30; #resistance in kΩ\n",
+ "R3 = 80; #resistance in kΩ\n",
+ "\n",
+ "#calculations\n",
+ "Rx = (R2*R3)/float(R1); #unknown resistance in kΩ\n",
+ "\n",
+ "#result\n",
+ "print'unknown resistance %d'%Rx,'kΩ';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.13,Page no:222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance 49.977 uΩ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R3 = 100.03*10**-6; #standard resistance in uΩ\n",
+ "l = 100.31; # inner ratio arm resistance in Ω\n",
+ "m = 200; # inner ratio arm resistance in Ω\n",
+ "R1 = 100.24; #outer ratio arm resistance in Ω\n",
+ "R2 = 200; #outer ratio arm resistance in Ω\n",
+ "Ry = 680*10**-6; #unknown resistor in uΩ\n",
+ "\n",
+ "#calculation\n",
+ "x = (R1*R3)/float(R2); #resistance in Ω\n",
+ "y = (m*Ry)/float(l+m+Ry); #resistance in Ω\n",
+ "z = ((R1/float(R2))-(l/float(m))); #unknown resistanc in Ω\n",
+ "Rx = x+(y*z);\n",
+ "\n",
+ "#rresult\n",
+ "print'unknown resistance %3.3f'%(Rx*10**6),'uΩ';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.14,Page no:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance 500\n",
+ "unknowm angle -50 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Z1 = 50; #inductive resistance in Ω\n",
+ "Z2 = 125; #pure rresistance in Ω\n",
+ "Z3 = 200; #inductive resistance in Ω\n",
+ "theta1 = 80;\n",
+ "theta2 = 0;\n",
+ "theta3 = 30;\n",
+ "\n",
+ "#calculations\n",
+ "Z4 = (Z2*Z3)/float(Z1); #unknown resistance in Ω\n",
+ "theta4 = theta2+theta3-theta1; #unknowm angle in °\n",
+ " \n",
+ "#result\n",
+ "print'unknown resistance %d'%Z4;\n",
+ "print 'unknowm angle %d'%theta4,'°';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.15,Page no:28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " R4 = 133.333333\n",
+ "capacitance 1.59 uF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 225; #resistance in Ω \n",
+ "R2 = 150; #resistance in Ω \n",
+ "C2 = 0.53*10**-6; #capacitance in F\n",
+ "R3 = 100; #resistance in Ω \n",
+ "L = 7.95*10**-3; #inductance in H \n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "Z1 = R1;\n",
+ "w = 2*cmath.pi*f;\n",
+ "x = (1/float(w*C2));\n",
+ "Z2 = complex(R2,-x);\n",
+ "y = w*L;\n",
+ "Z3 = complex(R3,y);\n",
+ "Z4 = (Z2*Z3)/float(Z1); #unknown arm \n",
+ "Z41 = complex(Z4)\n",
+ "C4 = (1/float(2*cmath.pi*f*100)); #imaginary value is 100 from Z4\n",
+ "c = (Z4);\n",
+ "\n",
+ "#result\n",
+ "print' R4 = %05f'%(Z4.real);\n",
+ "print'capacitance %3.2f'%(C4*10**6),'uF'\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.16,Page no:226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "shuntless resistance 140 Ω\n",
+ "capacitor of imperfect condenser 0.0115 uF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "w = 7500; #frequency in radians/sec \n",
+ "R2 = 140; #resistance in Ω\n",
+ "R3 = 1000; #non-reactive resistance of Ω\n",
+ "R4 = 1000; #non-reactive resistance of Ω\n",
+ "C2 = 0.0115; #capacitance in uF\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "R1 = (R2*R3)/float(R4); #shuntless resistance in Ω\n",
+ "C1 = (C2*R4)/float(R3); #capacitor of imperfect condenser in F \n",
+ "\n",
+ "#result\n",
+ "print'shuntless resistance %d'%R1,'Ω';\n",
+ "print'capacitor of imperfect condenser %3.4f'%C1,'uF';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.17,Page no:228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance 0.53 kΩ\n",
+ "unknown inductance 1.5 H\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 235; #resistance in kΩ\n",
+ "R2 = 2.5; #resistance in kΩ\n",
+ "R3 = 50; #resistance in kΩ\n",
+ "C1 = 0.012; #capacitance in uF\n",
+ "\n",
+ "#calculations\n",
+ "Rx = (R2*R3)/float(R1); #unknown resistance in Ω\n",
+ "Lx = C1*R2*R3; #unknown inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'unknown resistance %3.2f'%Rx,'kΩ';\n",
+ "print'unknown inductance %3.1f'%Lx,'H';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.18,Page no:230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 61,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "equivalent resistance 4.32 KΩ\n",
+ "equivalent inductance 0.296 H\n",
+ "Note:calculation mistake in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "w = 3000; #frequency in radians/sec \n",
+ "R2 = 9000; #resistance in Ω\n",
+ "R1 = 1800; # resistance of Ω\n",
+ "R3 = 900; # resistance of Ω\n",
+ "C1 = 0.9*10**-6; #capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "a = ((w**2)*(R1**2)*(C1**2));\n",
+ "Rx = ((w**2)*(C1**2)*R1*R2*R3)/float(1+a); #equivalent resistance in KΩ\n",
+ "Lx = (R2*R3*C1)/float(1+((w**2)*(R1**2)*(C1**2))); #equivalent inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'equivalent resistance %3.2f'%(Rx*10**-3),'KΩ';\n",
+ "print'equivalent inductance %3.3f'%Lx,'H';\n",
+ "print'Note:calculation mistake in textbook';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.19,Page no:232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 62,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 3000 kΩ\n",
+ "capacitance 0.20 uF\n",
+ "dissipation factor 3.77\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 1.5*10**3; #resistance in Ω\n",
+ "R2 = 3000; #resistance in Ω\n",
+ "C1 = 0.4*10**-6; #capacitance in F\n",
+ "C3 = 0.4*10**-6; #capacitance in F\n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "w = 2*math.pi*f;\n",
+ "Rx = (R2*C1)/float(C3); #resistance in kΩ\n",
+ "Cx = (R1*C3)/float(R2); #capacitance in F\n",
+ "D = w*Cx*Rx; #dissipation factor\n",
+ "\n",
+ "#result\n",
+ "print'resistance %d'%Rx,'kΩ';\n",
+ "print'capacitance %3.2f'%(Cx*10**6),'uF';\n",
+ "print'dissipation factor %3.2f'%D;\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.20,Page no:234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 63,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 500 Ω\n",
+ "inductance 0.3 H\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Q = 1000; #resistance in Ω\n",
+ "S = 1000; #resistance in Ω\n",
+ "P = 500; #resistance in Ω\n",
+ "C = 0.5*10**-6; #capacitance in uF\n",
+ "r = 100; #resistance in Ω\n",
+ "\n",
+ "#calculations\n",
+ "R = (P*Q)/float(S); #resistance in Ω\n",
+ "L = ((C*P)*((r*(Q+S))+(Q*S)))/float(S); #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'resistance %d'%R,'Ω';\n",
+ "print'inductance %3.1f'%L,'H';\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.21,Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 500 Ω\n",
+ "inductance 1.95 H\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R2 = 1000; #resistance in Ω\n",
+ "R4 = 1000; #resistance in Ω\n",
+ "R3 = 500; #resistance in Ω\n",
+ "C = 3*10**-6; #capacitance in uF\n",
+ "r = 100; #resistance in Ω\n",
+ "\n",
+ "#calculations\n",
+ "R = (R2*R3)/float(R4); #resistance in Ω\n",
+ "L = ((C*R2)*((r*(R3+R4))+(R3*R4)))/float(R4); #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'resistance %d'%R,'Ω';\n",
+ "print'inductance %3.2f'%L,'H';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.22,Page no:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 65,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance of specimen 8.34 Ω\n",
+ "resistance of specimen 80.65 Ω\n",
+ "impedance of specimen 132.240 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R2 = 100; #resistance in Ω\n",
+ "R3 = 834; #resistance in Ω\n",
+ "C4 = 0.1*10**-6; #capacitance in F\n",
+ "C3 = 0.124*10**-6; #capacitance in F\n",
+ "f = 1000;\n",
+ "\n",
+ "#calculations\n",
+ "L1 = R2*R3*C4; #inductance in H\n",
+ "R1 = (R2*C4)/float(C3); #resistance in Ω\n",
+ "X1 = 2*math.pi*2*f*L1; #reactance of specimen in Ω\n",
+ "Z1 = math.sqrt((R1**2)+(X1**2)); #impedance of specimen in Ω\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'inductance of specimen %3.2f'%(L1*10**3),'Ω';\n",
+ "print'resistance of specimen %3.2f'%R1,'Ω';\n",
+ "print'impedance of specimen %3.3f'%Z1,'Ω';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.23,Page no:243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 66,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance 0.9175 uF\n",
+ "series resistance of capacitor 1.75 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "M = 18.35*10**-3; #mutual inductance in H\n",
+ "R1 = 200; #non-reactive resistance in Ω\n",
+ "L1 = 40.6*10**-3; #inductance in mH\n",
+ "R2 = 119.5; #non-reactive resistance in Ω\n",
+ "R4 = 100; # resistance in Ω\n",
+ "\n",
+ "#calculations\n",
+ "C2 = M/float(R1*R4); #capacitance in F \n",
+ "R3 = (R4*(L1-M))/float(M); #resistance in Ω\n",
+ "R = R3-R2; #series resistance of capacitor in Ω \n",
+ "\n",
+ "#result\n",
+ "print'capacitance %3.4f'%(C2*10**6),'uF';\n",
+ "print'series resistance of capacitor %3.2f'%R,'Ω';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.24,Page no:245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 67,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "equivalent resistance 11.20 KΩ\n",
+ "equivalent capacitance 42.04 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 2.8*10**3; #resistance in Ω\n",
+ "C1 = 4.8*10**-6; #capacitance in uF\n",
+ "R2 = 20*10**3; #resistance in Ω\n",
+ "R4 = 80*10**3; #resistance in Ω\n",
+ "f = 2000; #frequency in Hz\n",
+ "w = 12.57*10**3;\n",
+ "R3 = 11.2*10**3;\n",
+ "\n",
+ "#calculations\n",
+ "x = 1/float((w**2)*(C1**2)*(R1));\n",
+ "y = R1+x;\n",
+ "z = R4/float(R2);\n",
+ "R3 = z*(x+y); #equivalent resistance in KΩ\n",
+ "a = (w**2)*C1*R1*R3;\n",
+ "C3 = 1/float(a); #equivalent capacitance in F\n",
+ "\n",
+ "#result\n",
+ "print'equivalent resistance %3.2f'%(R3*10**-3),'KΩ';\n",
+ "print'equivalent capacitance %3.2f'%(C3*10**12),'pF';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.25,Page no:246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 68,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 26.82\n",
+ "inductance 52.60 mH\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "L1 = 52.6; #inductance in mH\n",
+ "R2 = 1.68; #resistance in MHz\n",
+ "r1 = 28.5; #resistance in MHz\n",
+ "\n",
+ "#calculations\n",
+ "#at balance of bridge (r1+jwL1)=((R2+r2)+jwL2)\n",
+ "#comparing both real and imaginary terms we get \n",
+ "\n",
+ "r2 = r1-R2; #resistance in Ω\n",
+ "L2 = L1; #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'resistance %3.2f'%r2;\n",
+ "print'inductance %3.2f'%L1,'mH';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.26,Page no:246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 69,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R4 = 34.311470 Ω\n",
+ "inductance 29 mH\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "\n",
+ "#variable declaration\n",
+ "R3 = 300; #resistance in Ω \n",
+ "R2 = 500; #resistance in Ω \n",
+ "C1 = 0.2*10**-6; #capacitance in F\n",
+ "C3 = 0.1*10**-6; #capacitance in F\n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "w = 2*(cmath.pi)*f; #angular frequency \n",
+ "z = (1/float(w*C1));\n",
+ "Z1 = complex(0,-z);\n",
+ "Z2 = R2;\n",
+ "x = 1/float(R3);\n",
+ "y = w*C3;\n",
+ "Y3 = complex(x,y);\n",
+ "Z4 = (Z2)/complex(Z1*Y3);\n",
+ "L = ((182.19)/float(2*cmath.pi*f)); #imaginary value is 182.12 from Z4\n",
+ "\n",
+ "#result\n",
+ "print'R4 = %03f'%(Z4.real),'Ω';\n",
+ "print'inductance %3.0f'%(L*10**3),'mH';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.27,Page no:247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 70,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R4 = 373.348520 Ω\n",
+ "capacitance 0.18 uF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 200; #resistance in Ω \n",
+ "R2 = 200; #resistance in Ω \n",
+ "C2 = 5*10**-6; #capacitance in F\n",
+ "C3 = 0.2*10**-6; #capacitance in F\n",
+ "R3 = 500; #resistance in Ω \n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "Z1 = R1;\n",
+ "w = 2*cmath.pi*f; #angular frequency\n",
+ "x = (1/float(w*C2));\n",
+ "Z2 = complex(R2,-x);\n",
+ "y = 1/float(w*C3);\n",
+ "Z3 = complex(R3,-y);\n",
+ "Z4 = (Z2*Z3)/float(Z1); #unknown arm \n",
+ "C4 = (1/float(2*cmath.pi*f*875.3)); #imaginary value is 100 from Z4\n",
+ "\n",
+ "#result\n",
+ "print'R4 = %05f'%(Z4.real),'Ω';\n",
+ "print'capacitance %3.2f'%(C4*10**6),'uF';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.28,Page no:248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 71,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R4 = 166.666667 Ω\n",
+ "inductance 0.10 H\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 600; #resistance in Ω \n",
+ "R2 = 100; #resistance in Ω \n",
+ "C1 = 1*10**-6; #capacitance in F\n",
+ "R3 = 1000; #resistance in Ω \n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "w = 2*cmath.pi*f; #angular frequency \n",
+ "x = 1/float(R1);\n",
+ "y = w*C1;\n",
+ "Y1 = complex(x,y);\n",
+ "Z2 = R2;\n",
+ "Z3 = R3;\n",
+ "Z4 = Z2*Z3*Y1; #unknown arm\n",
+ "L = (628.3/float(2*cmath.pi*f)); #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'R4 = %05f'%(Z4.real),'Ω';\n",
+ "print'inductance %3.2f'%L,'H';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.29,Page no:249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 72,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance = 124.97 pF\n",
+ "power factor = 0.055\n",
+ "relative permittivity = 6.24\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C2 = 106*10**-12; #capacitance in F\n",
+ "R4 = 1000/float(math.pi); #resistance in\n",
+ "C4 = 0.55*10**-6; #capacitance in F\n",
+ "R3 = 270; #resistance in\n",
+ "e0 = 8.854*10**-12; #absolute permittivity \n",
+ "t = 0.005; #thickness of bakelite in m\n",
+ "d = 12*10**-2; #diameter in m\n",
+ "f = 50; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "R4 = 1000/float(math.pi); #resistance in\n",
+ "A = (math.pi/float(4))*((d)**2); #area of electrodes in m**2\n",
+ "w = 2*math.pi*f; #angular frequency\n",
+ "R1 = (R3*C4)/float(C2); #resistance in \n",
+ "C1 = (R4*C2)/float(R3); #apacitance in pF\n",
+ "P = w*R1*C1; #power factor \n",
+ "er = (C1*t)/float(e0*A); #relative permittivity\n",
+ "\n",
+ "#result\n",
+ "print'capacitance = %3.2f'%(C1*10**12),'pF';\n",
+ "print'power factor = %3.3f'%P;\n",
+ "print'relative permittivity = %3.2f'%er;\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.30,Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 73,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "distributed capacitance 20 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f1 = 2*10**6; #frequency in Hz\n",
+ "C1 = 420*10**-12; #capacitance in F\n",
+ "C2 = 90*10**-12; #capacitance in F\n",
+ "f2 = 4*10**6; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "Cd = (C1-(4*C2))/float(3); #distributed capacitance in pF\n",
+ "\n",
+ "#result\n",
+ "print'distributed capacitance %d'%(Cd*10**12),'pF';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.31,Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 74,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "distributed capacitance 18.571 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f1 = 2*10**6; #frequencyin Hz\n",
+ "f2 = 5*10**6; #frequencyin Hz \n",
+ "C1 = 410*10**-12; #capacitance in F\n",
+ "C2 = 50*10**-12; #capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "x = f2/float(f1);\n",
+ "Cd = (C1-((x**2)*(C2)))/float((x**2)-1); #distributed capacitance\n",
+ "\n",
+ "#result\n",
+ "print'distributed capacitance %3.3f'%(Cd*10**12),'pF';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.32,Page no:261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 75,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistive 48.18 Ω\n",
+ "reactive components 492.74 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C1 = 190*10**-12; #capacitance in F\n",
+ "Q1 = 75; #quality factor \n",
+ "C2 = 170*10**-12; #capacitance in F\n",
+ "Q2 = 45; #quality factor \n",
+ "f = 200*10**3; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "Rx = ((C1*Q1)-(C2*Q2))/float(2*math.pi*f*C1*C2*Q1*Q2); #resistive in Ω\n",
+ "Xx = (C1-C2)/float(2*math.pi*f*C1*C2); #reactive components in Ω\n",
+ "\n",
+ "#result\n",
+ "print'resistive %3.2f'%Rx,'Ω';\n",
+ "print'reactive components %3.2f'%Xx,'Ω';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.33,Page no:261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 76,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error 0.5 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R = 4; #resistance in Ω\n",
+ "f = 500*10**3; #frequency in Hz\n",
+ "C = 110*10**-12; #capacitance in F\n",
+ "x = 0.02; #resistance across oscillatory circuit in Ω\n",
+ "\n",
+ "#calculations\n",
+ "Qtrue = 1/float(2*math.pi*f*C*R);\n",
+ "Qindicated = 1/float(2*math.pi*f*C*(R+x));\n",
+ "e = ((Qtrue-Qindicated)/float(Qtrue))*100; #percentage error in %\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'percentage error %3.1f'%e,'%';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.34,Page no:262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 77,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "self-capacitance 9.89 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f1 = 600*10**3; #frequency in Hz\n",
+ "f2 = 2*10**6; #frequency in Hz\n",
+ "C1 = 100*10**-12; #capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "Cd = ((f1**2)*C1)/float((f2**2)-(f1**2)); #self-capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "print'self-capacitance %3.2f'%(Cd*10**12),'pF';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.35,Page no:263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 78,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance 719.61 uH\n",
+ "resistance 15.641626 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f = 400*10**3; #frequency in kHz\n",
+ "C = 220*10**-12; #capacitance in F\n",
+ "Rsh = 0.8; #resistance in Ω\n",
+ "Q = 110; #quality factor\n",
+ "\n",
+ "#calculations\n",
+ "Lcoil = 1/float(((2*math.pi*f)**2)*C); #inductance in H\n",
+ "x = (2*math.pi*f*Lcoil)/float(Q);\n",
+ "Rcoil = x-Rsh; #resistance in Ω\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "print'inductance %3.2f'%(Lcoil*10**6),'uH';\n",
+ "print'resistance %f'%Rcoil,'Ω';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.36,Page no:271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 79,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance L = 7.33 uH\n",
+ "capacitance C = 858.000 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Cs = 210*10**-12; #capacitance in F\n",
+ "Cv = 6*10**-12; #capacitance in F\n",
+ "f1 = 2*10**6; #frequency in Hz\n",
+ "f2 = 4*10**6; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "#we have Cs+Cv = 1/(4*(math.pi**2)*(f2**2)*L\n",
+ "#we have C+Cv = 1/(4*(math.pi**2)*(f2**2)*L \n",
+ "L = 1/float(4*(math.pi**2)*(f2**2)*(Cs+Cv)); #inductance in uH\n",
+ "C = (1/float((4*(math.pi**2)*(f1**2)*L)))-Cv; #capacitance in pF\n",
+ " \n",
+ "#result\n",
+ "print'inductance L = %3.2f'%(L*10**6),'uH';\n",
+ "print'capacitance C = %3.3f'%(C*10**12),'pF';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.37,Page no:271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 80,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance L = 3.598e-05 uH\n",
+ "resistance R = 17.3 Ω\n",
+ "ccalculation mistake in textbook assuming approximate values\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C1 = 40*10**-12; #capacitance in pF\n",
+ "C2 = 48*10**-12; #capacitance in pF\n",
+ "f = 4*10**6; #frequency in Hz\n",
+ "R1 = 60; #resistance in Ω\n",
+ "\n",
+ "#calculations\n",
+ "Co = (C1+C2)/float(2);\n",
+ "L = 1/float(4*(math.pi**2)*(f**2)*Co); #inductance in H\n",
+ "#we have I = E/math.sqrt((R**2)+((w*l)-((1/w*C1))**2))\n",
+ "#we also have I = E/(R+R1)\n",
+ "#comparing we get and solving we get R**2 + 2*R1*R +R1**2 = R**2 + ((w*l)-((1/w*C1))**2)\n",
+ "w = 2*math.pi*f; #angular frequency \n",
+ "x = w*L;\n",
+ "y = 1/float(w*C2);\n",
+ "Y = ((x-y)**2);\n",
+ "R = (Y-(R1**2))/float(2*R1); #resistance in Ω\n",
+ "\n",
+ "#result\n",
+ "print'inductance L = %3.3e'%(L),'uH';\n",
+ "print'resistance R = %3.1f'%(R),'Ω';\n",
+ "print'calculation mistake in textbook assuming approximate values'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.38,Page no:272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 83,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Q factor 100\n",
+ "effective resistance 8.29 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C = 160*10**-12; #capacitancein pF\n",
+ "f0 = 1.2*10**6; #frequency in Hz\n",
+ "f01 = 6*10**3; #frequency in Hz\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "f1 = f0+f01; #frequency in Hz\n",
+ "f2 = f0-f01; #frequency in Hz\n",
+ "f = f1-f2; #frequency in Hz\n",
+ "Q = f0/float(f); #Q factor\n",
+ "R = f/float(2*math.pi*f0*f0*C); #effective resistance in Ω\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'Q factor %d'%Q;\n",
+ "print'effective resistance %3.2f'%R,'Ω';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 2.39,Page no:274"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 82,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "self-capacitance of the coil = 13.33 pF\n",
+ "inductance = 292.97 uH\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C1 = 200*10**-12; #capacitance in F\n",
+ "C2 = 40*10**-12; #capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "f1 = (2/float(math.pi))*10**6; #frequency in Hz\n",
+ "f2 = 2*f1; #frequency in Hz\n",
+ "x1 = 4*(math.pi**2)*(f1**2);\n",
+ "x2 = 4*(math.pi**2)*(f2**2);\n",
+ "#L = 1/(x1*(C+Cd));\n",
+ "# L = 1/(x2*(C+Cd));\n",
+ "#comparing we get following equation for Cd\n",
+ "Cd = ((x1*C1)-(x2*C2))/float(x2-x1); #capacitance in pF\n",
+ "c = C1+Cd;\n",
+ "L = 1/float(x1*(c)); #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'self-capacitance of the coil = %3.2f'%(Cd*10**12),'pF';\n",
+ "print'inductance = %3.2f'%(L*10**6),'uH';\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}