{ "metadata": { "name": "", "signature": "sha256:1f51544adf15fc8ba28e47ac7da1a371a1d8835331773ecfcfa211468f9b325d" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "UNIT-5 Electricity" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.1,Page no:152" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "n=10**6 #no. of electrons\n", "e=1.6*10**-19 #charge on an electron in C\n", "\n", "#Calculation\n", "q=n*e #calculating total charge\n", "t=10**-3 #time in second\n", "I=q/t #calculating current\n", "\n", "#Result\n", "print\"Current flowing = \",I,\"Ampere\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Current flowing = 1.6e-10 Ampere\n" ] } ], "prompt_number": 71 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.2,Page no:152" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "I=300*10**-3 #current n Ampere\n", "t=60 #time in second\n", "e=1.6*10**-19 #chatge on electron in C\n", "\n", "#Calculation\n", "q=I*t #calculating charge\n", "n=q/e #calculating no of electrons\n", "\n", "#Result\n", "print\"No. of electrons = \",n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "No. of electrons = 1.125e+20\n" ] } ], "prompt_number": 20 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.3,Page no:154" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "V=200 #voltage in volt\n", "R=100 #resistance in Ohm\n", "e=1.6*10**-19 #charge on an electron in C\n", "\n", "#Calculation\n", "I=V/R #Ohm's law\n", "t=1 #time in second\n", "q=I*t #calculating charge\n", "n=q/e #calculating no of electrons\n", "\n", "#Result\n", "print\"No. of electrons = \",n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "No. of electrons = 1.25e+19\n" ] } ], "prompt_number": 72 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.4,Page no:156" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "l=15 #length in m\n", "A=6*10**-7 #area in m square\n", "R=5 #resistance in Ohm\n", "\n", "#Calculation\n", "p=(A*R)/l #calculating resistivity\n", "\n", "#Result\n", "print\"Resistivity= \",p,\"Ohm metre\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resistivity= 2e-07 Ohm metre\n" ] } ], "prompt_number": 73 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.5,Page no:157" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "l=0.1 #length in m\n", "A=10**-4 #area in m square\n", "R=0.01 #resistance in Ohm\n", "\n", "#Calculation\n", "p=(A*R)/l #calculating resistivity\n", "\n", "#Result\n", "print\"Resistivity = \",p,\"Ohm metre\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resistivity = 1e-05 Ohm metre\n" ] } ], "prompt_number": 74 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.6,Page no:157" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "#Variable declaration\n", "L=1 #length in m\n", "r=0.2*10**-3 #radius in m\n", "R=2 #resistance in Ohm\n", "\n", "#Calculation\n", "A=math.pi*(r)**2 #calculating area\n", "P=(R*A)/L #calculating resistivity\n", "\n", "#Result\n", "print\"Resistivity =%.2g\"%P,\"Ohm.metre\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resistivity =2.5e-07 Ohm.metre\n" ] } ], "prompt_number": 38 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.7,Page no:158" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "R1=5 #resisitance in Ohm\n", "\n", "#Calculation\n", "#A2=A/3\n", "#R2/5=3l*3/A*A/l\n", "#R2=9*5\n", "\n", "R2=9*R1 #calculating using R2/A1=(l2/A2)*(A1/l1)\n", "print\"Resisitance = \",R2,\"Ohm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resisitance = 45 Ohm\n" ] } ], "prompt_number": 75 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.8,Page no:159" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "R1=5 #resisitance in Ohm\n", "\n", "#Calculation\n", "#A2=A/2\n", "#R1=rho*l1/A1*R2\n", "#R2=rho*l2/A2\n", "#R2/R1=A1/l1\n", "R2=4*R1 #calculating using R2/A1=(l2/A2)*(A1/l1)\n", "\n", "#Result\n", "print\"Resisitance= \",R2,\"Ohm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resisitance= 20 Ohm\n" ] } ], "prompt_number": 70 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.9,Page no:162" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "R1=2 #resisitance in Ohm\n", "R2=4 #resistance in Ohm\n", "R3=5 #resistance in Ohm\n", "\n", "#Calculation\n", "R=(R1**-1)+(R2**-1)+(R3**-1) #calculating parallel resistance\n", "Rp=(1/R) \n", "\n", "#Result\n", "print\"Resisitance = \",Rp,\"Ohm\"\n", "print\"\\nNOTE:Incorrect answer in book\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resisitance = 1.05263157895 Ohm\n", "\n", "NOTE:Incorrect answer in book\n" ] } ], "prompt_number": 39 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.10,Page no:163" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "from scipy.optimize import fsolve \n", "\n", "#Variable declaration\n", "Rs=40 #resisitance in Ohm\n", "\n", "#Calculation\n", "#R1+R2=40\n", "#R1*R2=256\n", "#R1=256/R2\n", "#Putting this value in eq 1:\n", "#(256/R2)+R2=40\n", "from sympy import solve, symbols, pprint\n", "R2= symbols('R2')\n", "a=1\n", "b=-40\n", "c=256\n", "f = a*R2**2 + b*R2 + c\n", "solution = solve(f, R2)\n", "\n", "#Result\n", "print\"When R2=\",solution[0],\"Ohm R1=\",solution[1],\"Ohm\"\n", "print\"When R2=\",solution[1],\"Ohm R1=\",solution[0],\"Ohm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "When R2= 8 Ohm R1= 32 Ohm\n", "When R2= 32 Ohm R1= 8 Ohm\n" ] } ], "prompt_number": 24 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.11,Page no:164" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "V=2.0 #in volts\n", "R1=30.0 #resisitance in Ohm\n", "R2=60.0 #resistance in Ohm\n", "\n", "#Calculation\n", "Rp=(R1*R2)/(R1+R2) #calculating parallel resistance\n", "I=V/Rp #Ohm's law\n", "\n", "#Result\n", "print\"Resisitance = \",Rp,\"Ohm\"\n", "print\"Current = \",I,\"A\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resisitance = 20.0 Ohm\n", "Current = 0.1 A\n" ] } ], "prompt_number": 26 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.12,Page no:165" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "R1=2.0 #resisitance in Ohm\n", "R2=3.0 #resistance in Ohm\n", "R3=1.0 #resistance in Ohm\n", "\n", "#Calculation\n", "Rp=(R1*R2)/(R1+R2) #calculating parallel resistance\n", "R=Rp+1.0 #1 Ohm in series\n", "Rs=(R1+R2+R3) #series resistances\n", "Rp=(1.0/R1)+(1.0/R2)+(1.0/R3) #calculating parallel resistance\n", "\n", "#Result\n", "print\"(1)Equivalent Resisitance= \",R,\"Ohm\" \n", "print\"(2)All resistances in series = \",Rs,\"Ohm\"\n", "print\"(3)All in Parallel = \",(1/Rp),\"Ohm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(1)Equivalent Resisitance= 2.2 Ohm\n", "(2)All resistances in series = 6.0 Ohm\n", "(3)All in Parallel = 0.545454545455 Ohm\n" ] } ], "prompt_number": 76 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.13,Page no:166" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "V=20 #voltage in Volts\n", "R1=2.0 #resisitance in Ohm\n", "R2=4.0 #resistance in Ohm\n", "R3=5.0 #resistance in Ohm\n", "\n", "#Calculation\n", "Rp=(1/R1)+(1/R2)+(1/R3) #calculating parallel resistance\n", "R=1/Rp #Parallel\n", "I1=V/R1 #calculating current through R1\n", "I2=V/R2 #calculating current through R2\n", "I3=V/R3 #calculating current through R3\n", "I=V/R #calculating total current\n", "\n", "\n", "#Result\n", "print\"(a)Equivalent Resisitance = \",R,\"Ohm\"\n", "print\"Current through R1 = \",I1,\"Ampere\"\n", "print\"Current through R2 = \",I2,\"Ampere\" \n", "print\"Total current = \",I,\"Ampere\" " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)Equivalent Resisitance = 1.05263157895 Ohm\n", "Current through R1 = 10.0 Ampere\n", "Current through R2 = 5.0 Ampere\n", "Total current = 19.0 Ampere\n" ] } ], "prompt_number": 30 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.14,Page no:166" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "#Variable declaration\n", "R=7 #Total resistanc of combination\n", "\n", "#Calculation\n", "def f(n):\n", " Rp = 6*(1/n) #resistance in parallel\n", " return(R-Rp-5)\n", "n=fsolve(f,1)\n", "\n", "#Result\n", "print\"n=\",n[0]" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "n= 3.0\n" ] } ], "prompt_number": 33 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.15,Page no:173" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "R1=2 #resistance in Ohm\n", "R2=6 #resistance in Ohm\n", "R3=3 #resistance in Ohm\n", "V=24 #voltage in volts\n", "R=8 #resistance in Ohm\n", "\n", "#Calculation\n", "I=V/R #Ohm's Law\n", "V1=I*R1 #Ohm's Law\n", "V2=I*R2 #Ohm's Law\n", "V3=I*R3 #Ohm's Law\n", "\n", "#Result\n", "print\"Current = \",I,\"Ampere\" \n", "print\"Voltage drop across R1 = \",V1,\"Volts\"\n", "print\"Voltage drop across R2 = \",V2,\"Volts\" \n", "print\"Voltage drop across R3 = \",V3,\"Volts\"\n", "print\"\\nNOTE:Wrong answer of R3 in book\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Current = 3 Ampere\n", "Voltage drop across R1 = 6 Volts\n", "Voltage drop across R2 = 18 Volts\n", "Voltage drop across R3 = 9 Volts\n", "\n", "NOTE:Wrong answer of R3 in book\n" ] } ], "prompt_number": 36 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.16,Page no:173" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "R=15 #resistance in Ohm\n", "print\"KVL: 16I1+15I2=6 (1)\" #KVL equation\n", "I1=-1.66 #from(1)\n", "I2=2.17 #from (1)\n", "#Calculation\n", "V=(I1+I2)*R #calculating potential difference\n", "\n", "#Result\n", "print\"Potential difference= \",V,\"Volt\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "KVL: 16I1+15I2=6 (1)\n", "Potential difference= 7.65 Volt\n" ] } ], "prompt_number": 37 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.17,Page no:174" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "print\"3I1-I2-1=0 (1)\" #KVL equation\n", "print\"3I1-I2+2I=2 (2)\" #KVL equation\n", "print\"3I1-I1+2I=2 (3)\" #KVL equation\n", "\n", "#Variable declaration\n", "I1=4/17.0 #from (1)(2)(3)through AB \n", "I2=-2/17.0 #from (1)(2)(3)through BD\n", "I=3*I1+I2 #from (1)(2)(3)through main circuit\n", "\n", "#Calculation\n", "Ibc=I1-I2 #calculating current in BC\n", "Iad=I-I1 #calculating current in AD\n", "Idc=I-I1+I2 #calculating current in DC\n", "\n", "#Result\n", "print\"Current in branch BC = \",Ibc,\"Ampere\"\n", "print\"NOTE:Calculation mistake in book while calculating for BC\"\n", "print\"Current in branch AD = \",Iad,\"Ampere\"\n", "print\"Current in branch DC = \",Idc,\"Ampere\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "3I1-I2-1=0 (1)\n", "3I1-I2+2I=2 (2)\n", "3I1-I1+2I=2 (3)\n", "Current in branch BC = 0.352941176471 Ampere\n", "NOTE:Calculation mistake in book while calculating for BC\n", "Current in branch AD = 0.352941176471 Ampere\n", "Current in branch DC = 0.235294117647 Ampere\n" ] } ], "prompt_number": 77 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.18,Page no:176" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "P=10 #Ohm\n", "Q=3 #Ohm\n", "R=12 #Ohm\n", "S=6 #Ohm\n", "G=20 #Ohm\n", "\n", "\n", "#Calculation\n", "print\"-12I+22I1+IgG=0 (1)\" #KVL\n", "print\"6I-9I1+29Ig=0 (2)\" #KVL\n", "print\"13I1-3Ig=2 (3)\" #KVL\n", "#From above equations\n", "import numpy as np\n", "a = np.array([[-12,22,20],[6,-9,29],[0,13,-3]]) \n", "b = np.array([[0],[0],[2]])\n", "np.linalg.solve(a,b)\n", "\n", "\n", "#Result\n", "print\"Current through Galvanometer = \",round(Ig*1000,2),\"mA\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "-12I+22I1+IgG=0 (1)\n", "6I-9I1+29Ig=0 (2)\n", "13I1-3Ig=2 (3)\n", "Current through Galvanometer = 7.8 mA\n" ] } ], "prompt_number": 78 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.19,Page no:179" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "#Variable declaration \n", "P=500 #power in Watts\n", "V=200 #voltage in Volts\n", "V1=160 #voltage in Volts\n", "\n", "#Calculation\n", "R=(V**2)/P #using P=V**2*R\n", "P1=(V1**2)/R #calculating power\n", "Dp=500-P1 #drop in heat\n", "D=(Dp*100)/500 #percentage drop\n", "\n", "#Result\n", "print\"Resistance= \",R,\"Ohm\"\n", "print\"% Drop in heat production = \",D,\"%\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resistance= 80 Ohm\n", "% Drop in heat production = 36 %\n" ] } ], "prompt_number": 79 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.20,Page no:180" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "#Variable declaration\n", "P1=100 #power in Watts\n", "P2=500 #power in Watts\n", "\n", "#Calculation\n", "P=P2/P1 #ratio\n", "\n", "#Result\n", "print \"P=\",P\n", "print\"P>0,I2=5I Therefore I2>I1\" " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "P= 5\n", "P>0,I2=5I Therefore I2>I1\n" ] } ], "prompt_number": 80 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.21,Page no:181" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "#Variable declaration \n", "t=1200 #time in second\n", "P=100 #power in Watts\n", "V=230 #voltage in Volts\n", "\n", "#Calculation\n", "R=(V**2)/P #calculating resistance\n", "V1=115 #supply voltage in Volts\n", "E=((V1**2)*t)/R #calculating energy\n", "\n", "#Result\n", "print\"Energy dissipated by bulb = \",E,\"J\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Energy dissipated by bulb = 30000 J\n" ] } ], "prompt_number": 81 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.22,Page no:181" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "#Variable declaration\n", "P=10**4 #power in Watts\n", "V=250 #voltage in Volts\n", "R=0.2 #resistance in ohm\n", "\n", "#Calculation\n", "Pl=((P/V)*(P/V))*R #calculating power loss\n", "print P1\n", "E=P/(Pl+P) #calculating efficiency\n", "\n", "#Result\n", "print\"Percent Efficiency = \",round(E*100),\"%\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "100\n", "Percent Efficiency = 97.0 %\n" ] } ], "prompt_number": 56 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.23,Page no:182" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "#Variable declaration \n", "P=100.0 #power in Watts\n", "V=220.0 #voltage in Volts\n", "\n", "#Calculation\n", "I=P/V #Current in Ampere\n", "R=V/I #resistance\n", "\n", "#Result\n", "print\"Current = \",round(I,3),\"A\" \n", "print\"Resistance=\",R,\"Ohm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Current = 0.455 A\n", "Resistance= 484.0 Ohm\n" ] } ], "prompt_number": 59 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example no:5.24,Page no:182" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Variable declaration \n", "V=50 #voltage in Volts\n", "I=12 #Current in Ampere\n", "\n", "#Calculation\n", "P=V*I #power\n", "Pd=P*0.7 #power dissipated\n", "R=(Pd/(I)**2) \n", "\n", "#Result\n", "print\"Resistance = \",round(R,2),\"Ohm\" " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resistance = 2.92 Ohm\n" ] } ], "prompt_number": 82 } ], "metadata": {} } ] }