summaryrefslogtreecommitdiff
path: root/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal
diff options
context:
space:
mode:
Diffstat (limited to 'Electrical_Measurements_Measuring_Instruments_by_K._Shinghal')
-rwxr-xr-xElectrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter1.ipynb548
-rwxr-xr-xElectrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter2.ipynb2381
-rwxr-xr-xElectrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter3.ipynb3283
-rwxr-xr-xElectrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter4.ipynb751
-rwxr-xr-xElectrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter5.ipynb769
5 files changed, 7732 insertions, 0 deletions
diff --git a/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter1.ipynb b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter1.ipynb
new file mode 100755
index 00000000..fdb0119c
--- /dev/null
+++ b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter1.ipynb
@@ -0,0 +1,548 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1 - Philosophy of Measurement"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arithmetic mean is (V)= 100.0\n",
+ "average deviation is (V)= 0.084\n",
+ "standard deviation is (V)= 0.1192\n",
+ "probable error is (V)= 0.0804\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.1:#ARITHEMATIC MEAN,AVERAGE DEVIATION ,STANDARD DEVIATION AND PROBABLE ERROR\n",
+ "#calculate the ARITHEMATIC MEAN,AVERAGE DEVIATION ,STANDARD DEVIATION AND PROBABLE ERROR\n",
+ "#given\n",
+ "import math, numpy\n",
+ "T=numpy.array([99.7,99.8,99.9,100,100.1,100.2,100.3]);#VOLTS\n",
+ "f=numpy.array([2,8,20,40,21,6,3]);#frequency of occurence\n",
+ "q=numpy.array([T[0]*f[0],T[1]*f[1],T[2]*f[2],T[3]*f[3],T[4]*f[4],T[5]*f[5],T[6]*f[6]]);#\n",
+ "#calculations\n",
+ "AM=(q[0]+q[1]+q[2]+q[3]+q[4]+q[5]+q[6])/100;#arithematic mean in mm\n",
+ "qb=numpy.zeros(7)\n",
+ "for i in range(0,7):\n",
+ " qb[i]= T[i]-AM\n",
+ "\n",
+ "Q= numpy.array([qb[0],qb[1],qb[2],qb[3],qb[4],qb[5],qb[6]]);#\n",
+ "AV=(-qb[0]*f[0]-qb[1]*f[1]-qb[2]*f[2]-qb[3]*f[3]+qb[4]*f[4]+qb[5]*f[5]+qb[6]*f[6])/100;#\n",
+ "SD=math.sqrt(((qb[0]**2*f[0])+(qb[1]**2*f[1])+(qb[2]**2*f[2])+(qb[3]**2*f[3])+(qb[4]**2*f[4])+(qb[5]**2*f[5])+(qb[6]**2*f[6]))/100);#standard deviation\n",
+ "r1= 0.6745*SD;#PROBABLE ERROR OF ONE READING\n",
+ "#results\n",
+ "print\"arithmetic mean is (V)=\",AM\n",
+ "print\"average deviation is (V)=\",AV\n",
+ "print\"standard deviation is (V)=\",round(SD,4)\n",
+ "print\"probable error is (V)=\",round(r1,4)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "when current reading is 5mA\n",
+ "apparent resistance in kilo ohms is 20.0\n",
+ "percentage gross error is 13.33\n",
+ "when current reading is 50mA\n",
+ "apparent resistance in kilo ohms is 2.0\n",
+ "percentage gross error is 1.33\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.2:#APPRABET RESISTANCE AND PERCENTAGE GROSS ERROR\n",
+ "#calculate the APPARENT RESISTANCE AND PERCENTAGE GROSS ERROR\n",
+ "#given\n",
+ "print\"when current reading is 5mA\"\n",
+ "vr=100.;#voltmeter reading\n",
+ "ir=5.;#mA\n",
+ "#calculations and results\n",
+ "rt=vr/(ir);#in kilo ohms\n",
+ "print\"apparent resistance in kilo ohms is\",rt\n",
+ "vm=150.;#range of voltmeter\n",
+ "s=1.;#kilo ohms per volts sensivity\n",
+ "rv=s*vm;#kilo ohms\n",
+ "rx=((rt*rv)/(rv-rt));#kilo ohms\n",
+ "ge=((rx-rt)/rx)*100;#percentage gross error\n",
+ "print\"percentage gross error is\",round(ge,2)\n",
+ "print\"when current reading is 50mA\"\n",
+ "vr=100.;#voltmeter reading\n",
+ "ir1=50.;#mA\n",
+ "rt1=vr/(ir1);#in kilo ohms\n",
+ "print\"apparent resistance in kilo ohms is\",rt1\n",
+ "vm=150.;#range of voltmeter\n",
+ "s=1;#kilo ohms per volts sensivity\n",
+ "rv=s*vm;#kilo ohms\n",
+ "rx1=((rt1*rv)/(rv-rt1));#kilo ohms\n",
+ "ge1=((rx1-rt1)/rx1)*100;#percentage gross error\n",
+ "print\"percentage gross error is\",round(ge1,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limiting error at 150 V is (%)= 5.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.3:#limiting error\n",
+ "#calculate the limiting error\n",
+ "#given\n",
+ "fs=1.5;#full scale in percentage\n",
+ "vr=500.;#voltmeter reading\n",
+ "#calculations\n",
+ "ea=(fs/100)*vr;#volts\n",
+ "le=150;#limiting error voltage\n",
+ "lep=((ea/le)*100);#limiting error\n",
+ "#results\n",
+ "print \"limiting error at 150 V is (%)=\",lep\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arithmetic mean is, (V)= 100.0\n",
+ "average deviation is, (V)= 0.2\n",
+ "standard deviation is, (V)= 0.228\n",
+ "Variance is ,(V)= 0.052\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.4:#ARITHMETIC MEAN,AVERAGE DEVIATION ,STANDARD DEVIATION AND PROBABLE ERROR\n",
+ "#calculate the ARITHMETIC MEAN,AVERAGE DEVIATION ,STANDARD DEVIATION AND PROBABLE ERROR\n",
+ "#given\n",
+ "import math,numpy\n",
+ "T=numpy.array([99.7,99.8,100,100.2,100.3]);#VOLTS\n",
+ "q=numpy.array([T[0],T[1],T[2],T[3],T[4]]);#\n",
+ "#calculations\n",
+ "AM=(q[0]+q[1]+q[2]+q[3]+q[4])/5;#arithematic mean in mm\n",
+ "qb=numpy.zeros(6)\n",
+ "for i in range(0,5):\n",
+ " qb[i]= T[i]-AM;\n",
+ "\n",
+ "Q= numpy.array([qb[0],qb[1],qb[2],qb[3],qb[4]]);#\n",
+ "AV=(-qb[0]-qb[1]-qb[2]+qb[3]+qb[4])/5;#\n",
+ "SD=math.sqrt(((qb[0]**2)+(qb[1]**2)+(qb[2]**2)+(qb[3]**2)+(qb[4]**2))/5);#standard deviation\n",
+ "V=SD**2;#\n",
+ "#results\n",
+ "print\"arithmetic mean is, (V)=\",AM\n",
+ "print\"average deviation is, (V)=\",AV\n",
+ "print\"standard deviation is, (V)=\",round(SD,3)\n",
+ "print\"Variance is ,(V)=\",V"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "power is,(W)= 1344.8\n",
+ "error in power is,(W)= 40.606\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.5:#error\n",
+ "#calculate the error in power\n",
+ "#given\n",
+ "i=8.2;#in amperes\n",
+ "r=20.;#ohms\n",
+ "nd=100.;#divisions\n",
+ "ra=10.;#range in amperes\n",
+ "d=0.5;#divisions\n",
+ "amcr=1.;#ammemeter constant error\n",
+ "crr=-0.2;#construction error\n",
+ "#calculations\n",
+ "p=i**2*r;#watts\n",
+ "rd1=ra/nd;#reading of one division\n",
+ "per=((d*rd1)/i)*100;#possible ameter rwading error\n",
+ "ter=amcr+per;#total ammeter error\n",
+ "ep=(((2*ter)+crr)/nd)*p;#\n",
+ "#results\n",
+ "print \"power is,(W)=\",p\n",
+ "print \"error in power is,(W)=\",round(ep,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arithmetic mean is (V)= 100.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.6:#ARITHMETIC MEAN\n",
+ "#calculate the arithmetic mean\n",
+ "#given\n",
+ "import numpy\n",
+ "T=numpy.array([99.7,99.8,99.9,100,100.1,100.2,100.3]);#VOLTS\n",
+ "f=numpy.array([2,8,20,40,21,6,3]);#frequency of occurence\n",
+ "#calculations\n",
+ "qb=numpy.zeros(8)\n",
+ "for i in range (0,7):\n",
+ " qb[i]=T[i]-T[5];\n",
+ "\n",
+ "prdtc=(qb[0]*f[0])+(qb[1]*f[1])+(qb[2]*f[2])+(qb[3]*f[3])+(qb[4]*f[4])+(qb[5]*f[5])+(qb[6]*f[6])\n",
+ "am=T[5]+(prdtc/100);#arithemetic mean\n",
+ "#results\n",
+ "print \"arithmetic mean is (V)=\",am\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limiting error for power is, (%)= 3.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.7:#limiting error\n",
+ "#calculate the limiting error for power\n",
+ "#given\n",
+ "fse=1.;#full scale deflection\n",
+ "vr=150.;#range in volts\n",
+ "v1=100.;#volts\n",
+ "ve=100.;#range in mA\n",
+ "#calculations\n",
+ "ev=(fse/100)*vr;#voltas\n",
+ "le100=((ev)/v1)*100;#in percentage\n",
+ "ee=(fse/100)*ve;#mA\n",
+ "e1=55;#mA\n",
+ "le50=((ee/e1)*100);#in percentage\n",
+ "ler=le100+le50;#\n",
+ "#results\n",
+ "print \"limiting error for power is, (%)=\",round(ler,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "volume is,(m^3)= 0.216\n",
+ "percentage error in volume is,(%)= 3.0\n",
+ "error in volume is,(m^3)= 0.00648\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 37\n",
+ "#Example 1.8:# error\n",
+ "#calculate the volume, percentage error\n",
+ "#given\n",
+ "fse=1.;#full scale deflection\n",
+ "e=0.60;#meters\n",
+ "#calculations\n",
+ "v=(e)**3;#volume in m^3\n",
+ "ev=3*fse;#error in volume\n",
+ "evv=(ev/100)*v;#\n",
+ "#results\n",
+ "print \"volume is,(m^3)=\",v\n",
+ "print \"percentage error in volume is,(%)=\",ev\n",
+ "print \"error in volume is,(m^3)=\",evv\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 - pg 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "current in the circuit is,(A)= 2.375\n",
+ "error in current is,(A)= 0.0356\n",
+ "percentage error in current is,(%)= 1.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.9:#error\n",
+ "#calculate the error in circuit\n",
+ "#given\n",
+ "v=95.;#volts\n",
+ "r=40.;#ohms\n",
+ "evv=0.95;#error in voltage\n",
+ "err=-0.2;#error in resistance\n",
+ "#calculations\n",
+ "i=v/r;#amperes\n",
+ "err1=(err/r)*100;#percentage error \n",
+ "evv1=(evv/v)*100;#percentage error\n",
+ "x=evv1-err1;#\n",
+ "ei=(x/100)*i;#\n",
+ "#results\n",
+ "print \"current in the circuit is,(A)=\",i\n",
+ "print \"error in current is,(A)=\",round(ei,4)\n",
+ "print \"percentage error in current is,(%)=\",x"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "parralel resistance case\n",
+ "magnitude of resistance in ohms is = 17.391\n",
+ "limiting error in ohms is = 4.348\n",
+ "percentage error (%) = 25.0\n",
+ "series resistance case\n",
+ "magnitude of resistance in ohms is = 170.0\n",
+ "percentage error (%) = 5.0\n",
+ "limiting error in ohms is = 8.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.10:#MAGNITUDE AND LIMITING ERROR\n",
+ "#calculate the magnitude of resistance and limiting error\n",
+ "#given\n",
+ "print \"parralel resistance case\"\n",
+ "r1=40.;#ohms\n",
+ "er1=5.;#percentage error\n",
+ "r2=80.;#ohms\n",
+ "er2=5.;#percentage error\n",
+ "r3=50.;#ohms\n",
+ "er3=5.;#percentage error\n",
+ "#calculations\n",
+ "rp=((r1*r2*r3)/(r1*r2+r2*r3+r3*r1));#ohms\n",
+ "Y=(r1*r2+r2*r3+r3*r1);#ohms\n",
+ "ex=er1+er2+er3;#percentage error\n",
+ "ey1=er1+er2;#\n",
+ "ey2=er2+er3;#\n",
+ "ey3=er3+er1;#\n",
+ "y=(((r1*r2*ey1)/Y)+((r2*r3*ey2)/Y)+((r3*r1*ey3)/Y));#error\n",
+ "mer=(y+ex)*rp;#\n",
+ "#results\n",
+ "print \"magnitude of resistance in ohms is = \",round(rp,3)\n",
+ "print \"limiting error in ohms is = \",round(mer/100,3)\n",
+ "print \"percentage error (%) = \",(y+ex)\n",
+ "print \"series resistance case\"\n",
+ "rs=r1+r2+r3;#ohms\n",
+ "er=(((r1/rs)*er1)+((r2/rs)*er2)+((r3/rs)*er3));#\n",
+ "mer1=(er/100)*rs;#ohms\n",
+ "print \"magnitude of resistance in ohms is = \",rs\n",
+ "print \"percentage error (%) = \",er\n",
+ "print \"limiting error in ohms is = \",mer1\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnitude in ohm = 151.0\n",
+ "percentage error when error in both (PS) and (Q) is positive (%) = 0.5\n",
+ "error in ohms when error in both (PS) and (Q) is positive (ohms) = 0.755\n",
+ "percentage error when error in (PS) is positive and (Q) is negative (%) = 1.5\n",
+ "error in ohms when error in (PS) is positive and (Q) is negative (ohms) = 2.265\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.11:#MAGNITUDE AND LIMITING ERROR\n",
+ "#calculate the magintude of resistance in ohm and error\n",
+ "#given\n",
+ "r1=50;#ohms\n",
+ "er1=0.5;#percentage error\n",
+ "r2=100;#ohms\n",
+ "er2=0.5;#percentage error\n",
+ "r3=75.5;#ohms\n",
+ "er3=0.5;#percentage error\n",
+ "#calculations\n",
+ "x=((r2/r1)*r3);#ohms\n",
+ "eps=er1+er2;#\t\n",
+ "erpsq=eps-er3;#when error in both (PS) and (Q) is positive\n",
+ "erpsq1=eps+er3;#when error in (PS) is positive and (Q) is negetive\n",
+ "oer1=(erpsq/100)*x;#ohms\n",
+ "oer2=(erpsq1/100)*x;#ohms\n",
+ "#results\n",
+ "print \"magnitude in ohm = \",x\n",
+ "print \"percentage error when error in both (PS) and (Q) is positive (%) = \",erpsq\n",
+ "print \"error in ohms when error in both (PS) and (Q) is positive (ohms) = \",oer1\n",
+ "print \"percentage error when error in (PS) is positive and (Q) is negative (%) = \",erpsq1\n",
+ "print \"error in ohms when error in (PS) is positive and (Q) is negative (ohms) = \",oer2\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
+}
diff --git a/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter2.ipynb b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter2.ipynb
new file mode 100755
index 00000000..27e9fedf
--- /dev/null
+++ b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter2.ipynb
@@ -0,0 +1,2381 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2 - Analog measurement of electrical quantities"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "for Ist method\n",
+ "wattmeter reading is (W)= 804.0\n",
+ "percentage error is high (%) = 0.5\n",
+ "for 2nd method\n",
+ "wattmeter reading (W)= 802.5\n",
+ "percentage error is high (%) = 0.3125\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 130\n",
+ "#Example 2.1:#wattmeter reading and error\n",
+ "#calculate the wattmeter reading\n",
+ "import math,cmath\n",
+ "#given\n",
+ "print \"for Ist method\"\n",
+ "v=50;#volts\n",
+ "i=20;#amperes\n",
+ "pf=0.8;#power factor\n",
+ "pl=v*i*pf;#true power\n",
+ "vc=(50*pf)+1j*v*math.sqrt(1-pf**2);#complex form \n",
+ "ic=i+1j*0;#\n",
+ "r1=0.01;#ohms\n",
+ "#calculations and results\n",
+ "vpl=vc+(i*r1);#voltage across pressure coil\n",
+ "wrlc1=(vpl.real)*(ic.real);#\n",
+ "er=(wrlc1-pl)/(pl);#\n",
+ "print \"wattmeter reading is (W)=\",wrlc1\n",
+ "print \"percentage error is high (%) = \",er*100\n",
+ "print \"for 2nd method\"\n",
+ "r2=1000;#ohms\n",
+ "ic1=ic+(vc/r2);#\n",
+ "wrlc2=(vc.real)*(ic1.real)+(vc.imag)*(ic1.imag);#\n",
+ "er1=(wrlc2-pl)/(pl);#\n",
+ "print \"wattmeter reading (W)=\",wrlc2\n",
+ "print \"percentage error is high (%) = \",er1*100\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "self inductance (mH) = 2.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 131\n",
+ "#Example 2.2:#self inductance\n",
+ "#calculate the self inductance\n",
+ "#given\n",
+ "c=20.;#pF\n",
+ "rs=10000.;#ohms\n",
+ "#calculations\n",
+ "l=(c*10**-12)*rs**2;#henry\n",
+ "#results\n",
+ "print \"self inductance (mH) = \",l*10**3\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error is (%) = 0.39\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 131\n",
+ "#Example 2.3:#percentage error\n",
+ "#calculate the percentage error\n",
+ "#given\n",
+ "import math\n",
+ "v=100;#volts\n",
+ "i=10;#amperes\n",
+ "pf=0.45;#power factor\n",
+ "f=50;#Hz\n",
+ "l=25;#mH\n",
+ "r=4000;#ohms\n",
+ "#calculations\n",
+ "tp=v*i*pf;#true power in watts\n",
+ "b=math.atan((2*math.pi*f*l*10**-3)/r);#phase angle in radians\n",
+ "e=v*i*math.tan(b)*math.sqrt(1-pf**2);#\n",
+ "per=(e*100)/(tp);#\n",
+ "#results\n",
+ "print \"percentage error is (%) = \",round(per,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "true power in (kW) = 851.3\n",
+ "answer is wrong in the textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 131\n",
+ "#Example 2.4:#true power\n",
+ "#calculate the true power\n",
+ "#given\n",
+ "import math\n",
+ "from math import cos\n",
+ "ph=45.;#degree\n",
+ "th=90.;#radians\n",
+ "dela=-45.;#radians\n",
+ "f=50.;#Hz\n",
+ "l=15.;#mH\n",
+ "r=300.;#ohms\n",
+ "#calculations\n",
+ "b=math.atan((2*math.pi*f*l*10**-3)/r);#in radians\n",
+ "k=((cos(ph/57.3))/(cos(b)*cos(42/57.3)));#\n",
+ "nr=20;#nomianl ratio\n",
+ "e=-0.3;#\n",
+ "er=(e*nr)/100;#\n",
+ "ar1=nr-er;#actual ratio\n",
+ "nr1=100;#nomianl ratio\n",
+ "e1=0.9;#\n",
+ "er1=(e1*nr1)/100;#\n",
+ "ar2=nr1-er1;#actual ratio\n",
+ "p=450;#watts\n",
+ "tp=ar1*ar2*k*p;#\n",
+ "#results\n",
+ "print \"true power in (kW) = \",round(tp*10**-3,1)\n",
+ "print 'answer is wrong in the textbook'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "torque in Nm when angle is 45 degree (Nm) = 6.68e-06\n",
+ "torque in Nm when angle is 90 degree (Nm) = 9.45e-06\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 132\n",
+ "#Example 2.5:#torque\n",
+ "#calculate the torque required\n",
+ "#given\n",
+ "import math\n",
+ "from math import sin\n",
+ "d=2.5;#diameter in cm\n",
+ "n=500;#turns\n",
+ "b=1.1;#mWb/m**2\n",
+ "v=100;#volts\n",
+ "pf=0.7;#power factor\n",
+ "rp=2000;#ohms\n",
+ "#calculations\n",
+ "x=((math.pi*(d*10**-2)**2*n*b*10**-3*v*pf)/(4*rp));#\n",
+ "ang1=45;#degree\n",
+ "ang2=90;#degree\n",
+ "td1=x*sin(ang1/57.3);#\n",
+ "td2=x*sin(ang2/57.3);#\n",
+ "#results\n",
+ "print \"torque in Nm when angle is 45 degree (Nm) = \",round(td1,8)\n",
+ "print \"torque in Nm when angle is 90 degree (Nm) = \",round(td2,8)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance is (ohm)= 2784.0\n",
+ "answer is wrong in the textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 133\n",
+ "#Example 2.6:#resistance\n",
+ "#calculate the resistance\n",
+ "#given\n",
+ "import math\n",
+ "la=4.78;#henry\n",
+ "ra=298.;#ohms\n",
+ "lb=3.;#henry\n",
+ "rb=190.;#ohms\n",
+ "v=200.;#volts\n",
+ "#calculations\n",
+ "r=((la*100*lb*100*math.pi**2)-(ra*rb))/(rb+ra);#ohm\n",
+ "#results\n",
+ "print \"unknown resistance is (ohm)=\",round(r,0)\n",
+ "print 'answer is wrong in the textbook'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "addition resistance (ohm) = 2750.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 133\n",
+ "#Example 2.7:#resistance\n",
+ "#calculate the addition in resistance\n",
+ "#given\n",
+ "i=20.;#amperes\n",
+ "v=100.;#volts\n",
+ "pf=1;#power factor\n",
+ "rp=5500.;#ohms\n",
+ "th=150.;#angle\n",
+ "wd=20;#watts per degree\n",
+ "#calculations\n",
+ "p=v*i*pf;#watts\n",
+ "kd=((rp*th)/p);#constant\n",
+ "rp1=wd*kd;#in ohms\n",
+ "adr=rp1-rp;#\n",
+ "#results\n",
+ "print \"addition resistance (ohm) = \",adr\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance in (ohm) = 120.0\n",
+ "load impedance in (ohm) = 75.0\n",
+ "impedance of combination in (ohm) = 53.57\n",
+ "power absorbed by the load in (W) = 546.6\n",
+ "power factor of the load = 0.4555\n",
+ "total power supply is (W) = 1296.6\n",
+ "total power factor = 0.772\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 134\n",
+ "#Example 2.8:#resistance,impedance,power,power factor ,voltage and power factor\n",
+ "#calculate the total power factor,supply, impedance and resistance\n",
+ "#given\n",
+ "v=300.;#volts\n",
+ "i2=2.5;#amperes\n",
+ "#calculations and results\n",
+ "r=v/i2;#ohms\n",
+ "print \"resistance in (ohm) =\",r\n",
+ "i3=4;#amperes\n",
+ "zl=v/i3;#ohms\n",
+ "print \"load impedance in (ohm) = \",zl\n",
+ "v=300;#volts\n",
+ "i2=2.5;#amperes\n",
+ "r=v/i2;#ohms\n",
+ "i1=5.6;#amperes\n",
+ "z=v/i1;#ohms\n",
+ "print \"impedance of combination in (ohm) = \",round(z,2)\n",
+ "i3=4;#amperes\n",
+ "pl=((i1**2-i2**2-i3**2)*r)/2;#in watts\n",
+ "print \"power absorbed by the load in (W) = \",pl\n",
+ "pl=((i1**2-i2**2-i3**2)*r)/2;#in watts\n",
+ "pfl=((i1**2-i2**2-i3**2)/(2*i2*i3));#power factor\n",
+ "print \"power factor of the load = \",pfl\n",
+ "pr=i2**2*r;#in watts\n",
+ "tps=pl+pr;#in watts\n",
+ "print \"total power supply is (W) = \",tps\n",
+ "tps=pl+pr;#in watts\n",
+ "tpf=tps/(v*i1);#power factor\n",
+ "print \"total power factor = \",round(tpf,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 - pg 135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "average power to be read by wattmeter is (W) = 127.32\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 135\n",
+ "#Example 2.9:#wattmeter reading\n",
+ "#calculate the average power\n",
+ "import math,scipy\n",
+ "from scipy import integrate\n",
+ "v=24.;#volts\n",
+ "r1=6.;#ohms\n",
+ "vm=100;#volts\n",
+ "t0=0.;#\n",
+ "t1=(1./100);#\n",
+ "f=50.;#Hz\n",
+ "#calculations\n",
+ "i=v/r1;#in amperes\n",
+ "z=2*math.pi*f;#\n",
+ "def fun(t):\n",
+ "\ty=math.sin(z*t)\n",
+ "\treturn y\n",
+ "x=scipy.integrate.quad(fun,t0,(t1/2.));#\n",
+ "p=vm*(1/t1)*i*x[0];#\n",
+ "#results\n",
+ "print \"average power to be read by wattmeter is (W) = \",round(p,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "load impedance in (ohm) = 20.0\n",
+ "impedance of combination in (ohm) = 35.0\n",
+ "power absorbed by the load is,(W) = 202.0\n",
+ "power absorbed by the non inductive resistor is,(W) = 300.0\n",
+ "power factor of load is 0.63\n",
+ "power factor of the whole circuit is 0.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 136\n",
+ "#Example 2.10:#load impedance and combination impedance\n",
+ "#calculate the power factor and power, load\n",
+ "#given\n",
+ "v3=80.;#volts\n",
+ "i=4.;#amperes\n",
+ "v1=140;#volts\n",
+ "#calculations and results\n",
+ "zl=v3/i;#ohms\n",
+ "z=v1/i;#ohms\n",
+ "print \"load impedance in (ohm) = \",zl\n",
+ "print \"impedance of combination in (ohm) = \",z\n",
+ "v2=75.;#volts (it is given 72 in the textbook)\n",
+ "r=v2/i;#\n",
+ "pl=((v1**2-v2**2-v3**2)/(2*r));#watts\n",
+ "pr=i**2*r;#watts\n",
+ "print \"power absorbed by the load is,(W) = \",pl\n",
+ "print \"power absorbed by the non inductive resistor is,(W) = \",pr\n",
+ "pfl=((v1**2-v2**2-v3**2)/(2*v2*v3));#power factor of the load\n",
+ "tp=pr+pl;#total power in watts\n",
+ "pfc=tp/(v1*i);#power factor\n",
+ "print \"power factor of load is\",round(pfl,2)\n",
+ "print \"power factor of the whole circuit is\",round(pfc,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "wattmeter (W1) reading in (kW) = 85.0\n",
+ "wattmeter (W2) reading in (kW) = 215.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 136\n",
+ "#Example 2.11:#wattmeters readings\n",
+ "#calculate the wattmeters readings\n",
+ "import math\n",
+ "from math import sqrt\n",
+ "#given\n",
+ "pf=0.8;#\n",
+ "#calculations\n",
+ "td=(sqrt(1-pf**2))/pf;#\n",
+ "sr=300;#kW\n",
+ "df=(sr/sqrt(3))*td;#\n",
+ "w2=(sr+df)/2;#\n",
+ "w1=sr-w2;#\n",
+ "#results\n",
+ "print \"wattmeter (W1) reading in (kW) = \",round(w1)\n",
+ "print \"wattmeter (W2) reading in (kW) = \",round(w2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 - pg 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "power factor of the system = 0.189\n",
+ "capacitance (micro-F) = 322.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 137\n",
+ "#Example 2.12:#power factor and capacitance\n",
+ "#calculate the capacitance and power factor\n",
+ "import math\n",
+ "from math import atan,sqrt,cos\n",
+ "#given\n",
+ "w1=-2000.;#watts\n",
+ "w2=4000.;#watts\n",
+ "v=400.;#volts\n",
+ "pfn=0.5;#power factor\n",
+ "f=50.;#Hz\n",
+ "#calculations\n",
+ "ph=math.atan((sqrt(3.)*(w2-w1))/(w2+w1)) *57.3;#in degree\n",
+ "pf=cos(ph/57.3);#\n",
+ "w=w1+w2;#total power\n",
+ "vp=(v/sqrt(3));#phase voltage\n",
+ "pp=w/3.;#power per phase\n",
+ "pi=(pp)/(vp*pf);#phase current\n",
+ "pim=vp/pi;#phase impedance\n",
+ "rip=pim*pf;#resistance each phase\n",
+ "rep=(sqrt(pim**2-rip**2));#reactance of each phase\n",
+ "pimb=rip/pfn;#impedance per phase\n",
+ "repn=(sqrt(pimb**2-rip**2));#reactance per phase\n",
+ "cp=rep-repn;#capacitive reactance\n",
+ "c=((1/(2*math.pi*f*cp)));#\n",
+ "#results\n",
+ "print \"power factor of the system = \",round(pf,3)\n",
+ "print \"capacitance (micro-F) = \",round(c*10**6)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 - pg 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "power factor = 0.866\n",
+ "line current is (A)= 83.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 138\n",
+ "#Example 2.13:#power factor and line current\n",
+ "#calculate the line current and power factor\n",
+ "#given\n",
+ "import math\n",
+ "x=1;#\n",
+ "w=50;#kW\n",
+ "v=400.;#volts\n",
+ "#calculations\n",
+ "w2=2*x;#\n",
+ "w1=x;#\n",
+ "ph=math.atan((math.sqrt(3)*(w2-w1))/(w2+w1))*57.3;#in degree\n",
+ "pf=math.cos(ph/57.3);#power factor\n",
+ "il=((w/(math.sqrt(3)*v*pf)))*10**3;#in amperes\n",
+ "#results\n",
+ "print \"power factor = \",round(pf,3)\n",
+ "print \"line current is (A)=\",round(il,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 - pg 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "when both readings are positive\n",
+ "power is (W) = 6900.0\n",
+ "power factor (leading) = 0.866\n",
+ "when second readig is negative\n",
+ "power is (W) = 2300.0\n",
+ "power factor (leading) = 0.189\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 138\n",
+ "#Example 2.14:#total power and power factor\n",
+ "#calculate the total power and power factor\n",
+ "#given\n",
+ "import math\n",
+ "print \"when both readings are positive\"\n",
+ "w2=2300.;#watts\n",
+ "w1=4600.;#watts\n",
+ "#calculations and results\n",
+ "p1=w2+w1;#\n",
+ "ph=57.3*math.atan((math.sqrt(3)*(w2-w1))/(w2+w1));#in degree\n",
+ "pf=math.cos(ph/57.3);#power factor\n",
+ "print \"power is (W) = \",p1\n",
+ "print \"power factor (leading) = \",round(pf,3)\n",
+ "print \"when second readig is negative\"\n",
+ "w21=-2300.;#watts\n",
+ "w1=4600.;#watts\n",
+ "p2=w21+w1;#\n",
+ "ph2=57.3*math.atan((math.sqrt(3)*(w21-w1))/(w21+w1));#in degree\n",
+ "pf1=math.cos(ph2/57.3);#power factor\n",
+ "print \"power is (W) = \",p2\n",
+ "print \"power factor (leading) = \",round(pf1,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 - pg 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "load current in amperes = 5.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 139\n",
+ "#Example 2.15:#load current\n",
+ "#calculate the load current\n",
+ "#given\n",
+ "import math\n",
+ "from math import atan,cos,sqrt\n",
+ "rw=3550.;#reading of wattmeter\n",
+ "rp=806.;#watts\n",
+ "#calculations\n",
+ "ph=atan((sqrt(3)*rp)/rw);#in degree\n",
+ "pf=cos(ph/57.3);#power factor\n",
+ "v=440;#volts\n",
+ "i=((rw)/(sqrt(3)*v*pf));#amperes\n",
+ "#results\n",
+ "print \"load current in amperes = \",round(i)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 16 - pg 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "error (slow) in percentage = 9.1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 139\n",
+ "#Example 2.16:#error\n",
+ "#calculate the error percentage\n",
+ "#given\n",
+ "import math\n",
+ "from math import sin\n",
+ "d=87./57.3;#radians\n",
+ "pf=0.5;#\n",
+ "#calculations\n",
+ "n=(1./4)*sin(d-60/57.3);#\n",
+ "nc=(1./4)*pf*sin(d);#\n",
+ "e=((n-nc)/nc)*100;#error\n",
+ "#results\n",
+ "print \"error (slow) in percentage = \",round(-e,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 17 - pg 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "error (%) = 1.82\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 140\n",
+ "#Example 2.17:#error\n",
+ "#calculate the error\n",
+ "#given\n",
+ "import math,scipy\n",
+ "from scipy import integrate \n",
+ "i=5;#amperes\n",
+ "t0=0;#\n",
+ "t1=30./60;#\n",
+ "e=0.56;#kWh\n",
+ "v1=220;#volts\n",
+ "#calculations\n",
+ "def function(t):\n",
+ "\ty=5\n",
+ "\treturn y\n",
+ "x=scipy.integrate.quad(function,t0,t1);#\n",
+ "v=(e*10**3)/x[0];#volts\n",
+ "ae=v1*i*t1*10**-3;#actual energy\n",
+ "e=((e-ae)/ae)*100;#error\n",
+ "#results\n",
+ "print \"error (%) = \",round(e,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18 - pg 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "time duration (seconds) = 367.0\n",
+ "limits of accuracy (%) = 0.73\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 140\n",
+ "#Example 2.18:#time and error\n",
+ "#calculate the time duration and limits of accuracy\n",
+ "#given\n",
+ "nd=500.;#dvisions\n",
+ "cr=0.1;#dvisions can read\n",
+ "ie=0.05;#inherent error\n",
+ "tea=0.1;#total error allowable\n",
+ "cr1=0.01;#seconds\n",
+ "cr2=0.1;#seconds\n",
+ "nd1=500/10.;#\n",
+ "#calculations\n",
+ "re=(cr/nd)*100;#reading error\n",
+ "te=re+ie;#total error\n",
+ "per=tea-te;#permissible error\n",
+ "ersw=cr1*100;#error in reading stop watch\n",
+ "erss=cr2*100;#error in stopping and starting\n",
+ "ter=ersw+erss;#total error\n",
+ "t=per/ter;#seconds\n",
+ "er1=(cr/nd1)*100;#new reading error\n",
+ "ie1=((ie*nd)/nd1);#new inherent error\n",
+ "ter1=er1+ie1;#\n",
+ "la=ter1+per;#\n",
+ "#results\n",
+ "print \"time duration (seconds) = \",round(1./t)\n",
+ "print \"limits of accuracy (%) = \",la\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19 - pg 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "error (slow) is (%) 1.66\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 141\n",
+ "#Example 2.19:#error\n",
+ "#calculate the error\n",
+ "#given\n",
+ "import math\n",
+ "n=40.;#revolutions\n",
+ "rc=0.12;#registration constant\n",
+ "e2=22000;#volts\n",
+ "e1=110;#volts\n",
+ "i2=500;#amperes\n",
+ "i1=5;#amperes\n",
+ "i=5.25;#amperes\n",
+ "lv=110;#volts\n",
+ "pf=1;#\n",
+ "t=61;#seconds\n",
+ "#calculations\n",
+ "err=n/rc;#energy recorded in kWh is\n",
+ "ae=((math.sqrt(3)*e2*lv*i*i2*pf*t)/(e1*i1*3600))*10**-3;#kWh\n",
+ "e=((err-ae)/ae)*100;#\n",
+ "#results\n",
+ "print \"error (slow) is (%)\",round(-e,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 20 - pg 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "error (fast) in recording (%) = 0.2\n",
+ "limit of error in the meter is 0.07 % or 0.33 % \n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 142\n",
+ "#Example 2.20:#error and limit of error\n",
+ "#calculate the error and limit of error\n",
+ "#given\n",
+ "mc=1200.;#meter constant in rev/kWh\n",
+ "n=40.;#revolutions\n",
+ "tp=99.8;#seconds\n",
+ "v=240;#volts\n",
+ "i=5;#amperes\n",
+ "#calculations\n",
+ "err=n/mc;#energy recorded in kWh\n",
+ "ae=((v*i*tp*10**-3)/3600);#actual energy in kWh\n",
+ "e=((err-ae)/ae)*100;#error\n",
+ "n=500;#divisions\n",
+ "rn=0.1;#dvision reading accuracy\n",
+ "per=((rn/n)*100);#possible error\n",
+ "ie=0.05;#inherent error\n",
+ "per1=(((rn/10)/tp)*100);#possible error\n",
+ "her=((ie/tp)*100);#human error\n",
+ "tpr=per+per1+her+ie;#total possible error\n",
+ "li1=e-tpr;#\n",
+ "li2=e+tpr;#\n",
+ "#results\n",
+ "print \"error (fast) in recording (%) = \",round(e,2)\n",
+ "print \"limit of error in the meter is \",round(li1,2),\"% or \",round(li2,2),\"% \"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 21 - pg 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "total monthly bill in Rs 19295.0\n",
+ "power factor is 0.78\n",
+ "load factor is 0.96\n",
+ "average cost per unit (kWh) in paisa is 15.4\n",
+ "total monthly bill and load factor is calculated wrong in the book due to rounding off error\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 143\n",
+ "#Example 2.21:#consumer monthly bill ,power factor and average cost per unit\n",
+ "#calculate the consumer monthly bill ,power factor and average cost per unit\n",
+ "#given\n",
+ "import math\n",
+ "from math import sqrt\n",
+ "kwh=125000.;#\n",
+ "kvarh=100000.;#\n",
+ "kw=180;#\n",
+ "kvar=125;#\n",
+ "d=30.;#days\n",
+ "t=24.;#hours a day\n",
+ "#calculations\n",
+ "kvah=sqrt(kwh**2+kvarh**2);#kVAh\n",
+ "mkva=sqrt(kw**2+kvar**2);#kVA\n",
+ "pkva=15;#rupees\n",
+ "pkvah=0.1;#reupees\n",
+ "tmb=pkva*mkva+pkvah*kvah;#in Rs\n",
+ "pf=kwh/kvah;#power factor\n",
+ "lf=((kwh/(d*t))/kw);#load factor\n",
+ "avcp=tmb/kwh;#in paisa\n",
+ "#results\n",
+ "print \"total monthly bill in Rs\",round(tmb)\n",
+ "print \"power factor is\",round(pf,2)\n",
+ "print \"load factor is\",round(lf,2)\n",
+ "print \"average cost per unit (kWh) in paisa is\",round(avcp*100,1)\n",
+ "print 'total monthly bill and load factor is calculated wrong in the book due to rounding off error'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 22 - pg 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of revolution per kWh is,(revolutions/kWh)= 3273.0\n",
+ "full load speed r.p.s = 1.0\n",
+ "error (fast) in percentage = 0.84\n",
+ "numberof revolutions is calcultaed wrong in the textbook due to rounding off error\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 143\n",
+ "#Example 2.22:#full load speed and error\n",
+ "#calculate the full load speed and error\n",
+ "#given\n",
+ "v=220.;#volts\n",
+ "n=30.;#revolutions\n",
+ "i=5.;#in amperes\n",
+ "t=59.5;#seconds\n",
+ "#calculations\n",
+ "wrv=((v*i*10**-3)/(3600.));#kWh\n",
+ "mc=((3600.*10**3)/(v*i));#rev/kWh\n",
+ "ec=((v*i*10**-3)/(3600.));#kWh\n",
+ "sfl=mc*ec;#rps\n",
+ "hler=n*ec;#kWh\n",
+ "hlf=(((i/2.)*v*10**-3*t)/(3600.));#kWh\n",
+ "e=(hler-hlf)/hlf;#\n",
+ "#results\n",
+ "print \"number of revolution per kWh is,(revolutions/kWh)=\",round(mc)\n",
+ "print \"full load speed r.p.s = \",sfl\n",
+ "print \"error (fast) in percentage = \",round(e*100,2)\n",
+ "print 'numberof revolutions is calcultaed wrong in the textbook due to rounding off error'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 23 - pg 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "shunt resistance when current is 10mA (ohm) = 52.63\n",
+ "shunt resistance when current is 75mA (ohm) = 6.71\n",
+ "shunt resistance when current is 100mA (ohm) = 2.004\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 144\n",
+ "#Example 2.23:#shunt resistance \n",
+ "#calculate the shunt resistance \n",
+ "#given\n",
+ "ra=1000.;#armature resistance in ohms\n",
+ "i=10.;#mA\n",
+ "ia=500.;#micro amperes\n",
+ "i1=75;#mA\n",
+ "i3=100;#mA\n",
+ "#calculations\n",
+ "rsh1=((ra)/((i/(ia*10**-3))-1));#in ohms\n",
+ "rsh2=((ra)/((i1/(ia*10**-3))-1));#in ohms\n",
+ "ia3=0.4*ia;#micro amperes\n",
+ "rsh3=((ra)/((i3/(ia3*10**-3))-1));#in ohms\n",
+ "#results\n",
+ "print \"shunt resistance when current is 10mA (ohm) = \",round(rsh1,2)\n",
+ "print \"shunt resistance when current is 75mA (ohm) = \",round(rsh2,2)\n",
+ "print \"shunt resistance when current is 100mA (ohm) = \",round(rsh3,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 24 - pg 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "shunt resistance in milli ohm is 0.60012\n",
+ "power consumption in shunt is,(W)= 9.37\n",
+ "series resistance in kilo ohm is 24.997\n",
+ "power consumption in the series resistance is,(W)= 15.623\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 144\n",
+ "#Example 2.24:#shunt resistance and series resistance\n",
+ "#calculate the shunt resistance and series resistance\n",
+ "#given\n",
+ "i=125.;#amperes\n",
+ "ia=25.;#armature current in mA\n",
+ "ra=3;#ohms\n",
+ "#calculations\n",
+ "ish=i-(ia*10**-3);#amperes\n",
+ "rsh=((ia*ra)/ish);#milli ohms\n",
+ "pcs=ish**2*rsh*10**-3;#watts\n",
+ "rv=625;#volts\n",
+ "rs=((rv-(ra*ia*10**-3))/(ia*10**-3))*10**-3;#killo ohms\n",
+ "pc=(ia*10**-3)**2*rs*10**3;#watts\n",
+ "#results\n",
+ "print \"shunt resistance in milli ohm is\",round(rsh,5)\n",
+ "print \"power consumption in shunt is,(W)=\",round(pcs,2)\n",
+ "print \"series resistance in kilo ohm is\",rs\n",
+ "print \"power consumption in the series resistance is,(W)=\",round(pc,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 25 - pg 145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "when micro meter resistance is 25 ohm\n",
+ "multiplying power for the shunt for a 1250 ohm is 4.02\n",
+ "multiplying power for the shunt for a 2500 ohm is 2.01\n",
+ "when micro meter resistance is 2500 ohm\n",
+ "multiplying power for the shunt for a 1250 ohm is 6.0\n",
+ "multiplying power for the shunt for a 2500 ohm is 3.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 145\n",
+ "#Example 2.25:#mulitplying power\n",
+ "#calculate the mulitplying power in all cases\n",
+ "print \"when micro meter resistance is 25 ohm\"\n",
+ "#given\n",
+ "ra=25.;#ohms\n",
+ "rsh=5000.;#ohms\n",
+ "r1=1250.;#ohms\n",
+ "r2=2500;#ohms\n",
+ "#calculations and results\n",
+ "n=((ra+rsh)/r1);#\n",
+ "n2=((ra+rsh)/r2);#\n",
+ "print \"multiplying power for the shunt for a 1250 ohm is\",n\n",
+ "print \"multiplying power for the shunt for a 2500 ohm is\",n2\n",
+ "print \"when micro meter resistance is 2500 ohm\"\n",
+ "ra1=2500.;#ohms\n",
+ "rsh=5000.;#ohms\n",
+ "r1=1250.;#ohms\n",
+ "n1=((ra1+rsh)/r1);#\n",
+ "r2=2500.;#ohms\n",
+ "n3=((ra1+rsh)/r2);#\n",
+ "print \"multiplying power for the shunt for a 1250 ohm is\",n1\n",
+ "print \"multiplying power for the shunt for a 2500 ohm is\",n3\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 26 - pg 145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "voltage is,(V)= 487.0\n",
+ "resistance is ,(k-ohm)= 27.0\n",
+ "resistance is calculated wrong in the textbook due to rounding off error\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 145\n",
+ "#Example 2.26:#resistance\n",
+ "#calculate the resistance\n",
+ "r1=185.;#ohm\n",
+ "r2=205.;#ohm\n",
+ "r3=215.;#ohm\n",
+ "R31=195.;#OHM\n",
+ "r4=200.;#ohm\n",
+ "r5=1100.;#ohm\n",
+ "v1=85.;#V\n",
+ "#calculations\n",
+ "R=r1+r2+r3+r4+R31;#ohm\n",
+ "R1=(R-r4)+((r5*r4)/(r5+r4));#\n",
+ "V=(v1*R1)/round(R1-(R-r4));#V\n",
+ "I=round(V)/R;#A\n",
+ "vd4=I*r4;#V\n",
+ "x=0.5;#% allowable\n",
+ "vd41=(vd4)-(vd4*x)/100;#\n",
+ "rv=((vd41*(R-r4)*r4))/((V*r4)-((R*vd41)));#\n",
+ "#results\n",
+ "print \"voltage is,(V)=\",round(V)\n",
+ "print \"resistance is ,(k-ohm)=\",round(rv*10**-3)\n",
+ "print 'resistance is calculated wrong in the textbook due to rounding off error'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 27 - pg 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a). The sensitivity of an instrument,S1 = 0.0099\n",
+ "(b). The resistance,R(ohm) = 200.0\n",
+ "The relative sensitivity,S = 0.012\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 146\n",
+ "#Example 2.27: Sensitivity\n",
+ "#calculate the sensitivity and resistance, relative sensitivity\n",
+ "#given data :\n",
+ "I1=0.1;# in mA\n",
+ "R1=50.;# in ohm\n",
+ "I2=10.;# in mA\n",
+ "I3=10.1;# in mA\n",
+ "I5=10;# in mA\n",
+ "V=2;# in Volt\n",
+ "#calculations\n",
+ "I4=I2-I1;\n",
+ "Rsh=I1*R1/(I3-I1);\n",
+ "Im1=Rsh*I4/(R1+Rsh);\n",
+ "S1=(I1-Im1)/(I3-I4);\n",
+ "R=V/(I5*10**-3);\n",
+ "# formula : Im=((I3-Im)*(R-V))/R1;\n",
+ "Im2=(0.8*I3)-8;\n",
+ "Im3=(0.8*I4)-8\n",
+ "S2=(Im2-Im3)/(I3-I4);\n",
+ "S=S1/S2;\n",
+ "#results\n",
+ "print \"(a). The sensitivity of an instrument,S1 = \",round(S1,4)\n",
+ "print \"(b). The resistance,R(ohm) = \",R\n",
+ "print \"The relative sensitivity,S = \",round(S,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 28 - pg 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Shunt resistance,Rs(ohm) = 0.01\n",
+ "Inductance,Ls(micro-H) = 10.0\n",
+ "Current,Ia1(A) = 4.81\n",
+ "Error,(%)(low) = 3.8\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 147\n",
+ "#Example 2.28: Error\n",
+ "#calculate the Error, shunt resistance and inductance\n",
+ "#given data :\n",
+ "import math\n",
+ "from math import sqrt\n",
+ "La=90*10**-6;# in micro-H\n",
+ "Ra=0.09;# in ohm\n",
+ "I=50;# in A\n",
+ "Ia=5;# in A\n",
+ "f=50;# in Hz\n",
+ "#calculations\n",
+ "LsbyRs=La/Ra;\n",
+ "w=2*math.pi*f;\n",
+ "Rs=Ra/9;\n",
+ "Ls=LsbyRs*Rs*10**6;\n",
+ "Ls1=0;# shunt is non-inductive \n",
+ "Ia1=(Rs*I)/sqrt((Ra+Rs)**2+(w**2*La**2));\n",
+ "Error=((Ia-Ia1)/Ia)*100;\n",
+ "#results\n",
+ "print \"Shunt resistance,Rs(ohm) = \",Rs\n",
+ "print \"Inductance,Ls(micro-H) = \",Ls\n",
+ "print \"Current,Ia1(A) = \",round(Ia1,2)\n",
+ "print \"Error,(%)(low) = \",round(Error,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 29 - pg 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "area is (cm^2)= 188.0\n",
+ "error is (%)= 8.11\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 148\n",
+ "#Example 2.29 :area and percentage error\n",
+ "#calculate the area and error\n",
+ "#given data \n",
+ "import math\n",
+ "from math import sqrt\n",
+ "v1=18.;#kV\n",
+ "c1=60.;#pF\n",
+ "v2=2.;#\n",
+ "d=2.5;#cm\n",
+ "#calculations\n",
+ "q=v2*10**3*c1*10**-12;#\n",
+ "cs=q/(v1*10**3);#F\n",
+ "eo=8.854*10**-12;#\n",
+ "a=((cs*d*10**-2)/(eo));#\n",
+ "c2=50;#pf\n",
+ "x=c1-c2;#\n",
+ "stf=((v2*10**3)**2*x*10**-12);#\n",
+ "v=sqrt(stf/(x*10**-12*2))/1000;#kV\n",
+ "c3=c2+(x/2);#pf\n",
+ "x1=c3/(cs*10**12);#\n",
+ "V1=(x1+1)*v#\n",
+ "V=10*sqrt(2);#V\n",
+ "er=((V-V1)/V1)*100;#\n",
+ "#results\n",
+ "print \"area is (cm^2)=\",round(a*10**4)\n",
+ "print \"error is (%)=\",round(er,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 30 - pg 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The percentage error in case 1 (%) = -15.25\n",
+ "The percentage error in case 2 (%) = -0.688\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 150\n",
+ "#Example 2.30: % Error\n",
+ "#calculate the percentage error \n",
+ "#given data :\n",
+ "Ra=2.;# in ohm\n",
+ "Rsh=0.0004;# constant\n",
+ "alfa=0.004;\n",
+ "t1=288.;# in K\n",
+ "t2=333.;# in K\n",
+ "I=100.;# in A\n",
+ "Rs=50.;# in ohm\n",
+ "#calculations\n",
+ "theta=t2-t1;\n",
+ "Ra1=Ra+(alfa*Ra*theta);\n",
+ "N1=1+(Ra/Rsh);\n",
+ "Ia=I/N1;\n",
+ "N2=1+(Ra1/Rsh);\n",
+ "Ia1=I/N2;\n",
+ "epsilon1=(Ia1-Ia)*100/Ia;\n",
+ "N3=1+((Ra+Rs)/Rsh);\n",
+ "Ia2=I*10**3/N3;\n",
+ "N4=1+((Ra1+Rs)/Rsh);\n",
+ "Ia3=I*10**3/N4;\n",
+ "epsilon2=(Ia3-Ia2)*100/Ia2;\n",
+ "#results\n",
+ "print \"The percentage error in case 1 (%) = \",round(epsilon1,2)\n",
+ "print \"The percentage error in case 2 (%) = \",round(epsilon2,3)\n",
+ "print 'The answers are a bit different due to rounding off error in textbook'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 31 - pg 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "electromotive force is (mV)= 24.632\n",
+ "resistance is (ohm)= 105.263\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 151\n",
+ "#Example 2.31: Resistance and electromotive force\n",
+ "#calculate the electromotive force and resistance\n",
+ "#given data :\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "i1=20.;# in mA\n",
+ "i2=400.;# in mA\n",
+ "v1=19.5;# in mV\n",
+ "v2=23.4;# in mV\n",
+ "y=100;#mV\n",
+ "#calculations\n",
+ "i3=i1/i2;\n",
+ "K1=i1/i3;\n",
+ "x1=v1/K1;#\n",
+ "k2=y/i3;#\n",
+ "x2=v2/k2;#\n",
+ "A=numpy.matrix([[1, -x1],[1, -x2]]);\n",
+ "B=numpy.matrix([[v1],[v2]]);#\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);#\n",
+ "#results\n",
+ "print \"electromotive force is (mV)=\",round(X[0,0],3)\n",
+ "print \"resistance is (ohm)=\",round(X[1,0],3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 32 - pg 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Error (%) = 1.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 151\n",
+ "#Example 2.32: error\n",
+ "#calculate the error\n",
+ "#given data :\n",
+ "import math\n",
+ "V=20*10**3;# in V\n",
+ "v1=2*10**3;# in V\n",
+ "R=10*10**3;# in ohm\n",
+ "f=50.;# in Hz\n",
+ "#calculations\n",
+ "r=R*v1/V;\n",
+ "w=2*math.pi*f;\n",
+ "C=0.60*10**-6;# in F\n",
+ "v=V/((R/r)*math.sqrt(1+((w**2*C**2*r**2*(R-r)**2)/R**2)));\n",
+ "Error=((v1-v)/v1)*100;\n",
+ "#results\n",
+ "print \"Error (%) = \",round(Error,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 33 - pg 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(i). Flux in the core (mWb) = 0.591\n",
+ "(ii). The actual ratio K = 161.04\n",
+ "(iii). The phase angle (degree) = 0.215\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 152\n",
+ "#Example 2.33: Flux, actual ratio and phase angle\n",
+ "#calculate the Flux, actual ratio and phase angle\n",
+ "#given data :\n",
+ "import math\n",
+ "from math import sin,cos\n",
+ "I=5.;# in A\n",
+ "r1=4.;# in ohm\n",
+ "r2=0.2;# in ohm\n",
+ "Ts=160;# in turns\n",
+ "F=50;# in Hz\n",
+ "I0=6;# in A\n",
+ "theta1=30/57.3;# in radians\n",
+ "#calculations\n",
+ "Es=I*(r1+r2);\n",
+ "fi=Es*10**3/(4.44*Ts*F);\n",
+ "Ie=I0*cos(theta1);# in A\n",
+ "Im=I0*sin(theta1);# in A\n",
+ "dela=0;\n",
+ "K=Ts+(((Ie*cos(dela))+(Im*sin(dela)))/I);\n",
+ "theta=(180/math.pi)*(((Im*cos(dela))-(Ie*sin(dela)))/(Ts*I));\n",
+ "#results\n",
+ "print \"(i). Flux in the core (mWb) = \",round(fi,3)\n",
+ "print \"(ii). The actual ratio K = \",round(K,2)\n",
+ "print \"(iii). The phase angle (degree) = \",round(theta,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 34 - pg 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a). The ratio error (%) = -0.0436\n",
+ "(b). phase angle is 0.0 degree 3.438 minutes \n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 152\n",
+ "#Example 2.34: The ratio errror and phase angle error\n",
+ "#calculate the ratio error and phase angle\n",
+ "#given data :\n",
+ "import math\n",
+ "from math import sin,cos,sqrt\n",
+ "I=5.;# in A\n",
+ "n=1000./5;# normal ratio\n",
+ "sin_alfa=0.4;\n",
+ "Im=1;# in A\n",
+ "dela=0;\n",
+ "#calculations\n",
+ "cos_alfa=sqrt(1-sin_alfa**2);\n",
+ "I0=Im/cos_alfa;\n",
+ "Ie=I0*sin_alfa;\n",
+ "K=n+(((Ie*cos(dela))+(Im*sin(dela)))/I);\n",
+ "er=(n-K)*100/K;\n",
+ "eph=(180/math.pi)*(((Im*cos(dela))-(Ie*sin(dela)))/(n*I));\n",
+ "x=round(eph);#\n",
+ "y=eph-x;#\n",
+ "#results\n",
+ "print \"(a). The ratio error (%) = \",round(er,4)\n",
+ "print \"(b). phase angle is \",x,\" degree \",round(y*60,3),\" minutes \"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 35 - pg 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The ratio error,(%) = -0.744\n",
+ "The phase angle,(degree) = -0.252\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 153\n",
+ "#Example 2.35: The ratio errror and phase angle error\n",
+ "#calculate the ratio error and phase angle\n",
+ "#given data :\n",
+ "import math\n",
+ "from math import sin,cos,asin\n",
+ "I=5.;# in A\n",
+ "n=198.;# in turns\n",
+ "L=12.5;#in VA\n",
+ "f=50.;# assume in Hz\n",
+ "Ie=10.;# in A\n",
+ "Im=15.;# in A\n",
+ "l=1.*10**-3;# in H\n",
+ "#calculations\n",
+ "Kn=1000./I;\n",
+ "Zs=L/I**2;\n",
+ "Re=2*math.pi*f*l;# in ohm\n",
+ "dela=asin(Re/Zs)*180/math.pi;\n",
+ "K=n+(((Ie*cos(dela))+(Im*sin(dela)))/I);\n",
+ "Rerror=(Kn-K)*100./K;\n",
+ "eph=(180/math.pi)*(((Im*cos(dela))-(Ie*sin(dela)))/(n*I));\n",
+ "#results\n",
+ "print \"The ratio error,(%) = \",round(Rerror,3)\n",
+ "print \"The phase angle,(degree) = \",round(eph,3)\n",
+ "print 'The answers are a bit different due to rounding off error in textbook'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 36 - pg 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "phase angle is -4.7 minutes\n",
+ "load is (VA)= 12.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 154\n",
+ "#Example 2.36: phase angle error load in VA\n",
+ "#calculate the phase angle error load\n",
+ "#given data \n",
+ "import math\n",
+ "from math import sqrt\n",
+ "v1=1000.;#V\n",
+ "v2=100.;#V\n",
+ "xp=65.4;#ohm\n",
+ "rp=97.5;#ohm\n",
+ "pf=0.4;#\n",
+ "im=0.02;#A\n",
+ "Xp=110;#ohm\n",
+ "#calculations\n",
+ "r=v1/v2;#\n",
+ "sd=pf;#\n",
+ "csd=sqrt(1-pf**2);#\n",
+ "ie=im*(pf/csd);#A\n",
+ "th=((ie*xp)-(im*rp))/(r*v2);#rad\n",
+ "thd=th*(180/math.pi);#\n",
+ "iss=(r*((im*rp)-(ie*xp)))/(Xp);\n",
+ "va=iss*v2;#VA\n",
+ "#results\n",
+ "print \"phase angle is \",round(thd*60,1),\"minutes\"\n",
+ "print \"load is (VA)=\",round(va,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 37 - pg 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 41,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "flux is (m-Wb)= 0.18\n",
+ "ratio error is (%)= -3.61\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 155\n",
+ "#Example 2.37: flux and current ratio error\n",
+ "#calculate the flux and ratio error\n",
+ "#given\n",
+ "n1=1000.;#A\n",
+ "n2=5.;#A\n",
+ "r=1.6;#ohm\n",
+ "wt=1.5;#watt\n",
+ "f=50;#Hz\n",
+ "cd1=1;#\n",
+ "sd=0;#\n",
+ "#calculations\n",
+ "kn=n1/n2;#\n",
+ "ts=kn;#\n",
+ "es=n2*r;#v\n",
+ "ph=es/(4.44*f*kn);#m Wb\n",
+ "ep=es/kn;#\n",
+ "ie=wt/ep;#A\n",
+ "K=((kn+(ie/n2)));#\n",
+ "re=((kn-K)/K)*100;#\n",
+ "#results\n",
+ "print \"flux is (m-Wb)=\",round(ph*10**3,2)\n",
+ "print \"ratio error is (%)=\",round(re,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 38 - pg 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "RCF for case (a) = 1.0165\n",
+ "phase error for case (a) (%)= -1.623\n",
+ "phase angle error for case (a) 10.3 minutes\n",
+ "RCF for case (b) = 1.0075\n",
+ "phase error for case (b) (%)= -0.744\n",
+ "phase angle error for case (b)is 51.6 minutes\n",
+ "RCF for case (c) = 0.9925\n",
+ "phase error for case (c) (%)= 0.756\n",
+ "phase angle error for case (c) is 51.6 minutes\n",
+ "RCF for case (d) = 1.00825\n",
+ "phase error for case (d) (%)= -0.82\n",
+ "phase angle error for case (d) is 5.157 minutes\n",
+ "RCF for case (e) = 1.00375\n",
+ "phase error for case (e) (%)= -0.374\n",
+ "phase angle error for case (e) is 25.8 minutes\n",
+ "RCF for case (f) = 0.99625\n",
+ "phase error for case (f) (%)= 0.376\n",
+ "phase angle error for case (f) is 25.8 minutes\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 155\n",
+ "#Example 2.38: RCF ,ratio error and phase angle error\n",
+ "#calculate the ratio error, phase angle error and RCF in all cases\n",
+ "import math\n",
+ "from math import sqrt\n",
+ "#given\n",
+ "vp=2000.;#V\n",
+ "n=20.;#\n",
+ "va1=50.;#\n",
+ "pfl1=0.6;#lagging\n",
+ "va2=25.;#V\n",
+ "ie=0;#\n",
+ "im=0;#\n",
+ "cd1=0.6;#\n",
+ "rs1=0.75;#ohm\n",
+ "rp1=300.;#ohm\n",
+ "xs1=1.5;#ohm\n",
+ "xp1=600.;#ohm\n",
+ "#calculations and results\n",
+ "vs=vp/n;#\n",
+ "iss=va1/vs;#A\n",
+ "iss2=va2/vs;#A\n",
+ "sd1=sqrt(1-cd1**2);#\n",
+ "Rp1=n**2*rs1+rp1;#ohm\n",
+ "Xp1=n**2*xs1+xp1;#ohm\n",
+ "vps1=n+((iss/n)*(Rp1*cd1+Xp1*sd1))/vs;#\n",
+ "RCF1=vps1/n;#\n",
+ "er1=((n-vps1)/vps1)*100;#%\n",
+ "per1=((iss*(Xp1*cd1-Rp1*sd1))/(n**2*vs))*(180/math.pi);#degree\n",
+ "per1a=round(per1);#\n",
+ "x1=per1-per1a;#\n",
+ "print \"RCF for case (a) = \",RCF1\n",
+ "print \"phase error for case (a) (%)=\",round(er1,3)\n",
+ "print \"phase angle error for case (a) \",round(x1*60,1),\" minutes\"\n",
+ "cd11=1;#\n",
+ "sd11=sqrt(1-cd11**2);#\n",
+ "vps2=n+((iss/n)*(Rp1*cd11+Xp1*sd11))/vs;#\n",
+ "RCF2=vps2/n;#\n",
+ "er2=((n-vps2)/vps2)*100;#%\n",
+ "per2=((iss*(Xp1*cd11-Rp1*sd11))/(n**2*vs))*(180/math.pi);#degree\n",
+ "per1a1=round(per2);#\n",
+ "x2=per1-per1a1;#\n",
+ "print \"RCF for case (b) =\",RCF2\n",
+ "print \"phase error for case (b) (%)=\",round(er2,3)\n",
+ "print \"phase angle error for case (b)is \",round(per2*60,1),\" minutes\"\n",
+ "cd12=0.6;#\n",
+ "sd12=-0.8;#\n",
+ "vps3=n+((iss/n)*(Rp1*cd12+Xp1*sd12))/vs;#\n",
+ "RCF3=vps3/n;#\n",
+ "er3=((n-vps3)/vps3)*100;#%\n",
+ "per3=((iss*(Xp1*cd12-Rp1*sd12))/(n**2*vs))*(180/math.pi);#degree\n",
+ "per1a1=round(per2);#\n",
+ "x2=per1-per1a1;#\n",
+ "print \"RCF for case (c) =\",RCF3\n",
+ "print \"phase error for case (c) (%)=\",round(er3,3)\n",
+ "print \"phase angle error for case (c) is \",round(per3*60,1),\" minutes\"\n",
+ "cd13=0.6;#\n",
+ "sd13=0.8;#\n",
+ "vps4=n+((iss2/n)*(Rp1*cd13+Xp1*sd13))/vs;#\n",
+ "RCF4=vps4/n;#\n",
+ "er4=((n-vps4)/vps4)*100;#%\n",
+ "per4=((iss2*(Xp1*cd13-Rp1*sd13))/(n**2*vs))*(180/math.pi);#degree\n",
+ "per1a1=round(per2);#\n",
+ "x2=per1-per1a1;#\n",
+ "print \"RCF for case (d) =\",RCF4\n",
+ "print \"phase error for case (d) (%)=\",round(er4,2)\n",
+ "print \"phase angle error for case (d) is \",round(per4*60,3),\" minutes\"\n",
+ "cd14=1;#\n",
+ "sd14=0;#\n",
+ "vps5=n+((iss2/n)*(Rp1*cd14+Xp1*sd14))/vs;#\n",
+ "RCF5=vps5/n;#\n",
+ "er5=((n-vps5)/vps5)*100;#%\n",
+ "per5=((iss2*(Xp1*cd14-Rp1*sd14))/(n**2*vs))*(180/math.pi);#degree\n",
+ "per1a1=round(per2);#\n",
+ "x2=per1-per1a1;#\n",
+ "print \"RCF for case (e) =\",RCF5\n",
+ "print \"phase error for case (e) (%)=\",round(er5,3)\n",
+ "print \"phase angle error for case (e) is \",round(per5*60,1),\" minutes\"\n",
+ "cd15=0.6;#\n",
+ "sd16=-0.8;#\n",
+ "vps6=n+((iss2/n)*(Rp1*cd15+Xp1*sd16))/vs;#\n",
+ "RCF6=vps6/n;#\n",
+ "er6=((n-vps6)/vps6)*100;#%\n",
+ "per6=((iss2*(Xp1*cd15-Rp1*sd16))/(n**2*vs))*(180/math.pi);#degree\n",
+ "per1a1=round(per2);#\n",
+ "x2=per1-per1a1;#\n",
+ "print \"RCF for case (f) =\",RCF6\n",
+ "print \"phase error for case (f) (%)=\",round(er6,3)\n",
+ "print \"phase angle error for case (f) is \",round(per6*60,1),\" minutes\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 39 - pg 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio error (%)= -1.26\n",
+ "RCF = 1.01275\n",
+ "phase angle error (degree)= 0.73\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 158\n",
+ "#Example 2.39: ,ratio error and phase angle error\n",
+ "#calculate the ratio error,RCF and phase angle error\n",
+ "#given\n",
+ "import math\n",
+ "from math import cos, sin\n",
+ "vp=1000.;#V\n",
+ "iss=5.;#A\n",
+ "VA=25.;#\n",
+ "wt=0.25;#W\n",
+ "im=15.;#A\n",
+ "xs=1.;#ohm\n",
+ "rs=5.;#ohm\n",
+ "#calculations\n",
+ "n=vp/iss;#\n",
+ "vs=VA/iss;#\n",
+ "vp=iss/n;#V\n",
+ "ie=wt/vp;#A\n",
+ "dl=math.atan(xs/rs)*57.3;#\n",
+ "dlr=dl*(math.pi/180);#\n",
+ "K=n+((ie*cos(dl/57.3)+im*sin(dl/57.3))/iss);#\n",
+ "re=((n-K)/K)*100;#per\n",
+ "RCF=K/n;#\n",
+ "eph=(180/math.pi)*(((im*cos(dl/57.3))-(ie*sin(dl/57.3)))/(n*iss));\n",
+ "#results\n",
+ "print \"ratio error (%)=\",round(re,2)\n",
+ "print \"RCF =\",round(RCF,5)\n",
+ "print \"phase angle error (degree)=\",round(eph,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 40 - pg 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "true value of voltage is,(V)= 2030.0\n",
+ "true value of current is,(A)= 80.4\n",
+ "true value of power is ,(kW)= 149.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 159\n",
+ "#Example 2.40: true value of voltage ,current and power\n",
+ "#calculate the true value of voltage ,current and power\n",
+ "#given\n",
+ "import math\n",
+ "from math import acos,cos\n",
+ "vs=102.;#V\n",
+ "iss=4.;#A\n",
+ "ws=375.;#W\n",
+ "rcf=0.995;#\n",
+ "rcf1=1.005;#\n",
+ "a1=2000.;#\n",
+ "a2=100.;#\n",
+ "#calculations\n",
+ "ph=acos(ws/(iss*vs))*57.3;#degree\n",
+ "ph1=round(ph);#\n",
+ "x=ph-ph1;#\n",
+ "y=x*60;#\n",
+ "angd=y+22+10;#\n",
+ "ang=angd/60.;#\n",
+ "ta=ph1+ang;#\n",
+ "nr=a1/a2;#\n",
+ "avr=rcf*nr;#\n",
+ "pv=avr*vs;#\n",
+ "acr=rcf1*(a2/nr);#\n",
+ "pc=acr*iss*iss;#A\n",
+ "psd=pv*pc*cos(ta/57.3)*10**-3;#\n",
+ "#results\n",
+ "print \"true value of voltage is,(V)=\",round(pv)\n",
+ "print \"true value of current is,(A)=\",pc\n",
+ "print \"true value of power is ,(kW)=\",round(psd,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 41 - pg 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "primary current is,(A)= 498.415\n",
+ "phase error is (radian)= 0.0058\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 160\n",
+ "#Example 2.41:primary current ,phase error \n",
+ "#calculate the primary current ,phase error \n",
+ "#given\n",
+ "import math,cmath\n",
+ "from math import cos,sin\n",
+ "zs=0.433+1j*0.25;#ohm\n",
+ "zs1=0.15+1j*0.0;#ohm\n",
+ "nt=2.;#turns\n",
+ "l1=8.;#\n",
+ "l2=4.;#\n",
+ "tnt=198;#turns\n",
+ "iss=5;#A\n",
+ "#calculations\n",
+ "zs2=zs+zs1;#ohm\n",
+ "zsa=math.sqrt((zs2.real)**2+(zs2.imag)**2);#\n",
+ "zsng=math.atan(zs2.imag/zs2.real);#\n",
+ "ie=l2/nt;#\n",
+ "im=l1/nt;#\n",
+ "K=((tnt/2.)+((ie*cos(zsng))+(im*sin(zsng)))/iss);#\n",
+ "ip=K*iss;#A\n",
+ "th=((im*cos(zsng))-(ie*sin(zsng)))/((tnt/2)*iss);#\n",
+ "#results\n",
+ "print \"primary current is,(A)=\",round(ip,3)\n",
+ "print \"phase error is (radian)=\",round(th,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 42 - pg 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio error (%)= -1.26\n",
+ "RCF = 1.01275\n",
+ "phase angle error (degree)= 0.73\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 158\n",
+ "#Example 2.39: ,ratio error and phase angle error\n",
+ "#calculate the ratio error,RCF and phase angle error\n",
+ "#given\n",
+ "import math\n",
+ "from math import cos, sin\n",
+ "vp=1000.;#V\n",
+ "iss=5.;#A\n",
+ "VA=25.;#\n",
+ "wt=0.25;#W\n",
+ "im=15.;#A\n",
+ "xs=1.;#ohm\n",
+ "rs=5.;#ohm\n",
+ "#calculations\n",
+ "n=vp/iss;#\n",
+ "vs=VA/iss;#\n",
+ "vp=iss/n;#V\n",
+ "ie=wt/vp;#A\n",
+ "dl=math.atan(xs/rs)*57.3;#\n",
+ "dlr=dl*(math.pi/180);#\n",
+ "K=n+((ie*cos(dl/57.3)+im*sin(dl/57.3))/iss);#\n",
+ "re=((n-K)/K)*100;#per\n",
+ "RCF=K/n;#\n",
+ "eph=(180/math.pi)*(((im*cos(dl/57.3))-(ie*sin(dl/57.3)))/(n*iss));\n",
+ "#results\n",
+ "print \"ratio error (%)=\",round(re,2)\n",
+ "print \"RCF =\",round(RCF,5)\n",
+ "print \"phase angle error (degree)=\",round(eph,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 43 - pg 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "current is (mA)= 1.1474\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 161\n",
+ "#Example 2.43 :percentage change in current\n",
+ "#calculate the current\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "r=0.5;#kilo ohm\n",
+ "r1=1.;#kilo ohm\n",
+ "f=50.;#Hz\n",
+ "V=1.;#V\n",
+ "#calculations\n",
+ "z1=((1j*r1*r)/(r1+1j*r));#kilo-ohm\n",
+ "z1m=abs(z1);#kilo-ohm\n",
+ "z2=((1j*r1*r)/(r+1j*r1));#kilo-ohm\n",
+ "z2m=abs(z2);#kilo-ohm\n",
+ "tz=z1m+z2m;#kilo-ohm\n",
+ "i=V/tz;#A\n",
+ "v1=i*z1m*10**-3;#V\n",
+ "v2=i*10**-3*z2m;#V\n",
+ "df=f-((f*5)/100);#Hz\n",
+ "rc1=((r*df)/f);#k-ohm\n",
+ "rc2=((r1*df)/f);#k-ohm\n",
+ "z1n=((1j*rc1)/(r1+1j*rc1));#\n",
+ "z1nm=abs(z1n);#k-ohm\n",
+ "z2n=((1j*rc2*r)/(r+1j*rc2));#\n",
+ "z2nm=abs(z2n);#k-ohm\n",
+ "znw=z1nm+z2nm;#k-ohm\n",
+ "inn=V/znw;#\n",
+ "#results\n",
+ "print \"current is (mA)=\",round(inn,4)\n",
+ "print 'The answer is a bit different due to rounding off error in textbook'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 44 - pg 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance is (H)= 9.73\n",
+ "frequency is (Hz)= 41.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 162\n",
+ "#Example 2.44 :Inductance\n",
+ "#calculate the inductance and frequency\n",
+ "#given data\n",
+ "import math,cmath\n",
+ "c=1.;#micro-F\n",
+ "f1=60.;#Hz\n",
+ "f=50.;#Hz\n",
+ "#calculations\n",
+ "l1=((c*10**6)/(f1**2*(2*math.pi)**2));#\n",
+ "r1=100;#ohm\n",
+ "z1=r1+1j*((2*math.pi*f*l1)-(1/(2*math.pi*f*c*10**-6)));#ohm\n",
+ "c2=1.5;#micro-F\n",
+ "l2=((-z1.imag)+(1/(2*math.pi*c2)))/100;#H\n",
+ "f2=(1/(2*math.pi))*math.sqrt(1/(l2*c2*10**-6));#Hz\n",
+ "#results\n",
+ "print \"inductance is (H)=\",round(l2,2)\n",
+ "print \"frequency is (Hz)=\",round(f2,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 45 - pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "true value of voltage is,(V)= 2030.0\n",
+ "true value of current is,(A)= 80.4\n",
+ "true value of power is ,(kW)= 149.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 159\n",
+ "#Example 2.40: true value of voltage ,current and power\n",
+ "#calculate the true value of voltage ,current and power\n",
+ "#given\n",
+ "import math\n",
+ "from math import acos,cos\n",
+ "vs=102.;#V\n",
+ "iss=4.;#A\n",
+ "ws=375.;#W\n",
+ "rcf=0.995;#\n",
+ "rcf1=1.005;#\n",
+ "a1=2000.;#\n",
+ "a2=100.;#\n",
+ "#calculations\n",
+ "ph=acos(ws/(iss*vs))*57.3;#degree\n",
+ "ph1=round(ph);#\n",
+ "x=ph-ph1;#\n",
+ "y=x*60;#\n",
+ "angd=y+22+10;#\n",
+ "ang=angd/60.;#\n",
+ "ta=ph1+ang;#\n",
+ "nr=a1/a2;#\n",
+ "avr=rcf*nr;#\n",
+ "pv=avr*vs;#\n",
+ "acr=rcf1*(a2/nr);#\n",
+ "pc=acr*iss*iss;#A\n",
+ "psd=pv*pc*cos(ta/57.3)*10**-3;#\n",
+ "#results\n",
+ "print \"true value of voltage is,(V)=\",round(pv)\n",
+ "print \"true value of current is,(A)=\",pc\n",
+ "print \"true value of power is ,(kW)=\",round(psd,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 46 - pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Series resistance,Rs(ohm) = 8000.0\n",
+ "answer is wrong in the textbook due to rounding off error\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 160\n",
+ "#Example 2.42: Resistance\n",
+ "#calculate the Series resistance\n",
+ "import math\n",
+ "#given data :\n",
+ "f=50.;#/ in Hz\n",
+ "r=2000.;# in ohm\n",
+ "L=0.5;# in H\n",
+ "V=100.;# in V\n",
+ "#calculations\n",
+ "Zm=math.sqrt(r**2+(2*math.pi*f*L));\n",
+ "im=V/Zm;\n",
+ "Rs=(500.-(im*Zm))/im;\n",
+ "#results\n",
+ "print \"Series resistance,Rs(ohm) = \",round(Rs)\n",
+ "print 'answer is wrong in the textbook due to rounding off error'\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
+}
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
+}
diff --git a/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter4.ipynb b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter4.ipynb
new file mode 100755
index 00000000..6b8c7b81
--- /dev/null
+++ b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter4.ipynb
@@ -0,0 +1,751 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4 - Potentiometers"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Unknown resistor (ohm) = 0.08275\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 256\n",
+ "#Example 4.1: Unknown resistor\n",
+ "#calculate the Unknown resistor\n",
+ "#given data :\n",
+ "Vd=0.83942;# volt-drop in V\n",
+ "emf=23*10**-6;# in V\n",
+ "Vds=1.01575;# volt-drop in V\n",
+ "Rs=0.10014;# in ohm\n",
+ "#calculations\n",
+ "Vdt=Vd-emf;# in V\n",
+ "I=Vds/Rs;\n",
+ "R=Vdt/I;\n",
+ "#results\n",
+ "print \"Unknown resistor (ohm) = \",round(R,5)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a). emf of the cell,(V) = 1.42562\n",
+ "(b). % error (high),(%) = 1.98\n",
+ "(c). % error (high),(%) = 1.59\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 257\n",
+ "#Example 4.2: emf and % error \n",
+ "#calculate the emf and % error \n",
+ "#given data :\n",
+ "l=50;# in cm\n",
+ "l1=70;# in cm\n",
+ "l2=65;# in cm\n",
+ "l3=43.5;# in cm\n",
+ "I=0.45;# in A\n",
+ "V=1.0183;# in V\n",
+ "V1=1.35;# in V\n",
+ "R=2;# in ohm\n",
+ "#calculations\n",
+ "Vpl=V/l;# in V/cm\n",
+ "emf=Vpl*l1;\n",
+ "Vr=Vpl*l2;\n",
+ "P_error1=((V1-Vr)/Vr)*100;\n",
+ "Ir=(Vpl*l3)/R;# in A\n",
+ "P_error2=((I-Ir)/Ir)*100;\n",
+ "#results\n",
+ "print \"(a). emf of the cell,(V) = \",emf\n",
+ "print \"(b). % error (high),(%) = \",round(P_error1,2)\n",
+ "print \"(c). % error (high),(%) = \",round(P_error2,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "part a \n",
+ "current is (A)= 0.02\n",
+ "resistance is (ohm)= 100.0\n",
+ "part b\n",
+ "current is (mA)= 7.078\n",
+ "resistance is (k-ohm)= 2035.32\n",
+ "resistance is calculated wrong in the textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 258\n",
+ "#Example 4.3.a: current and resistance\n",
+ "#calculate the current and resistance\n",
+ "#given\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "e1=1.0191;#V\n",
+ "r1=100.;#ohms\n",
+ "l=2;#m\n",
+ "e2=4;#V\n",
+ "#calculations and results\n",
+ "I=l/r1;#A\n",
+ "rh=(e2/I)-r1;#\n",
+ "print 'part a '\n",
+ "print \"current is (A)=\",I\n",
+ "print \"resistance is (ohm)=\",rh\n",
+ "e1=4;#V\n",
+ "e2=1.0191;#V\n",
+ "R1=100;#OHM\n",
+ "R2=49.045;#OHMS\n",
+ "r3=R1-R2;#ohms\n",
+ "rg=50;#ohms\n",
+ "r4=200;#ohms\n",
+ "A=numpy.matrix([[r4, -r3],[-r3, (r4+rg+r3)]]);#\n",
+ "B=numpy.matrix([[e1],[e2]]);#\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B)\n",
+ "I2=X[1,0]*10**3;#\n",
+ "I1=((e1+(r3*10**-5))/r4);#mA\n",
+ "rp=((e2+(r3*I1)-(r4+rg+r3)*10**-5)/10**-5);#\n",
+ "#results\n",
+ "print 'part b'\n",
+ "print \"current is (mA)=\",round(I2,3)\n",
+ "print \"resistance is (k-ohm)=\",round(rp*10**-2,2)\n",
+ "print 'resistance is calculated wrong in the textbook'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "internal resistance,Ri(ohm) = 176.689\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 259\n",
+ "#Example 4.4: Resistance\n",
+ "#calculate the internal resistance\n",
+ "#given data :\n",
+ "emf=1.01892;# in V\n",
+ "R=1;# in M-ohm\n",
+ "V=1.01874;# in V\n",
+ "#calculations\n",
+ "Ic=V/R;\n",
+ "Vd=emf-V;\n",
+ "Ri=Vd/(Ic*10**-6);\n",
+ "#results\n",
+ "print \"internal resistance,Ri(ohm) = \",round(Ri,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Internal resistance,Ri(ohm) = 3.636\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 259\n",
+ "#Example 4.5: Resistance\n",
+ "#calculate the resistance\n",
+ "#given data :\n",
+ "l=65;# in cm\n",
+ "V=0.1;# in V\n",
+ "V1=5.5;# in V\n",
+ "R=20;# in ohm\n",
+ "#calculations\n",
+ "E=V*l;\n",
+ "I=V1/R;\n",
+ "Ri=(E-V1)/I;\n",
+ "#results\n",
+ "print \"Internal resistance,Ri(ohm) = \",round(Ri,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (k-ohm)= 50.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 259\n",
+ "#Example 4.6: Resistance\n",
+ "#calculate the resistance\n",
+ "#given\n",
+ "vr=5.;#V\n",
+ "r=10.;#k-ohm\n",
+ "#calculations\n",
+ "x=vr*r*10**3;#\n",
+ "R=x;#\n",
+ "#results\n",
+ "print \"resistance is (k-ohm)=\",R*10**-3\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The length of slide wire (cm) = 200.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 260\n",
+ "#Example 4.7: Length\n",
+ "#calculate the length of the slide wire\n",
+ "#given data :\n",
+ "l=40.;# in cm\n",
+ "r=0.5;# ion ohm\n",
+ "V=1.2;# in V\n",
+ "V1=6;# in V\n",
+ "#calculations\n",
+ "R=r*l/1;# in ohm\n",
+ "I=V/R;\n",
+ "x=V1/(r*I);\n",
+ "#results\n",
+ "print \"The length of slide wire (cm) = \",x\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance R is (ohm)= 20.0\n",
+ "resistance R1 is (ohm)= 2.0\n",
+ "resistance R2 is (ohm)= 4.0\n",
+ "resistance per cm of slide wire is (ohm/cm)= 0.02\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 260\n",
+ "#Example 4.8: design\n",
+ "#calculate the resistance in all cases\n",
+ "#given\n",
+ "vab=1.;#V\n",
+ "i=50.;#mA\n",
+ "n=10.;#\n",
+ "l=100.;#cm\n",
+ "#calculations\n",
+ "vr=2-vab;#V\n",
+ "R=vr/(i*10**-3);#ohm\n",
+ "R1=(vr/10)/(i*10**-3);#ohm\n",
+ "tr1=n*R1;#ohm\n",
+ "r2=2*R1;#\n",
+ "x=R1/l;#\n",
+ "#results\n",
+ "print \"resistance R is (ohm)=\",R\n",
+ "print \"resistance R1 is (ohm)=\",R1\n",
+ "print \"resistance R2 is (ohm)=\",r2\n",
+ "print \"resistance per cm of slide wire is (ohm/cm)=\",x"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 - pg 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance is (ohm) = 39.5\n",
+ "resolution of the instrument is (micro-V) = 20.0\n",
+ "error is (micro-V) = 2.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 261\n",
+ "#Example 4.9.a:resistance\n",
+ "#calculate the resistance, resolution and error\n",
+ "#given\n",
+ "st=15.;#steps\n",
+ "r=5.;#ohm\n",
+ "rsw=5.5;#ohm\n",
+ "vr=1.61;#V\n",
+ "e2=1.61;#V\n",
+ "e1=2.40;#V\n",
+ "trn=11.;#turns\n",
+ "dv=100.;#divisions\n",
+ "ig=0.05;#micro-A\n",
+ "vlt=1.1;#V\n",
+ "ir=50.;#ohm\n",
+ "#calculations\n",
+ "tr=(st*r)+rsw;#ohm\n",
+ "i=vr/tr;#A\n",
+ "rh=(e1-e2)/i;#ohm \n",
+ "slwr=rsw/trn;#ohm\n",
+ "vd=slwr*i;#V\n",
+ "vedv=(1/dv)*vd;#\n",
+ "rs=vedv/5;#\n",
+ "em=((ig*ir));#\n",
+ "#results\n",
+ "print \"resistance is (ohm) = \",rh\n",
+ "print \"resolution of the instrument is (micro-V) = \",rs*10**6\n",
+ "print \"error is (micro-V) = \",em\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "power dissipated in the resistor is (mW)= 0.4176\n",
+ "power dissipated in the coil is (mW)= 0.264\n",
+ "power dissipated in the capacitor is (mW)= 0.036\n",
+ "energy stored in the coil is (micro-J)= 0.61\n",
+ "energy stored in capacitor is (micro-J)= 0.42\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 262\n",
+ "#Example 4.10:power dissipated\n",
+ "#calculate the power dissipated and energy stored\n",
+ "#given\n",
+ "import math,cmath\n",
+ "r1=0.6-1j*0.24;#V\n",
+ "r2=0.6+1j*0.4;#V\n",
+ "r3=-0.1-1j*0.4;#V\n",
+ "f=50;#Hx\n",
+ "ir=1000;#ohm\n",
+ "#calculations\n",
+ "i1=r1/ir;#A\n",
+ "pdr=(r1.real*i1.real)+(r1.imag*i1.imag);#W\n",
+ "pdC=(r1.real*i1.real)+(r2.imag*i1.imag);#W\n",
+ "pdc=(r3.real*i1.real)-(r2.imag*i1.imag);#W\n",
+ "imp=(r2/r1)*10**3;#ohm\n",
+ "rc=imp.imag;#ohm\n",
+ "indu=rc/(2*math.pi*f);#H\n",
+ "ersl=(1./2)*(i1.imag**2+i1.real**2)*indu;#joules\n",
+ "admc=(r1*10**-3)/r3;#ohm**-1\n",
+ "C=admc.imag/(2*math.pi*f);#\n",
+ "ersc=(1./2)*(r3.imag**2+r3.real**2)*C;#\n",
+ "#results\n",
+ "print \"power dissipated in the resistor is (mW)=\",pdr*10**3\n",
+ "print \"power dissipated in the coil is (mW)=\",pdC*10**3\n",
+ "print \"power dissipated in the capacitor is (mW)=\",pdc*10**3\n",
+ "print \"energy stored in the coil is (micro-J)=\",round(ersl*10**6,2)\n",
+ "print \"energy stored in capacitor is (micro-J)=\",round(ersc*10**6,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "measuring range of the potentiometer is (V)= 1.9\n",
+ "resolution is (mV)= 0.5\n",
+ "current through the dial is (mA)= 10.0\n",
+ "setting of the rheostat is (ohm)= 410.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 263\n",
+ "#Example 4.11:measuring range,resulution,working current,setting of the rheostat\n",
+ "#calculate the measuring range,resulution,working current,setting of the rheostat\n",
+ "#given\n",
+ "sd=18.;#steps\n",
+ "v1=0.1;#V\n",
+ "dv=100;#divisions\n",
+ "dr=10;#ohm\n",
+ "wbc=6;#V\n",
+ "#calculations\n",
+ "mr=(sd*v1)+v1;#V\n",
+ "rs=(v1/dv)*(1./2);#mV\n",
+ "cdd=v1/dr;#A\n",
+ "rsv=wbc-mr;#V\n",
+ "sh=rsv/cdd;#ohm\n",
+ "#results\n",
+ "print \"measuring range of the potentiometer is (V)=\",mr\n",
+ "print \"resolution is (mV)=\",rs*10**3\n",
+ "print \"current through the dial is (mA)=\",cdd*10**3\n",
+ "print \"setting of the rheostat is (ohm)=\",sh\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 - pg 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "true value of drop across the resistance is (V)= 0.6529\n",
+ "percentage error is (%)= 0.06\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 263\n",
+ "#Example 4.12:voltage and percentage error\n",
+ "#calculate the voltage and percentage error\n",
+ "#given\n",
+ "st=15;#steps\n",
+ "r1=10;#ohm\n",
+ "v1=0.1;#V\n",
+ "r2=10;#ohm\n",
+ "r3=9.9;#ohm\n",
+ "v2=0.0185;#V\n",
+ "v3=1.0185;#V\n",
+ "n=6;#\n",
+ "vg=0.6525;#\n",
+ "#calculations\n",
+ "acr=(r1*r3)+((r2*v2)/v1);#ohm\n",
+ "I=v3/acr;#\n",
+ "acr1=(n*r3)+(r2*0.0525)/v1;#ohm\n",
+ "tvr=I*acr1;#V\n",
+ "er=((tvr-vg)/tvr)*100;#\n",
+ "#results\n",
+ "print \"true value of drop across the resistance is (V)=\",round(tvr,4)\n",
+ "print \"percentage error is (%)=\",round(er,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 - pg 264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "reactance is (ohm)= 1.28\n",
+ "inductance of the coil is (mH)= 30.0\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 264\n",
+ "#Example 4.13:resistance and reactance\n",
+ "#calculate the resistance and reactance\n",
+ "#given\n",
+ "import math,cmath\n",
+ "from math import sqrt,atan,sin\n",
+ "r1=2.;#ohm\n",
+ "r2=9.;#\n",
+ "vm=85.;#V\n",
+ "va=40.;#degree\n",
+ "vm1=90.;#V\n",
+ "va1=45.;#degree\n",
+ "f=50.;#Hz\n",
+ "#calculations\n",
+ "imp=r1+1j*r2;#ohm\n",
+ "mg=sqrt(r1**2+r2**2);#\n",
+ "th=atan(r2/r1) *57.3;#\n",
+ "ccm=vm/mg;#A\n",
+ "cca=va-th;#degree\n",
+ "impm=vm1/ccm;#ohm\n",
+ "impa=va1-cca;#degree\n",
+ "reac=impm*sin(impa/57.3);#ohm\n",
+ "rc=sqrt(impm**2-reac**2);#ohm\n",
+ "ind=reac/(2*math.pi*f);#\n",
+ "#results\n",
+ "print \"reactance is (ohm)=\",round(rc,2)\n",
+ "print \"inductance of the coil is (mH)=\",math.floor(ind*10**3)\n",
+ "print 'The answer is a bit different due to rounding off error in textbook'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 - pg 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limit of error in the reading is 48.6 micro-V\n",
+ "deflection of the galvanometer is (mm)= 8.1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 265\n",
+ "#Example 4.14:limit of error,deflection\n",
+ "#calculate the limit of error and deflection of galvanometer\n",
+ "#given\n",
+ "x=17.5;#mm/micro-A\n",
+ "r1=850.;#ohm\n",
+ "v1=2.;#V\n",
+ "r2=80.;#\n",
+ "v3=1.43;#V\n",
+ "v2=0.1;#V\n",
+ "l=50.;#cm\n",
+ "l1=2.;#mm\n",
+ "fr1=22.784;#\n",
+ "#calculations\n",
+ "lr=r1*(1./x);#micro V\n",
+ "i1=v1/r2;#A\n",
+ "r3=v2/i1;#ohm\n",
+ "r4=v3/i1;#ohm\n",
+ "r5=((l1/10.)/l)*r3;#ohm\n",
+ "fr=r4+r5;#ohm\n",
+ "R=(fr*fr1)/r2;#ohm\n",
+ "e=i1*fr;#V\n",
+ "ig=(e-v3)/(r1+R);#A\n",
+ "dg=ig*x*10**6;#mm\n",
+ "#results\n",
+ "print \"limit of error in the reading is \",round(lr,1),\" micro-V\"\n",
+ "print \"deflection of the galvanometer is (mm)=\",round(dg,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 - pg 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Current in one direction,I1(mA) = 10.0\n",
+ "Current in another direction,I2(mA) = 10.34\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 266\n",
+ "#Example 4.15: Current \n",
+ "#calculate the Current \n",
+ "#given data :\n",
+ "V1=4.2;# in V\n",
+ "V2=1.43;# in V\n",
+ "r1=21.0;# in ohm\n",
+ "r2=1.;# in ohm\n",
+ "r3=15.;# in ohm\n",
+ "#calculations\n",
+ "I=V1/r1;# in A\n",
+ "R=V2/I;# in ohm\n",
+ "R1=R+r2;\n",
+ "R2=R-r2;\n",
+ "R3=round(R1*(r1-R1)/r1);\n",
+ "R4=R2*(r1-R2)/r1;\n",
+ "e1=R1*I;\n",
+ "e2=R2*I;\n",
+ "I1=(e1-V2)*10**3/(R3+r3);\n",
+ "I2=(V2-e2)*10**3/(R4+r3);\n",
+ "#results\n",
+ "print \"Current in one direction,I1(mA) = \",I1\n",
+ "print \"Current in another direction,I2(mA) = \",round(I2,2)\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
+}
diff --git a/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter5.ipynb b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter5.ipynb
new file mode 100755
index 00000000..b328650c
--- /dev/null
+++ b/Electrical_Measurements_Measuring_Instruments_by_K._Shinghal/Chapter5.ipynb
@@ -0,0 +1,769 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5 - Magnetic measurement"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Capacity of the capacitor (micro-F) = 2.12\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 304\n",
+ "#Example 5.1: Capacity of the capacitor\n",
+ "#calculate the Capacity of the capacitor\n",
+ "#given data :\n",
+ "import math\n",
+ "Ig=0.0001;# in A\n",
+ "T0=3.;# in sec\n",
+ "theta0=200.;\n",
+ "theta=45.;\n",
+ "V=100.;# in V\n",
+ "#calculations\n",
+ "Q=(Ig*T0*theta0)/(theta*2*math.pi);\n",
+ "C=(Q/V)*10**6;\n",
+ "#results\n",
+ "print \"Capacity of the capacitor (micro-F) = \",round(C,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Coulomb sensitivity (mm/micro-C) = 8.89\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 304\n",
+ "#Example 5.2: Coulomb sensitivity\n",
+ "#calculate te Coulomb sensitivity\n",
+ "#given data :\n",
+ "C=1.5*10**-6;# in F\n",
+ "V=15;# in V\n",
+ "d1=20;# in cm\n",
+ "#calculations\n",
+ "Q=C*V;\n",
+ "Sb=(d1/Q)*10**-5;\n",
+ "#resutls\n",
+ "print \"Coulomb sensitivity (mm/micro-C) = \",round(Sb,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Logarithmic increment = 0.2231\n",
+ "undamped frequency is (Hz)= 0.1253\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 305\n",
+ "#Example 5.3: Logarithmic increment\n",
+ "#calculate the Logarithmic increment and frequency\n",
+ "#given data :\n",
+ "import math\n",
+ "theta1=12.5;\n",
+ "theta2=10.;\n",
+ "#calculations\n",
+ "lamda=math.log(theta1/theta2);\n",
+ "x=lamda**2;#\n",
+ "y=x/(math.pi**2-x);#\n",
+ "y1=math.sqrt(y);#\n",
+ "f=0.125;#Hz\n",
+ "fo=f/(math.sqrt(1-y1**2));#Hz\n",
+ "#results\n",
+ "print \"Logarithmic increment = \",round(lamda,4)\n",
+ "print \"undamped frequency is (Hz)=\",round(fo,4)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Flux density B(Wb/m^2) = 55.56\n",
+ "permeability mu(H/m) = 60.0\n",
+ "flux density is calculed wrong in the textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 305\n",
+ "#Example 5.4: Flux density\n",
+ "#calculate the flux density\n",
+ "#given data :\n",
+ "I1=5.;# in A\n",
+ "I2=10.;# in A\n",
+ "N1=100.;# number of turns\n",
+ "N2=200.;#number of turns\n",
+ "l=30*10**-2;# in m\n",
+ "R=200.;# in ohm\n",
+ "theta1=45.;# in degree\n",
+ "theta2=30.;# in degree\n",
+ "As=0.3*10**-4;# in m**2\n",
+ "M=100*10**-3;# in H\n",
+ "#calculations\n",
+ "k=(2*M*I1)/(R*theta1);\n",
+ "H=(N1*I2)/l;\n",
+ "fi=(R*k*theta2)/(2*N2);\n",
+ "B=fi/As;\n",
+ "mu=H/B;\n",
+ "#results\n",
+ "print \"Flux density B(Wb/m^2) = \",round(B,2)\n",
+ "print \"permeability mu(H/m) = \",mu\n",
+ "print 'flux density is calculed wrong in the textbook'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 309"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Flux density,B(Wb/m^2) = 1.25\n",
+ "Relative permeability = 521.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 309\n",
+ "#Example 5.5: Flux density and relative permeability\n",
+ "#calculate the Flux density and relative permeability\n",
+ "#given data :\n",
+ "import math\n",
+ "A=5*10**-4;# in m**2\n",
+ "d=25*10**-2;# in m\n",
+ "N1=150;# turns\n",
+ "N2=300;# turns\n",
+ "k=2*10**-6;# coulomb per division\n",
+ "R=2500;# in ohm\n",
+ "I=10;# in A\n",
+ "theta=75;# in division\n",
+ "#calculations\n",
+ "l=math.pi*d;\n",
+ "mu_0=4*math.pi*10**-7;\n",
+ "B=(k*theta*R)/(2*N2*A);\n",
+ "H=(N1*I)/l;\n",
+ "mu_r=(B/(mu_0*H));\n",
+ "#results\n",
+ "print \"Flux density,B(Wb/m^2) = \",B\n",
+ "print \"Relative permeability = \",round(mu_r)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "In case of total flux is (Wb)= 0.027\n",
+ "In case of useful flux is (Wb)= 0.0228\n",
+ "leakage coefficient is = 1.185\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 308\n",
+ "#Example 5.6 #flux per pole and leakage cofficient\n",
+ "#calculate the flux per pole and leakage cofficient\n",
+ "#given data:\n",
+ "k=0.15;#micro-C\n",
+ "th=120.;#divisions\n",
+ "th1=135.;#divisions\n",
+ "r=4500.;#ohm\n",
+ "n=3.;#turns\n",
+ "#calculations\n",
+ "ft=(k*10**-6*th*r)/n;#Wb\n",
+ "n1=4;#\n",
+ "ft1=(k*10**-6*th1*r)/n1;#Wb\n",
+ "lk=ft/ft1;#\n",
+ "#results\n",
+ "print \"In case of total flux is (Wb)=\",ft\n",
+ "print \"In case of useful flux is (Wb)=\",round(ft1,4)\n",
+ "print \"leakage coefficient is =\",round(lk,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "relative permeability = 30.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 308\n",
+ "#Example 5.7 #relative permeability\n",
+ "#calculate the relative permeability\n",
+ "#given data\n",
+ "import math\n",
+ "n1=320.;#turns\n",
+ "n2=250.;#turns\n",
+ "i=10.;#A\n",
+ "l=32.;#cm\n",
+ "fl=2.5*10**-4;#Wb\n",
+ "sd=100;#\n",
+ "sd1=270;#/\n",
+ "#calculations\n",
+ "N=(n1*i)/(l*10**-2);#AT/m\n",
+ "k=(fl*i)/sd;#\n",
+ "mo=4*math.pi*10**-7;#\n",
+ "A=0.35;#cm**2\n",
+ "ur=((k*sd1)/(2*mo*N*A*10**-4*n2));#\n",
+ "#results\n",
+ "print \"relative permeability =\",round(ur,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 309"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The shunt resistance S(ohm) = 0.0127\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 309\n",
+ "#Example 5.7 # Shunt resistance\n",
+ "#calculate the shunt resistance\n",
+ "#given data :\n",
+ "N=800.;# turns\n",
+ "I=10.;# in A\n",
+ "reluctance=150000;# in AT per Wb\n",
+ "K=.15*10**-3;# in Wb turns/ division\n",
+ "rs=0.025;# in ohm\n",
+ "Ns=1;\n",
+ "theta=120;#divisions\n",
+ "#calculations\n",
+ "fi=(N*I)/reluctance;\n",
+ "S=(K*rs*theta)/((fi*Ns)-(K*theta));\n",
+ "#results\n",
+ "print \"The shunt resistance S(ohm) = \",round(S,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 - pg 310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The magnetic potential difference between two points,(AT) = 697.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 310\n",
+ "#Example 5.9 # Magnetic pole difference\n",
+ "#calculate the Magnetic pole difference\n",
+ "#given data :\n",
+ "N=150.;# turns\n",
+ "I=1.2;# in A\n",
+ "theta=300.;# divisions\n",
+ "t=155.;#change in mmf in division\n",
+ "#calculations\n",
+ "mmf=N*I;\n",
+ "r=2*mmf;# du to reversal\n",
+ "K=360/t;\n",
+ "M=(K*theta);\n",
+ "#results\n",
+ "print \"The magnetic potential difference between two points,(AT) = \",round(M)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "relative permeability = 521.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 310\n",
+ "#Example 5.10 #relative permeability\n",
+ "#calculate the relative permeability\n",
+ "#given data\n",
+ "import math\n",
+ "n1=600.;#turns\n",
+ "i=3.;#A\n",
+ "d=30.;#cm\n",
+ "ass=6.;#cm^2;#\n",
+ "t1=500.;#turns\n",
+ "r=250.;#ohms\n",
+ "k=3000.;#micro-C\n",
+ "#calculations\n",
+ "H=(n1*i)/(math.pi*d*10**-2);#\n",
+ "mo=4*math.pi*10**-7;#\n",
+ "x=mo*H;#\n",
+ "y=ass*10**-4*x;#\n",
+ "z=t1*y;#\n",
+ "z1=2*z;#\n",
+ "it=z1/r;#\n",
+ "ur=(k*10**-6)/it;#\n",
+ "#results\n",
+ "print \"relative permeability =\",round(ur)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Fluxmeter deflection (degree) = 76.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 311\n",
+ "#Example 5.11 # Fluxmeter deflection\n",
+ "#calculate the Fluxmeter deflection\n",
+ "#given data :\n",
+ "import math\n",
+ "l=5*10**-2;# in m\n",
+ "N=40;# turns\n",
+ "B=5*10**-3;# in Wb/m**2\n",
+ "b=1.5*10**-2;# in m\n",
+ "cs=2*10**-4;# in m**2\n",
+ "B1=0.05;# in Wb/m**2\n",
+ "#calculations\n",
+ "fi=B1*cs;\n",
+ "del_fi=2*fi;\n",
+ "theta=(del_fi*10)/(N*B*l*b);\n",
+ "#results\n",
+ "print \"Fluxmeter deflection (degree) = \",round((theta*(180/math.pi)),1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 - pg 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Hysteresis current component of the loss (W)= 266.7\n",
+ "Eddy current component of the loss (W)= 158.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 311\n",
+ "#Example 5.12 #hysteresis and eddy current components\n",
+ "#calculate the hysteresis and eddy current components\n",
+ "#given data\n",
+ "import numpy\n",
+ "w1=132.;#W\n",
+ "f1=20.;#Hz\n",
+ "w2=425.;#W\n",
+ "f2=50.;#Hz\n",
+ "#calculations\n",
+ "x=w1/f1;#\n",
+ "y=w2/f2;#\n",
+ "A=numpy.matrix([[1, f1],[1, f2]]);#\n",
+ "B=numpy.matrix([[x],[y]]);#\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);#\n",
+ "Wh=X[0,0]*f2;#W\n",
+ "We=X[1,0]*f2**2;#W\n",
+ "#results\n",
+ "print \"Hysteresis current component of the loss (W)=\",round(Wh,1)\n",
+ "print \"Eddy current component of the loss (W)=\",round(We,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 - pg 312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "hysteresis loss is (W)= 22.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 312\n",
+ "#Example 5.13 #hysteresis loss\n",
+ "#calculate the hysteresis loss\n",
+ "#given data\n",
+ "Hx=125.;#AT/m\n",
+ "ah=200.;#cm**2\n",
+ "ba=0.15;#Wb/m**2\n",
+ "lo=50;#loos\n",
+ "kg=8.5*10**3;#kg/m**3\n",
+ "#calculations\n",
+ "le=ah*Hx*ba;#J/m**3\n",
+ "po=lo*le;#W/m**3\n",
+ "lkg=po/kg;#watt\n",
+ "#results\n",
+ "print \"hysteresis loss is (W)=\",round(lkg)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 - pg 312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The flux density B(Wb/m^2) = 0.121\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 312\n",
+ "#Example 5.14 # flux density\n",
+ "#calculate the flux density\n",
+ "#given data :\n",
+ "R=200+50.;# in ohm\n",
+ "k=100*10**-6;# in coulomb\n",
+ "theta=80.;# divisions\n",
+ "A=55*10**-4;# in m**2\n",
+ "N=1500;# turns\n",
+ "#calculations\n",
+ "B=(R*k*theta)/(2*A*N);\n",
+ "#results\n",
+ "print \"The flux density B(Wb/m^2) = \",round(B,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 - pg 313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "loss is (W)= 0.617\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 313\n",
+ "#Example 5.15 #loss\n",
+ "#calculate the loss\n",
+ "#given data\n",
+ "f=50.;#Hz\n",
+ "k=2.3*10**-2;#\n",
+ "x=1.7;#\n",
+ "wi=0.6;#W\n",
+ "bm=0.5;#Wb/m**2\n",
+ "f1=20;#Hz\n",
+ "bm1=1;#\n",
+ "#calculations\n",
+ "kd=((wi-(k*bm**x*f))/(bm**2*f**2));#\n",
+ "wi1=((k*bm1**x*f1)+(kd*bm1**2*f1**2));#\n",
+ "#results\n",
+ "print \"loss is (W)=\",round(wi1,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 16 - pg 313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnetic flux is (Wb/m^2)= 0.714\n",
+ "flux density is (AT/m^2)= 400.0\n",
+ "relative permeability is = 1421.03\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 313\n",
+ "#Example 5.16 #MAGNETIC FORCE ,FLUX DENSITY AND RELATIVE PERMEABILITY\n",
+ "#calculate the MAGNETIC FORCE ,FLUX DENSITY AND RELATIVE PERMEABILITY\n",
+ "#given data\n",
+ "import math\n",
+ "k=1;#micro-C\n",
+ "th=100.;#turns\n",
+ "r=5000.;#ohm\n",
+ "n2=350.;#turns\n",
+ "ass=10.;#cm**2\n",
+ "n1=100.;#turns\n",
+ "i=4.;#A\n",
+ "l=100.;#cm\n",
+ "#calculations\n",
+ "b=((k*th*r*10**-6)/(2*n2*ass*10**-4));#Wb/m**2\n",
+ "H=(n1*i)/(l*10**-2);#AT/m**2\n",
+ "mo=4*math.pi*10**-7;#\n",
+ "ur=b/(mo*H);#\n",
+ "#results\n",
+ "print \"magnetic flux is (Wb/m^2)=\",round(b,3)\n",
+ "print \"flux density is (AT/m^2)=\",H\n",
+ "print \"relative permeability is =\",round(ur,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 17 - pg 314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Constant is (Wb-turn/scale-div)= 1.005e-07\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 314\n",
+ "#Example 5.17 # fluxmeter\n",
+ "#calculate the Constant of fluxmeter\n",
+ "#given data :\n",
+ "import math\n",
+ "N1=800.;# turns\n",
+ "I=5;# in A\n",
+ "l=1;# in m\n",
+ "A=5*10**-4;# in m**2\n",
+ "N=500;# turns\n",
+ "theta=25.;# divisions\n",
+ "#calculations\n",
+ "H=(N1*I)/l;\n",
+ "B=(4*math.pi*10**-7*H);\n",
+ "fi=B*A*10**8;\n",
+ "K=((2*N*fi*10**-8)/(theta));\n",
+ "#results\n",
+ "print \"Constant is (Wb-turn/scale-div)=\",round(K*10**-3,10)\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
+}