summaryrefslogtreecommitdiff
path: root/Basic_Electrical_Engineering/Chapter2.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Basic_Electrical_Engineering/Chapter2.ipynb')
-rwxr-xr-xBasic_Electrical_Engineering/Chapter2.ipynb1532
1 files changed, 1532 insertions, 0 deletions
diff --git a/Basic_Electrical_Engineering/Chapter2.ipynb b/Basic_Electrical_Engineering/Chapter2.ipynb
new file mode 100755
index 00000000..496486a8
--- /dev/null
+++ b/Basic_Electrical_Engineering/Chapter2.ipynb
@@ -0,0 +1,1532 @@
+{
+ "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(I<I_rated): print(\"The toaster will not be damaged as the current is lesser than the rated current. \\n\")\n",
+ "else: print(\"The toaster will not be damaged as the current is equal to the rated current. \\n\")\n",
+ "\n",
+ "print \"The power consumed is %.2f W.\" %(P_consumed) \n",
+ "\n",
+ "if (P_consumed>P_rated): print(\"The rating will be affected as the power consumed is greater than the power rating. \\n\")\n",
+ "elif(P_consumed<P_rated): print(\"The rating will not be affected as the power consumed is lesser than the power rating. \\n\") \n",
+ "else: print(\"The rating will not be affected as the power consumed is equal to the power rating. \\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rated current is 4.17 A.\n",
+ "The power rating is 1000.00 W.\n",
+ "The current drawn is 3.82 A.\n",
+ "The toaster will not be damaged as the current is lesser than the rated current. \n",
+ "\n",
+ "The power consumed is 840.28 W.\n",
+ "The rating will not be affected as the power consumed is lesser than the power rating. \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15,Page number: 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"To find the range of resistance of a colour coded resistor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Yellow=4.0 #Mutilplier corresponding to yellow band\n",
+ "Violet=7.0 #Mutilplier corresponding to violet band\n",
+ "Orange=1.0e03 #Mutilplier corresponding to orange band \n",
+ "Gold=5.0/100 #Mutilplier corresponding to gold band\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "R=((Yellow*10)+Violet)*Orange\n",
+ "Rmin=R-(Gold*R)\n",
+ "Rmax=R+(Gold*R)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resistance should be between %.2f kilo Ohms and %.2f kilo Ohms.\" %(Rmin/1000,Rmax/1000) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance should be between 44.65 kilo Ohms and 49.35 kilo Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.16,Page number: 30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"To find the range of resistance of a colour coded resistor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Gray=8.0 #Mutilplier corresponding to gray band\n",
+ "Blue=6.0 #Mutilplier corresponding to blue band\n",
+ "Gold_3=1.0e-01 #Mutilplier corresponding to first gold band\n",
+ "Gold_4=5.0/100 #Mutilplier corresponding to second gold band \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "R=((Gray*10.0)+Blue)*Gold_3\n",
+ "Rmin=R-(Gold_4*R)\n",
+ "Rmax=R+(Gold_4*R)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resistance should be between %.2f Ohms and %.2f Ohms.\" %(Rmin,Rmax) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance should be between 8.17 Ohms and 9.03 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.17,Page number: 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resistance at a given temperature.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R1=126 #Resistance of transmission at 20 degrees Celsius(in Ohms)\n",
+ "T1=20 #Initial temperature(in degrees Celsius) \n",
+ "T2=-35 #Final temperature(in degrees Celsius)\n",
+ "temp_coeff=0.00426 #Temperature coefficient of the material of transmission(in Ohm per degree per Ohm)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "R2=(1+(temp_coeff*T2))*(R1/(1+(temp_coeff*T1)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resistance of the line at -35 degree Celsius is %.2f Ohms.\" %(R2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance of the line at -35 degree Celsius is 98.80 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.18,Page number: 32 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the temperature rise for change in resistance value.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R1=3.42 #Resistance of Copper winding at room temperature(in Ohms) \n",
+ "T1=20 #Room temperature(in degrees Celsius)\n",
+ "R2=4.22 #Resistance of Copper winding after an extended operation of motor(in Ohms)\n",
+ "temp_coeff=0.00426 #Temperature coefficient of Copper(in Ohm per degree per Ohm)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "T2=(((R2*(1+(temp_coeff*T1)))/R1)-1)/temp_coeff\n",
+ "temp_rise=T2-T1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The temperature rise is %.2f degree Celsius.\" %(temp_rise)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature rise is 59.59 degree Celsius.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.19,Page number: 32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the ratio of resistances and lengths of two wires.\"\"\" \n",
+ "\n",
+ "#Variable Declaration:\n",
+ "k=1.0 #Resistance per metre of the metallic wire(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" x is the length of the wire 'P'.\n",
+ "\n",
+ " R_P=k*x;\n",
+ " R_Q=k*(1-x);\n",
+ " \n",
+ " R_R=4*R_P;(because length of 'R' is two times length of 'P',the area of cross-section reduces to half.Resistance is directly \n",
+ " proportional to length and inversely proportional to area of cross-section.) \"\"\"\n",
+ "\n",
+ "x=1.0/(1+4)\n",
+ "R_P=k*x\n",
+ "R_Q=(1.0-x)*k\n",
+ "R_R=R_Q\n",
+ "ratio_res=R_P/R_R\n",
+ "ratio_len=x/(1-x)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The ratio of resistances of P and R is %.2f:1. \" %(ratio_res) \n",
+ "print \"(b)The ratio of lengths of P and Q is %.2f:1. \" %(ratio_len)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The ratio of resistances of P and R is 0.25:1. \n",
+ "(b)The ratio of lengths of P and Q is 0.25:1. \n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.20,Page number: 32 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the equivalent resistance.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "\n",
+ "#Calculations:\n",
+ "R1=1.0/((1.0/5)+(1.0/6))\n",
+ "R2=1.0/((1.0/4)+(1.0/3))\n",
+ "R_AB_1=R1+R2\n",
+ "R3=6+(1.0/((1.0/6)+(1.0/12)))\n",
+ "R4=1.0/((1.0/R3)+(1.0/10))\n",
+ "R_AB_2=2+R4+3\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The resistance between terminals A and B is %.2f Ohms.\" %(R_AB_1)\n",
+ "print \"(b)The resistance between terminals A and B is %.2f Ohms.\" %(R_AB_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The resistance between terminals A and B is 4.44 Ohms.\n",
+ "(b)The resistance between terminals A and B is 10.00 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.21,Page number: 33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the pd between two corners.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I=20e-03 #Current entering the cube(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Rp1=12/3\n",
+ "Rp2=12/6\n",
+ "Rp3=Rp1\n",
+ "R_AG=Rp1+Rp2+Rp3\n",
+ "V_AG=R_AG*I\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The potential difference across the corners A and G is %.2f V.\" %(V_AG)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The potential difference across the corners A and G is 0.20 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.22,Page number: 34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding equivalent resistance between points E and F.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "#The delta connection between points A,B and C is first converted into its equivalent star connection by creating a new node 'O'.\n",
+ "R_AO=(4.0*6.0)/(2.0+4.0+6.0)\n",
+ "R_BO=(2.0*6.0)/(2.0+4.0+6.0)\n",
+ "R_CO=(2.0*4.0)/(2.0+4.0+6.0)\n",
+ "R_EF=(8.0*(8+(32.0/3)))/(8.0+(8.0+(32.0/3)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The equivalent resistance between points E and F is %.2f Ohms.\" %(R_EF)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equivalent resistance between points E and F is 5.60 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.23,Page number: 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Find the current drawn from the 5-V supply.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=5 #Voltage from the battery(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" The star connection between A,C and D can be converted into its equivalent delta connection. \"\"\"\n",
+ "R1=((2*3)+(3*2)+(2*2))/3.0\n",
+ "R2=((2*3)+(3*2)+(2*2))/2.0\n",
+ "R3=((2*3)+(3*2)+(2*2))/2.0\n",
+ "\n",
+ "\"\"\"It is important to note that point B is lost during the process of star-to-delts transformation. \"\"\"\n",
+ "\n",
+ "R4=((16.0/3)*(32.0/9))/((16.0/3)+(32.0/9))\n",
+ "R5=R4+3\n",
+ "I=V/R5\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current I drawn from the battery is %.4f A.\" %(I)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current I drawn from the battery is 0.9740 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.24,Page number: 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current and the pd between A and B.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=488.0 #Total power dissipated(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "R_CD=1.0/((1.0/5)+(1.0/20)+(1.0/2.5))\n",
+ "R_AB=R_CD+10\n",
+ "V=sqrt(P*R_AB)\n",
+ "I=V/R_AB\n",
+ "V_CD=V-(10*I)\n",
+ "I1=V_CD/5.0\n",
+ "I2=V_CD/20.0\n",
+ "I3=V_CD/2.5\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \" The current I1= %.2f A.\" %(I1) \n",
+ "print \" The current I2= %.2f A.\" %(I2)\n",
+ "print \" The current I3= %.2f A.\" %(I3)\n",
+ "print \" The pd between A and B is %.2f V.\" %(V)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The current I1= 2.00 A.\n",
+ " The current I2= 0.50 A.\n",
+ " The current I3= 4.00 A.\n",
+ " The pd between A and B is 75.04 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.25,Page number: 36 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resistance R.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_AB=5 #Voltage between points A and B(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V_AC=15*(10.0/(10+5))\n",
+ "V_BA=-V_AB\n",
+ "V_BC=V_BA+V_AC\n",
+ "\"\"\" V_BC=15.0*(R/(2+R));\n",
+ " 10+(5*R)=(15*R); \"\"\"\n",
+ "R=10/10\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The value of resistance R is %.2f Ohm.\" %(R)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of resistance R is 1.00 Ohm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.26,Page number: 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding current supplied by the source.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=100 #Voltage of the supply(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "R1=1.0/((1.0/6)+(1.0/3))\n",
+ "R2=5+3+R1\n",
+ "R_BC=1.0/((1.0/10)+(1/R2))\n",
+ "R3=5+R_BC\n",
+ "R_AD=1.0/((1.0/R3)+(1.0/10))\n",
+ "R_total=R_AD+5\n",
+ "I=V/R_total\n",
+ "\"\"\"The concept of current divider is used to find current I1 through the 6 Ohm resistance.At A,the 10 A current divides into \n",
+ " two parts: I_AD and I_AB.The current I_AB depends on the total resistance on the right of point A(which is 10 Ohms).Thus the two\n",
+ " currents will be equal.\n",
+ " \n",
+ " I_AB= I_AD= 5 A.\n",
+ " \n",
+ " I_AB divides equally into I_BC and I_BE. \n",
+ " I_BC= I_BE= 2.5 A. I_BE divides into I1 and I2. \"\"\"\n",
+ "\n",
+ "I_AB=I/2.0\n",
+ "I_AD=I_AB\n",
+ "I_BC=I_AB/2.0\n",
+ "I_BE=I_BC\n",
+ "I1=I_BE*(3.0/(3.0+6.0))\n",
+ "V_6=I1*6\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current supplied by the 100-V source is %.2f A.\" %(I)\n",
+ "print \"(b)The voltage across the 6-Ohms resistance is %.2f V.\" %(V_6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current supplied by the 100-V source is 10.00 A.\n",
+ "(b)The voltage across the 6-Ohms resistance is 5.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.27,Page number: 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resistance R.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=80 #Power dissipated(in Watts)\n",
+ "V=20 #Applied voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Rp=1.0/((1.0/8)+(1.0/12)+(1.0/24))\n",
+ "\"\"\" R_total=R+Rp \"\"\"\n",
+ "R_total=(V*V)/P\n",
+ "R=R_total-Rp\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resistance R is %.2f Ohm.\" %(R)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance R is 1.00 Ohm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.28,Page number: 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resistance R2.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=100.0 #Voltage of the supply(in Volts)\n",
+ "I=10.0 #Current drawn from the mains(in Amperes)\n",
+ "P=600.0 #Power dissipated in the resistor R1(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "R1=(V*V)/P\n",
+ "I1=V/R1\n",
+ "I2=I-I1\n",
+ "R2=V/I2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resistance R2 is %.2f Ohms.\" %(R2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance R2 is 25.00 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.29,Page number: 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the electrical energy generated per tonne of the fuel.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P_out=50 #Output power(in kilo-Watts)\n",
+ "effi=0.35 #Efficiency of the diesel generating set\n",
+ "cal=12500 #Calorific value of the fuel(in kcal/kg)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "P_in=P_out/effi\n",
+ "Heat_per_hour=P_in*860\n",
+ "Fuel=Heat_per_hour/cal\n",
+ "ener=(P_out/Fuel)*1000\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The quantity of oil needed per hour is %.2f kg.\" %(Fuel)\n",
+ "print \"(b)The electrical energy generated per tonne of the fuel is %.2f kWh.\" %(ener)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The quantity of oil needed per hour is 9.83 kg.\n",
+ "(b)The electrical energy generated per tonne of the fuel is 5087.21 kWh.\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.30,Page number: 38 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resistance of the heater and quantity of heat generated.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R_A=10.0 #Resistance of heater A(in Ohms)\n",
+ "t_A=20 #Time of operation of heater-A(in minutes) \n",
+ "t_B=10 #Time of operation of heater-B(in minutes)\n",
+ "H_A=500 #Heat produced by heater-A in time t_A(in kcal) \n",
+ "H_B=1000 #Heat produced by heater-B in time t_B(in kcal)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V=sqrt((H_A*4.2*1000*R_A)/(t_A*60))\n",
+ "R_B=(V*V*t_B*60)/(H_B*4.2*1000)\n",
+ "R=R_A+R_B\n",
+ "t=5*60\n",
+ "H=(((V*V)*t)/R)/(4.2*1000)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The resistance of heater-B is %.2f Ohms.\" %(R_B)\n",
+ "print \"(b)The heat produced in 5 minutes when the two heaters are connected in series across the same supply voltage is %.2f kcal.\" %(H)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The resistance of heater-B is 2.50 Ohms.\n",
+ "(b)The heat produced in 5 minutes when the two heaters are connected in series across the same supply voltage is 100.00 kcal.\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.31,Page number: 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding total current taken from the supply and energy consumed in a day.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "lamps=8 #Number of lamps\n",
+ "P_lamp=100 #Power rating of the lamp(in Watts)\n",
+ "fans=3 #Number of fans\n",
+ "P_fan=80 #Power rating of the fan(in Watts)\n",
+ "P_fridge=0.5 #Power rating of the fridge(in HP)\n",
+ "P_heater=1000 #Power rating of the Heater(in Watts)\n",
+ "V=230 #Voltage of the supply(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "total_load=(lamps*P_lamp)+(fans*P_fan)+(P_fridge*746)+P_heater\n",
+ "I=total_load/V\n",
+ "ener=(total_load*(1.0/4)*24)/1000\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The total current taken from the supply is %.2f A.\" %(I)\n",
+ "print \"(b)The energy consumed in a day, if on an average only a quarter of the above load persists all the time is %.4f kWh.\" %(ener)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The total current taken from the supply is 10.49 A.\n",
+ "(b)The energy consumed in a day, if on an average only a quarter of the above load persists all the time is 14.4780 kWh.\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file