diff options
Diffstat (limited to 'Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter3.ipynb')
-rwxr-xr-x | Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter3.ipynb | 3283 |
1 files changed, 3283 insertions, 0 deletions
diff --git a/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter3.ipynb b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter3.ipynb new file mode 100755 index 00000000..b28ca570 --- /dev/null +++ b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter3.ipynb @@ -0,0 +1,3283 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3 - Measurement of parameters"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a). True value of unknown resistance Xt(ohm) = 8.13\n",
+ "(b). % error (%) = -1.6\n",
+ " i.e. 1.6 10w\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 194\n",
+ "#Example 3.1: Resistance and percentage error\n",
+ "#calculate the Resistance and percentage error\n",
+ "#given data :\n",
+ "V=3.2;# in V\n",
+ "I=0.4;# in A\n",
+ "Rv=500.;# in ohm\n",
+ "#calculations\n",
+ "Xt=V/(I*(1-(V/(I*Rv))));\n",
+ "Xm=V/I;\n",
+ "Pe=((Xm-Xt)/Xt)*100;\n",
+ "#results\n",
+ "print \"(a). True value of unknown resistance Xt(ohm) = \",round(Xt,2)\n",
+ "print \"(b). % error (%) =\",Pe\n",
+ "print \" i.e.\",-Pe,\"10w\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Measured value of resistance (ohm) = 0.833\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 195\n",
+ "#Example 3.2: Measured value of resistance\n",
+ "#calculate the Measured value of resistance\n",
+ "#given data :\n",
+ "a=1.;# in ohm\n",
+ "b=5.;# in ohm\n",
+ "I=0.1;# in A\n",
+ "#calculations\n",
+ "A=(1/a)+(1/b);\n",
+ "r=1/A;\n",
+ "V=r*I;\n",
+ "Mr=V/I;\n",
+ "#results\n",
+ "print \"Measured value of resistance (ohm) = \",round(Mr,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistance of resistor under test X(ohm) = 0.015\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 195\n",
+ "#Example 3.3: Resistor\n",
+ "#calculate the Resistor\n",
+ "#given data :\n",
+ "S=0.02;# in ohm\n",
+ "Vs=0.98;# in V\n",
+ "Vx=0.735;# in V\n",
+ "#calculate\n",
+ "X=(S*Vx)/Vs;\n",
+ "#results\n",
+ "print \"Resistance of resistor under test X(ohm) = \",X\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistance of unknown resistor R(ohm) = 0.0411\n",
+ "Current through the resistor I(A) = 10.235\n",
+ "Power loss in the unknown resistance P(W) = 4.31\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 196\n",
+ "#Example 3.4: Resistor,current and power loss\n",
+ "#calculate the Resistor,current and power loss\n",
+ "#given data :\n",
+ "S=0.1;# in ohm\n",
+ "Vs=1.0235;# in V\n",
+ "Vr=0.4211;# in V\n",
+ "#calculations\n",
+ "R=(Vr/Vs)*S;\n",
+ "I=Vs/S;\n",
+ "P=I**2 *R;\n",
+ "#results\n",
+ "print \"Resistance of unknown resistor R(ohm) = \",round(R,4)\n",
+ "print \"Current through the resistor I(A) = \",I\n",
+ "print \"Power loss in the unknown resistance P(W) = \",round(P,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Magnitude of error (micro-ohm) = 0.028129\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 196\n",
+ "#Example 3.5: Magnitude of error\n",
+ "#calculate the Magnitude of error\n",
+ "#given data :\n",
+ "p=100.31;# in ohm\n",
+ "q=200.;# in ohm\n",
+ "P=100.24;# in ohm\n",
+ "Q=200.;# in ohm\n",
+ "S=100.03*10**-6;# in ohm\n",
+ "r=700.*10**-6;# in ohm\n",
+ "Y=50.;# in micro-ohm\n",
+ "#calculations\n",
+ "X=(((P/Q)*S)+(((q*r)/(p+q))*((P/Q)-(p/q))))*10**6;\n",
+ "Error=Y-X;\n",
+ "#results\n",
+ "print \"Magnitude of error (micro-ohm) = \",round(Error,6)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Unknown resistance X(m-ohm) = 1.503\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 196\n",
+ "#Example 3.6: Unknown resistance\n",
+ "#calculate the Unknown resistance\n",
+ "#given data :\n",
+ "p=100.6;# in ohm\n",
+ "q=300.25;# in ohm\n",
+ "P=100.5;# in ohm\n",
+ "Q=300.;# in ohm\n",
+ "S=0.0045;# in ohm\n",
+ "r=0.1;# in ohm\n",
+ "#calculations\n",
+ "X=(((P/Q)*S)+(((q*r)/(p+q+r))*((P/Q)-(p/q))))*10**3;\n",
+ "#results\n",
+ "print \"Unknown resistance X(m-ohm) = \",round(X,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance is (Mega-ohm)= 0.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 197\n",
+ "#Example 3.7: Unknown resistance\n",
+ "#calculate the Unknown resistance\n",
+ "#given data :\n",
+ "s=0.5;#Mega ohms\n",
+ "g=10.;#killo ohms\n",
+ "d1=41.;#divisions\n",
+ "d2=51.;#divisions\n",
+ "#calculations\n",
+ "r=(((s*10**6)+(g*10**3))*(d1/d2))-(g*10**3);#ohms\n",
+ "#results\n",
+ "print \"unknown resistance is (Mega-ohm)=\",r*10**-6\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Unknown resistance R(ohm) = 460.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 197\n",
+ "#Example 3.8: Unknown resistance\n",
+ "#calculate the Unknown resistance\n",
+ "#given data :\n",
+ "P=100.;# in ohm\n",
+ "Q=10.;# in ohm\n",
+ "S=46.;# in ohm\n",
+ "#calculations\n",
+ "R=((P/Q)*S);\n",
+ "#results\n",
+ "print \" Unknown resistance R(ohm) = \",R\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 - pg 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limiting value of resistance is 3154.0 + 0.2 % to 3217.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 197\n",
+ "#Example 3.9: limiting value of unknown resistance\n",
+ "#calculate the limiting value of unknown resistance\n",
+ "#given data :\n",
+ "P=1000.;# in ohm\n",
+ "Q=1000.;# in ohm\n",
+ "S=3154.;# in ohm\n",
+ "dp=0.05;#percentage error\n",
+ "dq=0.05;#percentage error\n",
+ "ds=0.1;#percentage error\n",
+ "#calculations\n",
+ "R=((P/Q)*S);\n",
+ "dr=dp+dq+ds;#percentage error\n",
+ "x=R+((dr*10)*R)/100;#\n",
+ "#results\n",
+ "print \"limiting value of resistance is \",R,\"+\",dr,\"% to \",round(x),\" ohm\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance is (Ohm)= 0.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 197\n",
+ "#Example 3.10: value of unknown resistance\n",
+ "#calculate the value of unknown resistance\n",
+ "#given data\n",
+ "ra=1200.;#ohms\n",
+ "#calculations\n",
+ "rb=ra/1600;#ohms\n",
+ "r1=800*rb;#ohms\n",
+ "r2=r1/1.25;#ohms\n",
+ "r3=0.5*rb;#ohms\n",
+ "rx=((r2/r1)*r3);#ohms\n",
+ "#results\n",
+ "print \"unknown resistance is (Ohm)=\",rx\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Unknown resistance R(ohm) = 2.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 198\n",
+ "#Example 3.11: Unknown resistance\n",
+ "#calculate the Unknown resistance\n",
+ "#given data :\n",
+ "AB=25.;# in ohm\n",
+ "BC=75.;# in ohm\n",
+ "S=6.;# in ohm\n",
+ "#calculations\n",
+ "R=((AB/BC)*S);\n",
+ "#results\n",
+ "print \"Unknown resistance R(ohm) = \",R\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 - pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "In case 1 balance is obtained at 25.0 and 75.0 scale divisions\n",
+ "In case 2 balance is obtained at 5.0 and 95.0 cm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 199\n",
+ "#Example 3.12: length\n",
+ "#calculate the balance length\n",
+ "#given data\n",
+ "r=0.0250;#ohms\n",
+ "l=100.;#cm\n",
+ "d=100;#divisions\n",
+ "p=10.;#ohms\n",
+ "q=10.;#ohms\n",
+ "r2=1.0125;#ohms\n",
+ "r3=1;#ohms\n",
+ "p1=9.95;#ohms\n",
+ "q1=10.05;#ohms\n",
+ "#calculations\n",
+ "r1=r/l;#ohm/cm\n",
+ "x=p/q;#\n",
+ "l1=((r3+r)-r2)/(2*r1);#cm\n",
+ "l2=100-l1;#cm\n",
+ "x1=p1/q1;#\n",
+ "l11=((p1*(r3+r))-(q1*r2))/((p1*r1)+(q1*r1));#cm\n",
+ "l21=100-round(l11);#cm\n",
+ "#results\n",
+ "print \"In case 1 balance is obtained at \",l1,\" and \",l2,\" scale divisions\"\n",
+ "print \"In case 2 balance is obtained at \",round(l11),\" and \",l21,\" cm\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 - pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Insolution resistance R(M-ohm) = 186726.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 199\n",
+ "#Example 3.13: Insolution resistance\n",
+ "#calculate the Insolution resistance\n",
+ "#given data :\n",
+ "import math\n",
+ "V1=125.;# in V\n",
+ "V2=100.;# in V\n",
+ "t=25.;# in sec\n",
+ "C=600*10**-12;# in F\n",
+ "#calculations\n",
+ "R=t*10**-6/(C*math.log(V1/V2));\n",
+ "#results\n",
+ "print \"Insolution resistance R(M-ohm) = \",round(R)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 - pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Insolution resistance R(M-ohm) = 5.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 199\n",
+ "#Example 3.14: Insolution resistance of the cable\n",
+ "#calculate the Insolution resistance of the cable\n",
+ "import math\n",
+ "from math import log10\n",
+ "y=10.;#Mega ohms\n",
+ "d=200.;#divisioms\n",
+ "d1=126.;#divisions\n",
+ "d2=100.;#divisions\n",
+ "c=1;#assume\n",
+ "t=30.;#seconds\n",
+ "x=0.4343\n",
+ "#calculations\n",
+ "r=((x*t)/(c*log10(d/d1)));#\n",
+ "rd=((x*t)/(c*log10(d/d2)));#\n",
+ "x=rd/r;#\n",
+ "ro=((y-(10*x))/x);#Mega ohms\n",
+ "#results\n",
+ "print \"Insolution resistance R(M-ohm) = \",round(ro)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 - pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Unknown resistance,R(M-ohm) = 46.98\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 200\n",
+ "#Example 3.15:\n",
+ "#calculate the High resistance\n",
+ "#given data :\n",
+ "import math\n",
+ "V1=500.;# in V\n",
+ "V2=300.;# in V\n",
+ "t=60.;# in sec\n",
+ "C=2.5*10**-6;# in F\n",
+ "#calculations\n",
+ "R=t*10**-6/(C*math.log(V1/V2));\n",
+ "#results\n",
+ "print \"Unknown resistance R(M-ohm) = \",round(R,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 16 - pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Insolution resistance R(M-ohm) = 560.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 200\n",
+ "#Example 3.16: Insolution resistance of the cable\n",
+ "#calculate the Insolution resistance of the cable\n",
+ "US=2.5;#SHUNT\n",
+ "SD=250;#DIVISIONS\n",
+ "sr=350;#scale readomh\n",
+ "sd1=1000;#shunt\n",
+ "r=1;#Mega ohms\n",
+ "#calculations\n",
+ "x=US*SD;#\n",
+ "y=sr*sd1;#\n",
+ "ro=(y/x)*r;#mega ohms\n",
+ "#results\n",
+ "print \"Insolution resistance R(M-ohm) = \",round(ro)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 17 - pg 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "As 160000.0 = 160000.0 (Z1*Z4=Z2*Z3) firts condition is satisfied\n",
+ "As 70.0 is not equal to -10.0 (Sum of angles) second condition is not staisfied (so bridge is not balanced) \n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 201\n",
+ "#Example 3.17: Bridhe Balanced\n",
+ "#calculate the Bridhe Balanced condition\n",
+ "z1m=400.;#ohms\n",
+ "z1a=50.;#degree\n",
+ "z2m=200.;#ohms\n",
+ "z2a=40.;#degree\n",
+ "z3m=800.;#ohms\n",
+ "z3a=-50.;#degree\n",
+ "z4m=400.;#ohms\t\n",
+ "z4a=20.;#degree\n",
+ "#calculations\n",
+ "x=z1m*z4m;#ohms\n",
+ "y=z2m*z3m;#ohms\n",
+ "a=z1a+z4a;#degree\n",
+ "b=z2a+z3a;#degree\n",
+ "#results\n",
+ "print \"As \",x,\"=\",y,\" (Z1*Z4=Z2*Z3) firts condition is satisfied\"\n",
+ "print \"As \",a,\"is not equal to\",b,\"(Sum of angles) second condition is not staisfied (so bridge is not balanced) \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18 - pg 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistance R1(ohm) = 31.34\n",
+ "inductance L1(mH) = 47.8\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 201\n",
+ "#Example 3.18:Resistance \n",
+ "#calculate the Resistance and inductance\n",
+ "#given data :\n",
+ "R2=100.;# in ohm\n",
+ "R3=32.7;# in ohm\n",
+ "R4=100.;# in ohm\n",
+ "R=1.36;# in ohm\n",
+ "L=47.8;# in mH\n",
+ "#calculations\n",
+ "R1=(R2*R3/R4)-R;\n",
+ "L1=(R2/R4)*L;\n",
+ "#results\n",
+ "print \"Resistance R1(ohm) = \",R1\n",
+ "print \"inductance L1(mH) = \",L1\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19 - pg 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 23.0\n",
+ "inductance is (mH)= 50.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 201\n",
+ "#Example 3.19:Resistance and Inductance\n",
+ "#calculate the Resistance and Inductance\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "f=1;#assume\n",
+ "r1=25;#ohms\n",
+ "i=50.;#MH\n",
+ "x=r1+1j*(2*math.pi*f*(i*10**-3));#\n",
+ "r2=2;#ohms\n",
+ "r=x.real-r2;#ohms\n",
+ "l=x.imag/(2*math.pi*f);#henry\n",
+ "print \"resistance is (ohm)=\",r\n",
+ "print \"inductance is (mH)=\",l*1000.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 20 - pg 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Unknown resistance R1(ohm) = 240.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 202\n",
+ "#Example 3.20:Resistance \n",
+ "#calculate the Unknown resistance\n",
+ "#given data :\n",
+ "R2=600.;# in ohm\n",
+ "R3=400.;# in ohm\n",
+ "R4=1000.;# in ohm\n",
+ "#calculations\n",
+ "R1=(R2*R3/R4);\n",
+ "#results\n",
+ "print \"Unknown resistance R1(ohm) = \",R1"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 21 - pg 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistance rx(ohm) = 675.0\n",
+ "Inductance L(mH) = 270.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 202\n",
+ "#Example 3.21:Resistance and inductance\n",
+ "#calculate the Resistance and inductance\n",
+ "#given data :\n",
+ "S=900;# in ohm\n",
+ "P=1.5*10**3;# in ohm\n",
+ "Q=2*10**3;# in ohm\n",
+ "Cs=0.2*10**-6;# in F\n",
+ "#calculations\n",
+ "rx=S*P/Q;\n",
+ "L=P*Cs*S*10**3;\n",
+ "#results\n",
+ "print \"Resistance rx(ohm) = \",rx\n",
+ "print \"Inductance L(mH) = \",L\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 22 - pg 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistance R(ohm) = 1000.0\n",
+ "Inductance L(H) = 2.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 202\n",
+ "#Example 3.22:Resistance and inductance\n",
+ "#calculate the Resistance and inductance\n",
+ "#given data :\n",
+ "S=2000.;# in ohm\n",
+ "P=1000.;# in ohm\n",
+ "C=1*10**-6;# in F\n",
+ "r=200;# in ohm\n",
+ "#calculations\n",
+ "Q=S;# in ohm\n",
+ "R=P*Q/S;\n",
+ "L=(C*P/S)*(r*(Q+S)+(Q*S));\n",
+ "#results\n",
+ "print \"Resistance R(ohm) = \",R\n",
+ "print \"Inductance L(H) = \",L\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 23 - pg 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistance R1(ohm) = 81.9\n",
+ "inductance L1(H) = 0.0767\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 202\n",
+ "#Example 3.23:Resistance and inductance\n",
+ "#calculate the Resistance and inductance\n",
+ "#given data :\n",
+ "R2=250.;# in ohm\n",
+ "R3=100.;# in ohm\n",
+ "R4=200.;# in ohm\n",
+ "r1=43.1;# in ohm\n",
+ "r=229.7;# in ohm\n",
+ "C=1*10**-6;# in F\n",
+ "#calculations\n",
+ "R1=(R2*R3/R4)-r1;\n",
+ "L1=(C*R3/R4)*(r*(R4+R2)+(R2*R4));\n",
+ "#results\n",
+ "print \"Resistance R1(ohm) = \",R1\n",
+ "print \"inductance L1(H) = \",round(L1,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 24 - pg 203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistance R1(ohm) = 500.0\n",
+ "inductance L(H) = 1.95\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 203\n",
+ "#Example 3.24:Resistance and inductance\n",
+ "#calculate the Resistance and inductance\n",
+ "#given data :\n",
+ "R2=1000.;# in ohm\n",
+ "R3=500.;# in ohm\n",
+ "R4=1000.;# in ohm\n",
+ "r=100;# in ohm\n",
+ "C=3*10**-6;# in F\n",
+ "#calculations\n",
+ "R1=(R2*R3/R4);\n",
+ "L=(C*R2/R4)*(r*(R4+R3)+(R3*R4));\n",
+ "#results\n",
+ "print \"Resistance R1(ohm) = \",R1\n",
+ "print \"inductance L(H) = \",L\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 25 - pg 203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Inductance L1(H) = 6.321\n",
+ "Resistance R1(ohm) = 197.491\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 203\n",
+ "#Example 3.25:Resistance and inductance\n",
+ "#calculate the Resistance and inductance\n",
+ "#given data :\n",
+ "import math\n",
+ "R2=1000;# in ohm\n",
+ "R3=16800;# in ohm\n",
+ "R4=833;# in ohm\n",
+ "C4=0.38*10**-6;# in F\n",
+ "f=50;# in Hz\n",
+ "#calculations\n",
+ "w=2*math.pi*f;\n",
+ "L1=(R2*R3*C4)/(1+w**2*C4**2*R4**2);\n",
+ "R1=(R2*R3*R4*w**2*C4**2)/(1+w**2*C4**2*R4**2);\n",
+ "#results\n",
+ "print \"Inductance L1(H) = \",round(L1,3)\n",
+ "print \"Resistance R1(ohm) = \",round(R1,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 26 - pg 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Inductance L1(H) = 0.63\n",
+ "Resistance R1(ohm) = 141.1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 204\n",
+ "#Example 3.26:Resistance and inductance\n",
+ "#calculate the Resistance and inductance\n",
+ "#given data :\n",
+ "import math\n",
+ "R2=2410.;# in ohm\n",
+ "R3=750.;# in ohm\n",
+ "R4=64.9;# in ohm\n",
+ "C4=0.35*10**-6;# in F\n",
+ "f=500.;# in Hz\n",
+ "#calculations\n",
+ "w=2*math.pi*f;\n",
+ "L1=(R2*R3*C4)/(1+w**2*C4**2*R4**2);\n",
+ "R1=(R2*R3*R4*w**2*C4**2)/(1+w**2*C4**2*R4**2);\n",
+ "#results\n",
+ "print \"Inductance L1(H) = \",round(L1,2)\n",
+ "print \"Resistance R1(ohm) = \",round(R1,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 27 - pg 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Inductance,L1(H) = 6.32\n",
+ "Resistance,R1(ohm) = 197.0\n",
+ "resistance is calculated wrong in the textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 204\n",
+ "#Example 3.27:Resistance and inductance\n",
+ "#calculate the Resistance and inductance\n",
+ "#given data :\n",
+ "import math\n",
+ "R3=16800.;# in ohm\n",
+ "R2=1000.;# in ohm\n",
+ "R4=833.;# in ohm\n",
+ "C4=0.38*10**-6;# in F\n",
+ "f=50;# in Hz\n",
+ "#calculations\n",
+ "w=2*math.pi*f;\n",
+ "L1=(R2*R3*C4)/(1+w**2*C4**2*R4**2);\n",
+ "R1=(R2*R3*R4*w**2*C4**2)/(1+(w**2*C4**2*R4**2));\n",
+ "#results\n",
+ "print \"Inductance,L1(H) = \",round(L1,2)\n",
+ "print \"Resistance,R1(ohm) = \",round(R1,0)\n",
+ "print 'resistance is calculated wrong in the textbook'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 28 - pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance is (mH)= 8.34\n",
+ "resistance is (ohm)= 80.65\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 205\n",
+ "#Example 3.28:Resistance and Inductance\n",
+ "#calculate the Resistance and Inductance\n",
+ "r3=100;#ohms\n",
+ "c4=0.1;#micro-farads\n",
+ "r2=834;#ohms\n",
+ "c2=0.124;#micro farads\n",
+ "#calculations\n",
+ "la=r2*r3*c4*10**-3;#mH\n",
+ "r1=(r3)*(c4/c2);#ohms\n",
+ "#results\n",
+ "print \"inductance is (mH)=\",la\n",
+ "print \"resistance is (ohm)=\",round(r1,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 29 - pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Unknown capacitance C2(micro-F) = 1.0\n",
+ "Phase angle error del1(degree) = 3.6\n",
+ "Phase angle error del2(degree) = 3.6\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 205\n",
+ "#Example 3.29: Phase angle error and Capacitance\n",
+ "#calculate the Phase angle error and Capacitance\n",
+ "#given data :\n",
+ "import math\n",
+ "C1=1*10**-6;# in F\n",
+ "R1=1000.;# in ohm\n",
+ "R2=1000.;# in ohm\n",
+ "f=1000.;# in Hz\n",
+ "r1=10.;# in ohm\n",
+ "R3=2000.;# in ohm\n",
+ "R4=2000.;#/ in ohm\n",
+ "#calculations\n",
+ "C2=C1*R1*10**6/R2;\n",
+ "w=2*math.pi*f;\n",
+ "r2=(R2*(R3+r1)-(R1*R4))/R1;\n",
+ "del1=w*r1*C1*(180/math.pi);\n",
+ "del2=r2*w*C2*10**-6*(180/math.pi);\n",
+ "#results\n",
+ "print \"Unknown capacitance C2(micro-F) = \",C2\n",
+ "print \"Phase angle error del1(degree) = \",del1\n",
+ "print \"Phase angle error del2(degree) = \",del2\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 30 - pg 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Series resistance Rs(M-ohm) = 0.5\n",
+ "capacitance is (micro-F)= 309.0\n",
+ "Loss angle del(degree) = 2.779\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 206\n",
+ "#Example 3.30: Series resistance and loss angle\n",
+ "#calculate the Series resistance and loss angle\n",
+ "#given data :\n",
+ "import math\n",
+ "R2=100.;# in ohm\n",
+ "R4=309.;# in ohm\n",
+ "C3=100.*10**-12;# in F\n",
+ "C4=0.5*10**-6;# in F\n",
+ "f=50;# in Hz\n",
+ "#calculations\n",
+ "w=2*math.pi*f;\n",
+ "Rs=C4*R2*10**-6/C3;\n",
+ "Cs=R4*C3*10**12/R2;\n",
+ "dela=math.atan(w*Cs*Rs*10**-6)*57.3;\n",
+ "#results\n",
+ "print \"Series resistance Rs(M-ohm) = \",Rs\n",
+ "print \"capacitance is (micro-F)=\",Cs\n",
+ "print \"Loss angle del(degree) = \",round(dela,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 31 - pg 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 83,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cable capacitance Cs(PF) = 199.0\n",
+ "Parallel loss resistance rs(M-ohm) = 2.43\n",
+ "loss angle is (degree)= 8.11\n",
+ "power loss is = 10000000000\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 206\n",
+ "#Example 3.31: Capacitance, power loss, loss resistance and loss angle\n",
+ "#calculate the Cable Capacitance, power loss, loss resistance and loss angle\n",
+ "#given data :\n",
+ "import math\n",
+ "r2=1500/math.pi;# in ohm\n",
+ "r3=120.;# in ohm\n",
+ "C2=0.95*10**-6;#F\n",
+ "C1=50*10**-12;# F\n",
+ "f=50;\n",
+ "#calculations\n",
+ "Cs=round(C1*r2*10**12/r3);\n",
+ "w=round(2*math.pi*f);\n",
+ "rs=(r3/(w**2*C1*10));\n",
+ "dela=math.atan(100*math.pi*C2*r2)*57.3;#\n",
+ "v=100;#kV\n",
+ "pl=(v*10**3)**2;#\n",
+ "#results\n",
+ "print \"Cable capacitance Cs(PF) = \",Cs\n",
+ "print \"Parallel loss resistance rs(M-ohm) = \",round(rs*10**-6,2)\n",
+ "print \"loss angle is (degree)=\",round(dela,2)\n",
+ "print \"power loss is =\",pl\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 32 - pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "frequency is (Hz)= 398.0\n",
+ "resistance is (ohm)= 1000.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 207\n",
+ "#Example 3.32:frequency and resistance\n",
+ "#calculate the frequency and resistance\n",
+ "#given data\n",
+ "import math\n",
+ "r1=400.;#ohms\n",
+ "c1=1.;#micro farads\n",
+ "r2=1000.;#ohms\n",
+ "r3=800.;#ohms\n",
+ "c3=0.5;#micro farads\n",
+ "#calculations\n",
+ "f=((1/((2*math.pi)*math.sqrt(r1*r3*c1*10**-6*c3*10**-6))));#Hz\n",
+ "x=((c3/c1)+(r1/r3));#\n",
+ "r4=r2*x;#ohms\n",
+ "#results\n",
+ "print \"frequency is (Hz)=\",round(f)\n",
+ "print \"resistance is (ohm)=\",r4\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 33 - pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 400.0\n",
+ "frequency is (Hz)= 398.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 207\n",
+ "#Example 3.33:frequency and resistance\n",
+ "#calculate the frequency and resistance\n",
+ "import math\n",
+ "r1=200.;#ohms\n",
+ "c1=1.;#micro farads\n",
+ "r3=400.;#ohms\n",
+ "r4=1000.;#ohms\n",
+ "c2=2.;#micro farads\n",
+ "#calculations\n",
+ "x=((r4/r3)-(c1/c2));#\n",
+ "r2=r1*x;#ohms\n",
+ "f=((1/((2*math.pi)*math.sqrt(r1*r2*c1*10**-6*c2*10**-6))));#Hz\n",
+ "#results\n",
+ "print \"resistance is (ohm)=\",r2\n",
+ "print \"frequency is (Hz)=\",round(f)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 34 - pg 208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error is (%)= -4.5\n",
+ "voltmeter reading is (V)= 188.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 208\n",
+ "#Example 3.34:percentage error and voltmeter readings\n",
+ "#calculate the percentage error and voltmeter readings\n",
+ "#given data\n",
+ "v=180.;#volts\n",
+ "i=2.;#amperes\n",
+ "rv=2000;#ohms\n",
+ "ra=0.01;#ohms\n",
+ "#calculations\n",
+ "rm2=v/i;#ohms\n",
+ "iv=v/rv;#amperes\n",
+ "ir=i-iv;#amperes\n",
+ "r=v/ir;#ohms\n",
+ "per=((rm2-r)/r)*100;#\n",
+ "vr=i*(ra+r);#volts\n",
+ "#results\n",
+ "print \"percentage error is (%)=\",per\n",
+ "print \"voltmeter reading is (V)=\",round(vr,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 35 - pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance is (micro-ohm)= 49.97\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 209\n",
+ "#Example 3.35:unknown resistance\n",
+ "#calculate the unknown resistance\n",
+ "#given data\n",
+ "P=100.24;#ohms\n",
+ "Q=200.;#ohms\n",
+ "S=100.03;#ohms\n",
+ "q=200.;#ohms\n",
+ "r=700.;#micro ohms\n",
+ "p=100.31;#ohms\n",
+ "#calculations\n",
+ "x=(P/Q)*S*10**-6;#ohms\n",
+ "y=((q*r*10**-6)/(p+q+(r*10**-6)));#ohms\n",
+ "z=((P/Q)-(p/q));#ohms\n",
+ "R=x+(y*z);#micro ohms\n",
+ "#results\n",
+ "print \"unknown resistance is (micro-ohm)=\",round(R*10**6,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 36 - pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "deflection of the galvanometer is,(mm)= 27.7\n",
+ "sensivity of bridge is (mm/ohm)= 5.53\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 209\n",
+ "#Example 3.36:\n",
+ "#calculate the deflection of galvanometer and the sensivity\n",
+ "#given\n",
+ "P=1000.;#ohms\n",
+ "Q=100.;#ohms\n",
+ "S=200.;#ohms\n",
+ "R=2005.;#ohms\n",
+ "e=5.;#volts\n",
+ "G=100.;#ohms\n",
+ "si=10.;#mm/micro-ampere\n",
+ "#calculations\n",
+ "R1=((P/Q)*S);#ohms\n",
+ "dr=R-R1;#ohms\n",
+ "eo=e*((R/(R+S))-(P/(P+Q)));#volts\n",
+ "ro=(((R*S)/(R+S))+((P*Q)/(P+Q)));#ohms\n",
+ "ig=eo/(ro+G);#amperes\n",
+ "th=si*(ig*10**6);#mm\n",
+ "sb=th/dr;#mm/ohm\n",
+ "#results\n",
+ "print \"deflection of the galvanometer is,(mm)=\",round(th,1)\n",
+ "print \"sensivity of bridge is (mm/ohm)=\",round(sb,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 37 - pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (M-ohm)= 4.75\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 209\n",
+ "#Example 3.37: Insolution resistance of the cable\n",
+ "#calculate the resistance\n",
+ "#given data\n",
+ "import math\n",
+ "from math import log\n",
+ "v1=200.;#volts\n",
+ "v2=125.;#volts\n",
+ "t=30.;#seconds\n",
+ "v21=100;#volts\n",
+ "x=10;#mega ohms\n",
+ "#calculations\n",
+ "cr=t/(log(v1/v2));#\n",
+ "cr1=t/(log(v1/v21));#\n",
+ "y=cr1/cr;#\n",
+ "R=((x/y)-x);#mega ohms\n",
+ "#results\n",
+ "print \"resistance is (M-ohm)=\",round(R,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 38 - pg 210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 41,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 400.0\n",
+ "inductance is (H)= 1.12\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 210\n",
+ "#Example 3.38:resistance and inductance\n",
+ "#calculate the resistance and inductance\n",
+ "r2=400.;#ohms\n",
+ "r3=400.;#ohms\n",
+ "r4=400.;#ohms\n",
+ "r=500.;#ohms\n",
+ "c=2;#micro farads\n",
+ "#calculations\n",
+ "rX=((r2*r3)/r4);#ohms\n",
+ "l=(((c*10**-6*r2)/r4)*((r*(r3+r4))+(r3*r4)));#H\n",
+ "#results\n",
+ "print \"resistance is (ohm)=\",rX\n",
+ "print \"inductance is (H)=\",l\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 39 - pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance is (H)= 22.45\n",
+ "resistance is (ohm)= 1761.0\n",
+ "resistance is calculated wrong in the textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 211\n",
+ "#Example 3.39:resistance and inductance\n",
+ "#calculate the resistance and inductance\n",
+ "#given data\n",
+ "import math\n",
+ "r2=1000.;#ohms\n",
+ "r3=15000.;#ohms\n",
+ "r4=500.;#ohms\n",
+ "c4=1.59;#micro farads\n",
+ "f=50;#Hz\n",
+ "#calculations\n",
+ "w=2*math.pi*f;#\n",
+ "l=((r2*r3*c4*10**-6)/((1+(w**2*(c4*10**-6)**2*r4**2))));#H\n",
+ "r=((r2*r3*r4*w**2*(c4*10**-6)**2)/((1+(w**2*(c4*10**-6)**2*r4**2))));#ohms\n",
+ "#results\n",
+ "print \"inductance is (H)=\",round(l,2)\n",
+ "print \"resistance is (ohm)=\",round(r,0)\n",
+ "print 'resistance is calculated wrong in the textbook'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 40 - pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (M-ohm)= 0.01\n",
+ "capacitance is (micro-F) 100.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 211\n",
+ "#Example 3.40:resistance and capacitance\n",
+ "#calculate the resistance and capacitance\n",
+ "#given data\n",
+ "r2=1000.;#ohms\n",
+ "r4=100.;#ohms\n",
+ "c4=0.1;#micro farads\n",
+ "c3=1000.;#pF\n",
+ "#calculations\n",
+ "rs=((c4/(c3*10**-6))*r2);#M-ohm\n",
+ "cs=((r4/r2)*(c3*10**-6));#micro farads\n",
+ "#results\n",
+ "print \"resistance is (M-ohm)=\",rs*10**-7\n",
+ "print \"capacitance is (micro-F)\",cs*10**6\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 41 - pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capaciatnce is (micro-F)= 0.0115\n",
+ "resistance is (M-ohm)= 0.96\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 211\n",
+ "#Example 3.41:resistance and capacitance\n",
+ "#calculate the resistance and capacitance\n",
+ "#given data\n",
+ "r1=140.;#ohms\n",
+ "c1=0.0115*10**-6;#F\n",
+ "r2=1000.;#ohms\n",
+ "r4=1000.;#ohms\n",
+ "w=7500.;#\n",
+ "#calculations\n",
+ "x=((1/(w**2*r1*c1)));#\n",
+ "c3=c1;#\n",
+ "r3=x/c3;#\n",
+ "#results\n",
+ "print \"capaciatnce is (micro-F)=\",c3*10**6\n",
+ "print \"resistance is (M-ohm)=\",round(r3*10**-6,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 42 - pg 212"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Upper and lower limits of X are 302.5 ohm and 197.5 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 212\n",
+ "#Example 3.42:resistance\n",
+ "#calculate the Upper and lower limits of resistance\n",
+ "dp=0.08;#% error \n",
+ "ds=0.05;#% error\n",
+ "x=250;#ohms\n",
+ "#calculations\n",
+ "dq=dp;#\n",
+ "dx=dp+ds+dq;#% percentage error\n",
+ "dx1=dx*x;#\n",
+ "#results\n",
+ "print \"Upper and lower limits of X are \",x+dx1,\" ohm and \",x-dx1,\" ohm\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 43 - pg 213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance is (milli-ohm)= 1.5034\n",
+ "The answer is a bit different from textbook due to rounding off error\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 213\n",
+ "#Example 3.43:resistance\n",
+ "#calculate the unknown resistance\n",
+ "#given data\n",
+ "Q=100.5;#ohms\n",
+ "M=300.;#ohms\n",
+ "S=0.0045;#ohms\n",
+ "r=0.1;#ohms\n",
+ "m=300.25;#micro ohms\n",
+ "q=100.6;#ohms\n",
+ "#calculations\n",
+ "x=(Q/M)*S;#ohms\n",
+ "y=((r*m)/(r+m+q));#ohms\n",
+ "z=((Q/M)-(q/m));#ohms\n",
+ "R=x+(y*z);#milli ohms\n",
+ "#results\n",
+ "print \"unknown resistance is (milli-ohm)=\",round(R*10**3,4)\n",
+ "print 'The answer is a bit different from textbook due to rounding off error'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 44 - pg 213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "balance current is (micro-A)= 6.6\n",
+ "bridge sensivity is (cm-(ohm/ohm))= 5665.0\n",
+ "sensivity is calculated wrong in the book\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 213\n",
+ "#Example 3.44:balance current and bridge sensivity\n",
+ "#calculate the balance current and bridge sensivity\n",
+ "#given data\n",
+ "P=100.;#ohms\n",
+ "Q=1000.;#ohms\n",
+ "S=857.;#ohms\n",
+ "E=1.5;#volts\n",
+ "rg=50;#ohms\n",
+ "D=100;#M-ohm\n",
+ "#calculations\n",
+ "X=((P/Q)*S);#ohms\n",
+ "dx=1/X;#\n",
+ "a1=((rg+(X*(Q+S))/(X+S)));#ohms\n",
+ "dig=((E*S*X*dx)/((X+S)**2*a1));#\n",
+ "sb=((dig*D*10**6)/dx);#\n",
+ "#results\n",
+ "print \"balance current is (micro-A)=\",round(dig*10**6,1)\n",
+ "print \"bridge sensivity is (cm-(ohm/ohm))=\",round(sb*10**-1)\n",
+ "print 'sensivity is calculated wrong in the book'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 45 - pg 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "balance current is (micro-A)= 6.6\n",
+ "bridge sensivity is (cm-(ohm/ohm))= 5665.0\n",
+ "sensivity is calculated wrong in the book\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 213\n",
+ "#Example 3.44:balance current and bridge sensivity\n",
+ "#calculate the balance current and bridge sensivity\n",
+ "#given data\n",
+ "P=100.;#ohms\n",
+ "Q=1000.;#ohms\n",
+ "S=857.;#ohms\n",
+ "E=1.5;#volts\n",
+ "rg=50;#ohms\n",
+ "D=100;#M-ohm\n",
+ "#calculations\n",
+ "X=((P/Q)*S);#ohms\n",
+ "dx=1/X;#\n",
+ "a1=((rg+(X*(Q+S))/(X+S)));#ohms\n",
+ "dig=((E*S*X*dx)/((X+S)**2*a1));#\n",
+ "sb=((dig*D*10**6)/dx);#\n",
+ "#results\n",
+ "print \"balance current is (micro-A)=\",round(dig*10**6,1)\n",
+ "print \"bridge sensivity is (cm-(ohm/ohm))=\",round(sb*10**-1)\n",
+ "print 'sensivity is calculated wrong in the book'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 46 - pg 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (M-ohm)= 47.28\n",
+ "The answer is a bit different from textbook due to rounding off error\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 214\n",
+ "#Example 3.46:insulation resistance\n",
+ "#calculate the resistance\n",
+ "#given data\n",
+ "import math\n",
+ "from math import log\n",
+ "v=170.;#volts\n",
+ "e=250.;#volts\n",
+ "t=20.;#seconds\n",
+ "v1=110.;#volts\n",
+ "e=250.;#volts\n",
+ "t=20.;#seconds\n",
+ "r1=25.;#M-ohm\n",
+ "r2=70.;#M-ohm\n",
+ "#calculations\n",
+ "cr1=t/(log(e/v));#\n",
+ "cr2=t/(log(e/v1));#\n",
+ "x=cr1/cr2;#\n",
+ "y=((r1*r2)/(r1+r2));#\n",
+ "R=((x*r2*(r1*r2))-(r2*r1*r2))/((r2*(r1+r2))-((r1*r2*x)));#\n",
+ "#results\n",
+ "print \"resistance is (M-ohm)=\",round(R,2)\n",
+ "print 'The answer is a bit different from textbook due to rounding off error'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 47 - pg 215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Rp is (M-ohm)= 0.1\n",
+ "Rn is (M-ohm)= 0.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 215\n",
+ "#Example 3.47: resistance\n",
+ "#calculate the resistance\n",
+ "#given data\n",
+ "em=500.;#volts\n",
+ "ep=50.;#volts\n",
+ "en=150.;#volts\n",
+ "rv=50.;#k-ohm\n",
+ "#calculations\n",
+ "rp=((em-ep-en)/en)*rv*10**3;#ohm\n",
+ "rn=((em-ep-en)/ep)*rv*10**3;#\n",
+ "#results\n",
+ "print \"Rp is (M-ohm)=\",rp*10**-6\n",
+ "print \"Rn is (M-ohm)=\",rn*10**-6"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 49 - pg 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ep is (V)= 11.63\n",
+ "En is (V)= 23.26\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 216\n",
+ "#Example 3.49: readings\n",
+ "#calculate the readings\n",
+ "#given data\n",
+ "rp=1.;#M-ohm\n",
+ "rn=2.;#M-ohm\n",
+ "r=50.;#killo ohms\n",
+ "v=500;#volts\n",
+ "#calculations\n",
+ "x=((rp*10**6)/(r*10**3));#\n",
+ "ep=(v)/((rn*x+(rn+rp)));#volts\n",
+ "en=2*ep;#\n",
+ "#results\n",
+ "print \"Ep is (V)=\",round(ep,2)\n",
+ "print \"En is (V)=\",round(en,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 50 - pg 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 240.0\n",
+ "inductance is (H)= 0.12\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 216\n",
+ "#Example 3.50:Resistance and Inductance\n",
+ "#calculate the resistance and inductance\n",
+ "#given data\n",
+ "R2=600.;#OHMS\n",
+ "R4=400.;#OHMS\n",
+ "R3=1000.;#OHMS\n",
+ "C3=0.5;#MICRO-f\n",
+ "#calculations\n",
+ "r=((R2*R4)/R3);#ohms\n",
+ "l=R2*R4*C3*10**-6;#H\n",
+ "#results\n",
+ "print \"resistance is (ohm)=\",r\n",
+ "print \"inductance is (H)=\",l\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 51 - pg 217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum (+ve) percentage error in X = 0.253\n",
+ "The maximum (-ve) percentage error in X = -0.2499\n",
+ "Therefore limits of percentage error in X is + 0.253 to -0.2499 \n",
+ "The answers are a bit different from textbook due to rounding off error\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 217\n",
+ "#Example 3.51:Resistance \n",
+ "#calculate the percentage error\n",
+ "#given data\n",
+ "p=100.;#ohms\n",
+ "q=1000.;#ohms\n",
+ "s=518.8;#ohms\n",
+ "ep=0.1;#\n",
+ "eq=0.1;#\n",
+ "es1=0.05;#\n",
+ "es2=0.05;#\n",
+ "es3=0.1;#\n",
+ "es4=0.5;#\n",
+ "tes=0.267;#\n",
+ "ds=0.008;#ohms\n",
+ "#calculations\n",
+ "pes=(tes/s)*100;#\n",
+ "pds=(ds/s)*100;#\n",
+ "ttos1=pes+pds;#\n",
+ "ttos2=-pes+pds;#\n",
+ "m1=ep+eq+ttos1;#\n",
+ "m2=-ep-eq+ttos2;#\n",
+ "#results\n",
+ "print \"The maximum (+ve) percentage error in X =\",round(m1,4)\n",
+ "print \"The maximum (-ve) percentage error in X =\",round(m2,4)\n",
+ "print \"Therefore limits of percentage error in X is +\",round(m1,4),\" to \",round(m2,4),\" \"\n",
+ "print 'The answers are a bit different from textbook due to rounding off error'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 52 - pg 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance (ohms) = 3.65\n",
+ "capacitance (micro-F) = 0.7125\n",
+ "loss angle is 0.0 degree and 4.0 minutes \n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 218\n",
+ "#Example 3.52:loss angle\n",
+ "#calculate the loss angle\n",
+ "#given data\n",
+ "import math\n",
+ "r2=2000.;#ohms\n",
+ "r3=2850.;#ohms\n",
+ "r4=0.4;#ohms\n",
+ "c4=0.5;#micro-F\n",
+ "R4=4.8;#ohms\n",
+ "f=450;#Hz\n",
+ "#calculations\n",
+ "r1=((r2*(R4+r4))/r3);#ohms\n",
+ "c1=((r3*c4)/r2);#micro-F\n",
+ "w=2*math.pi*f;#\n",
+ "d=f*c1*10**-6*r1;#\n",
+ "ad=math.atan(d)*57.3;#\n",
+ "x=round(ad);#\n",
+ "#results\n",
+ "print 'resistance (ohms) = ',round(r1,2)\n",
+ "print 'capacitance (micro-F) = ',c1\n",
+ "print \"loss angle is \",x,\" degree and \",round(ad*60),\" minutes \"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 53 - pg 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 is (M-ohm)= 1.16\n",
+ "R2 is (M-ohm)= 0.58\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 218\n",
+ "#Example 3.53: resistance\n",
+ "#calculate the resistances\n",
+ "#given data\n",
+ "em=500.;#volts\n",
+ "i1=0.8;#mA\n",
+ "r=30;#killo ohms\n",
+ "i2=0.4;#mA\n",
+ "rv=50;#k-ohm\n",
+ "#calculations\n",
+ "ep=i1*r;#volts\n",
+ "en=i2*r;#volts\n",
+ "rp=((em-ep-en)/en)*r*10**3;#ohm\n",
+ "rn=((em-ep-en)/ep)*r*10**3;#\n",
+ "#results\n",
+ "print \"R1 is (M-ohm)=\",rp*10**-6\n",
+ "print \"R2 is (M-ohm)=\",rn*10**-6\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 54 - pg 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 7066.0\n",
+ "capacitance is (micro-F)= 0.717\n",
+ "resistance is wrong in the textbook due to rounding off error\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 219\n",
+ "#Example 3.54: resistance and capacitance\n",
+ "#calculate the resistance and capacitance\n",
+ "#given data\n",
+ "import math\n",
+ "r2=100.;#ohms\n",
+ "r4=1000.;#ohms\n",
+ "r1=50.;#ohms\n",
+ "f=50.;#Hz\n",
+ "l=0.1;#H\n",
+ "#calculations\n",
+ "r3=((r2*r4)/r1)+((r1*r2*r4)/((2*math.pi*f)**2*l**2));#ohms\n",
+ "c3=r1/((2*math.pi*f)**2*l*r3);#F\n",
+ "#results\n",
+ "print \"resistance is (ohm)=\",round(r3)\n",
+ "print \"capacitance is (micro-F)=\",round(c3*10**6,3)\n",
+ "print 'resistance is wrong in the textbook due to rounding off error'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 56 - pg 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 3184.0\n",
+ "inductance is (H)= 21.6\n",
+ "resistance is wrong in the textbook due to rounding off error\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 220\n",
+ "#Example 3.54: resistance and inductance\n",
+ "#calculate the resistance and inductance\n",
+ "#given data\n",
+ "import math\n",
+ "r2=16800.;#ohms\n",
+ "r3=950.;#ohms\n",
+ "r4=1000.;#ohms\n",
+ "f=50.;#Hz\n",
+ "c3=1.57;#micro-F\n",
+ "#calculations\n",
+ "x=((r2*r3*r4*(2*math.pi*f)**2*(c3*10**-6)**2));#\n",
+ "y=(1+(((2*math.pi*f)**2)*(c3*10**-6)**2*r3**2));#\n",
+ "r1=x/y;#ohms\n",
+ "l1=((r2*r4*c3*10**-6)/y);#\n",
+ "print \"resistance is (ohm)=\",round(r1)\n",
+ "print \"inductance is (H)=\",round(l1,1)\n",
+ "print 'resistance is wrong in the textbook due to rounding off error'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 57 - pg 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (k-ohm)= 453.0\n",
+ "capacitance is (p-F)= 281.0\n",
+ "power factor is = 0.04\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 221\n",
+ "#Example 3.57: resistance, capacitance AND POWER FACTOR\n",
+ "#calculate the resistance, capacitance AND POWER FACTOR\n",
+ "#given data\n",
+ "import math\n",
+ "f=50.;#Hz\n",
+ "r2=120.;#ohms\n",
+ "c3=0.4;#micro-F\n",
+ "c4=106.;#pF\n",
+ "r3=318.;#ohms\n",
+ "#calculations\n",
+ "r1=((r2*c3*10**-6)/(c4*10**-12));#ohms\n",
+ "c1=((c4*10**-12*r3)/r2);#pF\n",
+ "pf=((r1)/(math.sqrt(r1**2+(1/(2*math.pi*f*c1)**2))));#\n",
+ "#results\n",
+ "print \"resistance is (k-ohm)=\",round(r1*10**-3)\n",
+ "print \"capacitance is (p-F)=\",round(c1*10**12)\n",
+ "print \"power factor is =\",round(pf,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 58 - pg 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 62,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "X is = 3791.175\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 222\n",
+ "#Example 3.58: resistance \n",
+ "#calculate the resistance\n",
+ "#given data\n",
+ "l1=26.;#cm\n",
+ "l2=24.;#cm\n",
+ "l1d=25.8;#cm\n",
+ "l2d=23.5;#cm\n",
+ "s=545.;#ohm\n",
+ "sg=65.;#ohm\n",
+ "#calculations\n",
+ "sd=((s*sg)/(s+sg));#ohm\n",
+ "X=((sd*(l1-l2))-s*(l1d-l2d))/(l1-l2-l1d+l2d);#\n",
+ "#results\n",
+ "print \"X is =\",round(X,3) \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 59 - pg 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 63,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance is (micro-F)= 0.2356\n",
+ "resistance is (ohm)= 471.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 222\n",
+ "#Example 3.59: capacitance and resistance \n",
+ "#calculate the capacitance and resistance\n",
+ "#given data\n",
+ "e1=5000.;#volts\n",
+ "r1=500.;#ohm\n",
+ "l1=0.18;#H\n",
+ "r2=1000.;#ohm\n",
+ "#calculations\n",
+ "r4=r2;#ohms\n",
+ "x=(r1/(e1**2*l1));#\n",
+ "y=((r2*r2)/(1+((e1**2)*x**2)));#\n",
+ "c3=((l1/y));#F\n",
+ "r3=(x/c3);#\n",
+ "#results\n",
+ "print \"capacitance is (micro-F)=\",round(c3*10**6,4)\n",
+ "print \"resistance is (ohm)=\",round(r3,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 60 - pg 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance is (micro-F)= 0.2356\n",
+ "resistance is (ohm)= 471.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 222\n",
+ "#Example 3.59: capacitance and resistance \n",
+ "#calculate the capacitance and resistance\n",
+ "#given data\n",
+ "e1=5000.;#volts\n",
+ "r1=500.;#ohm\n",
+ "l1=0.18;#H\n",
+ "r2=1000.;#ohm\n",
+ "#calculations\n",
+ "r4=r2;#ohms\n",
+ "x=(r1/(e1**2*l1));#\n",
+ "y=((r2*r2)/(1+((e1**2)*x**2)));#\n",
+ "c3=((l1/y));#F\n",
+ "r3=(x/c3);#\n",
+ "#results\n",
+ "print \"capacitance is (micro-F)=\",round(c3*10**6,4)\n",
+ "print \"resistance is (ohm)=\",round(r3,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 61 - pg 223"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 65,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 60.0\n",
+ "inductance is (mH)= 8.1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 223\n",
+ "#Example 3.61;resistance and inductance\n",
+ "#calculate the resistance and inductance\n",
+ "#given data\n",
+ "p=0;#\n",
+ "r2=10;#ohms\n",
+ "r4=900;#ohms\n",
+ "c3=0.9;#micro-F\n",
+ "c4=0.15;#micro-F\n",
+ "#calculations\n",
+ "r=((r2*c3*10**-6)/(c4*10**-6));#ohms\n",
+ "l=r2*r4*c3*10**-3;#mH\n",
+ "#results\n",
+ "print \"resistance is (ohm)=\",r\n",
+ "print \"inductance is (mH)=\",l\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 62 - pg 223"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 66,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (M-ohm)= 224.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 223\n",
+ "#Example 3.62;resistance \n",
+ "#calculate the resistance\n",
+ "#given data\n",
+ "d2=350.;#\n",
+ "f2=1000.;#Hz\n",
+ "s=1;#M-ohm\n",
+ "d1=250.;#\n",
+ "f1=2.5;#Hz\n",
+ "l=400.;#/m\n",
+ "l1=1000.;#m\n",
+ "#calculations\n",
+ "X=((d2*f2*s)/(d1*f1));#M-ohm\n",
+ "x=(X*l)/l1;#M-ohm\n",
+ "#results\n",
+ "print \"resistance is (M-ohm)=\",x\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 63 - pg 223"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 67,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (M-ohm)= 224.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 223\n",
+ "#Example 3.62;resistance \n",
+ "#calculate the resistance\n",
+ "#given data\n",
+ "d2=350.;#\n",
+ "f2=1000.;#Hz\n",
+ "s=1;#M-ohm\n",
+ "d1=250.;#\n",
+ "f1=2.5;#Hz\n",
+ "l=400.;#/m\n",
+ "l1=1000.;#m\n",
+ "#calculations\n",
+ "X=((d2*f2*s)/(d1*f1));#M-ohm\n",
+ "x=(X*l)/l1;#M-ohm\n",
+ "#results\n",
+ "print \"resistance is (M-ohm)=\",x\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 64 - pg 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 68,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "permittivity is = 8.91e-11\n",
+ "power factor is = 0.044\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 224\n",
+ "#Example 3.64:permittivity and power factor\n",
+ "#calculate the permittivity and power factor\n",
+ "#given data\n",
+ "import math\n",
+ "r3=350.;#ohms\n",
+ "f=50.;#Hz\n",
+ "r2=250.;#ohms\n",
+ "c3=0.4;#micro-F\n",
+ "c4=100.;#pF\n",
+ "l=5.;#mm\n",
+ "l1=10.;#cm\n",
+ "#calculations\n",
+ "r1=((r2*c3*10**-6)/(c4*10**-12));#ohms\n",
+ "c1=((c4*10**-12)*(r3/r2));#F\n",
+ "e=((c1*l*10**-3)/((math.pi/4)*(l1/100)**2));#\n",
+ "pf=r1*2*math.pi*f*c1;#\n",
+ "#results\n",
+ "print \"permittivity is =\",round(e,13)\n",
+ "print \"power factor is =\",round(pf,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 65 - pg 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 69,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 40.0\n",
+ "capacitance is (micro-F)= 0.833\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 225\n",
+ "#Example 3.65:resistance and capacitance\n",
+ "#calculate the resistance and capacitance\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "rab=2000.;#ohms\n",
+ "f=1;#kHz\n",
+ "cab=0.047;#micro-farad\n",
+ "rbc=1000;#ohms\n",
+ "cbc=0.47;#micro-F\n",
+ "#calculations\n",
+ "cda=0.5;#micro-F\n",
+ "zab=(1/((1/rab)+(1j*2*math.pi*f*10**3*cab*10**-6)));#\n",
+ "zbc=rbc-(1j/(2*math.pi*f*10**3*cbc*10**-6));#\n",
+ "zda=(-1j/(2*math.pi*f*10**3*cda*10**-6));#\n",
+ "zx=(zda*zbc)/zab;#\n",
+ "rx=zx.real;#ohms\n",
+ "cx=-1/(2*math.pi*f*10**3*zx.imag);#\n",
+ "#results\n",
+ "print \"resistance is (ohm)=\",round(rx)\n",
+ "print \"capacitance is (micro-F)=\",round(cx*10**6,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 66 - pg 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 70,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance is (micro-F)= 0.1\n",
+ "voltage across the detector is (mV)= 4.4\n",
+ "voltage across the detector is (mV)= 7.6\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 225\n",
+ "#Example 3.66:capacitance\n",
+ "#calculate the capacitance and voltage\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "from math import sqrt\n",
+ "zbc=1000;#ohms\n",
+ "f=1;#kHz\n",
+ "cda=0.2*10**-6 ;#micro-F\n",
+ "zab=500.;#ohms\n",
+ "rba=1002;#ohms\n",
+ "v1=10;#volts\n",
+ "#calculations\n",
+ "zda=(-1j/(2*math.pi*f*10**3*cda));#\n",
+ "zcd=(zbc*zda)/zab;#\n",
+ "cx=-1/(2*math.pi*f*10**3*zcd.imag);#\n",
+ "iab=v1/(rba+zab);#amperes\n",
+ "ibc=iab;#amperes\n",
+ "ida=v1*1j*2*math.pi*f*10**3*((cda*cx)/(cda+cx));#amperes\n",
+ "icd=ida;#amperes\n",
+ "vab=(v1*zab)/(rba+zab);#volts\n",
+ "vab1=icd/(1j*2*math.pi*10**3*cda);#volts\n",
+ "vbd=vab1-vab;#volts\n",
+ "iba=v1/(zab-(1j/(2*math.pi*10**3*cda)));#\n",
+ "vba=zab*iba;#\n",
+ "v2=sqrt(vba.real**2+vba.imag**2);#volts\n",
+ "ibc=v1/(rba-(1j/(2*math.pi*10**3*cx)));#\n",
+ "vbc=rba*ibc;#\n",
+ "v3=sqrt(vbc.real**2+vbc.imag**2);#volts\n",
+ "vac=v3-v2;#\n",
+ "#results\n",
+ "print \"capacitance is (micro-F)=\",cx*10**6\n",
+ "print \"voltage across the detector is (mV)=\",round(vbd.real*10**3,1)\n",
+ "print \"voltage across the detector is (mV)=\",round(vac*10**3,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 67 - pg 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 71,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "frequency is (Hz)= 398.0\n",
+ "resistance is (ohm)= 1171.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 226\n",
+ "#Example 3.67:frequency and resistance\n",
+ "#calculate the frequency and resistance\n",
+ "#given data\n",
+ "import math\n",
+ "rab=800.;#ohm\n",
+ "cab=0.4;#micro-F\n",
+ "rbc=500.;#ohms\n",
+ "cbc=1;#micro-F\n",
+ "rcd=1200.;#ohm\n",
+ "#calculations\n",
+ "x=cab*10**-6*rab;#\n",
+ "y=cbc*10**-6*rbc;#\n",
+ "w=math.sqrt(1/(x*y));#rad/s\n",
+ "f=w/(2*math.pi);#\n",
+ "zab=(rab/((1+(1j*w*cab*10**-6*rab))));#ohms\n",
+ "zbc=rbc+(1/((1+(1j*w*cbc*10**-6*rbc))));#ohms\n",
+ "zda=(zab*rcd)/zbc;#ohms\n",
+ "#results\n",
+ "print \"frequency is (Hz)=\",round(f)\n",
+ "print \"resistance is (ohm)=\",round(zda.real)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 68 - pg 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 72,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "in case 1\n",
+ "resistance is (ohm)= 1250.0\n",
+ "inductance is (H)= 0.1875\n",
+ "in case 2\n",
+ "resistance is (ohm)= 1589.64\n",
+ "inductance is (H)= 0.1854\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 227\n",
+ "#Example 3.68: resistance and inductance\n",
+ "#calculate the resistance and inductance\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "cab=0.01;#micro-F\n",
+ "rbc=2.5;#k-ohms\n",
+ "cbc=1;#micro-F\n",
+ "rda=7.5*10**3;#ohm\n",
+ "cda=0.02;#micro-F\n",
+ "w=50*10**3;#Hz\n",
+ "#calculations and results\n",
+ "zab=(-1/(((1j*w*cab*10**-6*1))));#ohms\n",
+ "zbc=rbc*10**3;#ohms\n",
+ "zda=rda+(1/(((1j*w*cda*10**-6))));#ohms\n",
+ "zcd=(zbc*zda)/zab;#\n",
+ "r=-(zcd.real);#ohms\n",
+ "l=-(zcd.imag)/w;#H\n",
+ "print 'in case 1'\n",
+ "print \"resistance is (ohm)=\",round(r)\n",
+ "print \"inductance is (H)=\",l\n",
+ "zda2=zda/(1+(zda*1j*w*100*10**-12));#\n",
+ "zcd=(zbc*zda2)/zab;#\n",
+ "r=-zcd.real;#ohms\n",
+ "l=-(zcd.imag)/w;#H\n",
+ "print 'in case 2'\n",
+ "print \"resistance is (ohm)=\",round(r,2)\n",
+ "print \"inductance is (H)=\",round(l,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 69 - pg 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 74,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 27.869\n",
+ "capcitance is (micro-F)= 0.0195\n",
+ "error in R is (%)= 1.815\n",
+ "error in C is (%)= -0.00125\n",
+ "answer is wrong in the textbook for errors\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 228\n",
+ "#Example 3.69:resistance and capacitance\n",
+ "#calculate the resistance and capacitance\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "zab=521.;#ohms\n",
+ "zbc=1200.;#ohms\n",
+ "rda=12.1;#ohms\n",
+ "f=10.;#kHz\n",
+ "cda=0.045;#micro-F\n",
+ "#calculations and results\n",
+ "zda=rda-(1j/(2*math.pi*f*10**3*cda*10**-6));#\n",
+ "zcd=(zbc*zda)/zab;#\n",
+ "c=1/(2*math.pi*f*10**3*zcd.imag);#\n",
+ "print \"resistance is (ohm)=\",round(zcd.real,3)\n",
+ "print \"capcitance is (micro-F)=\",round(-c*10**6,4)\n",
+ "rab=521;#ohms\n",
+ "lab=2;#micro-H\n",
+ "cab=550;#pF\n",
+ "rbc=1200;#ohms\n",
+ "lbc=5;#micro-H\n",
+ "cbc=250;#pF\n",
+ "rda1=1.5;#m-ohms\n",
+ "cda=0.045;#micro-F\n",
+ "zab1=521;#ohms\n",
+ "zbc1=1200;#ohms\n",
+ "rda1=12.1;#ohms\n",
+ "f1=10;#kHz\n",
+ "cda1=0.045;#micro-F\n",
+ "zab=1/((1/(rab+(1j*2*math.pi*f*10**4*lab*10**-6)))+(1j*2*math.pi*f*10**3*cab*10**-12));#\n",
+ "zbc=1/((1/(rbc+(1j*2*math.pi*f*10**4*lbc*10**-6)))+(1j*2*math.pi*f*10**3*cbc*10**-12));#\n",
+ "zda=rda+((1/((1/rda1*10**-6)+(1j*2*math.pi*f*10**3*cda*10**-6))));#;#\n",
+ "zcd=(zbc*zda)/zab;#\n",
+ "zda1=rda1-(1j/(2*math.pi*f1*10**3*cda1*10**-6));#\n",
+ "zcd1=(zbc1*zda1)/zab1;#\n",
+ "c1=1/(2*math.pi*f*10**3*(zcd1.imag));#\n",
+ "c=1/(2*math.pi*f*10**3*(zcd.imag));#\n",
+ "per=(((zcd1.real)-(zcd.real))/(zcd.real))*100;#\n",
+ "pec=(((zcd1.imag)-(zcd.imag))/(zcd.imag))*100;#\n",
+ "print \"error in R is (%)=\",round(per,3)\n",
+ "print \"error in C is (%)=\",round(pec,5)\n",
+ "print 'answer is wrong in the textbook for errors'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 70 - pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 75,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 1000.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 230\n",
+ "#Example 3.70:resistance \n",
+ "#calculate the resistance\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "w=5000;#rad/s\n",
+ "cab=0.2;#micro-F\n",
+ "zbc=500.;#ohm\n",
+ "l=0.1;#H\n",
+ "cda=0.4;#micro-F\n",
+ "rcd=50.;#ohm\n",
+ "#calculations\n",
+ "zab=(-1j/(w*cab*10**-6));#ohms\n",
+ "zcd=rcd+1j*w*l;#ohm\n",
+ "izda=-1j/(w*cda*10**-6);#\n",
+ "zda=(zab*zcd)/zbc;#\n",
+ "rs=(zda.real);#ohms\n",
+ "#results\n",
+ "print \"resistance is (ohm)=\",rs\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 71 - pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 76,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance is (micro-F)= 0.1\n",
+ "voltage across the detector is (mV)= 4.4\n",
+ "voltage across the detector is (mV)= 7.6\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 225\n",
+ "#Example 3.66:capacitance\n",
+ "#calculate the capacitance and voltage\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "from math import sqrt\n",
+ "zbc=1000;#ohms\n",
+ "f=1;#kHz\n",
+ "cda=0.2*10**-6 ;#micro-F\n",
+ "zab=500.;#ohms\n",
+ "rba=1002;#ohms\n",
+ "v1=10;#volts\n",
+ "#calculations\n",
+ "zda=(-1j/(2*math.pi*f*10**3*cda));#\n",
+ "zcd=(zbc*zda)/zab;#\n",
+ "cx=-1/(2*math.pi*f*10**3*zcd.imag);#\n",
+ "iab=v1/(rba+zab);#amperes\n",
+ "ibc=iab;#amperes\n",
+ "ida=v1*1j*2*math.pi*f*10**3*((cda*cx)/(cda+cx));#amperes\n",
+ "icd=ida;#amperes\n",
+ "vab=(v1*zab)/(rba+zab);#volts\n",
+ "vab1=icd/(1j*2*math.pi*10**3*cda);#volts\n",
+ "vbd=vab1-vab;#volts\n",
+ "iba=v1/(zab-(1j/(2*math.pi*10**3*cda)));#\n",
+ "vba=zab*iba;#\n",
+ "v2=sqrt(vba.real**2+vba.imag**2);#volts\n",
+ "ibc=v1/(rba-(1j/(2*math.pi*10**3*cx)));#\n",
+ "vbc=rba*ibc;#\n",
+ "v3=sqrt(vbc.real**2+vbc.imag**2);#volts\n",
+ "vac=v3-v2;#\n",
+ "#results\n",
+ "print \"capacitance is (micro-F)=\",cx*10**6\n",
+ "print \"voltage across the detector is (mV)=\",round(vbd.real*10**3,1)\n",
+ "print \"voltage across the detector is (mV)=\",round(vac*10**3,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 72 - pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 77,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "frequency is (Hz)= 398.0\n",
+ "resistance is (ohm)= 1171.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 226\n",
+ "#Example 3.67:frequency and resistance\n",
+ "#calculate the frequency and resistance\n",
+ "#given data\n",
+ "import math\n",
+ "rab=800.;#ohm\n",
+ "cab=0.4;#micro-F\n",
+ "rbc=500.;#ohms\n",
+ "cbc=1;#micro-F\n",
+ "rcd=1200.;#ohm\n",
+ "#calculations\n",
+ "x=cab*10**-6*rab;#\n",
+ "y=cbc*10**-6*rbc;#\n",
+ "w=math.sqrt(1/(x*y));#rad/s\n",
+ "f=w/(2*math.pi);#\n",
+ "zab=(rab/((1+(1j*w*cab*10**-6*rab))));#ohms\n",
+ "zbc=rbc+(1/((1+(1j*w*cbc*10**-6*rbc))));#ohms\n",
+ "zda=(zab*rcd)/zbc;#ohms\n",
+ "#results\n",
+ "print \"frequency is (Hz)=\",round(f)\n",
+ "print \"resistance is (ohm)=\",round(zda.real)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 73 - pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 78,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "M is (H)= 2.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 231\n",
+ "#Example 3.73: inductance\n",
+ "#calculate the inductance\n",
+ "#given data\n",
+ "l1=4.;#H\n",
+ "r1=1.;#ohm\n",
+ "r2=1.;#ohm\n",
+ "r3=2.;#ohm\n",
+ "l4=2.;#H\n",
+ "r4=2.;#ohm\n",
+ "#calculations\n",
+ "M=((r3*l1)-(r2*l4))/(r2+r3);#H\n",
+ "#results\n",
+ "print \"M is (H)=\",M\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 74 - pg 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 79,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 300.0\n",
+ "inductance is (mH)= 0.06\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 232\n",
+ "#Example 3.74:resistance and inductance\n",
+ "#calculate the resistance and inductance\n",
+ "#given data\n",
+ "r2=500.;#ohms\n",
+ "r3=300.;#ohms\n",
+ "r4=500.;#ohms\n",
+ "r=150.;#ohms\n",
+ "c=2.5;#nano farads\n",
+ "#calculations\n",
+ "rX=((r2*r3)/r4);#ohms\n",
+ "l=(((c*10**-9*r3)/r4)*((r*(r2+r4))+(r2*r4)));#H\n",
+ "#results\n",
+ "print \"resistance is (ohm)=\",rX\n",
+ "print \"inductance is (mH)=\",l*100.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 75 - pg 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 80,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "current is (A)= 0.326\n",
+ "iron loss is (W)= 0.0935\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 233\n",
+ "#Example 3.75:iron loss\n",
+ "#calculate the current and iron loss\n",
+ "#given data\n",
+ "import math\n",
+ "r2=18.;#ohm\n",
+ "r4=550.;#ohm\n",
+ "r3=1250.;#ohm\n",
+ "c3=0.5;#micro-F\n",
+ "r4=550.;#ohm\n",
+ "r31=1125.;#ohm\n",
+ "c31=3.85;#micro-F\n",
+ "v=50.;#volts\n",
+ "w=4000.;#rad/s\n",
+ "#calculations\n",
+ "r1=(r2*r4)/r3;#ohm\n",
+ "l1=r2*r4*c3*10**-3;#mH\n",
+ "r11=(r2*r4)/r31;#ohm\n",
+ "l11=r2*r4*c31*10**-3;#mH\n",
+ "i1=v/(math.sqrt((r1+r11)**2+(w**2*(l11*10**-3)**2)));#\n",
+ "tl=i1**2*r11;#W\n",
+ "cl=i1**2*r1;#W\n",
+ "il=tl-cl;#\n",
+ "#results\n",
+ "print \"current is (A)=\",round(i1,3)\n",
+ "print \"iron loss is (W)=\",round(il,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 77 - pg 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 81,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm)= 77.87\n",
+ "capacitance is (micro-F)= 10.152\n",
+ "Rp is (ohm)= 81.03\n",
+ "Cp is (micro-F)= 0.396\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 235\n",
+ "#Example 3.77:parameters\n",
+ "#calculate the required parameters\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "rab=1000.;#ohm\n",
+ "f=1.;#kHz\n",
+ "cab=0.5;#micro-F\n",
+ "rbc=1000.;#ohm\n",
+ "rcd=200.;#ohm\n",
+ "lcd=30.;#mH\n",
+ "#calculations\n",
+ "zab=1/((1/rab)+(1j*2*math.pi*f*10**3*cab*10**-6));#\n",
+ "zbc=rbc-(1j/(2*math.pi*f*10**3*cab*10**-6));#\n",
+ "zcd=rcd+(1j*2*math.pi*f*10**3*lcd*10**-3);#\n",
+ "zda=(zab*zcd)/zbc;#ohm\n",
+ "R=(zda.real);#\n",
+ "cda=1/(2*math.pi*f*10**3*(zda.imag));#\n",
+ "x=math.sqrt((zda.real)**2+(zda.imag)**2);#\n",
+ "x=81.03\n",
+ "rp=x;#ohms\n",
+ "cp=((.2015)*10**3)/(2*math.pi*rp);#\n",
+ "#results\n",
+ "print \"resistance is (ohm)=\",round(R,3)\n",
+ "print \"capacitance is (micro-F)=\",round(-cda*10**6,3)\n",
+ "print \"Rp is (ohm)=\",round(rp,2)\n",
+ "print \"Cp is (micro-F)=\",round(cp,3)\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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
|