{ "metadata": { "name": "", "signature": "sha256:d669fd33d214dfe64d2894959328f05abdede2e1f58e2a68176378d9cf3931d3" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter1-circuit analysis" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex1-pg16" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "r1=4.;##resistance between point A and B in ohms which is in series with 10 volts d.c. supply.\n", "r2=3.;##resistance between points C and D in ohms which is in series with a d.c. supply of 8 volts.\n", "r3=5.;##resistance betwwen points F and G in ohms\n", "##arms AB.CD,FG are in parallel with each other.\n", "v1=10.;##d.c. supply voltage in the arm AB in volts\n", "v2=8.;##d.c. supply voltage in the arm CD in volts\n", "\n", "##calculations\n", "##using SUPER POSITION THEOREM\n", "##voltage source of 8 volts is neglected and supply is 10 volts d.c\n", "R1=r1+((r2*r3)/(r2+r3));## total resistance in ohms\n", "bIa1=v1/R1;##current in arm AB in amperes \n", "cId1=v1*(r3/(R1*(r2+r3)));##current in arm CD in amperes\n", "dIc1= -cId1;\n", "fIg1=(v1/R1)-cId1;##current in arm FG in amperes\n", "##voltage source of 10 volts is neglected and supply is 8 volts d.c\n", "R2=r2+((r1*r3)/(r1+r3));##total resistance in ohms\n", "dIc2=v2/R2;##current in arm CD in amperes\n", "aIb2=v2*(r3/(R2*(r3+r1)));##current in arm AB in amperes\n", "bIa2= -aIb2;\n", "fIg2=(v2/R2)-aIb2;##current in arm FG in amperes\n", "I1=bIa1+bIa2;##current in 10 V source in amperes\n", "I2=dIc1+dIc2;##current in 8V source in amperes\n", "I3=fIg1+fIg2;##current in arm FG in amperes\n", "\n", "##output\n", "print'%s %.2f %s %.2f %s %.2f %s '%('the currents in the circuit are ',I1,'A' and '',I2,'A' and '',I3,'A')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the currents in the circuit are 0.85 0.47 1.32 A \n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex2-pg16" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "v1=10.;## d.c. voltage source in volts present in arm 1 in series with a 2 ohm resistor\n", "v2=15.;##d.c. voltage source in volts present in arm 2 in series with a 3 ohm resistor\n", "r1=2.; ##resistance in arm 1 in ohms\n", "r2=3.;## resistance in arm 2 in ohms\n", "r3=1.8;##resistance between node formed by arm 1 and 2 and point A\n", "R=3.;##load resistance in ohms placed in arm AB\n", "## point A and B are in open condition and arm 1 and 2 are in parallel\n", "\n", "##calculations\n", "##thevenin equivalent circuit method\n", "i1=(v2-v1)/(r1+r2);## current in the parallel circuit in amperes\n", "e=v2-(i1*r2);## open cicuit e.m.f in volts i.e. thevenin's voltage\n", "r=r3+((r1*r2)/(r1+r3));## resistance to be considered between AandB in ohms i.e. thevenin's resistance\n", "I=e/(r+R);##current through the load resistance in amperes\n", "\n", "##output \n", "print'%s %.2f %s %.2f %s %.2f %s '%(' the thevenin equivalent generator will have a constant e.m.f. of ',e,' V' and 'internal resistance of ',r,' ohm.' and '\\n the current in 3 ohm resistor is ',I,' A')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " the thevenin equivalent generator will have a constant e.m.f. of 12.00 internal resistance of 3.38 \n", " the current in 3 ohm resistor is 1.88 A \n" ] } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex3-pg17" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "r1=0.2;##resistance in arm 1 in ohms which is in series with 10 volts d.c. supply.\n", "r2=0.2;##resistance in arm 2 in ohms which is in series with a d.c. supply of 12 volts.\n", "r3=0.4;##resistance in arm 3 in ohms whichis in series with 15 volts d.c. supply .\n", "##arms 1,2 and 3 are in parallel with each other and are parallel with the arm AB.\n", "v1=10;##d.c. supply voltage in the arm 1 in volts\n", "v2=12;##d.c. supply voltage in the arm 2 in volts\n", "v3=15;##d.c. supply voltage in the arm 3 in volts\n", "R1=2.28;## resistance in arm AB in ohms in one case\n", "R2=5.82;## resistance in arm AB in ohms in another\n", "\n", "##calculations\n", "##thevenin equivalent circuit method\n", "e=((v3/r3)+(v2/r2)+(v1/r1))/((1/r1)+(1/r2)+(1/r3));## thevenin's voltage in volts\n", "r=1/((1/r1)+(1/r2)+(1/r3));##thevenin's resistance in ohms\n", "I1=e/(r+R1);## current when resistance in AB arm is 2.28 ohms\n", "I2=e/(r+R2);## current when resistance in AB arm is 5.82 ohms\n", "\n", "##output\n", "print'%s %.2f %s %.2f %s %.2f %s %.2f %s '%('the equivalent generator has a constant voltage of ',e,' V 'and 'an internal resistance of ',r,' ohms' '\\n the load currents are ',I1,' A' and '',I2,' A')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the equivalent generator has a constant voltage of 11.80 an internal resistance of 0.08 ohms\n", " the load currents are 5.00 2.00 A \n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex4-pg18" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "##AB,BC,CD,DA are arms of a wheatstone bridge\n", "r1=4.;##resistance in arm AB in ohms\n", "r2=6.;##resistance in arm BC in ohms\n", "r3=5.;##resistance in arm CD in ohms\n", "r4=3.;##resistance in arm DA in ohms\n", "v=4.;##d.c. supply given between points A and C in volt\n", "R=10.;##resistance of the detector placed between the points B and D in ohms\n", "\n", "##calculations\n", "aIb=v/(r1+r2);##current in arm AB in amperes\n", "aId=v/(r3+r4);##current in arm DA in amperes\n", "aVb=aIb*r1;##voltage drop along arm AB in volts\n", "aVd=aId*r4;##voltage drop across arm AD in volts\n", "dVb=aVb-aVd;##since D is positive with respect to B\n", "e=dVb;## open circuit voltage in volts\n", "r0=((r1*r2)/(r1+r2))+((r3*r4)/(r3+r4));##equivalent resistance in ohms when the supply neglected\n", "I=e/(r0+R);##current through the 10 ohms resistance in amperes\n", "\n", "##output\n", "print'%s %.2f %s'%('the current through the detector will be ',I,' A in the direction from D to B')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the current through the detector will be 0.01 A in the direction from D to B\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex5-pg19" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "v1=21.;##voltage of first battery in arm 1 in volts\n", "v2=16.;##voltage of second battery in arm 2 in volts\n", "r1=3.;##internal resistance of first battery in ohms\n", "r2=2.;##internal resistance of second battery in ohms\n", "R=6.;##resistance going to be introduced in arm AB in ohms\n", "##arms 1,2 and AB are in parallel\n", "##arm AB is a short circuit path\n", "\n", "##calculations\n", "##norton's equivalent circuit method\n", "Isc=(v1/r1)+(v2/r2);##current through short circuit path in amperes\n", "aRb=(r1*r2)/(r1+r2);##equivalent resistance in ohms\n", "##now 6ohm resistor is placed in arm AB\n", "aIb=Isc*((aRb)/(aRb+R));##current through 6 ohm resistor in amperes\n", "\n", "##output\n", "print'%s %.2f %s %.2f %s %.2f %s '%('the constants for norton equivalent generator are ',Isc,' A' and '',aRb,'ohm' '\\n the current through the 6 ohm resistor is ',aIb,' A')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the constants for norton equivalent generator are 15.00 1.20 ohm\n", " the current through the 6 ohm resistor is 2.50 A \n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6-pg20" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "v1=5.;##voltage of battery in arm 1 in volts\n", "v2=10.;##voltage of battery in arm 2 in volts\n", "v3=20.;##voltage of battery in arm 3 in volts\n", "r1=3.;##internal resistance of battery in arm 1 in ohms\n", "r2=8.;##internal resistance of battery in arm 2 in ohms\n", "r3=24.;##internal resistance of battery in arm 3 in ohms\n", "##arms 1,2,3 and AB are in parallel with each other and AB are in open condition\n", "r4=6.;##resistance between node formed by arms 1,2 and 3 and point A in ohms\n", "R0=7.;##load resistance to be connected in arm AB in ohms\n", "##calculations\n", "##norton's equivalent method\n", "##batteries are neglected. so, only internal resistances remain in the arms\n", "R=1./((1./r1)+(1./r2)+(1./r3));##equivalent resistance in ohms\n", "aRb=R+r4;## total resistance when looked into the circuit from arm AB in ohm\n", "##applying superposition principle to determine the short circuit current\n", "##battery in arm 1 alone is considered\n", "R1=r1+(1./((1./r2)+(1./r3)+(1./r4)));##effective resistance in ohms\n", "I1=v1/R1;##current in amperes\n", "pd=I1*r1;##potential drop across the parallel combination in volts\n", "aIb1=pd/r4;##current in amperes\n", "##battery in the arm 2 alone is considered\n", "R2=r2+(1./((1./r1)+(1./r3)+(1./r4)));## effective resistance in ohms\n", "I2=v2/R2;##current in amperes\n", "V1=I2/((1./r1)+(1./r3)+(1./r4));##voltage in volts\n", "aIb2=V1/r4;##current in amperes\n", "##battery in the arm 3 alone is considered\n", "R3=r3+(1./((1./r1)+(1./r2)+(1./r4)));##effective resistance in ohms\n", "I3=v3/R3;##current in amperes\n", "V2=I3/((1./r1)+(1./r2)+(1./r4));##voltage in volts\n", "aIb3=V2/r4;##current in amperes\n", "Isc=aIb1+aIb2+aIb3;##short circuit current in amperes\n", "I=Isc*(aRb/(aRb+R0));##current through load resistor in amperes\n", "\n", "##output\n", "print'%s %.2f %s %.2f %s %.2f %s'%('Nortons equivalent generator will produce a constant current of ',Isc,' A' and 'has a shunt resistance of ',r2,' ohms' '\\n the current through the external resistor will be ',I,' A')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Nortons equivalent generator will produce a constant current of 0.94 has a shunt resistance of 8.00 ohms\n", " the current through the external resistor will be 0.50 A\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex7-pg20" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "##AB,BC,CD,DA are arms of a wheatstone bridge\n", "r1=4.;##resistance in arm AB in ohms\n", "r2=6.;##resistance in arm BC in ohms\n", "r3=5.;##resistance in arm CD in ohms\n", "r4=3.;##resistance in arm DA in ohms\n", "v=4.;##d.c. supply given between points A and C in volt\n", "R0=10.;##resistance of the detector placed between the points B and D in ohms\n", "##a detector is placed between the point B and D\n", "\n", "##calculations\n", "## noerton's equivalent circuit method\n", "R1=((r1*r2)/(r1+r2))+((r3*r4)/(r3+r4));## equivalent resistance assuming short circuit between poin A and C in ohms\n", "R2=((r1*r4)/(r1+r4))+((r2*r3)/(r2+r3));##equivalent resistance assuming short circuit between points B and D in ohms\n", "I1=v/R2;## total current in amperes\n", "aIb=v*(r4/(R2*(r4+r1)));##current in arm AB in amperes\n", "aVDb=v*aIb;##voltage drop in arm AB\n", "bVDc=v-aVDb;##voltage drop in arm DC\n", "bIc=bVDc/r2;##currrent in arm BC in amperes\n", "dIb=bIc-aIb;##current in arm DB in amperes\n", "Isc=dIb;##short circuit current in amperes\n", "I=Isc*(R1/(R1+R0));##current through the detector in amperes\n", "\n", "##output\n", "print'%s %.4f %s %.2f %s %.2f %s'%('Nortons equivalent generator will produce a constant current of ',Isc,' A' and 'has a shunt resistance of ',R1,' ohms' '\\n the current through the external resistor will be ',I,' A')\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Nortons equivalent generator will produce a constant current of 0.0234 has a shunt resistance of 4.28 ohms\n", " the current through the external resistor will be 0.01 A\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex8-pg21" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "##arma AB,BC and CA forms delta connection\n", "r1=2.;##resistance in arm AB in ohms\n", "r2=3.;##resistance in arm BC in ohms\n", "r3=5.;##resistance in arm CA in ohms\n", "\n", "##calculations\n", "##conversion of given delta into star connection\n", "##let N be the star point\n", "R1=(r1*r2)/(r1+r2+r3);##resistance in arm AN in ohms\n", "R2=(r2*r3)/(r1+r2+r3);##resistance in arm BN in ohms\n", "R3=(r1*r3)/(r1+r2+r3);##resistance in arm CN in ohms\n", "\n", "##output\n", "print'%s %.2f %s %.2f %s %.2f %s'%('the respective star connected resistances are ',R1,' ohm'and '',R2,' ohm' and '',R3,'ohm')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the respective star connected resistances are 0.60 1.50 1.00 ohm\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex9-pg22" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "##AB,BC,CD,DA are arms of a wheatstone bridge\n", "r1=5.;##resistance in arm AB in ohms\n", "r2=20.;##resistance in arm BC in ohms\n", "r3=15.;##resistance in arm CD in ohms\n", "r4=4.;##resistance in arm DA in ohms\n", "v=4.;##d.c. supply given between points A and C in volt\n", "r0=0.5;## internal resistances pf the d.c. supply in ohms\n", "r5=15.;##resistance in arm BD in ohms\n", "\n", "##calculations\n", "##BCD is replaced by equivalent star connection\n", "##assume N as star piont after conversion\n", "bRn=(r2*r3)/(r3+r2+r5);##resistance in arm BN in ohms\n", "cRn=(r2*r5)/(r3+r2+r5);##resistance in arm CN in ohms\n", "dRn=(r5*r3)/(r3+r2+r5);##resistance in arm DN in ohms\n", "R=r0+cRn+(((r1+bRn)*(r4+dRn))/(r1+bRn+r4+dRn));##total resistance in ohms after conversion\n", "I=v/R;##totalcurrent supply in amperes\n", "I1=(v/R)*((r4+dRn)/(r1+bRn+r4+dRn));##current between points A and B in amperes\n", "I2=I-I1;##current between points A and D in amperes\n", "V1=I1*r1;##voltage drop across r1 in volts\n", "V2=I2*r4;##voltage drop across r4 in volts\n", "V3=V2-V1;##voltage drop across r5 in volts and B is positive to D\n", "I3=V3/r5;##current between points B and D in amperes\n", "I4=I1-I3;##current between points B and C in amperes\n", "I5=I2+I3;##current between points D and C in amperes\n", "\n", "##output\n", "print'%s %.2f %s %.2f %s %.2f %s %.2f %s %.2f %s %.2f %s '%('the currents in each part of the circuit are \\n It= ',I,' A' and '\\n aIb= ',I1,' A' and '\\n aId= ',I2,' A 'and '\\n bId= ',I3,' A' and '\\n bIc= ',I4,' A' and '\\n dIc= ',I5,' A')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the currents in each part of the circuit are \n", " It= 0.35 \n", " aIb= 0.15 \n", " aId= 0.20 \n", " bId= 0.00 \n", " bIc= 0.15 \n", " dIc= 0.20 A \n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex10-pg23" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "##AN,BN,CN are connected in star fashion where N is the nuetral point\n", "r1=5.;##resistance in arm AN in ohms\n", "r2=20.;##resistance in arm BN in ohms\n", "r3=10.;##resistance in arm CN in ohms\n", "\n", "##calculations\n", "##star to delta conversion\n", "Y1=1./r1;##conductance of arm AN in seimens\n", "Y2=1./r2;##conductance of arm BN in seimens\n", "Y3=1./r3;##conductance of arm CN in seimens\n", "R1=1./((Y1*Y2)/(Y1+Y2+Y3));##resistance of arm AB in ohms\n", "R2=1./((Y2*Y3)/(Y1+Y2+Y3));##resistance of arm BC in ohms\n", "R3=1./((Y1*Y3)/(Y1+Y2+Y3));##resistance of arm CA in ohms\n", "\n", "##ouput\n", "print'%s %.2f %s %.2f %s %.2f %s '%('the equivalent resistances values for delta circuit are ',R1,' ohms,'and '',R2,' ohms' and '',R3,' ohms')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the equivalent resistances values for delta circuit are 35.00 70.00 17.50 ohms \n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex11-pg23" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "##AB,BC,CD,DA forms an unbalanced wheatstone's bridge\n", "r1=2.;##resistance in arm AB in ohms\n", "r2=5.;##resistance in arm BC in ohms\n", "r3=6.;##resistance in arm CD in ohms\n", "r4=2.;##resistance in arm DA in ohms\n", "r5=10.;##resistance of detector placed between the points B and D\n", "v=4.;##batterry supplying d.c. voltage in volts which is placed between points A and C\n", "r0=0.2;## internal resistance of the battery in ohms\n", "\n", "##calculations\n", "##AB,BC and BD are cosidered to be in star connection with B as star point\n", "Y1=1./r1;##conductacne of r1 in seimens\n", "Y2=1./r2;##conductance of r2 in seimens\n", "Y3=1./r5;##conductance of r5 in seimens\n", "##after delta conversion\n", "R1=1./((Y1*Y2)/(Y1+Y2+Y3));##resistance between points A and B in ohms\n", "R2=1./((Y2*Y3)/(Y1+Y2+Y3));##resistance between points C and D in ohms\n", "R3=1./((Y1*Y3)/(Y1+Y2+Y3));##resistance between points D and A in ohms\n", "Rad=(r4*R3)/(r4+R3);##effective resistance of arm AD in ohms\n", "Rdc=(r3*R2)/(r3+R2);##effective resistance of arm DC in ohms\n", "Radc=(Rad+Rdc);##effective resistance if arms AD and DC in ohms\n", "R=r0+((R1*Radc)/(R1+Radc));## total resistance of hte circuit in ohms\n", "I=v/R;##total current in the circuit in amperes\n", "I1=I*(R1/(R1+Radc));##current in arm AD in amperes\n", "I2=I-I1;##current in arm AB in amperes\n", "V1=I1*r4;##voltage across arm AD in volts\n", "V2=I2*r1;##voltage across arm AB in volts\n", "V3=V1-V2;##voltage across arm BD in volts and B is positive to D\n", "I3=V3/r5;##current in arm BD in amperes\n", "\n", "##output\n", "print'%s %.2f %s'%('the current in the detector is ',I3,' A')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the current in the detector is 0.01 A\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex12-pg24" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "##input\n", "## a battery consists of 10cells connected in series\n", "v=1.5;##e.m.f. of each cell in volts\n", "r=0.2;## internal resistance of each cell in ohms\n", "n=10.;##number of cells in the battery\n", "\n", "##calculations\n", "##for maximum power load resistance=internal resistance\n", "R=n*r;##total internal resistance of hte battery in ohms\n", "Rl=R;##load resistance in ohms\n", "e=n*v;##total e.m.f. of battery in volts\n", "I=e/(R+Rl);##current from battery in amperes\n", "P=(I**2)*R;##heating loss in the battery in watts\n", "V=e-(I*R);##terminal voltage in volts\n", "\n", "##output\n", "print'%s %.2f %s %.2f %s '%('The maximum value of power which the battery may transfer is ',P,' W' and 'an equal quantity of power is dissipated in the battery. \\n under these conditions the terminal p.d. is',V,'')\n", " \n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The maximum value of power which the battery may transfer is 28.12 an equal quantity of power is dissipated in the battery. \n", " under these conditions the terminal p.d. is 7.50 \n" ] } ], "prompt_number": 1 } ], "metadata": {} } ] }