{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 2:OHM'S LAW" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.1,Page number: 16" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Calculating the resistance of a wire.\"\"\"\n", "\n", "#Variable Declaration:\n", "\n", "\"\"\" R=(rho*L)/A\n", " R=Resistance of conductor;\n", " L=Length of conductor;\n", " d=diameter of conductor;\n", " A=Area of Cross Section of conductor=(pi*d*d)/4; \"\"\"\n", "\n", "R1=5 #Resistance of conductor(in Ohms)\n", "\n", "\"\"\" L2=4L1;\n", " d2=0.5d1;\n", " A1=(pi*d1*d1)/4;\n", " A2=(pi*d2*d2)/4=(pi*d1*d1)/16 ; \n", " rho1=rho2=rho(As both the conductors are made of the same material);\n", " R1=(rho*L1)/A1;\n", " R2=(rho*L2)/L2; \n", " R2/R1=(rho*(L2/A2)/(rho*(L1/A1)) \"\"\"\n", "\n", "\n", "#Calculations:\n", "R2=R1*(4/1)*(2/1)*(2/1)\n", "\n", "\n", "#Result:\n", "print \"The required value of resistance is: %d Ohms.\" % (R2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The required value of resistance is: 80 Ohms.\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.2,Page number: 16" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Finding resistance of Copper wire.\"\"\"\n", "\n", "#Variable Declaration:\n", "\"\"\" R=(rho*L)/A\n", " R=Resistance of conductor;\n", " L=Length of conductor;\n", " d=diameter of conductor;\n", " A=Area of Cross Section of conductor=(pi*d*d)/4; \"\"\"\n", "\n", "R1=10 #Resistance of Copper Wire(in Ohms)\n", "\n", "\"\"\" L2=3L1;\n", " d2=0.5d1;\n", " A2=A1/3;(If the length of the wire is made three times by drawing it,its area of cross section must \n", " decrease three times as the volume of the wire remains same in the drawing process.) \n", " rho1=rho2=rho(As both the conductors are made of the same material);\n", " R1=(rho*L1)/A1;\n", " R2=(rho*L2)/L2; \n", " R2/R1=(rho*(L2/A2)/(rho*(L1/A1))\n", " R2=R1*(L2/L1)*(A1/A2) \"\"\"\n", "\n", "\n", "#Calculations:\n", "R2=R1*(3/1)*(3/1)\n", "\n", "\n", "#Result:\n", "print \"The required value of resistance is: %d Ohms.\" % (R2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The required value of resistance is: 90 Ohms.\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.3,Page number: 19 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Finding the voltage across the four resistors.\"\"\"\n", "\n", "#Variable Declaration:\n", "\"\"\" Req=(4+4)||(8+4) \"\"\"\n", "\n", "Req=(8.0*12)/(8+12) #Equivalent Resistance of the circuit(in Ohms)\n", "I=5 #Current in the circuit(in Amperes) \n", "\n", "\n", "#Calculations:\n", "V=I*Req\n", "V1=(4.0*V)/(4+4)\n", "V2=(4.0*V)/(4+4)\n", "V3=(8.0*V)/(8+4)\n", "V4=(4.0*V)/(8+4)\n", "\n", "\n", "#Result:\n", "print \"The voltage across resistor 1 is: %d V.\" % (V1)\n", "print \"The voltage across resistor 2 is: %d V.\" % (V2)\n", "print \"The voltage across resistor 3 is: %d V.\" % (V3)\n", "print \"The voltage across resistor 4 is: %d V.\" % (V4)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The voltage across resistor 1 is: 12 V.\n", "The voltage across resistor 2 is: 12 V.\n", "The voltage across resistor 3 is: 16 V.\n", "The voltage across resistor 4 is: 8 V.\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.4,Page number:20" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Finding the currents through and voltage across the resistors.\"\"\"\n", "\n", "#Variable Declaration:\n", "I=2.0 #Current in Circuit(in Amperes)\n", "R1=2.0 #Resistance of resistor 1(in Ohms) \n", "R2=4.0 #Resistance of resistor 2(in Ohms)\n", "R3=6.0 #Resistance of resistor 3(in Ohms)\n", "\n", "\n", "#Calculations:\n", "Rp=1/((1/R2)+(1/R3))\n", "Req=R1+Rp\n", "Vs=I*Req\n", "v1=Vs*(R1/(R1+Rp))\n", "v2=Vs*(Rp/(R1+Rp))\n", "v3=v2\n", "i1=I\n", "i2=v2/R2\n", "i3=v3/R3\n", "\n", "\n", "#Result:\n", "print \"The current i1= %.2f A.\\nThe current i2= %.2f A.\\nThe current i3= %.2f A.\" %(i1,i2,i3)\n", "print \"The voltage v1= %.2f V.\\nThe voltage v2= %.2f V.\\nThe voltage v3= %.2f V.\\n\" %(v1,v2,v3)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The current i1= 2.00 A.\n", "The current i2= 1.20 A.\n", "The current i3= 0.80 A.\n", "The voltage v1= 4.00 V.\n", "The voltage v2= 4.80 V.\n", "The voltage v3= 4.80 V.\n", "\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.5,Page number: 23" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Finding the effective resistance.\"\"\"\n", "\n", "from sympy import *;\n", "\n", "#Calculations:\n", "Rp=1.0/((1.0/20)+(1.0/10)+(1.0/20))\n", "R_AB_1=15+Rp\n", "R = symbols('R')\n", "R1=1.0/((1.0/2.0)+1.0)+ 1.0\n", "R2=R1\n", "R_AB_2= 1.0/((1/R1)+(1/R2)+(1))\n", "R_AB_b=round(R_AB_2,4)*R\n", "R3=1.0/((1.0/3)+(1.0/6)) + 18\n", "R_AB_3= 1.0/((1.0/20)+(1/R3)) + 5\n", "\n", "\n", "#Result:\n", "print \"(a)The effective resistance between points A and B for the combination of resistances is R_AB = %.2f Ohms.\" %(R_AB_1)\n", "print \"(b)The effective resistance between points A and B for the combination of resistances is R_AB = %s Ohms.\" %(R_AB_b)\n", "print \"(c)The effective resistance between points A and B for the combination of resistances is R_AB = %.2f Ohms.\" %(R_AB_3)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)The effective resistance between points A and B for the combination of resistances is R_AB = 20.00 Ohms.\n", "(b)The effective resistance between points A and B for the combination of resistances is R_AB = 0.4545*R Ohms.\n", "(c)The effective resistance between points A and B for the combination of resistances is R_AB = 15.00 Ohms.\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.6,Page number: 24" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Finding currents in parallel branches.\"\"\"\n", "\n", "#Variable Declaration:\n", "V=100 #Voltage of the DC source(in Volts) \n", "\n", "\n", "#Calculations:\n", "Reff= 2+ (1.0/((1.0/12)+(1.0/20)+(1.0/30)))+2\n", "I=V/Reff\n", "\n", "\"\"\" Applying Ohm's Law, we have 12*I1=20*I2=30*I3;\n", " \n", " I2=0.6*I1; I3=0.4*I1 \"\"\"\n", "\n", "\"\"\" I=I1+I2+I3; \"\"\"\n", "I1=I/(0.6+0.4+1)\n", "I2=0.6*I1\n", "I3=0.4*I1\n", "\n", "\n", "#Result:\n", "print \"The current I1= %.2f A.\\nThe current I2= %.2f A.\\nThe current I3= %.2f A.\" %(I1,I2,I3)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The current I1= 5.00 A.\n", "The current I2= 3.00 A.\n", "The current I3= 2.00 A.\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.7,Page number: 25 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Finding the supply current I.\"\"\"\n", "\n", "from math import sqrt\n", "\n", "#Variable Declaration:\n", "P=20.0 #Power dissipated by resistor(in Watts)\n", "RL=5.0 #Resistance of the load resistor(in Ohms)\n", "R=10.0 #Resistance of resistor(in Ohms)\n", "\n", "\n", "#Calculations:\n", "I1=sqrt(P/RL)\n", "I=(I1*(R+RL))/R\n", "\n", "\n", "#Result:\n", "print \"The supply current( I ) is %d A.\"%(I)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The supply current( I ) is 3 A.\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.8,Page number:25" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Finding voltage and the total power dissipated.\"\"\"\n", "\n", "#Variable Declaration:\n", "V=120.0 #Voltage of the power line(in Volts)\n", "P_bulb=60.0 #Power rating of the bulb(in Watts)\n", "V_bulb=120.0 #Voltage rating of the bulb(in Volts)\n", "\n", "\n", "#Calculations:\n", "R=(V_bulb*V_bulb)/P_bulb\n", "R_A=R\n", "R_B=R\n", "R_C=R\n", "R_BC=1.0/((1.0/R)+(1.0/R))\n", "V_B=V*(R_BC/(R_BC+R_A)) \n", "V_C=V*(R_BC/(R_BC+R_A))\n", "V_A=V-V_B\n", "P_A=(V_A*V_A)/R_A \n", "P_B=(V_B*V_B)/R_B\n", "P_C=(V_C*V_C)/R_C\n", "P=P_A+P_B+P_C\n", "\n", "\n", "#Result:\n", "print \"The voltage across bulb A is %.2f V. \\nThe voltage across bulb B is %.2f V. \\nThe voltage across bulb C is %.2f V.\" %(V_A,V_B,V_C)\n", "print \"The total power dissipated in the three bulbs is %.2f W.\" %(P)\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The voltage across bulb A is 80.00 V. \n", "The voltage across bulb B is 40.00 V. \n", "The voltage across bulb C is 40.00 V.\n", "The total power dissipated in the three bulbs is 40.00 W.\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.9,Page number: 26\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Designing a variable resistor.\"\"\"\n", "\n", "#Variable Declaration:\n", "R1=30.0 #Resistance of the resistor(in Ohms)\n", "\n", "\n", "#Calculations:\n", "R2=75-R1\n", "Req=(30+75)/2.0\n", "Rp=Req-R1\n", "R=1/((1/Rp)-(1/R2))\n", "\n", "#Result:\n", "print \"(a)Minimum value of Req is obtained when R=0(i.e.,a short circuit,because the parallel combination of R2 and R is reduced to 0).\" \n", "print \" Maximum value of Req is obtained when R is an open ciruit.\\n Hence, R1 = %.2f Ohms and R2 = %.2f Ohms. \\n \" %(R1,R2)\n", "print \"(b)The resistance R to give Req=(30+75)/2 ohm is R = %.2f Ohms.\" %(R)\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)Minimum value of Req is obtained when R=0(i.e.,a short circuit,because the parallel combination of R2 and R is reduced to 0).\n", " Maximum value of Req is obtained when R is an open ciruit.\n", " Hence, R1 = 30.00 Ohms and R2 = 45.00 Ohms. \n", " \n", "(b)The resistance R to give Req=(30+75)/2 ohm is R = 45.00 Ohms.\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.10,Page number: 26" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\n", "\"\"\"Finding the equivalent resistance for the infinite ladder network.\"\"\"\n", "\n", "from math import sqrt\n", "\n", "#Variable Declaration:\n", "\"\"\" If we remove the first two resistances(i.e. the first rung of the ladder), the remaining circuit across the terminals C and D \n", " has an equivalent resistance ,which must be double of the original ladder. If R_AB=Rx, then R_CD=2*Rx; \"\"\" \n", "\"\"\" Rx=R + (R || (2*Rx)) ; (2*Rx*Rx)-(3*Rx*R)-(R*R);\"\"\"\n", "\"\"\" The roots of the above quadratic equation is solved using Shreedharacharya's Formula\"\"\"\n", "\"\"\" We ignore the negative root as Resistance cannot be negative\"\"\" \n", "a=2.0 #Coefficient of squared term in a quadratic equation\n", "b=-3.0 #Coefficient of first degree term in a quadratic equation \n", "c=-1.0 #Constant term in a quadratic equation \n", "\n", "\n", "#Calculations:\n", "Rx=((-b)+sqrt((b*b)-(4*a*c)))/(2*a)\n", "\n", "\n", "#Result:\n", "print \"The equivalent resistance between terminals A and B in terms of resistance R,for the infinite ladder network is %.2fR Ohms.\" %(Rx)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The equivalent resistance between terminals A and B in terms of resistance R,for the infinite ladder network is 1.78R Ohms.\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.11,Page number: 26" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Converting the pi-section into equivalent T-section.\"\"\"\n", "\n", "#Variable Declaration:\n", "R1=3.0 #First resistance of pi-section(in Ohms)\n", "R2=9.0 #Second resistance of pi-section(in Ohms) \n", "R3=6.0 #Third resistance of pi-section(in Ohms)\n", "\n", "\n", "#Calculations:\n", "Ra=(R2*R3)/(R1+R2+R3)\n", "Rb=(R1*R3)/(R1+R2+R3)\n", "Rc=(R1*R2)/(R1+R2+R3)\n", "\n", "\n", "#Result:\n", "print \"The resistance Ra is %.2f Ohms.\" %(Ra)\n", "print \"The resistance Rb is %.2f Ohm.\" %(Rb)\n", "print \"The resistance Rc is %.2f Ohms.\" %(Rc)\n", " " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The resistance Ra is 3.00 Ohms.\n", "The resistance Rb is 1.00 Ohm.\n", "The resistance Rc is 1.50 Ohms.\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.12,Page number: 27" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Finding the resistance of the coil.\"\"\"\n", "\n", "#Variable Declaration:\n", "\"\"\" Reff is the effective resistance of the two coils. \"\"\"\n", "V=100.0 #Voltage of the dc supply(in Volts)\n", "I=10.0 #Current drawn from the supply(in Amperes)\n", "P=600.0 #Power dissipated in one coil(in Watts)\n", "\n", "\n", "#Calculations:\n", "Reff=V/I\n", "R1=(V*V)/P\n", "R2=(Reff*R1)/(R1-Reff)\n", "\n", "#Result:\n", "print \"The resistance of first coil is: %.2f Ohms.\" %(R1)\n", "print \"The resistance of second coil is: %.2f Ohms.\" %(R2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The resistance of first coil is: 16.67 Ohms.\n", "The resistance of second coil is: 25.00 Ohms.\n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.13,Page number: 27" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"Finding the cost of the boiler operation.\"\"\"\n", "\n", "#Variable Declaration:\n", "I=12.0 #Current drawn by the electric boiler(in Amperes) \n", "V=115.0 #Operating voltage of the electric boiler(in Volts)\n", "t=6.0 #Time of operation of the electric boiler(in hours) \n", "\n", "\n", "#Calculations:\n", "W=(V*I*t)/1000\n", "Rate=2.50\n", "cost=W*Rate\n", "\n", "\n", "#Result:\n", "print \"The cost of boiler operation is Rs. %.2f.\" %(cost)\n", " " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The cost of boiler operation is Rs. 20.70.\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.14,Page number: 27" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Question:\n", "\"\"\"To find the effect of supply on the rating of toaster.\"\"\"\n", "\n", "#Variable Declaration:\n", "V_rated=240.0 #Voltage rating of the toaster(in Volts)\n", "P_rated=1000.0 #Power rating of the toaster(in Watts) \n", "V=220.0 #Voltage of the supply(in Volts)\n", "\n", "\n", "#Calculations:\n", "R_toaster=(V_rated*V_rated)/P_rated\n", "I_rated=P_rated/V_rated \n", "I=V/R_toaster\n", "P_consumed=V*I\n", "\n", "\n", "#Result:\n", "print \"The rated current is %.2f A.\" %(I_rated)\n", "print \"The power rating is %.2f W.\" %(P_rated)\n", "print \"The current drawn is %.2f A.\" %(I)\n", "if (I>I_rated): print(\"The toaster will be damaged as the current is greater than the rated current. \\n\")\n", "elif(IP_rated): print(\"The rating will be affected as the power consumed is greater than the power rating. \\n\")\n", "elif(P_consumed