diff options
author | nice | 2014-10-09 18:07:00 +0530 |
---|---|---|
committer | nice | 2014-10-09 18:07:00 +0530 |
commit | 36a03d6d76bac315dba73b2ba9555c7e3fe0234f (patch) | |
tree | 7e46e8873a7c92be2eef962a36e664c775aa6bf2 | |
parent | b8bb8bbfa81499ad7fc3f3508be257da65f543af (diff) | |
download | Python-Textbook-Companions-36a03d6d76bac315dba73b2ba9555c7e3fe0234f.tar.gz Python-Textbook-Companions-36a03d6d76bac315dba73b2ba9555c7e3fe0234f.tar.bz2 Python-Textbook-Companions-36a03d6d76bac315dba73b2ba9555c7e3fe0234f.zip |
updated books
208 files changed, 123537 insertions, 15951 deletions
diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter10.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter10.ipynb new file mode 100755 index 00000000..946a157a --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter10.ipynb @@ -0,0 +1,1357 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10: AC CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1,Page number: 274 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the power factor and the average power dissipated.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi,cos,degrees\n",
+ "from cmath import rect,phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vm=141.0 #Peak value of supply voltage(in Volts)\n",
+ "ang_freq=100.0*pi #Angular frequency(in radians per second) \n",
+ "R=3.0 #Resistance(in Ohms) \n",
+ "L=0.0127 #Self-inductance of the coil(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calcultaions:\n",
+ "Vrms=Vm/sqrt(2.0)\n",
+ "V=rect(Vrms,0.0)\n",
+ "X_L=ang_freq*L\n",
+ "Z=R+ (X_L*1j)\n",
+ "I=V/Z\n",
+ "ang_I=degrees(phase(I))\n",
+ "P=Vrms*abs(I)*cos(phase(I))\n",
+ "pf=cos(phase(I))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The rms value of the steady-state current is %.2f A and the relative phase angle is %.2f degrees.\" %(abs(I),-ang_I)\n",
+ "print \"(b)The expression for the instantaneous current is i=%.3f sin(100*pi*t%.2f degrees) A.\" %((sqrt(2)*abs(I)),ang_I)\n",
+ "print \"(c)The average power dissipated in the circuit is %.2f W.\" %(P)\n",
+ "print \"(d)The power factor is %.3f lagging.\" %(pf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The rms value of the steady-state current is 19.97 A and the relative phase angle is 53.06 degrees.\n",
+ "(b)The expression for the instantaneous current is i=28.246 sin(100*pi*t-53.06 degrees) A.\n",
+ "(c)The average power dissipated in the circuit is 1196.75 W.\n",
+ "(d)The power factor is 0.601 lagging.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2,Page number: 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the capacitance required,the phase angle,the power factor,the apparent power,and the reactive power.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi,degrees,acos,cos,sin\n",
+ "\n",
+ "#Variable Declaration: \n",
+ "V=230.0 #Rms value of supply voltage(in Volts)\n",
+ "f=50.0 #Frequency of supply(in Hertz) \n",
+ "P_lamp=750.0 #Power rating of the lamp(in Watts) \n",
+ "V_lamp=100.0 #Voltage rating of the lamp(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_rated=P_lamp/V_lamp\n",
+ "Vc=sqrt((V*V)-(V_lamp*V_lamp))\n",
+ "Xc=Vc/I_rated\n",
+ "C=1/(2*pi*f*Xc)\n",
+ "phase_angle=acos(V_lamp/V)\n",
+ "pf=cos(phase_angle)\n",
+ "app_P=V*I_rated\n",
+ "rea_P=V*I_rated*sin(phase_angle)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The required capacitance is %e F.\" %(C)\n",
+ "print \"(b)The phase angle is %.3f degrees.\" %(degrees(phase_angle))\n",
+ "print \"(c)The power factor is %.3f leading.\" %(pf)\n",
+ "print \"(d)The apparent power is %.3f VA.\" %(app_P)\n",
+ "print \"(e)The reactive power is %.3f VAr.\" %(rea_P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The required capacitance is 1.152611e-04 F.\n",
+ "(b)The phase angle is 64.229 degrees.\n",
+ "(c)The power factor is 0.435 leading.\n",
+ "(d)The apparent power is 1725.000 VA.\n",
+ "(e)The reactive power is 1553.424 VAr.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3,Page number: 277 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question: \n",
+ "\"\"\"Finding the impedance,the power factor,supply voltage,voltage across resistor,apparent power and reactive power.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import pi,cos,sin,degrees\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I=rect(0.9,0) #Current in the circuit(in Amperes)\n",
+ "R=120.0 #Resistance of the resistor(in Ohms) \n",
+ "Xc=250.0 #Reactance of the capacitor(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z=R- Xc*1j\n",
+ "pf=cos(phase(Z))\n",
+ "V=I*Z\n",
+ "V_R=I*R\n",
+ "V_C=I*Xc\n",
+ "act_P=abs(V)*abs(I)*cos(phase(Z))\n",
+ "app_P=abs(V)*abs(I)\n",
+ "rea_P=abs(V)*abs(I)*sin(phase(Z))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The impedance is %.3f ohm at a phase angle of %.3f degrees.\" %(abs(Z),degrees(phase(Z)))\n",
+ "print \"The power factor is %.3f leading.\" %(pf)\n",
+ "print \"The supply voltage is %.3f V at a phase angle of %.3f degrees.\" %(abs(V),degrees(phase(V)))\n",
+ "print \"The voltage across resistor is %.3f V at a phase angle of %.3f degrees.\" %(abs(V_R),degrees(phase(V_R)))\n",
+ "print \"The voltage across capacitor is %.3f V at a phase angle of %.3f degrees.\" %(abs(V_C),-90)\n",
+ "print \"The apparent power is %.3f VA.\" %(app_P)\n",
+ "print \"The active power is %.3f W.\" %(act_P)\n",
+ "print \"The reactive power is %.3f VAr.\" %(rea_P)\n",
+ "print \"Note: Negative sign indicates the capacitor supplies reactive power.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impedance is 277.308 ohm at a phase angle of -64.359 degrees.\n",
+ "The power factor is 0.433 leading.\n",
+ "The supply voltage is 249.578 V at a phase angle of -64.359 degrees.\n",
+ "The voltage across resistor is 108.000 V at a phase angle of 0.000 degrees.\n",
+ "The voltage across capacitor is 225.000 V at a phase angle of -90.000 degrees.\n",
+ "The apparent power is 224.620 VA.\n",
+ "The active power is 97.200 W.\n",
+ "The reactive power is -202.500 VAr.\n",
+ "Note: Negative sign indicates the capacitor supplies reactive power.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.4,Page number: 279 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the impedance of the circuit and state whether it is inductive or capacitive.\"\"\"\n",
+ "\n",
+ "from cmath import phase,rect\n",
+ "from math import pi,degrees,radians,cos,sin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=160.0 +120.0*1j #ac sinusoidal voltage(in Volts) \n",
+ "I=-4.0+10.0*1j #Current in circuit(in Amperes) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z=V/I\n",
+ "\n",
+ "if Z.imag>0:\n",
+ " print(\"The nature of circuit is inductive\\n\")\n",
+ " pf_type=\"lagging\"\n",
+ "\n",
+ "elif Z.imag<0:\n",
+ " print(\"The nature of circuit is capacitive\\n\")\n",
+ " pf_type=\"leading\" \n",
+ " \n",
+ "else:\n",
+ " print(\"The nature of circuit is resistive\\n\")\n",
+ "\n",
+ "pf=cos(phase(Z))\n",
+ "act_P=abs(V)*abs(I)*pf\n",
+ "rea_P=abs(V)*abs(I)*sin(pi+phase(Z))\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The power factor is %.3f %s.\" %(pf,pf_type)\n",
+ "print \"The active power is %.2f W.\" %(act_P)\n",
+ "print \"The reactive power is %.2f VAr.\" %(rea_P) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nature of circuit is capacitive\n",
+ "\n",
+ "The power factor is 0.260 leading.\n",
+ "The active power is 560.00 W.\n",
+ "The reactive power is 2080.00 VAr.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.5,Page number: 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the values of the two circuit elements.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=50 #Frequency of the source(in Hertz)\n",
+ "Z=10+10*1j #Impedance of the circuit(in Ohm) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "ang_freq=2*pi*f\n",
+ "R=Z.real\n",
+ "X_L=Z.imag\n",
+ "L=X_L/ang_freq\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The nature of the impedance indicates that the circiut is inductive.\\n\"\n",
+ "print \"The values of the two elements are: \\n(a)Resistance(R)=%.2f ohm \\n(b)Inductance(C)=%e H.\" %(R,L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nature of the impedance indicates that the circiut is inductive.\n",
+ "\n",
+ "The values of the two elements are: \n",
+ "(a)Resistance(R)=10.00 ohm \n",
+ "(b)Inductance(C)=3.183099e-02 H.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.6,Page number: 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the values of the two circuit elements.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=50.0 #Frequency of the source(in Hertz)\n",
+ "Z=10.0-10.0*1j #Impedance of the circuit(in Ohm) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "ang_freq=2.0*pi*f\n",
+ "Y=1.0/Z\n",
+ "R=1/Y.real\n",
+ "C=Y.imag/ang_freq\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The nature of the impedance indicates that the circiut is capacitive.\\n\"\n",
+ "print \"The values of the two elements are: \\n(a)Resistance(R)=%.2f ohm \\n(b)Capacitance(C)=%e F.\" %(R,C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nature of the impedance indicates that the circiut is capacitive.\n",
+ "\n",
+ "The values of the two elements are: \n",
+ "(a)Resistance(R)=20.00 ohm \n",
+ "(b)Capacitance(C)=1.591549e-04 F.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.7,Page number: 281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the impedance,the current,the phase angle,the voltage across each element and power factor.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import cos,pi,degrees\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=12.0 #Resistance of the resistor(in Ohms)\n",
+ "L=0.15 #Self-inductance of the inductor(in Henry)\n",
+ "C=100e-06 #Capacitance of the capacitor(in Farad)\n",
+ "f=50 #Frequency of the source(in Hertz) \n",
+ "V=rect(100,0) #Supply voltage(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "ang_freq=2*pi*f\n",
+ "X_L=ang_freq*L\n",
+ "X_C=1/(ang_freq*C)\n",
+ "Z=R + (X_L-X_C)*1j\n",
+ "\n",
+ "if Z.imag>0:\n",
+ " pf_type=\"lagging\"\n",
+ "\n",
+ "elif Z.imag<0:\n",
+ " pf_type=\"leading\" \n",
+ " \n",
+ "else:\n",
+ " print(\"The nature of circuit is resistive\\n\")\n",
+ "\n",
+ "I=V/Z\n",
+ "V_R=abs(I)*R\n",
+ "V_C=abs(I)*X_C\n",
+ "V_L=abs(I)*X_L\n",
+ "pf=cos(phase(I))\n",
+ "app_P=abs(V)*abs(I)\n",
+ "avg_P=abs(V)*abs(I)*pf\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The impedance is %.3f ohm at a phase angle of %.3f degrees.\" %(abs(Z),degrees(phase(Z)))\n",
+ "print \"(b)The current is %.3f A at a phase angle of %.3f degrees.\" %(abs(I),degrees(phase(I)))\n",
+ "print \"(c)The phase angle is %.3f degrees.\" %(degrees(phase(I)))\n",
+ "print \"(d)The voltage across the resistor is %.2f V.\" %(V_R) \n",
+ "print \" The voltage across the capacitor is %.2f V.\\n The voltage across the inductor is %.2f V.\" %(V_C,V_L)\n",
+ "print \"(e)The power factor is %.3f %s.\" %(pf,pf_type)\n",
+ "print \"(f)The apparent power is %.3f VA.\" %(app_P) \n",
+ "print \"(g)The average power is %.3f W.\" %(avg_P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The impedance is 19.439 ohm at a phase angle of 51.880 degrees.\n",
+ "(b)The current is 5.144 A at a phase angle of -51.880 degrees.\n",
+ "(c)The phase angle is -51.880 degrees.\n",
+ "(d)The voltage across the resistor is 61.73 V.\n",
+ " The voltage across the capacitor is 163.75 V.\n",
+ " The voltage across the inductor is 242.42 V.\n",
+ "(e)The power factor is 0.617 lagging.\n",
+ "(f)The apparent power is 514.431 VA.\n",
+ "(g)The average power is 317.567 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.8,Page number: 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage across the capacitor by applying Thevenin's theorem.\"\"\"\n",
+ "\n",
+ "from math import sqrt,degrees\n",
+ "from cmath import rect,phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "\"\"\" Note: All the impedances are expresssed in kilo ohm.\"\"\" \n",
+ "ang_freq=3000.0 #Angular frequency(in radians per second)\n",
+ "Vs_m=40.0 #Peak value of the supply voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vs_rms=Vs_m/sqrt(2.0)\n",
+ "Vs=rect(Vs_rms,0)\n",
+ "Zeq=1.5 + ((1.0-(2.0*1j))/(1j+1.0-2.0*1j))*1.0j\n",
+ "I=Vs/Zeq\n",
+ "Im=abs(I)*sqrt(2)\n",
+ "V_Th=Vs*(1j/(1.5+1j))\n",
+ "Z_Th=1+ ((1.5*1j)/(1.5+1j))\n",
+ "Vc=V_Th*((-2*1j)/(Z_Th-2*1j))\n",
+ "Z_L=Z_Th.real-Z_Th.imag*1j \n",
+ "C=1/(ang_freq*abs(Z_L.imag)*1000)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The expression for i(t) can be written as i(t)=%.1f sin(%dt%.2fdegrees) mA.\" %(Im,ang_freq,degrees(phase(I)))\n",
+ "print \"(b)The voltage across the capacitor by applying Thevenin's theorem is %.3f V at a phase angle of %.3f degrees.\" %(abs(Vc),degrees(phase(Vc)))\n",
+ "print \"(c)The values of the two elements of the load impedance that consumes maximum power are R=%e kilo Ohms and C=%e F.\" %(Z_L.real,C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The expression for i(t) can be written as i(t)=16.0 sin(3000t-36.87degrees) mA.\n",
+ "(b)The voltage across the capacitor by applying Thevenin's theorem is 16.000 V at a phase angle of 8.130 degrees.\n",
+ "(c)The values of the two elements of the load impedance that consumes maximum power are R=1.461538e+00 kilo Ohms and C=4.814815e-07 F.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.9,Page number: 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the value of resistance for a desired power factor.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "from cmath import atan\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "pf=0.8 #Power factor of the circuit\n",
+ "X_C=60.0 #Capacitive reactance(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "sin_ang=sqrt(1-(pf*pf))\n",
+ "tan_ang=sin_ang/pf\n",
+ "R=X_C/tan_ang\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The value of R for which the power factor of the circuit is 0.8 is %.2f Ohms.\" %(R)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R for which the power factor of the circuit is 0.8 is 80.00 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.10,Page number: 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resistance and the inductance of the coil.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vdc=20.0 #Supply dc voltage(in Volts)\n",
+ "Idc=4.0 #Current drawn by the coil(in Amperes)\n",
+ "f=50.0 #Frequency of supply voltage(in Hertz)\n",
+ "Vs=65.0 #Ac supply voltage(in Volts)\n",
+ "I=5.0 #Current drawn by the choke when connected ac supply(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "R=Vdc/Idc\n",
+ "Z=Vs/I\n",
+ "X_L=sqrt((Z*Z)-(R*R))\n",
+ "L=X_L/(2*pi*f)\n",
+ "pf=R/Z\n",
+ "P=Vs*I*pf\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The resistance of the coil is %.2f Ohms and the inductance of the coil is %.5f H.\" %(R,L)\n",
+ "print \"(b)The power factor is %.3f lagging.\" %(pf)\n",
+ "print \"(c)The power(real) drawn by the coil is %.3f W.\" %(P) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The resistance of the coil is 5.00 Ohms and the inductance of the coil is 0.03820 H.\n",
+ "(b)The power factor is 0.385 lagging.\n",
+ "(c)The power(real) drawn by the coil is 125.000 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.11,Page number: 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resistance and inductance of the coil.\"\"\"\n",
+ "\n",
+ "from math import pi,pow,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vs=240.0 #AC supply voltage(in Volts)\n",
+ "f1=50.0 #Frequency of the ac supply voltage(in Hertz) \n",
+ "I1=60.0 #First reading of the ammeter(in Amperes)\n",
+ "f2=100.0 #Frequency of the ac supply voltage(in Hertz)\n",
+ "I2=40.0 #Second reading of the ammeter(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z1=Vs/I1\n",
+ "Z2=Vs/I2\n",
+ "L=sqrt(((Z2*Z2)-(Z1*Z1))/((pow((200*pi),2.0))-(pow((100*pi),2.0))))\n",
+ "X1=2*pi*f1*L\n",
+ "R=sqrt((Z1*Z1)-(X1*X1))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resistance of the coil is %.2f Ohms.\" %(R)\n",
+ "print \"The inductance of the coil is %.5f H.\" %(L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance of the coil is 3.06 Ohms.\n",
+ "The inductance of the coil is 0.00822 H.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.12,Page number: 287 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the power consumed by the choke coil.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=100.0 #Resistance of the resistor(in Ohms)\n",
+ "V_R=200.0 #Voltage across resistor(in Volts)\n",
+ "V_Ch=300.0 #Voltage across choke coil(in Volts)\n",
+ "Vs=440.0 #Supply voltage(in Volts)\n",
+ "\n",
+ " \n",
+ "#Calculations:\n",
+ "pf=((Vs*Vs)-(V_R*V_R)-(V_Ch*V_Ch))/(2*V_R*V_Ch)\n",
+ "I=V_R/R\n",
+ "P=V_Ch*I*pf\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The power consumed by the choke coil is %.2f W.\" %(P) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power consumed by the choke coil is 318.00 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.13,Page number: 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the power dissipated in each coil.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "from cmath import phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R1=15.0 #Resistance of the first coil(in Ohms)\n",
+ "L1=0.2 #Inductance of the first coil(in Henry)\n",
+ "R2=25.0 #Resistance of the second coil(in Ohms)\n",
+ "L2=0.04 #Inductance of the second coil(in Henry)\n",
+ "V=230.0 #Supply voltage(in Volts)\n",
+ "f=50.0 #Frequency of supply voltage(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "X1=2*pi*f*L1\n",
+ "X2=2*pi*f*L2\n",
+ "Z1=R1+(1j*X1)\n",
+ "Z2=R2+(1j*X2)\n",
+ "Z=Z1+Z2\n",
+ "I=V/Z\n",
+ "V1=abs(I)*abs(Z1)\n",
+ "V2=abs(I)*abs(Z2)\n",
+ "P1=abs(I)*abs(I)*R1\n",
+ "P2=abs(I)*abs(I)*R2\n",
+ "pf=cos(phase(I))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The voltage across the first coil is %.2f V and the voltage across the second coil is %.2f V.\" %(V1,V2)\n",
+ "print \"(b)The power dissipated by the first coil is %.2f W and power dissipated by the second coil is %.2f W.\" %(P1,P2)\n",
+ "print \"(c)The power factor of the whole circuit is %.3f lagging.\" %(pf) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The voltage across the first coil is 174.07 V and the voltage across the second coil is 75.40 V.\n",
+ "(b)The power dissipated by the first coil is 108.92 W and power dissipated by the second coil is 181.54 W.\n",
+ "(c)The power factor of the whole circuit is 0.469 lagging.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.14,Page number: 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current and power drawn from the source.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I_A=8.0 #Current through coil A(in Amperes)\n",
+ "I_B=10.0 #Current through coil B(in Amperes)\n",
+ "V=100.0 #Voltage of the source(in Volts)\n",
+ "f=50.0 #Frequency of the supply(in Hertz)\n",
+ "P_A=120.0 #Power delivered to coil A(in Watts) \n",
+ "P_B=500.0 #Power delivered to coil B(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z_A=V/I_A\n",
+ "Z_B=V/I_B\n",
+ "R_A=P_A/(I_A*I_A)\n",
+ "R_B=P_B/(I_B*I_B)\n",
+ "X_A=sqrt((Z_A*Z_A)-(R_A*R_A))\n",
+ "X_B=sqrt((Z_B*Z_B)-(R_B*R_B))\n",
+ "R=R_A+R_B\n",
+ "X=X_A+X_B\n",
+ "Z=sqrt((R*R)+(X*X))\n",
+ "I=V/Z\n",
+ "P=I*I*R\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current when the two coils are in series is %.2f A and the power taken from the source is %.2f W.\" %(I,P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current when the two coils are in series is 4.52 A and the power taken from the source is 140.58 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.15,Page number: 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage drop across each coil.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=240.0 #Voltage of the source(in Volts)\n",
+ "f=50.0 #Frequency of the supply(in Hertz)\n",
+ "R_A=5.0 #Resistance of coil A(in Ohms)\n",
+ "L_B=0.015 #Inductance of the coil B(in Henry)\n",
+ "P=3e03 #Active power(in Watts)\n",
+ "Q=2e03 #Reactive power(in VAr)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "S=sqrt((P*P)+(Q*Q))\n",
+ "I=S/V\n",
+ "R_B=(P/(I*I))-R_A\n",
+ "X_B=2*pi*f*L_B\n",
+ "X_A=(Q/(I*I))-X_B\n",
+ "L_A=X_A/(2*pi*f)\n",
+ "Z_A=sqrt((R_A*R_A)+(X_A*X_A))\n",
+ "Z_B=sqrt((R_B*R_B)+(X_B*X_B))\n",
+ "V_A=Z_A*I\n",
+ "V_B=Z_B*I\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The resistance of coil B is %.2f Ohms.\" %(R_B)\n",
+ "print \"(b)The inductance of coil A is %.5f Henry.\" %(L_A)\n",
+ "print \"(c)The voltage drop across coil A is %.2f V and across coil B is %.2f V.\" %(V_A,V_B)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The resistance of coil B is 8.29 Ohms.\n",
+ "(b)The inductance of coil A is 0.01321 Henry.\n",
+ "(c)The voltage drop across coil A is 97.61 V and across coil B is 143.29 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.16,Page number: 289"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the total power consumed by the circuit and the power factor of the circuit.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=100.0 #Power rating of the bulb(in Watts)\n",
+ "V=120.0 #Voltage rating of the bulb(in Volts)\n",
+ "Vs=240.0 #Supply voltage(in Volts)\n",
+ "f=50.0 #Frequency of the supply(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I=P/V\n",
+ "V_R=Vs-V\n",
+ "R=V_R/I\n",
+ "pf_a=1.0\n",
+ "Pt_a=Vs*I\n",
+ "V_C=sqrt((Vs*Vs)-(V*V))\n",
+ "X_C=V_C/I\n",
+ "C=1/(2*pi*X_C*f)\n",
+ "pf_b=V/Vs\n",
+ "Pt_b=Vs*I*pf_b\n",
+ "Vr=I*10.0\n",
+ "V_L=sqrt((Vs*Vs)-((V+Vr)*(V+Vr)))\n",
+ "X_L=V_L/I\n",
+ "L=X_L/(2*pi*f)\n",
+ "V_R_c=V+Vr\n",
+ "pf_c=V_R_c/Vs\n",
+ "Pt_c=Vs*I*pf_c\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The value of the component used R=%.2f Ohms.\" %(R)\n",
+ "print \" The total power consumed is %.2f W.\" %(Pt_a)\n",
+ "print \" The power factor is %.2f.\" %(pf_a)\n",
+ "print \"(b)The value of the component used C=%e Farad.\" %(C)\n",
+ "print \" The total power consumed is %.2f W.\" %(Pt_b)\n",
+ "print \" The power factor is %.2f leading.\" %(pf_b)\n",
+ "print \"(c)The value of the component used R=10 Ohms and L=%.3f Henry.\" %(L)\n",
+ "print \" The total power consumed is %.2f W.\" %(Pt_c)\n",
+ "print \" The power factor is %.3f lagging.\" %(pf_c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The value of the component used R=144.00 Ohms.\n",
+ " The total power consumed is 200.00 W.\n",
+ " The power factor is 1.00.\n",
+ "(b)The value of the component used C=1.276224e-05 Farad.\n",
+ " The total power consumed is 100.00 W.\n",
+ " The power factor is 0.50 leading.\n",
+ "(c)The value of the component used R=10 Ohms and L=0.775 Henry.\n",
+ " The total power consumed is 106.94 W.\n",
+ " The power factor is 0.535 lagging.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.17,Page number: 289\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the value of capacitance C in the cirucit.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=20.0 #Resistance connected in series(in Ohms)\n",
+ "L=15e-03 #Pure inductance in parallel with the capacitor(in Henry)\n",
+ "ang_fre=1000.0 #Angular frequency of voltage source(in radians per second)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "X_L=ang_fre*L\n",
+ "X=R*tan(pi/4.0)\n",
+ "\"\"\"Case 1:(X is inductive)\"\"\"\n",
+ "X_C1=1.0/((1.0/X_L)-(1.0/X))\n",
+ "C1=1.0/(ang_fre*X_C1)\n",
+ "\"\"\"Case 2:(X is capacitive)\"\"\"\n",
+ "X_C2=1.0/((1.0/X_L)+(1.0/X))\n",
+ "C2=1.0/(ang_fre*X_C2)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The value of capacitance is:\"\n",
+ "print \"Case 1: If net reactance X is inductive, C=%e Farad.\" %(C1) \n",
+ "print \"Case 2: If net reactance X is capacitive, C=%e Farad.\" %(C2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of capacitance is:\n",
+ "Case 1: If net reactance X is inductive, C=1.666667e-05 Farad.\n",
+ "Case 2: If net reactance X is capacitive, C=1.166667e-04 Farad.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.18,Page number: 290\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding total current in the circuit.\"\"\"\n",
+ "\n",
+ "from cmath import phase\n",
+ "from math import degrees\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Z1=(12+1j*15) #Impedance of the first branch(in Ohms) \n",
+ "Z2=(8-1j*4) #Impedance of the second branch(in Ohms)\n",
+ "V=(230+1j*0) #Potential difference across the parallel combination(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=V/Z1\n",
+ "I2=V/Z2\n",
+ "I=I1+I2\n",
+ "P=abs(V)*abs(I)*cos(phase(I))\n",
+ "P1=abs(I1)*abs(I1)*(Z1.real)\n",
+ "P2=abs(I2)*abs(I2)*(Z2.real)\n",
+ "pf1=Z1.real/abs(Z1)\n",
+ "pf2=Z2.real/abs(Z2)\n",
+ "pf=cos(phase(I))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current supplied to branch 1 is %.2f A at a phase angle of %.2f degrees.\" %(abs(I1),degrees(phase(I1))) \n",
+ "print \" The current supplied to branch 2 is %.2f A at a phase angle of %.2f degrees.\" %(abs(I2),degrees(phase(I2))) \n",
+ "print \" The total current is %.2f A at a phase angle of %.2f degrees.\\n\" %(abs(I),degrees(phase(I)))\n",
+ "print \"(b)The power consumed by branch 1 is %.2f W.\" %(P1)\n",
+ "print \" The power consumed by branch 2 is %.2f W.\" %(P2)\n",
+ "print \" The total power consumed is %.2f W.\\n\" %(P)\n",
+ "print \"(c)The power factor of branch 1 is %.4f lagging.\" %(pf1)\n",
+ "print \" The power factor of branch 2 is %.4f leading.\" %(pf2)\n",
+ "print \" The overall power factor of the circuit is %.4f leading.\" %(pf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current supplied to branch 1 is 11.97 A at a phase angle of -51.34 degrees.\n",
+ " The current supplied to branch 2 is 25.71 A at a phase angle of 26.57 degrees.\n",
+ " The total current is 30.56 A at a phase angle of 4.04 degrees.\n",
+ "\n",
+ "(b)The power consumed by branch 1 is 1720.33 W.\n",
+ " The power consumed by branch 2 is 5290.00 W.\n",
+ " The total power consumed is 7010.33 W.\n",
+ "\n",
+ "(c)The power factor of branch 1 is 0.6247 lagging.\n",
+ " The power factor of branch 2 is 0.8944 leading.\n",
+ " The overall power factor of the circuit is 0.9975 leading.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.19,Page number: 290\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resistance and inductance of a coil.\"\"\"\n",
+ "\n",
+ "from math import acos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=230.0 #Voltage of the supply(in Volts)\n",
+ "f=50.0 #Frequency of the supply ac voltage(in Hertz)\n",
+ "R=50.0 #Reistance in series with the coil(in Ohms) \n",
+ "V_coil=180.0 #Voltage across coil(in Volts)\n",
+ "V_R=130.0 #Voltage across resistance(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I=V_R/R\n",
+ "\"\"\"From parallelogram OACB,the angle theta is calculated.\"\"\"\n",
+ "cos_theta=((V*V)-(V_R*V_R)-(V_coil*V_coil))/(2*V_R*V_coil)\n",
+ "theta=acos(cos_theta)\n",
+ "V_L=V_coil*sin(theta)\n",
+ "V_r=V_coil*cos(theta)\n",
+ "L=V_L/(I*2*pi*f)\n",
+ "r=V_r/I\n",
+ "P=I*V_r\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The resistance of the coil is %.2f Ohms and the inductance is %.2f H.\" %(r,L)\n",
+ "print \"(b)The power dissipated in the coil is %.2f W.\" %(P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The resistance of the coil is 5.33 Ohms and the inductance is 0.22 H.\n",
+ "(b)The power dissipated in the coil is 36.00 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.20,Page number: 291\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the component values of the circuit.\"\"\"\n",
+ "\n",
+ "from math import pi,sqrt,radians,cos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vm=141.4 #Peak value of supply voltage(in Volts) \n",
+ "Im=7.07 #Peak value of current in the series circuit(in Amperes)\n",
+ "ang_fre=2000.0 #Angular frequency of the ac signal(in radians per second) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V=Vm/sqrt(2.0)\n",
+ "I=Im/sqrt(2.0)\n",
+ "Z=V/I\n",
+ "\"\"\" We know that V=I*Z; \n",
+ " \n",
+ " 100=5*sqrt((R*R)+(X_C*X_C));\n",
+ " \n",
+ " (R*R)+(X_C*X_C)=400; \n",
+ " \n",
+ " From the triangle OAB,\n",
+ " \n",
+ " cos(36.87)=V_R/V; \"\"\"\n",
+ "R=(V*cos(radians(36.87)))/I\n",
+ "X_C=sqrt((Z*Z)-(R*R))\n",
+ "C=1.0/(ang_fre*X_C)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The elements of the circuit are R=%.2f Ohms and C=%e Farad.\" %(R,C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The elements of the circuit are R=16.00 Ohms and C=4.166657e-05 Farad.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.21,Page number: 292\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage and current by Thevenin's theorem.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import degrees,radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vs=rect(100,radians(20))\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Using voltage divider rule,\"\"\"\n",
+ "Z2=((1j*20)*(15-1j*30))/((1j*20)+(15-1j*30))\n",
+ "Z=10+Z2\n",
+ "I=Vs/Z\n",
+ "V2_div=Vs*(Z2/(10+Z2))\n",
+ "V1_div=V2_div*((-1j*30)/(15-1j*30))\n",
+ "\"\"\"Using Thevenin's theorem,\"\"\"\n",
+ "V_Th=Vs*((15-1j*30)/(10+15-1j*30))\n",
+ "Z_Th=(10*(15-1j*30))/(10+(15-1j*30))\n",
+ "V2=V_Th*((1j*20)/(Z_Th+1j*20))\n",
+ "V_Th=Vs*((1j*20)/(10+1j*20))\n",
+ "Z_Th=15+(1.0/((1.0/10)+(1.0/(1j*20))))\n",
+ "V1=V_Th*((-1j*30)/(Z_Th-1j*30))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)By voltage divider rule,\"\n",
+ "print \"(i)The current I is %.2f A at an angle of %.2f degrees.\" %(abs(I),degrees(phase(I))) \n",
+ "print \"(ii)The voltage V1 is %.2f V at an angle of %.2f degrees.\" %(abs(V1_div),degrees(phase(V1_div)))\n",
+ "print \"(b)By applying Thevenin's theorem,\"\n",
+ "print \"(i)The voltage V1 is %.2f V at an angle of %.2f degrees.\" %(abs(V1),degrees(phase(V1)))\n",
+ "print \"(ii)The voltage V2 is %.2f V at an angle of %.2f degrees.\" %(abs(V2),degrees(phase(V2)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)By voltage divider rule,\n",
+ "(i)The current I is 2.32 A at an angle of -28.62 degrees.\n",
+ "(ii)The voltage V1 is 77.30 V at an angle of 5.07 degrees.\n",
+ "(b)By applying Thevenin's theorem,\n",
+ "(i)The voltage V1 is 77.30 V at an angle of 5.07 degrees.\n",
+ "(ii)The voltage V2 is 86.42 V at an angle of 31.63 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.22,Page number: 293\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current by Norton's theorem.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import degrees,radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Is=rect(20,radians(45)) #Current supplied by current source(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Using current divider rule,\"\"\"\n",
+ "Z2=(1j*3)+1.0/((1.0/4)+(1.0/(-1j*5)))\n",
+ "I=Is*(2/(Z2+2))\n",
+ "I_R_div=I*((-1j*5)/(4-1j*5))\n",
+ "\"\"\"Using Norton's theorem,\"\"\"\n",
+ "I_N=Is*(2/(2+1j*3))\n",
+ "Z_N=1.0/((1.0/(2+1j*3))+(1.0/(-1j*5)))\n",
+ "I_R=I_N*(Z_N/(Z_N+4))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)By current divider rule,\"\n",
+ "print \" The current I_R is %.2f A at an angle of %.2f degrees.\" %(abs(I_R_div),degrees(phase(I_R_div)))\n",
+ "print \"(a)By Norton's theorem,\"\n",
+ "print \" The current I_R is %.2f A at an angle of %.2f degrees.\" %(abs(I_R),degrees(phase(I_R)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)By current divider rule,\n",
+ " The current I_R is 6.85 A at an angle of -6.95 degrees.\n",
+ "(a)By Norton's theorem,\n",
+ " The current I_R is 6.85 A at an angle of -6.95 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.23,Page number: 294\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage by Thevenin's theorem.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import radians,degrees\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vs=rect(200,radians(30.0))\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z2=((40)*(20+1j*50))/(40+(20+1j*50))\n",
+ "V2=(Vs*Z2)/(Z2-1j*20)\n",
+ "V_div=V2*(20/(20+1j*50))\n",
+ "V_Th=Vs*(40/(40-1j*20))\n",
+ "Z_Th=(1j*50)+1.0/((1.0/(-1j*20))+(1.0/40))\n",
+ "V=(V_Th*20)/(Z_Th+20)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)V using voltage divider rule is %.2f V at an angle of %.2f degrees.\" %(abs(V_div),degrees(phase(V_div)))\n",
+ "print \"(b)The voltage V using Thevenin's theorem is %.2f V at an angle of %.2f degrees.\" %(abs(V),degrees(phase(V)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)V using voltage divider rule is 81.23 V at an angle of 6.04 degrees.\n",
+ "(b)The voltage V using Thevenin's theorem is 81.23 V at an angle of 6.04 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter11.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter11.ipynb new file mode 100755 index 00000000..e9007ce3 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter11.ipynb @@ -0,0 +1,929 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11: RESONANCE IN AC CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.1,Page number: 315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resonant frequency,quality factor,voltage across each element in a series RLC circuit.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=12.0 #Resistance of resistor(in Ohms)\n",
+ "L=0.15 #Self-inductance of inductor(in Henry)\n",
+ "C=100e-06 #Capacitance of capacitor(in Farads) \n",
+ "V=100.0 #Voltage(rms) of ac source(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "resonant_freq=1/(2.0*pi*sqrt(L*C))\n",
+ "I_max=V/R\n",
+ "freq_c=(sqrt((1.0/(L*C))-(0.5*pow((R/L),2))))/(2.0*pi)\n",
+ "freq_l=1.0/(sqrt((L*C)-(0.5*pow((R*C),2)))*2*pi)\n",
+ "cap_rea=1.0/(2.0*pi*freq_l*C)\n",
+ "ind_rea=2.0*pi*round(freq_l,2)*L\n",
+ "Q=cap_rea/R\n",
+ "Vr=V\n",
+ "Vl=Q*V\n",
+ "Vc=Vl\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The Resonant frequency(at which the circuit current becomes maximum) is %.2f Hz.\" %(resonant_freq)\n",
+ "print \"(b)The maximum current supplied by the source is %.2f A.\" %(I_max)\n",
+ "print \"(c)The frequency at which voltage across the capacitor is maximum is %.2f Hz.\" %(freq_c)\n",
+ "print \"(d)The frequency at which voltage across the inducttor is maximum is %.2f Hz.\" %(freq_l)\n",
+ "print \"(e)The inductive reactance is %.2f Ohms.\" %(ind_rea)\n",
+ "print \"(f)The capacitive reactance is %.2f Ohms.\" %(cap_rea)\n",
+ "print \"(g)The quality factor of the circiut is %.2f.\" %(Q)\n",
+ "print \"(h)The voltage drop across resistor is %.2f V.\" %(Vr)\n",
+ "print \" The voltage drop across inductor is %.2f V.\" %(Vl)\n",
+ "print \" The voltage drop across capacitor is %.2f V.\" %(Vc) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The Resonant frequency(at which the circuit current becomes maximum) is 41.09 Hz.\n",
+ "(b)The maximum current supplied by the source is 8.33 A.\n",
+ "(c)The frequency at which voltage across the capacitor is maximum is 40.10 Hz.\n",
+ "(d)The frequency at which voltage across the inducttor is maximum is 42.12 Hz.\n",
+ "(e)The inductive reactance is 39.70 Ohms.\n",
+ "(f)The capacitive reactance is 37.79 Ohms.\n",
+ "(g)The quality factor of the circiut is 3.15.\n",
+ "(h)The voltage drop across resistor is 100.00 V.\n",
+ " The voltage drop across inductor is 314.91 V.\n",
+ " The voltage drop across capacitor is 314.91 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.2,Page number: 316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the capacitance value to give resonance in a series RLC circuit. \"\"\"\n",
+ "\n",
+ "from math import pi,sqrt,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "res_freq=50.0 #Resonant frequency(in Hertz)\n",
+ "L=0.5 #Self-inductance of inductor(in Henry)\n",
+ "R=4.0 #Resistance of resistor(in Ohms)\n",
+ "V=100.0 #Voltage of the supply(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C=1/(pow((2*pi*res_freq),2)*L)\n",
+ "I_max=V/R\n",
+ "V_L=I_max*(2*pi*res_freq*L)\n",
+ "V_C=V_L\n",
+ "Q=(2.0*pi*res_freq*L)/R\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The capacitance to give resonance is %e F.\" %(C)\n",
+ "print \"(b)The voltage across the inductor is %.2f V.\" %(V_L)\n",
+ "print \" The voltage across the capacitor is %.2f V.\" %(V_C)\n",
+ "print \"(c)The quality factor of the circuit is %.2f.\" %(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The capacitance to give resonance is 2.026424e-05 F.\n",
+ "(b)The voltage across the inductor is 3926.99 V.\n",
+ " The voltage across the capacitor is 3926.99 V.\n",
+ "(c)The quality factor of the circuit is 39.27.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.3,Page number: 317 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the inductance,the circuit current and the voltage across the capacitor under resonance.\"\"\"\n",
+ "\n",
+ "from math import pi,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "res_freq=175e03 #Resonant frequency(in Hertz) \n",
+ "V=0.85 #Voltage applied(in Volts)\n",
+ "Q=50.0 #Quality factor of the coil\n",
+ "C=320e-012 #Capacitance of the capacitor(in Farads)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "L=1/(pow((2*pi*res_freq),2)*C)\n",
+ "ind_rea=2*pi*res_freq*L\n",
+ "R=ind_rea/Q\n",
+ "Io=V/R\n",
+ "Vc=Q*V\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The value of inductance is %e H.\" %(L)\n",
+ "print \"The circuit current is %e A.\" %(Io)\n",
+ "print \"The voltage across the capacitor under resonance is %.2f V.\" %(Vc)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of inductance is 2.584724e-03 H.\n",
+ "The circuit current is 1.495398e-02 A.\n",
+ "The voltage across the capacitor under resonance is 42.50 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.4,Page number: 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current at the resonant frequency and the energy stored by inductor.\"\"\"\n",
+ "\n",
+ "from math import pow,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "res_freq=5e03 #Resonant frequency(in Hertz)\n",
+ "L=1e-03 #Self-inductance of the inductor(in Henry)\n",
+ "V=120.0 #Voltage of the supply(in Volts)\n",
+ "R=2.0 #Resistance of the coil(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C=1/(pow((2*pi*res_freq),2)*L)\n",
+ "I_max=V/R\n",
+ "\"\"\" U=0.5*L*I*I=L*Irms*Irms\"\"\"\n",
+ "U=L*I_max*I_max\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The required value of capacitance is %e F.\" %(C)\n",
+ "print \"(a)The current at the resonance frequency is %.2f A.\" %(I_max)\n",
+ "print \"(b)The maximum instantaneous energy is %.2f J.\" %(U)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of capacitance is 1.013212e-06 F.\n",
+ "(a)The current at the resonance frequency is 60.00 A.\n",
+ "(b)The maximum instantaneous energy is 3.60 J.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.5,Page number: 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resonance frequency and the quality factor for the overall circuit.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R1=0.51 #Resistor of the resistor-1(in Ohms) \n",
+ "R2=1.3 #Resistor of the resistor-2(in Ohms) \n",
+ "R3=0.24 #Resistor of the resistor-3(in Ohms)\n",
+ "L1=32e-03 #Self-inductance of the inductor-1(in Henry)\n",
+ "L2=15e-03 #Self-inductance of the inductor-2(in Henry)\n",
+ "C1=25e-06 #Capacitance of the capacitor-1(in Farads)\n",
+ "C2=62e-06 #Capacitance of the capacitor-2(in Farads)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Req=R1+R2+R3\n",
+ "Leq=L1+L2\n",
+ "Ceq=(C1*C2)/(C1+C2)\n",
+ "res_freq=1/(2*pi*sqrt(Leq*Ceq))\n",
+ "Q=(sqrt(Leq/Ceq))/Req\n",
+ "Q1=(2*pi*res_freq*L1)/R1\n",
+ "Q2=(2*pi*res_freq*L2)/R2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The resonance frequency is %.2f Hz.\" %(res_freq)\n",
+ "print \"(b)The quality factor of the overall circuit is %.2f.\" %(Q)\n",
+ "print \"(c)The quality factor of coil-1 is %.2f.\" %(Q1)\n",
+ "print \"(d)The quality factor of coil-2 is %.2f.\" %(Q2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The resonance frequency is 173.93 Hz.\n",
+ "(b)The quality factor of the overall circuit is 25.05.\n",
+ "(c)The quality factor of coil-1 is 68.57.\n",
+ "(d)The quality factor of coil-2 is 12.61.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.6,Page number: 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the half-power frequencies of a series ac circuit.\"\"\"\n",
+ "\n",
+ "from math import pow,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "bandwidth=75e03 #Bandwidth of the resonant circuit(in Hertz) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "pro=pow((150e03),2)\n",
+ "sum=sqrt(pow(bandwidth,2)+(4*pro))\n",
+ "f2=(sum+bandwidth)/2.0\n",
+ "f1=(sum-bandwidth)/2.0\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"Lower Half-power frequency is %e Hz.\" %(f1)\n",
+ "print \"Upper Half-power frequency is %e Hz.\" %(f2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lower Half-power frequency is 1.171165e+05 Hz.\n",
+ "Upper Half-power frequency is 1.921165e+05 Hz.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.7,Page number: 324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the line current,quality factor and the dynamic impedance of a series-parallel ac circuit.\"\"\"\n",
+ "\n",
+ "from math import pi,sqrt,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=200e-06 #Self-inductance of the inductor coil(in Henry) \n",
+ "res_freq=1e06 #Resonant frequency(in Hertz)\n",
+ "R=20.0 #Resistance of the coil(in Ohms)\n",
+ "Rs=8e03 #Series resistance(in Ohms)\n",
+ "V=230.0 #Voltage(rms) of the supply(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C=1/(pow((2*pi*res_freq),2)*L)\n",
+ "XL=2*pi*res_freq*L\n",
+ "Q=XL/R\n",
+ "Zo=L/(C*R)\n",
+ "Z=Zo+Rs\n",
+ "I=V/Z\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The value of capacitance to cause resonance is %e F.\" %(C)\n",
+ "print \"(b)The Q factor of the circuit is %.5f.\" %(Q)\n",
+ "print \"(c)The dynamic impedance of the parallel resonant circuit is %.2f Ohms.\" %(Zo)\n",
+ "print \"(d)The total line current is %e A.\" %(I) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The value of capacitance to cause resonance is 1.266515e-10 F.\n",
+ "(b)The Q factor of the circuit is 62.83185.\n",
+ "(c)The dynamic impedance of the parallel resonant circuit is 78956.84 Ohms.\n",
+ "(d)The total line current is 2.644990e-03 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.8,Page number: 325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resonant frequency,Q-factor and bandwidth of a practical parallel resonant circuit.\"\"\"\n",
+ "\n",
+ "from math import pow,sqrt,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=150.0 #Resistance of the coil(in Ohms)\n",
+ "L=0.24 #Self-inductance of the coil(in Henry)\n",
+ "C=3e-06 #Capacitance of the capacitor(in Farads)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "res_freq=(sqrt(1-((R*R*C)/L)))/(2*pi*sqrt(L*C))\n",
+ "Q=(2*pi*res_freq*L)/R\n",
+ "BW=res_freq/Q\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resonant frequency is %.2f Hz.\" %(res_freq)\n",
+ "print \"The quality factor is %.2f.\" %(Q)\n",
+ "print \"The bandwidth is %.2f Hz.\" %(BW)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resonant frequency is 159.02 Hz.\n",
+ "The quality factor is 1.60.\n",
+ "The bandwidth is 99.47 Hz.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.9,Page number: 326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the source frequency and the current supplied by the source.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi,pow,degrees\n",
+ "from cmath import phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=125.0 #Voltage of the source(in Volts)\n",
+ "C=20.5e-06 #Capacitance of the capacitor(in Farads)\n",
+ "R=1.06 #Resistance of the coil(in Ohms)\n",
+ "L=25.4e-03 #Inductance of the coil(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "fo=1.0/(2*pi*sqrt(L*C))\n",
+ "Io=V/R\n",
+ "V_L=Io*(2*pi*fo*L)\n",
+ "V_C=V_L\n",
+ "X_L=(2*pi*fo*L)\n",
+ "Z_coil=R+(1j*X_L)\n",
+ "V_coil=Io*Z_coil\n",
+ "I=300.0/X_L\n",
+ "R_new=V/I\n",
+ "Rx=R_new-R\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a) (i)The source frequency is %.2f Hz, and\\n (ii)The current supplied by the source is %.2f A.\\n\" %(fo,Io)\n",
+ "print \"(b) (i)The voltage across the capacitor is %.2f V and\" %(V_C)\n",
+ "print \" (ii)The voltage across the coil is %.2f V at an angle of %.2f degrees.\\n\" %(abs(V_coil),degrees(phase(V_coil)))\n",
+ "print \"(c)The resistance that must be connected in series with the circuit to limit the capacitor voltage to 300V is %.3f Ohms.\" %(Rx)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) (i)The source frequency is 220.56 Hz, and\n",
+ " (ii)The current supplied by the source is 117.92 A.\n",
+ "\n",
+ "(b) (i)The voltage across the capacitor is 4150.92 V and\n",
+ " (ii)The voltage across the coil is 4152.80 V at an angle of 88.28 degrees.\n",
+ "\n",
+ "(c)The resistance that must be connected in series with the circuit to limit the capacitor voltage to 300V is 13.607 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.10,Page number: 326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the maximum instantaneous energy stored in the inductor.\"\"\"\n",
+ "\n",
+ "from math import pow,pi,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=3.0 #Resistance of the coil(in Ohms)\n",
+ "L=12e-03 #Self-inductance of the coil(in Henry)\n",
+ "fo=9e03 #Resonant frequency(in Hertz)\n",
+ "V=240.0 #Supply voltage(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C=1.0/(pow((2*pi*fo),2)*L)\n",
+ "Io=V/R\n",
+ "ener=0.5*L*Io*Io\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The value of capacitance to be connected in series with the coil is %e F.\" %(C)\n",
+ "print \"The maximum instantaneous energy stored in the inductor is %.2f J.\" %(ener)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of capacitance to be connected in series with the coil is 2.605998e-08 F.\n",
+ "The maximum instantaneous energy stored in the inductor is 38.40 J.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.11,Page number: 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the parameters of a series RLC circuit.\"\"\"\n",
+ "\n",
+ "from math import pi,sqrt,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "fo=10e03 #Resonant frequency(in Hertz)\n",
+ "BW=1e03 #Bandwidth(in HErtz)\n",
+ "P=15.3 #Power drawn(in Watts)\n",
+ "V=200.0 #Voltage of generator(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V_R=V\n",
+ "R=(V_R*V_R)/P\n",
+ "\"\"\" Q=fo/BW=(2*pi*fo*L)/R; Q=Quality factor of the circuit. \"\"\"\n",
+ "L=R/(2*pi*BW)\n",
+ "C=1.0/(pow((2*pi*fo),2)*L)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The parameters of the circuit are:\\n R=%.2f Ohms,\\n L=%.3f H,\\n C=%e F.\" %(R,L,C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The parameters of the circuit are:\n",
+ " R=2614.38 Ohms,\n",
+ " L=0.416 H,\n",
+ " C=6.087677e-10 F.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.12,Page number: 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the half-power frequencies and the circuit current.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "fo=200.0 #Resonant frequency(in Hertz)\n",
+ "V=400.0 #Voltage of the source(in Volts)\n",
+ "R=20e-03 #Resistance of the coil(in Ohms)\n",
+ "L=6e-03 #Inductance of the coil(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C=1.0/(pow((2*pi*fo),2)*L)\n",
+ "Io=V/R\n",
+ "X_C=1.0/(2*pi*fo*C)\n",
+ "V_C=Io*X_C\n",
+ "Im=sqrt(2)*Io\n",
+ "U_max=0.5*L*Im*Im\n",
+ "Q=(2*pi*fo*L)/R\n",
+ "BW=fo/Q\n",
+ "f1=fo-(BW/2.0)\n",
+ "f2=fo+(BW/2.0)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The capacitance of the capacitor is %e F.\" %(C)\n",
+ "print \"(b)The circuit current is %.2f kA.\" %(Io/1000)\n",
+ "print \"(c)The voltage across the capacitor is %.2f kV.\" %(V_C/1000)\n",
+ "print \"(d)The maximum energy stored in the coil is %.2f MJ.\" %(U_max/1000000)\n",
+ "print \"(e)The lower half-power frequency is %.3f Hz and the upper half-power frequency is %.3f Hz.\" %(f1,f2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The capacitance of the capacitor is 1.055429e-04 F.\n",
+ "(b)The circuit current is 20.00 kA.\n",
+ "(c)The voltage across the capacitor is 150.80 kV.\n",
+ "(d)The maximum energy stored in the coil is 2.40 MJ.\n",
+ "(e)The lower half-power frequency is 199.735 Hz and the upper half-power frequency is 200.265 Hz.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.13,Page number: 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the bandwidth,resonant frequency,inductance and capacitance.\"\"\"\n",
+ "\n",
+ "from math import pi,pow,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=1e03 #Resistance of the resistor(in Ohms)\n",
+ "f1=20e03 #Lower half-power frequency(in Hertz) \n",
+ "f2=100e03 #Upper half-power frequency(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "BW=f2-f1\n",
+ "res_freq=sqrt(f1*f2)\n",
+ "Q=res_freq/BW\n",
+ "L=(Q*R)/(2*pi*res_freq)\n",
+ "C=1.0/(pow((2*pi*res_freq),2)*L)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The bandwidth is %.2f kHz.\" %(BW/1000.0)\n",
+ "print \"(b)The resonant frequency is %.2f kHz.\" %(res_freq/1000.0)\n",
+ "print \"(c)The inductance is %e H.\" %(L)\n",
+ "print \"(d)The capacitance is %e F.\" %(C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The bandwidth is 80.00 kHz.\n",
+ "(b)The resonant frequency is 44.72 kHz.\n",
+ "(c)The inductance is 1.989437e-03 H.\n",
+ "(d)The capacitance is 6.366198e-09 F.\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.14,Page number: 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the power at half-power frequencies.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=5.0 #Resistance of resistor(in Ohms)\n",
+ "V=20.0 #Voltage of the source(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Zo=R\n",
+ "Io=V/Zo\n",
+ "Po=(Io*Io)*R\n",
+ "P_half=Po/2.0\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The power at half-power frequencies is %.2f W.\" %(P_half) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power at half-power frequencies is 40.00 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.15,Page number: 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the half-power frequencies and the quality factor.\"\"\"\n",
+ "\n",
+ "from math import pi,pow,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "res_freq=100.0 #Resonant frequency(in Hertz)\n",
+ "V=240.0 #Voltage of the source(in Volts)\n",
+ "R=55e-03 #Resistance of the coil(in Ohms)\n",
+ "L=7e-03 #Self-inductance of the coil(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C=1.0/(pow((2*pi*res_freq),2)*L)\n",
+ "Q=(2*pi*res_freq*L)/R\n",
+ "BW=res_freq/Q\n",
+ "f1=res_freq-(BW/2.0)\n",
+ "f2=res_freq+(BW/2.0)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The value of the capacitance is %e F.\" %(C)\n",
+ "print \"(b)The quality factor of the circuit is %.2f.\" %(Q)\n",
+ "print \"(c)The lower half-power frequency is %.2f Hz and The upper half-power frequency is %.2f Hz.\" %(f1,f2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The value of the capacitance is 3.618614e-04 F.\n",
+ "(b)The quality factor of the circuit is 79.97.\n",
+ "(c)The lower half-power frequency is 99.37 Hz and The upper half-power frequency is 100.63 Hz.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.16,Page number: 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resonance frequency and the effective resistance at resonance.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=20.0 #Resistance of the coil(in Ohms)\n",
+ "L=0.2 #Inductance of the coil(in Henry)\n",
+ "C=100e-06 #Capacitance of the capacitor(in Farads)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "res_freq=sqrt(1-((R*R*C)/L))/(2*pi*sqrt(L*C))\n",
+ "Zo=L/(C*R)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The frequency at which the circuit behaves as a non-inductive reactance is %.2f Hz.\" %(res_freq)\n",
+ "print \"The effective resistance at resonance is %.2f Ohms.\" %(Zo) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency at which the circuit behaves as a non-inductive reactance is 31.83 Hz.\n",
+ "The effective resistance at resonance is 100.00 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.17,Page number: 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the quality factor at the upper tuning frequency.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pow,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=20e-06 #Self-inductance of the coil(in Henry)\n",
+ "fo_1=570e03 #Lower tuning frequency(in Hertz) \n",
+ "fo_2=1560e03 #Upper tuning frequency(in Hertz)\n",
+ "Q1=50.0 #Quality factor at the lower tuning frequency\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C1=1.0/(pow((2*pi*fo_1),2)*L)\n",
+ "C2=1.0/(pow((2*pi*fo_2),2)*L)\n",
+ "R=(2*pi*fo_1*L)/Q1\n",
+ "BW=fo_1/Q1\n",
+ "Q2=(2*pi*fo_2*L)/R\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The range of tuning capacitor is from %.3f nF to %.3f nF.\" %((C2*1e09),(C1*1e09))\n",
+ "print \"(b)The resistance of the coil is %.3f Ohms and the bandwidth of the circuit is %.3f kHz.\" %(R,(BW/1000))\n",
+ "print \"(c)The quality factor of the circuit at the upper tuning frequency is %.3f.\" %(Q2) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The range of tuning capacitor is from 0.520 nF to 3.898 nF.\n",
+ "(b)The resistance of the coil is 1.433 Ohms and the bandwidth of the circuit is 11.400 kHz.\n",
+ "(c)The quality factor of the circuit at the upper tuning frequency is 136.842.\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter12.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter12.ipynb new file mode 100755 index 00000000..eb96a9e1 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter12.ipynb @@ -0,0 +1,1251 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12: THREE-PHASE CIRCUITS AND SYSTEMS "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.1,Page number: 347"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current drawn from the power mains by a balanced three-phase load.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=32 #Resistance of the load(in Ohms)\n",
+ "X_L=24 #Inductive reactance of the load(in Ohms) \n",
+ "V_L=400 #Line Voltage(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z=R + X_L *1j\n",
+ "Z_mod=abs(Z)\n",
+ "V_ph_star=V_L/(sqrt(3))\n",
+ "I_ph_star=V_ph_star/Z_mod\n",
+ "I_L_star=I_ph_star\n",
+ "V_ph_delta=V_L\n",
+ "I_ph_delta=V_ph_delta/Z_mod\n",
+ "I_L_delta=I_ph_delta*(sqrt(3))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)For star connection:\"\n",
+ "print \"The current drawn from the power mains is %.3f A.\" %(I_L_star)\n",
+ "print \"(b)For delta connection:\"\n",
+ "print \"The current drawn from the power mains is %.3f A.\" %(I_L_delta)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)For star connection:\n",
+ "The current drawn from the power mains is 5.774 A.\n",
+ "(b)For delta connection:\n",
+ "The current drawn from the power mains is 17.321 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.2,Page number: 347"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current in each line and the current in the nuetral conductor for a star-connected three-phase system.\"\"\"\n",
+ "\n",
+ "from math import sqrt,cos,sin,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=415 #Line voltage(in Volts)\n",
+ "P_R=10e03 #Load in Red line(in kilo-Watts)\n",
+ "P_Y=8e03 #Load in Yellow line(in kilo-Watts)\n",
+ "P_B=5e03 #Load in Blue line(in kilo-Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vph=V_L/sqrt(3)\n",
+ "I_R=P_R/Vph\n",
+ "I_Y=P_Y/Vph\n",
+ "I_B=P_B/Vph\n",
+ "I_H=(I_Y*cos(pi/6))-(I_B*cos(pi/6))\n",
+ "I_V=I_R-(I_Y*sin(pi/6))-(I_B*sin(pi/6))\n",
+ "I_N=sqrt((I_H*I_H)+(I_V*I_V))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current taken by the 10-kW load is %.2f A.\" %(I_R) \n",
+ "print \" The current taken by the 8-kW load is %.2f A.\" %(I_Y) \n",
+ "print \" The current taken by the 5-kW load is %.2f A.\" %(I_B)\n",
+ "print \"(b)The current in the nuetral conductor is %.2f A.\" %(I_N)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current taken by the 10-kW load is 41.74 A.\n",
+ " The current taken by the 8-kW load is 33.39 A.\n",
+ " The current taken by the 5-kW load is 20.87 A.\n",
+ "(b)The current in the nuetral conductor is 18.19 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.3,Page number: 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the phase currents and the line currents.\"\"\"\n",
+ "\n",
+ "from math import cos,pi,atan,radians,degrees,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=50 #Frequency of the source(in Hertz)\n",
+ "V_L=415 #Line Voltage(in Volts)\n",
+ "R1=100 #Resistance of the first load(in Ohms)\n",
+ "R2=20.0 #Resistance of the second load(in Ohms)\n",
+ "L2=191e-03 #Self-inductance of the second load(in Henry)\n",
+ "R3=0.0 #Resistance of the third load(in Ohms)\n",
+ "C3=30e-06 #Capacitance of the third load(in Farads)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z1=R1\n",
+ "angle_1=0.0\n",
+ "X2=2*pi*f*L2\n",
+ "Z2=sqrt((R2*R2)+(X2*X2))\n",
+ "angle_2=atan(X2/R2)\n",
+ "Z3=1/(2*pi*f*C3)\n",
+ "angle_3=pi/2\n",
+ "Vph=V_L\n",
+ "I1=Vph/Z1\n",
+ "I2=Vph/Z2\n",
+ "I3=Vph/Z3\n",
+ "I_R=sqrt((I1*I1)+(I3*I3)+(2*I1*I3*cos(pi/6)))\n",
+ "angle_Y=radians(degrees(angle_2)-60)\n",
+ "I_Y=sqrt((I1*I1)+(I2*I2)+(2*I1*I2*cos(angle_Y)))\n",
+ "angle_B=pi-angle_Y-(pi/6)\n",
+ "I_B=sqrt((I2*I2)+(I3*I3)+(2*I2*I3*cos(angle_B)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The phase current I1 in the load RY is %.2f A in phase with V_RY.\" %(I1) \n",
+ "print \" The phase current I2 in load YB is %.2f A lagging V_YB by %.2f degrees.\" %(I2,degrees(angle_2)) \n",
+ "print \" The phase current I3 in load BR is %.2f A leading V_BR by %.2f degrees.\" %(I3,degrees(angle_3))\n",
+ "print \"(b)The line current I_R is %.2f A.\" %(I_R)\n",
+ "print \" The line current I_Y is %.2f A.\" %(I_Y) \n",
+ "print \" The line current I_B is %.2f A.\" %(I_B)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The phase current I1 in the load RY is 4.00 A in phase with V_RY.\n",
+ " The phase current I2 in load YB is 6.56 A lagging V_YB by 71.57 degrees.\n",
+ " The phase current I3 in load BR is 3.91 A leading V_BR by 90.00 degrees.\n",
+ "(b)The line current I_R is 7.64 A.\n",
+ " The line current I_Y is 10.51 A.\n",
+ " The line current I_B is 4.47 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.4,Page number: 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the line current,the power factor and the total power for a balanced three-phase system.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R_ph=20.0 #Resistance of each phase(in Ohms)\n",
+ "X_L_ph=15.0 #Inductive reactance of each phase(in Ohms)\n",
+ "V_L=400.0 #Line Voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z_ph=R_ph + X_L_ph *1j\n",
+ "Z_mod=abs(Z_ph)\n",
+ "V_ph_star=V_L/(sqrt(3))\n",
+ "I_ph_star=V_ph_star/Z_mod\n",
+ "I_L_star=I_ph_star\n",
+ "pf_star=R_ph/Z_mod\n",
+ "P_active_star=sqrt(3)*V_L*I_L_star*pf_star\n",
+ "V_ph_delta=V_L\n",
+ "I_ph_delta=V_ph_delta/Z_mod\n",
+ "I_L_delta=I_ph_delta*(sqrt(3))\n",
+ "pf_delta=R_ph/Z_mod\n",
+ "P_active_delta=sqrt(3)*V_L*I_L_delta*pf_delta\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)For star connected load:\"\n",
+ "print \"(i)The line current is %.2f A.\" %(I_L_star)\n",
+ "print \"(ii)The power factor is %.2f lagging.\" %(pf_star)\n",
+ "print \"(iii)The total active power is %.2f kW.\" %(P_active_star/1000)\n",
+ "print \"\\n(b)For delta connection:\"\n",
+ "print \"(i)The line current is %.2f A.\" %(I_L_delta)\n",
+ "print \"(ii)The power factor is %.2f lagging.\" %(pf_delta)\n",
+ "print \"(iii)The total active power is %.2f kW.\" %(P_active_delta/1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)For star connected load:\n",
+ "(i)The line current is 9.24 A.\n",
+ "(ii)The power factor is 0.80 lagging.\n",
+ "(iii)The total active power is 5.12 kW.\n",
+ "\n",
+ "(b)For delta connection:\n",
+ "(i)The line current is 27.71 A.\n",
+ "(ii)The power factor is 0.80 lagging.\n",
+ "(iii)The total active power is 15.36 kW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.5,Page number: 355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Fidning the total power consumed and the power factor of a balanced three-phase circuit.\"\"\"\n",
+ "\n",
+ "from math import atan,cos,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "W1=3e03 #Reading of wattmeter-1(in Watts)\n",
+ "W2=1.5e03 #Reading of wattmeter-2(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "P=W1+W2\n",
+ "pf_angle=atan(sqrt(3)*((W1-W2)/(W1+W2)))\n",
+ "pf=cos(pf_angle)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The total power consumed is %e W.\" %(P)\n",
+ "print \"The power factor of the balanced three-phase circuit is %.3f.\" %(pf)\n",
+ "print \"NOTE:From the given data it is impossible to state whether the power factor is leading or lagging.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total power consumed is 4.500000e+03 W.\n",
+ "The power factor of the balanced three-phase circuit is 0.866.\n",
+ "NOTE:From the given data it is impossible to state whether the power factor is leading or lagging.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.6,Page number: 355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the total power,the power factor and the line current for a balanced three-phase circuit.\"\"\"\n",
+ "\n",
+ "from math import atan,cos,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=415 #Line voltage(in Volts)\n",
+ "W1=5.2e03 #Reading of wattmeter-1(in Watts)\n",
+ "W2=-1.7e03 #Reading of wattmeter-2(in Watts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "P=W1+W2\n",
+ "pf_angle=atan(sqrt(3)*((W1-W2)/(W1+W2)))\n",
+ "pf=cos(pf_angle)\n",
+ "I_L=P/(sqrt(3)*V_L*pf)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The total power consumed is %e W.\\n\" %(P)\n",
+ "print \"The power factor of the balanced three-phase circuit is %.3f.\" %(pf)\n",
+ "print \"NOTE:From the given data it is impossible to state whether the power factor is leading or lagging.\"\n",
+ "print \"\\nThe line current is %.2f A.\" %(I_L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total power consumed is 3.500000e+03 W.\n",
+ "\n",
+ "The power factor of the balanced three-phase circuit is 0.281.\n",
+ "NOTE:From the given data it is impossible to state whether the power factor is leading or lagging.\n",
+ "\n",
+ "The line current is 17.32 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.7,Page number: 356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the total power consumed in a star-connected three-phase network.\"\"\"\n",
+ "\n",
+ "from math import sqrt,radians,degrees\n",
+ "from cmath import rect,phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=6.0 #Resistance per phase(in Ohms)\n",
+ "X_L=8.0 #Inductive reactance per phase(in Ohms)\n",
+ "V_L=220.0 #Line voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z=6+ (1j*8)\n",
+ "Vph=V_L/sqrt(3.0)\n",
+ "V_RN=rect(Vph,0)\n",
+ "V_YN=rect(Vph,radians(-120.0))\n",
+ "V_BN=rect(Vph,radians(120.0))\n",
+ "V_RY=V_RN-V_YN\n",
+ "V_YB=V_YN-V_BN\n",
+ "V_BR=V_BN-V_RN\n",
+ "I_R=V_RN/Z\n",
+ "I_Y=V_YN/Z\n",
+ "I_B=V_BN/Z\n",
+ "P=sqrt(3.0)*V_L*abs(I_R)*cos(phase(Z))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The phase voltages are:\"\n",
+ "print \" V_RN=%.2f V at an angle of %.3f degrees.\" %(abs(V_RN),degrees(phase(V_RN))) \n",
+ "print \" V_YN=%.2f V at an angle of %.3f degrees.\" %(abs(V_YN),degrees(phase(V_YN)))\n",
+ "print \" V_BN=%.2f V at an angle of %.3f degrees.\" %(abs(V_BN),degrees(phase(V_BN)))\n",
+ "print \"(b)The line voltages are:\"\n",
+ "print \" V_RY=%.2f V at an angle of %.3f degrees.\" %(abs(V_RY),degrees(phase(V_RY))) \n",
+ "print \" V_YB=%.2f V at an angle of %.3f degrees.\" %(abs(V_YB),degrees(phase(V_YB)))\n",
+ "print \" V_BR=%.2f V at an angle of %.3f degrees.\" %(abs(V_BR),degrees(phase(V_BR)))\n",
+ "print \"(c)The line currents(same as phase currents) are:\"\n",
+ "print \" I_R=%.2f A at an angle of %.3f degrees.\" %(abs(I_R),degrees(phase(I_R))) \n",
+ "print \" I_Y=%.2f A at an angle of %.3f degrees.\" %(abs(I_Y),degrees(phase(I_Y)))\n",
+ "print \" I_B=%.2f A at an angle of %.3f degrees.\" %(abs(I_B),degrees(phase(I_B)))\n",
+ "print \"(d)The total power consumed is %.2f W.\" %(round(P,2)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The phase voltages are:\n",
+ " V_RN=127.02 V at an angle of 0.000 degrees.\n",
+ " V_YN=127.02 V at an angle of -120.000 degrees.\n",
+ " V_BN=127.02 V at an angle of 120.000 degrees.\n",
+ "(b)The line voltages are:\n",
+ " V_RY=220.00 V at an angle of 30.000 degrees.\n",
+ " V_YB=220.00 V at an angle of -90.000 degrees.\n",
+ " V_BR=220.00 V at an angle of 150.000 degrees.\n",
+ "(c)The line currents(same as phase currents) are:\n",
+ " I_R=12.70 A at an angle of -53.130 degrees.\n",
+ " I_Y=12.70 A at an angle of -173.130 degrees.\n",
+ " I_B=12.70 A at an angle of 66.870 degrees.\n",
+ "(d)The total power consumed is 2904.00 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.8,Page number: 356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the total power consumed in a delta-connected three-phase network.\"\"\"\n",
+ "\n",
+ "from math import sqrt,radians,degrees\n",
+ "from cmath import rect,phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=6.0 #Resistance per phase(in Ohms)\n",
+ "X_L=8.0 #Inductive reactance per phase(in Ohms)\n",
+ "V_L=220.0 #Line voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z=6+ (1j*8)\n",
+ "Vph=V_L\n",
+ "V_RY=rect(Vph,0)\n",
+ "V_YB=rect(Vph,radians(-120.0))\n",
+ "V_BR=rect(Vph,radians(120.0))\n",
+ "I_RY=V_RY/Z\n",
+ "I_YB=V_YB/Z\n",
+ "I_BR=V_BR/Z\n",
+ "I_R=I_RY-I_BR\n",
+ "I_Y=I_YB-I_RY\n",
+ "I_B=I_BR-I_YB\n",
+ "P=sqrt(3.0)*V_L*abs(I_R)*cos(phase(Z))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The phase voltages(same as line voltages) are:\"\n",
+ "print \" V_RY=%.2f V at an angle of %.3f degrees.\" %(abs(V_RY),degrees(phase(V_RY))) \n",
+ "print \" V_YB=%.2f V at an angle of %.3f degrees.\" %(abs(V_YB),degrees(phase(V_YB)))\n",
+ "print \" V_BR=%.2f V at an angle of %.3f degrees.\" %(abs(V_BR),degrees(phase(V_BR)))\n",
+ "print \"(b)The phase currents in the three load impedances are:\"\n",
+ "print \" I_RY=%.2f A at an angle of %.3f degrees.\" %(abs(I_RY),degrees(phase(I_RY))) \n",
+ "print \" I_YB=%.2f A at an angle of %.3f degrees.\" %(abs(I_YB),degrees(phase(I_YB)))\n",
+ "print \" I_BR=%.2f A at an angle of %.3f degrees.\" %(abs(I_BR),degrees(phase(I_BR)))\n",
+ "print \"(c)The line currents are:\"\n",
+ "print \" I_R=%.2f A at an angle of %.3f degrees.\" %(abs(I_R),degrees(phase(I_R))) \n",
+ "print \" I_Y=%.2f A at an angle of %.3f degrees.\" %(abs(I_Y),degrees(phase(I_Y)))\n",
+ "print \" I_B=%.2f A at an angle of %.3f degrees.\" %(abs(I_B),degrees(phase(I_B)))\n",
+ "print \"(d)The total power consumed is %.2f W.\" %(round(P,2)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The phase voltages(same as line voltages) are:\n",
+ " V_RY=220.00 V at an angle of 0.000 degrees.\n",
+ " V_YB=220.00 V at an angle of -120.000 degrees.\n",
+ " V_BR=220.00 V at an angle of 120.000 degrees.\n",
+ "(b)The phase currents in the three load impedances are:\n",
+ " I_RY=22.00 A at an angle of -53.130 degrees.\n",
+ " I_YB=22.00 A at an angle of -173.130 degrees.\n",
+ " I_BR=22.00 A at an angle of 66.870 degrees.\n",
+ "(c)The line currents are:\n",
+ " I_R=38.11 A at an angle of -83.130 degrees.\n",
+ " I_Y=38.11 A at an angle of 156.870 degrees.\n",
+ " I_B=38.11 A at an angle of 36.870 degrees.\n",
+ "(d)The total power consumed is 8712.00 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.9,Page number: 357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the line current and the total power supplied by a three-phase system.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import radians,degrees,sqrt,cos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Z_A_delta=rect(12.0,radians(30.0))\n",
+ "Z_star=rect(5.0,radians(45.0))\n",
+ "V_L=400.0\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z_A_star=Z_A_delta/3.0\n",
+ "Zeq=(Z_A_star*Z_star)/(Z_A_star+Z_star)\n",
+ "Vph=V_L/sqrt(3.0)\n",
+ "I_L=Vph/Zeq\n",
+ "P=sqrt(3.0)*I_L*V_L*cos(phase(Zeq))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The line current is %.3f A.\" %(round((abs(I_L)),3))\n",
+ "print \"(b)The power suppiled is %e W.\" %(abs(P))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The line current is 103.045 A.\n",
+ "(b)The power suppiled is 5.726843e+04 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.10,Page number: 357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the constants of the load per phase.\"\"\"\n",
+ "\n",
+ "from math import pi,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I_L=100.0 #Line current(in Amperes)\n",
+ "V_L=1100.0 #Line voltage(in Volts)\n",
+ "f=50.0 #Frequency of the supply(in Hertz)\n",
+ "P=150e03 #Power delivered by the three-phase system(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "R=P/(3*I_L*I_L)\n",
+ "Vph=V_L/sqrt(3.0)\n",
+ "Iph=I_L\n",
+ "Z=Vph/Iph\n",
+ "X_C=sqrt((Z*Z)-(R*R))\n",
+ "C=1/(2*pi*f*X_C)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The constants of the load per phase are:\"\n",
+ "print \"R=%.3f Ohms and C=%e F.\" %(R,C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The constants of the load per phase are:\n",
+ "R=5.000 Ohms and C=8.128901e-04 F.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.11,Page number: 358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the impedance in each branch and the power factor in a balanced delta-connected three-phase circuit.\"\"\"\n",
+ "\n",
+ "from math import sqrt,cos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=400.0 #Line voltage(in Volts)\n",
+ "I_L=20.0 #Line current(in Amperes)\n",
+ "P=10e03 #Total power absorbed by the load(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V_ph=V_L\n",
+ "I_ph=I_L/sqrt(3.0)\n",
+ "Z_ph=V_ph/I_ph\n",
+ "pf=P/(sqrt(3.0)*V_L*I_L)\n",
+ "V_ph_star=V_L/sqrt(3.0)\n",
+ "I_L_star=V_ph_star/Z_ph\n",
+ "I_ph_star=I_L_star\n",
+ "P=sqrt(3.0)*V_L*I_L_star*pf\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The impedance in each branch is %.2f Ohms.\" %(round(Z_ph,2))\n",
+ "print \"(b)The power factor is %.4f lagging.\" %(pf)\n",
+ "print \"(c)The total power consumed if the same impedances are star-connected is %.2f kW.\" %(round((P/1000.0),2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The impedance in each branch is 34.64 Ohms.\n",
+ "(b)The power factor is 0.7217 lagging.\n",
+ "(c)The total power consumed if the same impedances are star-connected is 3.33 kW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.12,Page number: 358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the total power in the three-phase system.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import pi,sin,radians,degrees\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R1=100.0 #Resistance of the first phase(in Ohms)\n",
+ "R2=200.0 #Resistance of the second phase(in Ohms)\n",
+ "L3=0.3 #Inductance of the third phase(in Henry)\n",
+ "V_L=100.0 #Line voltage(in Volts)\n",
+ "f=50.0 #Frequency of the supply(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vab=rect(V_L,0)\n",
+ "Vbc=rect(V_L,radians(-120))\n",
+ "Vca=rect(V_L,radians(120))\n",
+ "Zab=R1\n",
+ "Zca=R2\n",
+ "Zbc=1j*(2*pi*f*L3)\n",
+ "Iab=Vab/Zab\n",
+ "Ibc=Vbc/Zbc\n",
+ "Ica=Vca/Zca\n",
+ "Pab=(abs(Vab)*abs(Vab))/R1\n",
+ "Pbc=0\n",
+ "Pca=(abs(Vca)*abs(Vca))/R2\n",
+ "act_P=Pab+Pbc+Pca\n",
+ "rea_P=abs(Vbc)*abs(Ibc)*sin(phase(Zbc))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The total active power in the system is %.2f W.\" %round(act_P,2)\n",
+ "print \"(b)The total reactive power in the system is %.2f VAr.\" %round(rea_P,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The total active power in the system is 150.00 W.\n",
+ "(b)The total reactive power in the system is 106.10 VAr.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.13,Page number: 359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the load circuit parameters per phase.\"\"\"\n",
+ "\n",
+ "from math import pi,sqrt,sin,acos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I_L=160.0 #Line current(in Amperes)\n",
+ "V_L=1.1e03 #Line voltage(in Volts)\n",
+ "P=210e03 #Total power load(in kilo-Watts)\n",
+ "f=50.0 #Frequency of the supply voltage(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "pf=P/(sqrt(3.0)*V_L*I_L)\n",
+ "V_ph=V_L/sqrt(3.0)\n",
+ "I_ph=I_L\n",
+ "Z_ph=V_ph/I_ph\n",
+ "R_ph=Z_ph*pf\n",
+ "X_C=Z_ph*sin(acos(pf))\n",
+ "C=1.0/(2*pi*f*X_C)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The load circuit parameters per phase are:\"\n",
+ "print \"R=%.3f Ohms.\" %(round(R_ph,3))\n",
+ "print \"C=%e F.\" %(C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The load circuit parameters per phase are:\n",
+ "R=2.734 Ohms.\n",
+ "C=1.106310e-03 F.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.14,Page number: 359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"Finding the resistance and the inductance of the load per phase.\"\"\"\n",
+ "\n",
+ "from math import pi,sqrt,sin,acos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=400.0 #Line voltage(in Volts)\n",
+ "f=50.0 #Frequency of the supply(in Hertz)\n",
+ "Iph=25.0 #Phase current(in Amperes)\n",
+ "P=13.856e03 #Total active power absorbed by the load(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_L=Iph\n",
+ "pf=P/(sqrt(3.0)*V_L*I_L)\n",
+ "Vph=V_L/sqrt(3.0)\n",
+ "Zph=Vph/Iph\n",
+ "Rph=Zph*pf\n",
+ "Xph=Zph*sin(acos(pf))\n",
+ "L=Xph/(2*pi*f)\n",
+ "Q=3*Vph*Iph*sin(acos(pf))\n",
+ "S=3*Vph*Iph\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The resistance of the load per phase is %.3f Ohms and the inductance of the load per phase is %e H.\" %(Rph,L)\n",
+ "print \"(b)The total reactive power is %e VAR.\" %(Q)\n",
+ "print \"(c)The total apparent power is %e VA.\" %(S)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The resistance of the load per phase is 7.390 Ohms and the inductance of the load per phase is 1.764344e-02 H.\n",
+ "(b)The total reactive power is 1.039285e+04 VAR.\n",
+ "(c)The total apparent power is 1.732051e+04 VA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.15,Page number: 360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the line current,the power factor and the total kVA.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi,cos\n",
+ "from cmath import phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Z1=100+(1j*0) #First impedance(in Ohms)\n",
+ "C=32e-06 #Capacitance of the capacitor(in Farads)\n",
+ "V_L=415.0 #Line voltage(in Volts)\n",
+ "f=50.0 #Frequency of the supply(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z2=-(1j*(1/(2*pi*f*C)))\n",
+ "Zph=(Z1*Z2)/(Z1+Z2)\n",
+ "Vph=V_L/sqrt(3.0)\n",
+ "Iph=Vph/Zph\n",
+ "I_L=Iph\n",
+ "pf=cos(phase(Zph))\n",
+ "P=sqrt(3.0)*V_L*I_L*pf\n",
+ "kVA=sqrt(3.0)*V_L*I_L\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The line current is %.3f A.\" %(abs(I_L))\n",
+ "print \"(b)The power factor is %.4f leading.\" %(pf)\n",
+ "print \"(c)The power absorbed is %e W.\" %(abs(P))\n",
+ "print \"(d)The total kVA is %e kVA.\" %(abs(kVA))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The line current is 3.397 A.\n",
+ "(b)The power factor is 0.7052 leading.\n",
+ "(c)The power absorbed is 1.722250e+03 W.\n",
+ "(d)The total kVA is 2.442104e+03 kVA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.16,Page number: 360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the line current,input and output power in a three-phase motor.\"\"\"\n",
+ "\n",
+ "from math import sqrt,atan,cos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "effi=0.86 #Efficiency of the motor\n",
+ "W1=255e03 #Reading of the first wattmeter(in Watts)\n",
+ "W2=85e03 #Reading of the second wattmeter(in Watts)\n",
+ "V_L=1.6e03 #Line voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "P=W1+W2\n",
+ "phi=atan(sqrt(3.0)*((W1-W2)/(W1+W2)))\n",
+ "pf=cos(phi)\n",
+ "I_L=P/(sqrt(3.0)*V_L*pf)\n",
+ "Po=P*effi\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The input power is %.2f kW.\" %(round((P/1000.0),2))\n",
+ "print \"(b)The power factor is %.3f lagging.\" %(round(pf,3))\n",
+ "print \"(c)The line current is %.2f A.\" %(round(I_L,2))\n",
+ "print \"(d)The output power is %.2f kW.\" %(round((Po/1000.0),2)) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The input power is 340.00 kW.\n",
+ "(b)The power factor is 0.756 lagging.\n",
+ "(c)The line current is 162.30 A.\n",
+ "(d)The output power is 292.40 kW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.17,Page number: 360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the readings of the two wattmeters.\"\"\"\n",
+ "\n",
+ "from math import sqrt,acos,tan \n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=25e03 #Total input power(in Watts)\n",
+ "pf=0.8 #Power factor\n",
+ "V_L=400.0 #Line voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"W1-W2=(1.0/sqrt(3.0))*(W1+W2)*tan(phi);\"\"\"\n",
+ "eq_1=P\n",
+ "eq_2=(1.0/sqrt(3.0))*P*tan(acos(pf))\n",
+ "W1=(eq_1+eq_2)/2.0\n",
+ "W2=P-W1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The readings of the wattmeters are:\" \n",
+ "print \"W1=%.4f kW.\" %(round((W1/1000.0),4))\n",
+ "print \"W2=%.4f kW.\" %(round((W2/1000.0),4))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The readings of the wattmeters are:\n",
+ "W1=17.9127 kW.\n",
+ "W2=7.0873 kW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.18,Page number: 361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the total active power consumed by the load.\"\"\"\n",
+ "\n",
+ "from cmath import phase,rect\n",
+ "from math import radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_RY=rect(200,0) #Line Voltage V_RY(in Volts)\n",
+ "V_YB=rect(200,radians(-120)) #Line Voltage V_YB(in Volts)\n",
+ "V_BR=rect(200,radians(120)) #Line Voltage V_BR(in Volts)\n",
+ "Z1=rect(10,radians(60)) #Impedance of the first phase(in Ohms) \n",
+ "Z2=rect(10,radians(0)) #Impedance of the second phase(in Ohms)\n",
+ "Z3=rect(10,radians(60)) #Impedance of the third phase(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=V_RY/Z1\n",
+ "I2=V_YB/Z2\n",
+ "I3=V_BR/Z3\n",
+ "IR=I1-I3\n",
+ "IB=I3-I2\n",
+ "W1=abs(V_RY)*abs(IR)*cos(phase(IR))\n",
+ "W2=-abs(V_YB)*abs(IB)*cos(phase(IB)-phase(V_YB))\n",
+ "P=W1+W2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The readings of the wattmeters are: W1=%.2f W and W2=%.2f W.\" %(W1,W2)\n",
+ "print \"(b)The total active power consumed by the load is %.2f W.\" %(P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The readings of the wattmeters are: W1=0.00 W and W2=8000.00 W.\n",
+ "(b)The total active power consumed by the load is 8000.00 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.19,Page number: 361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the total active power consumed by the load.\"\"\"\n",
+ "\n",
+ "from cmath import phase,rect\n",
+ "from math import radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_RY=rect(200,0) #Line Voltage V_RY(in Volts)\n",
+ "V_YB=rect(200,radians(-120)) #Line Voltage V_YB(in Volts)\n",
+ "V_BR=rect(200,radians(120)) #Line Voltage V_BR(in Volts)\n",
+ "Z1=rect(10,radians(60)) #Impedance of the first phase(in Ohms) \n",
+ "Z2=rect(10,radians(0)) #Impedance of the second phase(in Ohms)\n",
+ "Z3=rect(10,radians(60)) #Impedance of the third phase(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=V_RY/Z1\n",
+ "I2=V_YB/Z2\n",
+ "I3=V_BR/Z3\n",
+ "IR=I1-I3\n",
+ "IY=I2-I1\n",
+ "W1=-abs(V_BR)*abs(IR)*cos(phase(IR)-phase(V_BR))\n",
+ "W2=abs(V_YB)*abs(IY)*cos(phase(IY)-phase(V_YB))\n",
+ "P=W1+W2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The readings of the wattmeters are: W1=%.2f W and W2=%.2f W.\" %(W1,W2)\n",
+ "print \"(b)The total active power consumed by the load is %.2f W.\" %(P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The readings of the wattmeters are: W1=6000.00 W and W2=2000.00 W.\n",
+ "(b)The total active power consumed by the load is 8000.00 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.20,Page number: 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the reading of the wattmeter.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import radians,cos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_RY=rect(440.0,0) #Line voltage in RY line(in Volts)\n",
+ "V_YB=rect(440.0,radians(-120)) #Line voltage in YB line(in Volts)\n",
+ "V_BR=rect(440.0,radians(120)) #Line voltage in BR line(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V_RB=rect(440.0,radians(120-180)) \n",
+ "I1=V_RY/(60.0+(1j*45.0))\n",
+ "I2=V_RB/(-(1j*56.0))\n",
+ "I_AB=I1+I2\n",
+ "V_CD=V_YB\n",
+ "P=abs(I_AB)*abs(V_CD)*cos(phase(V_CD))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The reading of the wattmeter is %.4f W.\" %(round(P,4))\n",
+ "print \"Note: There is a calculation error in the textbook.\"\n",
+ "print \"I_AB=11.50 A at an angle of 2.035 degrees and not 11.05 A. Therefore P=-2531.1166 W.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reading of the wattmeter is -2531.1166 W.\n",
+ "Note: There is a calculation error in the textbook.\n",
+ "I_AB=11.50 A at an angle of 2.035 degrees and not 11.05 A. Therefore P=-2531.1166 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.21,Page number: 363"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the line and phase current in a motor.\"\"\"\n",
+ "\n",
+ "from cmath import phase,rect\n",
+ "from math import acos,sqrt,radians,cos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_RY=rect(440,0) #Line voltage in RY line(in Volts)\n",
+ "Zph=3+1j*4 #Phase Impedance(in Ohms)\n",
+ "pf=0.8 #Lagging power factor\n",
+ "P=75e03 #Total active power(in Watts)\n",
+ "V_L=440.0 #Line voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_L_mod=P/(sqrt(3.0)*V_L*pf)\n",
+ "phi=acos(pf)\n",
+ "I_L_delta=rect(I_L_mod,(radians(-30-degrees(phi))))\n",
+ "Iph=rect((I_L_mod/sqrt(3.0)),-phi)\n",
+ "Vph=rect((V_L/sqrt(3.0)),radians(-30))\n",
+ "I_L_star=Vph/Zph\n",
+ "I_L=I_L_delta+I_L_star\n",
+ "P1=sqrt(3.0)*abs(V_L)*abs(I_L_delta)*pf\n",
+ "P2=sqrt(3.0)*abs(V_L)*abs(I_L_star)*cos(phase(Zph))\n",
+ "P_tot=P1+P2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The line current in the motor is %.2f A at a phase angle of %.2f degrees.\" %(abs(I_L_delta),degrees(phase(I_L_delta)))\n",
+ "print \" The phase current in the motor is %.2f A at a phase angle of %.2f degrees.\" %(abs(Iph),degrees(phase(Iph)))\n",
+ "print \"(b)The line current and phase current in the load is %.2f A at a phase angle of %.2f degrees.\" %(abs(I_L_star),degrees(phase(I_L_star)))\n",
+ "print \"(c)The total line current is %.2f A at a phase angle of %.2f degrees.\" %(abs(I_L),degrees(phase(I_L)))\n",
+ "print \"(d)The total power consumed is %.3f W.\" %(P_tot) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The line current in the motor is 123.01 A at a phase angle of -66.87 degrees.\n",
+ " The phase current in the motor is 71.02 A at a phase angle of -36.87 degrees.\n",
+ "(b)The line current and phase current in the load is 50.81 A at a phase angle of -83.13 degrees.\n",
+ "(c)The total line current is 172.38 A at a phase angle of -71.60 degrees.\n",
+ "(d)The total power consumed is 98232.000 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter13.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter13.ipynb new file mode 100755 index 00000000..163431b5 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter13.ipynb @@ -0,0 +1,1498 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13: TRANSFORMERS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.1,Page number: 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage across the secondary of the transformer.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "E_p=6400 #Primary voltage(in Volts) \n",
+ "f=50 #Frequency of primary supply(in Hertz)\n",
+ "N1=480 #Number of turns in the primary of the transformer\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "flux_m=E_p/(4.44*f*N1)\n",
+ "N2=20.0\n",
+ "Es=4.44*f*N2*flux_m\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The peak value of the flux produced in the core is %.2f Wb.\" %(flux_m)\n",
+ "print \"(b)The voltage across the secondary winding if it has 20 turns is %.2f V.\" %(Es)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The peak value of the flux produced in the core is 0.06 Wb.\n",
+ "(b)The voltage across the secondary winding if it has 20 turns is 266.67 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.2,Page number: 377"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the peak value of the flux density in the core.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=50.0 #Operating frequency of the transformer(in Hertz)\n",
+ "N1=30.0 #Number of turns in the primary of transformer\n",
+ "N2=350.0 #Number of turns in the secondary of transformer\n",
+ "A=250e-04 #Cross-sectional area of the core(in square-metres)\n",
+ "E1=230.0 #Voltage of the supply(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "flux_m=E1/(4.44*f*N1)\n",
+ "B_m=flux_m/A\n",
+ "E2=E1*(N2/N1)\n",
+ "I2=100.0\n",
+ "I1=I2*(N2/N1)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The peak value of flux density in the core is %.2f T.\" %(B_m)\n",
+ "print \"(b)The voltage induced in the secondary winding is %e V.\" %(E2)\n",
+ "print \"(c)The primary current when the secondary current is 100 A is %e A.\" %(I1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The peak value of flux density in the core is 1.38 T.\n",
+ "(b)The voltage induced in the secondary winding is 2.683333e+03 V.\n",
+ "(c)The primary current when the secondary current is 100 A is 1.166667e+03 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.3,Page number: 377"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the turns-ratio of the transformer.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Req=50.0 #Output resistance of the source(in Ohms) \n",
+ "R_L=800.0 #Load resistance(in Ohms) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "K=sqrt(R_L/Req)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The turns-ratio of the transformer to be used for maximising the load power is %d.\" %(K)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The turns-ratio of the transformer to be used for maximising the load power is 4.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.4,Page number: 378"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the load current in the ac circuit.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import degrees\n",
+ "\n",
+ "#Calculations:\n",
+ "V=rect(30,0)\n",
+ "Ip=V/(20+20*1j+(pow(2,2)*(2-10*1j)))\n",
+ "I_L=2.0*Ip\n",
+ "\n",
+ "#Result:\n",
+ "print \"The load current is %.3f A at a phase angle of %.3f degrees.\" %(abs(I_L),degrees(phase(I_L)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The load current is 1.744 A at a phase angle of 35.538 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.5,Page number: 378 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the output of the transformer in kVA.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "B_m=1.1 #Maximum magnetic flux density(in Weber per square-metre)\n",
+ "A=150e-04 #Cross-sectional area of the core(in square-metres)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "flux_m=B_m*A\n",
+ "N2=66\n",
+ "f=50\n",
+ "Z_L=4.0\n",
+ "E2=4.44*N2*f*flux_m\n",
+ "V2=E2\n",
+ "I2=V2/Z_L\n",
+ "output=(I2*V2)/1000.0\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The output when connected to a load of 4 Ohms impedance is %.3f kVA.\" %(output)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output when connected to a load of 4 Ohms impedance is 14.612 kVA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.6,Page number: 378 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the number of turns in each winding of the transformer.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "A=9e-04 #Cross-sectional area of the core(in square-metre) \n",
+ "E1=230.0 #Primary Voltage(in Volts)\n",
+ "E2=110.0 #Secondary Voltage(in Volts)\n",
+ "E3=6.0 #Tertiary Voltage(in Volts)\n",
+ "f=50.0 #Operating frequency of the transformer(in Hertz)\n",
+ "Bm=1.0 #Maximum magnetic flux density(in Tesla) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "flux_m=Bm*A\n",
+ "N3_half=E3/(4.44*f*flux_m)\n",
+ "N3=2*N3_half\n",
+ "N1=N3_half*(E1/E3)\n",
+ "N2=N3_half*(E2/E3)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The total number of turns on the primary winding is %d turns.\" %(N1)\n",
+ "print \"The total number of turns on the secondary winding is %d turns.\" %(N2)\n",
+ "print \"The total number of turns on the tertiary winding is %d turns.\" %(N3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total number of turns on the primary winding is 1151 turns.\n",
+ "The total number of turns on the secondary winding is 550 turns.\n",
+ "The total number of turns on the tertiary winding is 60 turns.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.7,Page number: 380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the no-load power factor of the transformer.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=350.0 #Input at no-load(in Volt-Amperes) \n",
+ "V1=230.0 #Primary voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Io=VA/V1\n",
+ "Pi=110.0\n",
+ "pf=Pi/(V1*Io)\n",
+ "Iw=Io*pf\n",
+ "Im=sqrt(pow(Io,2)-pow(Iw,2))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The loss component of no-load current is given as %.4f A.\" %(Iw)\n",
+ "print \"The magnetising component of no-load current is %.4f A.\" %(Im)\n",
+ "print \"The no-load power factor is %.4f.\" %(pf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The loss component of no-load current is given as 0.4783 A.\n",
+ "The magnetising component of no-load current is 1.4446 A.\n",
+ "The no-load power factor is 0.3143.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.8,Page number: 382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the hysterisis and eddy-current losses of the transformer.\"\"\"\n",
+ "\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=50.0 #Operating frequency of the transformer(in Hertz)\n",
+ "eq1=100.0 #Iron loss at 60 Hz(in Watts)\n",
+ "eq2=60.0 #Iron loss at 40 Hz(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" P_h=A*f ; P_e=B*f*f ; \n",
+ " \n",
+ " P_i=P_h+P_e=(A*f)+(B*f*f); \"\"\"\n",
+ "\n",
+ "A=((eq2*36)-(eq1*16))/((40*36)-(60*16))\n",
+ "B=((eq1*4)-(eq2*6))/((3600*4)-(1600*6))\n",
+ "P_h=A*f\n",
+ "P_e=B*f*f\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The Hysteresis loss at 50 Hz is %.2f W.\" %(P_h) \n",
+ "print \"The Eddy-current loss at 50 Hz is %.2f W.\" %(P_e) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Hysteresis loss at 50 Hz is 58.33 W.\n",
+ "The Eddy-current loss at 50 Hz is 20.83 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.9,Page number: 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the primary current snd the primary power factor.\"\"\"\n",
+ "\n",
+ "from math import acos,degrees,cos\n",
+ "from cmath import phase,rect\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V1=440.0 #Primary voltage(in Volts)\n",
+ "V2=110.0 #Secondary voltage(in Volts)\n",
+ "I_0_mod=5.0 #No-load current(in Amperes) \n",
+ "I2=120.0 #Secondary current(in Amperes) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "phi_0=acos(0.2)\n",
+ "phi_2=acos(0.8)\n",
+ "K=V2/V1\n",
+ "I1_load_mod=K*I2\n",
+ "I1_load=rect(I1_load_mod,-phi_2)\n",
+ "I0=rect(I_0_mod,-phi_0)\n",
+ "I1_total=I0+I1_load\n",
+ "pf_primary=cos(phase(I1_total))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The primary current is %.2f A at a phase angle of %.2f degrees.\" %(abs(I1_total),degrees(phase(I1_total)))\n",
+ "print \"The primary power factor is %.3f lagging.\" %(pf_primary)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The primary current is 33.90 A at a phase angle of -42.49 degrees.\n",
+ "The primary power factor is 0.737 lagging.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.10,Page number: 390"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the equivalent resistance as referred to the primary and secondary.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=50e03 #Power rating of the transformer(in Volt-Amperes) \n",
+ "V1=4400.0 #Primary voltage(in Volts) \n",
+ "V2=220.0 #Secondary voltage(in Volts)\n",
+ "R1=3.45 #Primary resistance(in Ohms)\n",
+ "R2=0.009 #Secondary resistance(in Ohms)\n",
+ "X1=5.2 #Leakage reactance of primary(in Ohms)\n",
+ "X2=0.015 #Leakage reactance of secondary(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=VA/V1\n",
+ "I2=VA/V2\n",
+ "K=V2/V1\n",
+ "Re1=R1+(R2/(K*K))\n",
+ "Re2=(K*K*R1)+R2\n",
+ "Xe1=X1+(X2/(K*K))\n",
+ "Xe2=(K*K*X1)+X2\n",
+ "Ze1=sqrt((Re1*Re1)+(Xe1*Xe1))\n",
+ "Ze2=sqrt((Re2*Re2)+(Xe2*Xe2))\n",
+ "tot_copp_loss=(I1*I1*R1)+(I2*I2*R2)\n",
+ "tot_copp_eq_p=I1*I1*Re1\n",
+ "tot_copp_eq_s=I2*I2*Re2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The equivalent resistance as referred to the primary is %.2f Ohms.\" %(Re1)\n",
+ "print \"(b)The equivalent resistance as referred to the secondary is %.4f Ohms.\" %(Re2)\n",
+ "print \"(c)The equivalent reactance as referred to the primary is %.2f Ohms.\" %(Xe1)\n",
+ "print \"(d)The equivalent reactance as referred to the secondary is %.3f Ohms.\" %(Xe2)\n",
+ "print \"(e)The equivalent impedance as referred to the primary is %.2f Ohms.\" %(Ze1)\n",
+ "print \"(f)The equivalent impedance as referred to the secondary is %.4f Ohms.\" %(Ze2)\n",
+ "print \"(g)The total copper loss by using the individual resistances of the two windings is %.2f W.\" %(tot_copp_loss)\n",
+ "print \" By considering equivalent resistances,\"\n",
+ "print \" Total copper loss(referred to primary equivalent resistance)=%.2f W.\" %(tot_copp_eq_p) \n",
+ "print \" Total copper loss(referred to secondary equivalent resistance)=%.2f W\" %(tot_copp_eq_s)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The equivalent resistance as referred to the primary is 7.05 Ohms.\n",
+ "(b)The equivalent resistance as referred to the secondary is 0.0176 Ohms.\n",
+ "(c)The equivalent reactance as referred to the primary is 11.20 Ohms.\n",
+ "(d)The equivalent reactance as referred to the secondary is 0.028 Ohms.\n",
+ "(e)The equivalent impedance as referred to the primary is 13.23 Ohms.\n",
+ "(f)The equivalent impedance as referred to the secondary is 0.0331 Ohms.\n",
+ "(g)The total copper loss by using the individual resistances of the two windings is 910.38 W.\n",
+ " By considering equivalent resistances,\n",
+ " Total copper loss(referred to primary equivalent resistance)=910.38 W.\n",
+ " Total copper loss(referred to secondary equivalent resistance)=910.38 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.11,Page number: 393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the full-load regulation for different load power factors.\"\"\"\n",
+ "\n",
+ "from math import cos,acos,sin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=40e03 #Power rating of the transformer(in Volt-Amperes) \n",
+ "V1=6600.0 #Primary voltage(in Volts) \n",
+ "V2=250.0 #Secondary voltage(in Volts)\n",
+ "R1=10.0 #Primary resistance(in Ohms)\n",
+ "R2=0.02 #Secondary resistance(in Ohms)\n",
+ "Xe1=35.0 #Equivalent leakage reactance as referred to the primary(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "K=V2/V1\n",
+ "I2=VA/V2\n",
+ "Re2=(K*K*R1)+R2\n",
+ "Xe2=(K*K*Xe1)\n",
+ "pf=1\n",
+ "phi=acos(pf)\n",
+ "per_reg_a=(((I2*Re2*pf)+(I2*Xe2*sin(phi)))/V2)*100\n",
+ "pf=0.8\n",
+ "phi=acos(pf)\n",
+ "per_reg_b=(((I2*Re2*pf)+(I2*Xe2*sin(phi)))/V2)*100\n",
+ "pf=0.8\n",
+ "phi=acos(pf)\n",
+ "per_reg_c=(((I2*Re2*pf)-(I2*Xe2*sin(phi)))/V2)*100\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)For unity power factor of the load:\"\n",
+ "print \"The full-load percentage regulation is %.3f percent.\" %(per_reg_a)\n",
+ "print \"\\n(b)For power factor of the load=0.8 lagging:\"\n",
+ "print \"The full-load percentage regulation is %.3f percent.\" %(per_reg_b)\n",
+ "print \"\\n(c)For power factor of the load=0.8 leading:\"\n",
+ "print \"The full-load percentage regulation is %.3f percent.\" %(per_reg_c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)For unity power factor of the load:\n",
+ "The full-load percentage regulation is 2.198 percent.\n",
+ "\n",
+ "(b)For power factor of the load=0.8 lagging:\n",
+ "The full-load percentage regulation is 3.687 percent.\n",
+ "\n",
+ "(c)For power factor of the load=0.8 leading:\n",
+ "The full-load percentage regulation is -0.170 percent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.12,Page number: 396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the number of turns in each winding.\"\"\"\n",
+ "\n",
+ "from math import sqrt \n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=50.0 #Operating frequency of the transformer(in Hertz)\n",
+ "E1=5000.0 #Primary voltage at no-load(in Volts)\n",
+ "E2=250.0 #Secondary voltage at no-load(in Volts)\n",
+ "VA_full=150e03 #Power rating of the transformer(in Volt-Ampere) \n",
+ "flux=0.06 #Maximum core flux(in Weber)\n",
+ "Pi=1500.0 #Core losses(in Watts)\n",
+ "Pc_FL=1800.0 #Full-load copper losses(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "N2=E2/(4.44*f*flux)\n",
+ "N1=(E1/E2)*round(N2,0)\n",
+ "pf=1\n",
+ "Po=0.5*VA_full*pf\n",
+ "Pc=0.5*0.5*Pc_FL\n",
+ "effi_b=(Po/(Po+Pi+Pc))*100\n",
+ "pf=0.8\n",
+ "Po=VA_full*pf\n",
+ "Pc=Pc_FL\n",
+ "effi_c=(Po/(Po+Pi+Pc))*100\n",
+ "x=sqrt(Pi/Pc_FL)\n",
+ "VA_load=VA_full*x\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The number of turns in the primary winding is %d.\" %(round(N1,0)) \n",
+ "print \" The number of turns in the secondary winding is %d.\" %(round(N2,0))\n",
+ "print \"(b)The efficiency at half rated kVA and unity power factor is %.3f percent\" %(effi_b)\n",
+ "print \"(c)The efficiency at full load and 0.8 power factor lagging is %.3f percent.\" %(effi_c)\n",
+ "print \"(d)The kVA load for maximum efficiency is %d kVA.\" %(round((VA_load/1000),0))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The number of turns in the primary winding is 380.\n",
+ " The number of turns in the secondary winding is 19.\n",
+ "(b)The efficiency at half rated kVA and unity power factor is 97.466 percent\n",
+ "(c)The efficiency at full load and 0.8 power factor lagging is 97.324 percent.\n",
+ "(d)The kVA load for maximum efficiency is 137 kVA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.13,Page number: 397"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the all-day efficiency of a distribution transformer.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "kVA_FL=200.0 #Power rating of transformer at full-load(in Volt-Ampere) \n",
+ "Pc_FL=3.02 #Full-load copper losses(in kilo-Watts) \n",
+ "Pi=1.6 #Iron-losses(in kilo-Watts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Pi_24_hrs=24.0*Pi\n",
+ "\"\"\" For 80 kW load at unity power factor in 6 hrs:\"\"\"\n",
+ "Po_1=80\n",
+ "t1=6\n",
+ "pf_1=1\n",
+ "output_ene_1=Po_1*t1\n",
+ "kVA_1=Po_1/pf_1\n",
+ "Pc_1=pow((kVA_1/kVA_FL),2)*Pc_FL*t1\n",
+ "\"\"\" For 160 kW load at 0.8 power factor in 8 hrs:\"\"\"\n",
+ "Po_2=160\n",
+ "t2=8\n",
+ "pf_2=0.8\n",
+ "output_ene_2=Po_2*t2\n",
+ "kVA_2=Po_2/pf_2\n",
+ "Pc_2=pow((kVA_2/kVA_FL),2)*Pc_FL*t2\n",
+ "\"\"\" For no load period of 10 hrs:\"\"\"\n",
+ "Po_3=0\n",
+ "t3=10\n",
+ "output_ene_3=0\n",
+ "Pc_3=0\n",
+ "Po_total=output_ene_1+output_ene_2+output_ene_3\n",
+ "Pc_total=Pc_1+Pc_2+Pc_3\n",
+ "all_day_effi=Po_total/(Po_total+Pc_total+Pi_24_hrs)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The all day efficiency of the distribution transformer is %.3f percent.\" %(all_day_effi*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The all day efficiency of the distribution transformer is 96.414 percent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.14,Page number: 398"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the apparent power rating of an autotransformer.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_rated=120.0 #Voltage rating of the transformer(in Volts)\n",
+ "VA=12e03 #Power rating of the transformer(in Volt-Ampere)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=VA/V_rated\n",
+ "I2=I1\n",
+ "input_app_pow=240*I1\n",
+ "output_app_pow=120*2*I1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"In auto-tranformer mode, the input apparent power is %d kVA and the output apparent power is %d kVA.\" %(round((input_app_pow/1000),0),round((output_app_pow/1000),0))\n",
+ "print \"Thus, the apparent power capacity of the 12-kVA transformer is doubled by the auto-transformer connection.\"\n",
+ "print \"In effect,half the apparent power is transformed and half is conducted directly to the secondary side.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In auto-tranformer mode, the input apparent power is 24 kVA and the output apparent power is 24 kVA.\n",
+ "Thus, the apparent power capacity of the 12-kVA transformer is doubled by the auto-transformer connection.\n",
+ "In effect,half the apparent power is transformed and half is conducted directly to the secondary side.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.15,Page number: 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the secondary line voltage on no load when the windings are connected(a)star/delta,(b)delta/star.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L1=3300.0 #Supply voltage(in Volts)\n",
+ "Np=840.0 #Number of turns in the primary\n",
+ "Ns=72.0 #Number of turns in the secondary\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vph_1a=V_L1/sqrt(3)\n",
+ "Vph_2a=Vph_1a*(Ns/Np)\n",
+ "V_L2a=Vph_2a\n",
+ "Vph_1b=V_L1\n",
+ "Vph_2b=Vph_1b*(Ns/Np)\n",
+ "V_L2b=Vph_2b*sqrt(3)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print(\"(a)For star/delta connection: \")\n",
+ "print \"The secondary line voltage on no load is %.2f V.\" %(V_L2a)\n",
+ "print(\"(b)For delta/star connection: \")\n",
+ "print \"The secondary line voltage on no load is %.2f V.\" %(V_L2b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)For star/delta connection: \n",
+ "The secondary line voltage on no load is 163.31 V.\n",
+ "(b)For delta/star connection: \n",
+ "The secondary line voltage on no load is 489.92 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.16,Page number: 403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the magnetising current and the core-loss current in a single-phase transformer.\"\"\" \n",
+ " \n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=12e03 #Power rating of the transformer(in Volt-Ampere) \n",
+ "Vp=400.0 #Primary voltage(in Volts)\n",
+ "Vs=200.0 #Secondary voltage(in Volts)\n",
+ "Wo=120.0 #Power in open-circuit test(in Watts) \n",
+ "V1=200.0 #Voltage in open-circuit test(in Volts)\n",
+ "I_0=1.3 #Current in open-circuit test(in Amperes)\n",
+ "Isc=30.0 #Current in short-circuit test(in Amperes)\n",
+ "Wsc=200.0 #Power in short-circuit test(in Watts)\n",
+ "Vsc=22.0 #Voltage in short-circuit test(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Iw=Wo/V1\n",
+ "Im=sqrt((I_0*I_0)-(Iw*Iw))\n",
+ "R_0=V1/Iw\n",
+ "X_0=V1/Im\n",
+ "K=Vs/Vp\n",
+ "I_FL=VA/Vp\n",
+ "Re1=Wsc/(Isc*Isc)\n",
+ "Ze1=Vsc/Isc\n",
+ "Xe1=sqrt((Ze1*Ze1)-(Re1*Re1))\n",
+ "Re2=K*K*Re1\n",
+ "Xe2=K*K*Xe1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The magnetising current is %.2f A and the core-loss current is %.2f A\" %(Im,Iw)\n",
+ "print \"(b)The parameters of equivalent circuit as referred to the low voltage winding(secondary winding) are: \\n Re2=%.4f ohm \\n Xe2=%.4f ohm\" %(Re2,Xe2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The magnetising current is 1.15 A and the core-loss current is 0.60 A\n",
+ "(b)The parameters of equivalent circuit as referred to the low voltage winding(secondary winding) are: \n",
+ " Re2=0.0556 ohm \n",
+ " Xe2=0.1747 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.17,Page number: 404"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the secondary emf in a transformer.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=25.0e03 #Power rating of the transformer(in VA)\n",
+ "N1=500.0 #Number of turns in the primary winding \n",
+ "N2=40.0 #Number of turns in the secondary winding\n",
+ "V1=3e03 #Voltage of the supply connected to primary(in Volts)\n",
+ "f=50.0 #Frequency of the supply(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "K=N2/N1\n",
+ "E2=K*V1\n",
+ "I1=VA/V1\n",
+ "I2=I1/K\n",
+ "flux=V1/(4.44*f*N1)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The secondary emf is %.2f V.\" %(E2)\n",
+ "print \"(b)The primary current on full-load is %.2f A and the secondary current on full-load is %.2f A.\" %(I1,I2)\n",
+ "print \"(c)The maximum flux in the core is %.4f Wb.\" %(flux)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The secondary emf is 240.00 V.\n",
+ "(b)The primary current on full-load is 8.33 A and the secondary current on full-load is 104.17 A.\n",
+ "(c)The maximum flux in the core is 0.0270 Wb.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.18,Page number: 404"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the active cross-sectional area of the core.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N1=50.0 #Number of turns in the primary winding\n",
+ "B=1.0 #Maximum flux density(in Tesla)\n",
+ "f=50.0 #Frequency rating of the transformer(in Hertz)\n",
+ "V=230.0 #Voltage rating of the transformer(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "E1=V\n",
+ "flux=E1/(4.44*f*N1)\n",
+ "A=flux/B\n",
+ "\"\"\"Due to the insulation of laminations from each other,the gross area is about 10% greater than the active area.\"\"\" \n",
+ "gross=1.1*A\n",
+ "a=sqrt(gross)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The active cross sectional area of the core is %.5f square m.\" %(A)\n",
+ "print \"(b)The side of a square core is %.2f m.\" %(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The active cross sectional area of the core is 0.02072 square m.\n",
+ "(b)The side of a square core is 0.15 m.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.19,Page number: 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the output of the transformer in kVA.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "A=150e-04 #Cross-sectional area of the core(in square metres)\n",
+ "Bm=1.1 #Maximum flux density(in Tesla)\n",
+ "f=50.0 #Frequency of the supply(in Hertz)\n",
+ "N2=66.0 #Number of turns in the secondary winding\n",
+ "Z_L=4.0 #Load impedance(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "flux=Bm*A\n",
+ "E2=4.44*flux*f*N2\n",
+ "I2=E2/Z_L\n",
+ "kVA=(E2*I2)/1000.0\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The output in kVA when connected to a 4 Ohms load impedance is %.2f kVA.\" %(kVA)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output in kVA when connected to a 4 Ohms load impedance is 14.61 kVA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.20,Page number: 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the magnetising current and the iron loss.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I0=1.0 #No-load primary current(in Amperes)\n",
+ "pf=0.24 #Power factor\n",
+ "V1=11e03 #Primary voltage(in Volts)\n",
+ "V2=400 #Secondary voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Iw=I0*pf\n",
+ "Im=sqrt((I0*I0)-(Iw*Iw))\n",
+ "Pi=V1*I0*pf\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The core-loss current is %.2f A.\" %(Iw) \n",
+ "print \"(b)The magnetising current is %.3f A.\" %(Im)\n",
+ "print \"(c)The iron loss is %.2f W.\" %(Pi)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The core-loss current is 0.24 A.\n",
+ "(b)The magnetising current is 0.971 A.\n",
+ "(c)The iron loss is 2640.00 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.21,Page number: 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the supply voltage and the power factor.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import degrees,radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "K=0.5 #Turns ratio of the step-down transformer\n",
+ "R1=2.5 #Resistance of the primary winding(in Ohms)\n",
+ "X1=6.0 #Reactance of the primary winding(in Ohms)\n",
+ "R2=0.25 #Resistance of the secondary winding(in Ohms)\n",
+ "X2=1 #Reactance of the secondary winding(in Ohms)\n",
+ "Im=51.5e-03 #Magnetising current(in Amperes)\n",
+ "Iw=20.6e-03 #Core-loss current(in Amperes)\n",
+ "Z_L=rect(25,radians(30)) #Load impedance(in Ohms)\n",
+ "Vo=50.0 #Output voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z1=R1+1j*X1\n",
+ "Z2=R2+1j*X2\n",
+ "V2=rect(Vo,0)\n",
+ "I2=V2/Z_L\n",
+ "E2=V2+(I2*Z2)\n",
+ "E1=E2/K\n",
+ "E1_minus=-E1\n",
+ "I1_a=-I2*K\n",
+ "\"\"\"Im lags -E1 by 90 degrees and Iw is in phase with -E1.\"\"\"\n",
+ "Im_com=rect(Im,(phase(E1_minus)-radians(90)))\n",
+ "Iw_com=rect(Iw,phase(E1_minus))\n",
+ "I1=I1_a+Im_com+Iw_com\n",
+ "V1=E1_minus+(I1*Z1)\n",
+ "pf_ang=phase(V1)-phase(I1)\n",
+ "pf=cos(pf_ang)\n",
+ "\n",
+ "\n",
+ "#Result:I\n",
+ "print \"The supply voltage is %.4f V at a phase angle of %.2f degrees.\" %(abs(V1),degrees(phase(V1)))\n",
+ "print \"The current drawn from the supply is %.4f A at a phase angle of %.2f degrees.\" %(abs(I1),degrees(phase(I1)))\n",
+ "print \"The power factor is %.3f lagging.\" %(pf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The supply voltage is 108.6120 V at a phase angle of -176.35 degrees.\n",
+ "The current drawn from the supply is 1.0451 A at a phase angle of 148.19 degrees.\n",
+ "The power factor is 0.815 lagging.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.22,Page number: 406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the copper loss in the transformer.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "K=0.25 #Turns ratio of the step-down transformer\n",
+ "R1=1.4 #Resistance of the primary(in Ohms)\n",
+ "X1=5.5 #Reactance of the primary(in Ohms)\n",
+ "R2=0.06 #Resistance of the secondary(in Ohms)\n",
+ "X2=0.04 #Reactance of the secondary(in Ohms)\n",
+ "Vsc=24.0 #Voltage of the HV winding(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Re1=R1+(R2/(K*K))\n",
+ "Xe1=X1+(X2/(K*K))\n",
+ "Ze1=sqrt((Re1*Re1)+(Xe1*Xe1))\n",
+ "Isc=Vsc/Ze1\n",
+ "I1=Isc\n",
+ "I2=I1/K\n",
+ "P=I1*I1*Re1\n",
+ "pf=P/(Vsc*I1)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current in the LV winding is %.3f A.\" %(I2)\n",
+ "print \"(b)The copper loss in the transformer is %.2f W.\" %(P)\n",
+ "print \"(c)The power factor is %.4f.\" %(pf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current in the LV winding is 14.594 A.\n",
+ "(b)The copper loss in the transformer is 31.42 W.\n",
+ "(c)The power factor is 0.3588.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.23,Page number: 406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the regulation and efficiency.\"\"\"\n",
+ "\n",
+ "from math import acos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=20e03 #Power rating of the transformer(in Volt-Amperes)\n",
+ "V1=2200.0 #Voltage of the primary winding(in Volts)\n",
+ "V2=220.0 #Voltage of the secondary winding(in Volts)\n",
+ "f=50.0 #Frequency rating of the transformer(in Hertz)\n",
+ "Vsc=86.0 #Voltage measured during short-circuit test(in Volts)\n",
+ "Isc=10.5 #Current measured during short-circuit test(in Amperes)\n",
+ "Psc=360.0 #Power measured during short-circuit test(in Watts)\n",
+ "Voc=220.0 #Voltage measured during open-circuit test(in Volts)\n",
+ "Ioc=4.2 #Current measured during open-circuit test(in Amperes)\n",
+ "Poc=148.0 #Power measured during open-circuit test(in Watts)\n",
+ "pf=0.8 #Lagging power factor\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ze1=Vsc/Isc\n",
+ "Re1=Psc/(Isc*Isc)\n",
+ "Xe1=sqrt((Ze1*Ze1)-(Re1*Re1))\n",
+ "I1=VA/V1\n",
+ "reg=(I1*((Re1*pf)+(Xe1*sin(acos(pf)))))/V1\n",
+ "Pc=(I1/Isc)*(I1/Isc)*Psc\n",
+ "Pi=Poc\n",
+ "Po=VA*pf\n",
+ "effi=Po/(Po+Pc+Pi)\n",
+ "pf_sc=Re1/Ze1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The regulation at 0.8 pf lagging at full load is %.2f per cent.\" %(reg*100) \n",
+ "print \" The efficiency is %.2f per cent.\" %(effi*100)\n",
+ "print \"(b)The power factor on short circuit is %.3f lagging.\" %(pf_sc)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The regulation at 0.8 pf lagging at full load is 2.94 per cent.\n",
+ " The efficiency is 97.45 per cent.\n",
+ "(b)The power factor on short circuit is 0.399 lagging.\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.24,Page number: 407"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the efficiency at half of full-load current.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=200e03 #Power rating of the transformer(in VA)\n",
+ "effi_FL=0.98 #Full-load efficiency of the transformer\n",
+ "pf=0.8 #Lagging power factor\n",
+ "x=0.75 #Fraction of load at which maximum efficiency occurs\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Po=VA*pf\n",
+ "Pin=Po/effi_FL\n",
+ "tot_loss=Pin-Po\n",
+ "Pc=tot_loss/(1+(x*x))\n",
+ "Pi=tot_loss-Pc\n",
+ "x_new=0.5\n",
+ "P1=(x_new*x_new*Pc)+Pi\n",
+ "effi_half=(Po/2.0)/((Po/2.0)+P1)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The efficiency at half of full-load current is %.3f per cent.\" %(effi_half*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency at half of full-load current is 97.922 per cent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.25,Page number: 408"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the efficiency at different rated kVAs.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=150e03 #Power rating of the transformer(in Volt-Amperes)\n",
+ "V1=5000.0 #Voltage of the primary winding(in Volts)\n",
+ "V2=250.0 #Voltage of the secondary winding(in Volts)\n",
+ "f=50.0 #Frequency rating of the transformer(in Hertz)\n",
+ "Pc=1.8e03 #Full-load copper losses(in Watts)\n",
+ "Pi=1.5e03 #Core losses(in Watts)\n",
+ "flux=60e-03 #Maximum core flux(in Webers)\n",
+ "pf=0.8 #Lagging power factor\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "N2=V2/(4.44*f*flux)\n",
+ "N1=round(N2,0)*(V1/V2)\n",
+ "\"\"\"Case 1:\"\"\"\n",
+ "Po=(VA*pf)\n",
+ "effi_a=Po/(Po+Pi+Pc)\n",
+ "\"\"\"Case 2:\"\"\"\n",
+ "pf=1.0\n",
+ "Po=0.5*VA*pf\n",
+ "Pc_new=0.5*0.5*Pc\n",
+ "effi_b=Po/(Po+Pi+Pc_new)\n",
+ "\n",
+ "x=sqrt(Pi/Pc)\n",
+ "VA_max_effi=x*VA\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The number of turns in the primary winding is %d turns.\" %(round(N1,0))\n",
+ "print \" The number of turns in the secondary winding is %d turns.\" %(round(N2,0))\n",
+ "print \"(b)The efficiency at full rated kVA with 0.8 pf lagging is %.2f percent.\" %(effi_a*100) \n",
+ "print \"(c)The efficiency at half rated kVA with unity pf is %.2f percent.\" %(effi_b*100)\n",
+ "print \"(d)The kVA load for maximum efficieny is %d kVA.\" %(round((VA_max_effi/1000),0)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The number of turns in the primary winding is 380 turns.\n",
+ " The number of turns in the secondary winding is 19 turns.\n",
+ "(b)The efficiency at full rated kVA with 0.8 pf lagging is 97.32 percent.\n",
+ "(c)The efficiency at half rated kVA with unity pf is 97.47 percent.\n",
+ "(d)The kVA load for maximum efficieny is 137 kVA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.26,Page number: 409 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the impedance on the high voltage side.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=50e03 #Power rating of the transformer(in VA)\n",
+ "V1=2400.0 #Voltage of primary winding(in Volts)\n",
+ "V2=240.0 #Voltage of secondary winding(in Volts)\n",
+ "f=50.0 #Frequency rating of the transformer(in Hertz)\n",
+ "LV=240.0 #Low tension voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I2=VA/V2\n",
+ "Z_L=V2/I2\n",
+ "K=V2/V1\n",
+ "Zeq=Z_L/(K*K)\n",
+ "I_high=K*I2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The load impedance connected to the LV side is %.3f Ohms.\" %(Z_L)\n",
+ "print \"(b)The load impedance referred to to the high voltage side is %.2f Ohms.\" %(Zeq)\n",
+ "print \"(c)The current referred to the high voltage side is %.3f A.\" %(I_high) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The load impedance connected to the LV side is 1.152 Ohms.\n",
+ "(b)The load impedance referred to to the high voltage side is 115.20 Ohms.\n",
+ "(c)The current referred to the high voltage side is 20.833 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.27,Page number: 409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the kVA output of the transformer.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "VA=10e03 #Power rating of the transformer(in VA)\n",
+ "V1=2300.0 #Voltage of HT winding(in Volts)\n",
+ "V2=230.0 #Voltage of LT winding(in Volts)\n",
+ "f=50.0 #Frequency rating of the transformer(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_HT=VA/V1\n",
+ "I_LT=VA/V2\n",
+ "I2=I_HT+I_LT\n",
+ "I1=I_LT\n",
+ "kVA_out=(V1*I2)/1000.0\n",
+ "VA_c=(V1*I1)\n",
+ "VA_i=V1*(I2-I1)\n",
+ "K=V1/(V1+V2)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current distribution in the windings: load current=%.2f A and the input current is %.2f A.\" %(I2,I1)\n",
+ "print \"(b)The kVA output is %.2f kVA.\" %(kVA_out)\n",
+ "print \"(c)The volt-amperes transferred conductively is %.2f kVA\" %(VA_c/1000.0) \n",
+ "print \" The volt-amperes transferred inductively is %.2f kVA\" %(VA_i/1000.0)\n",
+ "print \"(d)The saving in copper as compared to the two-winding transformer is %.2f per cent.\" %(K*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current distribution in the windings: load current=47.83 A and the input current is 43.48 A.\n",
+ "(b)The kVA output is 110.00 kVA.\n",
+ "(c)The volt-amperes transferred conductively is 100.00 kVA\n",
+ " The volt-amperes transferred inductively is 10.00 kVA\n",
+ "(d)The saving in copper as compared to the two-winding transformer is 90.91 per cent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter14.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter14.ipynb new file mode 100755 index 00000000..8d806acc --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter14.ipynb @@ -0,0 +1,1213 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14: ALTERNATORS AND SYNCHRONOUS MOTORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.1,Page number: 433"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the number of poles on the generator if the frequency of the generated voltage is decreased.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=60 #Frequency of ac-generator(in Hertz)\n",
+ "P=6 #Number of poles\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ns=(120*f)/P\n",
+ "f=20\n",
+ "P=(120*f)/Ns\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The speed of rotation of the generator is %d rpm.\" %(Ns)\n",
+ "print \"If the frequency is reduced to 20Hz,the required number of poles is %d.\" %(P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed of rotation of the generator is 1200 rpm.\n",
+ "If the frequency is reduced to 20Hz,the required number of poles is 2.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.2,Page number: 441\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the distribution factor for a machine.\"\"\"\n",
+ "\n",
+ "from math import radians,degrees,sin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "slots=9 #Number of slots\n",
+ "slot_angle=radians(180/9) #Slot angle(in radians)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "q_a=120.0/degrees(slot_angle)\n",
+ "k_d_a=sin(q_a*(slot_angle/2.0))/(q_a*sin(slot_angle/2.0))\n",
+ "q_b=60.0/degrees(slot_angle)\n",
+ "k_d_b=sin(q_b*(slot_angle/2.0))/(q_b*sin(slot_angle/2.0))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The distribution factor for a machine for a three phase winding with 120 degrees phase group is %.3f.\" %(k_d_a)\n",
+ "print \"(b)The distribution factor for a machine for a three phase winding with 60 degrees phase group is %.3f.\" %(k_d_b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The distribution factor for a machine for a three phase winding with 120 degrees phase group is 0.831.\n",
+ "(b)The distribution factor for a machine for a three phase winding with 60 degrees phase group is 0.960.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.3,Page number: 441"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the speed,the generated emf per phase,and the line emf of a three-phase alternator.\"\"\"\n",
+ "\n",
+ "from math import radians,degrees,sqrt,sin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "phase=3 #Number of phases\n",
+ "f=50 #Frequency rating(in Hertz)\n",
+ "P=20 #Number of poles \n",
+ "slots=180 #Number of slots on the stator\n",
+ "cond_per_slot=8 #Number of conductors per slot\n",
+ "flux=25e-03 #Flux per pole(in Weber) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z=slots*cond_per_slot\n",
+ "T=(Z/2)/phase\n",
+ "Ns=(120*f)/P\n",
+ "k_p=1\n",
+ "slots_per_pole=slots/P\n",
+ "slot_angle=radians(180/slots_per_pole)\n",
+ "q=slots_per_pole/phase\n",
+ "k_d=sin(q*(slot_angle/2))/(q*sin(slot_angle/2))\n",
+ "E=4.44*f*flux*T*k_p*k_d\n",
+ "line_emf=sqrt(3.0)*E\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The speed of the alternator is %d rpm.\" %(round(Ns,0))\n",
+ "print \"(b)The rms value of generated EMF per phase is %.2f V.\" %(E)\n",
+ "print \"(c)The line EMF is %.2f V.\" %(line_emf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The speed of the alternator is 300 rpm.\n",
+ "(b)The rms value of generated EMF per phase is 1278.45 V.\n",
+ "(c)The line EMF is 2214.34 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.4,Page number: 446\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage regulation for full-load for a three-phase alternator.\"\"\"\n",
+ "\n",
+ "from math import sqrt,cos,acos \n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=600e06 #Power rating of the alternator(in VA) \n",
+ "V_L=22e03 #Rated terminal voltage(in Volts) \n",
+ "sync_imp=0.16 #Synchronous impedance per phase(in Ohms)\n",
+ "res_phase=0.014 #Resistance per phase(in Ohms) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_L=P/(sqrt(3)*V_L)\n",
+ "Iph=I_L\n",
+ "V=V_L/sqrt(3)\n",
+ "Vz=Iph*sync_imp\n",
+ "theta=acos(res_phase/sync_imp)\n",
+ "pf=0.8\n",
+ "phi=acos(pf)\n",
+ "alpha=theta-phi\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "vol_reg_a=(E-V)/V\n",
+ "pf=1\n",
+ "phi=acos(pf)\n",
+ "alpha=theta-phi\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "vol_reg_b=(E-V)/V\n",
+ "pf=0.8\n",
+ "phi=acos(pf)\n",
+ "alpha=theta+phi\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "vol_reg_c=(E-V)/V\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)For a power factor of 0.8 lagging:\"\n",
+ "print \"The voltage regulation for full load is %.2f percent.\" %(vol_reg_a*100)\n",
+ "print \"(b)For unity power factor:\"\n",
+ "print \"The voltage regulation for full load is %.2f percent.\" %(vol_reg_b*100)\n",
+ "print \"(c)For a power factor of 0.8 leading:\" \n",
+ "print \"The voltage regulation for full load is %.2f percent.\" %(vol_reg_c*100)\n",
+ "print \"\\nNote:The voltage regulation for leading power-factor load is negative.\"\n",
+ "print \"It means that on removing the load, the terminal voltage decreases.\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)For a power factor of 0.8 lagging:\n",
+ "The voltage regulation for full load is 14.20 percent.\n",
+ "(b)For unity power factor:\n",
+ "The voltage regulation for full load is 3.64 percent.\n",
+ "(c)For a power factor of 0.8 leading:\n",
+ "The voltage regulation for full load is -8.90 percent.\n",
+ "\n",
+ "Note:The voltage regulation for leading power-factor load is negative.\n",
+ "It means that on removing the load, the terminal voltage decreases.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.5,Page number: 450\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the synchronous reactance per phase and the voltage regulation for a three-phase star-connected alternator.\"\"\"\n",
+ "\n",
+ "from math import acos,sqrt,cos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=900 #Open-circuit voltage(line to line)(in Volts)\n",
+ "V_L_rated=3.3e03 #Rated voltage of the alternator(in Volts)\n",
+ "I_f=100 #Full-load current(in Amperes)\n",
+ "R=0.9 #Armature Resistance(in Ohm/phase)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V_oc=V_L/sqrt(3)\n",
+ "I_sc=I_f\n",
+ "sync_imp=V_oc/I_sc\n",
+ "sync_rea=sqrt((sync_imp*sync_imp)-(R*R))\n",
+ "theta=acos(R/sync_imp)\n",
+ "V=V_L_rated/sqrt(3)\n",
+ "Vz=I_f*sync_imp\n",
+ "pf=0.8\n",
+ "phi=acos(pf)\n",
+ "alpha=theta-phi\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "vol_reg_a=(E-V)/V\n",
+ "pf=0.8\n",
+ "phi=acos(pf)\n",
+ "alpha=theta+phi\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "vol_reg_b=(E-V)/V\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The synchronous reactance per phase is %.3f Ohms.\" %(sync_rea)\n",
+ "print \"(a) For a power factor of 0.8 lagging:\"\n",
+ "print \"The voltage regulation for full load is %.2f percent\" %(vol_reg_a*100)\n",
+ "print \"(b) For a power factor of 0.8 leading:\"\n",
+ "print \"The voltage regulation for full load is %.2f percent.\" %(vol_reg_b*100)\n",
+ "print \"\\nNote: The voltage regulation for leading power-factor load is negative.\"\n",
+ "print \"It means that on removing the load, the terminal voltage decreases.\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The synchronous reactance per phase is 5.118 Ohms.\n",
+ "(a) For a power factor of 0.8 lagging:\n",
+ "The voltage regulation for full load is 21.34 percent\n",
+ "(b) For a power factor of 0.8 leading:\n",
+ "The voltage regulation for full load is -9.03 percent.\n",
+ "\n",
+ "Note: The voltage regulation for leading power-factor load is negative.\n",
+ "It means that on removing the load, the terminal voltage decreases.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.6,Page number: 455\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the angle of retard of a synchronous motor.\"\"\"\n",
+ "\n",
+ "from math import sqrt,acos,cos,pi,asin,sin,degrees\n",
+ "from cmath import phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Po=9e03 #Power rating of synchronous motor(in Watts) \n",
+ "V_L=400 #Voltage rating of synchronous motor(in Watts)\n",
+ "Zs=0.4+3*1j #Synchronous impedance per phase(in Ohms) \n",
+ "pf=0.8 #Power factor(leading) \n",
+ "effi=0.9 #Efficiency of the motor\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Pin=Po/effi\n",
+ "I_L=Pin/(sqrt(3)*V_L*pf)\n",
+ "I=I_L\n",
+ "phi=acos(pf)\n",
+ "mod_Zs=abs(Zs)\n",
+ "theta=phase(Zs)\n",
+ "V=V_L/sqrt(3)\n",
+ "Er=I*mod_Zs\n",
+ "E=sqrt((V*V)+(Er*Er)+(2*V*Er*cos(pi-(theta+phi))))\n",
+ "E_L=sqrt(3)*E\n",
+ "angle_retard=asin((Er*sin(theta+phi))/E)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The angle of retard of the rotor is %.2f degrees.\" %(degrees(angle_retard))\n",
+ "print \"The excitation emf E to which the motor has to be excited to give a full-load output at 0.8 leading power factor is %.2f V.\" %(E_L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The angle of retard of the rotor is 10.47 degrees.\n",
+ "The excitation emf E to which the motor has to be excited to give a full-load output at 0.8 leading power factor is 453.81 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.7,Page number: 459"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the line emf generated by the alternator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "S=24.0 #Number of slots in the alternator\n",
+ "C=12.0 #Number of conductors per slot\n",
+ "flux=0.1 #Flux per pole(in Weber)\n",
+ "P=4.0 #Number of poles in the alternator\n",
+ "Ns=1500.0 #Synchronous speed of the alternator(in rpm)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Zph=S*C/3.0\n",
+ "T=Zph/2.0\n",
+ "S_pole=S/P\n",
+ "slot_ang=180.0/S_pole\n",
+ "q=S_pole/3.0\n",
+ "kd=sin((q*radians(slot_ang)/2))/(q*sin(radians(slot_ang/2)))\n",
+ "f=(P*Ns)/120.0\n",
+ "kp=1.0\n",
+ "E=4.44*flux*f*T*kp*kd\n",
+ "E_L=sqrt(3.0)*E\n",
+ " \n",
+ " \n",
+ "#Result:\n",
+ "print \"The line emf generated when the alternator runs at 1500 rpm is %.2f V.\" %(E_L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The line emf generated when the alternator runs at 1500 rpm is 1782.78 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.8,Page number: 460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the net emf induced in the 6 coil in series constituting the alternator winding.\"\"\"\n",
+ "\n",
+ "from math import radians,sin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "q=6.0 #Number of slots per pole per phase\n",
+ "angle=30.0 #Electrical angle between two consecutive slotss(in degrees) \n",
+ "e=10.0 #Emf of each coil(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "kd=sin(q*(radians(angle/2.0)))/(q*sin(radians(angle/2.0)))\n",
+ "arith_sum=6*e\n",
+ "Er=kd*arith_sum\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The net emf induced in the six coils in series is %.3f V.\" %(round(Er,3)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The net emf induced in the six coils in series is 38.637 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.9,Page number: 460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the number of poles and the current rating of an alternator.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N=120.0 #Speed of the alternator(in rpm)\n",
+ "f=50.0 #Frequency of the alternator(in Hertz)\n",
+ "VA=100e06 #VA rating of the alternator(in Volt-Ampere)\n",
+ "pf=1.0 #Power factor\n",
+ "V_L=11e03 #Line voltage(in Volts)\n",
+ "effi=0.97 #Efficiency of the alternator \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "P=(120.0*f)/N\n",
+ "Po=VA*pf\n",
+ "I_L=VA/(sqrt(3.0)*V_L)\n",
+ "Pin=Po/effi\n",
+ "tor=Pin/(2*pi*N/60.0)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The number of poles is %d.\" %(P)\n",
+ "print \"(b)The current rating is %.2f A.\" %(I_L)\n",
+ "print \"(c)The input power is %.2f MW.\" %(round((Pin/1000000),2))\n",
+ "print \"(d)The prime-mover torque applied to the genrator shaft is %e Nm.\" %(tor)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The number of poles is 50.\n",
+ "(b)The current rating is 5248.64 A.\n",
+ "(c)The input power is 103.09 MW.\n",
+ "(d)The prime-mover torque applied to the genrator shaft is 8.203863e+06 Nm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.10,Page number: 460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the percentage regulation for a load.\"\"\"\n",
+ "\n",
+ "from math import atan,radians,acos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=11e03 #Line voltage of the star-connected alternator(in Volts)\n",
+ "VA=800e03 #Power rating of the alternator(in Volt-Amperes)\n",
+ "Rs=1.5 #Resistance per phase(in Ohms)\n",
+ "Xs=25.0 #Synchronous reactance(in Ohms)\n",
+ "pf=0.8 #Leading power factor\n",
+ "Po=600e03 #Output power(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vph=V_L/sqrt(3.0)\n",
+ "V=Vph\n",
+ "Iph=Po/(sqrt(3.0)*V_L*pf)\n",
+ "Zs=sqrt((Rs*Rs)+(Xs*Xs))\n",
+ "theta=atan(Xs/Rs)\n",
+ "Vz=Iph*Zs\n",
+ "pf_ang=acos(pf)\n",
+ "alpha=theta+pf_ang\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "reg=(E-V)/V\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The percentage regulation is %.3f per cent.\" %(reg*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage regulation is -7.641 per cent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.11,Page number: 461"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the full-load voltage regulation of the alternator.\"\"\"\n",
+ "\n",
+ "from math import atan,acos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=6e03 #Line voltage of the alternator(in Volts)\n",
+ "VA=6000e03 #Power rating of the alternator(in Volt-Amperes)\n",
+ "R=0.2 #Winding resistance per phase(in Ohms)\n",
+ "pf=0.8 #Lagging power factor\n",
+ "V_L_OC=480.0 #Line voltage in open-circuit test(in Volts)\n",
+ "I_f_OC=10.0 #Field current in open-circuit test(in Amperes)\n",
+ "I_L_SC=105.0 #Line current in short-circuit test(in Amperes)\n",
+ "I_f_SC=5.0 #Field current in short-circuit test(in Amperes) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"In the short-circuit test,the currents are small compared to the full-load current.\"\"\"\n",
+ "V=V_L/sqrt(3.0)\n",
+ "I=VA/(3*V)\n",
+ "V_ph_OC=V_L_OC/sqrt(3.0)\n",
+ "\"\"\"Since the field current of 5 A gives an armature current of 105 A,a field current of 10 A will give an armature \n",
+ " current of (105*2)=210 A.\"\"\"\n",
+ "I_ph=I_L_SC*2\n",
+ "Zs=V_ph_OC/I_ph\n",
+ "Xs=sqrt((Zs*Zs)-(R*R))\n",
+ "theta=atan(Xs/R)\n",
+ "Vz=I*Zs\n",
+ "pf_ang=acos(pf)\n",
+ "alpha=theta-pf_ang\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "reg=(E-V)/V\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The full-load voltage regulation of the alternator at 0.8 lagging power factor is %.2f per cent.\" %(reg*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The full-load voltage regulation of the alternator at 0.8 lagging power factor is 16.73 per cent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.12,Page number: 462"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the terminal voltage of the generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=50.0 #Frequency rating of the generator(in Hertz)\n",
+ "Z_p=96.0 #Number of conductors per phase\n",
+ "flux=0.1 #Flux per pole(in Webers)\n",
+ "Xs=5.0 #Synchronous reactance per phase(in Ohms)\n",
+ "kd=0.96 #Distribution factor for the stator winding\n",
+ "Z_L=10.0 #Load impedance(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Zs=1j*Xs\n",
+ "kp=1.0\n",
+ "T=Z_p/2.0\n",
+ "E=4.44*f*flux*kp*kd*T\n",
+ "V=E/(1+(Zs/Z_L))\n",
+ "V_L=sqrt(3.0)*abs(V)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The terminal voltage of the generator is %.2f V.\" %(V_L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The terminal voltage of the generator is 1584.79 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.13,Page number: 462"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the percentage change of voltage.\"\"\"\n",
+ "\n",
+ "from math import atan,radians,acos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=6.6e03 #Line voltage of the star-connected alternator(in Volts)\n",
+ "VA=1500e03 #Power rating of the alternator(in Volt-Amperes)\n",
+ "Rs=0.5 #Resistance per phase(in Ohms)\n",
+ "Xs=5.0 #Synchronous reactance(in Ohms)\n",
+ "pf=0.8 #Lagging power factor\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vph=V_L/sqrt(3.0)\n",
+ "V=Vph\n",
+ "Iph=VA/(3.0*Vph)\n",
+ "Zs=sqrt((Rs*Rs)+(Xs*Xs))\n",
+ "theta=atan(Xs/Rs)\n",
+ "Vz=Iph*Zs\n",
+ "pf_ang=acos(pf)\n",
+ "alpha=theta-pf_ang\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "reg=(E-V)/V\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The percentage change in voltage is %.3f per cent.\" %(reg*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in voltage is 12.432 per cent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.14,Page number: 463"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the terminal voltage and load regulation.\"\"\"\n",
+ "\n",
+ "from math import atan,radians,acos,asin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=6599.0 #Line voltage of the star-connected alternator(in Volts)\n",
+ "Rs=0.5 #Resistance per phase(in Ohms)\n",
+ "Xs=5.0 #Synchronous reactance(in Ohms)\n",
+ "I=130.0 #Full-load current(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "E=V_L/sqrt(3.0)\n",
+ "Zs=Rs+1j*Xs\n",
+ "theta=atan(Xs/Rs)\n",
+ "Vz=I*abs(Zs)\n",
+ "pf=0.8\n",
+ "pf_ang=acos(pf)\n",
+ "alpha=theta-pf_ang\n",
+ "tor_ang=asin((Vz*sin(alpha))/E)\n",
+ "V_a=(E*cos(tor_ang))-(Vz*cos(alpha))\n",
+ "reg_a=(E-V_a)/V_a\n",
+ "pf=0.6\n",
+ "pf_ang=acos(pf)\n",
+ "alpha=theta+pf_ang\n",
+ "beta=pi-alpha\n",
+ "tor_ang=asin((Vz*sin(beta))/E)\n",
+ "V_b=(E*cos(tor_ang))+(Vz*cos(beta))\n",
+ "reg_b=(E-V_b)/V_b\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The terminal voltage when the power factor is 0.8 lagging is %.2f V.\" %(V_a)\n",
+ "print \" The load regulation is %.2f per cent.\" %(reg_a*100) \n",
+ "print \"(b)The terminal voltage when the power factor is 0.6 leading is %.2f V.\" %(V_b)\n",
+ "print \" The load regulation is %.2f per cent.\" %(reg_b*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The terminal voltage when the power factor is 0.8 lagging is 3337.45 V.\n",
+ " The load regulation is 14.16 per cent.\n",
+ "(b)The terminal voltage when the power factor is 0.6 leading is 4265.21 V.\n",
+ " The load regulation is -10.67 per cent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.15,Page number: 464"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the percentage load regulation.\"\"\"\n",
+ "\n",
+ "from math import acos,atan\n",
+ "\n",
+ "#Variable Declration:\n",
+ "VA=1.5e06 #Power rating of the synchronous generator(in Volt-Amperes)\n",
+ "V_L=11e03 #Line voltage(in Volts)\n",
+ "Rs=1.2 #Armature resistance(in Ohms)\n",
+ "Xs=25.0 #Synchronous reactance per phase(in Ohms)\n",
+ "P_L=1.4375e06 #Load to be delivered(in Volt-Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V=V_L/sqrt(3.0)\n",
+ "I=P_L/(3*V)\n",
+ "Zs=sqrt((Rs*Rs)+(Xs*Xs))\n",
+ "Vz=I*Zs\n",
+ "pf=0.8\n",
+ "pf_ang=acos(pf)\n",
+ "theta=atan(Xs/Rs)\n",
+ "alpha=theta-pf_ang\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "reg_a=(E-V)/V\n",
+ "alpha=theta+pf_ang\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "reg_b=(E-V)/V\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The percentage load regulation for a power factor of 0.8 lagging is %.2f per cent.\" %(reg_a*100)\n",
+ "print \"(b)The percentage load regulation for a power factor of 0.8 leading is %.2f per cent.\" %(reg_b*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The percentage load regulation for a power factor of 0.8 lagging is 21.15 per cent.\n",
+ "(b)The percentage load regulation for a power factor of 0.8 leading is -13.12 per cent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.16,Page number: 465"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the torque angle of the alternator.\"\"\"\n",
+ "\n",
+ "from math import acos,degrees\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=0.5 #Effective resistance per phase of the alternator(in Ohms)\n",
+ "V_L=2200.0 #Line voltage of the alternator(in Volts)\n",
+ "I_FL=200.0 #Full-load current(in Amperes)\n",
+ "If=30.0 #Field current(in Amperes)\n",
+ "V_L_oc=1100.0 #Line-to-line voltage on open circuit(in Volts)\n",
+ "pf=0.8 #Lagging power factor \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Zs=V_L_oc/(sqrt(3.0)*I_FL)\n",
+ "theta=acos(R/Zs)\n",
+ "Vz=I_FL*Zs\n",
+ "V=V_L/sqrt(3.0)\n",
+ "pf_ang=acos(pf)\n",
+ "alpha=theta-pf_ang\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "Po=V*I_FL*pf\n",
+ "tor_ang=theta-acos((Po+(V*V*cos(theta)/Zs))*(Zs/(E*V)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The torque angle of the alternator is %.2f degrees.\" %(degrees(tor_ang))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The torque angle of the alternator is 14.35 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.17,Page number: 465"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"\"Finding the synchronising power of the alternator.\"\"\"\n",
+ "\n",
+ "from math import acos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=6.0 #Number of poles\n",
+ "VA=3e06 #Power rating of the alternator(in Volt-Amperes)\n",
+ "Ns=1000.0 #Speed of operation of the alternator(in rpm)\n",
+ "V_L=3.3e03 #Line voltage of the load(in Volts)\n",
+ "pf=0.8 #Lagging power factor\n",
+ "\n",
+ "#Calculations:\n",
+ "V=V_L/sqrt(3.0)\n",
+ "I=VA/(sqrt(3.0)*V_L)\n",
+ "IXs=0.25*V\n",
+ "Xs=IXs/I\n",
+ "rotor_dis=radians(1*(P/2.0))\n",
+ "Vz=I*Xs\n",
+ "theta=pi/2\n",
+ "pf_ang=acos(0.8)\n",
+ "alpha=theta-pf_ang\n",
+ "E=sqrt((V*V)+(Vz*Vz)+(2*V*Vz*cos(alpha)))\n",
+ "Psy=(3*E*V*sin(rotor_dis))/(Xs)\n",
+ "tor=(3*Psy)/(2*pi*Ns/60)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The synchronising power is %.2f kW.\" %(Psy/1000)\n",
+ "print \"(b)The synchronising torque per mechanical degree is %.2f kNm.\" %(tor/1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The synchronising power is 733.08 kW.\n",
+ "(b)The synchronising torque per mechanical degree is 21.00 kNm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.18,Page number: 466"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the armature current and power factor.\"\"\"\n",
+ "\n",
+ "from math import radians,degrees\n",
+ "from cmath import rect,phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=2300.0 #Line voltage of the winding(in Volts)\n",
+ "f=50.0 #Operating frequency of the synchronous motor(in Hertz)\n",
+ "Psh=205.0 #Power delivered by the motor(in Horse Power)\n",
+ "ang=15.0 #Power angle(in degrees)\n",
+ "Xs=11.0 #Synchronous reactance(in Ohms)\n",
+ "effi=0.90 #Efficiency of the motor\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V=V_L/sqrt(3.0)\n",
+ "Psh=Psh*746.0\n",
+ "Pd=Psh/effi\n",
+ "E=(Pd*Xs)/(3.0*V*sin(radians(ang)))\n",
+ "I=(rect(V,0)-rect(E,radians(-ang)))/(1j*Xs)\n",
+ "pf=cos(phase(I))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The excitation voltage per phase is %.2f V per phase.\" %(E)\n",
+ "print \"(b)The armature current is %.2f A at a phase angle of %.2f degrees.\" %(abs(I),degrees(phase(I)))\n",
+ "print \"(c)The power factor is %.4f leading.\" %(pf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The excitation voltage per phase is 1812.83 V per phase.\n",
+ "(b)The armature current is 57.44 A at a phase angle of 42.05 degrees.\n",
+ "(c)The power factor is 0.7426 leading.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.19,Page number: 466"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the line current and the power factor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=6600.0 #Line voltage(in Volts)\n",
+ "Xs=20.0 #Synchronous reactance per phase(in Ohms)\n",
+ "Pin=915e03 #Power consumed by the motor(in Watts)\n",
+ "E_L=8942.0 #Induced line emf per phase(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V=V_L/sqrt(3.0)\n",
+ "E=E_L/sqrt(3.0)\n",
+ "I_cos=Pin/(sqrt(3.0)*V_L)\n",
+ "BN=Xs*I_cos\n",
+ "NA=sqrt((E*E)-(BN*BN))\n",
+ "NO=NA-V\n",
+ "Er=sqrt((NO*NO)+(BN*BN))\n",
+ "I_L=Er/Xs\n",
+ "pf=I_cos/I_L\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The line current is %.2f A.\" %(I_L)\n",
+ "print \"(b)The power factor is %.4f leading.\" %(pf) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The line current is 97.05 A.\n",
+ "(b)The power factor is 0.8247 leading.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.20,Page number: 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the power factor when the load on the motor increases.\"\"\"\n",
+ "\n",
+ "from math import acos,asin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_L=6600.0 #Line voltage(in Volts)\n",
+ "Xs=15.0 #Synchronous reactance per phase(in Ohms)\n",
+ "Pin=500e03 #Power consumed by the motor(in Watts)\n",
+ "pf=0.8 #Leading power factor\n",
+ "Pin_new=800e03 #New Input power(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V=V_L/sqrt(3.0)\n",
+ "Zs=Xs\n",
+ "I_L=Pin/(sqrt(3.0)*V_L*pf)\n",
+ "Er=I_L*Zs\n",
+ "pf_ang=acos(pf)\n",
+ "alpha=(pi/2)-pf_ang\n",
+ "E=sqrt((V*V)+(Er*Er)+(2*V*Er*cos(alpha)))\n",
+ "I1_cos=Pin_new/(sqrt(3.0)*V_L)\n",
+ "sin_tor=(Pin_new*Xs)/(E*V)\n",
+ "AN=V*sin_tor\n",
+ "NB=E-(V*cos(asin(sin_tor)))\n",
+ "Er1=sqrt((AN*AN)+(NB*NB))\n",
+ "I1=Er1/Xs\n",
+ "pf=I1_cos/I1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The power factor when the load on the motor increases is %.4f leading.\" %(pf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power factor when the load on the motor increases is 0.3229 leading.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.21,Page number: 469"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the power factor and kVA rating of the synchronous motor.\"\"\"\n",
+ "\n",
+ "from math import atan,acos\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Si=500e03 #Load supplied by the three-phase system(in Volt-Amperes)\n",
+ "pf_i=0.5 #Lagging power factor of three-phase system\n",
+ "Po=100.0 #Load supplied by the synchronous motor(in Horse-Power)\n",
+ "pf_t=0.9 #Overall lagging power factor \n",
+ "effi=0.87 #Efficiency of the synchronous motor\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Pi=Si*pf_i\n",
+ "Qi=Si*sin(acos(pf_i))\n",
+ "Ps=(Po*746)/effi\n",
+ "Pt=Pi+Ps\n",
+ "St=Pt/pf_t\n",
+ "Qt=St*sin(acos(pf_t))\n",
+ "Qs=Qt-Qi\n",
+ "pf_ang=atan(Qs/Ps)\n",
+ "pf_s=cos(pf_ang)\n",
+ "Ss=sqrt((Ps*Ps)+(Qs*Qs))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The power faactor of the synchronous motor is %.2f leading.\" %(pf_s)\n",
+ "print \"(b)The kVA rating of the synchronous motor is %.2f kVA.\" %(Ss/1000.0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The power faactor of the synchronous motor is 0.30 leading.\n",
+ "(b)The kVA rating of the synchronous motor is 283.67 kVA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter15.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter15.ipynb new file mode 100755 index 00000000..f49bd253 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter15.ipynb @@ -0,0 +1,957 @@ +{ + "metadata": { + "name": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 15: INDUCTION MOTORS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.1,Page number: 480" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the synchronous speed of an induction motor and the frequency of rotor currents at standstill.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "P=6.0 #Number of poles \n", + "f=50.0 #Operating frequency of the induction motor(in Hertz)\n", + "s_no_load=0.01 #Slip at no-load \n", + "s_full_load=0.03 #Slip at full-load\n", + "\n", + "\n", + "#Calculations:\n", + "Ns=(120.0*f)/P\n", + "N_no_load=Ns*(1-s_no_load)\n", + "N_full_load=Ns*(1-s_full_load)\n", + "s_standstill=1.0\n", + "fr_standstill=s_standstill*f\n", + "fr_full_load=s_full_load*f\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The synchronous speed is %d rpm.\" %(Ns) \n", + "print \"(b)The no-load speed is %d rpm.\" %(N_no_load) \n", + "print \"(c)The full-load speed is %d rpm.\" %(N_full_load) \n", + "print \"(d)The frequency of rotor-currents at standstill is %.2f Hz.\" %(fr_standstill)\n", + "print \"(e)The frequency of rotor-currents at full-load is %.2f Hz.\" %(fr_full_load)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The synchronous speed is 1000 rpm.\n", + "(b)The no-load speed is 990 rpm.\n", + "(c)The full-load speed is 970 rpm.\n", + "(d)The frequency of rotor-currents at standstill is 50.00 Hz.\n", + "(e)The frequency of rotor-currents at full-load is 1.50 Hz.\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.2,Page number: 480" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the frequency of rotor-current in an induction motor.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "P=12.0 #Number of poles \n", + "f=50.0 #Operating frequency of induction motor(in Hertz)\n", + "N=485.0 #Speed of the motor(in rpm) \n", + "\n", + "\n", + "#Calculations:\n", + "Ns=(120.0*f)/P\n", + "s=(Ns-N)/Ns\n", + "fr=s*f\n", + "\n", + "\n", + "#Result:\n", + "print \"The frequency of the rotor-currents is %.2f Hz.\" %(fr) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The frequency of the rotor-currents is 1.50 Hz.\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.3,Page number: 481 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the full-load slip and speed of an induction motor.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "fr=2.0 #Frequency of thr rotoremf at full-load(in Hertz) \n", + "f=50.0 #Frequency of the supply(in Hertz)\n", + "P=6.0 #Number of poles \n", + "\n", + "\n", + "#Calculations:\n", + "s=fr/f\n", + "Ns=(120*f)/P\n", + "N=Ns*(1-s)\n", + "\n", + "\n", + "#Result:\n", + "print \"The slip at full-load is %.2f percent.\" %(s*100)\n", + "print \"The full-load speed is %d rpm.\" %(N) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The slip at full-load is 4.00 percent.\n", + "The full-load speed is 960 rpm.\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.4,Page number: 481 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the synchronous speed and the rotor frequency of an induction motor.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "f=50.0 #Frequency of the supply(in Hertz) \n", + "P=4.0 #Number of poles\n", + "\n", + "\n", + "#Calculations:\n", + "Ns=(120*f)/P\n", + "s1=0.04\n", + "N1=Ns*(1-s1) \n", + "N2=600\n", + "s2=(Ns-N2)/Ns\n", + "fr=s2*f\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The synchronous speed is %d rpm.\" %(Ns)\n", + "print \"(b)The speed of the rotor when the slip is 0.04 is %d rpm.\" %(N1)\n", + "print \"(c)The rotor frequency when the speed of the rotor is 600 rpm is %.2f Hz.\" %(fr)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The synchronous speed is 1500 rpm.\n", + "(b)The speed of the rotor when the slip is 0.04 is 1440 rpm.\n", + "(c)The rotor frequency when the speed of the rotor is 600 rpm is 30.00 Hz.\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.5,Page number: 484 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the rotor current of a three-phase induction motor.\"\"\"\n", + "\n", + "from math import sqrt,pow,acos,radians,degrees\n", + "\n", + "#Variable Declaration:\n", + "E_L=100.0 #Induced EMF(in Volts)\n", + "R2=0.05 #Resistance of rotor windings(in Ohms) \n", + "X_20=0.1 #Standstill reactance of rotor windings(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "E_20=E_L/sqrt(3.0)\n", + "s_a=0.04\n", + "E2_a=s_a*E_20\n", + "Z2_a=sqrt((R2*R2)+pow((s_a*X_20),2))\n", + "I2_a=E2_a/Z2_a\n", + "angle_a=acos(R2/Z2_a)\n", + "s_b=1.0\n", + "E2_b=s_b*E_20\n", + "Z2_b=sqrt((R2*R2)+pow((s_b*X_20),2))\n", + "I2_b=E2_b/Z2_b\n", + "angle_b=acos(R2/Z2_b)\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)At 4% slip : \"\n", + "print \" The rotor current is %.2f A.\" %(round(I2_a,2))\n", + "print \" The phase difference between the rotor voltage and the rotor current is %.2f degrees.\" %(round(degrees(angle_a),2))\n", + "print \"\\n(b)At 100% slip :\"\n", + "print \" The rotor current is %.2f A.\" %(round(I2_b,2))\n", + "print \" The phase difference between the rotor voltage and the rotor current is %.2f degrees.\" %(round(degrees(angle_b),2))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)At 4% slip : \n", + " The rotor current is 46.04 A.\n", + " The phase difference between the rotor voltage and the rotor current is 4.57 degrees.\n", + "\n", + "(b)At 100% slip :\n", + " The rotor current is 516.40 A.\n", + " The phase difference between the rotor voltage and the rotor current is 63.43 degrees.\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.6,Page number: 485" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the developed power,air-gap power,rotor copper loss,and stator loss in an induction motor.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "HP=746.0 #Value of Horse-Power(in Watts) \n", + "f=50.0 #Operating frequency of the induction motor(in Hertz)\n", + "N=1470.0 #Speed of the motor(in rpm)\n", + "P=4.0 #Number of poles\n", + "phase=3.0 #Number of phases \n", + "effi=87.5e-02 #Efficiency of the motor at full-load \n", + "\n", + "\n", + "#Calculations:\n", + "Po=5.0*HP\n", + "Pin=Po/effi\n", + "total_loss=Pin-Po\n", + "mech_loss=0.05*total_loss\n", + "elec_loss=total_loss-mech_loss\n", + "dev_pow=Po+mech_loss\n", + "Ns=(120*f)/P\n", + "s=(Ns-N)/Ns\n", + "Pg=dev_pow/(1-s)\n", + "P_R=s*Pg\n", + "P_S=Pin-Pg\n", + "\n", + "\n", + "#Result:\n", + "print \"The developed power is %.2f W.\" %(round(dev_pow,2))\n", + "print \"The air-gap power is %.2f W.\" %(round(Pg,2))\n", + "print \"The rotor copper loss is %.2f W.\" %(round(P_R,2))\n", + "print \"The stator loss is %.2f W.\" %(round(P_S,2))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The developed power is 3756.64 W.\n", + "The air-gap power is 3833.31 W.\n", + "The rotor copper loss is 76.67 W.\n", + "The stator loss is 429.55 W.\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.7,Page number: 490 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the rotor speed,the stator current,the power factor and the efficiency of an induction motor. \"\"\"\n", + "\n", + "from math import sqrt,cos,degrees\n", + "from cmath import rect,phase\n", + "\n", + "#Variable Declaration:\n", + "V_L=400.0 #Operating voltage of the induction motor(in Volts)\n", + "P=4.0 #Number of poles\n", + "f=50.0 #Operating frequency of the motor(in Hertz)\n", + "s=0.02 #Slip at rated load \n", + "rot_loss=0.34e03 #Rotational losses(in Watts)\n", + "R1=0.641 #Impedance per phase on the stator side(in Ohms) \n", + "X1=1.106 #Impedance per phase on the stator side(in Ohms) \n", + "R2_eq=0.332 #Impedance per phase on the stator side(in Ohms)\n", + "X_20_eq=0.464 #Impedance per phase on the stator side(in Ohms) \n", + "Xg=26.3 #Impedance per phase on the stator side(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "V1_mod=V_L/sqrt(3)\n", + "V1=rect(V1_mod,0)\n", + "Ns=(120*f)/P\n", + "N=Ns*(1-s)\n", + "V_Th=V1*((Xg/(R1+(X1+Xg)*1j))*1j)\n", + "Z_Th=((Xg*(R1+X1*1j))/(R1+(X1+Xg)*1j))*1j\n", + "R_L_eq=((1-s)/s)*R2_eq\n", + "I1=V_Th/(Z_Th +(R2_eq+X_20_eq*1j)+R_L_eq)\n", + "angle=phase(I1)\n", + "pf=cos(angle)\n", + "Po=(3*abs(I1)*abs(I1)*R_L_eq)-rot_loss\n", + "Pi=3*abs(V1)*abs(I1)*cos(phase(I1))\n", + "effi=(Po/Pi)*100\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The rotor speed is %d rpm.\" %(round(N,0))\n", + "print \"(b)The stator current is %.2f A at a phase angle of %.2f degrees.\" %(abs(I1),degrees(phase(I1))) \n", + "print \"(c)The power factor is %.3f lagging.\" %(pf)\n", + "print \"(d)The output power is %.2f W.\" %(Po)\n", + "print \" The input power is %.2f W.\" %(Pi)\n", + "print \"(e)The efficiency of the motor is %.2f percent.\" %(effi)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The rotor speed is 1470 rpm.\n", + "(b)The stator current is 12.84 A at a phase angle of -3.78 degrees.\n", + "(c)The power factor is 0.998 lagging.\n", + "(d)The output power is 7703.00 W.\n", + " The input power is 8874.78 W.\n", + "(e)The efficiency of the motor is 86.80 percent.\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.8,Page number: 495" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the standstill rotor reactance of an induction motor.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "f=50.0 #Operating frequency of induction motor(in Hertz)\n", + "P=6.0 #Number of poles\n", + "N=940.0 #Speed of motor(in rpm)\n", + "R2=0.1 #Resistance per phase(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "Ns=(120*f)/P\n", + "s=(Ns-N)/Ns\n", + "X_20=R2/s\n", + "\n", + "\n", + "#Result:\n", + "print \"The standstill rotor resistance is %.3f Ohms.\" %(X_20)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The standstill rotor resistance is 1.667 Ohms.\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.9,Page number: 498" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the full-load slip of an induction motor.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "P_motor=6.0 #Number of poles in the induction motor\n", + "N_motor=960.0 #Full-load speed of the induction motor(in rpm)\n", + "P_alt=4.0 #Number of poles in the alternator\n", + "N_alt=1500.0 #Speed of the alternator(in rpm)\n", + "\n", + "\n", + "#Calculations:\n", + "f=(N_alt*P_alt)/120.0\n", + "Ns=(120.0*f)/P_motor\n", + "s=(Ns-N_motor)/Ns\n", + "\n", + "\n", + "#Result:\n", + "print \"The full-load slip of the motor is %.2f percent.\" %(s*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The full-load slip of the motor is 4.00 percent.\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.10,Page number: 498" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the rotor input,motor input and the efficiency of an induction motor.\"\"\"\n", + "\n", + "from math import pi\n", + "\n", + "#Variable Declaration:\n", + "P=4.0 #Number of poles in the induction motor\n", + "useful_tor=160.0 #Useful torque(in Newton-metre)\n", + "s=0.05 #Slip\n", + "P_S=1000.0 #Stator losses(in Watts)\n", + "Pm=500.0 #Frictional and windage losses(in Watts)\n", + "f=50.0 #Frequency of induction motor(in Hertz)\n", + "#Calculations:\n", + "Ns=(120.0*f)/P\n", + "N=(1-s)*Ns\n", + "Po=(2*pi*useful_tor*N)/60.0\n", + "Pd=Po+Pm\n", + "Pg=Pd/(1-s)\n", + "Pin=Pg+P_S\n", + "effi=Po/Pin\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The rotor input is %.4f kW.\" %(Pg/1000.0)\n", + "print \"(b)The motor input is %.4f W.\" %(Pin)\n", + "print \"(c)The efficiency is %.4f percent.\" %(effi*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The rotor input is 25.6591 kW.\n", + "(b)The motor input is 26659.0570 W.\n", + "(c)The efficiency is 89.5609 percent.\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.11,Page number: 499" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the slip of an induction motor.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "effi=0.9 #Efficiency of the induction motor\n", + "Po=50e03 #Load driven by the motor(in Watts)\n", + "\n", + "\n", + "#Calculations:\n", + "Pin=Po/effi\n", + "P_tot=Pin-Po\n", + "\"\"\"The no-load losses comprise of the stator iron loss(Pi) and mechanical losses(Pm)\n", + " (since the stator and rotor copper losses are negligible).These two losses are independent of the load.\n", + " \n", + " Given,the mechanical loss,Pm=(no-load loss)/3.0=((Pi+Pm)/3.0).\n", + " \n", + " Therefore,Pm=(Pi/2.0).\n", + " \n", + " Total loss=(Stator copper loss)+(Stator iron loss)+(Rotor copper loss)+(Mechanical loss).\"\"\"\n", + "Pi=(2.0/7.0)*P_tot\n", + "P_R=Pi\n", + "Pm=Pi/2.0\n", + "Pd=Po+Pm\n", + "Pg=Pd+P_R\n", + "s=P_R/Pg\n", + "\n", + "\n", + "#Result:\n", + "print \"The slip of the induction motor is %.2f percent.\" %(s*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The slip of the induction motor is 3.03 percent.\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.12,Page number: 499" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the rotor current in an induction motor.\"\"\"\n", + "\n", + "from math import sqrt\n", + "\n", + "#Variable Declaration:\n", + "V2=100.0 #Induced emf between slip ring terminals(in Volts)\n", + "R2=0.4 #Resistance per phase of star-connected rotor windings(in Ohms)\n", + "s=0.04 #Slip of rotor\n", + "\n", + "\n", + "#Calculations:\n", + "E20=V2/sqrt(3.0)\n", + "\"\"\"The rotor reactance X2=(s*X20) is negligible for small values of sand hence cam be ignored.\"\"\"\n", + "I2=(s*E20)/R2\n", + "\n", + "\n", + "#Result:\n", + "print \"The rotor current is %.3f A.\" %(I2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The rotor current is 5.774 A.\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.13,Page number: 499" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the number of poles and the slip of an induction motor.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "N=285.0 #Full-load speed of an induction motor(in rpm)\n", + "f=50.0 #Frequency of supply(in Hertz)\n", + "P_R=250.0 #Original rotor losses(in Watts)\n", + "\n", + "\n", + "#Calculations:\n", + "P=(120.0*f)/N\n", + "\"There has to be even number of poles,such that Ns>N.Thus,the actual number of poles is 20.\"\"\"\n", + "P=round((P-1),0)\n", + "Ns=(120.0*f)/P\n", + "s=(Ns-N)/Ns\n", + "\"\"\"For small values of s,the reactance of (s*X20) is much smaller than the resistance R2,hence\n", + " torque is directly proportional to (s/R2).\n", + " \n", + " It means that the to keep the torque same,the (s/R2) ratio should remain the same.If R2 is doubled,then s also has to be \n", + " doubled.\"\"\" \n", + "s_new=2*s\n", + "\"\"\"Since the full-load current remains the same,on doubling the rotor resistance,the copper loss(I*I*R) is also doubled.\"\"\"\n", + "P_R_new=2*P_R\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The number of poles is %d.\" %(P)\n", + "print \"(b)The slip is %.2f percent.\" %(s*100)\n", + "print \"(c)The slip for full-load torque if the rotor resistance is doubled is %.2f percent.\" %(s_new*100)\n", + "print \"(d)The rotor copper losses with added rotor resistance is %.2f W.\" %(P_R_new)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The number of poles is 20.\n", + "(b)The slip is 5.00 percent.\n", + "(c)The slip for full-load torque if the rotor resistance is doubled is 10.00 percent.\n", + "(d)The rotor copper losses with added rotor resistance is 500.00 W.\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.14,Page number: 500" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the slip and the power output of an induction motor when external resistances are inserted in each rotor phase.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "s=0.02 #Full-load slip of the induction motor\n", + "Po=500 #Power rating of the motor(in HorsePower)\n", + "R2=0.25 #Resistance per phase of the rotor(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "R2_new=2.0+R2\n", + "s_new=(s/R2)*(R2_new)\n", + "\"\"\"If Ns is the synchronous speed of the motor,then the speed of the rotor before inserting external resistance,\n", + " N=(1-s)*Ns;\n", + " \n", + " The speed of the rotor after inserting external resistance is N_new=(1-s_new)*Ns;\"\"\"\n", + "\n", + "Po_new=((1-s_new)/(1-s))*Po\n", + " \n", + "\n", + "#Result:\n", + "print \"The new slip is %.2f percent.\" %(s_new*100)\n", + "print \"The new power output is %.2f HP.\" %(Po_new)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The new slip is 18.00 percent.\n", + "The new power output is 418.37 HP.\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.15,Page number: 500" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the full-load speed of an induction motor.\"\"\"\n", + "\n", + "from sympy import *;\n", + "\n", + "#Variable Declaration:\n", + "P=4.0 #Number of poles in the induction motor\n", + "f=50.0 #Rated frequency of the induction motor(in Hertz)\n", + "\n", + "\n", + "#Calculations:\n", + "\"\"\" Starting torque(tor_st)=1.6*(tor_fl) where tor_fl=full-load torque;\n", + " Maximum torque(tor_max)=2.0*(tor_fl);\n", + " \n", + " tor_st/tor_max=0.8;\n", + " \n", + " (tor_st/tor_max)=(2*s_m)/((s_m*s_m)+1))\n", + " \n", + " (s_m*s_m)-(2.5*s_m)+1=0 is a quadratic equation whose roots are 2 and 0.5 \n", + " \n", + " s_m has to be less than 1. Therefore, s_m=0.5; \n", + " \n", + " Similarly,\n", + " (tor_fl)/(tor_max)=0.5; \n", + " \n", + " (tor_fl)/(tor_max)=(2*s_fl*s_m)/((s_m*s_m)+(s_fl*s_fl))\n", + " \n", + " Substituting s_m=0.5,we get a quadratic equation,\n", + " \n", + " (s_fl*s_fl)-(s_fl)+0.125=0 whose roots are 0.8535,0.1465.\n", + " \n", + " s_fl=0.1465 as s_fl should be less than s_m. \"\"\"\n", + "\"\"\"Finding the roots:\"\"\"\n", + "s_m,s_fl= symbols('s_m s_fl')\n", + "a=solve(s_m**2-(2.5*s_m)+1.0,s_m)\n", + "b=solve(s_fl**2-s_fl+0.125, s_fl)\n", + "Ns=(120*f)/P\n", + "Nfl=Ns*(1-b[0])\n", + "Nm=Ns*(1-a[0])\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The full-load speed is %.2f rpm.\" %(Nfl)\n", + "print \"(b)The speed at maximum torque is %.2f rpm.\" %(Nm)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The full-load speed is 1280.33 rpm.\n", + "(b)The speed at maximum torque is 750.00 rpm.\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.16,Page number: 501" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the rotor copper loss and the gross torque for an induction motor.\"\"\"\n", + "\n", + "from math import pi\n", + "\n", + "#Variable Declaration:\n", + "s=0.04 #Full-load slip\n", + "P=4.0 #Number of poles\n", + "f=50.0 #Frequency of the induction motor(in Hertz)\n", + "Po=18.65e03 #Power output(in Watts)\n", + "\n", + "\n", + "#Calculations:\n", + "Pm=0.025*Po\n", + "Pd=Pm+Po\n", + "P_R=Pd*(s/(1-s))\n", + "Pg=P_R/s\n", + "Ns=(120*f)/P\n", + "N=Ns*(1-s)\n", + "sh_tor=Po/(2*pi*(N/60.0))\n", + "gross_tor=Pd/(2*pi*(N/60.0))\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The rotor copper loss is %.2f W.\" %(P_R)\n", + "print \"(b)The rotor input is %.2f W.\" %(Pg)\n", + "print \"(c)The output(shaft) torque is %.2f Nm.\" %(sh_tor)\n", + "print \"(d)The gross torque is %.2f Nm.\" %(gross_tor)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The rotor copper loss is 796.51 W.\n", + "(b)The rotor input is 19912.76 W.\n", + "(c)The output(shaft) torque is 123.68 Nm.\n", + "(d)The gross torque is 126.77 Nm.\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.17,Page number: 501" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the rotor current and the rotor power factor for an induction motor.\"\"\"\n", + "\n", + "from math import sqrt,pow,cos,atan\n", + "\n", + "#Variable Declaration:\n", + "P=4.0 #Number of poles in the induction motor\n", + "E1=1100.0 #Line voltage(in Volts) \n", + "f=50.0 #Operating frequency of the motor(in Hertz)\n", + "K=1.0/3.8 #Transformation ratio\n", + "R2=0.012 #Rotor resistance per phase(in Ohms)\n", + "X20=0.25 #Rotor stanstill reactance per phase(in Ohms) \n", + "N=1440.0 #Full-load speed of the motor(in rpm)\n", + "\n", + "\n", + "#Calculations:\n", + "Ns=(120.0*f)/P\n", + "s=(Ns-N)/Ns\n", + "E20=K*E1\n", + "Z20=sqrt((R2*R2)+(X20*X20))\n", + "Z2=sqrt((R2*R2)+(s*X20*s*X20))\n", + "I20=E20/Z20\n", + "pf_20=cos(atan(X20/R2))\n", + "I2=(s*E20)/Z2\n", + "pf=R2/Z2\n", + "I1=100.0/sqrt(3.0)\n", + "I_20=I1/K\n", + "Z2_rot=E20/I_20\n", + "r=sqrt((Z2_rot*Z2_rot)-(X20*X20))-R2\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The rotor current at starting with slip-rings shorted is %.2f A.\" %(I20)\n", + "print \"(b)The rotor power factor at starting with slip-rings shorted is %.5f,lagging.\" %(pf_20)\n", + "print \"(c)The rotor current while running at full load with slip-rings shorted is %.3f A.\" %(I2)\n", + "print \"(d)The rotor power factor while running at full-load with slip-rings shorted is %.5f,lagging.\" %(pf)\n", + "print \"(e)The external rotor resistance is %.4f Ohms.\" %(r)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The rotor current at starting with slip-rings shorted is 1156.56 A.\n", + "(b)The rotor power factor at starting with slip-rings shorted is 0.04794,lagging.\n", + "(c)The rotor current while running at full load with slip-rings shorted is 741.266 A.\n", + "(d)The rotor power factor while running at full-load with slip-rings shorted is 0.76822,lagging.\n", + "(e)The external rotor resistance is 1.2835 Ohms.\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter16.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter16.ipynb new file mode 100755 index 00000000..7078e036 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter16.ipynb @@ -0,0 +1,1654 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16: DC MACHINES "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.1,Page number: 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the terminal voltage,output current and total power generated by a dc generator.\"\"\" \n",
+ "\n",
+ "#Variable Declaration:\n",
+ "e=2.1 #Average emf generated in each conductor(in Volts) \n",
+ "full_load_I=200.0 #Full-load current(in Amperes) \n",
+ "Z=480.0 #Number of conductors in armature\n",
+ "P=8.0 #Number of poles\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "A_1=P\n",
+ "E_1=e*(Z/A_1)\n",
+ "I_L_1=full_load_I*A_1\n",
+ "Po_1=E_1*I_L_1\n",
+ "A_2=2\n",
+ "E_2=e*(Z/A_2)\n",
+ "I_L_2=full_load_I*A_2\n",
+ "Po_2=E_2*I_L_2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print(\"(a) When the armature is lap wound \\n \")\n",
+ "print \"The terminal voltage on no load is %.2f V\" %(E_1)\n",
+ "print \"The output current on full load is %.2f A\" %(I_L_1) \n",
+ "print \"The total power generated on full load is %e W\" %(Po_1)\n",
+ "print(\"\\n(b)When the armature is wave wound \\n \")\n",
+ "print \"The terminal voltage on no load is %.2f V\" %(E_2)\n",
+ "print \"The output current on full load is %.2f A\" %(I_L_2) \n",
+ "print \"The total power generated on full load is %e W\" %(Po_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) When the armature is lap wound \n",
+ " \n",
+ "The terminal voltage on no load is 126.00 V\n",
+ "The output current on full load is 1600.00 A\n",
+ "The total power generated on full load is 2.016000e+05 W\n",
+ "\n",
+ "(b)When the armature is wave wound \n",
+ " \n",
+ "The terminal voltage on no load is 504.00 V\n",
+ "The output current on full load is 400.00 A\n",
+ "The total power generated on full load is 2.016000e+05 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.2,Page number: 520"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the emf induced in the armature of a dc generator. \"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "slots=65.0 #Number of slots\n",
+ "cond_per_slot=12.0 #Number of conductors per slot\n",
+ "A=4.0 #Number of parallel paths\n",
+ "P=4.0 #Number of poles\n",
+ "flux=0.02 #Flux per pole(in Webers) \n",
+ "N=1200.0 #Speed of operation of the dc generator(in rpm)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z=slots*cond_per_slot\n",
+ "E=(flux*Z*N*P)/(60*A)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The emf induced in the armature is %.2f V\" %(E)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The emf induced in the armature is 312.00 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.3,Page number: 520"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\" Finding the induced emf in a dc machine.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N1=500.0 #Initial speed of operation of dc machine(in rpm) \n",
+ "E1=180.0 #Induced emf at 500rpm(in Volts)\n",
+ "N2=600.0 #New speed of operation(in rpm)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "E2=(N2/N1)*E1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The induced emf when the machine runs at 600 rpm is %.2f V\" %(E2) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The induced emf when the machine runs at 600 rpm is 216.00 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.4,Page number: 520"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"\"Finding the percentage increase in the field flux in a dc generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N1=750.0 #Initial speed of operation of dc machine(in rpm)\n",
+ "E1=220.0 #Induced emf at 750 rpm(in Volts) \n",
+ "E2_a=250.0 #New emf(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations and Result:\n",
+ "N2_a=(E2_a/E1)*N1\n",
+ "E2_b=250.0\n",
+ "N2_b=600.0\n",
+ "flux_ratio=(E2_b/E1)*(N1/N2_b)\n",
+ " \n",
+ " \n",
+ "#Result:\n",
+ "print \"(a)The speed at which the induced emf is 250V(assuming the flux to be constant) is %d rpm \" %(round(N2_a,0))\n",
+ "print \"(b)The required percentage increase in the field flux so that the induced emf is 250V,while the speed is only 600rpm is %d percent\" %(round(((flux_ratio-1)*100),0))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The speed at which the induced emf is 250V(assuming the flux to be constant) is 852 rpm \n",
+ "(b)The required percentage increase in the field flux so that the induced emf is 250V,while the speed is only 600rpm is 42 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.5,Page number: 525 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\" Finding the emf induced in the armature.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=440.0 #Load voltage(in Volts) \n",
+ "Rsh=110.0 #Resistance of shunt field coil(in Ohms)\n",
+ "Ra=0.02 #Armature resistance(in Ohms)\n",
+ "I_L=496.0 #Load current(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ish=V/Rsh\n",
+ "Ia=I_L+Ish\n",
+ "Eg=V+(Ia*Ra)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The emf induced in the armature is %.2f V\" %(Eg)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The emf induced in the armature is 450.00 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.6,Page number: 525 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\" Finding the total armature current and the generated emf.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "no_of_lamps=100.0 #Number of lamps\n",
+ "P=60.0 #Power rating of each lamp(in Watts) \n",
+ "V=200 #Voltage rating of each lamp(in Volts)\n",
+ "Ra=0.2 #Armature resistance(in Ohms)\n",
+ "Rsh=50 #Shunt field resistance(in Ohms)\n",
+ "Poles=4.0 #Number of poles\n",
+ "no_of_brushes=2.0 #Number of brushes\n",
+ "brush_drop_per_brush=1.0 #Brush drop at each brush(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=P/V\n",
+ "I_L=no_of_lamps*I1\n",
+ "Ish=V/Rsh\n",
+ "Ia=Ish+I_L\n",
+ "A=Poles\n",
+ "Ic=Ia/A\n",
+ "brush_drop=no_of_brushes*brush_drop_per_brush\n",
+ "Eg=V+(Ia*Ra)+brush_drop\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The total armature current is %.2f A\" %(Ia)\n",
+ "print \"The current per path is %.2f A\" %(Ic)\n",
+ "print \"The generated emf is %.2f V\" %(Eg)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total armature current is 34.00 A\n",
+ "The current per path is 8.50 A\n",
+ "The generated emf is 208.80 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.7,Page number: 525"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the emf generated in a compound-wound dc generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=250.0 #Load voltage(in Volts)\n",
+ "Rsh=130.0 #Shunt field resistance(in Ohms)\n",
+ "Ra=0.1 #Armature resistance(in Ohms)\n",
+ "Rse=0.1 #Series field resistance(in Ohms)\n",
+ "I_L=100.0 #Load current(in Amperes)\n",
+ "no_of_brushes=2 #Number of brushes \n",
+ "brush_drop_per_brush=1.0 #Brush drop at each brush(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ise=I_L\n",
+ "Vse=Ise*Rse\n",
+ "Vsh=V+Vse\n",
+ "Ish=Vsh/Rsh\n",
+ "Ia=I_L+Ish\n",
+ "brush_drop=no_of_brushes*brush_drop_per_brush\n",
+ "Eg=V+Vse+(Ia*Ra)+brush_drop\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The emf generated is %.2f V.\" %(Eg)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The emf generated is 272.20 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.8,Page number: 528 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the emf generated,the copper losses,and efficiency of a shunt generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Po=30e03 #Full-load output power(in Watts)\n",
+ "V=200.0 #Terminal voltage(in Volts)\n",
+ "Ra=0.05 #Armature resistance(in Ohms)\n",
+ "Rsh=50.0 #Shunt field resistance(in Ohms)\n",
+ "loss=1000.0 #Friction losses(in Watts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_L=Po/V\n",
+ "Ish=V/Rsh\n",
+ "Ia=Ish+I_L\n",
+ "Eg=V+(Ia*Ra)\n",
+ "copper_loss=(pow(Ish,2)*Rsh)+(pow(Ia,2)*Ra)\n",
+ "effi=Po/(Po+copper_loss+loss)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The emf generated is %.2f V\" %(Eg)\n",
+ "print \"(b)The copper loss is %.2f W\" %(copper_loss)\n",
+ "print \"(c)The efficiency is %.2f percent\" %(effi*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The emf generated is 207.70 V\n",
+ "(b)The copper loss is 1985.80 W\n",
+ "(c)The efficiency is 90.95 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.9,Page number:529 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding armature resistance and the load-current corresponding to maximum efficiency of dc shunt generator.\"\"\"\n",
+ "\n",
+ "from math import sqrt,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=210.0 #Full-load voltage(in Volts)\n",
+ "I_L=195.0 #Full-load current(in Amperes)\n",
+ "Rsh=52.5 #Shunt field resistance(in Ohms)\n",
+ "effi=0.90 #Full-load efficiency\n",
+ "stray_loss=710.0 #Stray losses(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Po=V*I_L\n",
+ "Pin=Po/effi\n",
+ "total_loss=Pin-Po\n",
+ "Ish=V/Rsh\n",
+ "Ia=I_L+Ish\n",
+ "sh_copp_loss=pow(Ish,2)*Rsh\n",
+ "const_loss=sh_copp_loss+stray_loss\n",
+ "arma_copp_loss=total_loss-const_loss\n",
+ "Ra=arma_copp_loss/(pow(Ia,2))\n",
+ "Ia_max_effi=sqrt(const_loss/Ra)\n",
+ "I_L_max_effi=Ia_max_effi-Ish\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The armature resistance is %.5f ohm \" %(Ra)\n",
+ "print \"The load current corresponding to maximum efficiency is %.2f A\" %(I_L_max_effi)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The armature resistance is 0.07576 ohm \n",
+ "The load current corresponding to maximum efficiency is 139.04 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.10,Page number: 534 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the number of series turns required per pole for a level-compounded generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I_full_load=100.0 #Full-load current(in Amperes)\n",
+ "sh_turns=1500.0 #Number of turns in the shunt winding \n",
+ "Ish_no_load=4.0 #Shunt current at no-load(in Amperes) \n",
+ "Ish_full_load=6.0 #Shunt current at full-load(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "At_no_load=Ish_no_load*sh_turns\n",
+ "At_full_load=Ish_full_load*sh_turns\n",
+ "At_series=At_full_load-At_no_load\n",
+ "Nse=At_series/I_full_load\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The number of series turns required per pole is %d \" %(Nse)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of series turns required per pole is 30 \n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.11,Page number: 536"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the back emf generated in a dc shunt motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I_L=41.0 #Full-load current(in Amperes)\n",
+ "V=250.0 #Full-load voltage(in Volts) \n",
+ "Ra=0.1 #Armature resistance(in Ohms) \n",
+ "Rsh=250.0 #Shunt field resistance(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ish=V/Rsh\n",
+ "Ia=I_L-Ish\n",
+ "Eb=V-(Ia*Ra)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The back emf generated in the motor is %.2f V\" %(Eb)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The back emf generated in the motor is 246.00 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.12,Page number: 536 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the speed of a dc motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "A=2.0 #Number of parallel paths\n",
+ "P=4.0 #Number of poles \n",
+ "Z=888.0 #Number of conductors \n",
+ "flux=23e-03 #Flux per pole(in Webers) \n",
+ "Ia=50.0 #Armature current(in Amperes)\n",
+ "Ra=0.28 #Armature resistance(in Ohms) \n",
+ "V=440.0 #Rated voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Eb=V-(Ia*Ra)\n",
+ "N=(60*A*Eb)/(flux*Z*P)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The speed of the motor is %d rpm\" %(round(N,0)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed of the motor is 626 rpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.13,Page number: 536"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the speed of a dc motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V1=460.0 #Initial supply voltage(in Volts)\n",
+ "N1=900.0 #Speed of motor at 460-V(in rpm)\n",
+ "V2=200.0 #Final supply voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "kflux=V1/N1\n",
+ "N2=V2/(0.7*kflux)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "ans_N2=\"The approximate speed of the motor when the motor is connected across a 200V supply is %d rpm\" %(round(N2,0))\n",
+ "print(ans_N2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The approximate speed of the motor when the motor is connected across a 200V supply is 559 rpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.14,Page number: 537"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the speed and the gross torque developed by the armature of a dc motor.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=480.0 #Rated voltage(in Volts) \n",
+ "Ia=110.0 #Armature current at rated voltage(in Amperes)\n",
+ "Ra=0.2 #Armature resistance(in Ohms) \n",
+ "flux=50e-03 #Flux per pole(in Webers) \n",
+ "A=6.0 #Number of parallel paths\n",
+ "P=6.0 #Number of poles \n",
+ "Z=864.0 #Number of conductors\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Eb=V-(Ia*Ra)\n",
+ "N=(60*A*Eb)/(flux*Z*P)\n",
+ "torque=((flux*Z)/(2*pi))*(P/A)*Ia\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The speed of the motor is %d rpm \" %(round(N,0))\n",
+ "print \"(b)The gross torque developed by the armature is %.2f Nm\" %(torque)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The speed of the motor is 636 rpm \n",
+ "(b)The gross torque developed by the armature is 756.30 Nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.15,Page number: 538 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the power generated in the armature winding of a dc generator.\"\"\"\n",
+ "\n",
+ "from math import pi \n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N=900.0 #Operating speed of generator(in rpm)\n",
+ "torque=2e03 #Torque(in N-metre) \n",
+ "P_losses=8e03 #Power losses(in Watts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Pin=(2*pi*torque*N)/60.0\n",
+ "Pd=Pin-P_losses\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The power generated in the armature winding is %e W\" %(Pd)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power generated in the armature winding is 1.804956e+05 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.16,Page number: 540"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the speed of a series motor when the current changes.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=230.0 #Supply voltage(in Volts)\n",
+ "Ra=0.12 #Armature resistance(in Ohms) \n",
+ "Rse=0.03 #Series field resistance(in Ohms)\n",
+ "Ia1=110.0 #Current at 230 V(in Amperes)\n",
+ "flux1=24e-03 #Flux per pole at 110 A(in Webers)\n",
+ "N1=600.0 #Speed at 230 V(in rpm) \n",
+ "Ia2=50.0 #Armature current(in Amperes) \n",
+ "flux2=16e-03 #Flux per pole at 50 A(in Webers) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Eb1=V-Ia1*(Ra+Rse)\n",
+ "k=Eb1/(N1*flux1)\n",
+ "Eb2=V-Ia2*(Ra+Rse)\n",
+ "N2=Eb2/(k*flux2)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The speed of the motor when the currenthas fallen to 50 A is %d rpm\" %(round(N2,0))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed of the motor when the currenthas fallen to 50 A is 938 rpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.17,Page number: 540"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current drawn by the machine.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=250.0 #Supply voltage(in Volts)\n",
+ "Ra=0.2 #Armature resistance(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Eb_1=0\n",
+ "Ia_1=(V-Eb_1)/Ra\n",
+ "Eb_2=200\n",
+ "Ia_2=(V-Eb_2)/Ra\n",
+ "Eb_3=250\n",
+ "Ia_3=(V-Eb_3)/Ra\n",
+ "Eb_4=-250\n",
+ "Ia_4=(V-Eb_4)/Ra\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)When the machine is at rest,\"\n",
+ "print \"The current drawn by the machine is %.2f A\" %(Ia_1)\n",
+ "print \"(b)When the machine is generating an emf of 200V and is connected to the supply with correct polarities,\"\n",
+ "print \"The current drawn by the machine is %.2f A\" %(Ia_2)\n",
+ "print \"(c)When the machine is generating an emf of 250V and is connected to the supply with correct polarities,\"\n",
+ "print \"The current drawn by the machine is %.2f A\" %(Ia_3)\n",
+ "print \"(d)When the machine is generating an emf of 250V and is connected to the supply with reversed polarities,\"\n",
+ "print \"The current drawn by the machine is %.2f A\" %(Ia_4) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)When the machine is at rest,\n",
+ "The current drawn by the machine is 1250.00 A\n",
+ "(b)When the machine is generating an emf of 200V and is connected to the supply with correct polarities,\n",
+ "The current drawn by the machine is 250.00 A\n",
+ "(c)When the machine is generating an emf of 250V and is connected to the supply with correct polarities,\n",
+ "The current drawn by the machine is 0.00 A\n",
+ "(d)When the machine is generating an emf of 250V and is connected to the supply with reversed polarities,\n",
+ "The current drawn by the machine is 2500.00 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.18,Page number: 541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the speed and the gross torque developed by the armature of a dc series motor.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=6.0 #Number of poles\n",
+ "A=6.0 #Number of parallel paths \n",
+ "Z=864.0 #Number of conductors \n",
+ "flux=50e-03 #Flux per pole(in Webers)\n",
+ "Ia=110.0 #Armature current(in Amperes)\n",
+ "V=480.0 #Load voltage(in Volts)\n",
+ "Ra=0.18 #Armature resistance(in Ohms) \n",
+ "Rse=0.02 #Series field resistance(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Eb=V-Ia*(Ra+Rse)\n",
+ "N=(60*A*Eb)/(flux*Z*P)\n",
+ "torque=(60*Eb*Ia)/(2*pi*N)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The speed of the motor is %d rpm\" %(round(N,0))\n",
+ "print \"(b)The gross torque developed by the armature is %.2f Nm \" %(torque) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The speed of the motor is 636 rpm\n",
+ "(b)The gross torque developed by the armature is 756.30 Nm \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.19,Page number: 541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the series resistance to reduce the speed of a shunt motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=220.0 #Rated voltage of the motor(in Volts)\n",
+ "Ia=22.0 #Armature current(in Amperes)\n",
+ "Ra=0.45 #Armature resistance(in Ohms)\n",
+ "N1=700.0 #Initial speed of motor(in rpm)\n",
+ "N2=450.0 #Final speed of motor(in rpm)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "E1=V-(Ia*Ra)\n",
+ "E2=(N2/N1)*E1\n",
+ "R=((V-E2)/Ia)-Ra\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resistance that should be placed in series with the armature to reduce the speed to 450 rpm is %.3f ohm \" %(R)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance that should be placed in series with the armature to reduce the speed to 450 rpm is 3.411 ohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.20,Page number: 541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the speed of a dc series motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=230.0 #Rated voltage of the dc series motor(in Volts) \n",
+ "Ra=0.2 #Armature resistance(in Ohms) \n",
+ "Rse=0.1 #Series field resistance(in Ohms) \n",
+ "Ia1=40.0 #Line current at rated voltage(in Amperes)\n",
+ "N1=1000.0 #Speed of motor at rated voltage(in rpm)\n",
+ "Ia2=20.0 #Line current at 230 V(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Eb1=V-Ia1*(Ra+Rse)\n",
+ "Eb2=V-Ia2*(Ra+Rse)\n",
+ "\"\"\" Eb=k*flux*N \"\"\"\n",
+ "N2=(Eb2*N1)/(Eb1*0.6)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The speed of the motor for a line current of 20A at 230V is %d rpm\" %(round(N2,0)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed of the motor for a line current of 20A at 230V is 1713 rpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.21,Page number: 543 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the terminal voltage of a dc shunt generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=4 #Number of poles\n",
+ "turns=260 #Number of turns in the armature winding\n",
+ "R=0.006 #Resistance of each turn of armature(in Ohms)\n",
+ "flux=0.08 #Useful flux per pole(in Webers)\n",
+ "I_L=55 #Load current(in Amperes)\n",
+ "N=1000 #Speed of the generator(in rpm)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Z=2*turns\n",
+ "A=P\n",
+ "Eg=(flux*Z*N*P)/(60.0*A)\n",
+ "Rw=turns*R\n",
+ "R1=Rw/4.0\n",
+ "Ra=R1/4\n",
+ "V=Eg-(I_L*Ra)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The terminal voltage of the generator when it is running at 1000 rpm and supplying load current of 55 A is %.3f V.\" %(V)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The terminal voltage of the generator when it is running at 1000 rpm and supplying load current of 55 A is 687.971 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.22,Page number: 544"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the armature current,the emf induced and the flux per pole for a dc shunt generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=8.0 #Number of poles\n",
+ "A=2.0 #Number of parallel paths\n",
+ "Z=778 #Number of conductors\n",
+ "V=250.0 #Load voltage(in Volts)\n",
+ "R_L=12.5 #Load resistance(in Ohms)\n",
+ "Ra=0.24 #Armature resistance(in Ohms)\n",
+ "Rsh=250.0 #Shunt field resistance(in Ohms)\n",
+ "N=500 #Speed of the dc shunt generator(in rpm) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_L=V/R_L\n",
+ "Ish=V/Rsh\n",
+ "Ia=I_L+Ish\n",
+ "Eg=V+(Ia*Ra)\n",
+ "flux=(60.0*A*Eg)/(Z*N*P)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The armature current is %.2f A.\" %(Ia)\n",
+ "print \"The emf induced is %.2f V.\" %(Eg)\n",
+ "print \"The flux per pole is %e Wb.\" %(flux)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The armature current is 21.00 A.\n",
+ "The emf induced is 255.04 V.\n",
+ "The flux per pole is 9.834447e-03 Wb.\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.23,Page number: 544"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the percentage reduction in speed of dynamo.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Po_1=500e03 #Initial power output(in Watts)\n",
+ "Po_2=250e03 #Final power output(in Watts)\n",
+ "V=500.0 #Constant excitation voltage(in Volts)\n",
+ "Ra=0.015 #Resistance between the terminals of dynamo(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ia_1=Po_1/V\n",
+ "E1=V+(Ia_1*Ra)\n",
+ "Ia_2=Po_2/V\n",
+ "E2=V+(Ia_2*Ra)\n",
+ "\"\"\" Since excitation emf remains constant in the two cases,we have \n",
+ "\n",
+ " E=(flux*Z*N*P)/(60*A) where E=emf generated;Z=number of conductors;N=speed of motor(in rpm);P=number of poles;A=number of parallel paths;\n",
+ " flux=useful flux per pole(in Wb).\n",
+ " \n",
+ " N=KE, where K is a constant.\n",
+ " \n",
+ " Hence,fractional reduction in speed is given as,\n",
+ " \n",
+ " (N1-N2)/N1=((K*(E1-E2))/(K*E1)). \"\"\"\n",
+ "\n",
+ "fract=((E1-E2)/E1)*100\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The percentage reduction in speed of the dynamo is %.3f percent.\" %(fract) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage reduction in speed of the dynamo is 1.456 percent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.24,Page number: 545 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage between the far end of the feeder and the bus-bar of a dc series generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Rt=0.3 #Resistance of transmission line(in Ohms) \n",
+ "I_L_1=160.0 #Load current in first case(in Amperes) \n",
+ "I_L_2=50.0 #Load current in second case(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vt_1=I_L_1*Rt\n",
+ "Vb_1=(50.0/200.0)*I_L_1\n",
+ "Vd_1=Vt_1-Vb_1\n",
+ "Vt_2=I_L_2*Rt\n",
+ "Vb_2=(50.0/200.0)*I_L_2\n",
+ "Vd_2=Vt_2-Vb_2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The voltage between far end of the feeder and the bus-bar at a cusrrent of 160 A is %.2f V.\" %(Vd_1)\n",
+ "print \"(b)The voltage between far end of the feeder and the bus-bar at a cusrrent of 50 A is %.2f V.\" %(Vd_2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The voltage between far end of the feeder and the bus-bar at a cusrrent of 160 A is 8.00 V.\n",
+ "(b)The voltage between far end of the feeder and the bus-bar at a cusrrent of 50 A is 2.50 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.25,Page number: 545"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\" Finding the emf generated and the armature current in a dc long-shunt compound generator. \"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I_L=50 #Load current(in Amperes)\n",
+ "V=500 #Terminal voltage(in Volts)\n",
+ "Ra=0.05 #Armature resistance(in Ohms)\n",
+ "Rse=0.03 #Series field resistance(in Ohms)\n",
+ "Rsh=250 #Shunt field resistance(in Ohms)\n",
+ "brush_drop=1.0 #Brush contact drop(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ish=V/Rsh\n",
+ "Ia=Ish+I_L\n",
+ "Eg=V+(Ia*(Ra+Rse))+brush_drop\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The armature current is %.2f A.\" %(Ia)\n",
+ "print \"The emf generated is %.2f V\" %(Eg)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The armature current is 52.00 A.\n",
+ "The emf generated is 505.16 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.26,Page number: 545"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\" Finding the voltage and the power generated by a dc generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "P=8 #Number of poles\n",
+ "Z=500 #Number of conductors on the armature\n",
+ "flux =0.02 #Magnetic flux per pole(in Webers)\n",
+ "N=1800 #Speed of the generator(in rpm)\n",
+ "I=5.0 #Allowable current per path(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "A_1=2\n",
+ "Eg_1=(flux*Z*N*P)/(60*A_1)\n",
+ "A_2=P\n",
+ "Eg_2=(flux*Z*N*P)/(60*A_2)\n",
+ "Ia_1=A_1*I\n",
+ "Pd_1=Eg_1*Ia_1\n",
+ "Ia_2=A_2*I\n",
+ "Pd_2=Eg_2*Ia_2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"When the armature is wave wound:\"\n",
+ "print \"(a)The generated voltage is %.2f V.\" %(Eg_1)\n",
+ "print \"(b)The kW generated by the machine is %.2f kW.\" %(Pd_1/1000.0)\n",
+ "print \"\\nWhen the armature is lap wound:\"\n",
+ "print \"(a)The generated voltage is %.2f V.\" %(Eg_2)\n",
+ "print \"(b)The kW generated by the machine is %.2f kW.\" %(Pd_2/1000.0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When the armature is wave wound:\n",
+ "(a)The generated voltage is 1200.00 V.\n",
+ "(b)The kW generated by the machine is 12.00 kW.\n",
+ "\n",
+ "When the armature is lap wound:\n",
+ "(a)The generated voltage is 300.00 V.\n",
+ "(b)The kW generated by the machine is 12.00 kW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.27,Page number: 546"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the emf generated and the copper losses in a dc shunt generator.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=250.0 #Terminal voltage(in Volts)\n",
+ "I_L=195 #Load current(in Amperes)\n",
+ "Ra=0.02 #Armature resistance(in Ohms)\n",
+ "Rsh=50.0 #Shunt-field resistance(in Ohms)\n",
+ "loss=950.0 #Iron and frictional losses(in Watts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ish=V/Rsh\n",
+ "Ia=I_L+Ish\n",
+ "Eg=V+(Ia*Ra)\n",
+ "copp=(Ia*Ia*Ra)+(V*Ish)\n",
+ "Po=V*I_L\n",
+ "tot_loss=copp+loss\n",
+ "Pin=Po+tot_loss\n",
+ "Pe=Pin-loss\n",
+ "mech_effi=Pe/Pin\n",
+ "ele_effi=Po/Pe\n",
+ "comm_effi=Po/Pin\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The emf generated is %.2f V.\" %(Eg)\n",
+ "print \"(b)The copper losses is %.2f W.\" %(copp)\n",
+ "print \"(c)The output of the prime mover is %.3f kW.\" %(Pin/1000.0)\n",
+ "print \"(d)The commercial efficiency is %.2f.\\n The mechanical efficiency is %.2f.\" %((comm_effi*100),(mech_effi*100))\n",
+ "print \" The electrical efficiency is %.2f.\" %(ele_effi*100) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The emf generated is 254.00 V.\n",
+ "(b)The copper losses is 2050.00 W.\n",
+ "(c)The output of the prime mover is 51.750 kW.\n",
+ "(d)The commercial efficiency is 94.20.\n",
+ " The mechanical efficiency is 98.16.\n",
+ " The electrical efficiency is 95.96.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.28,Page number: 547"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the back emf generated by a dc shunt motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=250.0 #Terminal Voltage(in Volts)\n",
+ "I_L1=2.0 #No-load current(in Amperes)\n",
+ "N1=1000.0 #No-load speed(in rpm)\n",
+ "Ra=0.2 #Armature resistance(in Ohms)\n",
+ "Rsh=250.0 #Field resistance(in Ohms)\n",
+ "I_L2=51.0 #Current after loading(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ish=V/Rsh\n",
+ "Ia1=I_L1-Ish\n",
+ "E1=V-(Ia1*Ra)\n",
+ "Ia2=I_L2-Ish\n",
+ "E2=V-(Ia2*Ra)\n",
+ "\"\"\"As the motor is shunt-wound,the flux remains constant.The emf generated is directly proportional to the speed.\"\"\"\n",
+ "N2=(E2/E1)*N1\n",
+ "speed_drop=(N1-N2)/N1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The back emf generated at no-load is %.3f V.\" %(E1)\n",
+ "print \"(b)On loading,\\n The back emf generated is %.2f V.\\n The speed of the motor is %d rpm.\" %(E2,round(N2,0))\n",
+ "print \" The percentage speed drop is %.3f percent.\" %(speed_drop*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The back emf generated at no-load is 249.800 V.\n",
+ "(b)On loading,\n",
+ " The back emf generated is 240.00 V.\n",
+ " The speed of the motor is 961 rpm.\n",
+ " The percentage speed drop is 3.923 percent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.29,Page number: 547"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the value of starting resistance for a shunt motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Po=14920.0 #Output power(in Watts)\n",
+ "V=240.0 #Supply voltage(in Volts)\n",
+ "Ra=0.25 #Armature resistance(in Ohms)\n",
+ "effi=0.86 #Efficiency at full-load\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Pin=Po/effi\n",
+ "I_L=Pin/V\n",
+ "Ist=1.5*I_L\n",
+ "Rt=V/Ist\n",
+ "Rst=Rt-Ra\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The starting resistance for the shunt motor is %.3f Ohms.\" %(Rst)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The starting resistance for the shunt motor is 1.963 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.30,Page number: 548"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the speed and efficiency of a dc shunt motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I_L1=4.0 #No-load current(in Amperes)\n",
+ "N1=1000 #No-load speed(in rpm)\n",
+ "V=500.0 #Voltage rating of the dc shunt motor(in Volts)\n",
+ "Ra=0.2 #Armature resistance(in Ohms)\n",
+ "Ish=1.0 #Field current(in Amperes)\n",
+ "I_L2=100.0 #Full-load current(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ia1=I_L1-Ish\n",
+ "E1=V-(Ia1*Ra)\n",
+ "Ia2=I_L2-Ish\n",
+ "E2=V-(Ia2*Ra)\n",
+ "\"\"\" For a shunt motor,the flux remains constant and hence E is directly proportional to speed of the motor(N).\n",
+ " \n",
+ " E=kN where k is a constant. \"\"\"\n",
+ "N2=(E2/E1)*N1\n",
+ "\"\"\"At no-load,the power taken by the motor mainly meets the constant losses(iron and frictional losses).\"\"\"\n",
+ "Pc=V*I_L1\n",
+ "\"\"\"On loading,the copper loss in shunt field winding is negligible compared to the copper loss in armature winding.\"\"\"\n",
+ "Pv=Ia2*Ia2*Ra\n",
+ "Pin=V*I_L2\n",
+ "effi=(Pin-(Pv+Pc))/Pin\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The speed of the dc shunt motor on loading is %d rpm.\" %(round(N2,0))\n",
+ "print \"The efficiency of the motor is %.2f percent.\" %(effi*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed of the dc shunt motor on loading is 962 rpm.\n",
+ "The efficiency of the motor is 92.08 percent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.31,Page number: 548"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the speed of a dc generator running as a shunt motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Ra=0.02 #Armature resistance(in Ohms)\n",
+ "Rsh=50.0 #Shunt-field resistance(in Ohms)\n",
+ "V=250.0 #Terminal voltage(in Volts)\n",
+ "Po=50e03 #Output power(in Watts)\n",
+ "N1=500.0 #Speed of the dc generator(in rpm)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ish=V/Rsh\n",
+ "\"\"\" When working as a generator,the machine supplies a load of 50 kW at 250 V. \"\"\"\n",
+ "I_L=Po/V\n",
+ "Ia1=I_L+Ish\n",
+ "E1=V+(Ia1*Ra)\n",
+ "\"\"\"When working as a motor,the machine takes a power of 50 kW at 250 V. \"\"\"\n",
+ "Ia2=I_L-Ish\n",
+ "E2=V-(Ia2*Ra)\n",
+ "N2=(E2/E1)*N1\n",
+ "\"\"\" NOTE: The field current and the flux per pole is same in both cases.\"\"\"\n",
+ "\n",
+ "#Result:\n",
+ "print \"The speed of the machine running as a shunt motor is %d rpm.\" %(round(N2,0)) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed of the machine running as a shunt motor is 484 rpm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.32,Page number: 548"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the applied voltage and the current to run the motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Ra=0.6 #Resistance of the armature(in Ohms)\n",
+ "Rse=0.4 #Series field resistance(in Ohms)\n",
+ "Ia1=20.0 #Initial armature current(in Amperes)\n",
+ "V1=400.0 #Initial terminal voltage(in Volts)\n",
+ "N1=250.0 #Initial speed of the motor(in rpm)\n",
+ "N2=350.0 #Final speed of the motor(in rpm)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" In a series motor,torque is directly proprtional to the square of the armature current(Ia).\n",
+ " \n",
+ " Given: Torque is directly proprtional to the square of the speed(N).\n",
+ " \n",
+ " Therefore, Ia is directly proportional to N. Ia=kN where k is a constant. \"\"\"\n",
+ "Ia2=(N2/N1)*Ia1\n",
+ "E1=V1-(Ia1*(Ra+Rse))\n",
+ "\"\"\"In a series motor,as the flux is directly proportional to Ia,the back emf is proportional to (Ia*N). \"\"\"\n",
+ "E2=E1*((Ia2*N2)/(Ia1*N1))\n",
+ "V2=E2+(Ia2*(Ra+Rse))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The applied voltage is %.2f V and the current is %.2f A to run the motor at 350 rpm.\" %(V2,Ia2) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The applied voltage is 772.80 V and the current is 28.00 A to run the motor at 350 rpm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter17.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter17.ipynb new file mode 100755 index 00000000..e240ccf5 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter17.ipynb @@ -0,0 +1,332 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17: FRACTIONAL HORSE POWER MOTORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.1,Page number: 570\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the slip and efficiency of induction motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=50 #Frequency rating of the induction motor(in Hertz) \n",
+ "P=4 #Number of poles in the induction motor \n",
+ "N=1410 #Speed of the motor(in rpm)\n",
+ "Po=375 #Output Power(in Watts)\n",
+ "V=230 #Voltage rating of the induction motor(in Volts) \n",
+ "I=2.9 #Input current(in Amperes)\n",
+ "pf=0.71 #Power factor(lagging) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ns=(120.0*f)/P\n",
+ "slip=(Ns-N)/Ns\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"Slip is %.2f percent.\" %(slip*100)\n",
+ "Pin=V*I*pf\n",
+ "efficiency=Po/Pin\n",
+ "print \"The efficiency is %.2f percent.\" %(efficiency*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Slip is 6.00 percent.\n",
+ "The efficiency is 79.19 percent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.2,Page number: 570\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\n",
+ "\"\"\"Finding the currents and the power factor in the induction motor.\"\"\"\n",
+ "\n",
+ "from cmath import phase,rect,polar\n",
+ "from math import radians,degrees,cos\n",
+ "\n",
+ "#Variable Declartion:\n",
+ "V=rect(230,0) #Voltage rating of the split-phase induction motor(in Volts) \n",
+ "Z_M=5+ 12*1j #Impedance of the main winding(in Ohms)\n",
+ "Z_A=12+ 5*1j #Start-winding impedance(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "mod_Z_M=abs(Z_M)\n",
+ "mod_Z_A=abs(Z_A)\n",
+ "phi_M=phase(Z_M)\n",
+ "phi_A=phase(Z_A)\n",
+ "I_M=V/Z_M\n",
+ "mod_I_M=abs(I_M)\n",
+ "phi_I_M=degrees(phase(I_M))\n",
+ "I_A=V/Z_A\n",
+ "mod_I_A=abs(I_A)\n",
+ "phi_I_A=degrees(phase(I_A))\n",
+ "I_L=I_M+I_A\n",
+ "mod_I_L=abs(I_L)\n",
+ "phi_I_L=degrees(phase(I_L))\n",
+ "phi=phi_I_A-phi_I_M\n",
+ "pf=cos(radians(phi_I_L))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current in the main winding is %.2f A at a phase angle of %.2f degrees.\" %(mod_I_M,phi_I_M)\n",
+ "print \"(b)The current in the starting winding is %.2f A at a phase angle of %.2f degrees.\" %(mod_I_A,phi_I_A)\n",
+ "print \"(c)The line current is %.2f A at a phase angle of %.2f degrees.\" %(mod_I_L,phi_I_L)\n",
+ "print \"(d)The phase displacement between the two winding currents is %.2f degrees.\" %(phi)\n",
+ "print \"(e)The power factor is %.4f lagging.\" %(pf) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current in the main winding is 17.69 A at a phase angle of -67.38 degrees.\n",
+ "(b)The current in the starting winding is 17.69 A at a phase angle of -22.62 degrees.\n",
+ "(c)The line current is 32.72 A at a phase angle of -45.00 degrees.\n",
+ "(d)The phase displacement between the two winding currents is 44.76 degrees.\n",
+ "(e)The power factor is 0.7071 lagging.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.3,Page number: 571\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the capacitance in series with the auxiliary winding to maximize starting torque.\"\"\"\n",
+ "\n",
+ "from math import radians,degrees,atan,pi,tan\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "X_M=20 #Inductive reactance of the main winding(in Ohm)\n",
+ "R_M=2 #Resistance of the main winding(in Ohm)\n",
+ "X_A=5 #Inductive reactance of the auxiliary winding(in Ohm)\n",
+ "R_A=25 #Resistance of the auxiliary winding(in Ohm)\n",
+ "f=50 #Frequency rating of the split-phase induction motor(in Hertz) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "angle_M=atan(X_M/R_M)\n",
+ "angle_A=degrees(angle_M)-90\n",
+ "Xc=X_A-(R_A*tan(radians(angle_A)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "C=1/(2*pi*f*Xc)\n",
+ "print \"The value of capacitance connected in series with the auxiliary winding to obtain maximum starting torque is %e F.\" %(C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of capacitance connected in series with the auxiliary winding to obtain maximum starting torque is 4.244132e-04 F.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.4,Page number: 576\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the resolution and shaft speed of a stepper motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "beta=2.5 #Step-angle of a stepper motor(in degrees)\n",
+ "step_freq=3600 #Stepping frequency(in pps)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "res=360/beta\n",
+ "number_steps=res*25\n",
+ "shaft_speed=(beta*step_freq)/360\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The resolution is %d steps per revolution.\" %(res)\n",
+ "print \"(b)The number of steps required for the shaft to make 25 revolutions=%d.\" %(number_steps)\n",
+ "print \"(c)The shaft speed is %.2f rps.\" %(shaft_speed)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The resolution is 144 steps per revolution.\n",
+ "(b)The number of steps required for the shaft to make 25 revolutions=3600.\n",
+ "(c)The shaft speed is 25.00 rps.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.5,Page number:577\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the number of stator and rotor poles in a VR motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "m=3 #Number of phases\n",
+ "beta=15 #Step angle(in degrees)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Nr=360/(m*beta)\n",
+ "Ns1=(Nr*360)/(360-(beta*Nr))\n",
+ "Ns2=(Nr*360)/(360+(beta*Nr))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a) The number of rotor poles is %d.\" %(Nr)\n",
+ "print \"(b)\"\n",
+ "print \" Case 1: Ns>Nr\"\n",
+ "print \" The number of stator poles is %d. \\n\" %(Ns1)\n",
+ "print \" Case 2: Ns<Nr\"\n",
+ "print \" The number of stator poles is %d.\" %(Ns2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The number of rotor poles is 8.\n",
+ "(b)\n",
+ " Case 1: Ns>Nr\n",
+ " The number of stator poles is 12. \n",
+ "\n",
+ " Case 2: Ns<Nr\n",
+ " The number of stator poles is 6.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.6,Page number: 579\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the number of rotor and stator teeth in VR stepper motor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "m=4 #Number of stacks\n",
+ "beta=1.8 #Step angle(in degrees)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Nr=360/(m*beta)\n",
+ "Ns=Nr\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The number of rotor teeth is %d.\" %(Nr)\n",
+ "print \"The number of stator teeth is %d.\" %(Ns)\n",
+ "print \"\\nNOTE: In a multistack stepper motor the number of stator teeth is same as that of the rotor teeth.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of rotor teeth is 50.\n",
+ "The number of stator teeth is 50.\n",
+ "\n",
+ "NOTE: In a multistack stepper motor the number of stator teeth is same as that of the rotor teeth.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter18.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter18.ipynb new file mode 100755 index 00000000..99017984 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter18.ipynb @@ -0,0 +1,542 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18: ELECTRICAL MEASURING INSTRUMENTS\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.1,Page number: 598\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the deflecting torque in Newton-metres for a PMMC instrument.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I=15e-03 #Current flowing through the coil(in Amperes) \n",
+ "B=0.2 #Flux density in the air gap(in Tesla)\n",
+ "l=2e-02 #Length of the magnetic field(in m)\n",
+ "d=2.5e-02 #Mean width of the coil(in m) \n",
+ "r=d/2 #Radius of the coil(in cm) \n",
+ "n1=42 #Number of turns(lower limit) \n",
+ "n2=43 #Number of turns(upper limit)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "F1=I*B*l*n1\n",
+ "F2=I*B*l*n2\n",
+ "net_torque=(F1+F2)*r\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The deflecting torque is %e Nm.\" %(net_torque)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The deflecting torque is 6.375000e-05 Nm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.2,Page Number: 604\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the shunt resistance for measuring a maximum current of 10 mA.\"\"\" \n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Ifsd=10e-03 #Maximum current(in Amperes)\n",
+ "Im=100e-06 #Full-scale deflection current(in Amperes) \n",
+ "Rm=100 #Meter Resistance(in Ohms) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ish=Ifsd-Im\n",
+ "Rsh=(Im*Rm)/Ish\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The shunt resistance needed is %.6f Ohms.\" %(Rsh)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The shunt resistance needed is 1.010101 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.3,Page number: 605"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Designing an universal shunt for a multi-range ammeter.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Im=100e-06 #Full-scale deflection current(in Amperes)\n",
+ "Rm=100.0 #Internal resistance(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"For 1-mA range,the required shunt can be calculated as follows.\"\"\"\n",
+ "Ifsd=1e-03\n",
+ "Rsh=(Im*Rm)/(Ifsd-Im)\n",
+ "\n",
+ "Rm=900.0\n",
+ "R=100.0\n",
+ "\"\"\"(a)Range-switch at 1 mA:\"\"\"\n",
+ "Rm1=Rm\n",
+ "Ish1=(1e-03)-(0.1e-03)\n",
+ "Rsh1=(Rm1*Im)/(Ish1)\n",
+ "\n",
+ "\"\"\"(b)Range-switch at 10 mA:\"\"\"\n",
+ "\"\"\"Rm2=Rm+R1\"\"\"\n",
+ "Ish2=(10e-03)-(0.1e-03)\n",
+ "\"\"\"Rsh2=R2+R3+R4+R5=R-R1=100-R1;\"\"\"\n",
+ "\"\"\"Rsh2=(Rm2*Im)/Ish2;\"\"\"\n",
+ "R1=(9900.0-900.0)/100.0\n",
+ "\n",
+ "\"\"\"(c)Range-switch at 100 mA:\"\"\"\n",
+ "\"\"\"Rm3=Rm+R1+R2\"\"\"\n",
+ "Ish3=(100e-03)-(0.1e-03)\n",
+ "\"\"\"Rsh3=R3+R4+R5=R-R1-R2=100-90-R2=90-R2;\"\"\"\n",
+ "\"\"\"Rsh3=(Rm3*Im)/Ish3;\"\"\"\n",
+ "R2=(9990.0-990.0)/1000.0\n",
+ "\n",
+ "\"\"\"(d)Range-switch at 500 mA:\"\"\"\n",
+ "\"\"\"Rm4=Rm+R1+R2+R3\"\"\"\n",
+ "Ish3=(500e-03)-(0.1e-03)\n",
+ "\"\"\"Rsh4=R4+R5=R-R1-R2-R3=100-90-9-R3=1-R3;\"\"\"\n",
+ "\"\"\"Rsh4=(Rm4*Im)/Ish4;\"\"\"\n",
+ "R3=(4999.0-999.0)/5000.0\n",
+ "\n",
+ "\n",
+ "\"\"\"(e)Range-switch at 1 A:\"\"\"\n",
+ "\"\"\"Rm5=Rm+R1+R2+R3+R4\"\"\"\n",
+ "Ish3=(1000e-03)-(0.1e-03)\n",
+ "\"\"\"Rsh5=R5=R-R1-R2-R3-R4=100-90-9-0.8-R4=0.2-R4;\"\"\"\n",
+ "\"\"\"Rsh5=(Rm5*Im)/Ish5;\"\"\"\n",
+ "R4=(1999.8-999.8)/10000.0\n",
+ "R5=R-R1-R2-R3-R4\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resistor values are: \"\n",
+ "print \"R1=%.2f Ohms.\" %(R1)\n",
+ "print \"R2=%.2f Ohms.\" %(R2)\n",
+ "print \"R3=%.2f Ohms.\" %(R3)\n",
+ "print \"R4=%.2f Ohms.\" %(R4)\n",
+ "print \"R5=%.2f Ohms.\" %(R5)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistor values are: \n",
+ "R1=90.00 Ohms.\n",
+ "R2=9.00 Ohms.\n",
+ "R3=0.80 Ohms.\n",
+ "R4=0.10 Ohms.\n",
+ "R5=0.10 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.4,Page number: 609"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"To convert a d'Arsonval meter movement into a voltmeter.\"\"\" \n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Im=100e-06 #Current sensitivity(in Amperes)\n",
+ "Rm=100 #Resistance of the coil(in Ohms)\n",
+ "Vfsd=100 #Full-scale deflection of voltmeter(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Rs=(Vfsd/Im)-Rm\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"To convert the d'Arsonval meter movement into a voltmeter of range 100V, we connect a resistor Rs in series.\"\n",
+ "print \"Rs = %.3f kilo Ohms. \" %(Rs/1000)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "To convert the d'Arsonval meter movement into a voltmeter of range 100V, we connect a resistor Rs in series.\n",
+ "Rs = 999.900 kilo Ohms. \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.5,Page number: 609\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the multipiler resistance and the voltage mutiplyiing factor of a dc voltmeter.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Im=50e-06 #Full-scale deflection current(in Amperes) \n",
+ "Rm=1e03 #Meter Resistance(in Ohms) \n",
+ "Vfsd=50 #Full-scale deflection of voltmeter(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Rs=(Vfsd/Im)-Rm\n",
+ "n=Vfsd/(Im*Rm)\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The multiplier resistance needed is %.2f kilo Ohms.\" %(Rs/1000)\n",
+ "print \"(b)The voltage multiplying factor is %d.\" %(round(n,0))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The multiplier resistance needed is 999.00 kilo Ohms.\n",
+ "(b)The voltage multiplying factor is 1000.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.6,Page number: 612"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the reading and error in measurement of voltmeter.\"\"\"\n",
+ " \n",
+ "\"\"\" NOTE: All resistances expressed in kilo Ohms.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "range_A=50 #Range of voltmeter-A(in Volts)\n",
+ "range_B=50 #Range of voltmeter-B(in Volts)\n",
+ "sens_A=1000 #Sensitivity of voltmeter-A(in Ohm/Volts) \n",
+ "sens_B=20000 #Sensitivity of voltmeter-B(in Ohm/Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vt=150.0*(50.0/(100.0+50.0))\n",
+ "R_i1=(range_A*sens_A)/1000.0\n",
+ "Req=1/((1/R_i1)+(1.0/50))\n",
+ "V1=(150.0)*(Req/(100+Req))\n",
+ "R_i2=(range_B*sens_B)/1000.0\n",
+ "Req=1/((1/R_i2)+(1.0/50))\n",
+ "V2=(150.0)*(Req/(Req+100))\n",
+ "err_A=((Vt-V1)/Vt)*100.0\n",
+ "err_B=((Vt-V2)/Vt)*100.0\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The reading of voltmeter-A is %.2f V\\nThe reading of voltmeter-B is %.2f V.\" %(V1,V2)\n",
+ "print \"\\nThe error in the reading of voltmeter-A is %.2f percent.\" %(err_A)\n",
+ "print \"The error in the reading of voltmeter-B is %.2f percent.\" %(err_B)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reading of voltmeter-A is 30.00 V\n",
+ "The reading of voltmeter-B is 48.39 V.\n",
+ "\n",
+ "The error in the reading of voltmeter-A is 40.00 percent.\n",
+ "The error in the reading of voltmeter-B is 3.23 percent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.7,Page number: 617"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the deflection in an ammeter.\"\"\"\n",
+ "\n",
+ "from math import sin,asin,degrees,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I1=20.0 #Initial current(in Amperes) \n",
+ "I2=12.0 #Final current(in Amperes)\n",
+ "angle1=60 #Initial deflection(in degrees)\n",
+ "\"\"\" Given: Deflecting torque is directly proportional to the current.\"\"\"\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"For spring control: Controlling torque is directly proportional to deflection.\n",
+ " For steady state deflection, controlling torque=deflecting torque.\n",
+ " Therefore,deflection is directly proportional to current. \"\"\"\n",
+ "angle2_a=(I2/I1)*angle1\n",
+ "\"\"\"For gravity control: Controlling torque is directly proportional to sine of the deflection angle.\n",
+ " For steady state deflection, controlling torque=deflecting torque.\n",
+ " Therefore,sine of the angle of deflection is directly proportional to the current. \"\"\" \n",
+ "angle2_b=asin((I2/I1)*sin(radians(angle1)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The deflection for a current of 12A when the instrument is spring controlled is %.2f degrees.\" %(angle2_a) \n",
+ "print \"(b)The deflection for a current of 12A when the instrument is gravity controlled is %.2f degrees.\" %(degrees(angle2_b)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The deflection for a current of 12A when the instrument is spring controlled is 36.00 degrees.\n",
+ "(b)The deflection for a current of 12A when the instrument is gravity controlled is 31.31 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.8,Page number: 618"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the deflection in degrees in a gravity-controlled instrument.\"\"\"\n",
+ "\n",
+ "from math import asin,degrees\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "W=0.005 #Controlling weight(in kilograms)\n",
+ "l=2.4e-02 #Distance of controlling weight from the axis(in metres)\n",
+ "torque=1.05e-04 #Deflecting torque(in kg-m)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "angle=asin(torque/(W*l))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The deflection corresponding to a deflecting torque of 1.05e-04 kg-m is %.2f degrees.\" %(degrees(angle))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The deflection corresponding to a deflecting torque of 1.05e-04 kg-m is 61.04 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.9,Page number: 618"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the deflection in an ammeter.\"\"\"\n",
+ "\n",
+ "from math import sin,asin,degrees,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I1=10.0 #Initial current(in Amperes) \n",
+ "I2=5.0 #Final current(in Amperes)\n",
+ "angle1=90 #Initial deflection(in degrees)\n",
+ "\"\"\" Given: Deflecting torque is directly proportional to square of the current.\"\"\"\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"For spring control: Controlling torque is directly proportional to deflection.\n",
+ " For steady state deflection, controlling torque=deflecting torque.\n",
+ " Therefore,deflection is directly proportional to square of the current. \"\"\"\n",
+ "angle2_a=pow((I2/I1),2)*angle1\n",
+ "\"\"\"For gravity control: Controlling torque is directly proportional to sine of the deflection angle.\n",
+ " For steady state deflection, controlling torque=deflecting torque.\n",
+ " Therefore,sine of the angle of deflection is directly proportional to square of the current. \"\"\" \n",
+ "angle2_b=asin((pow((I2/I1),2))*sin(radians(angle1)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The deflection for a current of 5A when the instrument is spring controlled is %.2f degrees.\" %(angle2_a) \n",
+ "print \"(b)The deflection for a current of 5A when the instrument is gravity controlled is %.2f degrees.\" %(degrees(angle2_b)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The deflection for a current of 5A when the instrument is spring controlled is 22.50 degrees.\n",
+ "(b)The deflection for a current of 5A when the instrument is gravity controlled is 14.48 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.10,Page number: 619 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current required to produce a deflection of 60 degrees in a moving coil instrument.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "w=4e-02 #Width of the coil(in metres)\n",
+ "l=5e-02 #Length of the coil(in metres)\n",
+ "N=80.0 #Number of turns in the coil\n",
+ "torque_control=0.5e-07 #Controlling torque per degree deflection of the coil(in Nm)\n",
+ "B=0.1 #Magnetic flux density in the air gap(in Wb per square-metre)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "A=w*l\n",
+ "torque_c=torque_control*60.0\n",
+ "I=torque_c/(B*N*A)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current required to give a deflection of 60 degrees is %e A.\" %(I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current required to give a deflection of 60 degrees is 1.875000e-04 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file 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 diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter3.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter3.ipynb new file mode 100755 index 00000000..a6211207 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter3.ipynb @@ -0,0 +1,2116 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: NETWORK ANALYSIS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1,Page number: 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the value of capacitance parameter.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "per_free_space=8.854e-12 #Permittivity of free space(in Farad per metre)\n",
+ "A=0.113 #Total area(in square metre) \n",
+ "rel_per=10.0 #Relative permittivity of mica layer\n",
+ "d=0.1e-03 #Thickness of mica layer(in metre)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C1=(per_free_space*rel_per*A)/d\n",
+ "W=0.05\n",
+ "V=100.0\n",
+ "C2=(2*W)/(V*V)\n",
+ "i=5e-03\n",
+ "dv=100\n",
+ "dt=0.1\n",
+ "C3=i/(dv/dt)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(i)The value of capacitance is %.2f micro Farad.\" %(C1*1000000)\n",
+ "print \"(ii)The value of capacitance is %.2f micro Farad.\" %(C2*1000000)\n",
+ "print \"(iii)The value of capacitance is %.2f micro Farad.\" %(C3*1000000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)The value of capacitance is 0.10 micro Farad.\n",
+ "(ii)The value of capacitance is 10.00 micro Farad.\n",
+ "(iii)The value of capacitance is 5.00 micro Farad.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2,Page number: 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the inductance of the coil for different cases.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "W=0.2 #Energy stored in magnetic field(in Joules) \n",
+ "i=0.2 #Current producing magnetic field(in Amperes) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "L1=(2*W)/(i*i)\n",
+ "v=10\n",
+ "di=0.1\n",
+ "dt=0.2\n",
+ "L2=v/(di/dt)\n",
+ "p=2.5\n",
+ "di=0.5\n",
+ "dt=1\n",
+ "i=0.1\n",
+ "L3=p/(i*(di/dt))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(i)The inductance of the coil is %.2f H.\" %(L1)\n",
+ "print \"(ii)The inductance of the coil is %.2f H.\" %(L2)\n",
+ "print \"(iii)The inductance of the coil is %.2f H.\" %(L3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)The inductance of the coil is 10.00 H.\n",
+ "(ii)The inductance of the coil is 20.00 H.\n",
+ "(iii)The inductance of the coil is 50.00 H.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3,Page number: 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the inductance of 2 coils.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Leq=0.7 #Equivalent self-inductance(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" Leq=0.7 H; \n",
+ " \n",
+ " Leq=((L1*L2)/(L1+L2))+0.5 ;\n",
+ "\n",
+ " L1=(2*L2); \"\"\"\n",
+ "L2=(Leq-0.5)*(3.0/2)\n",
+ "L1=2*L2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"L1=%.2f H. \\nL2=%.2f H.\" %(L1,L2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L1=0.60 H. \n",
+ "L2=0.30 H.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4,Page number: 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the equivalent capacitance of the network and the voltage drop across each capacitor. \"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=220.0 #Voltage of the DC source(in Volts)\n",
+ "C1=0.05e-06 #Capacitance of the capacitor 1(in Farad)\n",
+ "C2=0.10e-06 #Capacitance of the capacitor 2(in Farad)\n",
+ "C3=0.20e-06 #Capacitance of the capacitor 3(in Farad)\n",
+ "C4=0.05e-06 #Capacitance of the capacitor 4(in Farad) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Cs=1/((1/C1)+(1/C2)+(1/C3)+(1/C4))\n",
+ "Q=Cs*V\n",
+ "V1=Q/C1\n",
+ "V2=Q/C2\n",
+ "V3=Q/C3\n",
+ "V4=Q/C4\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The equivalent capacitance of the network is %.4f micro Farad.\" %(Cs*1000000)\n",
+ "print \"The voltage across capacitor C1= %.2f V.\" %(V1)\n",
+ "print \"The voltage across capacitor C2= %.2f V.\" %(V2)\n",
+ "print \"The voltage across capacitor C3= %.2f V.\" %(V3)\n",
+ "print \"The voltage across capacitor C4= %.2f V.\" %(V4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equivalent capacitance of the network is 0.0182 micro Farad.\n",
+ "The voltage across capacitor C1= 80.00 V.\n",
+ "The voltage across capacitor C2= 40.00 V.\n",
+ "The voltage across capacitor C3= 20.00 V.\n",
+ "The voltage across capacitor C4= 80.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5,Page number: 55\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage across each capacitor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Q1=400e-06 #Charge on the capacitor 1(in Coulombs)\n",
+ "Q2=200e-06 #Charge on the capacitor 2(in Coulombs) \n",
+ "C1=2e-06 #Capacitance of the capacitor 1(in Farad)\n",
+ "C2=10e-06 #Capacitance of the capacitor 2(in Farad) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Q=Q1+Q2\n",
+ "C=C1+C2\n",
+ "V=Q/C\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"After the switch is closed, the voltage that exists across each capacitor is %.2f V.\" %(V)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After the switch is closed, the voltage that exists across each capacitor is 50.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6,Page number: 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\" A series combination of 2 capacitances C1=2 micro-F and C2=8 micro-F is connected across a dc-supply of 300-V.Determine(a)the charge,\n",
+ " (b)the voltage,and(c)the energy stored in each capacitor. \"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "C1=2e-06 #Capacitance of the capacitor 1(in Farad) \n",
+ "C2=8e-06 #Capacitance of the capacitor 2(in Farad)\n",
+ "V=300.0 #Voltage of Dc supply(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C=(C1*C2)/(C1+C2)\n",
+ "Q=C*V\n",
+ "V1=Q/C1\n",
+ "V2=Q/C2\n",
+ "W1=(1.0/2)*C1*(V1*V1) \n",
+ "W2=(1.0/2)*C2*(V2*V2)\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)When connected in series,the charge on each capacitor is the same.The charge on each capacitor is %.2f micro Coulomb.\" %(Q*1000000)\n",
+ "print \"(b)The voltage across the capacitor C1= %.2f V.\\n The voltage across the capacitor C2= %.2f V.\" %(V1,V2)\n",
+ "print \"(c)The energy stored in the capacitor C1= %.2f milli Joule.\" %(W1*1000)\n",
+ "print \" The energy stored in the capacitor C2= %.2f milli Joule.\" %(W2*1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)When connected in series,the charge on each capacitor is the same.The charge on each capacitor is 480.00 micro Coulomb.\n",
+ "(b)The voltage across the capacitor C1= 240.00 V.\n",
+ " The voltage across the capacitor C2= 60.00 V.\n",
+ "(c)The energy stored in the capacitor C1= 57.60 milli Joule.\n",
+ " The energy stored in the capacitor C2= 14.40 milli Joule.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7,Page number: 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the value of capacitance.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "C_eq=1e-06 #Equivalent capacitance of the network(in Farad)\n",
+ "C1=1e-06 #Capacitance of the capacitor 1(in Farad)\n",
+ "C2=8e-06 #Capacitance of the capacitor 2(in Farad)\n",
+ "C3=2e-06 #Capacitance of the capacitor 3(in Farad)\n",
+ "C4=2e-06 #Capacitance of the capacitor 4(in Farad)\n",
+ "C5=6e-06 #Capacitance of the capacitor 5(in Farad)\n",
+ "C6=12e-06 #Capacitance of the capacitor 6(in Farad)\n",
+ "C7=4e-06 #Capacitance of the capacitor 7(in Farad) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "C8=C3+C4\n",
+ "C9=1/((1/C5)+(1/C6))\n",
+ "C10=1/((1/C2)+(1/C8))\n",
+ "C11=C7+C9\n",
+ "C12=1/((1/C1)+(1/C11))\n",
+ "C13=C12+C10\n",
+ "C=1/((1/C_eq)-(1/C13))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The value of capacitance C is %.2f micro Farad.\" %(C*1e06)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of capacitance C is 1.39 micro Farad.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8,Page number: 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the % change in V_L and I_L.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "E=3.0 #EMF of the battery(in Volts) \n",
+ "Ri=1.0 #Internal resistance of the battery(in Ohms)\n",
+ "R_L_min=100.0 #Minimum value of variable load resistance(in Ohms)\n",
+ "R_L_max=1000.0 #Maximum value of variable load resistance(in Ohms) \n",
+ "\n",
+ "\n",
+ "#Calculations and Result: \n",
+ "I_L1=E/(R_L_min+Ri)\n",
+ "I_L2=E/(R_L_max+Ri)\n",
+ "V_L1=E-(I_L1*Ri)\n",
+ "V_L2=E-(I_L2*Ri)\n",
+ "\n",
+ "if I_L1>I_L2 :\n",
+ " change_I_L= ((I_L1-I_L2)/I_L1)*100\n",
+ " ans=\"(a)The percentage decrease in I_L is %.2f percent\" %(round(change_I_L,2))\n",
+ " print(ans)\n",
+ "elif I_L2>IL1 : \n",
+ " change_I_L= ((I_L2-I_L1)/I_L1)*100\n",
+ " ans=\"(a)The percentage increase in I_L is %.2f percent\" %(round(change_I_L,2))\n",
+ " print(ans)\n",
+ "else: print(\"(a)The percentage change in I_L is 0 percent.\")\n",
+ "\n",
+ "if V_L2>V_L1 :\n",
+ " change_V_L= ((V_L2-V_L1)/V_L1)*100\n",
+ " ans=\" The percentage increase in V_L is %.2f percent\" %(round(change_V_L,2))\n",
+ " print(ans)\n",
+ "elif V_L1>V_L2 :\n",
+ " change_V_L= ((V_L1-V_L2)/V_L1)*100\n",
+ " ans=\" The percentage decrease in V_L is %.2f percent\" %(round(change_V_L,2))\n",
+ " print(ans)\n",
+ "else : print(\" The percentage change in V_L is 0\",\"%\")\n",
+ "\n",
+ "R_L_min=1e-03\n",
+ "R_L_max=10e-03\n",
+ "I_L1=E/(R_L_min+Ri)\n",
+ "I_L2=E/(R_L_max+Ri)\n",
+ "V_L1=round((E-(I_L1*Ri)),3)\n",
+ "V_L2=round((E-(I_L2*Ri)),2)\n",
+ "\n",
+ "if I_L1>I_L2 :\n",
+ " change_I_L= ((I_L1-I_L2)/I_L1)*100\n",
+ " ans=\"(b)The percentage decrease in I_L is %.2f percent\" %(round(change_I_L,2))\n",
+ " print(ans) \n",
+ "\n",
+ "elif I_L2>I_L1 :\n",
+ " change_I_L= ((I_L2-I_L1)/I_L1)*100\n",
+ " ans=\"(b)The percentage increase in I_L is %.2f percent\" %(round(change_I_L,2))\n",
+ " print(ans)\n",
+ "\n",
+ "else : print(\"(b) The percentage change in I_L is 0 percent\")\n",
+ "\n",
+ "if V_L2>V_L1 :\n",
+ " change_V_L= ((V_L2-V_L1)/V_L1)*100\n",
+ " ans=\" The percentage increase in V_L is %.3f percent\" %(change_V_L)\n",
+ " print(ans)\n",
+ "\n",
+ "elif V_L1>V_L2 :\n",
+ " change_V_L= ((V_L1-V_L2)/V_L1)*100\n",
+ " ans=\" The percentage decrease in V_L is %.2f percent\" %(change_V_L)\n",
+ " print(ans)\n",
+ "\n",
+ "else: print(\" The percentage change in V_L is 0 percent\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The percentage decrease in I_L is 89.91 percent\n",
+ " The percentage increase in V_L is 0.90 percent\n",
+ "(b)The percentage decrease in I_L is 0.89 percent\n",
+ " The percentage increase in V_L is 900.000 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9,Page number: 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the power delivered by the ideal part of the sources.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R_S=2.0 #Resistance of the current source(in Ohms)\n",
+ "I_S=3.0 #Current from the current source(in Amperes) \n",
+ "R_L=4.0 #Resistance of the load(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V_S=R_S*I_S\n",
+ "I_L1=I_S*(R_S/(R_S+R_L))\n",
+ "V_L1=I_L1*R_L\n",
+ "R1=1/((1/R_S)+(1/R_L))\n",
+ "P_S1=I_S*I_S*R1\n",
+ "I_L2=V_S/(R_S+R_L)\n",
+ "V_L2=V_S*(R_L/(R_S+R_L))\n",
+ "R2=R_S+R_L\n",
+ "P_S2=(V_S*V_S)/R2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"Case 1:\"\n",
+ "print \"I_L=%.2f A. \\nV_L=%.2f V. \\nP_S=%.2f W.\" %(I_L1,V_L1,P_S1)\n",
+ "print \"\\nCase 2:\"\n",
+ "print \"I_L=%.2f A. \\nV_L=%.2f V. \\nP_S=%.2f W.\" %(I_L2,V_L2,P_S2) \n",
+ "print \"\\nWe find that the two energy sources are equivalent as regards the terminal relationships. But, the total power delivered by the ideal part of the two sources is different.\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case 1:\n",
+ "I_L=1.00 A. \n",
+ "V_L=4.00 V. \n",
+ "P_S=12.00 W.\n",
+ "\n",
+ "Case 2:\n",
+ "I_L=1.00 A. \n",
+ "V_L=4.00 V. \n",
+ "P_S=6.00 W.\n",
+ "\n",
+ "We find that the two energy sources are equivalent as regards the terminal relationships. But, the total power delivered by the ideal part of the two sources is different.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10,Page number: 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the currents through the two resistors in the circut.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "I_2_ohm1=16.0*(6.0/(6+2))\n",
+ "I_6_ohm1=16-I_2_ohm1\n",
+ "V_eq=16*2\n",
+ "I_2_ohm2=V_eq/(2+6)\n",
+ "I_6_ohm2=I_2_ohm2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current through the 2 ohm resistor is %.2f A.\" %(I_2_ohm1) \n",
+ "print \"The current through the 6 ohm resistor is %.2f A. \\n\" %(I_6_ohm1) \n",
+ "print \"After transformation,\\nThe current through the 2 ohm resistor is %.2f A.\" %(I_2_ohm2) \n",
+ "print \"The current through the 6 ohm resistor is %.2f A.\" %(I_6_ohm2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current through the 2 ohm resistor is 12.00 A.\n",
+ "The current through the 6 ohm resistor is 4.00 A. \n",
+ "\n",
+ "After transformation,\n",
+ "The current through the 2 ohm resistor is 4.00 A.\n",
+ "The current through the 6 ohm resistor is 4.00 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11,Page number: 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the reduced network using source transformation.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"First all the voltage sources are transformed to equivalent current sources.\"\"\"\n",
+ "I1=8.0/2.0\n",
+ "I2=6.0/1.0\n",
+ "I3=6.0/2.0\n",
+ "I4=3.0/1.0\n",
+ "I5=I1+I2\n",
+ "I6=I3+I4\n",
+ "R1=1.0/((1.0/2.0)+(1.0/1.0))\n",
+ "R2=1.0/((1.0/2.0)+(1.0/1.0))\n",
+ "V5=I5*R1\n",
+ "V6=I6*R2\n",
+ "V_tot=V5+V6\n",
+ "R_tot=R1+R2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The network is equivalent to a voltage source of %.3f V with an internal resistance of %.2f Ohms.\" %(V_tot,R_tot)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The network is equivalent to a voltage source of 10.667 V with an internal resistance of 1.33 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12,Page number: 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage across 3 Ohms resistor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I1=4.0 #Current delivered by source 1(in Amperes)\n",
+ "R1=1.0 #Resitance of resistor parallel to current source 1(in Ohms) \n",
+ "V2=6.0 #Voltage of the voltage source 2(in Volts)\n",
+ "I2=5.0 #Current delivered by source 2(in Amperes)\n",
+ "R2=2.0 #Resistance of resistor 2(in Ohms) \n",
+ "R3=3.0 #Resistance of resistor 3(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V1=I1*R1\n",
+ "V3=V1+V2\n",
+ "I3=V3/R1\n",
+ "I4=I3-I2\n",
+ "V4=I4*R1\n",
+ "V_res=V4*(R3/(R1+R2+R3))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The voltage across 3 Ohms resistor is %.2f Volts.\" %(V_res)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage across 3 Ohms resistor is 2.50 Volts.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13,Page number: 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current in the circuit.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=24.0 #Supply voltage(in Volts)\n",
+ "R1=4.0 #Resistance of resistor 1(in Ohms) \n",
+ "R2=2.0 #Resistance of resistor 2(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" V1=4*I;\n",
+ " Applying Kirchoff's Voltage Law to the closed loop, 24-(4*I)-(2*I)-(4.5*4*I)=0 ; \"\"\"\n",
+ "I=24/((R1+R2)-(4.5*R1))\n",
+ "P=-4.5*R1*I*I\n",
+ "R=V/I\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The value of the current I is %.2f A.\" %(abs(I))\n",
+ "print \"(b)The power absorbed by the dependent source is %.2f W.\" %(P)\n",
+ "print \"(c)The resistance 'seen' by the independent voltage source is %.2f Ohms.\" %(R) \n",
+ "print \"\\nNOTE: The negative sign of the resistance is a result of the action of the dependent source.\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The value of the current I is 2.00 A.\n",
+ "(b)The power absorbed by the dependent source is -72.00 W.\n",
+ "(c)The resistance 'seen' by the independent voltage source is -12.00 Ohms.\n",
+ "\n",
+ "NOTE: The negative sign of the resistance is a result of the action of the dependent source.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14,Page number: 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage in the circuit.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=100.0 #Supply voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Appling KVL in the closed loop, +100-(40*I)-(60*I)=0.\"\"\"\n",
+ "I=V/(40.0+60.0)\n",
+ "V1=I*60.0\n",
+ "\"\"\"Appling KVL in the open loop, -10+V1+(0*10)+30-Vab=0.\"\"\"\n",
+ "Vab=30+V1-10\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The voltage Vab in the circuit is %.2f V.\" %(Vab)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage Vab in the circuit is 80.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15,Page number: 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the unknown voltages Vx and Vcd.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=10.0 #Supply voltage(in Volts)\n",
+ "Vca=4.0 #Voltage between points c and a(in Volts) \n",
+ "V1=6.0 #Voltage across resistor R1(in Volts) \n",
+ "V2=-4.0 #Voltage across resistor R2(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vx=Vca-V2\n",
+ "Vcd=Vca-V1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The voltage Vx in the circuit is %.2f V.\" %(Vx)\n",
+ "print \"The voltage Vcd in the circuit is %.2f V.\" %(Vcd)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage Vx in the circuit is 8.00 V.\n",
+ "The voltage Vcd in the circuit is -2.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.16,Page number: 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the currents in the network.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"KVL equations for loops 1,2 and 3 are written and the equations are solved using SymPy.\"\"\" \n",
+ "print \"Note: All currents are expressed in Amperes.\"\n",
+ "Ix, Iy, I1 = symbols('Ix Iy I1');\n",
+ "solve([(5*Ix)+(0*Iy)+(10*I1)-100,(7*Ix)+(2*Iy)+(-2*I1)+50,(3*Ix)+(-5*Iy)+(-3*I1)+50], [Ix,Iy,I1])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Note: All currents are expressed in Amperes.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 20,
+ "text": [
+ "{I1: 585/49, Ix: -190/49, Iy: 25/49}"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.17,Page number: 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the currents using Kirchoff's laws.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"KCL equations at nodes B and C,we get\n",
+ " \n",
+ " I1+I2=20;\n",
+ " \n",
+ " I3-I2=30;\"\"\"\n",
+ "\"\"\"KVL equation for the outer loop ABCDEFGHA, I1-(3*I2)-(2*I3)=-100; \"\"\"\n",
+ "print \"All the currents are expressed in Amperes.\"\"\"\n",
+ "print \"Resistances R1 and R2 are in Ohms.\"\"\"\n",
+ "I1, I2,I3,R1,R2 = symbols('I1 I2 I3 R1 R2')\n",
+ "solve([I1+I2+(0*I3)-20,(0*I1)-I2+I3-30,I1+(-3*I2)+(-2*I3)+100,(110-(0.1*I1))-(20*R1),(120-(0.2*I3))-(30*R2)],[I1,I2,I3,R1,R2])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "All the currents are expressed in Amperes.\n",
+ "Resistances R1 and R2 are in Ohms.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 42,
+ "text": [
+ "{I1: 10.0000000000000,\n",
+ " I2: 10.0000000000000,\n",
+ " I3: 40.0000000000000,\n",
+ " R1: 5.45000000000000,\n",
+ " R2: 3.73333333333333}"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.18,Page number: 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current through resistor in the circuit.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I=2.0 #Loop current(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"KVL Equation: 10-(5*(I1-2))-(8*I1)=0.\"\"\"\n",
+ "I1=(10.0+10.0)/(8.0+5.0)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current through the 8 Ohms resistor is %.3f A.\" %(I1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current through the 8 Ohms resistor is 1.538 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.19,Page number: 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the unknown voltage.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Writing the KVL equation around the loop of I, -(2*I)+(3*I)+6-(1*(I+5-4))=0.\"\"\"\n",
+ "I=(6.0-1.0)/(2+3+1)\n",
+ "v=3*I\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The unknown voltage in the circuit is %.2f V.\" %(v)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unknown voltage in the circuit is 2.50 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.20,Page number: 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current drawn by the source.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KVL for the loops 1, 2 and 3 and solving for currents.\"\"\"\n",
+ "print \"All the currents are expressed in Amperes.\"\"\"\n",
+ "print \"The current delivered by the source is I1.\"\n",
+ "I1, I2,I3,Is = symbols('I1 I2 I3 Is')\n",
+ "solve([(19*I1)+(-12*I2)+(0*I3)-60,(-12*I1)+(18*I2)+(-6*I3),(0*I1)+(-6*I2)+(18*I3),Is-I1], [I1,I2,I3,Is]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "All the currents are expressed in Amperes.\n",
+ "The current delivered by the source is I1.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 4,
+ "text": [
+ "{I1: 6, I2: 9/2, I3: 3/2, Is: 6}"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.21,Page number: 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the mesh currents using mesh analysis.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KVL for the loops 1, 2 and 3 and solving for currents.\"\"\"\n",
+ "print \"All the currents are expressed in Amperes.\"\"\"\n",
+ "I1, I2, I3 = symbols('I1 I2 I3')\n",
+ "solve([(7*I1)+(-4*I2)+(0*I3)-13,(-4*I1)+(15*I2)+(-6*I3)-12,(0*I1)+(-6*I2)+(13*I3)-1], [I1,I2,I3]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "All the currents are expressed in Amperes.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 34,
+ "text": [
+ "{I1: 3, I2: 2, I3: 1}"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.22,Page number: 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage across resistor using node-voltage analysis.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KCL at nodes a and b and finding the nodal voltages.\"\"\"\n",
+ "print \"All the voltages are expressed in Volts.\"\"\"\n",
+ "Va,Vb,Vab = symbols('Va Vb Vab')\n",
+ "solve([(Va/2)+((Va-Vb)/3)-5,((Vb-Va)/3)+(Vb/4)+6,Va-Vb-Vab], [Va,Vb,Vab])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "All the voltages are expressed in Volts.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 43,
+ "text": [
+ "{Va: 22/9, Vab: 34/3, Vb: -80/9}"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.23,Page number: 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current through resistor.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Applying KCL at node 1,\n",
+ "\n",
+ " ((V1-0)/12.0)+((V1-60.0)/7.0)+((V1-0)/4.0)=0; \"\"\"\n",
+ "V1=(60.0/7.0)/((1.0/12.0)+(1.0/7.0)+(1.0/4.0))\n",
+ "I1=V1/12.0\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current I1 through the 12 Ohms resistor is %.2f A.\" %(I1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current I1 through the 12 Ohms resistor is 1.50 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.24,Page number: 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current through a resistor.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KCL for supernode (a,b) and for node c and finding the nodal voltages.\"\"\"\n",
+ "print \"All the voltages are expressed in Volts.\"\"\"\n",
+ "print \"The current I is in Amperes.\"\n",
+ "Va,Vb,Vc,I = symbols('Va Vb Vc I')\n",
+ "solve([Va-Vb-6,(Va/3)+((Vb-Vc)/4)-2,((Vc-Vb)/4)+(Vc/5)+7,((Vb-Vc)/4)-I], [Va,Vb,Vc,I])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "All the voltages are expressed in Volts.\n",
+ "The current I is in Amperes.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 47,
+ "text": [
+ "{I: 35/12, Va: -11/4, Vb: -35/4, Vc: -245/12}"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.25,Page number: 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage across resistor by nodal-voltage method.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Applying KCL at node a,\n",
+ " \n",
+ " ((Va-6.0)/1.0)+((Va-0.0)/5.0)=-4.0+5.0 ; \"\"\"\n",
+ "\n",
+ "Va=(6.0-1.0)/1.2\n",
+ "v=Va*(3.0/(2.0+3.0))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The voltage across 3 Ohms resistor is %.2f V.\" %(v)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage across 3 Ohms resistor is 2.50 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.26,Page number: 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current through resistor.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Applying KCL at nodes 1 and 2 and solving for nodal voltages.\"\"\"\n",
+ "print \"All the voltages are expressed in Volts.\"\"\"\n",
+ "print \"The current I is in Amperes.\"\n",
+ "V1,V2,I = symbols('V1 V2 I')\n",
+ "solve([(0.7*V1)+(-0.2*V2)-3,(-0.2*V1)+(1.2*V2)-2,((V1-V2)/5.0)-I],[V1,V2,I])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "All the voltages are expressed in Volts.\n",
+ "The current I is in Amperes.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 16,
+ "text": [
+ "{I: 0.500000000000000, V1: 5.00000000000000, V2: 2.50000000000000}"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.27,Page number: 85 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current through a resistor.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Applying KCL at node 1,\n",
+ "\n",
+ " ((V-10.0)/2.0)+((V-0.0)/(1.0+3.0))+((V-8.0)/6.0)=0 ; \"\"\"\n",
+ "\n",
+ "V=((10.0/2.0)+(8.0/6.0))/((1.0/2.0)+(1.0/4.0)+(1.0/6.0))\n",
+ "I=V/(1.0+3.0)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current I is %.2f A.\" %(I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current I is 1.73 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.28,Page number: 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the values of capacitances.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vs=200.0 #Voltage of the dc supply(in Volts)\n",
+ "V1=120.0 #Potential difference across C1(in Volts)\n",
+ "V_new=140.0 #Potential difference across C1 when a capacitor is added(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Case 1: The charge on each capacitor is the same.\n",
+ "\n",
+ " (C1*V1)=(C2*V2);\n",
+ " (120*C1)=(80*C2);\"\"\"\n",
+ "\"\"\"Case 2: The capacitance of 3 micro Farad in parallel with C2 gives an equivalent capacitance of (C2+3) micro Farad.\n",
+ " \n",
+ " (140*C1)=(60*(C2+3)) ;\"\"\"\n",
+ "print \"Note:The capacitances are expressed in Farads.\" \n",
+ "C1,C2 = symbols('C1 C2')\n",
+ "solve([(120*C1)-(80*C2),(140*C1)-(60*(C2+(3e-06)))],[C1,C2])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Note:The capacitances are expressed in Farads.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 31,
+ "text": [
+ "{C1: 3.60000000000000e-6, C2: 5.40000000000000e-6}"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.29,Page number: 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current in each branch.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=20.0/10.0\n",
+ "I4=10.0/5.0\n",
+ "I5=10.0/2.0\n",
+ "I2=(20.0-(10.0+9.0))/1.0\n",
+ "I3=(20.0-50.0-10.0)/20.0\n",
+ "Ia=I1+I2+I3\n",
+ "Ib=I4+I5-I2-I3\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The currents are:\" \n",
+ "print \" I1=%.2f A \\n I2=%.2f A \\n I3=%.2f A \\n I4=%.2f A \\n I5=%.2f A \\n Ia=%.2f A \\n Ib=%.2f A\" %(I1,I2,I3,I4,I5,Ia,Ib)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The currents are:\n",
+ " I1=2.00 A \n",
+ " I2=1.00 A \n",
+ " I3=-2.00 A \n",
+ " I4=2.00 A \n",
+ " I5=5.00 A \n",
+ " Ia=1.00 A \n",
+ " Ib=8.00 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.30,Page number: 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the currents through resistors.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KVL for the loops 1 and 2 and solving for currents.\"\"\"\n",
+ "print \"All the currents are expressed in Amperes.\"\"\"\n",
+ "print \"Current through R1= Current through R2=I1\"\n",
+ "print \"Current through R3=I3\"\n",
+ "print \"Current through R4=I2\"\n",
+ "I1, I2, I3 = symbols('I1 I2 I3')\n",
+ "solve([(4.5*I1)+(-3*I2)-2,(-3*I1)+(4*I2)-5,I1-I2-I3], [I1,I2,I3]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "All the currents are expressed in Amperes.\n",
+ "Current through R1= Current through R2=I1\n",
+ "Current through R3=I3\n",
+ "Current through R4=I2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 54,
+ "text": [
+ "{I1: 2.55555555555556, I2: 3.16666666666667, I3: -0.611111111111111}"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.31,Page number: 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current through each resistor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "E1=4.0 #EMF of cell 1(in Volts)\n",
+ "E2=8.0 #EMF of cell 2(in Volts)\n",
+ "R1=0.5 #Internal resistance of cell 1(in Ohms)\n",
+ "R2=1.0 #Internal resistance of cell 2(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "R3=1.0/((1.0/3.0)+(1.0/6.0))\n",
+ "Rt=R1+R2+R3+4.5\n",
+ "E=E2-E1\n",
+ "I=E/Rt\n",
+ "I_3=I*(6.0/(3.0+6.0))\n",
+ "I_6=I*(3.0/(3.0+6.0))\n",
+ "V1=E1+(I*R1)\n",
+ "V2=E2-(I*R2)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current the 3 Ohms resistor is %.2f A.\" %(I_3)\n",
+ "print \" The current the 6 Ohms resistor is %.2f A.\" %(I_6)\n",
+ "print \" The current the 4.5 Ohms resistor is %.2f A.\" %(I)\n",
+ "print \"(b)The potential difference across cell 1 is %.2f V and across cell 2 is %.2f V.\" %(V1,V2)\n",
+ "print \" Note that the pd of cell E1 is greater than its EMF.This is so because the cell is working as a load.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current the 3 Ohms resistor is 0.33 A.\n",
+ " The current the 6 Ohms resistor is 0.17 A.\n",
+ " The current the 4.5 Ohms resistor is 0.50 A.\n",
+ "(b)The potential difference across cell 1 is 4.25 V and across cell 2 is 7.50 V.\n",
+ " Note that the pd of cell E1 is greater than its EMF.This is so because the cell is working as a load.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.32,Page number: 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the potential of point A.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "E1=8.0 #EMF of first source(in Volts)\n",
+ "E2=6.0 #EMF of second source(in Volts)\n",
+ "E3=4.0 #EMF of third source(in Volts)\n",
+ "R1=5.0 #Resistance of resistor 1(in Ohms) \n",
+ "R2=9.0 #Resistance of resistor 2(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V_A=E3+E2-E1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The potential of point A is %.2f V.\" %(V_A)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The potential of point A is 2.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.33,Page number: 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the energy stored in a capacitor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "C=4e-06 #Capacitance of the capacitor(in Farad)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" Applying KCL to the node at the top of the capacitor, current through 5 Ohms resistance is 1+2=3 A. \n",
+ " Applying KCL to the node at the bottom of the capacitor, current through 2 Ohms resistance is 2-1=1 A.\"\"\"\n",
+ "V=(3*5)+(3*1)+(1*2)\n",
+ "W=0.5*C*V*V\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The energy stored in the capacitor is %e J.\" %(W)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy stored in the capacitor is 8.000000e-04 J.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.34,Page number: 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the potential differnce between two points.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "E1=3.0 #EMF of cell 1(in Volts)\n",
+ "E2=2.0 #EMF of cell 2in Volts)\n",
+ "E3=1.0 #EMF of cell 3in Volts)\n",
+ "r1=1.0 #Internal resistance of cell 1(in Ohms)\n",
+ "r2=1.0 #Internal resistance of cell 2(in Ohms)\n",
+ "r3=1.0 #Internal resistance of cell 3(in Ohms) \n",
+ "R=1.0 #Resistance of resistor R(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Assigning loop currents as I1 and I2 and writing KVL equations for the two loops,\n",
+ "\n",
+ " E1-(I1*r1)-((I1-I2)*r2)-E2=0; which is (-2*I1)+I2+1=0; \n",
+ " \n",
+ " E2-(I2*r3)-((I2-I1)*r2)-E3=0; which is (-2*I2)+I1+1=0; \"\"\"\n",
+ "\n",
+ "eq1=-1\n",
+ "eq2=-1\n",
+ "I1=((2*eq1)+eq2)/(-3.0)\n",
+ "I2=((2*eq2)+eq1)/(-3.0)\n",
+ "Vab=E2+((I1-I2)*r2)+(0*R)\n",
+ "\n",
+ "V_CB=E2\n",
+ "V_B=0.0\n",
+ "V_C=V_CB+V_B\n",
+ "I3=(V_C-E1)/r1\n",
+ "I4=(V_C-E3)/r3\n",
+ "I6=V_C/R\n",
+ "I5=I3+I4+I6\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The potential difference between points A and B is %.2f V.\" %(Vab) \n",
+ "print \" The current through r1 is %.2f A,the current through r2=%.2f A.\" %(I1,(I1-I2)) \n",
+ "print \" The current through r3=%.2f A and the current through R is 0(no closed loop).\" %(I2)\n",
+ "print \"(b)The current through E1 is %.2f A.\" %(I3) \n",
+ "print \" The current through E2 is %.2f A.\" %(I5)\n",
+ "print \" The current through E3 is %.2f A.\" %(I4)\n",
+ "print \" The current through R is %.2f A.\" %(I6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The potential difference between points A and B is 2.00 V.\n",
+ " The current through r1 is 1.00 A,the current through r2=0.00 A.\n",
+ " The current through r3=1.00 A and the current through R is 0(no closed loop).\n",
+ "(b)The current through E1 is -1.00 A.\n",
+ " The current through E2 is 2.00 A.\n",
+ " The current through E3 is 1.00 A.\n",
+ " The current through R is 2.00 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.35,Page number: 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the potential diiference between two points.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "pd_9=0.0\n",
+ "pd_13=0.0\n",
+ "pd_10=6.0*10.0\n",
+ "pd_5=5.0*8.0\n",
+ "pd_18=15.0\n",
+ "Vab=pd_5-pd_10-pd_18\n",
+ "\n",
+ "#Result:\n",
+ "print \"The voltage drop Vab is %.2f V.\" %(Vab)\n",
+ "print \"The resistors 4 Ohms,11 Ohms,9 Ohms,18 Ohms and 13 Ohms have no effect on the voltage drop Vab.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage drop Vab is -35.00 V.\n",
+ "The resistors 4 Ohms,11 Ohms,9 Ohms,18 Ohms and 13 Ohms have no effect on the voltage drop Vab.\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.36,Page number: 90 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage of dependent voltage source.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KVL for the loops 1 and 2.\"\"\"\n",
+ "print \"The current I1 is expressed in Amperes and the voltage V1 is expressed in Volts.\"\"\"\n",
+ "V1,I1 = symbols('V1 I1')\n",
+ "solve([V1+(2*I1),24-(16*I1)-(4*V1)], [V1,I1]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current I1 is expressed in Amperes and the voltage V1 is expressed in Volts.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 33,
+ "text": [
+ "{I1: 3, V1: -6}"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.37,Page number: 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage V.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KCL at the upper node and KVL equation for the left loop.\"\"\"\n",
+ "print \"The currents I1 and I2 are expressed in Amperes and the voltage V is expressed in Volts.\"\"\"\n",
+ "I1,I2,V = symbols('I1 I2 V')\n",
+ "solve([I1-I2+(10*I2),36-(20e03*I1),V+(10*I2*(5e03))], [I1,I2,V]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The currents I1 and I2 are expressed in Amperes and the voltage V is expressed in Volts.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 37,
+ "text": [
+ "{I1: 0.00180000000000000, I2: -0.000200000000000000, V: 10.0000000000000}"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.38,Page number: 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the loop currents.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KVL for the loops 1 and 2.\"\"\"\n",
+ "print \"The loop currents i1 and i2 are expressed in Amperes.\"\n",
+ "i1,i2 = symbols('i1 i2')\n",
+ "solve([(3*i2)-((i2-i1)*1)-(i2*2)-3,4-(i1*1)-((i1-i2)*1)-(3*i2)], [i1,i2]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The loop currents i1 and i2 are expressed in Amperes.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 16,
+ "text": [
+ "{i1: 3, i2: -1}"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.39,Page number: 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the nodal voltages.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Applying KCL at top node and solving for nodal voltages.\"\"\"\n",
+ "print \"All the voltages are expressed in Volts.\"\"\"\n",
+ "print \"The current I is in Amperes.\"\n",
+ "V1,V2,I = symbols('V1 V2 I')\n",
+ "solve([9-I-(V1/10)+(3*I),9-(4*V1/5)-(V1/10),V2-V1-108],[V1,V2,I])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "All the voltages are expressed in Volts.\n",
+ "The current I is in Amperes.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 40,
+ "text": [
+ "{I: -4, V1: 10, V2: 118}"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.40,Page number: 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current I by nodal analysis.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KCL at the nodes 1 and 2.\"\"\"\n",
+ "print \"The nodal voltages V1 and V2 are expressed in Volts.\"\n",
+ "print \"The current I is expressed in Amperes.\"\n",
+ "V1,V2,I = symbols('V1 V2 I')\n",
+ "solve([(2*V1)-(V2)-12,(-2*V1)+(4*V2)-6,I-((V1-V2)/3)], [V1,V2,I]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nodal voltages V1 and V2 are expressed in Volts.\n",
+ "The current I is expressed in Amperes.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 15,
+ "text": [
+ "{I: 1, V1: 9, V2: 6}"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.41,Page number: 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current I in the circuit.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KCL at the nodes 1 and 2.\"\"\"\n",
+ "print \"The nodal voltages V1 and V2 are expressed in Volts.\"\n",
+ "print \"The current I is expressed in Amperes.\"\n",
+ "V1,V2,I = symbols('V1 V2 I')\n",
+ "solve([(1*V1)-(0.5*V2)-6,(-0.5*V1)+(0.625*V2)-3,I-((V1-V2)/2)], [V1,V2,I]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nodal voltages V1 and V2 are expressed in Volts.\n",
+ "The current I is expressed in Amperes.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 14,
+ "text": [
+ "{I: -1.00000000000000, V1: 14.0000000000000, V2: 16.0000000000000}"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.42,Page number: 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current through resistor.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Apply KCL at the nodes 1,2. and 3\"\"\"\n",
+ "print \"The nodal voltages V1,V2 and V3 are expressed in Volts.\"\n",
+ "print \"The current I flowing through the 2 Ohms resistor is expressed in Amperes.\" \n",
+ "V1,V2,V3,I = symbols('V1 V2 V3 I')\n",
+ "solve([(7*V1)-(3*V2)-(4*V3)+11,(-3*V1)+(6*V2)-(2*V3)-3,(-4*V1)-(2*V2)+(11*V3)-25,I-(2*(V2-V3))], [V1,V2,V3,I]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nodal voltages V1,V2 and V3 are expressed in Volts.\n",
+ "The current I flowing through the 2 Ohms resistor is expressed in Amperes.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 12,
+ "text": [
+ "{I: -2, V1: 1, V2: 2, V3: 3}"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.43,Page number: 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the nodal voltages in the circuit.\"\"\"\n",
+ "\n",
+ "from sympy import *;\n",
+ "\n",
+ "#Calculations:\n",
+ "Ieq=13.0*5.0 #Equivalent current source\n",
+ "\"\"\"Apply KCL at the nodes 1 and 2.\"\"\"\n",
+ "print \"The nodal voltages V1 and V2 are expressed in Volts.\"\n",
+ "V1,V2 = symbols('V1 V2')\n",
+ "solve([(9*V1)-(5*V2)-10,(-5*V1)+(11*V2)-52], [V1,V2]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nodal voltages V1 and V2 are expressed in Volts.\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 11,
+ "text": [
+ "{V1: 5, V2: 7}"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter4.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter4.ipynb new file mode 100755 index 00000000..74af3cd5 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter4.ipynb @@ -0,0 +1,1114 @@ +{ + "metadata": { + "name": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4: NETWORK THEOREMS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1,Page number: 105" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the current I in the circuit using superposition theorem.\"\"\"\n", + "\n", + "#Calculations:\n", + "I1=-0.5*(0.3/(0.1+0.3))\n", + "I2=80e-03/(0.1+0.3)\n", + "I=I1+I2\n", + "\n", + "\n", + "#Result:\n", + "print \"The current I in the circuit is %.3f A.\" %(I)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current I in the circuit is -0.175 A.\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2,Page number: 106" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding current I_x in the network using superposition theorem.\"\"\"\n", + "\n", + "#Calculations:\n", + "I1=10.0/(50+150)\n", + "I2=40*(150.0/(50+150))\n", + "I3=-120*(50.0/(150+50))\n", + "Ix=I1+I2+I3\n", + "\n", + "\n", + "#Result:\n", + "print \"The current Ix determined using superposition principle is %.2f A.\" %(Ix)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current Ix determined using superposition principle is 0.05 A.\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3,Page number: 106" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the voltage across resistor by applying the principle of superposition.\"\"\"\n", + "\n", + "#Calculations:\n", + "i=4.0*(1.0/(1.0+(2+3)))\n", + "R=3.0\n", + "v_4=i*R\n", + "v_5=(-5*(1.0/(1+(2+3))))*R\n", + "v_6=6.0*(3.0/(1+2+3))\n", + "v=+v_4+v_5+v_6\n", + "\n", + "\n", + "#Result:\n", + "print \"The total voltage(v) across the 3 ohm resistor is %.2f V.\" %(v)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The total voltage(v) across the 3 ohm resistor is 2.50 V.\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4,Page number: 108 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the value of I_s to reduce the voltage across the 4-ohm resistor to zero. \"\"\"\n", + "\n", + "#Variable Declaration:\n", + "V_source=10.0 #Voltage of the source(in Volts) \n", + "\n", + "\n", + "#Calculations:\n", + "I1=V_source/(2+4+6)\n", + "\n", + "\"\"\" I2(from top to bottom in the 4 ohm resistor) = -Is*((2+6)/(2+6+4)) = -(2/3)*Is ;\n", + " \n", + " The voltage across the 4 ohm resistor can be zero,only if the current through this resistor is zero. \n", + " \n", + " I1+I2=0; \"\"\"\n", + "\n", + "Is=I1*(3.0/2)\n", + "\n", + "\n", + "#Result:\n", + "print \"The current Is to reduce the voltage across the 4 ohm resistor to zero is %.2f A.\" %(Is) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current Is to reduce the voltage across the 4 ohm resistor to zero is 1.25 A.\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5,Page number: 110" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question: \n", + "\"\"\"Finding the voltage across the load resistor using Thevenin's theorem.\"\"\"\n", + "\n", + "#Calculations:\n", + "I1=(50.0-10.0)/(10+10+20)\n", + "I2=1.5*(10.0/(10.0+(10+20)))\n", + "I=I1+I2\n", + "V_Th=I*20\n", + "R_Th=1.0/((1.0/20)+(1.0/(10+10)))\n", + "R_L=5.0\n", + "V_L=V_Th*(R_L/(R_L+R_Th))\n", + "\n", + "\n", + "#Result:\n", + "print \"The voltage across the load resistor R_L is %.2f V.\" %(V_L)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The voltage across the load resistor R_L is 9.17 V.\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6,Page number: 111" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the voltage across the resistor by applying Thevenin's theorem.\"\"\"\n", + "\n", + "#Calculations:\n", + "V_Th=5.0*1.0\n", + "R_Th=3.0\n", + "R_L=3.0\n", + "V_L=V_Th*(R_L/(R_L+R_Th))\n", + "\n", + "\n", + "#Result:\n", + "print \"The voltage across the resistor by applying Thevenin's Theorem is %.2f V.\" %(V_L)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The voltage across the resistor by applying Thevenin's Theorem is 2.50 V.\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7,Page number: 113" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding Norton's equivalent circuit with respect to terminals AB.\"\"\"\n", + "\n", + "#Calculations:\n", + "I1=10.0/5\n", + "I2=5.0/10\n", + "I_N=I1+I2\n", + "R_N=1.0/((1.0/5)+(1.0/10))\n", + "I_L=I_N*((10.0/3)/((10.0/3)+5))\n", + "\n", + "\n", + "#Result:\n", + "print \"When terminals AB are shorted, the current I_N is %.2f A.\" %(I_N)\n", + "print \"The value of current that would flow through a load resistor of 5 ohm if it were connected across terminals AB is %.2f A.\" %(I_L) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "When terminals AB are shorted, the current I_N is 2.50 A.\n", + "The value of current that would flow through a load resistor of 5 ohm if it were connected across terminals AB is 1.00 A.\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.8,Page number: 114 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the available power from the battery.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "Voc=12.6 #Open-circuit voltage(in Volts)\n", + "Isc=300.0 #Short-circuit voltage(in Volts)\n", + "\n", + "\n", + "#Calculations:\n", + "Ro=Voc/Isc\n", + "P_avl=(Voc*Voc)/(4*Ro)\n", + "\n", + "\n", + "#Result:\n", + "print \"The available power from the battery is %.2f W.\" %(P_avl)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The available power from the battery is 945.00 W.\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.9,Page number: 115 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the available power from the battery.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "no_of_cells=8 #Number of dry cells in the battery\n", + "emf=1.5 #EMF of each cell(in Volts)\n", + "int_res=0.75 #Internal resistanceof each cell(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "Voc=no_of_cells*emf\n", + "Ro=no_of_cells*int_res\n", + "P_avl=(Voc*Voc)/(4.0*Ro)\n", + "\n", + "\n", + "#Result:\n", + "print \"The available power from the battery is %.2f W.\" %(P_avl)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The available power from the battery is 6.00 W.\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.10,Page number: 115 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Plotting a curve showing the variation of the output power Po with the load resistance R_L.\"\"\"\n", + "\n", + "from math import sqrt\n", + "\n", + "#Variable Declaration:\n", + "P=25.0 #Power to be delivered to the speaker(in Watts)\n", + "Ro=8.0 #Resistance of the speaker(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "V_Th=sqrt(P*4*Ro)\n", + "Vo=V_Th/2.0\n", + "R_Th=Ro\n", + "R_L=0.0\n", + "P1=(V_Th*V_Th*R_L)/((R_Th+R_L)*(R_Th+R_L))\n", + "R_L=2.0\n", + "P2=(V_Th*V_Th*R_L)/((R_Th+R_L)*(R_Th+R_L))\n", + "R_L=4.0\n", + "P3=(V_Th*V_Th*R_L)/((R_Th+R_L)*(R_Th+R_L))\n", + "R_L=6.0\n", + "P4=(V_Th*V_Th*R_L)/((R_Th+R_L)*(R_Th+R_L))\n", + "R_L=8.0\n", + "P5=(V_Th*V_Th*R_L)/((R_Th+R_L)*(R_Th+R_L))\n", + "R_L=16.0\n", + "P6=(V_Th*V_Th*R_L)/((R_Th+R_L)*(R_Th+R_L))\n", + "R_L=32.0\n", + "P7=(V_Th*V_Th*R_L)/((R_Th+R_L)*(R_Th+R_L))\n", + "P8=0.0\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The voltage provided by this amplifier to to the speaker is %.2f V.\" %(Vo)\n", + "print \"(b)(i)If the load is a short circuit(R_L=0),the output voltage Vo would be zero and hence the output power,Po= Vo*I_L = 0*I_L =0.\"\n", + "print \" (ii) If the load is an open circuit(R_L=0),the load current I_L would be zero and hence the output power,Po= Vo*I_L = Vo*0 = 0.\"\n", + "print \"(c)(i) For R_L = 0 , Po = %.2f W. \\n (ii) For R_L = 2 Ohms, Po = %.2f W.\" %(P1,P2) \n", + "print \" (iii) For R_L = 4 Ohms, Po = %.2f W. \\n (iv) For R_L = 6 Ohms, Po = %.2f W.\" %(P3,P4) \n", + "print \" (v) For R_L = 8 Ohms, Po = %.2f W. \\n (vi) For R_L = 16 Ohms, Po = %.2f W.\" %(P5,P6) \n", + "print \" (vii) For R_L = 32 Ohms, Po = %.2f W. \\n (viii) For R_L = infinity, Po = %.2f W.\" %(P7,P8)\n", + "print \"Note: Po is the power delivered to the speaker (in Watts) and R_L is the speaker resistance(in Ohms).\" \n", + "\n", + "\n", + "from __future__ import division\n", + "from pylab import *\n", + "from matplotlib import *\n", + "import numpy as np\n", + "%pylab inline\n", + "\n", + "\n", + "#Variable declaration:\n", + "Rdata=[0.0, 2.0, 4.0, 6.0, 8.0, 16.0] #(in ohm)\n", + "Podata=[0, 16, 22.22, 24.49, 25, 22.22] #(in Watt)\n", + "\n", + "\n", + "#Calculations:\n", + "R=np.array(Rdata)\n", + "Po=np.array(Podata)\n", + "length=len(R)\n", + "Rmax=R[length-1]\n", + "a=polyfit(R,Po,4)\n", + "Rfit=[0]*100\n", + "Pofit=[0]*100\n", + "for n in range(1,100,1):\n", + " Rfit[n-1]=Rmax*(n-1)/100\n", + " Pofit[n-1]=a[0]*Rfit[n-1]**4+a[1]*Rfit[n-1]**3+a[2]*Rfit[n-1]**2+a[3]*Rfit[n-1]+a[4]\n", + "\n", + "#Plot the data and then the fit to compare (convert xfit to cm and Lfit to mH)\n", + "plot(Rdata,Podata,'o')\n", + "plot(np.array(Rfit),np.array(Pofit),'g.') \n", + "xlabel('R_L (in ohm) ')\n", + "ylabel('Po (in Watt) ')\n", + "title('Ouput power(Po) vs. Speaker Resistance(R_L)')\n", + "grid()\n", + "print \"\\n\\nThe required plot is shown below: \"\n", + "show()\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The voltage provided by this amplifier to to the speaker is 14.14 V.\n", + "(b)(i)If the load is a short circuit(R_L=0),the output voltage Vo would be zero and hence the output power,Po= Vo*I_L = 0*I_L =0.\n", + " (ii) If the load is an open circuit(R_L=0),the load current I_L would be zero and hence the output power,Po= Vo*I_L = Vo*0 = 0.\n", + "(c)(i) For R_L = 0 , Po = 0.00 W. \n", + " (ii) For R_L = 2 Ohms, Po = 16.00 W.\n", + " (iii) For R_L = 4 Ohms, Po = 22.22 W. \n", + " (iv) For R_L = 6 Ohms, Po = 24.49 W.\n", + " (v) For R_L = 8 Ohms, Po = 25.00 W. \n", + " (vi) For R_L = 16 Ohms, Po = 22.22 W.\n", + " (vii) For R_L = 32 Ohms, Po = 16.00 W. \n", + " (viii) For R_L = infinity, Po = 0.00 W.\n", + "Note: Po is the power delivered to the speaker (in Watts) and R_L is the speaker resistance(in Ohms).\n", + "Populating the interactive namespace from numpy and matplotlib\n", + "\n", + "\n", + "The required plot is shown below: " + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "stream": "stderr", + "text": [ + "WARNING: pylab import has clobbered these variables: ['streamplot', 'rc', 'tri', 'axes', 'legend', 'rc_context', 'figure', 'f', 'quiver', 'axis', 'linalg', 'draw_if_interactive', 'text', 'random', 'colors', 'stackplot', 'contour', 'colorbar', 'rcdefaults', 'table', 'power', 'info', 'fft', 'test']\n", + "`%pylab --no-import-all` prevents importing * from pylab and numpy\n" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEaCAYAAAAYOoCaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYVPX+B/D3oKAggwMIsioqpYIgKGnumJoKWZT7vpRk\nlkVZ1+61cmnxWhoumWlq1EUyrLypuC+4b10l9HZdMFCRlEVAVtk+vz/4cZqBGRiGM8w5w+f1PD6P\n58zM4T1nZs73nM/3nO9REBGBMcZYk2Nh6gCMMcZMgxsAxhhrorgBYIyxJoobAMYYa6K4AWCMsSaK\nGwDGGGuiuAFgovr73/+O1atXN2gZiYmJ6Nevn0iJpG/GjBl4//33TR1DbydOnECXLl1MHaNeNmzY\ngDfffNNoy5frd5YbAB2ioqLg7+8PpVIJV1dXzJ07F7m5uY3yt+W2QaiSkZGBf/3rX5gzZw4AID4+\nHhYWFlAqlWjVqhU6duyIL7/8ss7l+Pv7Q6VSYffu3caOrCElJQXPPPMM7OzsYGdnBx8fH3zzzTdG\n/7sKhQIKhcIoyw4ODoa1tTWUSiXs7OwwYsQIpKSkNGiZAwYMwNWrV+t83uLFizF16tQG/S0xlJSU\n4OOPP8bf/vY3AJWfs/r30s3NDf/4xz+gzyVRXl5eOHz4cI35pvrONhQ3AFqsXLkSCxcuxLp165CX\nl4eEhASkp6dj2LBhKC0tNXU8ySkrKwNQ2WiGhoaiRYsWwmPu7u7Iy8tDQUEBIiMjMW/ePCQkJNS5\nzMmTJ2PDhg1Gy6zNhAkT0LVrV9y/fx8PHz7E9u3b4eHh0Sh/W4zrMSsqKmrMUygUwvf4zp07ICK8\n/vrrDf5bcvLLL7+ga9eucHV11Zifm5uLgoIC7Nq1C2vWrMGOHTvqXFZtjbUpvrMNRkxDbm4u2dra\nUlxcnMb84uJi8vDwoC1bthAR0fTp0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79+8XHktLS8Mz\nzzyDjh07IiIiQphva2uLBQsWwN/fH8OGDcO5c+fw1FNPoV27dvj555+F540cORLbt29v0PtjrDpu\nAJjslZeX48CBAw0eq/3kyZPCiKRA5Z571d67QqGAi4sLzp8/j4iICKxYsaLG6yMjI2FnZ4f//ve/\n2LFjB2bMmIHi4mIQERISEhAbG4v//e9/2LFjB1JSUgBUDjU8dOhQJCYmQqlU4oMPPsDhw4exe/du\nfPDBB8Kye/XqhePHjzfo/TFWHTcATLaKiooQGBgIV1dX3LlzB3PmzGnQ8m7fvg0XFxedj1fdrKRH\njx4aw5ZXOXXqlHBXM29vbzz22GO4cuUKFAoFhgwZAhsbG7Ro0QK+vr7CjY6srKwwbNgwAJWjTgYH\nB0OhUKBbt24af8PV1VVoNBgTCzcATLasra1x6dIl3Lp1CzY2Nvjll18avMzaxkZs0aIFgMrO54qK\nCr1eX3UEUfXa6q+3tLQU5ltYWMDKykr4v/rfICLZ3TCJSR83AEz2rK2tsWrVKixcuLBBd2pq3749\n7t27Z/DrBwwYgB9++AFA5U1Ebty4gW7duoly96g///xTMvcgZuaDGwAmW+p7xAEBAfD29kZsbKzO\n51+7dg2enp7Cv6oO3ir9+/fHr7/+qtff1bY3HhERgdzcXPj6+iIsLAzffvstWrRoofP51d9D9Wn1\n/58/fx4DBw6sMxtj9cH3A2Ds/xERevTogXPnzgmlGKkIDg5GbGysJO9CxeSLjwAY+38KhQKzZ8+W\n3L1pExMT4e3tzRt/Jjo+AmBm5fLlyzVufN+yZUucOXPGRIkYky5uABhjrIniEhBjjDVR3AAwxlgT\nxQ0AY4w1UdwAMMZYE8UNAGOMNVH/B1z6XURJsXa0AAAAAElFTkSuQmCC\n", + "text": [ + "<matplotlib.figure.Figure at 0x43b9d10>" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.11,Page number: 115" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the current in branch B due to the voltage source of 36 V in branch A.\"\"\"\n", + "\n", + "\n", + "#Variable Declaration:\n", + "V_supply_a=36.0 #Supply voltage in the network shown in figure a(in Volts)\n", + "Req_a=2+ 1/((1.0/12)+(1.0/(3+1))) + 4 #Equivalent resistance of network shown in figure a(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "I_supply_a=V_supply_a/Req_a\n", + "I=I_supply_a*(12.0/(12+4))\n", + "V_supply_b=36.0\n", + "Req_b= 3+ 1.0/((1.0/12)+(1.0/(2+4))) + 1\n", + "I_supply_b=V_supply_b/Req_b\n", + "I_dash= I_supply_b*(12.0/(12+6))\n", + "R_tr=V_supply_a/I\n", + "\n", + "\n", + "#Result:\n", + "print \"The current I(in figure (a)) is %.2f A and the current I'(in branch A in figure (b)) is %.2f A.\" %(I,I_dash)\n", + "if(I==I_dash) : print \"As the two currents I and I' have the same value, the reciprocity theorem is established.\\n \"\n", + "else : print \"As the two currents I and I' have different values, the reciprocity theorem is not established.\\n \"\n", + "print \"The transfer resistance is %.2f Ohms.\" %(R_tr)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current I(in figure (a)) is 3.00 A and the current I'(in branch A in figure (b)) is 3.00 A.\n", + "As the two currents I and I' have the same value, the reciprocity theorem is established.\n", + " \n", + "The transfer resistance is 12.00 Ohms.\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.13,Page number: 119" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the current using Thevenin's theorem.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "R_L=20.0 #Load resistance(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "\"\"\" KVL equation for the loop bacdeb, V_Th+50-20+10=0.\"\"\"\n", + "V_Th=-50.0-10.0+20.0\n", + "\"\"\"Shorting all the voltage sources.\"\"\"\n", + "R_Th=0.0\n", + "I3=V_Th/(R_L+R_Th)\n", + "\n", + "\n", + "#Result:\n", + "print \"The current I3 in the circuit is %.2f A.\" %(I3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current I3 in the circuit is -2.00 A.\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.14,Page number: 120" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the current using Thevenin's theorem.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "R_L=1.0 #Load resistance(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "\"\"\" KVL equation for the loop bacdeb, V_Th+50-20+10=0.\"\"\"\n", + "V_Th=20.0-10.0-9.0\n", + "\"\"\"Shorting all the voltage sources.\"\"\"\n", + "R_Th=0.0\n", + "I2=V_Th/(R_L+R_Th)\n", + "\n", + "\n", + "#Result:\n", + "print \"The current I2 in the circuit is %.2f A.\" %(I2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current I2 in the circuit is 1.00 A.\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.15,Page number: 121" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the current using superposition theorem.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "R=0.5 #Load resistance(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "I=15.0/(1+0.6)\n", + "I1=I*(1/(1+(R+1)))\n", + "I2=20/((2/3.0)+2)\n", + "I1_20=I2*(2.0/(2.0+(R+R)))\n", + "Inet=I1-I1_20\n", + "\n", + "\n", + "#Result:\n", + "print \"The current flowing through R from A to B is %.2f A.\" %(Inet) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current flowing through R from A to B is -1.25 A.\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.16,Page number: 121" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the voltage across the resistance using Thevenin's theorem.\"\"\"\n", + "\n", + "#Calculations:\n", + "\"\"\"The first step is to remove the 5 Ohms resistance.Then, find the open-circuit voltage Voc across AB. \n", + " Using nodal analysis,for node C we can write ((Voc-20)/2)+((Voc+10)/1)+((Voc-12)/4)=10.\"\"\"\n", + "Voc=(10+3)/(0.5+1+0.25)\n", + "V_Th=Voc\n", + "R_Th=1.0/((1.0/2.0)+(1.0)+(1/4.0))\n", + "V_AB=V_Th*(5.0/(5.0+R_Th))\n", + "\n", + "\n", + "#Result:\n", + "print \"The voltage across the 5 Ohms resistance is %.2f V.\" %(V_AB)\n", + "print \"Note:There is a calculation error in the textbook.Voc=7.43 V but not 1.74 V. Therefore V_AB=6.67 V.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The voltage across the 5 Ohms resistance is 6.67 V.\n", + "Note:There is a calculation error in the textbook.Voc=7.43 V but not 1.74 V. Therefore V_AB=6.67 V.\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.17,Page number: 122" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the current using Norton's theorem.\"\"\"\n", + "\n", + "#Calculations:\n", + "Isc=20.0/10.0\n", + "I_N=Isc\n", + "R_N=1.0/((1.0/10)+(1.0/10))\n", + "I=I_N*(R_N/(R_N+2.0))\n", + "\n", + "\n", + "#Result:\n", + "print \"The current through the 2 Ohms resistance when connected across terminals AB is %.2f A.\" %(I)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current through the 2 Ohms resistance when connected across terminals AB is 1.43 A.\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.18,Page number: 123" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finfing the power consumed by resistor using Norton's theorem.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "R_L=2.0 #Resistance of load(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "\"\"\"To determine I_N,short circuit the terminals xy and find the current Isc throgh this short circuit.\n", + "\n", + " Applying node-voltage analysis to determine the voltage at node 1,\n", + " \n", + " ((V1-12)/3)+(V1/2)=4;\"\"\"\n", + "\n", + "V1=(4.0+(12.0/3.0))/((1.0/3.0)+0.5)\n", + "Isc=V1/2.0\n", + "I_N=Isc\n", + "R_N=1.0/((1.0/(3.0+2.0))+(1.0/5.0))\n", + "I=I_N*(R_N/(R_N+R_L))\n", + "P=I*I*R_L\n", + "\n", + "\n", + "#Result:\n", + "print \"The power consumed by the 2 Ohms load reistor is %.3f W.\" %(P)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The power consumed by the 2 Ohms load reistor is 14.222 W.\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.19,Page number: 124" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the voltage across load.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "R_L=5.0 #Load resistance(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "R_N=1.0/((1.0/20.0)+(1.0/(10.0+10.0)))\n", + "I_N=(65.0-10.0)/(10.0+10.0)\n", + "I_L=I_N*(R_N/(R_N+R_L))\n", + "V_L=I_L*R_L\n", + "\n", + "\n", + "#Result:\n", + "print \"The voltage across the load using Norton's theorem is %.2f V.\" %(V_L)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The voltage across the load using Norton's theorem is 9.17 V.\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.20,Page number: 125 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the reading of voltmeter.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "R=500e03 #Resistance across which voltmeter is connected(in Ohms)\n", + "Rm=10e06 #Internal resistance of voltmeter(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "V_a=10.0*(R/(R+800e03))\n", + "R_Th=1.0/((1/R)+(1/800e03))\n", + "V_Th=V_a\n", + "V_b=V_Th*(Rm/(Rm+R_Th))\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The reading of the voltmeter if it assumed to be ideal is %.2f V.\" %(V_a)\n", + "print \"(b)The reading of the voltmeter if it has an internal resistance of 10 M Ohms is %.2f V.\" %(V_b)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The reading of the voltmeter if it assumed to be ideal is 3.85 V.\n", + "(b)The reading of the voltmeter if it has an internal resistance of 10 M Ohms is 3.73 V.\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.21,Page number: 125" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the load resistance for receiving maximum power.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "R_L=3e03 #Load resistance(in Ohms)\n", + "\n", + "\n", + "#Calculations:\n", + "\"\"\"First, we remove R_L and then find Voc=V_Th. We transform the 5-mA current source into voltage source.\"\"\"\n", + "Voc=(60.0-40.0)*((6e03)/((6e03)+(12e03+18e03)))\n", + "V_Th=Voc\n", + "R_Th=1.0/((1.0/6e03)+(1.0/(12e03+18e03)))\n", + "Vab_b=V_Th*(R_L/(R_L+R_Th))\n", + "R_L_c=R_Th\n", + "\"\"\" The current required through 6 kilo Ohms resistor is 0.1 mA.\"\"\"\n", + "Vab_d=(0.1e-03)*(6e03)\n", + "V_30k=20-Vab_d\n", + "I_30k=V_30k/(30e03)\n", + "I_L=I_30k-(0.1e-03)\n", + "R_L_d=Vab_d/I_L\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The Thevenin's equivalent voltage is %.2f V and the Thevenin's resistance is %.2f kilo Ohms.\" %(V_Th,(R_Th/1000.0))\n", + "print \"(b)The Vab for R_L=3 kilo Ohms is %.3f V.\" %(Vab_b)\n", + "print \"(c)The value of R_L which receives maximum power from the circuit is %.2f kilo Ohms.\" %(R_L_c/1000.0)\n", + "print \"(d)The value of R_L which makes the current in the 6 kilo Ohms resistor to be 0.1 mA is %.3f kilo Ohms.\" %(R_L_d/1000.0) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The Thevenin's equivalent voltage is 3.33 V and the Thevenin's resistance is 5.00 kilo Ohms.\n", + "(b)The Vab for R_L=3 kilo Ohms is 1.250 V.\n", + "(c)The value of R_L which receives maximum power from the circuit is 5.00 kilo Ohms.\n", + "(d)The value of R_L which makes the current in the 6 kilo Ohms resistor to be 0.1 mA is 1.098 kilo Ohms.\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.22,Page number: 127" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the value of resistance.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "V=12.0 #Supply voltage(in Volts)\n", + "\n", + "\n", + "#Calculations:\n", + "\"\"\" To receive maximum power,the resistance R should be equal to the output resistance of the remaining circuit,which is same as \n", + " Thevenin's resistance.\"\"\"\n", + "R_Th=1.0/((1.0/2.0)+(1.0/6.0))\n", + "R=R_Th\n", + "\"\"\" Mesh equations to find loop currents I1 and I2, \n", + " \n", + " (8*I1)-(6*I2)=4 and -(6*I1)+(7.5*I2)=8. Solving these equations, we get I1=3.25 A. \"\"\"\n", + "I1=((4*7.5)+(8*6))/((8*7.5)-(6*6))\n", + "P=V*I1\n", + "\n", + "\n", + "#Result:\n", + "print \"(a)The value of R to receive maximum power from the circuit is %.2f Ohms.\" %(R)\n", + "print \"(b)The power supplied by the 12 V source is %.2f W.\" %(P) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The value of R to receive maximum power from the circuit is 1.50 Ohms.\n", + "(b)The power supplied by the 12 V source is 39.00 W.\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.23,Page number: 127" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the current Is.\"\"\"\n", + "\n", + "#Calculations:\n", + "I1=12.0/(80.0+120)\n", + "\"\"\" I2=Is*(80/(80+120)); I1+I2=0;\"\"\"\n", + "Is=-I1/(80.0/(80+120))\n", + "\n", + "\n", + "#Result:\n", + "print \"The current Is such that the current through 120 Ohms resistor is zero is %.2f A.\" %(Is)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current Is such that the current through 120 Ohms resistor is zero is -0.15 A.\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.24,Page number: 128" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Question:\n", + "\"\"\"Finding the Thevenin equivalent circuit.\"\"\"\n", + "\n", + "#Variable Declaration:\n", + "Vs=12.0 #Supply voltage(in Volts)\n", + "\n", + "\n", + "#Calculations:\n", + "\"\"\"The circuit has no independent source.So,the current I in the 12 Ohms resistor will be zero and hence the dependent voltage source\n", + " (8*I) will also be zero. Obviously,Thevenin's voltage V_Th=0 V. \"\"\"\n", + "V_Th=0.0\n", + "I=12.0/12.0\n", + "V=8*I\n", + "\"\"\"Applying KCL to node a,\"\"\"\n", + "Is=(12.0/12.0)+(12.0/6.0)+((12.0-8.0)/4.0)\n", + "R_Th=Vs/Is\n", + "\n", + "\n", + "#Result:\n", + "print \"The Thevenin's equivalent resistance is %.2f Ohms and the Thevenin's equivalent voltage is %.2f V.\" %(R_Th,V_Th)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Thevenin's equivalent resistance is 3.00 Ohms and the Thevenin's equivalent voltage is 0.00 V.\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter5.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter5.ipynb new file mode 100755 index 00000000..3a8210b4 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter5.ipynb @@ -0,0 +1,841 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: ELECTROMAGNETISM"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1,Page number: 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current necessary to produce a magnetic field inside the solenoid.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "B=20e-03 #Magnitude of magnetic field inside the solenoid(in Tesla)\n",
+ "n=20e02 #Number of turns per cm in the long solenoid\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "abs_per=(4*pi)*(1e-07)\n",
+ "I=B/(abs_per*n)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The required current is %.2f A.\" %(I) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required current is 7.96 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2,Page number: 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the magnetic field near the centre and the ends of a solenoid.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "abs_per=4*pi*(1e-07) #Absolute permeability of free space(in Henry per metre)\n",
+ "I=6.0 #Current carried by the solenoid(in Amperes)\n",
+ "l=50e-02 #Length of solenoid(in metres)\n",
+ "r=1.4e-02 #Radius of the lowest layer(in metres)\n",
+ "turns_per_layer=350 #Number of turns per layer\n",
+ "number_of_layers=4 #Number of layers\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "n=(turns_per_layer*number_of_layers)/l\n",
+ "B_centre=abs_per*n*I\n",
+ "B_end=(abs_per*n*I)/2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The magnetic field inside the solenois is quite uniform,its strength near the centre on its axis and\" \n",
+ "print \" off its axis is the same and its magnitude is %e T.\" %(B_centre)\n",
+ "print \"(b)The magnetic field strength at the end of the solenoid is %e T.\" %(B_end)\n",
+ "print \"(c)The magnetic field far outside the solenoid near its axis is negligible,compared to the internal field.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The magnetic field inside the solenois is quite uniform,its strength near the centre on its axis and\n",
+ " off its axis is the same and its magnitude is 2.111150e-02 T.\n",
+ "(b)The magnetic field strength at the end of the solenoid is 1.055575e-02 T.\n",
+ "(c)The magnetic field far outside the solenoid near its axis is negligible,compared to the internal field.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3,Page number: 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the force between two long straight parallel wires.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "r=2 #Distance between the parallel current carrying wires(in metres) \n",
+ "abs_per=(4*pi)*(1e-07) #Absolute permeability of free space(in Henry per metre)\n",
+ "I1=80 #Current in the first wire(in Amperes)\n",
+ "I2=30 #Current in the second wire(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "F=(abs_per*I1*I2)/(2*pi*r)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The magnitude of the force between the two wires is %e N/m.\" %(F)\n",
+ "print \"Since the two currents are in the same direction,the force will be attractive.\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnitude of the force between the two wires is 2.400000e-04 N/m.\n",
+ "Since the two currents are in the same direction,the force will be attractive.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4,Page number: 148 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the force due to current flowing in two straight,parallel wires.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I1=4.0 #Current in the first wire(in Amperes)\n",
+ "I2=6.0 #Current in the second wire(in Amperes)\n",
+ "r=3e-02 #Distance between the parallel current carrying wires(in metres) \n",
+ "abs_per=(4*pi)*(1e-07) #Absolute permeability of free space(in Henry per metre)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "F=(abs_per*I1*I2)/(2*pi*r)\n",
+ "l=15e-02\n",
+ "F_net=F*l\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The net force on 15cm(=0.15 m) section of wire B near its centre is %e N.\" %(F_net)\n",
+ "print \"Since the currents are in opposite directions,the force F_net is repulsive.\"\n",
+ "print \"It means that its direction is normal to wire A away from it.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The net force on 15cm(=0.15 m) section of wire B near its centre is 2.400000e-05 N.\n",
+ "Since the currents are in opposite directions,the force F_net is repulsive.\n",
+ "It means that its direction is normal to wire A away from it.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5,Page number: 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the emf produced in a conductor placed in an uniform magnetic field.\"\"\"\n",
+ "\n",
+ "from math import sin,radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "B=0.5 #Magnitude of magnetic field(in Tesla)\n",
+ "l=20e-02 #Active length of the conductor(in metres) \n",
+ "v=5 #Velocity of the conductor(in metres per second)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "angle_a=0\n",
+ "e_a=B*l*v*sin(radians(angle_a))\n",
+ "angle_b=90\n",
+ "e_b=B*l*v*sin(radians(angle_b))\n",
+ "angle_c=30\n",
+ "e_c=B*l*v*sin(radians(angle_c))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The emf induced in the straight conductor when its motion is parallel to the magnetic field is %.2f V.\" %(e_a)\n",
+ "print \"(b)The emf induced in the straight conductor when its motion is perpendicular to the magnetic field is %.2f V.\" %(e_b)\n",
+ "print \"(c)The emf induced in the straight conductor when its motion is at an angle 30 degrees to the magnetic field is %.2f V.\" %(e_c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The emf induced in the straight conductor when its motion is parallel to the magnetic field is 0.00 V.\n",
+ "(b)The emf induced in the straight conductor when its motion is perpendicular to the magnetic field is 0.50 V.\n",
+ "(c)The emf induced in the straight conductor when its motion is at an angle 30 degrees to the magnetic field is 0.25 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6,Page number: 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the emf generated between the wing-tips of an aeroplane.\"\"\"\n",
+ "\n",
+ "from math import sin,radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "l=52 #Wing span of the aeroplane(in metres)\n",
+ "B=38e-06 #Magnitude of magnetic field(in Tesla)\n",
+ "v=1100.0*(1000.0/3600.0) #Velocity of the aeroplane(in metres per second)\n",
+ "angle=90 #Angle between the magnetic field vector and the velocity vector(in degrees) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "e=B*l*v*sin(radians(angle))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The emf generated between the wing tips is %.5f V.\" %(e)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The emf generated between the wing tips is 0.60378 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7,Page number: 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the emf developed between the centre and the metallic ring.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "\"\"\" A=(1/2)*R*R*theta; where theta is the angle between the rod and the rod OP(in figure) at time t \"\"\"\n",
+ "B=1.0 #Magnitude of magnetic field(in Tesla)\n",
+ "R=1 #Radius of circular ring(in metres)\n",
+ "f=50 #Frequency of rotation(in revolutions per second) \n",
+ "\n",
+ "\"\"\" B=d(flux)/dt= d(B*A)/dt= (1/2)*B*R*R*d(theta)/dt= (1/2)*B*R*R*ang_freq \"\"\"\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "ang_freq=2*pi*f\n",
+ "e=(1.0/2)*B*R*R*ang_freq\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The emf developed between the centre and the metallic ring is %.2f V.\" %(e)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The emf developed between the centre and the metallic ring is 157.08 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8,Page number: 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the force needed to pull a rectangular loop placed in an uniform magnetic field.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "B=0.5 #Magnitude of magnetic field(in Tesla)\n",
+ "w=3e-02 #Width of the rectangular loop(in metres)\n",
+ "l=10e-02 #Length of the rectangular loop(in metres)\n",
+ "v=1e-02 #Velocity of the rectangular loop(in metre per second)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "e1=B*w*v\n",
+ "t1=l/v\n",
+ "e2=B*l*v\n",
+ "t2=w/v\n",
+ "R=1e-03\n",
+ "F_a=(pow((B*w),2)*v)/R\n",
+ "F_b=(pow((B*l),2)*v)/R\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The induced emf is %e V and the time for which the induced voltage lasts is %.2f secs.\" %(e1,t1)\n",
+ "print \"(b)The induced emf is %e V and the time for which the induced voltage lasts is %.2f secs.\" %(e2,t2)\n",
+ "print \"(c)Because of the gap,no current can flow.Hence there is no heat produced(or no I*I*R losses).\"\n",
+ "print \" If we neglect friction,no force is required to pull the coil.\"\n",
+ "print \"(d)The force required to pull the loop if it has no cut and has a resistance of 1 mill ohm is :\"\n",
+ "print \" For fig (a): F=%e N.\" %(F_a)\n",
+ "print \" For fig (b): F=%e N.\" %(F_b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The induced emf is 1.500000e-04 V and the time for which the induced voltage lasts is 10.00 secs.\n",
+ "(b)The induced emf is 5.000000e-04 V and the time for which the induced voltage lasts is 3.00 secs.\n",
+ "(c)Because of the gap,no current can flow.Hence there is no heat produced(or no I*I*R losses).\n",
+ " If we neglect friction,no force is required to pull the coil.\n",
+ "(d)The force required to pull the loop if it has no cut and has a resistance of 1 mill ohm is :\n",
+ " For fig (a): F=2.250000e-03 N.\n",
+ " For fig (b): F=2.500000e-02 N.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.9,Page number: 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the magnetic field due to a line caryying current.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I=90.0 #Current flowing through the line(in Amperes)\n",
+ "x=1.5 #Distance of point of observation from the line(in metres)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "abs_per=(4*pi)/(1e07)\n",
+ "B=(abs_per*I)/(2*pi*x)\n",
+ " \n",
+ "\n",
+ "#Result:\n",
+ "print \"The magnetic field due to the current at a point 1.5 m below the line is %e T.\" %(B)\n",
+ "print \"By applying the right-hand thumb rule,we find that the direction of the magnetic field is from north to south.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnetic field due to the current at a point 1.5 m below the line is 1.200000e-05 T.\n",
+ "By applying the right-hand thumb rule,we find that the direction of the magnetic field is from north to south.\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.10,Page number: 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the force per unit length on a current carrying wire.\"\"\"\n",
+ "\n",
+ "from math import sin,radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I=8.0 #Current flowing through the wire(in Amperes)\n",
+ "B=0.15 #Magnitude of uniform magnetic field(in Tesla)\n",
+ "angle=30 #Angle between the direction of current and the uniform magnetic field(in degrees)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Fu=I*B*sin(radians(angle))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The force per unit length of the wire is %.2f N/m.\" %(Fu)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The force per unit length of the wire is 0.60 N/m.\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.11,Page number: 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the torque experienced by a square coil.\"\"\"\n",
+ "\n",
+ "from math import sin,radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I=12.0 #Current flowing through the square coil(in Amperes)\n",
+ "N=20.0 #Number of turns in the square coil\n",
+ "l=10e-02 #Length of each side of the square coil(in metres)\n",
+ "B=0.8 #Magnitude of uniform horizontal magnetic field(in Tesla)\n",
+ "angle=30.0 #Angle made by normal to the plane of the coil with the direction of horizontal magnetic field(in degrees)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "F=I*B*l*N\n",
+ "x=l*sin(radians(angle))\n",
+ "T=F*x\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The torque experienced by the coil is %.3f Nm.\" %(T)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The torque experienced by the coil is 0.960 Nm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.12,Page number: 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the net force on a rectangular loop.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I1=15.0 #Current carried by the rectangular loop(in Amperes)\n",
+ "I2=25.0 #Current carried by the straight conductor(in Amperes)\n",
+ "l=25e-02 #Length of the rectangular loop(in metres)\n",
+ "w=10e-02 #Width of the rectangular loop(in metres)\n",
+ "r=2e-02 #Separation between the nearer side of the loop and the conductor(in metres)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "abs_per=(4*pi)/(1e07)\n",
+ "\"\"\"Parts AD and BC do not experience any force,since these conductors are at right angles to the long straight conductor.\n",
+ " \n",
+ " The current I1 in AB and the current I2 in the straight conductor are in the same direction.\n",
+ " Hence,the force F_AB is attractive.\"\"\"\n",
+ "\n",
+ "F_AB=((abs_per*I1*I2)/(2*pi*r))*l\n",
+ "\n",
+ "\"\"\" The current I1 in CD and the current I2 in the straight conductor are in opposite directions.\n",
+ " Hence,the force F_CD is repulsive.\"\"\"\n",
+ "\n",
+ "F_CD=((abs_per*I1*I2)/(2*pi*(r+w)))*l\n",
+ "F_net=F_AB-F_CD\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The net force on the rectangular loop is %.5f mN.\" %(F_net*1000.0) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The net force on the rectangular loop is 0.78125 mN.\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.13,Page number: 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the location of a point where the resultant magnetic field is zero.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I=10.0 #Current flowing through the wire(in Amperes)\n",
+ "B=2.0e-03 #Horizontal component of Earth's magnetic field(in Tesla)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" To make the resultant magnetic field zero,the magnetic filed produced by the long vertical wire must be equal and opposite \n",
+ " to the horizontal component of Earth's magnetic field.This is possible at a point P,west of the wire. \"\"\"\n",
+ "\n",
+ "abs_per=(4*pi)/(1e07)\n",
+ "x=(abs_per*I)/(2*pi*B)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The distance between the required point from the wire is %e m,to the west of the wire.\" %(x)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The distance between the required point from the wire is 1.000000e-03 m,to the west of the wire.\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.14,Page number: 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the force per unit length between two current carrying wires.\"\"\"\n",
+ "\n",
+ "from math import pi \n",
+ "\n",
+ "#Variable Declaration:\n",
+ "I=300.0 #Current flowing through each wire(in Amperes)\n",
+ "r=1.5e-02 #Separation between the wires(in metres)\n",
+ "l=70e-02 #Length of each wire(in metres)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "abs_per=(4*pi)/(1e07)\n",
+ "\"\"\"Since the length of the wires is 70 cm and their separation is only 1.5 cm(i.e, l>>r),\n",
+ " we can conclude that for the given separation the two wires are infinitely long. \"\"\"\n",
+ "F=(abs_per*I*I)/(2*pi*r)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The force per unit length between the two wires is %.2f N/m.\" %(F)\n",
+ "print \"Since the currents in the two wires are in the opposite directions,the force between them will be repulsive.\"\"\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The force per unit length between the two wires is 1.20 N/m.\n",
+ "Since the currents in the two wires are in the opposite directions,the force between them will be repulsive.\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.15,Page number: 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the counter torque to prevent a coil from turning.\"\"\"\n",
+ "\n",
+ "from math import pi,sin,radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N=30.0 #Number of turns in the circular coil\n",
+ "r=8e-02 #Radius of circular coil(in metres)\n",
+ "I=6.0 #Current flowing through the circular coil(in Amperes)\n",
+ "B=1.0 #Magnitude of uniform magnetic field(in Tesla)\n",
+ "angle=60 #Angle made by the field lines with the normal to the coil(in degrees)\n",
+ "\n",
+ " \n",
+ "#Calculations:\n",
+ "\"\"\"The counter torque required to prevent the coil from moving must be equal(and opposite) to the torque developed.\"\"\"\n",
+ "A=pi*r*r\n",
+ "tor=B*I*N*A*sin(radians(angle))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The counter torque that must be applied to prevent the coil from turning is %.2f Nm.\" %(tor) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The counter torque that must be applied to prevent the coil from turning is 3.13 Nm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.16,Page number: 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the maximum voltage induced in a coil.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "A=300e-04 #Area of circular coil(in square-m)\n",
+ "N=25.0 #Number of turns in the circular coil\n",
+ "w=40.0 #Angluar frequency(in radians per second)\n",
+ "B=0.05 #Magnitude of uniform magnetic field(in Tesla)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Em=N*B*A*w\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The maximum value of emf induced in the coil is %.2f V.\" %(Em)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum value of emf induced in the coil is 1.50 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.17,Page number: 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the induces emf in a circular conducting loop.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "B=0.02 #Magnitude of uniform magnetic field(in Tesla)\n",
+ "r=2e-02 #Radius of the circular loop(in metres)\n",
+ "rate=1.0e-03 #Rate of shrinking of the radius(in metre per second)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" flux=B*A; A=(pi*r*r);\n",
+ " e=d(flux)/dt; \n",
+ " \n",
+ " e=(B*pi*2*r)*(dr/dt); \"\"\"\n",
+ "\n",
+ "e=B*pi*2*r*rate\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The emf induced in the loop at an instant when the radius is 2 cm is %e V.\" %(e) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The emf induced in the loop at an instant when the radius is 2 cm is 2.513274e-06 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter6.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter6.ipynb new file mode 100755 index 00000000..fde4f296 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter6.ipynb @@ -0,0 +1,627 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: MAGNETIC CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1,Page number: 167\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the magnetic field strength and total flux passing through a coil.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N=200 #Number of turns in the coil \n",
+ "l=0.60 #Length(Circumference) of the wooden ring(in metres)\n",
+ "A=500e-06 #Cross-sectional area of the ring(in square-metres)\n",
+ "I=4 #Current through the coil(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "H=(N*I)/l\n",
+ "rel_per=1\n",
+ "per=(4*pi)*(1e-07)\n",
+ "B=per*rel_per*H\n",
+ "flux=B*A\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The magnetic field strength is %.2f A/m.\" %(H)\n",
+ "print \"(b)The flux density is %.2f micro T.\" %(B*1000000)\n",
+ "print \"(c)The total flux is %.5f micro Wb.\" %(flux*1000000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The magnetic field strength is 1333.33 A/m.\n",
+ "(b)The flux density is 1675.52 micro T.\n",
+ "(c)The total flux is 0.83776 micro Wb.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2,Page number: 168\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the magnetomotive force(mmf) required to produce flux.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "flux=0.015 #Flux across the air-gap(in Webers)\n",
+ "l=2.5e-03 #Length of the air-fap(in metres)\n",
+ "A=200e-04 #Effective area of the air-gap(in square-metres)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "B=flux/A\n",
+ "abs_per=(4*pi)*(1e-07)\n",
+ "H=B/abs_per\n",
+ "mmf=H*l\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The magneto motive force(mmf) required is %.2f At.\" %(mmf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magneto motive force(mmf) required is 1492.08 At.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3,Page number: 168\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the reluctance of a mild-steel ring.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N=200 #Number of turns in the coil\n",
+ "abs_per=(4*pi)*(1e-07) #Absolute permeability of free space \n",
+ "rel_per=380 #Relative permeability of mild-steel\n",
+ "l=400e-03 #Length(Circumference) of the mild-steel ring(in metres)\n",
+ "A=500e-06 #Cross-sectional area of the mild-steel ring(in square-metres)\n",
+ "flux=800e-06 #Flux in the ring(in Webers) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Rel=l/(abs_per*rel_per*A)\n",
+ "mmf=flux*Rel\n",
+ "I=mmf/N\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The reluctance of the ring is %6e A/Wb.\" %(Rel)\n",
+ "print \"(b)The magnetising current is %.2f A.\" %(I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The reluctance of the ring is 1.675315e+06 A/Wb.\n",
+ "(b)The magnetising current is 6.70 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4,Page number: 171\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current in the coil to produce a flux density of 0.9 T in the air gap.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "B=0.90 #Flux Density in the air gap(in Tesla) \n",
+ "N=4000 #Number of turns in the core\n",
+ "l_core=220e-03 #Length of the core(in metres)\n",
+ "A_core=50e-06 #Cross-sectional area of the core(in square-metres)\n",
+ "H_core=820 #Magnetic field intensity of the core(in Ampere per metre) \n",
+ "l_gap=1e-03 #Length of the air-gap(in metres)\n",
+ "A_gap=50e-06 #Cross-sectional area of the air gap(in square-metres)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "mmf_core=H_core*l_core\n",
+ "abs_per=(4*pi*(1e-07))\n",
+ "H_gap=B/abs_per\n",
+ "mmf_air_gap=H_gap*l_gap\n",
+ "Total_mmf=mmf_core+mmf_air_gap\n",
+ "I=Total_mmf/N\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The magnetisation current is %.5f A.\" %(I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnetisation current is 0.22415 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5,Page number: 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the magnetising current required to produce a flux across the air gap.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "w=40e-03 #Width of the core(in metres)\n",
+ "d=50e-03 #Depth of the core(in metres)\n",
+ "lg=2.0e-03 #Length of the air gap(in metres)\n",
+ "Ag=2500e-06 #Area of the air gap(in square metres)\n",
+ "N=800 #Number of turns in the coil\n",
+ "flux=2.50e-03 #Flux across the air gap(in Webers)\n",
+ "lf=1.2 #Leakage Factor\n",
+ "abs_per=(4*pi)*(1e-07) #Absolute permeability of free space(Henry per metre) \n",
+ "lc=600e-03 #Length of the core(in metres)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Ac=w*d\n",
+ "Bg=flux/Ag\n",
+ "Hg=Bg/abs_per\n",
+ "mmf_g=Hg*lg\n",
+ "eff_Ac=0.92*Ac\n",
+ "flux_c=flux*lf\n",
+ "Bc=flux_c/eff_Ac\n",
+ "Hc=4000.0\n",
+ "mmf_c=Hc*lc\n",
+ "mmf=mmf_c+mmf_g\n",
+ "I=mmf/N\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The magnetising current required to produce a flux of 0.0025 Wb across the air gap is %.2f A.\" %(I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnetising current required to produce a flux of 0.0025 Wb across the air gap is 4.99 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6,Page number: 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current in the coil.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "lA=0.3 #Length of silicon steel material(in metres)\n",
+ "lB=0.2 #Length of low-carbon mild steel material(in metres)\n",
+ "lC=0.1 #Length of cast iron material(in metres)\n",
+ "N=100 #Number of turns in the exciting coil\n",
+ "A=0.001 #Cross-sectional area(in square-metres)\n",
+ "flux=600e-06 #Flux in the coil(in Webers)\n",
+ "abs_per=(4*pi)*(1e-07)#Absolute permeability of free space(in Henry per metre)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "B=flux/A\n",
+ "B_A=B\n",
+ "B_C=B\n",
+ "B_C=B\n",
+ "\"\"\"From magnetisation characteristics of ferromagnetic materials,\"\"\"\n",
+ "H_A=20.0\n",
+ "H_B=700.0\n",
+ "H_C=2500.0\n",
+ "\"\"\"According to Kirchoff's magnetomotive force law(KML),the total mmf required, tot_mmf= mmf_A+mmf_B+mmf_C.\"\"\"\n",
+ "tot_mmf=(H_A*lA)+(H_B*lB)+(H_C*lC)\n",
+ "I=tot_mmf/N\n",
+ "rel_A=B/(abs_per*H_A)\n",
+ "rel_B=B/(abs_per*H_B)\n",
+ "rel_C=B/(abs_per*H_C)\n",
+ "R_A=(H_A*lA)/flux\n",
+ "R_B=(H_B*lB)/flux\n",
+ "R_C=(H_C*lC)/flux\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The mmf for setting up a flux of 600 micro Weber is %.2f At.\" %(tot_mmf)\n",
+ "print \"(b)The current in the coil is %.2f A.\" %(I)\n",
+ "print \"(c)The relative permeability of:\\n Material A: %.2f\\n Material B: %.2f\\n Material C: %.2f.\\n\" %(rel_A,rel_B,rel_C)\n",
+ "print \" The reluctances are :\\n R_A=%.2f At/Wb \\n R_B=%.2f At/Wb \\n R_C=%.2f At/Wb.\" %(R_A,R_B,R_C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The mmf for setting up a flux of 600 micro Weber is 396.00 At.\n",
+ "(b)The current in the coil is 3.96 A.\n",
+ "(c)The relative permeability of:\n",
+ " Material A: 23873.24\n",
+ " Material B: 682.09\n",
+ " Material C: 190.99.\n",
+ "\n",
+ " The reluctances are :\n",
+ " R_A=10000.00 At/Wb \n",
+ " R_B=233333.33 At/Wb \n",
+ " R_C=416666.67 At/Wb.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.7,Page number: 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current in the exciting coil.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N=300 #Number of the turns in the exciting coil\n",
+ "flux=600e-06 #Flux in the air gap(in Webers)\n",
+ "lg=1e-03 #Length of the air gap(in metres)\n",
+ "lc=40e-02 #Mean length of the core(in metres)\n",
+ "A=4e-04 #Cross sectional area of the core(in square metres)\n",
+ "abs_per=(4*pi)*1e-07 #Absolute permeability of free space(in Henry per metre)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "B=flux/A\n",
+ "Hg=B/abs_per\n",
+ "mmf_g=Hg*lg\n",
+ "mmf_c=3000*lc\n",
+ "mmf=mmf_g+mmf_c\n",
+ "I=mmf/N\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current in the exciting coil to set up a flux of 600 micro Weber in the air gap is %.2f A.\" %(I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current in the exciting coil to set up a flux of 600 micro Weber in the air gap is 7.98 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.8,Page number: 175 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current in the exciting coil.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "l1=10e-02 #Length of first side of the magnetic circuit(in metres)\n",
+ "l2=18e-02 #Length of second side of the magnetic circuit(in metres)\n",
+ "l3=18e-02 #Length of third side of the magnetic circuit(in metres)\n",
+ "A1=6.25e-04 #Cross sectional area of l1 path(in square-metre) \n",
+ "A2=3.00e-04 #Cross sectional area of l2 path(in square-metre)\n",
+ "A3=3.00e-04 #Cross sectional area of l3 path(in square-metre)\n",
+ "lg=2e-03 #Length of air gap(in metres)\n",
+ "rel_per=800.0 #Relative permeability of core material\n",
+ "N=600 #Number of turns\n",
+ "flux=100e-06 #Flux in the air gap(in Webers)\n",
+ "abs_per=(4*pi)*1e-07 #Absolute permeability of free space(in Farad per metre)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Bg=flux/A1\n",
+ "Hg=Bg/abs_per\n",
+ "mmf_g=Hg*lg\n",
+ "B1=Bg\n",
+ "H1=B1/(rel_per*abs_per)\n",
+ "mmf_1=H1*l1\n",
+ "flux2=flux/2.0\n",
+ "B2=flux2/A2\n",
+ "H2=B2/(rel_per*abs_per)\n",
+ "mmf_2=H2*l2\n",
+ "tot_mmf=mmf_g+mmf_1+mmf_2\n",
+ "I=tot_mmf/N\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current in the 600 turn exciting coil is %.3f A.\" %(I) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current in the 600 turn exciting coil is 0.501 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.9,Page number: 176 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the value of exciting current.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "A_B=0.01 #Area of cross section of limb B(in square metre)\n",
+ "A_C=0.02 #Area of cross section of limb C(in square metre)\n",
+ "l_B=1e-03 #Length of air gap in limb B(in metres)\n",
+ "l_C=2e-03 #Length of air gap in limb C(in metres)\n",
+ "flux_B=1.5e-03 #Flux in limb B(in Webers)\n",
+ "N=500 #Number of turns in the coil\n",
+ "abs_per=(4*pi)*(1e-07)#Absolute permeability of free space(in Henry per metre) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"The mmf across parallel paths must be same. \n",
+ " (R_B*flux_B)=(R_C*flux_C);\"\"\"\n",
+ "flux_C=flux_B*(l_B/l_C)*(A_C/A_B)\n",
+ "flux=flux_B+flux_C\n",
+ "R_B=l_B/(abs_per*A_B)\n",
+ "R_C=l_C/(abs_per*A_C)\n",
+ "R_net=1.0/((1.0/R_B)+(1.0/R_C))\n",
+ "I=(flux*R_net)/N\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The flux in limb A is %e Wb.\" %(flux)\n",
+ "print \"The current in the exciting coil is %e A.\" %(I) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flux in limb A is 3.000000e-03 Wb.\n",
+ "The current in the exciting coil is 2.387324e-01 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.10,Page number: 177 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the ampere turns required to produce a flux.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "abs_per=(4*pi)*(1e-07) #Absolute permeability of free space(in Henry per metre)\n",
+ "D=21e-02 #Mean diameter of the ring(in metres)\n",
+ "A=10e-04 #Cross sectional area(in square metre)\n",
+ "flux=0.8e-03 #Flux to be produced(in Webers)\n",
+ "lg=0.4e-03 #Length of the air gap(in metres) \n",
+ "rel_i=166.0 #Relative permeability of iron\n",
+ "rel_s=800.0 #Relative permeability of steel\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "B=flux/A\n",
+ "li=(pi*D)/2.0\n",
+ "ls=(pi*D)/2.0\n",
+ "mmf_g=(B/abs_per)*lg\n",
+ "mmf_i=(B/(abs_per*rel_i))*li\n",
+ "mmf_s=(B/(abs_per*rel_s))*ls\n",
+ "mmf=mmf_g+mmf_i+mmf_s\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The total ampere turns required is %.2f At.\" %(mmf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total ampere turns required is 1782.21 At.\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.11,Page number: 177 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the ampere turns of the coil wound on the central limb.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "flux=1e-03 #Flux in the central limb(in Webers)\n",
+ "Ac=8e-04 #Area of the central limb(in square metres)\n",
+ "As=5e-04 #Area of each side limb(in square metres)\n",
+ "l=0.15 #Length of the central limb(in metres)\n",
+ "lg=0.001 #Length of the air gap(in metres)\n",
+ "abs_per=(4*pi)*1e-07 #Absolute permeability of free space(in Henry per metre)\n",
+ "l1=0.34 #Length of the part ABCD(in metres)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "B=flux/Ac\n",
+ "\"\"\"Corresponding to this value of B, H is 500 At/m from the table.\"\"\"\n",
+ "mmf_DG=500*l\n",
+ "Hg=1.25/abs_per\n",
+ "mmf_g=Hg*lg\n",
+ "B1=(flux/2.0)/As\n",
+ "\"\"\"Corresponding to this value of B, H is 200 At/m from the table.\"\"\"\n",
+ "mmf_1=200*l1\n",
+ "mmf_tot=mmf_DG+mmf_g+mmf_1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The required ampere turns of the coil wound on the central limb is %.2f At.\" %(mmf_tot)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required ampere turns of the coil wound on the central limb is 1137.72 At.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter7.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter7.ipynb new file mode 100755 index 00000000..acf4ea53 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter7.ipynb @@ -0,0 +1,975 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: SELF AND MUTUAL INDUCTANCES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1,Page number: 184\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the emf induced in a coil.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=4 #Self inductance of the coil(in Henry) \n",
+ "di=4-10 #Change in current(in Amperes)\n",
+ "dt=0.1 #Time interval(in seconds)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "e=-L*(di/dt)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The emf induced in the coil is %.2f V.\" %(e)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The emf induced in the coil is 240.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2,Page number: 184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the inductance of a coil.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N=150 #Number of turns in the coil \n",
+ "flux=0.01 #Flux linked with the coil(in Webers)\n",
+ "I=10 #Current in the coil(in Amperes) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "L=(N*flux)/I\n",
+ "di=-10-(10)\n",
+ "dt=0.01\n",
+ "e=-L*(di/dt)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The inductance of the coil is %.2f H.\" %(L)\n",
+ "print \"The induced emf is %.2f V.\" %(e)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The inductance of the coil is 0.15 H.\n",
+ "The induced emf is 300.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3,Page number: 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the inductance of the coil and the emf induced.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N=100 #Number of turns in the coil\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "dflux=-0.4-0.4\n",
+ "di=-10-10\n",
+ "L=N*(dflux/di)\n",
+ "dt=0.01\n",
+ "e=-(L*(di/dt))/1000\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The inductance of the coil is %.2f mH.\" %(L)\n",
+ "print \"The induced emf is %.2f V.\" %(e)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The inductance of the coil is 4.00 mH.\n",
+ "The induced emf is 8.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4,Page number: 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the energy stored in an air-cored solenoid.\"\"\"\n",
+ "\n",
+ "from math import pi,pow\n",
+ "\n",
+ "\"\"\" All quantities expresssed in SI System.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "l=0.30 #Length of the solenoid(in metres) \n",
+ "d=0.015 #Internal diameter of the solenoid(in metres) \n",
+ "r=0.0075 #Internal radius of the solenoid(in metres)\n",
+ "N=900 #Number of turns in the coil \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "A=pi*pow(r,2)\n",
+ "L=(pow(N,2)*4*pi*A)/(0.30*10000000)\n",
+ "I=5\n",
+ "W=0.5*L*pow(I,2)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The inductance of the air-cored solenoid is %.2f mH.\" %(L*1000)\n",
+ "print \"The amount of energy stored in the air-cored solenoid is %.2f mJ.\" %(W*1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The inductance of the air-cored solenoid is 0.60 mH.\n",
+ "The amount of energy stored in the air-cored solenoid is 7.49 mJ.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5,Page number: 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the relative permeability of iron and the inductance of a coil.\"\"\"\n",
+ "\n",
+ "from math import pow,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "r=0.01 #Radius of circular ring(in metres)\n",
+ "A=pi*pow(r,2) #Area of circular ring(in square metres) \n",
+ "N=3000 #Number of turns in the coil \n",
+ "I=0.5 #Current in the coil(in Amperes)\n",
+ "l=20.0/100 #Length of the iron rod(in metres) \n",
+ "B=1.2 #Magnitude of magnetic field(in Tesla)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "H=(N*I)/l\n",
+ "per=B/H\n",
+ "rel_per=(per*10000000)/(4*pi)\n",
+ "L=(N*B*A)/I\n",
+ "dflux=(0.1-1)*A*B\n",
+ "dt=0.01\n",
+ "e=-N*(dflux/dt)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The permeability of iron is %e Tm/A.\" %(per)\n",
+ "print \"(b)The relative permeability of iron is %d.\" %(rel_per)\n",
+ "print \"(c)The inductance of the coil is %.2f H.\" %(L)\n",
+ "print \"(d)The voltage in the coil is %.2f V.\" %(e)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The permeability of iron is 1.600000e-04 Tm/A.\n",
+ "(b)The relative permeability of iron is 127.\n",
+ "(c)The inductance of the coil is 2.26 H.\n",
+ "(d)The voltage in the coil is 101.79 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6,Page number: 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the potential difference across the terminals of a coil.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=3 #Resistance of the coil(in Ohms)\n",
+ "i=1 #Current in the coil(in Amperes)\n",
+ "di=10000 #Change in current(in Amperes) \n",
+ "dt=1 #Time interval(in seconds)\n",
+ "L=0.1/1000 #Self inductance of the coil(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V=(i*R)+(L*(di/dt))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The potential difference that exists across the terminals of the coil is %.2f V.\" %(V) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The potential difference that exists across the terminals of the coil is 4.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.7,Page number: 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the mutual inductance and emf induced in a search coil.\"\"\"\n",
+ "\n",
+ "from math import pi,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N1=2000 #Number of turns in the solenoid \n",
+ "N2=500 #Number of turns in the search coil\n",
+ "l=0.70 #Length of the solenoid(in metres) \n",
+ "k=1 #Coefficient of coupling\n",
+ "A=30.0/10000 #Mean area of the search coil(in square metres)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "per=(4*pi)/10000000.0\n",
+ "M=(k*N1*N2*per*A)/l\n",
+ "di1=260.0\n",
+ "dt=1\n",
+ "e=M*(di1/dt)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The mutual inductance is %.4f mH.\" %(M*1000)\n",
+ "print \"(b)The emf induced in the search coil is %.2f V.\" %(e)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The mutual inductance is 5.3856 mH.\n",
+ "(b)The emf induced in the search coil is 1.40 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.8,Page number: 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the mutual inductance and the coefficient of coupling between two coils.\"\"\"\n",
+ "\n",
+ "from math import pow,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N1=600.0 #Number of turns in the first coil\n",
+ "N2=1700.0 #Number of turns in the second coil \n",
+ "flux2=0.8/1000 #Magnetic flux produced in the second coil(in Webers) \n",
+ "I2=6 #Current in the second coil(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "L2=(N2*flux2)/I2\n",
+ "L1=L2*pow((N1/N2),2)\n",
+ "flux21=0.5/1000\n",
+ "k=flux21/flux2\n",
+ "M=k*sqrt(L1*L2)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"L1=%.4f H.\" %(L1)\n",
+ "print \"L2=%.4f H.\" %(L2)\n",
+ "print \"The coefficient of coupling(k)=%.4f.\" %(k) \n",
+ "print \"M=%.4f H.\" %(M)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L1=0.0282 H.\n",
+ "L2=0.2267 H.\n",
+ "The coefficient of coupling(k)=0.6250.\n",
+ "M=0.0500 H.\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.9,Page number: 189 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the mutual inductance and the coefficient of coupling between two coils.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N1=1200.0 #Number of turns in the first coil \n",
+ "flux1=0.25/1000 #Magnetic flux produced in the first coil(in Webers) \n",
+ "I1=5 #Current in the first coil(in Amperes)\n",
+ "N2=800.0 #Number of turns in the second coil\n",
+ "flux2=0.15/1000 #Magnetic flux produced in the second coil(in Webers)\n",
+ "I2=5 #Current in the second coil(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "L1=(N1*flux1)/I1\n",
+ "L2=(N2*flux2)/I2\n",
+ "k=0.6\n",
+ "flux12=k*flux1\n",
+ "M=(N2*flux12)/I1\n",
+ "k_new=M/sqrt(L1*L2)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The mutual inductance(M) is %.4f H.\" %(M)\n",
+ "print \"The coefficient of coupling is %.4f.\" %(k_new)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mutual inductance(M) is 0.0240 H.\n",
+ "The coefficient of coupling is 0.6325.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.10,Page number: 192 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the mutual inductance and the coefficient of coupling between two coils.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Lsa=1.4/1000 #Net inductance in series-aiding connections(in Henry) \n",
+ "Lso=0.6/1000 #Net inductance in series-opposing connections(in Henry) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "M=(Lsa-Lso)/4\n",
+ "\"\"\"Lsa=L1+L2+2M \n",
+ " L1+L2=1 mH; As the two coils are similar L1=L2=0.5mH \"\"\"\n",
+ "L1=0.5/1000\n",
+ "L2=0.5/1000\n",
+ "k=M/sqrt(L1*L2)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The mutual inductance is %.2f mH.\" %(M*1000)\n",
+ "print \"The coefficient of coupling(k) is %.2f.\" %(k)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mutual inductance is 0.20 mH.\n",
+ "The coefficient of coupling(k) is 0.40.\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.11,Page number: 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the mutual inductance and the self-inductances of two coils. \"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "\"\"\" Equation 1 is L1+L2+(2*M)=1.8;\n",
+ " \n",
+ " Equation 2 is L1+L2-(2*M)=0.8. \"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "k=0.6 #Coefficient of coupling\n",
+ "eq1=1.8 #Net inductance when fluxes are in same direction(in Henry)\n",
+ "eq2=0.8 #Net inductance when fluxes are in opposite direction(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "M=(eq1-eq2)/4\n",
+ "sum=(eq1+eq2)/2\n",
+ "product=(M*M)/(k*k)\n",
+ "diff=sqrt((sum*sum)-(4*product))\n",
+ "L1=(sum+diff)/2\n",
+ "L2=(sum-diff)/2\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The mutual inductance of the two coils is %.3f H.\" %(M)\n",
+ "print \"The self inducatnce of the first coil is %.3f H and the self inductance of the second coil is %.3f H.\" %(L1,L2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mutual inductance of the two coils is 0.250 H.\n",
+ "The self inducatnce of the first coil is 1.149 H and the self inductance of the second coil is 0.151 H.\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.12,Page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the equivalent inductance of a combination of inductances connected in parallel.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "k=0.433 #Coefficient of coupling \n",
+ "L1=8 #Self-inductance of the first coil \n",
+ "L2=6 #Self-inductance of the second coil\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "M=k*sqrt(L1*L2)\n",
+ "Lpa=((L1*L2)-(M*M))/(L1+L2-(2*M))\n",
+ "Lpo=((L1*L2)-(M*M))/(L1+L2+(2*M))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The equivalent inductance such that the mutual induction assists the self induction is %.3f H.\" %(Lpa)\n",
+ "print \"(b)The equivalent inductance such that the mutual induction opposes the self induction is %.3f H.\" %(Lpo) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The equivalent inductance such that the mutual induction assists the self induction is 4.875 H.\n",
+ "(b)The equivalent inductance such that the mutual induction opposes the self induction is 1.950 H.\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.13,Page number: 196 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the number of turns in an air-cored coil.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "l=2.5e-02 #Length of the coil(in metres)\n",
+ "A=2e-04 #Average cross-sectional area of the coil(in square-metres)\n",
+ "L=400e-06 #Self-inductance of the coil(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "abs_per=(4*pi)/(1e07)\n",
+ "N=sqrt((L*l)/(abs_per*A))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The number of turns in the air-cored coil is %d.\" %(round(N,0)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of turns in the air-cored coil is 199.\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.14,Page number: 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the mutual inductance between two coils and their self inductances.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "k=0.75 #Coefficient of coupling between two coils\n",
+ "I1=3.0 #Current in the first coil(in Amperes)\n",
+ "N1=250.0 #Number of turns in the first coil\n",
+ "flux1=4e-03 #Flux produced in the first coil(in Webers)\n",
+ "V2=70.0 #Voltage induced in the second coil due to first coil(in Volts)\n",
+ "di1=3.0 #Change in current in the first coil(in Amperes)\n",
+ "dt=3e-03 #Time interval(in seconds)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "L1=N1*(flux1/I1)\n",
+ "M=(V2*dt)/di1\n",
+ "L2=(M*M)/(k*k*L1)\n",
+ "N2=N1*sqrt(L2/L1)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"L1=%.4f H.\" %(L1)\n",
+ "print \"L2=%.4f H.\" %(L2)\n",
+ "print \"M=%.4f H.\" %(M)\n",
+ "print \"N2=%d.\" %(round(N2,0))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L1=0.3333 H.\n",
+ "L2=0.0261 H.\n",
+ "M=0.0700 H.\n",
+ "N2=70.\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.15,Page number: 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the mean value of self inductance of a coil.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N=1000.0 #Number of turns in the coil\n",
+ "A=20e-04 #Cross-sectional area of the coil(in square-metre)\n",
+ "I1=4.0 #First current(in Amperes)\n",
+ "B1=1.0 #Flux density associated with the first current(in Weber per sqyare-metre) \n",
+ "I2=9.0 #Second current(in Amperes)\n",
+ "B2=1.4 #Flux density associated with the first current(in Weber per sqyare-metre)\n",
+ "dt=0.05 #Time interval(in seconds)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "L1=(N*B1*A)/I1\n",
+ "L2=(N*B2*A)/I2\n",
+ "L=(L1+L2)/2.0\n",
+ "di=I2-I1\n",
+ "e=L*(di/dt)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The mean value of inductance between the given current limits is %.4f H.\" %(L)\n",
+ "print \"The emf induced in the coil is %.2f V.\" %(e)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mean value of inductance between the given current limits is 0.4056 H.\n",
+ "The emf induced in the coil is 40.56 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.16,Page number: 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the mutual inductance between two coils and their respective self-inductances.\"\"\"\n",
+ "\n",
+ "from math import pi,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "N1=100.0 #Number of turns in the first coil\n",
+ "N2=150.0 #Number of turns in the second coil\n",
+ "A=125e-04 #Area of cross-section(in square-metres)\n",
+ "l=200e-02 #Mean length(in metres)\n",
+ "rel_per=2000.0 #Relative permeability of iron\n",
+ "k=1 #Coefficient of coupling\n",
+ "\n",
+ "\"\"\" NOTE: As the two coils are wound side by side,there is tight coupling. Therefore, k=1. \"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "abs_per=(4*pi)/(1e07)\n",
+ "L1=(N1*N1*rel_per*abs_per*A)/l\n",
+ "L2=(N2*N2*rel_per*abs_per*A)/l\n",
+ "M=k*sqrt(L1*L2)\n",
+ "di1=5.0\n",
+ "dt=0.02\n",
+ "e2=M*(di1/dt)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The self inductances of the tow coils are: L1=%.3f mH and L2=%.3f mH.\" %((L1*1000.0),(L2*1000.0))\n",
+ "print \"(b)The mutual inductance between the two coils is %.3f mH.\" %(M*1000.0)\n",
+ "print \"(c)The emf induced in the second coil is %.2f V.\" %(e2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The self inductances of the tow coils are: L1=157.080 mH and L2=353.429 mH.\n",
+ "(b)The mutual inductance between the two coils is 235.619 mH.\n",
+ "(c)The emf induced in the second coil is 58.90 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.17,Page number: 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the coeffcient of coupling and the self-inductance of two coils.\"\"\" \n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Lsa=4.0 #Equivalent inductance of series aiding(in Henry)\n",
+ "Lso=0.8 #Equivalent inductance of series opposing(in Henry)\n",
+ "\n",
+ "\"\"\" NOTE: Lsa=L+L+(2*M);\n",
+ " Lso=L+L-(2*M); \"\"\"\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "L=(Lsa+Lso)/4.0\n",
+ "M=(Lsa-Lso)/4.0\n",
+ "k=M/sqrt(L*L)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The self inductance of each coil is %.2f H.\" %(L)\n",
+ "print \"The coefficient of coupling is %.3f.\" %(round(k,3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The self inductance of each coil is 1.20 H.\n",
+ "The coefficient of coupling is 0.667.\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.18,Page number: 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the equivalent inductance of different combinations of two coils.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L1=200e-03 #Self-inductance of the first coil(in Henry) \n",
+ "L2=800e-03 #Self-inductance of the second coil(in Henry)\n",
+ "k=0.5 #Coefficient of coupling between two coils\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "M=k*sqrt(L1*L2)\n",
+ "Lsa=L1+L2+(2*M)\n",
+ "Lso=L1+L2-(2*M)\n",
+ "Lpa=((L1*L2)-(M*M))/Lso\n",
+ "Lpo=((L1*L2)-(M*M))/Lsa\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The equivalent inductance of series aiding is %.3f mH.\" %(Lsa*1000.0)\n",
+ "print \"(b)The equivalent inductance of series opposing is %.3f mH.\" %(Lso*1000.0)\n",
+ "print \"(c)The equivalent inductance of parallel aiding is %.3f mH.\" %(Lpa*1000.0)\n",
+ "print \"(d)The equivalent inductance of parallel opposing is %.3f mH.\" %(Lpo*1000.0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The equivalent inductance of series aiding is 1400.000 mH.\n",
+ "(b)The equivalent inductance of series opposing is 600.000 mH.\n",
+ "(c)The equivalent inductance of parallel aiding is 200.000 mH.\n",
+ "(d)The equivalent inductance of parallel opposing is 85.714 mH.\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.19,Page number: 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the exciting current for a horse-shoe magnet.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "l=45e-02 #Length of the iron path(in metres)\n",
+ "A=6e-04 #Cross-sectional area of the wrought iron bar(in square-metres)\n",
+ "N=500.0 #Number of turns in exciting coil\n",
+ "load=60.0 #Load to be lifted(in kilograms)\n",
+ "rel_per=800.0 #Relative permeability of iron\n",
+ "g=9.8 #Accelaration due to gravity(in metre per square-seconds) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "abs_per=(4*pi)/(1e07)\n",
+ "F=(load/2.0)*g\n",
+ "B=sqrt((2*abs_per*F)/A)\n",
+ "H=B/(abs_per*rel_per)\n",
+ "At=H*l\n",
+ "I=At/(N*2)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The exciting current needed for the magnet is %.5f A.\" %(I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The exciting current needed for the magnet is 0.49674 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter8.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter8.ipynb new file mode 100755 index 00000000..b22550d5 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter8.ipynb @@ -0,0 +1,1188 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: DC TRANSIENTS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1,Page number: 207 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current i(0+)=I0.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=24 #Supply voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Req=20+(1.0/((1.0/20)+(1.0/10)))\n",
+ "I=V/Req\n",
+ "I_L=I*(20.0/(20+10))\n",
+ "Io=I_L\n",
+ "i_0_plus=Io\n",
+ "R=20\n",
+ "v_R=(-Io)*R\n",
+ "R1=(20+10)\n",
+ "v_L=Io*R1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current i(0+)=Io=%.2f A.\" %(i_0_plus)\n",
+ "print \"(b)The magnitude of v_R across the 20 Ohms resistor at the instant just after the switch is opened is %.2f V.\" %(v_R)\n",
+ "print \"(c)The magnitude of v_L across the inductor immediately after the switch is opened is %.2f V.\" %(v_L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current i(0+)=Io=0.60 A.\n",
+ "(b)The magnitude of v_R across the 20 Ohms resistor at the instant just after the switch is opened is -12.00 V.\n",
+ "(c)The magnitude of v_L across the inductor immediately after the switch is opened is 18.00 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2,Page number: 208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding i(0),the power being absorbed by the inductor at t=1 s.\"\"\"\n",
+ "\n",
+ "from math import e,pow,sqrt,log\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=1.6 #Self-inductance of the inductor(in Henry)\n",
+ "R=0.8 #Resistance of the resistor(in Ohms)\n",
+ "t=-1.0 #Instant of time(in seconds) \n",
+ "i_minus_1=20.0 #Current at t=1 seconds(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "time_const=L/R\n",
+ "Io=i_minus_1/pow(e,(-t/time_const))\n",
+ "t=1\n",
+ "i_t=Io*pow(e,(-t/time_const))\n",
+ "p_t=i_t*i_t*R\n",
+ "W=100.0\n",
+ "i_t1=sqrt((2*W)/L)\n",
+ "t=-(log(i_t1/Io))*time_const\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)i(0) = %.3f A.\" %(Io)\n",
+ "print \"(b)The power absorbed by the resistor is %.2f W. \" %(p_t) \n",
+ "print \" The inductor by virtue of the emf induced in it,supplies this power to the resistor.\"\n",
+ "print \" Therefore,the power absorbed by the inductor is %.2f W.\" %(-p_t)\n",
+ "print \"(c)The time at which the energy stored in the inductor is 100J is %.5f seconds.\" %(t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)i(0) = 12.131 A.\n",
+ "(b)The power absorbed by the resistor is 43.31 W. \n",
+ " The inductor by virtue of the emf induced in it,supplies this power to the resistor.\n",
+ " Therefore,the power absorbed by the inductor is -43.31 W.\n",
+ "(c)The time at which the energy stored in the inductor is 100J is 0.16315 seconds.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3,Page number: 210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the value of current in the circuit at an instant 0.4 s after the switch has been closed.\"\"\"\n",
+ "\n",
+ "from math import e,pow,log\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=14.0 #Self-inductance of the inductor(in Henry)\n",
+ "R=10.0 #Resistance of the resistor(in Ohms)\n",
+ "V=140.0 #Supply Voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "time_const=L/R\n",
+ "t=0.4\n",
+ "Io=V/R\n",
+ "i=Io*(1-pow(e,(-t/time_const)))\n",
+ "i_t=8\n",
+ "t=-time_const*log(i_t/Io)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The value of current in the circuit at an instant 0.4 s after the switch has been closed is %.3f A.\" %(i)\n",
+ "print \"(b)The time taken for the current to drop to 8 A after the switch is opened is %.4f seconds.\" %(t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The value of current in the circuit at an instant 0.4 s after the switch has been closed is 3.479 A.\n",
+ "(b)The time taken for the current to drop to 8 A after the switch is opened is 0.7835 seconds.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4,Page number: 210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the magnitude of the inductor current at t=0- and at t=0+.\"\"\"\n",
+ "\n",
+ "from math import pow,e\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=40e-03 #Self-inductance of the inductor(in Henry)\n",
+ "R=80.0 #Resistance of the resistor(in Ohm) \n",
+ "V1=20.0 #Supply voltage-1(in Volts) \n",
+ "V2=40.0 #Supply voltage-2(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "time_const=L/R\n",
+ "I_01=V1/R\n",
+ "i_0_minus=I_01\n",
+ "i_0_plus=I_01\n",
+ "I_02=(V1+V2)/R\n",
+ "t=1e-03\n",
+ "i_t=I_01+(I_02-I_01)*(1-pow(e,(-t/time_const)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The magnitude of inductor current at t=0- is %.2f A.\" %(i_0_minus)\n",
+ "print \"(b)The magnitude of inductor current at t=0+ is %.2f A.\" %(i_0_plus)\n",
+ "print \"(c)As t tends to infinity,the current approaches its final steady-state value given as %.2f A.\" %(I_02)\n",
+ "print \"(d)The magnitude of inductor current at t=1 ms is %.3f A.\" %(i_t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The magnitude of inductor current at t=0- is 0.25 A.\n",
+ "(b)The magnitude of inductor current at t=0+ is 0.25 A.\n",
+ "(c)As t tends to infinity,the current approaches its final steady-state value given as 0.75 A.\n",
+ "(d)The magnitude of inductor current at t=1 ms is 0.682 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5,Page number: 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding i_L(0-),i2(0-),i_L(0+),i_L(20 ms) and i_2(20 ms).\"\"\"\n",
+ "\n",
+ "from math import e,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=20.0 #Source Voltage(in Volts)\n",
+ "R1=20.0 #Resistance of resistor-1(in Ohms)\n",
+ "R2=40.0 #Resistance of resistor-2(in Ohms)\n",
+ "R3=30.0 #Resistance of resistor-3(in Ohms)\n",
+ "R4=25.0 #Resistance of resistor-4(in Ohms)\n",
+ "R5=5.0 #Resistance of resistor-5(in Ohms)\n",
+ "L=2.0 #Self-inductance of inductor(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Io=V/(R4+R5)\n",
+ "i_L_0_minus=Io\n",
+ "i_2_0_minus=V/R3\n",
+ "i_L_0_plus=Io\n",
+ "R_45=R4+R5\n",
+ "R_12=R1+R2\n",
+ "Req=R_45+(1/((1/R_12)+(1/R3)))\n",
+ "time_const=L/Req\n",
+ "t=20e-03\n",
+ "i_L_t=Io*pow(e,(-t/time_const))\n",
+ "i_2_t=-i_L_t*(R_12/(R_12+R3))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)i_L(0-) = %.3f A.\" %(i_L_0_minus)\n",
+ "print \"(b)i_2(0-) = %.3f A.\" %(i_2_0_minus)\n",
+ "print \"(c)i_L(0+) = %.3f A.\" %(i_L_0_plus)\n",
+ "print \"(d)i_L(20 ms) = %.3f A.\" %(i_L_t)\n",
+ "print \"(e)i_2(20 ms) = %.3f A.\" %(i_2_t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)i_L(0-) = 0.667 A.\n",
+ "(b)i_2(0-) = 0.667 A.\n",
+ "(c)i_L(0+) = 0.667 A.\n",
+ "(d)i_L(20 ms) = 0.404 A.\n",
+ "(e)i_2(20 ms) = -0.270 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.6,Page number: 215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding v(0+),i(0+) and time constant.\"\"\"\n",
+ "\n",
+ "from math import e,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=1.5e03 #Resistance of the resistor(in Ohms) \n",
+ "C=5e-06 #Capacitance of the capacitor(in Farad)\n",
+ "Vo=3.0 #Source Voltage(in Volts)\n",
+ "v_0_plus=0 #Voltage across capacitor at t=0+(in Volts) \n",
+ "v_0_minus=0 #Voltage across capacitor at t=0-(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Io=Vo/R\n",
+ "i_0_plus=Io\n",
+ "time_const=R*C\n",
+ "t=15e-03\n",
+ "v=Vo*(1-pow(e,(-t/time_const))) \n",
+ "i=Io*pow(e,(-t/time_const))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)Since the voltage across a capacitor cannot change instantaneously, we have, v(0+)=%d V.\" %(v_0_plus)\n",
+ "print \"(b)i(0+)= %.3f mA.\" %(i_0_plus*1000)\n",
+ "print \"(c)The time constant is %.2f ms.\" %(time_const*1000)\n",
+ "print \"(d)At t=15 ms, \\n v=%.5f V. \\n i=%.4f mA.\" %(v,(i*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Since the voltage across a capacitor cannot change instantaneously, we have, v(0+)=0 V.\n",
+ "(b)i(0+)= 2.000 mA.\n",
+ "(c)The time constant is 7.50 ms.\n",
+ "(d)At t=15 ms, \n",
+ " v=2.59399 V. \n",
+ " i=0.2707 mA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.7,Page number: 216\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding v(0+),i(0+) and time constant.\"\"\"\n",
+ "\n",
+ "from math import e,pow\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=100 #Resistance of the resistor(in Ohms)\n",
+ "C=5e-06 #Capacitance of the capacitor(in Farads) \n",
+ "Vo=3.0 #Source Voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "v_0_plus=Vo\n",
+ "v_0_minus=Vo\n",
+ "Io=Vo/R\n",
+ "i_0_plus=-Io\n",
+ "time_const=R*C\n",
+ "t=1.2e-03\n",
+ "v=Vo*pow(e,(-t/time_const)) \n",
+ "i=-Io*pow(e,(-t/time_const))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)Since the voltage across a capacitor cannot change instantaneously, we have, v(0+)=%d V.\" %(v_0_plus)\n",
+ "print \"(b)At t=0+, the capacitor behaves as a voltage source of emf Vo. Hence, i(0+)= -Io = %.3f mA.\" %(i_0_plus*1000)\n",
+ "print \"(c) The time constant is %.2f ms.\" %(time_const*1000)\n",
+ "print \"(d)At t=1.2 ms, \\n v=%.5f V. \\n i=%.4f mA.\" %(v,(i*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Since the voltage across a capacitor cannot change instantaneously, we have, v(0+)=3 V.\n",
+ "(b)At t=0+, the capacitor behaves as a voltage source of emf Vo. Hence, i(0+)= -Io = -30.000 mA.\n",
+ "(c) The time constant is 0.50 ms.\n",
+ "(d)At t=1.2 ms, \n",
+ " v=0.27215 V. \n",
+ " i=-2.7215 mA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.8,Page number: 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current i(t) for t>0 seconds.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\" R_Th=(1+10)kilo ohm || (1 kiloohm) \"\"\" #Thevenin's Equivalent Resistance(in Ohms) \n",
+ "\n",
+ "print(\"Note: All currents expressed in mA \\n\")\n",
+ "R_Th=1.0/((1.0/11000)+(1.0/1000))\n",
+ "C=10e-06\n",
+ "time_const=R_Th*C\n",
+ "v_C_0_minus=30.0*((1e03)/((1e03)+(1e03)))\n",
+ "\n",
+ "\"\"\" Applying KVL, 30-(i_0_plus*(1 kilo ohm))-15=0 \"\"\"\n",
+ "\n",
+ "i_0_plus=(30-15)/1.0\n",
+ "i_infinity=30.0/(1+1+10)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"i(t)= (%.1f + (%.1f-%.1f)*(e to the power -t/%.2f ms)) mA.\" %(i_infinity,i_0_plus,i_infinity,(time_const*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Note: All currents expressed in mA \n",
+ "\n",
+ "i(t)= (2.5 + (15.0-2.5)*(e to the power -t/9.17 ms)) mA.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.9,Page number: 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current at t=1 seconds.\"\"\"\n",
+ "\n",
+ "from math import exp,log\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=3.0 #Resistance of the coil(in Ohms)\n",
+ "time_const=1.8 #Time constant of the coil(in seconds)\n",
+ "V=10.0 #Supply voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "L=time_const*R\n",
+ "i_0_plus=0\n",
+ "I0=V/R\n",
+ "i=I0*(1-exp((-1/time_const)))\n",
+ "t=(log(0.5,e))*(-1.8)\n",
+ "growth=V/L\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current at t=1 seconds is given as %.2f A.\" %(i)\n",
+ "print \"(b)The time at which current attains half of its final value is %.2f seconds.\" %(t)\n",
+ "print \"(c)The initial rate of growth of current is %.2f A/s.\" %(growth)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current at t=1 seconds is given as 1.42 A.\n",
+ "(b)The time at which current attains half of its final value is 1.25 seconds.\n",
+ "(c)The initial rate of growth of current is 1.85 A/s.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.10,Page number: 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the value of current during a sudden change.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"If I0 is the final steady-state value of current,at t=1 s, we have\n",
+ " \n",
+ " i=Io*(1-exp(-1/time_const)) or (0.741*Io)=Io*(1-exp(-1/time_const));\n",
+ " \n",
+ " exp(-1/time_const)=0.259;\n",
+ " \n",
+ " During the decay of current,we have i(t)=Io*exp(-1/time_const); \n",
+ " \n",
+ " Therefore, at t=1s, we have\n",
+ " \n",
+ " i1=0.259*Io.\n",
+ " \n",
+ " Therefore the value of current in the circuit is 0.259 times the steady state value.\"\"\"\n",
+ "k=1-0.741\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The value of current in the circuit is %.3f times the steady state value.\" %(k)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of current in the circuit is 0.259 times the steady state value.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.11,Page number: 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current in the circuit at t=0.6 s.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=120.0 #Supply dc voltage(in Volts)\n",
+ "R=20.0 #Resistance of the resistor(in Ohms)\n",
+ "L=8.0 #Inductance of the inductor(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "time_const=L/R\n",
+ "Io=V/R\n",
+ "i=Io*(1-exp(-0.6/time_const))\n",
+ "\"\"\"The voltage drop across R,v_R=i*r=Io*(1-exp(-t/time_const))*R;\n",
+ " The voltage drop across L,v_L=L*(di/dt)=((L*Io)/time_const)*exp(-t/time_const); \n",
+ " \n",
+ " We are to find the time at which these two voltage-drops are same. \"\"\"\n",
+ "t=-time_const*log(0.5,e)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current in the circuit at t=0.6 s is %.2f A.\" %(i)\n",
+ "print \"(b)The time at which the voltage drops across R and L are same is %.3f s.\" %(t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current in the circuit at t=0.6 s is 4.66 A.\n",
+ "(b)The time at which the voltage drops across R and L are same is 0.277 s.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.12,Page number: 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the energy stored in the magnetic field.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=30.0 #Supply dc voltage(in Volts)\n",
+ "R=12.0 #Resistance of the resistor(in Ohms)\n",
+ "L=18.0 #Inductance of the inductor(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "time_const=L/R\n",
+ "rate_curr=V/L\n",
+ "Io=V/R\n",
+ "i1=(V/R)*(1-exp(-3.0/time_const))\n",
+ "W1=0.5*i1*i1*L\n",
+ "Wlost=(0.5*L*Io*Io)-W1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The time constant is %.2f seconds.\" %(time_const)\n",
+ "print \"(b)The initial rate of change of current is %.3f A/s.\" %(rate_curr)\n",
+ "print \"(c)The current at t=3 s is %.2f A.\" %(i1)\n",
+ "print \"(d)The energy stored in the magnetic field at t=3 s is %.3f J.\" %(W1)\n",
+ "print \"(e)The energy lost as heat till t=3 s is %.3f J.\" %(Wlost)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The time constant is 1.50 seconds.\n",
+ "(b)The initial rate of change of current is 1.667 A/s.\n",
+ "(c)The current at t=3 s is 2.16 A.\n",
+ "(d)The energy stored in the magnetic field at t=3 s is 42.055 J.\n",
+ "(e)The energy lost as heat till t=3 s is 14.195 J.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.13,Page number: 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage and current at different time instants.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R1=200.0 #Resistance of resistor 1(in Ohms)\n",
+ "L=5e-03 #Inductance of the coil(in Henry)\n",
+ "R2=17.0 #Resistance of resistor 2(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "i_0_plus=20e-03\n",
+ "v_0_plus=i_0_plus*R2\n",
+ "time_const=L/R1\n",
+ "v_L_0_plus=(L*i_0_plus)/time_const\n",
+ "t=20e-06 \n",
+ "i_20=i_0_plus*exp(-t/time_const)\n",
+ "v_20=v_0_plus\n",
+ "t=50e-06\n",
+ "i_50=i_0_plus*exp(-t/time_const)\n",
+ "v_50=v_0_plus\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The value of i(0+)=%e A.\" %(i_0_plus) \n",
+ "print \"(b)The value of v(0+)=%.3f V.\" %(v_0_plus)\n",
+ "print \"(c)The value of v_L(0+)=%.3f V.\" %(v_L_0_plus)\n",
+ "print \"(d)The value of i at t=20 micro seconds is %e A and v=%.3f V.\" %(i_20,v_20)\n",
+ "print \"(d)The value of i at t=50 micro seconds is %e A and v=%.3f V.\" %(i_50,v_50)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The value of i(0+)=2.000000e-02 A.\n",
+ "(b)The value of v(0+)=0.340 V.\n",
+ "(c)The value of v_L(0+)=4.000 V.\n",
+ "(d)The value of i at t=20 micro seconds is 8.986579e-03 A and v=0.340 V.\n",
+ "(d)The value of i at t=50 micro seconds is 2.706706e-03 A and v=0.340 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.14,Page number: 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the currents at t=5 mill seconds.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=0.8 #Self Inductance of the coil(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "i_L_0_minus=(120e-03)*(200.0/(200.0+40.0))\n",
+ "Req=40+(1.0/((1.0/800.0)+(1.0/200.0)))\n",
+ "time_const=L/Req\n",
+ "t=5e-03 \n",
+ "i_L=i_L_0_minus*exp(-t/time_const)\n",
+ "i_x=-i_L*(800.0/(800.0+200.0))\n",
+ "i_y=(120e-03)+(-i_L*(200.0/(200.0+800.0)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"At t=5 milli seconds,\" \n",
+ "print \"(a)The current i_L=%e A.\" %(i_L)\n",
+ "print \"(b)The current i_x=%e A.\" %(i_x)\n",
+ "print \"(c)The current i_y=%e A.\" %(i_y)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At t=5 milli seconds,\n",
+ "(a)The current i_L=2.865048e-02 A.\n",
+ "(b)The current i_x=-2.292038e-02 A.\n",
+ "(c)The current i_y=1.142699e-01 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.15,Page number: 223 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current through an inductor at the time of switching.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=4.0 #Self inductance of inductor(in Henry)\n",
+ "R=10.0 #Resistance of resistor parallel to the inductor(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"By superposition theorem, I_L_0=I_L_1+I_L_2; \"\"\"\n",
+ "I_L1=12.0/4.0\n",
+ "I_L2=2.0\n",
+ "I_L0=I_L1+I_L2\n",
+ "i_L_0_plus=I_L0\n",
+ "w_L_0_plus=0.5*L*I_L0*I_L0\n",
+ "time_const=L/R\n",
+ "t=1.0\n",
+ "i_L=I_L0*exp(-t/time_const)\n",
+ "v_10=-i_L*R\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current i_L(0+)=%.2f A. The energy stored in the inductor is w_L(0+)=%.2f J.\" %(i_L_0_plus,w_L_0_plus)\n",
+ "print \"(b)At t=1 second, the current in the inductance is %.2f A and the voltage v_10=%.2f V.\" %(i_L,v_10) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current i_L(0+)=5.00 A. The energy stored in the inductor is w_L(0+)=50.00 J.\n",
+ "(b)At t=1 second, the current in the inductance is 0.41 A and the voltage v_10=-4.10 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.16,Page number: 223 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the energy stored in the inductor.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=5e-03 #Self inductance of inductor(in Henry)\n",
+ "R=200.0 #Resistance of resistor(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_L0=5e-03\n",
+ "time_const=L/R\n",
+ "t=20e-06\n",
+ "i_L=I_L0*exp(-t/time_const)\n",
+ "w=0.5*L*i_L*i_L\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The energy stored in the inductor after 20 micro seconds of throwing the switch is %e J.\" %(w)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy stored in the inductor after 20 micro seconds of throwing the switch is 1.261853e-08 J.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.17,Page number: 224 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current in the circuit.\"\"\"\n",
+ "\n",
+ "#Variable DEclaration:\n",
+ "L=8.0 #Self inductance of the coil(in Henry)\n",
+ "R=20.0 #Resistance of resistor(in Ohms)\n",
+ "V=120.0 #Voltage of the supply(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Io=V/R\n",
+ "time_const=L/R\n",
+ "t=0.6\n",
+ "i_t=Io*(1-exp(-t/time_const))\n",
+ "\"\"\" The voltage of R at any time is given as v_R(t)=6*(1-exp(-t/0.4))*20=120*(1-exp(-t/0.4));\n",
+ "\n",
+ " The voltage across L at any time is v_L(t)=L*(di/dt)=120*exp(-t/0.4);\n",
+ " \n",
+ " Applying v_L(t)=v_R(t), \"\"\"\n",
+ "t=-log(120.0/240.0)*0.4\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The current in the circuit at t=0.6 seconds is %.2f A.\" %(i_t)\n",
+ "print \"(b)The time at which the voltage drops across R and L are same is %.4f seconds.\"%(t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The current in the circuit at t=0.6 seconds is 4.66 A.\n",
+ "(b)The time at which the voltage drops across R and L are same is 0.2773 seconds.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.18,Page number: 224 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current i_x in the circuit at different time instants.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=25e-03 #Self inductance of the coil(in Henry)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_L0=(10e-03)*(80.0/(80.0+20.0))\n",
+ "i_x_minus_2=I_L0\n",
+ "i_x_0_minus=I_L0\n",
+ "i_x_0_plus=I_L0*(30.0/(30.0+20.0))\n",
+ "Req=1.0/((1.0/20.0)+(1.0/30.0))\n",
+ "time_const=L/Req\n",
+ "t=2e-03\n",
+ "i_L_2=I_L0*exp(-t/time_const)\n",
+ "i_x_2=i_L_2*(30.0/(30.0+20.0))\n",
+ "t=4e-03\n",
+ "i_L_4=I_L0*exp(-t/time_const)\n",
+ "i_x_4=i_L_4*(30.0/(30.0+20.0))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The current i_x:\" \n",
+ "print \"At t=-2 ms, i_x=%e A.\" %(i_x_minus_2) \n",
+ "print \"At t=0- ms, i_x=%e A.\" %(i_x_0_minus)\n",
+ "print \"At t=0+ ms, i_x=%e A.\" %(i_x_0_plus)\n",
+ "print \"At t=2 ms, i_x=%e A.\" %(i_x_2)\n",
+ "print \"At t=4 ms, i_x=%e A.\" %(i_x_4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current i_x:\n",
+ "At t=-2 ms, i_x=8.000000e-03 A.\n",
+ "At t=0- ms, i_x=8.000000e-03 A.\n",
+ "At t=0+ ms, i_x=4.800000e-03 A.\n",
+ "At t=2 ms, i_x=1.837886e-03 A.\n",
+ "At t=4 ms, i_x=7.037134e-04 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.19,Page number: 225 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the current and voltage at the time of switching.\"\"\"\n",
+ "\n",
+ "#Variable Declaration: \n",
+ "V=1.5 #Voltage of the supply(in Volts)\n",
+ "R1=5e-03 #Resistance of resistor 1(in Ohms) \n",
+ "R2=1.5e03 #Resistance of resistor 2(in Ohms)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Before the switch is thrown from a to b,the capacitor is fully charged to supply voltage.\n",
+ "\n",
+ " When switching takes place,the capacitor starts discharging through the 5 milli Ohms resistance.\"\"\" \n",
+ "V0=V\n",
+ "v_0_plus=V0\n",
+ "i_0_plus=V0/R1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The voltage v(0+)=%.2f V and the current i(0+)=%.2f A.\" %(v_0_plus,i_0_plus)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage v(0+)=1.50 V and the current i(0+)=300.00 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.20,Page number: 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage and current at different time intervals.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "C=5e-06 #Capacitance of the capacitor(in Farads)\n",
+ "V=6.0 #Voltage of the supply(in Volts) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "v_0_minus=6.0*((3.0+2.0)/(3.0+2.0+1.0))\n",
+ "R=(1e03+3e03+2e03)\n",
+ "i_0_minus=V/R\n",
+ "v_0_plus=v_0_minus\n",
+ "Vo=v_0_plus\n",
+ "Req=(5e03+3e03+2e03)\n",
+ "time_const=Req*C\n",
+ "i_0_plus=v_0_plus/Req\n",
+ "Io=i_0_plus\n",
+ "t=0.05\n",
+ "v_t1=Vo*exp(-t/time_const)\n",
+ "i_t1=Io*exp(-t/time_const)\n",
+ "t=0.10\n",
+ "v_t2=Vo*exp(-t/time_const)\n",
+ "i_t2=Io*exp(-t/time_const)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The values of v(t) and i(t) are: \"\n",
+ "print \"At t=0- s, v(t)=%.3f V and i(t)=%e A.\" %(v_0_minus,i_0_minus)\n",
+ "print \"At t=0+ s, v(t)=%.3f V and i(t)=%e A.\" %(v_0_plus,i_0_plus)\n",
+ "print \"At t=0.05 s, v(t)=%.3f V and i(t)=%e A.\" %(v_t1,i_t1)\n",
+ "print \"At t=0.10 s, v(t)=%.3f V and i(t)=%e A.\" %(v_t2,i_t2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The values of v(t) and i(t) are: \n",
+ "At t=0- s, v(t)=5.000 V and i(t)=1.000000e-03 A.\n",
+ "At t=0+ s, v(t)=5.000 V and i(t)=5.000000e-04 A.\n",
+ "At t=0.05 s, v(t)=1.839 V and i(t)=1.839397e-04 A.\n",
+ "At t=0.10 s, v(t)=0.677 V and i(t)=6.766764e-05 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.21,Page number: 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltage and current at the time of switching.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "\"\"\"Using current divider rule, the current through branch AB is determined.\"\"\" \n",
+ "I_AB=10e-03*(1000.0/(1000.0+(800.0+200.0)))\n",
+ "v_0_minus=I_AB*800.0\n",
+ "V_AB=v_0_minus\n",
+ "v_0_plus=V_AB\n",
+ "i_C_0_plus=V_AB/(1.0/((1.0/200.0)+(1.0/800.0)))\n",
+ "i_0_plus=i_C_0_plus*(800.0/(800.0+200.0))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The value of v(0+)=%.2f V and the current i(0+)=%e A.\" %(v_0_plus,i_0_plus)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of v(0+)=4.00 V and the current i(0+)=2.000000e-02 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.22,Page number: 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the voltages across resistor,capacitor and switch.\"\"\"\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=12.0 #Voltage of the supply(in Volts)\n",
+ "C=50e-03 #Capacitance of the capacitor(in Farads)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "v_C_0_minus=12.0*(20.0/(20.0+4.0))\n",
+ "v_C_0_plus=v_C_0_minus\n",
+ "Vo=v_C_0_plus\n",
+ "Req=5.0+20.0\n",
+ "time_const=Req*C\n",
+ "t=1.0\n",
+ "v_C1=Vo*exp(-t/time_const)\n",
+ "v_R1=v_C1*(20.0/(20.0+5.0))\n",
+ "v_SW1=V-V_R1\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The value of v_C at t=1 second is %.3f V.\" %(v_C1) \n",
+ "print \"The value of v_R at t=1 second is %.3f V.\" %(v_R1)\n",
+ "print \"The value of v_SW at t=1 second is %.3f V.\" %(v_SW1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of v_C at t=1 second is 4.493 V.\n",
+ "The value of v_R at t=1 second is 3.595 V.\n",
+ "The value of v_SW at t=1 second is 8.405 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/Chapter9.ipynb b/BASIC_ELECTRICAL_ENGINEERING_/Chapter9.ipynb new file mode 100755 index 00000000..299b89e3 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/Chapter9.ipynb @@ -0,0 +1,1092 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9:ALTERNATING CURRENT AND VOLTAGE"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1,Page number: 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the angle at which the instantaneous value of voltage is 10 V.\"\"\"\n",
+ "\n",
+ "from math import asin,degrees\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vm=20.0 #Peak value of sinusoidal voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "v=10.0 #Instantaneous Voltage(in Volts)\n",
+ "angle=degrees(asin(v/Vm))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The angle at which the instantaneous value of voltage is 10V is %.2f degrees.\" %(angle)\n",
+ "print \"(b)The maximum value of voltage is Vm=20 V.This occurs twice in one cycle at angles 90 degrees and 270 degrees.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The angle at which the instantaneous value of voltage is 10V is 30.00 degrees.\n",
+ "(b)The maximum value of voltage is Vm=20 V.This occurs twice in one cycle at angles 90 degrees and 270 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2,Page number: 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the time represented by a 60 degrees phase angle.\"\"\"\n",
+ "\n",
+ "from math import pi,sin,radians\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "ang_freq=2000.0 #Angular Frequency(in radians per second)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "f=ang_freq/(2*pi)\n",
+ "T=1/f\n",
+ "t=160e-06\n",
+ "v=0.04*sin((2000*t)+radians(60))\n",
+ "t_60=(60.0/360)*T\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The frequency is %.2f Hz.\" %(f)\n",
+ "print \"(b)The angular frequency is %.2f rad/sec.\" %(ang_freq)\n",
+ "print \"(c)The instantaneous voltage when t=60 micro seconds, is %e V.\" %(v)\n",
+ "print \"(d)The time represented by 60 degrees phase angle is %e seconds.\" %(t_60)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The frequency is 318.31 Hz.\n",
+ "(b)The angular frequency is 2000.00 rad/sec.\n",
+ "(c)The instantaneous voltage when t=60 micro seconds, is 3.917381e-02 V.\n",
+ "(d)The time represented by 60 degrees phase angle is 5.235988e-04 seconds.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3,Page number: 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the equation for the instantaneous value of a sinusoidal voltage.\"\"\"\n",
+ "\n",
+ "from math import pi,sin,radians,degrees,asin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V_peak_to_peak=20.0 #Peak-to-peak Voltage(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "V_m=V_peak_to_peak/2\n",
+ "T=10.0e-03\n",
+ "f=1/T\n",
+ "ang_freq=2*pi*f\n",
+ "phi=180-degrees(asin(3.6/V_m))\n",
+ "t=12e-03\n",
+ "v_12=V_m*sin((ang_freq*t)-radians(phi))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The equation of the given sinusoidal voltage is v(t)=%.2f sin(%.2ft+%.2f) V.\" %(V_m,ang_freq,phi)\n",
+ "print \"(b)The value of voltage at 12ms would be %.3f V.\" %(v_12)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The equation of the given sinusoidal voltage is v(t)=10.00 sin(628.32t+158.90) V.\n",
+ "(b)The value of voltage at 12ms would be -9.985 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4,Page number: 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the equation for the instantaneous value of an alternating current.\"\"\"\n",
+ "\n",
+ "from math import pi,sin,asin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "f=60.0 #Frequency of alternating current(in Hertz)\n",
+ "i_m=12.0 #Peak value of the alternating current(in Amperes) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "ang_freq=2*pi*f\n",
+ "t1=1.0/360\n",
+ "i_t1=i_m*sin(ang_freq*t1)\n",
+ "i2=9.6\n",
+ "t2=(asin(9.6/12))/ang_freq\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The equation for the instantaneous value of alternating current is i= %d sin(%.2ft) A.\" %(i_m,ang_freq)\n",
+ "print \"(b)The value of current at t=1/360 second is %.2f A.\" %(i_t1)\n",
+ "print \"(c)The time taken to reach 9.6A for the first time is %e seconds.\" %(t2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The equation for the instantaneous value of alternating current is i= 12 sin(376.99t) A.\n",
+ "(b)The value of current at t=1/360 second is 10.39 A.\n",
+ "(c)The time taken to reach 9.6A for the first time is 2.459727e-03 seconds.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5,Page number: 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the phase difference between two sinusoidal currents.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Calculations:\n",
+ "ang_freq=100.0*pi\n",
+ "f=ang_freq/(2.0*pi)\n",
+ "T=1/f\n",
+ "t=(30.0/360.0)*T\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The phase difference in terms of time is %e seconds.\" %(t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The phase difference in terms of time is 1.666667e-03 seconds.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6,Page number: 248 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the power consumed by a resistor.\"\"\"\n",
+ "\n",
+ "from cmath import phase\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=10 #Resistance of resistance(in Ohms) \n",
+ "I=4+ 1j*3 #Alternating current phasor(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "I_mod=abs(I)\n",
+ "I_phase= phase(I)\n",
+ "I_rms=I_mod\n",
+ "P=pow(I_rms,2)*R\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The power consumed by the 10 ohm resistor is %.2f W.\" %(P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power consumed by the 10 ohm resistor is 250.00 W.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7,Page number: 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question: \n",
+ "\"\"\"Finding the resultant current obtained by adding two alternating currents.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import radians,degrees,sqrt\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=rect(10,0)\n",
+ "I2=rect(20,radians(60))\n",
+ "I=I1+I2\n",
+ "Im=abs(I)\n",
+ "I_phase=degrees(phase(I))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resultant current is %.2f A at a phase angle of %.2f degrees.\" %(Im,I_phase)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resultant current is 26.46 A at a phase angle of 40.89 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8,Page number: 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the rms value of the sum of two currents.\"\"\"\n",
+ "\n",
+ "from cmath import rect\n",
+ "from math import radians,sqrt\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=rect((10*sqrt(2)),0)\n",
+ "I2=rect((20*sqrt(2)),radians(60))\n",
+ "I=I1+I2\n",
+ "Im=abs(I)\n",
+ "Irms=Im/(sqrt(2))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The rms value of the sum of the currents is %.2f A.\" %(Irms) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the sum of the currents is 26.46 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.9,Page number: 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the rms value of the resultant current.\"\"\"\n",
+ "\n",
+ "from cmath import rect,phase\n",
+ "from math import radians,sqrt,degrees\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=rect(5,0)\n",
+ "I2=rect(5,radians(30))\n",
+ "I3=rect(5,radians(-120))\n",
+ "I=I1+I2+I3\n",
+ "Im=abs(I)\n",
+ "Irms=Im/(sqrt(2))\n",
+ "I_phase=degrees(phase(I))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The rms value of the resultant current that leaves the junction is %.2f A at a phase angle of %.2f degrees.\" %(Irms,I_phase) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the resultant current that leaves the junction is 5.00 A at a phase angle of -15.00 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.10,Page number: 251"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the average and rms value of the resultant cuurent in a wire.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration: \n",
+ "I1rms=10.0 #Rms value of direct current(in Amperes) \n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "avg=10.0 \n",
+ "I2rms=10.0/sqrt(2)\n",
+ "I_rms=sqrt(pow(I1rms,2)+pow(I2rms,2))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The average value of the resultant current is %d A as the current goes as much positive as negative around the value of %d A.\" %(avg,avg) \n",
+ "print \"The rms value of the resultant current is %.3f A.\" %(I_rms)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average value of the resultant current is 10 A as the current goes as much positive as negative around the value of 10 A.\n",
+ "The rms value of the resultant current is 12.247 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.11,Page number: 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the average value of a voltage waveform.\"\"\"\n",
+ "\n",
+ "#Calculations:\n",
+ "area_0_to_1=10*(1e-03)\n",
+ "area_1_to_3=-5*(2e-03)\n",
+ "area_3_to_4=20*(1e-03)\n",
+ "area_4_to_5=0*(1e-03)\n",
+ "area_5_to_8=5*(3e-03)\n",
+ "total_area=(area_0_to_1+area_1_to_3+area_3_to_4+area_4_to_5+area_5_to_8)\n",
+ "total_period=8e-03\n",
+ "avg_value=total_area/total_period\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The average value of the alternating voltage waveform is %.3f V.\" %(avg_value)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average value of the alternating voltage waveform is 4.375 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.12,Page number: 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the effective value of a voltage waveform.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Calculations:\n",
+ "area_0_to_10=400*(10e-03)\n",
+ "area_10_to_20=100*(10e-03)\n",
+ "total_area=(area_0_to_10+area_10_to_20)\n",
+ "total_period=20e-03\n",
+ "avg_value_of_square=total_area/total_period\n",
+ "rms=sqrt(avg_value_of_square)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The effective(rms) value of the alternating voltage waveform is %.3f V.\" %(rms) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The effective(rms) value of the alternating voltage waveform is 15.811 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.13,Page number: 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the rms value,the average value and the form factor for a current waveform.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "period=3.0 #Time period of the current waveform(in seconds)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Irms=sqrt( ((pow(10,2)*2)+(pow(0,2)*1))/3 )\n",
+ "Iavg=((10.0*2)+(0*1))/3.0\n",
+ "form_factor=Irms/Iavg\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The rms value of current waveform is %.2f A.\" %(Irms) \n",
+ "print \"The average value of current waveform is %.2f A.\" %(Iavg) \n",
+ "print \"The form factor of the current waveform is %.2f.\" %(form_factor) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of current waveform is 8.12 A.\n",
+ "The average value of current waveform is 6.67 A.\n",
+ "The form factor of the current waveform is 1.22.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.14,Page number: 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the form factor and the peak factor for a saw-tooth waveform.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "T=5e-03 #Time period of saw-tooth waveform(in seconds) \n",
+ "V_m=10.0 #Peak value of the saw-tooth voltage(in Volts)\n",
+ "\n",
+ "\"\"\" Vav=(Area under the curve in one cycle)/(Duration of one cycle) \"\"\"\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vav=((1.0/2)*V_m*T)/T\n",
+ "Vrms=V_m/(sqrt(3))\n",
+ "form_factor=Vrms/Vav\n",
+ "peak_factor=V_m/Vrms\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The average value of the saw-tooth voltage waveform is %.3f V.\" %(Vav)\n",
+ "print \"The rms value of the saw-tooth voltage waveform is %.3f V.\" %(Vrms)\n",
+ "print \"The form factor for the saw-tooth voltage waveform is %.3f.\" %(form_factor)\n",
+ "print \"The peak factor for the saw-tooth voltage waveform is %.3f.\" %(peak_factor)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average value of the saw-tooth voltage waveform is 5.000 V.\n",
+ "The rms value of the saw-tooth voltage waveform is 5.774 V.\n",
+ "The form factor for the saw-tooth voltage waveform is 1.155.\n",
+ "The peak factor for the saw-tooth voltage waveform is 1.732.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.15,Page number: 255 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the average power,the apparent power,the instantaneous power and the power factor in percentage in an ac circuit.\"\"\"\n",
+ "\n",
+ "from math import cos,sqrt,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "phase_angle=pi/5 #Phase difference between the alternating current and alternating voltage(in radians) \n",
+ "Vm=55 #Peak value of the alternating voltage(in Volts) \n",
+ "Im=6.1 #Peak value of the alternating current(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vrms=Vm/sqrt(2)\n",
+ "Irms=Im/sqrt(2)\n",
+ "pf=cos(phase_angle)\n",
+ "P_avg=Vrms*Irms*cos(phase_angle)\n",
+ "P_app=Vrms*Irms\n",
+ "P_inst=P_avg-(Vrms*Irms*cos((2*0.3)-(pi/5)))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The average power is %.2f W.\" %(P_avg)\n",
+ "print \"The apparent power is %.2f VA.\" %(P_app)\n",
+ "print \"The instantaneous power at wt=0.3 is %.2f W.\" %(P_inst)\n",
+ "print \"The power factor is %.3f lagging.\" %(pf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average power is 135.71 W.\n",
+ "The apparent power is 167.75 VA.\n",
+ "The instantaneous power at wt=0.3 is -31.97 W.\n",
+ "The power factor is 0.809 lagging.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.16,Page number:262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the average and rms values of waveforms.\"\"\"\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vm1=10.0 #Peak voltage of first waveform(in Volts) \n",
+ "Vm2=10.0 #Peak voltage of second waveform(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Vav1=Vm1/2.0\n",
+ "Vrms1=Vm1/sqrt(3.0)\n",
+ "Vav2=Vm2/4.0\n",
+ "Vrms2=Vm2/sqrt(6.0)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The average value of the voltage is %.2f V and the rms value of the voltage is %.2f V.\" %(Vav1,Vrms1) \n",
+ "print \"(b)The average value of the voltage is %.2f V and the rms value of the voltage is %.2f V.\" %(Vav2,Vrms2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The average value of the voltage is 5.00 V and the rms value of the voltage is 5.77 V.\n",
+ "(b)The average value of the voltage is 2.50 V and the rms value of the voltage is 4.08 V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.17,Page number:263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"Finding the value of current at a given instant.\"\"\"\n",
+ "\n",
+ "from math import pi,sin,asin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Im=12.0 #Maximum value of the alternating current(in Amperes)\n",
+ "f=60.0 #Frequency of the alternating current(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "w=2*pi*f\n",
+ "t=1/360.0\n",
+ "i=Im*sin(w*t)\n",
+ "i1=9.6\n",
+ "t=asin(i1/Im)/w\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The equation for the instantaneous current is i(t)=%.2f sin(%.2f*t) A.\" %(Im,w)\n",
+ "print \"(b)The value of the current after (1/360) second is %.2f A.\" %round(i,2)\n",
+ "print \"(c)The time taken to reach 9.6 A for the first time is %e seconds.\" %(t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The equation for the instantaneous current is i(t)=12.00 sin(376.99*t) A.\n",
+ "(b)The value of the current after (1/360) second is 10.39 A.\n",
+ "(c)The time taken to reach 9.6 A for the first time is 2.459727e-03 seconds.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.18,Page number:263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the expression of an alternating current in cosine form.\"\"\"\n",
+ "\n",
+ "from math import asin,pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Imax=10.0 #Maximum value of current(in Amperes)\n",
+ "Io=5.0 #Value of current at t=0(in Amperes)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "phi=asin(Io/Imax)\n",
+ "phi_new=(pi/2.0)-phi\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The expression for current is i=%.2f cos(wt-%.2f) A.\" %(Imax,phi_new)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The expression for current is i=10.00 cos(wt-1.05) A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.19,Page number:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the time(from negative value) at which the instantaneous current is 10/sqrt(2.0) A.\"\"\"\n",
+ "\n",
+ "from math import pi,sqrt,radians,asin\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Irms=20.0 #Rms value of alternating current(in Amperes)\n",
+ "f=50.0 #Frequency of the alternating current(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "ang_freq=2*pi*f\n",
+ "Im=Irms*sqrt(2.0)\n",
+ "i=10.0*sqrt(2.0)\n",
+ "ph_lag=pi/2.0\n",
+ "t=(asin(i/Im)+ph_lag)/ang_freq\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The time(measured from negative value) at which instantaneous current will be 10/sqrt(2.0) is %.2f ms.\" %round((t*1000),2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The time(measured from negative value) at which instantaneous current will be 10/sqrt(2.0) is 6.67 ms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.20,Page number:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the average and rms value of an alternating current.\"\"\"\n",
+ "\n",
+ "from math import pow,sqrt\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Idc=10.0 #Dc current(in Amperes)\n",
+ "Im=5.0 #Peak value of sinusoidal component(in Volts)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "Iav=Idc\n",
+ "Irms=sqrt((10*10)+pow((5.0/sqrt(2.0)),2))\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The average value of current is %.2f A.\" %(Iav)\n",
+ "print \"The rms value of current is %.2f A.\" %(Irms)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average value of current is 10.00 A.\n",
+ "The rms value of current is 10.61 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.21,Page number:264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the sum of three alternating voltages.\"\"\"\n",
+ "\n",
+ "from math import radians,degrees\n",
+ "from cmath import rect,phase\n",
+ "\n",
+ "#Calculations:\n",
+ "v1=rect(147.3,radians(188.1))\n",
+ "v2=rect(294.6,radians(45))\n",
+ "v3=rect(88.4,radians(135))\n",
+ "v_res=v1+v2+v3\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"The resultant voltage is v=%.2f sin(wt+(%.2f degrees)) V.\" %(abs(v_res),degrees(phase(v_res)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resultant voltage is v=250.07 sin(wt+(90.01 degrees)) V.\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.22,Page number:265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the reactance offered by an inductor and a capacitor.\"\"\"\n",
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "L=0.2 #Inductance of the inductor(in Henry)\n",
+ "C=10e-06 #Capacitance of the capacitor(in Farads)\n",
+ "f=100 #Initial frequency of the ac input voltage(in Hertz)\n",
+ "f1=140 #New frequency of the ac input voltage(in Hertz)\n",
+ "\n",
+ "\n",
+ "#Calculations:\n",
+ "X_L=2*pi*f*L\n",
+ "X_C=1.0/(2*pi*f*C)\n",
+ "X_L1=2*pi*f1*L\n",
+ "X_C1=1.0/(2*pi*f1*C)\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)For a frequency of 100Hz, X_L=%.2f Ohms and X_C=%.2f Ohms.\" %(X_L,X_C)\n",
+ "print \"(a)For a frequency of 140Hz, X_L=%.2f Ohms and X_C=%.2f Ohms.\" %(X_L1,X_C1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)For a frequency of 100Hz, X_L=125.66 Ohms and X_C=159.15 Ohms.\n",
+ "(a)For a frequency of 140Hz, X_L=175.93 Ohms and X_C=113.68 Ohms.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.23,Page number:265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Question:\n",
+ "\"\"\"Finding the currents in each case.\"\"\"\n",
+ "\n",
+ "from math import radians,degrees\n",
+ "from cmath import rect,phase\n",
+ "\n",
+ "#Calculations:\n",
+ "I1=rect(10,0)\n",
+ "I2=rect(10,0)\n",
+ "Ia=I1+I2\n",
+ "I1=rect(10,radians(90))\n",
+ "Ib=I1+I2\n",
+ "I1=rect(10,radians(-90))\n",
+ "I2=rect(10,radians(-90))\n",
+ "Ic=I1+I2\n",
+ "V=250.0+1j*0\n",
+ "X_L=1j*25.0\n",
+ "Id=V/X_L\n",
+ "X_C=-1j*25.0\n",
+ "I=5.0+1j*0\n",
+ "Ve=I*X_C\n",
+ "\n",
+ "\n",
+ "#Result:\n",
+ "print \"(a)The unknown current is %.2f A at a phase angle of %.2f degrees.\" %(abs(Ia),degrees(phase(Ia)))\n",
+ "print \"(a)The unknown current is %.2f A at a phase angle of %.2f degrees.\" %(abs(Ib),degrees(phase(Ib)))\n",
+ "print \"(a)The unknown current is %.2f A at a phase angle of %.2f degrees.\" %(abs(Ic),degrees(phase(Ic)))\n",
+ "print \"(a)The unknown current is %.2f A at a phase angle of %.2f degrees.\" %(abs(Id),degrees(phase(Id)))\n",
+ "print \"(a)The unknown voltage is %.2f A at a phase angle of %.2f degrees.\" %(abs(Ve),degrees(phase(Ve)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The unknown current is 20.00 A at a phase angle of 0.00 degrees.\n",
+ "(a)The unknown current is 14.14 A at a phase angle of 45.00 degrees.\n",
+ "(a)The unknown current is 20.00 A at a phase angle of -90.00 degrees.\n",
+ "(a)The unknown current is 10.00 A at a phase angle of -90.00 degrees.\n",
+ "(a)The unknown voltage is 125.00 A at a phase angle of -90.00 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/README.txt b/BASIC_ELECTRICAL_ENGINEERING_/README.txt new file mode 100755 index 00000000..5982dc4d --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/README.txt @@ -0,0 +1,10 @@ +Contributed By: Abhiram Padmanabhan +Course: be +College/Institute/Organization: PES University,Bangalore +Department/Designation: Electrical and Electronics +Book Title: BASIC ELECTRICAL ENGINEERING +Author: D C KULSHRESHTHA +Publisher: Tata McGraw Hill Education Private Limited,7 West Patel Nagar,New Delhi-110008. +Year of publication: 2012 +Isbn: 978-0-07-132896-8 +Edition: Revised First
\ No newline at end of file diff --git a/BASIC_ELECTRICAL_ENGINEERING_/screenshots/Screenshot1.png b/BASIC_ELECTRICAL_ENGINEERING_/screenshots/Screenshot1.png Binary files differnew file mode 100755 index 00000000..0d0af695 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/screenshots/Screenshot1.png diff --git a/BASIC_ELECTRICAL_ENGINEERING_/screenshots/Screenshot2.png b/BASIC_ELECTRICAL_ENGINEERING_/screenshots/Screenshot2.png Binary files differnew file mode 100755 index 00000000..cb8b214f --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/screenshots/Screenshot2.png diff --git a/BASIC_ELECTRICAL_ENGINEERING_/screenshots/Screenshot3.png b/BASIC_ELECTRICAL_ENGINEERING_/screenshots/Screenshot3.png Binary files differnew file mode 100755 index 00000000..8fed5b31 --- /dev/null +++ b/BASIC_ELECTRICAL_ENGINEERING_/screenshots/Screenshot3.png diff --git a/Basic_Fluid_Mechanics/README.txt b/Basic_Fluid_Mechanics/README.txt new file mode 100755 index 00000000..9fe52d79 --- /dev/null +++ b/Basic_Fluid_Mechanics/README.txt @@ -0,0 +1,10 @@ +Contributed By: Jatin Patel +Course: bca +College/Institute/Organization: Freelancing work +Department/Designation: Freelancer +Book Title: Basic Fluid Mechanics +Author: Peerless +Publisher: Pergamon Press +Year of publication: 1967 +Isbn: 978-0080110981 +Edition: 1
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch10.ipynb b/Basic_Fluid_Mechanics/ch10.ipynb new file mode 100755 index 00000000..805fdf34 --- /dev/null +++ b/Basic_Fluid_Mechanics/ch10.ipynb @@ -0,0 +1,353 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:deacbf9acb1071d19b96737be4ae4bdcb6a5696a34ffaedecc8c1b87e6d2a62b" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 : External Flows" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 Page No : 367" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from numpy import *\n", + "\t\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "u= 3.6*10**-5 \t#lbf sec/ft**2 viscosity\n", + "d= 64. \t#lbm/ft**2 density\n", + "l= 20. \t#ft long\n", + "a= 0.5\n", + "\t\n", + "#CALCULATIONS\n", + "sw= u*g/(a*d)\n", + "sw1= u**2*g*l/(2*a*d)\n", + "Re=array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])*10**5\n", + "Vinf=Re*u*g/(d*a)\n", + "Cd= array([1.2, 1.15, 0.94, 0.68, 0.305, 0.31, 0.32, 0.33, 0.34, 0.35])\n", + "cdre=Cd*Re**2\n", + "D=sw1*cdre\n", + "\t\n", + "#RESULTS\n", + "print 'velocity = %.3e ft/sec'%(sw)\n", + "print ' Force = %.3e lbf'%(sw1)\n", + "print \"V (ft/sec) D(lbf)\"\n", + "for i in range(len(D)):\n", + " print \"%6.1f %6d\"%(Vinf[i],D[i])\n", + "\n", + "\n", + "# note : answers are accurate. please check manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "velocity = 3.623e-05 ft/sec\n", + " Force = 1.304e-08 lbf\n", + "V (ft/sec) D(lbf)\n", + " 3.6 156\n", + " 7.2 599\n", + " 10.9 1103\n", + " 14.5 1418\n", + " 18.1 994\n", + " 21.7 1455\n", + " 25.4 2044\n", + " 29.0 2754\n", + " 32.6 3591\n", + " 36.2 4564\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2 Page No : 368" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%pylab inline\n", + "from numpy import *\n", + "from matplotlib.pyplot import *\n", + "\t\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "u= 3.6*10**-5 \t#lbf sec/ft**2\n", + "d= 64. \t#lbm/ft**2 density\n", + "l= 20. \t#ft long\n", + "a= 0.5\n", + "\t\n", + "#CALCULATIONS\n", + "sw= u*g/(a*d)\n", + "sw1= u**2*g*l/(2*a*d)\n", + "Re = array([1 ,2, 3, 4, 5, 6, 7, 8, 9, 10])*10**5\n", + "Vinf=Re*u*g/(d*a)\n", + "Cd = array([1.2, 1.15, 0.94, 0.68, 0.305, 0.31, 0.32, 0.33, 0.34, 0.35])\n", + "cdre=Cd*Re**2\n", + "D=sw1*cdre\n", + "\t\n", + "#RESULTS\n", + "plot(Vinf,D)\n", + "xlabel(\"Vinf, ft/sec\")\n", + "ylabel(\"D, lbf\") \n", + "suptitle(\"Streamlinedbody curve\")\n", + "\n", + "\t#data for curves b,c,d is not given\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Populating the interactive namespace from numpy and matplotlib\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 1, + "text": [ + "<matplotlib.text.Text at 0x2683050>" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEhCAYAAABoTkdHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VNXdx/HPJEah4koS4pOkoqBAhgmMQFQKNmExkogs\nUglIrCAtWhfEpS6PNaAW6kIBrQsuQSVUQAWLJkY2I48CAUJYQq0LsmSCQNhkSYCEnOePK1MQokzI\n5M4k3/frlZfhMnfmO7dlfnPOuecchzHGICIicopC7A4gIiLBRYVDRER8osIhIiI+UeEQERGfqHCI\niIhPVDhERMQnKhxSp/7yl7/QqlUr2rVrR7t27Vi2bBkAEydOpLy8vE6zbNy4EZfLBcCKFSsYOXJk\nrTzvm2++yd133w3Arbfeyvvvv1/j50pMTKSgoKBWconUljPsDiANR15eHgsWLKCoqIiwsDD27t1L\nWVkZAJMmTSI9PZ3GjRufcF5VVRUhIf79jtOxY0c6duxY68/rcDhO+/zTfY5TcXQ6V128lgQ/tTik\nzpSWlhIREUFYWBgA5557LlFRUTz//PNs2bKFpKQkunfvDkCTJk144IEH6NixI0uXLuW1116jXbt2\nOJ1Ohg0bRmVlJQC33347nTp14vLLL+fhhx/2vlbz5s353//9X29BWLlyJb169aJ58+a88MILJ2TL\ny8ujd+/eAIwePZphw4bRo0cPLr74Yp577jnv46rLMXnyZFq0aEHnzp1ZvHjxcc89f/58rrrqKlq0\naMHs2bMBKC8vZ9CgQTidTlwuF5988gkAZWVl9OnTB6fTyYABAygvL8cYw5QpUxg1atRxOe67774T\n3scHH3xAfHw8brfbey1Hjx7N+PHjvY9p27YtmzdvZuPGjbRq1Ypbb72V9u3b89RTT/HnP//Z+7hj\nW07VvW9poIxIHfnhhx9M27ZtTevWrc3tt99u5s+f7/275s2bm507d3r/7HA4zKxZs4wxxqxatcqk\npqaayspKY4wxd9xxh3nttde8z2mMMZWVlSYxMdGsWLHC+3yvvvqqMcaYUaNGGZfLZcrLy01paakJ\nDw83xhizYcMG07ZtW2OMMZ9++qm5/vrrjTHGZGRkmC5dupgjR46YHTt2mAsuuMAcOnSo2hybN282\n0dHRZs+ePaaystJ07drV3H333cYYY37/+9+b1NRU7+tFRkaasrIy89e//tX88Y9/NMYY880335io\nqChTXl5uxo4d6z2+bt06c8YZZ5iCggKzf/9+06JFC+9rd+7c2RQVFR13fbds2WKioqKMx+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yhMzMTO+xq6++mmef\nfZYuXbqc0nOcf/757N69+2fXTdu6dStdu3blm2++AeCSSy5hxYoV3oXlwCpi77777nHHRAKRWhzS\noN14441kZ2dTWVkJWCvFbtmyhS5duvDmm29y9913A3DrrbcycuRIrrnmGn796197WwY33HAD+/fv\n54orrmDmzJnVvs61115LSUkJbrebJ554gi1btpCUlET37t0B2Lt3L4cPH6Zp06a88847uFwu3G63\nd8XayspK7rrrLtq1a0ebNm14/vnnvc89ZswY2rRpQ/v27X+x1SNSG4Jmz3ERf7jwwgtJSEggJyeH\nG264genTpzNw4EDgxJWXt2/fzqJFi/jyyy/p1asXgwcPZs6cOZxzzjkUFhb+7Ot8+OGHXH/99d7H\nTZkyhby8PC688EIA5s+fT48ePQB46qmnyMvLIyIiggMHDgDw0ksvcdFFF7F69WoOHTpE586d6dWr\nF0VFRcybN481a9YQFhbGDz/8UKvXR+Rk1OKQBm/QoEFMnz4dgBkzZjBo0CDg+A14HA4HN9xwAwBt\n2rTxriR6qn6pR/iTTz7xLs55zTXXMGTIEF599VXvOMjcuXN5++23cbvdXHXVVezZs4f169ezYMEC\nhg4dSlhYGGCtzCribyoc0uDdcMMNLFiwgMLCQsrKynC73cCJLY4zzzzT+3tt7wOzbNky7z70L7/8\nMk8++STff/89HTp08G7+88orr1BYWEhhYSHr16/nuuuuAwJvhzmp/1Q4pMFr0qQJSUlJDB06lMGD\nB3uP1+QDefbs2Tz66KO/+LjGjRt7u6HWrVtH69atvcVo48aNJCQkkJGRQbNmzdiwYQPJyclMnjyZ\nqqoqADZs2EB5eTk9e/bkzTff5PDhwwDqqpI6oTEOEazuqv79+x83wH10A55j//xLv69fv77a7qJj\nH3fbbbeRlJTEr3/9a1JTU4/bQ2bUqFF89913VFVVkZSURIcOHXC73WzcuBGn08mZZ57JBRdcwIcf\nfkifPn1YtWoV8fHxNG7cmF69ejF27NjTuxgiv0C344rUovT0dCZOnOjTLbXXXnstU6dOpVmzZn5M\nJlJ7VDhERMQnGuMQERGfqHCIiIhPVDhERMQnKhwiIuITFQ4REfGJCoeIiPhEhUNERHzy/xEUA+vK\n3v8VAAAAAElFTkSuQmCC\n", + "text": [ + "<matplotlib.figure.Figure at 0x2682fd0>" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.3 Page No : 373" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "v1= 10. \t#ft/sec\n", + "v2m= 9 \t #ft/sec wide\n", + "a= 1.02\n", + "hbyd= 5.95\n", + "\t\n", + "#CALCULATIONS\n", + "ca= (v1/v2m)**2\n", + "Cd= hbyd*(ca-1+2-2*ca)+2*a*ca\n", + "\t\n", + "#RESULTS\n", + "print 'Drag coeffcieicnt = %.2f'%(Cd)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Drag coeffcieicnt = 1.12\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.4 Page No : 387" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "A= 320. \t#ft/**2 area\n", + "w= 18000. \t#lbf weighs\n", + "v= 230. \t#ft/sec normal speed\n", + "ad= 0.0765 \t#lbm/ft**3 density\n", + "p= 5. \t#per cent of the total lift force\n", + "c= 0.055\n", + "n= 1.75 # total drag\n", + "g= 32.2 \t#ft/sec**2\n", + "\t\n", + "#CALCULATIONS\n", + "CL= 2*w*(1-(p/100))*g/(ad*v**2*A)\n", + "D= w*(1-(p/100))*c*n/CL\n", + "\t\n", + "#RESULTS\n", + "print ' lift coefficient = %.2f'%(CL)\n", + "print ' Drag force = %.f'%(D)\n", + "\n", + "# note : answer is accurate" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " lift coefficient = 0.85\n", + " Drag force = 1935\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.5 Page No : 396" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "bi= 70. \t#degrees outlet angels\n", + "i= 8. \t#degrees incidence angle\n", + "bo= 130. \t#degrees outlet angels\n", + "s= 5. \t#degrees\n", + "vi= 1200. \t#ft/sec\n", + "g= 32.2 \t#ft/sec**2\n", + "a= 0.48\n", + "s1= 1.4 \t#in\n", + "b= 5. \t#in\n", + "Cx= 0.06 # co-efficient \n", + "\t\n", + "#CALCULATIONS\n", + "O= bo-s-bi+i\n", + "Vo= vi*math.sin(math.radians(bi-i))/math.sin(math.radians(bo-s))\n", + "Fy= -a*vi*math.sin(math.radians(bi-i))*(s1/12)*(b/12)*(Vo*math.cos(math.radians(bo-s))-vi*math.cos(math.radians(bi-i)))/g\n", + "dp= a*(Vo**2*(1+Cx)-vi**2)/(2*g)\n", + "\t\n", + "#RESULTS\n", + "print 'Fluid deflection angle = %.f degrees'%(O)\n", + "print ' Vo = %.f ft/sec'%(Vo)\n", + "print ' Force on each blade = %.f lbf'%(Fy)\n", + "print ' Pressure difference = %.f lbf/ft**2'%(dp)\n", + "\n", + "# note : answer is accurate. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fluid deflection angle = 63 degrees\n", + " Vo = 1293 ft/sec\n", + " Force on each blade = 1002 lbf\n", + " Pressure difference = 2485 lbf/ft**2\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.6 Page No : 397" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "ari= 62. \t#degrees\n", + "aro= 125. \t#degrees\n", + "vri= 1200. \t#ft/sec\n", + "vro= 1294. \t#ft/sec\n", + "vrr= 550. \t#ft/sec velocity\n", + "\t\n", + "#CALCULATIONS\n", + "v1= vri*math.sin(math.radians(ari))\n", + "v2= vrr+vri*math.cos(math.radians(ari))\n", + "vi= math.sqrt(v1**2+v2**2)\n", + "ai= round(math.degrees(math.atan(v1/v2)),1)\n", + "vo= round(vro*math.sin(math.radians(aro)))\n", + "vo1= round(vro*math.cos(math.radians(aro))+vrr)\n", + "vo2= round(math.sqrt(vo**2+vo1**2))\n", + "ao= math.degrees(math.atan(vo/vo1))+180\n", + "\n", + "#RESULTS\n", + "print ' absolute velocity = %.f ft/sec'%(vi)\n", + "print ' direction = %.1f degrees'%(ai)\n", + "print ' absolute velocity = %.f ft/sec'%(vo2)\n", + "print ' direction = %.1f degrees'%(ao)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " absolute velocity = 1537 ft/sec\n", + " direction = 43.6 degrees\n", + " absolute velocity = 1077 ft/sec\n", + " direction = 100.3 degrees\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch11.ipynb b/Basic_Fluid_Mechanics/ch11.ipynb new file mode 100755 index 00000000..1a38341e --- /dev/null +++ b/Basic_Fluid_Mechanics/ch11.ipynb @@ -0,0 +1,443 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d460554b2abe6f6d6700d68291fcbf83cdf7b3bd9d716f5a9395eef88b744934" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 : Turbomachines:Elementary Analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1 Page No : 426" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from sympy.functions.elementary.trigonometric import acot\n", + "\n", + "#initialisation of variables\n", + "rt= 1.3 \t#ft\n", + "rr= 0.6 \t#ft\n", + "Q= 75. \t#ft**3 flow rate\n", + "rm= 0.95\n", + "w1= 40. \t#rev/sec \n", + "bim= 153. \t#degrees blade inlet angle\n", + "bom= 147. \t#degrees blade outlet angle\n", + "w= 62.4 \t#lb/ft**3\n", + "g= 32.2 \t#ft/sec**2\n", + "\t\n", + "#CALCULATIONS\n", + "A= round(math.pi*(rt**2-rr**2),2)\n", + "Va= round(Q/A,2)\n", + "Vbm= rm*w1\n", + "#a= -1/math.degrees(math.atan(-Vbm/Va))\n", + "a = math.degrees(acot(-Vbm/Va))\n", + "im= a-bim\n", + "vwm= Vbm+Va*1/math.tan(math.radians(bom))\n", + "dvwm= rm*vwm\n", + "C= w*Q*dvwm/g\n", + "Cw= C*w1\n", + "dp= Cw/Q\n", + "\n", + "#RESULTS\n", + "print ' Incidence = %.1f degrees'%(im) \n", + "print ' Oulet velocity = %.2f ft/sec'%(vwm)\n", + "print ' Change of whirl at the mean radius = %.2f ft**2/sec'%(dvwm)\n", + "\n", + "print ' Torque = %.f lbf/ft'%(C)\n", + "print ' Rate of working = %.f ft lbf/sec'%(Cw)\n", + "print ' Workdone by the rotor = %.f lbf/ft**2'%(dp)\n", + "\n", + "# note : answer in book is wrong. please check manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Incidence = -178.3 degrees\n", + " Oulet velocity = 10.37 ft/sec\n", + " Change of whirl at the mean radius = 9.86 ft**2/sec\n", + " Torque = 1432 lbf/ft\n", + " Rate of working = 57300 ft lbf/sec\n", + " Workdone by the rotor = 764 lbf/ft**2\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2 Page No : 428" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#initialisation of variables\n", + "vbm= 38. \t#ft/sec\n", + "va= 17.94 \t#ft/sec\n", + "a= 147.5 \t#degrees\n", + "vwm= 10.37 \t#ft/sec\n", + "C= 1430. \t#lbf/ft\n", + "P= 763. \t#lbf/ft**2\n", + "\t\n", + "#CALCULATIONS\n", + "vwm1= vbm+va*1/math.tan(math.radians(a))\n", + "p= (vwm-vwm1)/vwm\n", + "C1= C*(1-p)\n", + "P1= P*(1-p)\n", + "\t\n", + "#RESULTS\n", + "print ' Oulet Velocity = %.2f ft/sec'%(vwm1) \n", + "print ' Torque = %.f lbf/ft'%(round(C1,-1))\n", + "print ' Workdone by the rotor = %.f lbf/ft**2'%(P1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Oulet Velocity = 9.84 ft/sec\n", + " Torque = 1360 lbf/ft\n", + " Workdone by the rotor = 724 lbf/ft**2\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3 Page No : 430" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "from sympy.functions.elementary.trigonometric import acot\n", + "\t\n", + "#initialisation of variables\n", + "a= 154 \t #degrees\n", + "vbm= 38 \t#ft/sec\n", + "bom= 147 \t#degrees outlet angle\n", + "vwm= -7.78 \t#ft/sec outlet whirl velocity\n", + "w= 62.4 \t#lbf/ft**3\n", + "g= 32.2 \t#ft/sec**2\n", + "vb= 38 \t#ft/sec velocity\n", + "A= 4.18 \t#ft**2 flow area\n", + "e= 0.95\n", + "\t\n", + "#CALCULATIONS\n", + "vat= (vwm-vb)*math.tan(math.radians(bom))\n", + "Q= vat*A\n", + "#a1= 1/math.tan(math.radians(-vbm/vat))\n", + "a1 = math.degrees(acot(-vbm/vat))\n", + "imt= a1-a\n", + "C= w*Q*vwm*e/g\n", + "\n", + "#RESULTS\n", + "print ' Flow rate = %.1f ft**3'%(Q)\n", + "print ' Incidence angle= %.f degrees'%(imt)\n", + "print ' Torque= %.f lbf ft'%(C)\n", + "#Incorrect value for a1 in textbook. Hence the difference in answers" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Flow rate = 124.3 ft**3\n", + " Incidence angle= -192 degrees\n", + " Torque= -1780 lbf ft\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4 Page No : 435" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from numpy import *\n", + "\t\n", + "#initialisation of variables\n", + "rt= 0.5 \t#ft radius\n", + "rr= 0.16 \t#ft root radius\n", + "dv1= 88.3 \t#ft/sec\n", + "b= 150. \t#degrees\n", + "r= array([0.16, 0.3, 0.5])\n", + "vw= array([2.5, 5, 7.5])\n", + "vb= array([46.6, 88.3, 132.5])\n", + "vrb= array([44.16, 88.3, 132.5])\n", + "v1= array([-1.154, -0.385])\n", + "\t\n", + "#CALCULATIONS\n", + "A= math.pi*(rt**2-rr**2)\n", + "Va= -dv1*math.tan(math.radians(b))\n", + "Q= Va*A\n", + "ari = degrees((arctan(Va/(vw - vb)))) + 180\n", + "ari = array([ari[0],ari[2]])\n", + "#a= tan(radians(v1))+180\n", + "b = degrees(math.tan(0.577))\n", + "i = ari - 150\n", + "\n", + "#RESULTS\n", + "print ' Velocity = %.2f ft/sec'%(Va)\n", + "print ' Flow rate = %.1f ft**3'%(Q)\n", + "\n", + "print (v1)\n", + "print (ari)\n", + "print (i)\n", + "\n", + "# rounding off error. and for 'i' answer is wrong. please check. " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Velocity = 50.98 ft/sec\n", + " Flow rate = 35.9 ft**3\n", + "[-1.154 -0.385]\n", + "[ 130.86126801 157.81238868]\n", + "[-19.13873199 7.81238868]\n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5 Page No : 436" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from numpy import *\n", + "\t\n", + "#initialisation of variables\n", + "rt= 0.5 \t#ft\n", + "rr= 0.16 \t#ft\n", + "dv1= 88.3 \t#ft/sec\n", + "b= 150. \t#degrees\n", + "a= 5. \t#degrees mean radius\n", + "v1= array([-0.933 ,-0.311])\n", + "i= array([1.0, 5.0 ,6.7])\n", + "\t\n", + "#CALCULATIONS\n", + "b1= b+a\n", + "A= math.pi*(rt**2-rr**2)\n", + "Va= -dv1*math.radians(math.tan(b1))\n", + "Q= Va*A\n", + "a1= degrees(tan(v1))+180\n", + "\n", + "\t\n", + "#RESULTS\n", + "print ' Velocity = %.2f ft/sec'%(Va)\n", + "print ' Flow rate = %.1f ft**3/sec'%(Q)\n", + "\n", + "print (v1)\n", + "print (a1)\n", + "print (i)\n", + "#Incorrect calculations in textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Velocity = -2.76 ft/sec\n", + " Flow rate = -1.9 ft**3/sec\n", + "[-0.933 -0.311]\n", + "[ 102.69071396 161.58339075]\n", + "[ 1. 5. 6.7]\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6 Page No : 439" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "r= 1. \t#in\n", + "b= 0.75 \t#in rotor inlet width\n", + "w= 180. \t#rev/sec\n", + "B= 120. \t#degrees blade inlet angle\n", + "Bo= 150. \t#degrees blade outlet angle\n", + "ro= 3. \t#ft\n", + "bo= 0.5 \t#ft\n", + "Vbo= 180. \t#ft/sec\n", + "w1= 62.4 \t#lbf/ft**3 density\n", + "g= 32.2 \t#ft/sec**2\n", + "\t\n", + "#CALCULATIONS\n", + "Q= -2*math.pi*(r/12)**2*(b/12)*w*math.tan(math.radians(B))\n", + "Vfo= Q/(2*math.pi*(ro/12)*(bo/12))\n", + "Vwo= Vbo*(ro/12)+Vfo*1/math.tan(math.radians(Bo))\n", + "C= w1*Q*Vwo*(ro/12)/g\n", + "dp= w1*Vwo*w*(ro/12)/g\n", + "ari= degrees(math.atan((-Q*0.8/(2*math.pi*(r/12)**2*(b/12)*w))))+180\n", + "i1= ari-B\n", + "\n", + "#RESULTS\n", + "print ' Flow rate = %.2f ft**3/sec'%(Q)\n", + "print ' radial velocity= %.2f ft/sec'%(Vfo)\n", + "print ' outlet whirl velocity= %.2f ft/sec'%(Vwo)\n", + "print ' Torque= %.2f lbf ft'%(C)\n", + "print ' Stagnant pressure = %.f lbf/ft**2'%(dp)\n", + "print ' Incidence angle = %.1f degrees'%(i1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Flow rate = 0.85 ft**3/sec\n", + " radial velocity= 12.99 ft/sec\n", + " outlet whirl velocity= 22.50 ft/sec\n", + " Torque= 9.27 lbf ft\n", + " Stagnant pressure = 1962 lbf/ft**2\n", + " Incidence angle = 5.8 degrees\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.7 Page No : 447" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "r= 1.4\n", + "Mai= 0.5 \t#ft/sec mach number\n", + "T= 582. \t#R temperature\n", + "psi= 3040. \t#lbf/in**2 pressure\n", + "R= 53.3 \t #ft lbf/lbm gas\n", + "g= 32.2 \t#ft/sec**2\n", + "Vwi= 300. \t#ft/sec velocity\n", + "m= 35. \t#lb/sec\n", + "rm= 0.7 \t #ft radius\n", + "rp= 4.25\n", + "w= 1200. \t#rev/sec\n", + "cp= 0.24\n", + "J= 778. \t#lb\n", + "\t\n", + "#CALCULATIONS\n", + "tr= 1+0.5*(r-1)*Mai**2\n", + "Ti= round(T/tr)\n", + "pr= tr**(r/(r-1))\n", + "pi= psi/pr\n", + "ai= pi/(R*Ti)\n", + "Vi= Mai*(r*R*g*Ti)**0.5\n", + "Vai= math.sqrt(Vi**2-Vwi**2)\n", + "h= m/(2*math.pi*ai*rm*Vai)\n", + "pr1= rp**(1./12)\n", + "Vwo= Vwi+(pr1**((r-1)/r)-1)*(cp*J*g*T/(rm*w))\n", + "BO= 1/math.tan(math.radians((Vwo-w*rm)/Vai))\n", + "\n", + "\n", + "#RESULTS\n", + "print ' Absolute air velocity = %.f ft/sec'%(Vi)\n", + "print ' air velocity = %.f ft/sec'%(Vai)\n", + "print ' Blade height = %.3f ft'%(h)\n", + "print ' velocity = %.f ft/sec'%(Vwo)\n", + "print ' outlet balde angle = %.1f degrees'%(BO) #incorrect answer in the textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Absolute air velocity = 577 ft/sec\n", + " air velocity = 493 ft/sec\n", + " Blade height = 0.186 ft\n", + " velocity = 446 ft/sec\n", + " outlet balde angle = -71.7 degrees\n" + ] + } + ], + "prompt_number": 30 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch12.ipynb b/Basic_Fluid_Mechanics/ch12.ipynb new file mode 100755 index 00000000..61bd9af9 --- /dev/null +++ b/Basic_Fluid_Mechanics/ch12.ipynb @@ -0,0 +1,302 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:747d23d1d49d9ec45297f78a51cc698e8f77e86dac46ee6fa2ac037964e152b9" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12 : Turbomachines: Further Analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1 Page No : 461" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%pylab inline\n", + "from matplotlib.pyplot import *\n", + "import math \n", + "\t\n", + "#initialisation of variables\n", + "d= 0.0764 \t #lbm/ft**3\n", + "u= 3.74*10**-7 \t #lbf sec/ft**2\n", + "D= 15. \t#in\n", + "g= 32.2 \t #ft/sec**2\n", + "p= 14.7 \t #lb/in**2\n", + "r1= [0.02, 0.04, 0.06, 0.08, 0.1, 1.15]\n", + "r2= [0.0338, 0.0267, 0.0199, 0.0159, 0.0132, 0.0100]\n", + "r3= [0.46, 0.92, 1.38, 1.84, 2.3, 2.64]\n", + "r4= [2.97, 2.35, 1.75, 1.4, 1.16, 0.88]\n", + "r5= [0.0206, 0.0163, 0.0121, 0.0097, 0.0081, 0.0061]\n", + "\t\n", + "#CALCULATIONS\n", + "re= (d/u)*(p*100*2*math.pi/60)*(D/12)**2/g\n", + "\t\n", + "#RESULTS\n", + "print 'Reynolds Number = %.2e '%(re)\n", + "print \"m/qwD**3 g0deltaPe/QW**2D**2 m(lbm/sec) deltap(lbf/ft**2) deltap(lbf/in**2)\"\n", + "for i in range(len(r1)):\n", + " print \"%7.2f %8.4f %7.2f %7.2f %8.4f\"%(r1[i],r2[i],r3[i],r4[i],r5[i])\n", + "\n", + "plot(r3,r5)\n", + "xlabel(\"m lbm/sec\")\n", + "ylabel( \"dPs lbf/ft**2\") \n", + "suptitle(\"Actual perfomance curve\")\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Populating the interactive namespace from numpy and matplotlib\n", + "Reynolds Number = 1.53e+06 \n", + "m/qwD**3 g0deltaPe/QW**2D**2 m(lbm/sec) deltap(lbf/ft**2) deltap(lbf/in**2)\n", + " 0.02 0.0338 0.46 2.97 0.0206\n", + " 0.04 0.0267 0.92 2.35 0.0163\n", + " 0.06 0.0199 1.38 1.75 0.0121\n", + " 0.08 0.0159 1.84 1.40 0.0097\n", + " 0.10 0.0132 2.30 1.16 0.0081\n", + " 1.15 0.0100 2.64 0.88 0.0061\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 1, + "text": [ + "<matplotlib.text.Text at 0x1c015d0>" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEhCAYAAABV3CYhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtclGXex/HPIApmB01FiyE1tYzhrEYecMlDBGoesIe0\nSMV23TYzs3ystvLwVJsdttTKTE0r3cqw0kIpU9CydK1Ry9rSXE2GttZDlqnkINfzx10TiCAIwzDw\nfb9evprDdd/zu7h7zW+u+zrZjDEGERGRMxTg6wBERMS/KZGIiEiVKJGIiEiVKJGIiEiVKJGIiEiV\nKJGIiEiVKJFIjXnzzTcJCAjgq6++Om3ZJ598kmPHjp3xZy1atIhbb731jI8vz6uvvsoll1xCnz59\nvHJ+EX+jRCI15uWXX2bAgAG8/PLLpy07c+ZMjh49esafZbPZzvjYshhjKCoqYuHChSxatIg1a9ZU\n+2fUVkVFRb4OQWoxJRKpET///DObNm3iqaee4tVXX/W8XlhYyC233MJll11GdHQ0M2fOZPbs2Xz7\n7bdceeWVnl/9Z599tueYzMxMRo8eDcCKFSuIj48nMjKSXr168Z///KfcOKZOnUp6ejoJCQm0b9+e\np59+2vPe9OnTiYqK4rLLLuPuu+8GYM+ePVx66aWMGjWKmJgYHnzwQTZs2EBGRgaTJ0+moKCA4cOH\n43A4iIyM5J133gGsFtHgwYNJTk6mXbt2PPXUUzz22GN06dKFuLg49u/fD8DcuXO5/PLLcTgcDBw4\nkJ9//hmAUaNGcdttt9GrVy8uuugi/vGPf3jinDZtGpdddhkxMTFMnjwZgK+++oorr7yS6Oho4uPj\n+fzzz0vV/fDhw1x33XU4HA6io6NZtmxZuX/bUaNG8ec//5kePXowadIk2rVrx48//ugp27FjR/bt\n28d3333HgAEDiI6OJiYmhnXr1pV7DaQOMiI1YPHixWbs2LHGGGMSEhLMJ598Yowx5u9//7tJS0vz\nlDt06JAxxpi2bduaAwcOeF4/++yzPY8zMzPNqFGjjDHG/Pjjj57X582bZ8aNG2eMMWbhwoWex8VN\nmTLFxMTEGLfbbX744QcTGhpq9u7da5YvX27+9Kc/GWOMOXHihBkwYIBZvXq12b17twkICDAff/yx\n5xyJiYme+B988EHPcTt37jStW7c2x44dMwsXLjQdOnQwx44dM/v27TPnnnuumT9/vjHGmNtvv908\n+uijpeK/9957zWOPPWaMMWbUqFHmuuuuM8YY88UXX5g2bdoYY4x5/fXXTY8ePczx48dLHN+9e3ez\nc+dOY4wxGzduND169ChV9/Hjx5s777zT8/y3Y8v6244cOdIMHjzY895tt91mFi5c6PmMfv36GWOM\nGTJkiPnggw+MMcZ88803pn379qU+W+q2QF8nMqkfXn75ZW6//XYArr32Wl5++WXi4uJYs2aN53WA\n8847r1Ln/frrr5k4cSIHDhzA7XZz0UUXlVveZrMxaNAgAgMDadq0KX369GHjxo2sW7eOd999l9jY\nWACOHDnCnj176NChA23atKFz586nPN+GDRuYNGkSAB06dKBjx45s374dm83GlVdeSXBwMMHBwTRt\n2pSUlBQAIiMj2bp1KwCbNm3ivvvu49ixYxw+fJi+fft6zn3NNdcAcNlll3laMO+99x6jR4+mYcOG\nAJx77rns378fp9PJtdde6zn2VP1La9asYfny5Z7n55577mn/VkOHDvU8T0tLY/r06YwaNYpXXnmF\ntLQ0T0y7d+/2lPvll184fPgw55xzTrnnl7pDiUS87uDBg+Tk5Hi+YE+cOEFAQACPPvooYPU9nE7x\nMsW/JMeNG8e9995LSkoK69atY+rUqZWO77f+lPvuu4+MjIwS7+3Zs4cmTZpUOLbi5wsKCvK8FhAQ\n4Hlus9k8fQ4jR45k9erVOBwOXnjhBXJzcz3HNGrUqNQ5bTZbqc8zxtCyZUu2bNly2rqe6m9d1t8W\n4KyzzvI8vuKKK/j666/Zv38/y5cv5/777/fEtHnzZgID9XVSX6mPRLwuMzOTG2+8kT179rB79272\n7t1L27Ztef/99+nXrx/z5s3zfJn9dg++cePGHDlyxHOO5s2b8+WXX2KM4c033/R8sRYUFNC6dWsA\nXnzxxdPGYoxhx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siHoqNpuNwYMHExgYSNOmTenTpw8bN24kJCSErl270qJFCwA6dOhA3759Pedds2YNYG1oFh8f\nD0C3bt0YM2YMx44dY+DAgcTFxbFq1Sp27txJ9+7dAWtjovj4eD799FPatm1LdHQ08PvGRSI1QYlE\n5CRBQUGexwEBATRq1MjzuKioqNLn+20hv5PP+9vz4uddtWqVZ5XnhIQE1q9fT1ZWFjfddBMTJkzg\nrLPOIjk5mRdffLHEZ3z88ceVjkukuqiPRKQaGWNYsWIFbrebQ4cOsWbNGuLj4yu8JevatWs9LRWX\ny0VISAhjxowhIyODjz/+mISEBHJycjyr0BYUFLBr1y6ioqLYs2cPW7duBeDIkSOcOHHCO5UUOYla\nJCInOXnkVfHnpxqVZbPZPK/bbDYiIyPp3bs3+fn53HPPPdjtdnbt2lXmiK7fjt+/fz/BwcE0adIE\ngDVr1vDYY4/RsGFDzjnnHJ5//nlatWrFc889xzXXXANYW6Y++OCDtG/fnldffZWMjAyKiooIDg5m\nzZo1nnOJeJOWkRepJZYsWUJ+fj7/+7//6+tQRCpFiURERKpEfSQiIlIlSiQiIlIlSiQiIlIlSiQi\nIlIlSiQiIlIlSiQiIlIlSiQiIlIl/w/IbjDGd8tQDQAAAABJRU5ErkJggg==\n", + "text": [ + "<matplotlib.figure.Figure at 0x1c01590>" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.2 Page No : 464" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "psif= 10.2 \t#lbf/in**2 pressure\n", + "usit= 3.8*10**-7 \t#lbf sec/ft**2 viscosity\n", + "usif= 3.52*10**-7 \t#lbf sec/ft**2 viscosity\n", + "Tsit= 530. \t#R temperature\n", + "Tsif= 480. #R temperature\n", + "wf= 15000. \t#rev/min speed\n", + "\t\n", + "#CALCULATIONS\n", + "Psit= psif*usit*math.sqrt(Tsit/Tsif)/usif\n", + "wt= wf*math.sqrt(Tsit/Tsif)\n", + "\t\n", + "#RESULTS\n", + "print 'Pressure in the test cell = %.1f lbf/in**2'%(Psit) \n", + "print ' Compressor speed = %.f rev.min'%(wt) \n", + "\n", + "# book answer is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure in the test cell = 11.6 lbf/in**2\n", + " Compressor speed = 15762 rev.min\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.3 Page No : 474" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "w= 62.3 \t#lbf/ft**3 weight\n", + "d= 0.375 \t#in diameter\n", + "ro= 0.75 \t#ft radius\n", + "l= 1.25 \t#ft length\n", + "b= 120. \t#degrees angle\n", + "do= 0.25 \t#in diameter\n", + "p= 750. \t#lbf/in**2\n", + "g= 32.1 \t#ft/sec**2\n", + "f= 0.03 # friction factor\n", + "f1= 0.9\n", + "f2= 0.3\n", + "w1= 60. \t#rad/sec\n", + "\t\n", + "#CALCULATIONS\n", + "Q= math.sqrt(((p/w)+((60*ro)**2/(2*g))+do)*math.pi**2*g*(d/12)**4/((d/do)**4-1+(l*f/(d/12))+f1+f2))*0.353\n", + "Vwo= w1*ro+(4*Q/(math.pi*(do/12)**2))*math.cos(math.radians(b))\n", + "C= w*Q*Vwo*ro/g\n", + "\t\n", + "#RESULTS\n", + "print ' Flow Rate = %.4f ft**3/sec'%(Q) \n", + "print ' Vwo = %.2f ft/sec'%(Vwo) \n", + "print ' Driving Torque = %.3f lbf ft'%(C) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Flow Rate = 0.0160 ft**3/sec\n", + " Vwo = 21.56 ft/sec\n", + " Driving Torque = 0.502 lbf ft\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.4 Page No : 491" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "W= 38. \t#rev/sec speed\n", + "w= 62.4 \t#lbf/ft**3 density\n", + "m= 2000. \t#lbm/sec flow rate\n", + "g= 32.2 \t#ft/sec**2\n", + "ps= 5000. \t#lbf/ft**2 pressure rise\n", + "S3= 4.6\n", + "e= 0.91\n", + "\t\n", + "#CALCULATIONS\n", + "S1= W*(w*m**2/(g*ps)**3)**0.25\n", + "D= S3*(m**2/(w*g*ps))**0.25\n", + "\t\n", + "#RESULTS\n", + "print ' S1 = %.3f'%(S1) \n", + "print ' Diameter = %.2f ft'%(D) \n", + "print ' efficiency = %.2f '%(e)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " S1 = 0.594\n", + " Diameter = 3.65 ft\n", + " efficiency = 0.91 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.5 Page No : 495" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "d= 6. \t#in diameter\n", + "f= 0.25\n", + "l= 1200. \t#ft long\n", + "p= 55. \t#lbm/ft**3\n", + "w= 740. \t#rev/min\n", + "g= 32.2 \t#ft/sec**2\n", + "n= 0.87 # efficiency\n", + "d1= 1.78 \t#ft\n", + "\t\n", + "#CALCULATIONS\n", + "D= (0.13*math.pi**2*(d/12)**5/(8*f*l*0.012**2))**0.25*d1\n", + "m= 0.012*p*(w*2*math.pi/60)*D**3\n", + "dps= 0.13*p*(w*2*math.pi*D/60)**2/g\n", + "P= m*10*dps/(p*n)\n", + "\t\n", + "#RESULTS\n", + "print ' Diameter = %.2f ft'%(D) \n", + "print ' Mass flow rate = %.1f lbm/sec'%(m) \n", + "print ' pressure rise = %.1f lbf/ft**2'%(round(dps,-1))\n", + "print ' shaft power = %.2e ft lbf/sec'%(P)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Diameter = 1.04 ft\n", + " Mass flow rate = 57.3 lbm/sec\n", + " pressure rise = 1440.0 lbf/ft**2\n", + " shaft power = 1.72e+04 ft lbf/sec\n" + ] + } + ], + "prompt_number": 5 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch13.ipynb b/Basic_Fluid_Mechanics/ch13.ipynb new file mode 100755 index 00000000..6819ab71 --- /dev/null +++ b/Basic_Fluid_Mechanics/ch13.ipynb @@ -0,0 +1,185 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:943d4576ca0c6a409710e5e5dfd3597778d333997c650e03aa4c9f933860e70a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13 : Hydraulic Power Transmission|" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1 Page No : 512" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "nop= 0.88\n", + "nom= 0.88 # constant\n", + "Pm= 75. \t#hp\n", + "p= 3000. \t#lb/in**2 pressure\n", + "d= 54.5 \t#lbm/ft**3 density\n", + "u= 1.05*10**-4 # viscosity\n", + "d1= 0.5 \t#in\n", + "g= 32.2 \t#ft/sec**2\n", + "\t\n", + "#CALCULATIONS\n", + "nt= (7./11)*nop*nom\n", + "pp= Pm/nt\n", + "Q= nop*pp*550/(p*144)\n", + "Re= 4*d*Q/(math.pi*u*(d1/12)*g)\n", + "\t\n", + "#RESULTS\n", + "print ' ntrans = %.3f '%(nt)\n", + "print ' Input power = %.f hp'%(pp)\n", + "print ' Flow rate = %.3f ft**3/sec'%(Q)\n", + "print ' Reynolds Number = %.1e '%(Re)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ntrans = 0.493 \n", + " Input power = 152 hp\n", + " Flow rate = 0.171 ft**3/sec\n", + " Reynolds Number = 8.4e+04 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2 Page No : 513" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "lc= 0.25\n", + "a= 90. \t#degrees\n", + "p= 3000. \t#lb/in**2 pressure\n", + "g= 32.2 \t#ft/sec**2\n", + "d1= 0.5 \t#in\n", + "Q= 0.171 \t#ft**3/sec\n", + "d= 54.5 \t#lbm/ft**3 density\n", + "n1= 2. \n", + "n2= 6.\n", + "lc1= 0.9\n", + "nop= 0.88\n", + "nom= 0.88\n", + "\t\n", + "#CALCULATIONS\n", + "P1= 4*p*144/11\n", + "P2= 8*d*Q**2*(n1*lc+n2*lc1)/(math.pi**2*(d1/12)**4*g)\n", + "pt= P1+P2\n", + "dpm= (p*144-pt)\n", + "ntrans= nop*nom*dpm/(p*144)\n", + "\t\n", + "#RESULTS\n", + "print ' Frictional pressure drop = %.2e lbf/ft**2'%(P1) \n", + "print ' Extra Frictional pressure drop = %.2e lbf/ft**2'%(P2) \n", + "print ' Total pressure drop = %.2e lbf/ft**2'%(pt)\n", + "print ' Motor pressure drop = %.2e lbf/ft**2'%(dpm)\n", + "print ' Overall transmission coefficiency = %.3f'%(ntrans)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Frictional pressure drop = 1.57e+05 lbf/ft**2\n", + " Extra Frictional pressure drop = 7.85e+04 lbf/ft**2\n", + " Total pressure drop = 2.36e+05 lbf/ft**2\n", + " Motor pressure drop = 1.96e+05 lbf/ft**2\n", + " Overall transmission coefficiency = 0.352\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.3 Page No : 521" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "bip= 135. \t#degrees inlet angle\n", + "bop= 150. \t#degrees outlet angle\n", + "bot= 140. \t#degrees turbine outlet angle\n", + "bos= 137. \t#degrees stator blade outlet angle\n", + "r= 1.8 \n", + "r1= 1.8 # ratio b1/b2\n", + "r2= 0.7 # ratio b1/b3\n", + "r3= 0.95 # ratio r3/r1\n", + "\t\n", + "#CALCULATIONS\n", + "Vw2r2byVw1r1 = (1+(1/math.tan(math.radians(bip))/1/math.tan(math.radians(bos))))*r**2-r1*(1/math.tan(math.radians(bop))/1/math.tan(math.radians(bos)))\n", + "Vw3r3byVw1r1 = r2*r3**2*(1+(1/math.tan(math.radians(bip))/1/math.tan(math.radians(bos))))-(1/math.tan(math.radians(bot))/1/math.tan(math.radians(bos)))\n", + "CtbyCp = (Vw2r2byVw1r1-Vw3r3byVw1r1)/(Vw3r3byVw1r1-1)\n", + "\t\n", + "#RESULTS\n", + "print ' R1 = %.2f'%(Vw2r2byVw1r1) \n", + "print ' R2 = %.2f'%(Vw3r3byVw1r1) \n", + "print ' Torque ratio = %.2f'%(CtbyCp)\n", + "\n", + "# rounding off error. please check. instead of cot, have used 1/tan. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " R1 = 3.37\n", + " R2 = 0.03\n", + " Torque ratio = -3.45\n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch14.ipynb b/Basic_Fluid_Mechanics/ch14.ipynb new file mode 100755 index 00000000..9cfe7a00 --- /dev/null +++ b/Basic_Fluid_Mechanics/ch14.ipynb @@ -0,0 +1,148 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:bc77360c046c25bc1074d9e1441ee10dd742c14709d1f92baa61c939b8a28b76" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14 : Further Developments" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1 Page No : 532" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%pylab inline\n", + "import math \n", + "from matplotlib.pyplot import *\n", + "\t\n", + "#initialisation of variables\n", + "a= 60.5\n", + "Q= 0.2 \t#ft**3/sec flow rate\n", + "d= 3. \t#in diameter\n", + "u= 0.0325\n", + "g= 32.2 \t#ft/sec**2\n", + "T= [50.0, 60.0, 70.0, 80.0, 90.0, 100.0]\n", + "Ep= [294.5, 188.6, 113.2, 60.4, 37.7, 24.5]\n", + "Eh= [0 ,69.9, 139.8, 209.7, 279.5, 349.4]\n", + "Et= [295, 258, 253, 270, 317, 374]\n", + "\t\n", + "#CALCULATIONS\n", + "re= a*4*Q/(math.pi*(d/12)*u*g)\n", + "\t\n", + "#RESULTS\n", + "print 'Reynolds Number = %.1f '%(re)\n", + "print (T)\n", + "print (Ep)\n", + "print (Eh)\n", + "print (Et)\n", + "plot(T,Ep)\n", + "plot(T,Eh)\n", + "plot(T,Et)\n", + "\n", + "xlabel(\"T (F)\")\n", + "ylabel(\"Eh,Ep,Eh&Ep (kW)\")\n", + "suptitle(\"Variations of Ep, Eh and (Ep+Eh) with T\")\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Populating the interactive namespace from numpy and matplotlib\n", + "Reynolds Number = 58.9 \n", + "[50.0, 60.0, 70.0, 80.0, 90.0, 100.0]\n", + "[294.5, 188.6, 113.2, 60.4, 37.7, 24.5]\n", + "[0, 69.9, 139.8, 209.7, 279.5, 349.4]\n", + "[295, 258, 253, 270, 317, 374]\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 1, + "text": [ + "<matplotlib.text.Text at 0x2b11ed0>" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEhCAYAAABhpec9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xtczvf7wPFXNeccJnIKmTmV0sFhKHKMYma2YRg2xoaS\n44ZNGM2GsNl+9p0xs4PDbLblOMqZME2OI0zlVHKKzr1/f3zWTVRS3d33Xdfz8ejh7u7+fD7XfZf7\nut+n622mlFIIIYQQ2TA3dABCCCGMmyQKIYQQOZJEIYQQIkeSKIQQQuRIEoUQQogcSaIQQgiRI0kU\nJqZjx45s3bo1030LFy7k3XffzfU5pk+fzvbt23N8zLfffsuVK1d03w8fPpxTp049XbAFYPz48TRp\n0oTJkydnun/FihVUrVoVZ2dn3dfp06fzdI0hQ4bw3HPP6c7j5uYGgL+/P/Pnz8/3c3gSW1tb4uLi\nsvxZ586duXv3LgAWFhaZnu8nn3ySr+tevHiRMmXKZDrnqlWrALC0tMzymMWLF/Pdd9/l6Xq///47\nc+fOBeDXX3/N9Pfk4eHBkSNHsj02PDxcF6OVlZXu99W1a9c8xSKekhIm5auvvlJDhw7NdN8LL7yg\ndu/enavj09LScvU4Dw8Pdfjw4aeOr6BVrFhRpaenP3b/ihUr1JgxYwrkGkOGDFE///zzY/f7+/ur\nefPmFcg1cmJra6tu3Ljx2P3bt29X7777ru57S0vLPF+jffv26uLFi5nuu3DhgmratGmWj8/uWnfu\n3FEtWrTIcxwZBg8erNatW6f7/mn+3rL7fQn9kRaFienTpw9BQUGkpqYC2qfCy5cv4+bmxogRI2jR\nogUNGzbkvffe0x1ja2vLe++9R6tWrVi3bh1Dhgzh559/BrRPzS1btqRx48YMGTKE9PR01q1bx+HD\nhxkwYAAuLi4kJiZm+sS3fPly7OzssLOzY+zYsbrrWFpaMm3aNN0nv4wWyY8//oiDgwPOzs64u7s/\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+ ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.2 Page No : 535" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "wcb= 2. \t#ton weighing\n", + "wc= 100. \t #ton\n", + "wa= 6.5 \t #% of the weight\n", + "wca= 20. \n", + "r= 0.8\n", + "r1= 1.2\n", + "\t\n", + "#CALCULATIONS\n", + "wca1= wc/wa\n", + "wca2= wcb*(wca1/wca)**1.5\n", + "Wca= wcb*r**(9./4)*(1./r1)**(9./4)*(wca1/wca)**1.5\n", + "\t\n", + "#RESULTS\n", + "print ' Wc/Wa = %.2f '%(wca1)\n", + "print ' Wc,a = %.2f ton'%(wca2)\n", + "print ' Wc,a = %.2f ton'%(Wca)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Wc/Wa = 15.38 \n", + " Wc,a = 1.35 ton\n", + " Wc,a = 0.54 ton\n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch2.ipynb b/Basic_Fluid_Mechanics/ch2.ipynb new file mode 100755 index 00000000..eab5eede --- /dev/null +++ b/Basic_Fluid_Mechanics/ch2.ipynb @@ -0,0 +1,309 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:30849a845cb23e6184901c441ceb4a2e2451d5db6a2c0f60dce1b23531e4d077" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : Similarity" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1 Page No : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "r= 4.\n", + "l1= 4 \t#units long axis\n", + "l2= 10 \t#units long axis\n", + "\t\n", + "#CALCULATIONS\n", + "sxy= (4/r)\n", + "sxy1= l1**2\n", + "sxy2= l2**2\n", + "\t\n", + "#RESULTS\n", + "print 'x**2+4*y**2 = %.f '%(sxy)\n", + "print ' x**2+4*y**2 = %.f '%(sxy1)\n", + "print ' x**2+4*y**2 = %.f '%(sxy2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "x**2+4*y**2 = 1 \n", + " x**2+4*y**2 = 16 \n", + " x**2+4*y**2 = 100 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3 Page No : 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#initialisation of variables\n", + "vo= 10 \t#ft/sec\n", + "a= 0.5 \t#ft**-1\n", + "b= 1 \t#ft\n", + "x= -2 \t#ft\n", + "y= 2 \t#ft\n", + "b1= 2\n", + "a1= 3./5 \t#ft\n", + "\t\n", + "#CALCULATIONS\n", + "Vx= vo/(a*x**2+b)\n", + "Vy= -2*a*b*vo*x*y/(a*x**2+b)**2\n", + "V= math.sqrt(Vx**2+Vy**2)\n", + "fx= -2*a*b**2*vo**2*x/(a*x**2+b)**3\n", + "fy= 2*a*b**2*vo**2*y*(b-a*x**2)/(a*x**2+b)**4\n", + "f= math.sqrt(fx**2+fy**2)\n", + "r= b1**2/a1\n", + "f1= f*r\n", + "\t\n", + "#RESULTS\n", + "print 'Vx = %.2f ft/sec'%(Vx)\n", + "print ' Vy = %.2f ft/sec'%(Vy)\n", + "print ' V = %.2f ft/sec'%(V)\n", + "print ' fx = %.2f ft/sec**2'%(fx)\n", + "print ' fy = %.2f ft/sec**2'%(fy)\n", + "print ' f = %.2f ft/sec**2'%(f)\n", + "print ' r = %.2f in the present case'%(r)\n", + "print ' f1 = %.2f ft/sec**2'%(f1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Vx = 3.33 ft/sec\n", + " Vy = 4.44 ft/sec\n", + " V = 5.56 ft/sec\n", + " fx = 7.41 ft/sec**2\n", + " fy = -2.47 ft/sec**2\n", + " f = 7.81 ft/sec**2\n", + " r = 6.67 in the present case\n", + " f1 = 52.05 ft/sec**2\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4 Page No : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "r= 1./5\n", + "b1= 2 \t#ft\n", + "a1= 3./5 \t#ft\n", + "\t\n", + "#CALCULATIONS\n", + "r= (a1*b1)**2*r\n", + "\t\n", + "#RESULTS\n", + "print 'ratio of resultant forces acting on coorresponding fluid elements = %.3f '%(r)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "ratio of resultant forces acting on coorresponding fluid elements = 0.288 \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5 Page No : 44" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "vos= 70. \t#ft/sec\n", + "as1= 78. \t#ft density\n", + "am= 72. \t#ft wind-tunnel\n", + "ls1= 6. \t#ft strut section\n", + "lm= 2. \t#ft length\n", + "um= 386. \t#ft/sec\n", + "us= 372. \t#ft/sec\n", + "dm= 0.4\n", + "\t\n", + "#CALCULATIONS\n", + "vom= vos*as1*ls1*um/(am*lm*us)\n", + "Ds= dm*(am/as1)*(us/um)**2\n", + "\t\n", + "#RESULTS\n", + "print 'Air speed = %.f ft/sec'%(vom)\n", + "print ' Ds = %.3f lbf'%(Ds)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air speed = 236 ft/sec\n", + " Ds = 0.343 lbf\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.6 Page No : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "vom= 236. \t#ft/sec\n", + "as1= 0.072 \t#ft\n", + "am = 62.4 \t#ft density of water\n", + "ls1= 2. \t#ft\n", + "lm= 8. \t#ft\n", + "um= 248. \t#ft/sec viscosity\n", + "us= 3.86 \t#ft/sec\n", + "Pm= 0.4/3.3\n", + "\t\n", + "#CALCULATIONS\n", + "voh= vom*as1*ls1*um/(am*lm*us)\n", + "Ds= Pm*(as1/am)*(um/us)**2*(ls1/lm)*(lm-ls1)\n", + "\t\n", + "#RESULTS\n", + "print 'Air speed = %.2f ft/sec'%(voh)\n", + "print ' Drag force = %.3f lbf'%(Ds)\n", + "\n", + "# note : rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air speed = 4.37 ft/sec\n", + " Drag force = 0.866 lbf\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.7 Page No : 51" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "To1= 540. \t#R temperature\n", + "po3= 12.6 \t#lbf/in**2\n", + "l3= 3. \t#ft\n", + "po1= 14.7 \t#lbf/in**2 pressure\n", + "l1= 1. \t#ft\n", + "vo1= 500. \t#ft/sec velocity\n", + "r= 0.83\n", + "P1= 1. \t#lbf/in**2 turbine blade\n", + "\t\n", + "#CALCULATIONS\n", + "To3= To1*(po3*l3/(po1*l1))**r\n", + "Vo3= vo1*math.sqrt(To3/To1)\n", + "P3= P1*po3*l3/(po1*l1)\n", + "\t\n", + "#RESULTS\n", + "print 'To3 = %.f R'%(To3)\n", + "print ' Vo3 = %.f ft/sec'%(Vo3)\n", + "print ' P3 = %.2f lbf/ft'%(P3)\n", + "\n", + "# note : book answers are not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "To3 = 1183 R\n", + " Vo3 = 740 ft/sec\n", + " P3 = 2.57 lbf/ft\n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch3.ipynb b/Basic_Fluid_Mechanics/ch3.ipynb new file mode 100755 index 00000000..cd8562e6 --- /dev/null +++ b/Basic_Fluid_Mechanics/ch3.ipynb @@ -0,0 +1,160 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:be8f61b53e434158045726efedae14168d3ad7c750cfe29d070385bb73f71e47" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Dimensional Analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 Page No : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "t= 1. \t#hr\n", + "g1= 32.2 \t#ft/sec**2\n", + "g2= 32.2 \t#lbm ft/lbf\n", + "u= 2.4*10**-5 \t#lbf sec/ft**2\n", + "\t\n", + "#CALCULATIONS\n", + "q2= g*(t*60*60)**2\n", + "go= g*(t*60*60)**2\n", + "q3= g/g2\n", + "u1= u/(t*60*60)\n", + "\t\n", + "#RESULTS\n", + "print ' q2 = %.2e lbm ft/lbf hr**2'%(q2)\n", + "print ' go = %.2e lbm ft/lbf hr**2'%(go)\n", + "print ' go = %.f slug ft/lbf sec**2'%(q3)\n", + "print ' viscosity = %.2e lbf hr/ft**2'%(u1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " q2 = 4.17e+08 lbm ft/lbf hr**2\n", + " go = 4.17e+08 lbm ft/lbf hr**2\n", + " go = 1 slug ft/lbf sec**2\n", + " viscosity = 6.67e-09 lbf hr/ft**2\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 Page No : 64" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "m= 1 \t#lb\n", + "\t\n", + "#CALCULATIONS\n", + "m1= g/m\n", + "\t\n", + "#RESULTS\n", + "print '1 lbf/sec ft**2 = %.1f lbm/ft sec'%(m1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1 lbf/sec ft**2 = 32.2 lbm/ft sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5 Page No : 75" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "n1=1.\n", + "n2= 3.\n", + "n3=2.\n", + "\t\n", + "#CALCULATIONS\n", + "a1= -n1\n", + "a2= -n3\n", + "a3= -n1-a2+3*a1\n", + "b1= -n1\n", + "b2= -n1\n", + "b3= n1+3*b1-b2\n", + "\t\n", + "#RESULTS\n", + "print ' a1 = %.f '%(a1)\n", + "print ' a2 = %.f '%(a2)\n", + "print ' a3 = %.f '%(a3)\n", + "print ' b1 = %.f '%(b1)\n", + "print ' b2 = %.f '%(b2)\n", + "print ' b3 = %.f '%(b3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " a1 = -1 \n", + " a2 = -2 \n", + " a3 = -2 \n", + " b1 = -1 \n", + " b2 = -1 \n", + " b3 = -1 \n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch5.ipynb b/Basic_Fluid_Mechanics/ch5.ipynb new file mode 100755 index 00000000..e44fb093 --- /dev/null +++ b/Basic_Fluid_Mechanics/ch5.ipynb @@ -0,0 +1,212 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:925f1eedf50c877ed321461a7c6fe2319e03573a843bd9a8a44c0d22ceada0ec" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : Control-Volume Analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 Page No : 114" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "w= 20. \t#lbm/sec plant rate\n", + "sh= 0.004\n", + "mw2= 0.12 \t#lbm/sec stream rate\n", + "ma3= 12.2 \t#lbm/sec rates of air\n", + "mw3= 0.130 \t#lbm/sec water rate\n", + "\t\n", + "#CALCULATIONS\n", + "mw1= w/((1/sh)+1)\n", + "ma1= w-mw1\n", + "ma4= ma1-ma3\n", + "mw4= mw1+mw2-mw3\n", + "mr= ma4+mw4\n", + "sh1= mw4/ma4\n", + "\t\n", + "#RESULTS\n", + "print ' mw1 = %.4f lbm/sec'%(mw1)\n", + "print ' ma1 = %.2f lbm/sec'%(ma1)\n", + "print ' ma4 = %.2f lbm/sec'%(ma4)\n", + "print ' mw4 = %.4f lbm/sec'%(mw4)\n", + "print ' mr = %.2f lbm/sec'%(mr)\n", + "print ' specific humidity = %.5f lbm/sec'%(sh1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " mw1 = 0.0797 lbm/sec\n", + " ma1 = 19.92 lbm/sec\n", + " ma4 = 7.72 lbm/sec\n", + " mw4 = 0.0697 lbm/sec\n", + " mr = 7.79 lbm/sec\n", + " specific humidity = 0.00903 lbm/sec\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 Page No : 131" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "w= 62.4 \t#lbf/ft**3 fluid density\n", + "g= 32.2 \t#ft/sec**2 \n", + "v= 86.5 \t#ft/sec velocity\n", + "d2= 3. \t#in\n", + "d1= 6. \t#in\n", + "dp= 50. \t#lbf/in**2 gauge pressure\n", + "\t\n", + "#CALCULATIONS\n", + "Fb= ((math.pi*(w/g)*v**2*(1/d1)**2*(1-(d2/d1)**2)*0.25)-dp*144*(math.pi/4)*(1/d2)**2)\n", + "\t\n", + "#RESULTS\n", + "print 'Load on the bolts = %.f lbf'%(Fb)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Load on the bolts = -391 lbf\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 Page No : 133" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "F1= 237. \t#lb\n", + "dp= 50. \t#lbf/in**2\n", + "D= 6. \t#in diameter\n", + "\t\n", + "#CALCULATIONS\n", + "F2= dp*144*(math.pi/4)*(D/12)**2\n", + "Fb= F1-F2\n", + "\t\n", + "#RESULTS\n", + "\n", + "print 'Load on the bolts = %.f lbf'%(Fb)\n", + "#rounding-off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Load on the bolts = -1177 lbf\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.5 Page No : 137" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "w1= 0.0286 \t#lbm/ft**3 density\n", + "v= 2500. \t#ft/sec velocity\n", + "A= 2.5 \t#ft**3 area\n", + "k= 0.015\n", + "p2= 700. \t#lbf/ft**2\n", + "p1= 628. \t#lbf/ft**2 pressure\n", + "v2= 3500. \t#ft/sec outlet\n", + "g= 32.17 \t#ft/sec**2\n", + "\t\n", + "#CALCULATIONS\n", + "ma= w1*v*A\n", + "mf= round(k*ma,2)\n", + "mt= round(ma+mf,1)\n", + "F= (p2-p1)*A+(mt*v2/g)-(ma*v/g)\n", + "\n", + "\n", + "#RESULTS\n", + "print ' air mass flow rate = %.2f lbm/sec'%(ma)\n", + "print ' Fuel flow rate = %.2f lbm/sec'%(mf)\n", + "print ' Fuel flow rate at station 2 = %.2f lbm/sec'%(mt)\n", + "print ' Thrust force = %d lbf'%(round(F,-1))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " air mass flow rate = 178.75 lbm/sec\n", + " Fuel flow rate = 2.68 lbm/sec\n", + " Fuel flow rate at station 2 = 181.40 lbm/sec\n", + " Thrust force = 6020 lbf\n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch6.ipynb b/Basic_Fluid_Mechanics/ch6.ipynb new file mode 100755 index 00000000..71c77f3e --- /dev/null +++ b/Basic_Fluid_Mechanics/ch6.ipynb @@ -0,0 +1,391 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:912103c870040cf2e80e26b9450874f8f07874fb3d9db28d3d6ce1077a023edc" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 : Steady, One-Dimensional, Reversible Flow" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 Page No : 157" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2 gravitational acceleration\n", + "h= 4. \t#ft diameter\n", + "d2= 0.16 \t#ft\n", + "d1= 0.3 \t#ft\n", + "dp= 13.6 \t#lbf/in**2 mercury\n", + "\t\n", + "#CALCULATIONS\n", + "Q= (math.pi/4)*math.sqrt(2*g*dp*h/((1/d2**4)-(1/d1**4)))\n", + "\t\n", + "#RESULTS\n", + "print 'Volumetric flow rate = %.2f ft**3/sec'%(Q)\n", + "\n", + "# note: book answer is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Volumetric flow rate = 1.24 ft**3/sec\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 Page No : 158" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "w= 0.0765 \t#lbm/ft**3 density\n", + "v1= 120. \t#ft/sec velocity\n", + "go = 62.4 \t#lmb/ft**3\n", + "\t\n", + "#CALCULATIONS\n", + "dp= (w*v1**2)/(2*go)\n", + "\t\n", + "#RESULTS\n", + "print 'Difference in pressure= %.2f lbf/ft**2'%(dp)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Difference in pressure= 8.83 lbf/ft**2\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 Page No : 161" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "r=1.4\n", + "g= 32.2 \t#ft/sec**2 gas\n", + "R= 53.3 \t#lbf ft/lbm\n", + "T1= 760. \t#R Temperature\n", + "p2= 2. \t#lbf/in**2\n", + "p1= 3. \t #lbf/in**2\n", + "\t\n", + "#CALCULATIONS\n", + "V2= math.sqrt(2*r*R*g*T1*(1-(p2/p1)**((r-1)/r))/(r-1))\n", + "\t\n", + "#RESULTS\n", + "print 'Velocity in working section = %.f ft/sec'%(V2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Velocity in working section = 999 ft/sec\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 Page No : 166" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "y = 1.4\n", + "g = 32.2 \t#ft/sec**2\n", + "R = 53.3 \t#lbf ft/lbm\n", + "T = 32. \t#C air\n", + "T1 = 2000. \t#R air\n", + "y1 = 1.32\n", + "p = 1440. \t#lbf/in**2\n", + "v1 = 1.2306 \t #ft**3/lbm\n", + "v2 = 1.2546 \t #ft**3/lbm\n", + "bm = 3.13*10**5 \t#lbf/in**2\n", + "w = 62.4 \t #lbf/ft**3\n", + "\t\n", + "#CALCULATIONS\n", + "a1= math.sqrt(y*R*(460+T)*g)\n", + "a2= math.sqrt(y1*R*T1*g)\n", + "r2= p/(v1-v2)\n", + "a3= math.sqrt(-g*(v1+v2)**2*0.5**2*r2)\n", + "a4= math.sqrt(bm*144*g/w)\n", + "\t\n", + "#RESULTS\n", + "print ' Acoustic veloctiy in air at 32 F = %.f ft/sec'%(a1)\n", + "print ' Acoustic veloctiy in air at 2000 R = %.f ft/sec'%(a2)\n", + "print ' Acoustic veloctiy in steam at 480 F = %.f ft/sec'%(a3)\n", + "print ' Acoustic veloctiy in water at 60 F = %.f ft/sec'%(a4)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Acoustic veloctiy in air at 32 F = 1087 ft/sec\n", + " Acoustic veloctiy in air at 2000 R = 2129 ft/sec\n", + " Acoustic veloctiy in steam at 480 F = 1727 ft/sec\n", + " Acoustic veloctiy in water at 60 F = 4823 ft/sec\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 Page No : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "r= 1.4\n", + "ma2= 2.5 \t#ft/sec\n", + "g= 32.17 \t#ft/sec**2\n", + "p2= 1. \t#lbf/in**2\n", + "ps= 17.08 \t#lbf/in**2\n", + "ps2= 75. \t#lbf/in**2\n", + "Ts= 720. \t#R\n", + "R= 53.3 \t#lbf ft/lbm gas\n", + "A= 4. \t#ft**2 flow area\n", + "ps3= 0.4 \t#lbf/in**2\n", + "A2= 0.685 \t#ft**2\n", + "P= 5. \t#per cent throat area\n", + "\t\n", + "#CALCULATIONS\n", + "R1= (1+0.5*(r-1)*ma2**2)**(r/(r-1))\n", + "R2= (2*(r/(r-1))*(p2/ps)**(2/(r))*(1-(p2/ps)**((r-1)/r)))**0.5\n", + "m2= R2*ps2*144*(g/(R*Ts))**0.5*0.1\n", + "m= m2*A\n", + "At= A*R2/A2\n", + "m1= m*(1-(P/100))\n", + "mrp= (1-(P/100))*R2\n", + "\t\n", + "#RESULTS\n", + "print ' Mass flow rate= %.1f lbm/sec'%(m)\n", + "print ' Area of throat= %.3f ft**2'%(At)\n", + "print ' Mass flow rate= %.1f lbm/sec'%(m1)\n", + "print ' Mass flow rate parameter = %.4f'%(mrp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Mass flow rate= 32.5 lbm/sec\n", + " Area of throat= 1.517 ft**2\n", + " Mass flow rate= 30.9 lbm/sec\n", + " Mass flow rate parameter = 0.2468\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7 Page No : 181" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "r1= 10. \t#ft point - 1\n", + "r2= 0.2 \t#miles point - 2\n", + "w= 0.0765 \t#lbm/ft**2 density\n", + "g= 32.2 \t#ft/sec**2\n", + "V1= 1. \t#ft/sec velocity\n", + "\t\n", + "#CALCULATIONS\n", + "k= r2*5280*V1 \n", + "dp= w*k**2*10*((1/r1)**2-(1/(5280*r2))**2)/(2*g)\n", + "\t\n", + "#RESULTS\n", + "print 'k = %.f ft**2/sec'%(k)\n", + "print ' pressure difference = %.1f lbf/ft**2'%(dp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "k = 1056 ft**2/sec\n", + " pressure difference = 132.5 lbf/ft**2\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.9 Page No : 186" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "w= 12. \t#ft wide\n", + "q= 300. \t#ft**3/sec rate\n", + "h= 10. \t#ft depth upstream of the gate\n", + "g= 32.2 \t#ft/sec**2\n", + "R= 2.6\n", + "\t\n", + "#CALCULATIONS\n", + "hc= ((q/12)**2/g)**(1./3)\n", + "r= h/hc\n", + "h1= hc*(((h/hc)+0.5*(hc/h)**2)-0.5*R**2)\n", + "\t\n", + "#RESULTS\n", + "print ' hc = %.2f ft'%(hc)\n", + "print ' stream depth = %.3f ft'%(h1)\n", + "#rounding-off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " hc = 2.69 ft\n", + " stream depth = 1.013 ft\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.10 Page No : 190" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "Q= 400. \t#ft**3/sec flow rate\n", + "b1= 25. \t#ft channel width\n", + "b2= 20. \t#ft channel width\n", + "h1= 6. \t#ft stream depth\n", + "z1= 2.5 \t#ft elevation of channel bottom\n", + "z2= 3.3 \t#ft elevation of channel bottom\n", + "g= 32.2 \t#ft/sec**2\n", + "\t\n", + "#CALCULATIONS\n", + "hc1= (Q**2/(g*b1**2))**(1./3)\n", + "hc2= (Q**2/(g*b2**2))**(1./3)\n", + "r= (hc1/hc2)*((h1/hc1)+0.5*(hc1/h1)**2)+((z1-z2)/hc2)\n", + "\t\n", + "#RESULTS\n", + "print ' hc1 = %.3f ft'%(hc1)\n", + "print ' hc2 = %.3f ft'%(hc2)\n", + "print ' Ratio = %.3f '%(r)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " hc1 = 1.996 ft\n", + " hc2 = 2.316 ft\n", + " Ratio = 2.293 \n" + ] + } + ], + "prompt_number": 10 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch7.ipynb b/Basic_Fluid_Mechanics/ch7.ipynb new file mode 100755 index 00000000..3818de1b --- /dev/null +++ b/Basic_Fluid_Mechanics/ch7.ipynb @@ -0,0 +1,523 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:fb647d6d0a9fd1fab503f1e20b9cd4c1b8f196f963f97a28e2375980e25dde26" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 : Steady, One-Dimensional, Irreversible Flow" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 Page No : 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "r= 1.5\n", + "f= 0.025 # friction factor\n", + "\t\n", + "#CALCULATIONS\n", + "r1= (2/f)*(r**2-1)\n", + "\t\n", + "#RESULTS\n", + "print 'ratio L/D2 = %.f'%(r1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "ratio L/D2 = 100\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 Page No : 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\t\n", + "#initialisation of variables\n", + "a= 6. \t#degrees angle\n", + "r= 1.5\n", + "l= 100. \t#ft\n", + "f= 0.025\n", + "K= 0.15\n", + "\t\n", + "#CALCULATIONS\n", + "R= r**4-1\n", + "R1= 1/math.tan(math.radians(a/2))*(1-(1./r))\n", + "p1= f*l\n", + "p2= 2.5*(l-p1)/l\n", + "p3= (1-r**2)**2\n", + "p4= K*p3\n", + "pt= p4+p2\n", + "\t\n", + "#RESULTS\n", + "print ' lowest ratio = %.2f'%(R)\n", + "print ' contribtuion of friction in pipe = %.3f lbf/ft**2'%(p1)\n", + "print ' contribtuion of diffuser in pipe = %.3f lbf/ft**2'%(p2)\n", + "print ' stagnant pressure drop = %.3f lbf/ft**2'%(p3)\n", + "print ' contribtuion of friction in pipe after reduction = %.3f lbf/ft**2'%(pt)\n", + "\n", + "# note : rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " lowest ratio = 4.06\n", + " contribtuion of friction in pipe = 2.500 lbf/ft**2\n", + " contribtuion of diffuser in pipe = 2.438 lbf/ft**2\n", + " stagnant pressure drop = 1.562 lbf/ft**2\n", + " contribtuion of friction in pipe after reduction = 2.672 lbf/ft**2\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 Page No : 219" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "d= 4. \t #in galvanised iron pipe diameter\n", + "q= 0.5 \t #ft**3/sec flow rate\n", + "w= 62.4 \t#lb/ft**3 density\n", + "u= 2.7*10**-5 \t#lbf sec/ft**2 viscosity\n", + "e= 0.0005 \t#ft\n", + "g= 32.1 \t#ft/sec**2 acceleration\n", + "f= 0.0235\n", + "lt= 400. \t#ft long\n", + "\t\n", + "#CALCULATIONS\n", + "V= 4*q/(math.pi*(d/12)**2)\n", + "Re= w*V*(d/12)/(u*g)\n", + "r= e/(d/12)\n", + "dz= (V**2/(2*g))*(1.7+f*lt/(d/12))\n", + "\t\n", + "#RESULTS\n", + "print ' mean flow velocity = %.2f ft/sec'%(V)\n", + "print ' Reynolds number = %.2e'%(Re)\n", + "print ' Relative roughness = %.4f'%(r)\n", + "print ' difference in the levels of water = %.1f ft'%(dz)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " mean flow velocity = 5.73 ft/sec\n", + " Reynolds number = 1.38e+05\n", + " Relative roughness = 0.0015\n", + " difference in the levels of water = 15.3 ft\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 Page No : 220" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "d= 4. \t#in\n", + "v= 6.64 \t#ft/sec\n", + "\t\n", + "#CALCULATIONS\n", + "Q= math.pi*0.25*(d/12)**2*v\n", + "\t\n", + "#RESULTS\n", + "print 'Flow rate= %.3f ft**3/sec'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Flow rate= 0.579 ft**3/sec\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5 Page No : 221" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "d= 0.366 \t#ft\n", + "i= 12\n", + "\t\n", + "#CALCULATIONS\n", + "pd= d*i\n", + "\t\n", + "#RESULTS\n", + "print 'Required pipe diameter = %.2f in'%(pd)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required pipe diameter = 4.39 in\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 Page No : 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "Ps1= 1050. \t#lbf/ft**2\n", + "fr= 10.7\n", + "p= 36.6 \t#lbf/ft**2\n", + "p1= 195. \t#lbf/ft**2\n", + "fr1= 16.\n", + "fr2= 1.8\n", + "\t\n", + "#CALCULATIONS\n", + "deltap = (p+957+p1+Ps1)\n", + "p2= round(fr*p)\n", + "dp= Ps1-p2\n", + "lc= round(dp/p)\n", + "sp= Ps1+p1-p*(fr1+fr2)\n", + "lc1= sp/p\n", + "\n", + "#RESULTS\n", + "print ' Pressure = %.f lbf/ft**2'%(round(deltap,-1))\n", + "print ' pressure difference = %.f lbf/ft**2'%(dp)\n", + "print ' Loss coefficient = %.f '%(lc)\n", + "print ' Loss coefficient = %.1f '%(lc1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Pressure = 2240 lbf/ft**2\n", + " pressure difference = 658 lbf/ft**2\n", + " Loss coefficient = 18 \n", + " Loss coefficient = 16.2 \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7 Page No : 232" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "p1= 50. \t#lbf/in**2 pressure\n", + "R= 96.3 \t#ft lbf/lbm R\n", + "T= 80. \t #F temperature\n", + "p2= 20. \t#lbf/in**2 pressure\n", + "r= 1.31\n", + "u= 2.34*10**-7 \t#lbf sec/ft**2\n", + "e= 0.00005 \t #ft\n", + "m= 5.*10**4 \t#lbm/sec\n", + "d= 1.5 \t #ft\n", + "g= 32.2 \t #ft/sec**2\n", + "f= 0.113\n", + "\t\n", + "#CALCULATIONS\n", + "w1= p1*144/(R*(460+T))\n", + "V1= 4*(m/3600)/(math.pi*w1*d**2)\n", + "Ma1= V1/(r*R*g*(460+T))**0.5\n", + "Re= w1*V1*d/(u*g)\n", + "dx= (((1/(r*Ma1**2))*10*(1-(p2/p1)**2))+math.log(p2/p1))*d/f\n", + "\t\n", + "#RESULTS\n", + "print ' density = %.3f lbm/ft**3'%(w1)\n", + "print ' mean flow velocity = %.1f ft/sec'%(V1)\n", + "print ' Match number = %.4f '%(Ma1)\n", + "print ' Reynolds number = %.2e '%(Re)\n", + "print ' Length of pipe = %.2e ft'%(dx)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " density = 0.138 lbm/ft**3\n", + " mean flow velocity = 56.8 ft/sec\n", + " Match number = 0.0383 \n", + " Reynolds number = 1.56e+06 \n", + " Length of pipe = 5.79e+04 ft\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.9 Page No : 238" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "r= 1.4\n", + "R= 53.3 \t#ft lbf/lbm R\n", + "g= 32.2 \t#ft/sec**2\n", + "T1= 410. \t#R temperature\n", + "v= 2500. \t#ft/sec steadility\n", + "P1= 628. \t#lbf/in**2 pressure\n", + "\t\n", + "#CALCULATIONS\n", + "v1= int(math.sqrt(r*g*R*T1))\n", + "Ma1= round(v/v1,2)\n", + "Ts1= int(T1*(1+0.5*(r-1)*Ma1**2))\n", + "Ps1= P1*(1+0.5*(r-1)*Ma1**2)**(r/(r-1))\n", + "Ps2= Ps1*((r+1)/(2*r*Ma1**2-r+1))**(1/(r-1))*(0.5*(r+1)*Ma1**2/(1+0.5*(r-1)*Ma1**2))**(r/(r-1))\n", + "\n", + "#RESULTS\n", + "print ' acoustic velocity = %.f ft/sec'%(v1)\n", + "print ' Match number = %.2f '%(Ma1)\n", + "print ' Stagnition temperature = %.f R'%(Ts1)\n", + "print ' Stagnition pressure = %.f lbf/ft**2'%(Ps1)\n", + "print ' Stagnition pressure = %.f lbf/ft**2'%(Ps2)\n", + "\n", + "# note : answer in book is wrong. Please check manually.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " acoustic velocity = 992 ft/sec\n", + " Match number = 2.52 \n", + " Stagnition temperature = 930 R\n", + " Stagnition pressure = 11069 lbf/ft**2\n", + " Stagnition pressure = 5435 lbf/ft**2\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.10 Page No : 245" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "p2= 67.2 \t#lbf/in**2 pressure\n", + "p1= 63. \t#lbf/in62 pressure\n", + "r= 1.4\n", + "n= 0.6 # efficiency\n", + "T1= 870. \t#R temperature\n", + "ma1= 0.8 \t#ft/sec mach number\n", + "\n", + "#CALCULATIONS\n", + "dt= (p2/p1)**((r-1)/r)-1\n", + "dt1= dt/n\n", + "T2= T1*(1+dt1)\n", + "Ts1= T1*(1+0.5*(r-1)*ma1**2)\n", + "ps1= p1*(1+0.5*(r-1)*ma1**2)**(r/(r-1))\n", + "ps2= p2*(Ts1/T2)**(r/(r-1))\n", + "dp= ps1-ps2\n", + "\n", + "#RESULTS\n", + "print ' dT = %.5f '%(dt)\n", + "print ' dT1 = %.5f '%(dt1)\n", + "print ' Temperature = %.f R'%(T2)\n", + "print ' Temperature = %.1f R'%(Ts1)\n", + "print ' Pressure = %.1f lbf/in**2'%(ps1)\n", + "print ' Pressure = %.1f lbf/in**2'%(ps2)\n", + "print ' pressure difference = %.1f lbf/in**2'%(dp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " dT = 0.01861 \n", + " dT1 = 0.03102 \n", + " Temperature = 897 R\n", + " Temperature = 981.4 R\n", + " Pressure = 96.0 lbf/in**2\n", + " Pressure = 92.0 lbf/in**2\n", + " pressure difference = 4.0 lbf/in**2\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.11 Page No : 246" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "r= 1.4\n", + "ma3= 3. \t#ft/sec mach number\n", + "ps= 80. \t#lbf/ft**2 pressure\n", + "Ts= 840. \t#R temperature\n", + "r1= 53.3 \t#ft lbm/ft**3\n", + "A3= 2. \t#in**2 flow area\n", + "g= 32.2 \t#ft/sec**2\n", + "ma1= 1.6\n", + "\n", + "#CALCULATIONS\n", + "R= (1+(r-1)*0.5*ma3**2)**(r/(r-1))\n", + "p3= ps/R\n", + "R1= 1+0.5*(r-1)*ma3**2\n", + "T3= Ts/R1\n", + "w3= p3*144/(r1*T3)\n", + "V3= ma3*math.sqrt(r*r1*g*T3)\n", + "m= w3*V3*A3/144\n", + "ra= ((r+1)/(2*r*ma1**2-(r-1)))**(1/(r-1))*(0.5*(r+1)*ma1**2/(1+0.5*(r-1)*ma1**2))**(r/(r-1))\n", + "ps2= ps*ra\n", + "dp= ps-ps2\n", + "\n", + "#RESULTS\n", + "print ' outlet pressure = %.2f lbf/in**2'%(p3)\n", + "print ' outlet temperature = %.f R'%(T3)\n", + "print ' mass flow rate = %.3f lbm/sec'%(m)\n", + "print ' ps2 = %.1f lbf/in**2'%(ps2)\n", + "print ' Stagnation pressure loss = %.1f lbf/in**2'%(dp)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " outlet pressure = 2.18 lbf/in**2\n", + " outlet temperature = 300 R\n", + " mass flow rate = 0.694 lbm/sec\n", + " ps2 = 71.6 lbf/in**2\n", + " Stagnation pressure loss = 8.4 lbf/in**2\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch8.ipynb b/Basic_Fluid_Mechanics/ch8.ipynb new file mode 100755 index 00000000..539707f8 --- /dev/null +++ b/Basic_Fluid_Mechanics/ch8.ipynb @@ -0,0 +1,148 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:64db2287da8cb97edd52d96a1a1d6b51c3497c61118b03ae2e2cf16f97e85bf8" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 : Analysis of Two-Dimensional, Constant-Density, Laminar Flow " + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2 Page No : 279" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "w= 78.9 \t#lbf.ft**3 weight\n", + "d= 0.01 \t#in bore\n", + "u= 8.67*10**-9 \t#lbf/ hr ft**2 viscosity\n", + "h= 18. \t#ft\n", + "l= 10. \t #ft length\n", + "\t\n", + "#CALCULATIONS\n", + "Q= math.pi*w*(d/12)**4*(h+l)/(l*128*u)\n", + "\t\n", + "#RESULTS\n", + "print 'Flow rate = %.2e ft**3/hr'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Flow rate = 3.02e-04 ft**3/hr\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3 Page No : 290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "x= 0.1 \t#ft\n", + "w= 62.4 \t#lbf/ft**3 fluid density\n", + "v1= 10. \t#ft/sec velocity\n", + "u= 2.4*10**-5 \t#lbf/ft viscosity\n", + "g= 32.2 \t#ft/sec**2\n", + "k= 4.91\n", + "\t\n", + "#CALCULATIONS\n", + "s= k*x*(w*v1*x/(u*g))**-0.5\n", + "Tw= 0.332*w*v1**2*(u*g/(w*x*v1))**0.5/g\n", + "R= 0.332*6*Tw\n", + "\t\n", + "#RESULTS\n", + "print 'Thickness = %.2e*ft'%(s)\n", + "print ' Shear stress = %.3f lbf/ft**2'%(Tw)\n", + "print ' Shear stress = %.3f lbf/ft'%(R)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thickness = 1.73e-03*ft\n", + " Shear stress = 0.226 lbf/ft**2\n", + " Shear stress = 0.451 lbf/ft\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4 Page No : 298" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "r = 1\n", + "r1 = 1\n", + "\t\n", + "#CALCULATIONS\n", + "e1= r+r1\n", + "e2= r-r1\n", + "\t\n", + "#RESULTS\n", + "print ' vorticity in a forced vortex = %.f*k'%(e1)\n", + "print ' vorticity in a free vortex = %.f'%(e2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " vorticity in a forced vortex = 2*k\n", + " vorticity in a free vortex = 0\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/ch9.ipynb b/Basic_Fluid_Mechanics/ch9.ipynb new file mode 100755 index 00000000..004fdaf6 --- /dev/null +++ b/Basic_Fluid_Mechanics/ch9.ipynb @@ -0,0 +1,126 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:cf784c378e9383adb15dcad9ef6ad8b764187d7f185393fb16ff16d5b2a1ed70" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Analysis of Two-Dimensional, Constant-Density, Turbulent Flow" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 Page No : 324" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\n", + "#initialisation of variables\n", + "n=7.\n", + "w= 62.4 \t#lbf/ft**3 density\n", + "v= 6. \t#ft/sec velocity\n", + "d= 2. \t #in pipe diameter\n", + "u= 2.34*10**-5 \t#lbf/ft**3 viscosity\n", + "f= 0.0178\n", + "g= 32.2 \t#ft/sec**2\n", + "R= 1.224\n", + "R1= 8. \t#ft/sec\n", + "\t\n", + "#CALCULATIONS\n", + "r= (n+1)*(2*n+1)/(2*n**2)\n", + "Red= w*v*(d/12)/(u*g)\n", + "C= (d/Red)**(1./7)*R*(R1/f)**(4./7)\n", + "V = v*math.sqrt(f/8)\n", + "\t\n", + "#RESULTS\n", + "print ' Vmax/V = %.3f'%(r)\n", + "print ' Red = %.2e'%(Red)\n", + "print ' C = %.2f'%(C)\n", + "print ' Velocity = %.3f ft/sec'%(V)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Vmax/V = 1.224\n", + " Red = 8.28e+04\n", + " C = 8.79\n", + " Velocity = 0.283 ft/sec\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 Page No : 332" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\n", + "#initialisation of variables\n", + "Re= 5.\n", + "g= 32.2 \t#ft/sec**2\n", + "u= 2.34*10**-5 \t#lbf/ft sec\n", + "w= 62.4 \t#lbf/ft**3\n", + "v= 0.283 \t#ft/sec\n", + "Re1= 70.\n", + "v1= 0.0374 \t#ft/sec\n", + "\t\n", + "#CALCULATIONS\n", + "y= Re*u*g/(w*v)\n", + "y1= Re1*u*g/(w*v)\n", + "y2= Re*u*g/(w*v1)\n", + "y3= Re1*u*g/(w*v1)\n", + "\t\n", + "#RESULTS\n", + "print ' y = %.6f ft'%(y)\n", + "print ' y = %.5f ft'%(y1)\n", + "print ' y = %.5f ft'%(y2)\n", + "print ' y = %.4f ft'%(y3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " y = 0.000213 ft\n", + " y = 0.00299 ft\n", + " y = 0.00161 ft\n", + " y = 0.0226 ft\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Basic_Fluid_Mechanics/screenshots/Streamlinedbody_curve.png b/Basic_Fluid_Mechanics/screenshots/Streamlinedbody_curve.png Binary files differnew file mode 100755 index 00000000..0628f98d --- /dev/null +++ b/Basic_Fluid_Mechanics/screenshots/Streamlinedbody_curve.png diff --git a/Basic_Fluid_Mechanics/screenshots/VariationsOfEpEhEp+EhwithT.png b/Basic_Fluid_Mechanics/screenshots/VariationsOfEpEhEp+EhwithT.png Binary files differnew file mode 100755 index 00000000..bd0bd566 --- /dev/null +++ b/Basic_Fluid_Mechanics/screenshots/VariationsOfEpEhEp+EhwithT.png diff --git a/Basic_Fluid_Mechanics/screenshots/actual_perfomance_curve.png b/Basic_Fluid_Mechanics/screenshots/actual_perfomance_curve.png Binary files differnew file mode 100755 index 00000000..ece48d25 --- /dev/null +++ b/Basic_Fluid_Mechanics/screenshots/actual_perfomance_curve.png diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_1.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_1.ipynb new file mode 100755 index 00000000..ccf39a3c --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_1.ipynb @@ -0,0 +1,100 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1:Units & Dimensions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.1,Page no:9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "# 1 Poise = 1g/cm s = ((1/453.6)lb)/((1/30.48)ft*1s)\n",
+ "\n",
+ "#Calculation\n",
+ "be=30.48/453.6*3600 #be->british engineering unit\n",
+ "# 1 Poise = 1g/cm s = ((1/1000)kg)/((1/100)m*1s)\n",
+ "si=100/1000.0 #si->SI units\n",
+ "\n",
+ "#Result\n",
+ "print\" 1 Poise=\",round(be),\"lb/ft h\" \n",
+ "print\"\\n 1 Poise =\",si,\"N s/m**2 \""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1 Poise= 242.0 lb/ft h\n",
+ "\n",
+ " 1 Poise = 0.1 N s/m**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.2,Page no:10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "\n",
+ "# 1 kW= 103 W = 103 J/s = 10**3 * (1 kg*1 m**2)/1 s**3\n",
+ "# = (10**3 * (1/0.4536) lb x (1/0.3048)**2 ft**2)/1 s**3\n",
+ "\n",
+ "#Calculation\n",
+ "lfs=(10**3*(1/0.4536)*(1/.3048)**2) #lfs->lb ft**2/s**3\n",
+ "sfs=lfs/32.2 #sfs->slug ft**2/s**3\n",
+ "hp=sfs/550.0 \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n 1 kW =\",round(hp,2),\"h.p.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " 1 kW = 1.34 h.p.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_10.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_10.ipynb new file mode 100755 index 00000000..c72a5f6c --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_10.ipynb @@ -0,0 +1,653 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10:Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.1,Page no:580"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "x=1e-3 #Thickness of stagnant air film\n",
+ "D=1.8e-5 #Difffusivity of ammonia\n",
+ "R=8314 #Gas constant\n",
+ "T=295 #Temperature \n",
+ "P=101.3e3 #Total Pressure\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "#If the subscripts 1 and 2 refer to the two sides of the stagnant layer and \n",
+ "#the subscripts A and B refer to ammonia and air respectively,\n",
+ "P_A1=.50*P \n",
+ "P_A2=0 \n",
+ "P_B1=P-P_A1 \n",
+ "P_B2=P-P_A2 \n",
+ "P_BM=(P-P_A1)/math.log(P/P_A1) \n",
+ "#Thus, substituting in equation 10.31 gives:\n",
+ "N_A=(-D/(R*T*x))*(P/P_BM)*(P_A2-P_A1) \n",
+ "\n",
+ "#Result\n",
+ "print\"The rate of diffusion of ammonia through the layer = %.2e\"%N_A,\"kmol/m**2*s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of diffusion of ammonia through the layer = 5.15e-04 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.2,Page no:582"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "import numpy as np\n",
+ "%pylab inline\n",
+ "th=np.array([0,0,3,7,22,32,46,55,80,106]) #Time in hours\n",
+ "tm=np.array([0,26,5,36,16,38,50,25,22,25]) #Time in min\n",
+ "tim=[0]*10\n",
+ "#Conversion to kilo seconds\n",
+ "for i in range(0,10):\n",
+ " tm[i]=tm[i]*60.0 \n",
+ " th[i]=th[i]*3600.0 \n",
+ " tim[i]=(tm[i]+th[i])/1000.0 \n",
+ "\n",
+ "L=np.array([0,2.5,12.9,23.2,43.9,54.7,67.0,73.8,90.3,104.8]) #in mm\n",
+ "Lo=L[0] \n",
+ "\n",
+ "#Calculation\n",
+ "x=L-Lo \n",
+ "y=[0]*10 \n",
+ "for j in range(1,10):\n",
+ " y[j]=tim[j]/(L[j]-Lo) \n",
+ "plot(x,y,marker='+') \n",
+ "plt.title('t/(L-L0) vs (L-L0)')\n",
+ "plt.xlabel('$(L-L0) in mm$')\n",
+ "plt.ylabel('$t/(L-L0) in ks/mm**2$') \n",
+ "\n",
+ "#Calculation of slope\n",
+ "s=(y[3]-y[2])/(x[3]-x[2])*10**3*10**6 \n",
+ "Vl=22.4 #Molar volume in litres\n",
+ "den=1540 #Density in kg/m**3\n",
+ "T0=273 \n",
+ "T=321 \n",
+ "vp=37.6 #vapour pressure in kPa\n",
+ "P0=101.3 #PRessue in kPa\n",
+ "M=154 \n",
+ "Ct=T0/(Vl*T) \n",
+ "Ca=(vp*Ct)/P0 \n",
+ "Cb1=Ct \n",
+ "Cb2=(P0-vp)*Ct/P0 \n",
+ "Cbm=(Cb1-Cb2)/math.log(Cb1/Cb2) \n",
+ "#Diffusivity calculation\n",
+ "D=den*Cbm/(2*M*Ca*Ct*s) \n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "show()\n",
+ "print\"\\nSlope is %.1e\"%s,\"s/m**2\"\n",
+ "print\"\\nDiffusivity is %.2e\"%D,\" m**2/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEfCAYAAAC9CZqZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtUVOX6B/DvIKZy8YIKpKMrE5SLykWQMpJBMpWANKnU\njlj6M9SjVkfN0+mmZahHMzVLbeU1T2iRJil6lHSIjnJTkQQvaJKAiJIikFwG2L8/dk4MF50ZmNnM\n8P2sxTrOzJ69n/cs4/F9n/ciEwRBABERkRYspA6AiIhMB5MGERFpjUmDiIi0xqRBRERaY9IgIiKt\nMWkQEZHWmDSIiEhrTBpk8p544gmcOXPGaM9bv349/vnPfxrlWf/9738xfvx4ozwLACorK+Hq6oqi\noiKjPZNMC5MGtVqPPPIIjh492uD96OhovPTSSwCAH374AV26dIGHhwcAYPHixZgyZYpW91coFNi8\neXOjn6Wnp2Po0KGwtraGj4+PRlKaMWMG/vOf/+DmzZu6Nklnb7/9Nt566y31awsLC/z6668P/J5S\nqUSfPn2a/HzRokXo0aMHevTooZEAO3TogGnTpmH58uXNC5zMFpMGtVoymQyNbVhw4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Figure at 0x5bbe390>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Slope is 3.1e+07 s/m**2\n",
+ "\n",
+ "Diffusivity is 9.17e-06 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.3,Page no:585"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "P=101.3e3 #pressure of the operating column\n",
+ "T=295.0 #Temperature of the operating column\n",
+ "P_A=7.0e3 #partial pressure of ammonia\n",
+ "x=1.0e-3 #=(y1-y2)Thickness of stationary gas film\n",
+ "D=2.36e-5 #Diffusivity of ammonia\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C_A=(1.0/22.4)*(273.0/T)*(P_A/P) #=(C_A1-C_A2)Concentration of ammonia gas\n",
+ "#X=C_T/C_BM\n",
+ "X=P*math.log(P/(P-P_A))/(P-(P-P_A)) \n",
+ "#From equation 10.33\n",
+ "N_A_=(D/x)*X*(C_A) \n",
+ "\n",
+ "#Result\n",
+ "print\"The transfer rate per unit area = %.2e\"%N_A_,\"kmol/m**2*s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The transfer rate per unit area = 6.98e-05 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.4,Page no:606"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Q=3e-6 #Flow rate of water\n",
+ "Meu=1e-3 #Viscosity of water\n",
+ "D=1.5e-9 #diffusivity of carbon dioxide in water\n",
+ "rho=1e3 #Density of water\n",
+ "\n",
+ "#Calculation\n",
+ "s=(Q*1e2*Meu*3/(rho*9.81))**(1.0/3.0) #Thickness of film\n",
+ "A=0.95 \n",
+ "y=s*(1-A)**0.5 #The distance below the free surface\n",
+ "t=(1.305/1.822)**2\n",
+ "Us=rho*9.81*s**2/(2*Meu) #surface velocity\n",
+ "L=Us*t #The maximum lend=gth of column\n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The maximum length of column =\",round(L,2),\" m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The maximum length of column = 0.51 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.5,Page no:608"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "N_dot=50 #Initial maas transfer rate\n",
+ "D=1.8e-9 #Diffusivity of gas in liquid phase\n",
+ "C_bg=(1/22.4)*(273.0/293.0) #bulk gas concentration\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "N_C=N_dot*C_bg #Initial maas transfer rate in terms of cocentration\n",
+ "h=N_C/0.04 # Effective Mass transfer coefficient\n",
+ "R=1/h #Equivalent resistance\n",
+ "R_l=R*9 #Liquid phase resistance\n",
+ "h_l=1/R_l #Liquid phase coefficient\n",
+ "#From equation 10.113 and using liquid phase resistance\n",
+ "t=R_l**2/(math.pi/D) \n",
+ "\n",
+ "#Result\n",
+ "print\"The required time is =%.2e\"%t,\"s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required time is =1.72e-11 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.6,Page no:608"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "import math\n",
+ "#Diffusivity of CO2 in ethanol\n",
+ "D=4*10**-9 #in m**2/sw\n",
+ "t=100 #Time in sec\n",
+ "import sympy\n",
+ "Cai=sympy.Symbol('x') \n",
+ "\n",
+ "#Calculation\n",
+ "y=[0,10**-3] \n",
+ "\n",
+ "mole=[0]*3\n",
+ "for i in range(0,2):\n",
+ " mole[i]=((2*math.sqrt(D*t/math.pi)*math.exp(-y[i]**2/(4*D*t)))-(y[i]*math.erfc(y[i]/(2*math.sqrt(D*t))))) \n",
+ "\n",
+ "ret=(mole[0]-mole[1])/mole[0] \n",
+ "\n",
+ "#Result\n",
+ "print\"Proportion retained is %d\"%(ret*100),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Proportion retained is 83 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.8,Page no:621"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "L=825.0e-3 #length of the tube\n",
+ "d=15.0e-3 #diameter of the tube\n",
+ "P_i=7.5e3 #Partial pressure of ammonia at inlet\n",
+ "P_o=2.0e3 #Partial pressure of ammonia at inlet\n",
+ "A_r=2.0e-5 #Air rate\n",
+ "P=101.3e3 #Atmospheric pressure\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D_F_m=(P_i-P_o)/math.log(P_i/P_o) #Mean driving force\n",
+ "A_absorbd=A_r*((P_i/(P-P_i))-(P_o/(P-P_o))) \n",
+ "A_w=math.pi*d*L #Wetted surface\n",
+ "K_G=(A_absorbd/(A_w*D_F_m)) #Overall transfer coefficient\n",
+ "\n",
+ "#Result\n",
+ "print\"Overall Transfer coefficient =%.2e\"%K_G,\"kmol/[m**2 s (N/m**2)]\"\n",
+ "print\"NOTE:Very approx answer in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall Transfer coefficient =7.40e-09 kmol/[m**2 s (N/m**2)]\n",
+ "NOTE:Very approx answer in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.9,Page no:628"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "\n",
+ "z=0.693 \n",
+ "#Calculation\n",
+ "import math\n",
+ "ratio=(math.exp(math.sqrt(z))+math.exp(-math.sqrt(z))-4.0)/(2.0*(1-math.exp(-math.sqrt(z))-math.exp(math.sqrt(z)))) \n",
+ "\n",
+ "#Result\n",
+ "print\"The final ratio is\",round(ratio,1)\n",
+ "print\"NOTE:Wrong answer in book\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The final ratio is 0.4\n",
+ "NOTE:Wrong answer in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.10,Page no:629"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "#After denoting the original conditions by subscript 1,\n",
+ "#The mass transfer rate (moles/unit area and unit time) is given by\n",
+ "#N_A2=0.83*N_A1\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "n=2*(math.log(0.83/(1.35)**0.5)/math.log(0.8))-1 \n",
+ "\n",
+ "#Result\n",
+ "print\"n =\",round(n,2)\n",
+ "print\"Thus the reaction is of second order\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n = 2.01\n",
+ "Thus the reaction is of second order\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.11,Page no:630"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "k = 2.5*10**-6 #[s**-1] Rate constant\n",
+ "E = 2.643*10**7 #[J/kmol] Energy of Activation\n",
+ "R = 8314 #[J/kmol.K] Universal gas contss\n",
+ "D = 10**-9 #[m**2/s] MOlecular diffuisivity\n",
+ "L = .01 #[m] Film Thickness\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "#At T =293K\n",
+ "T = 293 #[K] temperature\n",
+ "A = k/math.exp(-E/(R*T)) #[s**-1]\n",
+ "e = math.exp(-2*L*math.sqrt(k/D)) \n",
+ "N = math.sqrt(k/D)*(1+e)/(1-e) #Consider relative Solubility at 293 K be unity\n",
+ "#At T =313K\n",
+ "T2 = 313 #[K] temperature\n",
+ "k2 = A*math.exp(-E/(R*T2)) #[s**-1]\n",
+ "e2 = math.exp(-2*L*math.sqrt(k2/D)) \n",
+ "N2 = .8*math.sqrt(k2/D)*(1+e2)/(1-e2) #Consider relative Solubility at 313 K be .8 wrt that of 293K\n",
+ "\n",
+ "Nr = N2/N \n",
+ "\n",
+ "#Result\n",
+ "print'Change in mass transfer rate is given by factor',round(Nr,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in mass transfer rate is given by factor 0.86\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.12,Page no:643"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "k=5e-4 #first order rate constant\n",
+ "D_e=2e-9 #effective diffusivity of reactants in the pores of the particles\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "lamda=(k/D_e)**0.5 \n",
+ "# (i) For the platelet of thickness 8 mm,\n",
+ "L=0.5*(8e-3) \n",
+ "phi=lamda*L #thiele modulus\n",
+ "#From equation 10.202, the effectiveness factor 'eta' is given by:\n",
+ "eta=(1/phi)*math.tanh(phi) \n",
+ "#(ii) For the sphere of diameter 10 mm, r_o = 0.005 m**-1.\n",
+ "r_o=5e-3 \n",
+ "phi_o=lamda*r_o #Thiele modulus\n",
+ "#From equation 10.212, the effectiveness factor 'eta' is given by:\n",
+ "eta_o=(3/phi_o)*((1.0/math.tanh(phi_o))-(1/phi_o)) \n",
+ "\n",
+ "#result\n",
+ "print\"\\n (i) Thiele modulus =\",phi \n",
+ "print\"\\n The effectiveness factor =\",round(eta,3)\n",
+ "print\"\\n (ii) Thiele modulus =\",phi_o\n",
+ "print\"\\n The effectiveness factor =\",round(eta_o,3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (i) Thiele modulus = 2.0\n",
+ "\n",
+ " The effectiveness factor = 0.482\n",
+ "\n",
+ " (ii) Thiele modulus = 2.5\n",
+ "\n",
+ " The effectiveness factor = 0.736\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.13,Page no:644"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "D_e=1e-5 #Effective diffusivity for the reactants in the catalyst particle\n",
+ "k=14.4 #first order rate constant\n",
+ "L=2.5e-3 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "lamda=(k/D_e)**0.5 \n",
+ "phi=(k/D_e)**0.5*(L) #Thiele modulus\n",
+ "#From equation 10.202, the effectiveness factor,\n",
+ "eta=(1/phi)*math.tanh(phi) \n",
+ "#The concentration profile is given by equation 10.198\n",
+ "y=1.25e-3 \n",
+ "C_Ai=0.15 \n",
+ "C_A=C_Ai*(math.cosh(lamda*y)/math.cosh(lamda*L)) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n (i) The effectiveness factor =\",round(eta,3)\n",
+ "print\"\\n (ii) The concentration of reactant at a position half-way between the centre and the outside of the\\n\\t pellet =\",round(C_A,3),\"kmol/m**3\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (i) The effectiveness factor = 0.332\n",
+ "\n",
+ " (ii) The concentration of reactant at a position half-way between the centre and the outside of the\n",
+ "\t pellet = 0.035 kmol/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:10.14,Page no:645"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "R_r=8.2e-2 #reaction rate when concentration =0.011 kmol/m**3\n",
+ "D_e=7.5e-8 #Effective diffusivity\n",
+ "\n",
+ "#Calculation\n",
+ "#catalyst = eta*k*C_Ai (equation 10.217),\n",
+ "#eta=phi_L**-1\n",
+ "#Substituting numerical values in prev eqn:\n",
+ "k=(1.217*R_r/0.011)**2 \n",
+ "phi_L=1.217*(k)**0.5 \n",
+ "eta=phi_L**-1 \n",
+ "\n",
+ "#Result\n",
+ "print\"Effectiveness factor =\",round(eta,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effectiveness factor = 0.0906\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_11.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_11.ipynb new file mode 100755 index 00000000..65d448d9 --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_11.ipynb @@ -0,0 +1,161 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11:The Boundary Layer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:11.1,Page no:680"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "u_s=1 #Velocity of water\n",
+ "w=0.6 #Width of plane surface\n",
+ "l=1 #Length of plane surface\n",
+ "A=0.6*1 #Area of the surface\n",
+ "Re_xc=10**5 #Reynods group\n",
+ "\n",
+ "#Calculation\n",
+ "#Taking\n",
+ "Meu=1e-3 #Viscosity of water\n",
+ "rho=1000 #Density of water\n",
+ "Re=rho*u_s*l/Meu\n",
+ "#Mean value of S/pw2 from equation 11.41\n",
+ "#X=R/(rho*u**2)\n",
+ "X=0.037*(Re)**-0.2+(Re**-1)*(0.646*(10**5)**0.5-0.037*(10**5)**0.8)\n",
+ "F=X*rho*u_s**2*A \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Total drag force =\",round(F,2),\"N (approx)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Total drag force = 1.3 N (approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:11.2,Page no:680"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "x=150e-3 #Distance from leading edge where thicness is to be found\n",
+ "Meu_o=0.05 #viscosity of oil\n",
+ "rho_o=1000 #Density of oil\n",
+ "u=0.3 #Velocity of flow\n",
+ "\n",
+ "#Calculation\n",
+ "Re_x=x*u*rho_o/Meu_o \n",
+ "#For streamline flow:\n",
+ "#from equation 11.17\n",
+ "dell=4.64*x/Re_x**0.5 #thickness of the boundary layer\n",
+ "#from equation 11.20\n",
+ "del_star=0.375*dell \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The thickness of the boundary layer =\",dell*1e3,\"mm\"\n",
+ "print\"\\n The displacement thickness =\",del_star*1e3,\"mm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The thickness of the boundary layer = 23.2 mm\n",
+ "\n",
+ " The displacement thickness = 8.7 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:11.3,Page no:684"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "D=50e-3 #Diameter of the pipe\n",
+ "Q=2e-3 #Flow rate of benzene through pipe\n",
+ "rho_b=870 #Density of benzene\n",
+ "Meu_b=0.7e-3 #Viscosity of benzene\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "G=Q*rho_b #Mass flow rate of benzene\n",
+ "Re=4*G/(Meu_b*math.pi*D) #Reynolds number\n",
+ "#From equation 11.49:\n",
+ "del_b=62*D*Re**(-7.0/8.0) \n",
+ "area=math.pi/4*D**2 #Cross sectional are of pipe\n",
+ "u=G/(rho_b*area) #mean velocity\n",
+ "#From equation 11.47:\n",
+ "u_b=2.49*u*Re**(-1.0/8.0) \n",
+ "print\"\\n The thickness of the laminar sub-layer =\",round(del_b*1e3,3),\"mm\"\n",
+ "print\"\\n The velocity of the benzene at the edge of the laminar sub-layer =\",round(u_b,3),\"m/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The thickness of the laminar sub-layer = 0.195 mm\n",
+ "\n",
+ " The velocity of the benzene at the edge of the laminar sub-layer = 0.637 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_12.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_12.ipynb new file mode 100755 index 00000000..fe313489 --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_12.ipynb @@ -0,0 +1,328 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12:Momentum,Heat and MAss Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:12.1,Page no:714"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=250e-3 #internal diameter of pipe\n",
+ "u=15 #Velocity of air through the pipe\n",
+ "y1=50e-3 #First point where velocity is to be found out\n",
+ "y2=5e-3 #Second point where velocity is to be found out\n",
+ "rho_air=1.10 #Density of air\n",
+ "Meu_air=20e-6 #Viscosity of air\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Re=d*u*rho_air/Meu_air \n",
+ "#Hence, from Figure 3.7: X=R/(rho*u**2)=0.0018\n",
+ "X=0.0018 \n",
+ "u_s=u/0.817 \n",
+ "u_star=u*X**0.5 \n",
+ "#At 50 mm from the wall:\n",
+ "y1_r=2*y1/d # y/r\n",
+ "#Hence, from equation 12.34:\n",
+ "u_x1=u_s+2.5*u_star*math.log(y1_r) \n",
+ "#At 5 mm from the wall:\n",
+ "y2_r=2*y2/d # y/r\n",
+ "#Hence, from equation 12.34:\n",
+ "u_x2=u_s+2.5*u_star*math.log(y2_r) \n",
+ "#The thickness of the laminar sub-layer is given by equation 12.54:\n",
+ "del_b=5*d/(Re*X**0.5) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The fluid velocity at 50 mm from the wall =\",round(u_x1,1),\"m/s\" \n",
+ "print\"\\n The fluid velocity at 5 mm from the wall =\",round(u_x2,1),\"m/s\" \n",
+ "print\"\\n The thickness of the laminar sub-layer =\",round(del_b*1e3,3),\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The fluid velocity at 50 mm from the wall = 16.9 m/s\n",
+ "\n",
+ " The fluid velocity at 5 mm from the wall = 13.2 m/s\n",
+ "\n",
+ " The thickness of the laminar sub-layer = 0.143 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:12.2,Page no:722"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "u=10 #Velocity of air\n",
+ "T=330 #Temperature of air\n",
+ "d=25e-3 #Inner diameter of pipe\n",
+ "T_p=415 #Temperature at which the pipe is maintained\n",
+ "DP_l=80 #Drop of static pressure along the pipe per unit length\n",
+ "\n",
+ "import math\n",
+ "#From equations 12.98 and 3.18:\n",
+ "#we get h=0.05*Cp\n",
+ "#The heat taken up per unit time by the air dQ=0.0052*Cp*dT......(i)\n",
+ "#The heat transferred through the pipe wall is also given by: = 0.039*Cp*(415-T)......(ii)\n",
+ "#Equating (i) & (ii)\n",
+ "#On integrating we get\n",
+ "T_0=415-(85/math.exp(0.45))\n",
+ "print\"\\n The required air Temperature =%d\"%T_0,\"K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The required air Temperature =360 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:12.2,Page no:732"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "u=0.5 #m/s\n",
+ "l=20.0/1000.0 #m lemngth of tube\n",
+ "mu=10**-3\n",
+ "rho=1000.0 #kg/m**3\n",
+ "Sc=2330.0\n",
+ "#Calculation\n",
+ "Re=l*u*rho/mu\n",
+ "Hd=u*0.032*Re**(-1/4.0)*(1+2.0*(Sc-1)*Re**(-1/8.0))**-1\n",
+ "\n",
+ "#result\n",
+ "print\"Mass Transfer coefficient is: %.3e\"%Hd,\"kmol/m**2 s= %.3e\"%Hd,\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass Transfer coefficient is: 1.085e-06 kmol/m**2 s= 1.085e-06 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:12.3,Page no:733"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "u=3.5 #Velocity of water\n",
+ "d=25e-3 #Diameter of the pipe\n",
+ "l=6 #Length of the pipe\n",
+ "T1=300 #Temperature at enterance\n",
+ "T2=330 #Temperature at exit\n",
+ "rho=1000 #density of water at 310 K\n",
+ "Meu=0.7e-3 #Viscosity of water at 310 K\n",
+ "#Taking the fluid properties at 310 K and assuming that fully developed flow exists\n",
+ "Cp=4.18e3 #heat capapcity\n",
+ "k=0.65 #Thermal conductivity\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Re=d*u*rho/Meu \n",
+ "Pr=Cp*Meu/k \n",
+ "import math\n",
+ "h1=0.032*(Re**-0.25)*Cp*rho*u #....Equation 12.139\n",
+ "# on solving we get final equation as\n",
+ "theta_dash1=330-10**(math.log10(30)-(0.0654*h1*1e-3/2.303)) \n",
+ "h2=0.032*(Re**-0.25)*(1+2*Re**(-1.0/8.0)*(Pr-1))**-1*Cp*rho*u \n",
+ "# on solving we get final equation as\n",
+ "theta_dash2=330-10**(math.log10(30)-(0.0654*h2*1e-3/2.303)) #....Equation 12.140\n",
+ "h3=0.032*(Re**-0.25)*(1+0.82*Re**(-1.0/8.0)*((Pr-1)+math.log(0.83*Pr+0.17)))**-1*Cp*rho*u #...equation 12.141\n",
+ "# on solving we get final equation as\n",
+ "theta_dash3=330-10**(math.log10(30)-(0.0654*h3*1e-3/2.303)) \n",
+ "h4=k/d*0.023*Re**0.8*Pr**0.33 \n",
+ "# on solving we get final equation as\n",
+ "theta_dash4=330-10**(math.log10(30)-(0.0654*h4*1e-3/2.303)) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n (a) Reynolds analogy\"\n",
+ "print\"\\n The outlet temperature =\",round(theta_dash1,1),\"K\"\n",
+ "print\"\\n\\n (b) Taylor Prandtl Equation\"\n",
+ "print\"\\n The outlet temperature =\",round(theta_dash2,1),\"K\"\n",
+ "print\"\\n\\n (c) Universal velocity profile equation\"\n",
+ "print\"\\n The outlet temperature =\",round(theta_dash3,1),\"K\"\n",
+ "print\"\\n\\n (d) Nu=0.023*Re**0.8*Pr**0.33\"\n",
+ "print\"\\n The outlet temperature = %d\"%theta_dash4,\"K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Reynolds analogy\n",
+ "\n",
+ " The outlet temperature = 324.1 K\n",
+ "\n",
+ "\n",
+ " (b) Taylor Prandtl Equation\n",
+ "\n",
+ " The outlet temperature = 313.9 K\n",
+ "\n",
+ "\n",
+ " (c) Universal velocity profile equation\n",
+ "\n",
+ " The outlet temperature = 317.2 K\n",
+ "\n",
+ "\n",
+ " (d) Nu=0.023*Re**0.8*Pr**0.33\n",
+ "\n",
+ " The outlet temperature = 316 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:12.4,Page no:734"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "u=3.5 #Velocity of air\n",
+ "d=25e-3 #Diameter of the pipe\n",
+ "l=6 #Length of the pipe\n",
+ "T1=290 #Temperature at enterance\n",
+ "T2=350 #Temperature at exit\n",
+ "rho=29/22.4*273/310 #density of air at 310 K\n",
+ "Meu=0.018e-3 #Viscosity of air at 310 K\n",
+ "#Taking the physical properties at 310 K and assuming that fully developed flow exists\n",
+ "Cp=1.003e3 #heat capapcity\n",
+ "k=0.024 #Thermal conductivity\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Re=d*u*rho/Meu \n",
+ "Pr=Cp*Meu/k \n",
+ "h1=0.032*(Re**-0.25)*Cp*rho*u #....Equation 12.139\n",
+ "# on solving we get final equation as\n",
+ "theta_dash1=350-10**(math.log10(60)-(239.88*h1*1e-3/2.303)) \n",
+ "h2=0.032*(Re**-0.25)*(1+2*Re**(-1.0/8.0)*(Pr-1))**-1*Cp*rho*u \n",
+ "# on solving we get final equation as\n",
+ "theta_dash2=350-10**(math.log10(60)-(239.88*h2*1e-3/2.303)) #....Equation 12.140\n",
+ "h3=0.032*(Re**-0.25)*(1+0.82*Re**(-1.0/8.0)*((Pr-1)+math.log(0.83*Pr+0.17)))**-1*Cp*rho*u #...equation 12.141\n",
+ "# on solving we get final equation as\n",
+ "theta_dash3=350-10**(math.log10(60.0)-(239.88*h3*1e-3/2.303)) \n",
+ "h4=k/d*0.023*Re**0.8*Pr**0.33 \n",
+ "# on solving we get final equation as\n",
+ "theta_dash4=350-10**(math.log10(60)-(239.88*h4*1e-3/2.303)) \n",
+ "print\"\\n (a) Reynolds analogy\"\n",
+ "print\"\\n The outlet temperature =\",round(theta_dash1,1),\"K\"\n",
+ "print\"\\n\\n (b) Taylor Prandtl Equation\"\n",
+ "print\"\\n The outlet temperature =\",round(theta_dash2),\"K\"\n",
+ "print\"\\n\\n (c) Universal velocity profile equation\"\n",
+ "print\"\\n The outlet temperature = \",round(theta_dash3,1),\"K\"\n",
+ "print\"\\n\\n (d) Nu=0.023*Re**0.8*Pr**0.33\"\n",
+ "print\"\\n The outlet temperature =\",round(theta_dash4,1),\"K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Reynolds analogy\n",
+ "\n",
+ " The outlet temperature = 348.3 K\n",
+ "\n",
+ "\n",
+ " (b) Taylor Prandtl Equation\n",
+ "\n",
+ " The outlet temperature = 349.0 K\n",
+ "\n",
+ "\n",
+ " (c) Universal velocity profile equation\n",
+ "\n",
+ " The outlet temperature = 349.0 K\n",
+ "\n",
+ "\n",
+ " (d) Nu=0.023*Re**0.8*Pr**0.33\n",
+ "\n",
+ " The outlet temperature = 349.5 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_13.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_13.ipynb new file mode 100755 index 00000000..12141327 --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_13.ipynb @@ -0,0 +1,720 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13:Humidification and water cooling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:13.1,Page no:740"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "P=101.3e3 \n",
+ "T=297 \n",
+ "R=8314 #gas constant\n",
+ "RH=60 #Relative humidity\n",
+ "p_b1=12.2e3 #Vapor pressure at 297 K\n",
+ "p_b2=6e3 #Vapor pressure at 283 K\n",
+ "M_w=78 #molecular weight of benzene\n",
+ "M_a=28 #Mass of nitrogen \n",
+ "\n",
+ "#Calculation\n",
+ "#From the definition of percentage relative humidity (RH)\n",
+ "P_w=(p_b1)*(RH/100.0) \n",
+ "#In the benzene -nitrogen mixture:\n",
+ "m_b=P_w*M_w/(R*T) #mass of benzene\n",
+ "m_n=(P-P_w)*M_a/(R*T) #mass of nitrogen\n",
+ "H=m_b/m_n #Humidity at 297 K\n",
+ "#In order to recover 80 per cent of the benzene, the humidity must be reduced to 20 per cent of the initial value\n",
+ "H_o=H*.20 \n",
+ "#Thus in equation 13.2\n",
+ "P_r=p_b2+(p_b2/M_a*M_w)/H_o \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The required pressure is =\",round(P_r*1e-3,1),\"kN/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The required pressure is = 391.2 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:13.2,Page no:741"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "P=101.3e3 #Given pressure\n",
+ "T=300 #Given Temperature\n",
+ "RH=25 #Percentage relative humidity of water \n",
+ "P_wo=3.6e3 #partial pressure of water vapour when air is saturated with vapour\n",
+ "M_w=18 #Molecular weight of water\n",
+ "M_a=29 #Molecular weight of air\n",
+ "R=8314 #gas constant\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "P_w=P_wo*(RH/100.0) \n",
+ "m_w=P_w*M_w/(R*T) #mass of water vapour\n",
+ "m_a=(P-P_w)*M_a/(R*T) #mass of water air\n",
+ "Vs_w=1/m_w #specific volume of water vapour at 0.9 kN/m**2\n",
+ "Vs_a=1/m_a #specific volume of air at 100.4 kN/m**2\n",
+ "H=m_w/m_a #Humidity\n",
+ "H_v=Vs_a #Humid volume\n",
+ "H_p=(P-P_wo)/(P-P_w)*RH #Percentage humidity\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The partial pressure of the water vapour in the vessel = \",P_w*1e-3,\"kN/m**2\"\n",
+ "print\" b) Specific volume of water vapour =\",round(Vs_w),\"m**3/kg\"\n",
+ "print\" Specific volume of air =\",round(Vs_a,3),\"m**3/kg\" \n",
+ "print\"(c) Humidity of air =\",round(H,4),\"kg water/kg air\"\n",
+ "print\" Humid volume =\",round(H_v,3),\"m**3/kg\"\n",
+ "print\"(d) Percentage humidity =\",round(H_p,1),\"per cent\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The partial pressure of the water vapour in the vessel = 0.9 kN/m**2\n",
+ " b) Specific volume of water vapour = 154.0 m**3/kg\n",
+ " Specific volume of air = 0.857 m**3/kg\n",
+ "(c) Humidity of air = 0.0056 kg water/kg air\n",
+ " Humid volume = 0.857 m**3/kg\n",
+ "(d) Percentage humidity = 24.3 per cent\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:13.3,Page no:743"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "T=310.0 #Temperature of moist air\n",
+ "T_w=300.0 #Wet bulb tempeature\n",
+ "L=2440e3 #Latent heat of vapourisation of water at 300 K\n",
+ "P=105e3 #Given total pressure\n",
+ "P_wo1=3.6e3 #Vapour pressure of water vapour at 300 K\n",
+ "P_wo2=6.33e3 #Vapour pressure of water vapour at 310 K\n",
+ "M_w=18.0 #Molecular weight of water\n",
+ "M_a=29.0 #Molecular weight of air\n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "H_w=(P_wo1/(P-P_wo1))*(M_w/M_a) #The humidity of air saturated at the wet-bulb temperature\n",
+ "#Therefore, taking (h/hD*rho*A) as 1.0 kJ/kg K, in equation 13.8:\n",
+ "H=H_w-(1e3/L)*(T-T_w) \n",
+ "#In equation 13.2:\n",
+ "x=sympy.Symbol('x') \n",
+ "P_w=sympy.solve(H*(P-x)*M_a-M_w*x) \n",
+ "RH=P_w[0]/P_wo2*100.0 \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The humidity of the air =\",round(H,3),\"kg/kg\"\n",
+ "print\"\\n The percentage relative humidity (RH)=\",round(RH,1),\"per cent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The humidity of the air = 0.018 kg/kg\n",
+ "\n",
+ " The percentage relative humidity (RH)= 46.6 per cent\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:13.4,Page no:749"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "#Refer HUMIDITY ENTHALPY PLOT Figure 13.5 Page 748 as Humidity Chart\n",
+ "#According the given passes and situatuion\n",
+ "T = [325,301,308,312,315] #[K]\n",
+ "H = [.005,.015,.022,.027,.032] #[kg/kg]\n",
+ "#From Humidity Chart on humidifying to 60 percent humidity\n",
+ "Tw = [296,301,305,307] #[K]\n",
+ "\n",
+ "#Calculation\n",
+ "Hin = H[4]-H[0] #[kg/kg] Increase in Humidity\n",
+ "#From Humitidy Chart at the obtained leaving conditions\n",
+ "v = .893 #[m**3/kg] Specific Volume of dry air\n",
+ "vs = .968 #[m**3/kg] Specific Volume of Saturated air\n",
+ "vh = .937 #[m**3/kg] Humid Volume of air of 60 per cent humidity by Interpolation of Curve in Humidity Chart\n",
+ "x = 5 #[m**3/s] Amount of moist air leaves the dryer in (b)\n",
+ "m = x/vh #[kg/s] Mass of air passing through the dryer\n",
+ "mw = m*Hin # [kg/s] Mass of water evaporated\n",
+ "Tb = 370.0 #[K] dry Bulb temperature corresponding to humidity of .005 kg/kg and wet-bulb temperature 307 K\n",
+ "\n",
+ "#Result\n",
+ "print'\\n\\n (a) The temperature of the material on each tray (in Kelvin)'\n",
+ "print \"\\t\",Tw,\"K\"\n",
+ "print' Thus the air leaving the system is at',T[4],' K and 60 per cent humidity.'\n",
+ "print'\\n\\n (b) If 5 m**3/s moist air leaves the dryer, The amount of water removed is',round(mw,3),' kg/s.'\n",
+ "print'\\n\\n (c) The Temperature to which the inlet air would have to be raised\\n to carry out the drying in single stage is',Tb,'K.'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " (a) The temperature of the material on each tray (in Kelvin)\n",
+ "\t[296, 301, 305, 307] K\n",
+ " Thus the air leaving the system is at 315 K and 60 per cent humidity.\n",
+ "\n",
+ "\n",
+ " (b) If 5 m**3/s moist air leaves the dryer, The amount of water removed is 0.144 kg/s.\n",
+ "\n",
+ "\n",
+ " (c) The Temperature to which the inlet air would have to be raised\n",
+ " to carry out the drying in single stage is 370.0 K.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:13.5,Page no: 753"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "G1=1 #flow rate of air at 350 K\n",
+ "PH1=10 #Percentage Humidity at 350 K\n",
+ "G2=5 #flow rate of air at 300 K\n",
+ "PH2=30 #Percentage Humidity at 300 K\n",
+ "#from fig 13.4\n",
+ "H1=0.043 #Humidity at 350 K and 10 percent humidity\n",
+ "H2=0.0065 #Humidity at 300 K and 30 percent humidity\n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "#Thus, in equation 13.23:\n",
+ "H=((G1*H1)+(G2*H2))/(G1+G2) \n",
+ "#from fig 13.5\n",
+ "H_1=192e3 #Entahlpy at 350 K and 10 percent humidity\n",
+ "H_2=42e3 #Enthalpy at 300 K and 30 percent humidity\n",
+ "x=sympy.Symbol('x') \n",
+ "H_=sympy.solve((G1*(x-H_1))-(G2*(H_2-x))) \n",
+ "#From Figure 13.5:\n",
+ "#at H_ (Enthalpy)= 67 kJ/kg and H(humidity) = 0.0125 kg/kg\n",
+ "T=309 \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Humidity of final stream =\",round(H,4),\"kg/kg\" \n",
+ "print\"\\n Entahlpy of the resultant stream =\",round(H_[0]*1e-3),\"kJ/kg\"\n",
+ "print\"\\n Temperature of the resultant stream =\",T,\"K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Humidity of final stream = 0.0126 kg/kg\n",
+ "\n",
+ " Entahlpy of the resultant stream = 67.0 kJ/kg\n",
+ "\n",
+ " Temperature of the resultant stream = 309 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:13.6,Page no:755"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "G_s=0.15 #Mass flow rate of steam\n",
+ "T=400 #Temperature to which steam is superheated\n",
+ "T_a=320 #Tremperature of air \n",
+ "RH_a=20 #Percentage relative humidity of air\n",
+ "G_a=5 #Mass flow rate of air\n",
+ "L=2258e3 #latent heat of steam\n",
+ "Cp=2e3 #Specific heat of superheated steam\n",
+ "\n",
+ "#Calculation\n",
+ "#Enthalpy of steam\n",
+ "H_3=4.18*(373-273)+L+Cp*(T-373) \n",
+ "#From Figure .13.5:\n",
+ "#at T=320 K and 20 percent Relative Humidity\n",
+ "H1=0.013 #Humidity\n",
+ "H_1=83e3 #Enthalpy\n",
+ "#By making required constructions we get\n",
+ "H=0.043 \n",
+ "H_=165e3 \n",
+ "T_s=324 \n",
+ "#from chart and equation 13.28\n",
+ "G_case2=0.41 \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Relative humidity of stream=\",round(H,3),\"kg/kg\"\n",
+ "print\" Entahlpy of stream =\",H_*1e-3,\" kJ/kg\"\n",
+ "print\" Temperature of stream =\",T_s,\"K\"\n",
+ "print\"\\n\\n When exit temperature = 330 K\"\n",
+ "print\" The required flow of steam = \",round(G_case2,2),\" kg/s\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Relative humidity of stream= 0.043 kg/kg\n",
+ " Entahlpy of stream = 165.0 kJ/kg\n",
+ " Temperature of stream = 324 K\n",
+ "\n",
+ "\n",
+ " When exit temperature = 330 K\n",
+ " The required flow of steam = 0.41 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.7,Page no:761"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declartaion\n",
+ "theta1=300 #K\n",
+ "theta2=320 #K\n",
+ "H=0.2 #Percent humidity\n",
+ "\n",
+ "#Calculation\n",
+ "#From standard charts(Fig 13.4):\n",
+ "H1=0.0045 #Humidity in kg/kg\n",
+ "H2=0.0140 #Humidity in kg/kg\n",
+ "\n",
+ "#Heat the air from 300 to 318 K\n",
+ "theta=294.5 #K\n",
+ "#H=0.0140 kg/kg\n",
+ "\n",
+ "#Result\n",
+ "print\"Heat the saturated air at H=\",H2,\"kg/kg from\",theta,\"to\",theta2,\"K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat the saturated air at H= 0.014 kg/kg from 294.5 to 320 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no 13.8,Page no:766"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "T_water_enter=301.0 #Water entering the tower in [K]\n",
+ "T_water_leave=294.0 #Water entering the tower in [K]\n",
+ "air_drybulb=287.0 #[K]\n",
+ "air_wetbulb=284.0 #[K]\n",
+ "m=4810.0 #[kg/s] Water flow rate\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "delta_T=T_water_enter-T_water_leave #Temperatue range of water\n",
+ "T_mean=0.5*(T_water_enter+T_water_leave) #MEan wate temperature in [K]\n",
+ "H_mean=92.6 #kJ/kg\n",
+ "H_drybulb=49.5 #kJ/kg\n",
+ "delTdash=T_mean-air_drybulb\n",
+ "delHdash=H_mean-H_drybulb\n",
+ "import math\n",
+ "Dt=m/(0.00369*(delHdash/delta_T)*math.sqrt(delTdash+(0.0752*delHdash)))\n",
+ "from scipy.optimize import fsolve\n",
+ "Ct=5.0\n",
+ "h=100.0 #height assumed in [m]\n",
+ "Ab=Dt/(19.50*math.sqrt(h)/(Ct**1.5))\n",
+ "Id=math.sqrt(round(Ab)*4/math.pi)\n",
+ "\n",
+ "#Result\n",
+ "print \"Thus the internal diameter of the column at sill level,\",round(Id,1),\"m\"\n",
+ "print\"Since this gives a height-dia ratio=3:2 the design is aceptable\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thus the internal diameter of the column at sill level, 64.6 m\n",
+ "Since this gives a height-dia ratio=3:2 the design is aceptable\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:13.9,Page no:775"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Ti=293 #Inlet temperature in [K]\n",
+ "L=2495 #Latent heat of water in kJ/kg\n",
+ "flow=0.68 #[m**3/m**2 s] flow of air \n",
+ "water_thru=0.26 #Water througput in [kg/m**2 s]\n",
+ "Cp_air=1.003 #Specific heat of air in kJ/kg K\n",
+ "Cp_wv=2.006 #Sp heat of water vapour\n",
+ "wv_in=0.003 #Water vapour in inlet air[kg/kg dry air]\n",
+ "wv_in_m=0.005 #kmol/kmol dry air\n",
+ "H=0.003\n",
+ "hd_a=0.2 #Resistance whole\n",
+ "\n",
+ "#Calculation\n",
+ "Hg1=Cp_air*(Ti-273.0)+H*(L+Cp_wv*(Ti-273.0)) #;kJ/kg]\n",
+ "flow=(1.0-wv_in_m)*flow\n",
+ "rho=(29.0/22.4)*(273.0/Ti) #Density of air at 293 K[kg/m**3]\n",
+ "G_dash=rho*flow #[kg/m**s]\n",
+ "slope=water_thru*4.18/G_dash\n",
+ "theta_l1=293 \n",
+ "Hg1=27.67 #kJ/kg\n",
+ "import numpy as np\n",
+ "Hg=np.array([27.7,30,40,50,60,70,76.5])\n",
+ "theta=np.array([293,294.5,302,309,316,323,328])\n",
+ "Hf=np.array([57.7,65,98,137,190,265,355])\n",
+ "Hf_Hg=Hf-Hg\n",
+ "one_Hf_Hg=1.0/(Hf_Hg)\n",
+ "%pylab inline\n",
+ "plot(Hg,one_Hf_Hg)\n",
+ "ylabel(\"1/(Hf-Hg)\")\n",
+ "xlabel(\"Hg(kJ/kg)\")\n",
+ "title(\"Evaluation of the integral of dHg/(Hf-Hg)\")\n",
+ "from scipy.integrate import simps, trapz\n",
+ "area = simps(Hg,one_Hf_Hg,dx=10)\n",
+ "area=0.65\n",
+ "#At bottom of the column:\n",
+ "delta_H1=Hf[0]-Hg[0]\n",
+ "#At the top of the column:\n",
+ "delta_H2=Hf[6]-Hg[6]\n",
+ "m_water_temp=0.5*(theta[0]+theta[6])\n",
+ "Hgm=52\n",
+ "Hfm=145\n",
+ "del_Hm=93\n",
+ "f=0.79\n",
+ "intg=(Hg[6]-Hg[0])/(f*del_Hm)\n",
+ "z=intg*G_dash/(hd_a*rho)\n",
+ "show()\n",
+ "\n",
+ "#Result\n",
+ "print \"Height of packing,z=\",round(z,1),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['f']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEZCAYAAABWwhjiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYVdX6wPHvUdBESHDgoEBiDIKKB5LE7FYY4YBCmmlo\nAyqZmUN19Wc2inUfh8rK4VbqNcMycr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np1VwcLDy9PRUISEh6uzZs+YOtVb27Nmj/P39lcFgUL6+vurtt99WSimLad91SUlJKiwsTCllOW07\nfPiwMhgMymAwqK5du6pZs2YppSynfUoptWvXLhUQEKC6d++uhgwZovLy8iyqfQUFBapNmzbq/Pnz\nxtcsqX1z585VXbp0Ud26dVNPPfWUKioqqnH7ZLGhEEKIWmvww1lCCCHMR5KIEEKIWpMkIoQQotYk\niQghhKg1SSJCCCFqTZKIEEKIWpMkIkQFbG1tSz3/9NNPmTRpUpXHnThxgoEDB1Z6THR0NPPmzTM+\nT05O5plnniEmJqZa57ju+PHjhIaGVru8EHVNkogQFbhxz6Dq7pG0aNEiRo0aVekxN76emJjIgAED\nahyjXq/HwcGB1NTUGh8rRF2QJCJENZVcl3vo0CF69epF9+7dee2110pt+rl27VpjT6SkuLg4evfu\nzenTp8u89/333/PQQw+VOsf18mfOnKn0fOHh4cTGxtZVM4WoEUkiQlSgsLCw1J3tZsyYYexBPP/8\n87z44ovs2bMHV1dX4zG5ubk0bdoUGxubUnWtW7eOuXPnkpCQQJs2bUq9d+rUKaytrUslhpLlW7du\nXeH5AHr27MnWrVvruvlCVIuVuQMQor5q0aIFaWlpxucxMTHs2LED0K5hbNy4EYARI0YwdepUAP74\n4w/jzr2g9V5++OEHduzYwebNm8tcZwH49ttv6devn/F5eeUrOh9oOwVnZGTUUauFqBnpiQhRTdXd\nZq5kOZ1Oh7u7OwUFBezfv79Uueu9msTERPr3719l+crO11DvaSEaPkkiQtRCr169WLt2LaDd9e66\njh07Gu/FANoHfMeOHVm7di1PPfUUe/fuLVPXnj17MBgMlZav6Hyg3fOhY8eOddtAIapJkogQFShv\ndtb11z744APee+89/Pz8OHToEK1atQK0e2xcvXqVixcvljqmc+fOrFy5kmHDhnH48GGuXr1Ks2bN\n2LFjB/7+/mXOUbL8kSNHKjwfQEpKCvfff7+pfx1ClEu2gheiFgoLC2nRogWg9QxWrVrFunXrAG0N\niI+PD4899liFxz/yyCOMHTuW1NRUPD09GT58eK3P9/jjjzN16tRSyUiIW0UurAtRCzt37mTixIko\npXBwcOCTTz4xvjdhwgQiIyMrTCK+vr54e3vTr1+/aq8Nqeh8J06cIC8vTxKIMBvpiQghhKg1uSYi\nhBCi1iSJCCGEqDVJIkIIIWpNkogQQohakyQihBCi1iSJCCGEqLX/BzaWkCCYwsRQAAAAAElFTkSu\nQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7975048>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height of packing,z= 2.2 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:13.10,Page no:782"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "L_dash=0.25 #n-butanol flow rate\n",
+ "Mw=74.0 #Molecular wt of butanol\n",
+ "Ma=29.0 #Molecular wt of air\n",
+ "hDa=0.1 #Mass transfer coefficient per unit volume\n",
+ "b=2.34 #Psychometric ratio\n",
+ "lamda=590 #kJ/kg\n",
+ "Cl=2.5 #kJ/kg K\n",
+ "s=1.05 #Humid heat of gas in [kJ/kg K]\n",
+ "Cp_dry=1.001 #Sp heat of dry air\n",
+ "G=0.7 #Vaour rate \n",
+ "T=[295,300,305,310,315,320,325,330,335,340,345,350]\n",
+ "Pwo=[0.59,0.86,1.27,1.75,2.48,3.32,4.49,5.99,7.89,10.36,14.97,17.5] #kN/m**2\n",
+ "Ho=[0]*12\n",
+ "Hf=[0]*12\n",
+ "Hf_dash=[0]*12\n",
+ "\n",
+ "#Calculation\n",
+ "lamda_dash=lamda/b\n",
+ "print\"______________________________\"\n",
+ "print\"T\\tHo\\tHf\\tHf`\"\n",
+ "print\"_______________________________\"\n",
+ "for i in range(0,12):\n",
+ " Ho[i]=Pwo[i]/(101.3-Pwo[i])*(74/29.0)\n",
+ " Hf[i]=(1/(1+Ho[i]))*Cp_dry*(T[i]-273.0)+Ho[i]*(Cl*(T[i]-273.0)+lamda)\n",
+ " Hf_dash[i]=Cp_dry*(T[i]-273.27)/(1+Ho[i])+Ho[i]*(Cl*(T[i]-273.0)+lamda_dash)\n",
+ " print T[i],\"\\t\",round(Ho[i],4),\"\\t\",round(Hf[i],2),\"\\t\",round(Hf_dash[i],2)\n",
+ "%pylab inline\n",
+ "plot(T,Hf)\n",
+ "plot(T,Hf_dash)\n",
+ "xlim(285,340)\n",
+ "ylim(0,200)\n",
+ "theta_l1=T[0]\n",
+ "Hg1=s*(290.0-273.0)\n",
+ "Hg1=round(Hg1,1)\n",
+ "rho_air=(Ma/22.4)*(273/310.0)\n",
+ "G_dash=G*rho_air\n",
+ "slope=L_dash*Cl/G_dash\n",
+ "theta_l2=T[7]\n",
+ "Hg2=46 #kJ/kg\n",
+ "#y=mx+c\n",
+ "c=Hg2-slope*theta_l2\n",
+ "plot([theta_l1,theta_l2],[Hg1,Hg2])\n",
+ "xlabel(\"Temperature(K)\")\n",
+ "ylabel(\"Enthalpy(kJ/kg)\")\n",
+ "title(\"Graphical construction\")\n",
+ "Hg1_dash=(Hg1+(b-1)*s*(290.0-273.0))/b #[kJ/kg]\n",
+ "slp=-3*s\n",
+ "theta_f1=293.0\n",
+ "import numpy as np\n",
+ "Hf_dash1=np.array([23.9,29.0,35.3,42.1,50.0,57.9,66.7,75.8])\n",
+ "Hg_dash=np.array([17.9,22.0,26.0,30.0,34.0,38.1,42.0,46.0])\n",
+ "Hfd_Hg=Hf_dash1-Hg_dash\n",
+ "HfHG=1/(Hfd_Hg)\n",
+ "mean=[0]*7\n",
+ "interval=[0]*7\n",
+ "value=[0]*7\n",
+ "summ=0\n",
+ "show()\n",
+ "print\"____________________________________________________________________\"\n",
+ "print\"Mean value in interval\\t\\tInterval\\tValue of integral\"\n",
+ "print\"____________________________________________________________________\"\n",
+ "for i in range(0,7):\n",
+ " mean[i]=(HfHG[i]+HfHG[i+1])/2.0\n",
+ " interval[i]=Hg_dash[i+1]-Hg_dash[i]\n",
+ " value[i]=mean[i]*interval[i]\n",
+ " summ=summ+value[i]\n",
+ " print round(mean[i],3),\"\\t\\t\\t\\t\",interval[i],\"\\t\\t\\t\",round(value[i],3),\"\\t\"\n",
+ "z=G_dash*summ/(b*hDa)\n",
+ "print\"Value of integral=\",round(summ,3)\n",
+ "#Result\n",
+ "print \"\\n\\n\\nHeight=\",round(z,1),\"m\"\n",
+ "print\"The final point is given by theta=\",308,\"K\"\n",
+ "print\"NOTE:For 2nd part,calculation can't be done on python,it is drawn geometrically\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "______________________________\n",
+ "T\tHo\tHf\tHf`\n",
+ "_______________________________\n",
+ "295 \t0.0149 \t31.34 \t26.02\n",
+ "300 \t0.0218 \t40.81 \t33.17\n",
+ "305 \t0.0324 \t52.73 \t41.53\n",
+ "310 \t0.0449 \t66.06 \t50.65\n",
+ "315 \t0.064 \t84.02 \t62.13\n",
+ "320 \t0.0865 \t104.48 \t75.01\n",
+ "325 \t0.1183 \t131.75 \t91.53\n",
+ "330 \t0.1604 \t166.64 \t112.23\n",
+ "335 \t0.2155 \t211.63 \t138.59\n",
+ "340 \t0.2907 \t272.16 \t173.74\n",
+ "345 \t0.4425 \t390.67 \t240.99\n",
+ "350 \t0.5329 \t467.26 \t287.04\n",
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['mean']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEZCAYAAACJjGL9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8jtf/x/FX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o8PT3Zt28f\nAwcOZNeuXXh4eHDw4EHjYPaTxxswYABubm7Ur1+fOnXqMHjwYFJSUqhQoQLJyck8ePDgqWvy8vJi\n/vz5+Pr6EhISQlJSEjdu3MDV1TULv10hZJlxIQgNDaV9+/acPn1a71KeSUBAALVq1Uo1RpKWrVu3\nsnHjRqZNm5ZLlQlzJS0KITCtPZLfe+89Fi5cmOnr5s6dy8cff5wLFQlzJy0KIYQQGZIWhRBCiAxJ\nUAghhMiQBIUQQogMSVAIIYTIkASFEEKIDElQCCGEyND/Ay/+5bvPWiSpAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x5797cf8>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "____________________________________________________________________\n",
+ "Mean value in interval\t\tInterval\tValue of integral\n",
+ "____________________________________________________________________\n",
+ "0.155 \t\t\t\t4.1 \t\t\t0.635 \t\n",
+ "0.125 \t\t\t\t4.0 \t\t\t0.501 \t\n",
+ "0.095 \t\t\t\t4.0 \t\t\t0.38 \t\n",
+ "0.073 \t\t\t\t4.0 \t\t\t0.29 \t\n",
+ "0.057 \t\t\t\t4.1 \t\t\t0.232 \t\n",
+ "0.045 \t\t\t\t3.9 \t\t\t0.177 \t\n",
+ "0.037 \t\t\t\t4.0 \t\t\t0.148 \t\n",
+ "Value of integral= 2.363\n",
+ "\n",
+ "\n",
+ "\n",
+ "Height= 8.1 m\n",
+ "The final point is given by theta= 308 K\n",
+ "NOTE:For 2nd part,calculation can't be done on python,it is drawn geometrically\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_2.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_2.ipynb new file mode 100755 index 00000000..a6f061ca --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_2.ipynb @@ -0,0 +1,244 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Flow of Fluids \u2014Energy and Momentum Relationships"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.1,Page no:36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "#(a) PV = 1 * RT, where \n",
+ "R=8314.0 \n",
+ "P=60.0*10**6 \n",
+ "T=320.0 \n",
+ "Tc=191.0 \n",
+ "Pc=4.64*10**6 \n",
+ "\n",
+ "#Calculation\n",
+ "V1=8314.0*T/P \n",
+ "#(b) In van der Waals equation (2.32), the constants may be taken as:\n",
+ "a=27*R**2*Tc**2.0/(64.0*Pc) \n",
+ "b=R*Tc/(8.0*Pc) \n",
+ "#Thus using equation 2.32:\n",
+ "import sympy\n",
+ "x=Symbol('x') \n",
+ "p=sympy.solve((60*10**6*x**2+a)*(x-0.0427)-(8314*320*x**2)) \n",
+ "#(c) Tr=T/Tc ,Pr=P/Pc\n",
+ "Tr=T/Tc \n",
+ "Pr=P/Pc \n",
+ "#Thus from Figure 2.1, \n",
+ "Z=1.33 \n",
+ "#V = ZnRT/P (from equation 2.31)\n",
+ "V3=Z*R*T/P \n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Volume of vessel (ideal gas law) =\",round(V1,4),\"m**3\"\n",
+ "print\"(b) Volume of vessel(van der waals eq.) =\",round(p[0],3),\"m**3\"\n",
+ "print\"(c) Volume of vessel(generalised compressibility-factor chart) =\",round(V3,4),\"m**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Volume of vessel (ideal gas law) = 0.0443 m**3\n",
+ "(b) Volume of vessel(van der waals eq.) = 0.066 m**3\n",
+ "(c) Volume of vessel(generalised compressibility-factor chart) = 0.059 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.3,Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "#Mass rate of discharge of water, G = rho*u*A\n",
+ "rho=1000.0 #Density of Water\n",
+ "d=25.0*10**-3 #Diameter of nozzle\n",
+ "u=25.0 #Velocity of water at nozzle\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "G=rho*u*math.pi/4*d**2 \n",
+ "#Momentum of fluid per second = Gu\n",
+ "F=G*25 \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Reaction force = Rate of change of momentum =\",round(F),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Reaction force = Rate of change of momentum = 307.0 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.4,Page no:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "#Momentum per second of approaching liquid in Y-direction = rho*u**2*A\n",
+ "rho=1000.0 #Density of water\n",
+ "d=50.0*10**-3 #Diameter of pipe\n",
+ "u=5.0 #Velocity of water in pipe\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "M=rho*u**2*math.pi/4*d**2 \n",
+ "Rf=M*(math.cos(math.pi/4)+math.sin(math.pi/4)) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The resultant force in direction of arm of bracket =\",round(Rf,1),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The resultant force in direction of arm of bracket = 69.4 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.5,Page no:48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "#From equation 2.68:\n",
+ "# 0.5*((u2)**2-(u1)**2)=g*(z1-z2)+((P1-P2)/rho)\n",
+ "#Suffix 1 to denote conditions in the pipe and suffix 2 to denote conditions in the jet\n",
+ "#Symbols have their usual meaning\n",
+ "u1=0.0 \n",
+ "z1=0.0 \n",
+ "z2=0.0 \n",
+ "P1=250.0*10**3 \n",
+ "P2=0.0 \n",
+ "rho=1000.0 #Density of water\n",
+ "g=9.81 \n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "x=Symbol('x') \n",
+ "u2=solve((0.5*(x)**2)-((P1-P2)/rho)) \n",
+ "print\"Velocity of the jet, u2 =\",round(u2[1],1),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of the jet, u2 = 22.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.6,Page no:54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "id=0.5 #internal diameter of pipe\n",
+ "rs=50 #revolution speed\n",
+ "ir=0.15 #internal radius of water\n",
+ "rho=1000 #density of water\n",
+ "\n",
+ "#Calculation\n",
+ "omega=2*math.pi*rs \n",
+ "#The wall pressure is given by equation 2.82 as:\n",
+ "wall_pressure=rho*(omega)**2/2*((id/2)**2-ir**2) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The wall pressure is %.2e\"%wall_pressure,\"N/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The wall pressure is 1.97e+06 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_3.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_3.ipynb new file mode 100755 index 00000000..ddcbac8f --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_3.ipynb @@ -0,0 +1,578 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3:FLOW OF LIQUIDS IN PIPES AND OPEN CHANNELS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.1,Page no:70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "sap=1.25 #Sulphuric acid pumped\n",
+ "d=25e-3 #Diameter of pipe\n",
+ "l=30 #length of pipe\n",
+ "meu=25e-3 #Viscosity of acid\n",
+ "rho_a=1840 #Density of acid\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Re=4*sap/(math.pi*meu*d) \n",
+ "u=sap/(rho_a*math.pi/4*d**2) \n",
+ "#calculating pressure drop from the energy balance equation and equation 3.19\n",
+ "Dp=rho_a*((0.5+4*0.006*30/0.025)*u**2+9.81*12) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Pressure drop =\",round((Dp/10**3)),\"kN/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Pressure drop = 320.0 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 110
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.2,Page no:70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=50e-3 #Diameter of pipe\n",
+ "l=100.0 #length of pipe\n",
+ "e=0.013 #Roughness of pipe\n",
+ "DPf=50e3 #Maximum pressure drop\n",
+ "rho=1000.0 #density of water\n",
+ "meu=1e-3 #viscosity of water\n",
+ "\n",
+ "#Calculatiom\n",
+ "phi_re2=(DPf)*d**3*rho/(4*l*meu**2) \n",
+ "e_d=e/(d*1e3) \n",
+ "Re=7.9e4 \n",
+ "u=Re*meu/(rho*d) \n",
+ "\n",
+ "#Result\n",
+ "print\"The maximum allowable velocity is =\",round(u,1),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum allowable velocity is = 1.6 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 111
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.3,Page no:71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Dia_tank=5 #Diameter of the tank\n",
+ "len_pipe=100.0 #Length of pipe\n",
+ "dia_pipe=225e-3 #Diameter of pipe\n",
+ "\n",
+ "#Calculation\n",
+ "X=.0020 \n",
+ "def f(D):\n",
+ " return(111.5*(1+(3552*X))**0.5*D**-0.5)\n",
+ "from scipy.integrate import quad\n",
+ "t=quad(f,0.3,3) \n",
+ "\n",
+ "print\"The time taken for the level to fall is therefore about %d\"%t[0],\"s or %.1f\"%(t[0]/60.0),\"min\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The time taken for the level to fall is therefore about 751 s or 12.5 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 112
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.4,Page no:72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d1=0.3 #diameter of pipe from junction A to D or B to D\n",
+ "l1=1.5e3 #length of pipe from junction A to D or B to D\n",
+ "d2=0.5 # diameter of pipe from junction D to C\n",
+ "l2=0.75e3 # length of pipe from junction D to C\n",
+ "h_A=10 # height of tank A above C\n",
+ "h_B=h_A+6 # height of tank A above C\n",
+ "rho=870 # density of liquid\n",
+ "Meu_l=0.7e-3 # viscosity of liquid\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import sympy\n",
+ "import numpy as np\n",
+ "x=Symbol('x') \n",
+ "u2=sympy.solve(x**4-(7.38*x**2)+13.57) \n",
+ "u1=(np.square(u2)-1.47)**0.5 \n",
+ "u3=(u1+u2)/2.78 \n",
+ "#taking the positive values and which satisfy equation 7\n",
+ "U1=u1[2] \n",
+ "U2=u2[2]\n",
+ "U3=u3[2]\n",
+ "Q=math.pi/4*d2**2*U3 \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The volumetric flow rate =%.2f\"%Q,\"m**3/s\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The volumetric flow rate =0.23 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 113
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.5,Page no:86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "r=50.0 \n",
+ "\n",
+ "#Calculation\n",
+ "from scipy.optimize import fsolve\n",
+ "a=Symbol('a') \n",
+ "def f(a):\n",
+ " return(105*a**(8.0/7.0)-56*a**(15.0/7.0)-24.5)\n",
+ "p=fsolve(f,0.5)\n",
+ "y=p[0]*r \n",
+ "\n",
+ "#Result\n",
+ "print\"a =\",round(p[0],2)\n",
+ "print\"y =\",round(y,1),\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a = 0.33\n",
+ "y = 16.6 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 114
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.6,Page no:88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Q=7.2 #Water flow rate\n",
+ "d1=40e-3 #initial pipe diameter\n",
+ "d2=50e-3 #diameter of pipe after enlargement\n",
+ "g=9.81 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "u1=(Q/3600.0)/(math.pi/4*d1**2) #Velocity in 40 mm pipe\n",
+ "u2=(Q/3600.0)/(math.pi/4*d2**2) #Velocity in 50 mm pipe\n",
+ "# The head lost is given by equation 3.77 as:\n",
+ "hf=(u1-u2)**2.0/(2.0*g) \n",
+ "\n",
+ "#Result\n",
+ "print\"Head lost =\",round(hf*1e3,1),\"mm of water\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head lost = 16.7 mm of water\n"
+ ]
+ }
+ ],
+ "prompt_number": 115
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.7,Page no:92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Q_h=2.27 # flow rate of water in m**3/h\n",
+ "T=320 #Temperature of water to be pumped\n",
+ "id=40e-3 #internal diameter of pipe\n",
+ "l_h=150.0 #length of pipe horizontally\n",
+ "l_v=10.0 #length of pipe vertically\n",
+ "e=0.2e-3 \n",
+ "g=9.81 \n",
+ "rho=1000.0 \n",
+ "\n",
+ "#Calculation\n",
+ "rel_rough=e/id #Relative roughness\n",
+ "meu=0.65e-3 #Viscosity at 320 K\n",
+ "Q_s=Q_h/3600.0 #flow rate of water in m**3/s\n",
+ "area=math.pi/4*id**2 # Area for flow\n",
+ "u=Q_s/area #Velocity\n",
+ "Re=(id*u*rho)/meu \n",
+ "#X=R/(rho*u**2)=0.004 (from Figure 3.7)\n",
+ "X=.004 \n",
+ "equi_len=l_h+l_v+(260*id) # Equivalent length of pipe\n",
+ "hf=4*X*equi_len*u**2/(id*g) \n",
+ "tot_head=hf+1.5+10 # Total head to be developed\n",
+ "mass_thr=Q_s*rho #Mass throughput\n",
+ "power_reqd=(mass_thr*tot_head*g)/0.60 \n",
+ "\n",
+ "#Result\n",
+ "print\"Power required =%.1f\"%power_reqd,\"W =%.3f\"%(power_reqd*1e-3),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power required =136.6 W =0.137 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 116
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.8,Page no:92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=0.15 # diameter of pipe\n",
+ "g=9.81 \n",
+ "phi=.0045 \n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "import math\n",
+ "x=Symbol('x') \n",
+ "u=sympy.solve((7.6+4*phi*(105/.15))*x**2/(2*g)-10) \n",
+ "rate_dis=u[1]*math.pi*d**2/4 \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Rate of discharge =%.d\"%(rate_dis*1e3),\"kg/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Rate of discharge =55 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 117
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.9,Page no:103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "u1=1.5 # velocity\n",
+ "D1=75e-3 #depth\n",
+ "g=9.81 \n",
+ "\n",
+ "#Calculation\n",
+ "#The depth of fluid in the channel after the jump is given by:\n",
+ "D2=0.5*(-D1+(D1**2+(8*u1**2*D1/g)**0.5)) #equation 3.113\n",
+ "#If the channel is of uniform cross-sectional area, then:\n",
+ "u2=u1*D1/D2 \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The velocity of fluid in the channel after the jump is =\",round(u2,2),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The velocity of fluid in the channel after the jump is = 0.75 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 118
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.10,Page no:127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "k=10 \n",
+ "n=0.2 \n",
+ "Ucl=1 # centre line velocity\n",
+ "l=200 # length of pipe\n",
+ "r=.02 # radius of pipe\n",
+ "dux_dy_1=10 \n",
+ "dux_dy_2=50 \n",
+ "Ry_1=k*dux_dy_1**0.2 \n",
+ "Ry_2=k*dux_dy_2**0.2 \n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "#Using the Bingham-plastic model (equation 3.125):\n",
+ "import numpy as np\n",
+ "A=np.array([[1,10],[1,50]])\n",
+ "B=np.array([15.85,21.87])\n",
+ "C=np.linalg.inv(A)*B \n",
+ "Ry=C[0] \n",
+ "Meu_p=C[1] \n",
+ "# Using Equation 3.131\n",
+ "DP=2*k*l*Ucl**n*((n+1)/n)**n*r**(-n-1) \n",
+ "# For a Bingham-plastic fluid:\n",
+ "# The centre line velocity is given by equation 3.145:\n",
+ "X=(l*2*Ry)/(r*DP) \n",
+ "Up=(DP*r**2*(2-4*X+2*X**2))/(8*Meu_p*l) \n",
+ "\n",
+ "#Result\n",
+ "print\"Plastic viscosity (Meu_p) =\",C[1][0]+C[1][1],\"N s/m**2\" \n",
+ "print\"\\nYeild stress (Ry) =\",C[0][0]+C[0][1],\"N s/m**2\"\n",
+ "print\"\\nPressure drop (Bingham plastic model)=%.2e\"%DP,\"N/m**2\"\n",
+ "print\"\\ncentre line velocity (Bingham plastic model) = \",round(Up[0]+Up[1],2),\"m/s (APPROX taken in book)\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Plastic viscosity (Meu_p) = 0.1505 N s/m**2\n",
+ "\n",
+ "Yeild stress (Ry) = 14.345 N s/m**2\n",
+ "\n",
+ "Pressure drop (Bingham plastic model)=6.26e+05 N/m**2\n",
+ "\n",
+ "centre line velocity (Bingham plastic model) = 0.68 m/s (APPROX taken in book)\n"
+ ]
+ }
+ ],
+ "prompt_number": 119
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.11,Page no:129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Meu=0.1 # Viscosity of liquid\n",
+ "d=25e-3 # Diameter of pipe\n",
+ "l=20.0 # length of pipe\n",
+ "DP=1e5 # Pressure drop\n",
+ "n=1/3.0 # flow index of polymer solution\n",
+ "dux_dy=1000.0 \n",
+ "k=Meu \n",
+ "\n",
+ "#Calculation\n",
+ "Meu_a=Meu \n",
+ "k_poly_sol=Meu_a/(dux_dy)**(n-1) \n",
+ "Ry=10.0*(dux_dy)**n \n",
+ "#From equation 3.136:\n",
+ "#For a power-law fluid:\n",
+ "u2=((DP/(4*k_poly_sol*l))**3)*(n*(d**((n+1)/n)))/(2*(3*n+1)) \n",
+ "u1=(DP/(4*k*l))*(d**2)/8.0\n",
+ "ratio=u2/u1 \n",
+ "\n",
+ "#Result\n",
+ "print\"Ratio of the volumetric flow rates of the two liquids =\",round(ratio,3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of the volumetric flow rates of the two liquids = 0.065\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Examople no:3.12,Page no:129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "n=0.5\n",
+ "du_dy=0.01\n",
+ "import sympy\n",
+ "mu=sympy.Symbol('mu')\n",
+ "\n",
+ "#Calculation\n",
+ "k=mu/(du_dy)**(n-1)\n",
+ "Ry=k*du_dy**(n-1)\n",
+ "#ux=(rho*g/k)**(1/n)*((s-y)**(n+1)/n)*(-n/(n+1)]+constant\n",
+ "#At the surface\n",
+ "y=0\n",
+ "ux=0\n",
+ "#At free surface:\n",
+ "#y=s\n",
+ "#us=(rho*g/k)**(1/n)*(n/(n+1))**(s*(n+1)/n)\n",
+ "s=sympy.Symbol('s')\n",
+ "sn=sympy.Symbol('sn')\n",
+ "#For non-newtonian:\n",
+ "us1=0.00592*sn**6/s**5\n",
+ "#For newtonian:\n",
+ "us2=0.0067*sn**5/s**4\n",
+ "sn_s=1/(us1/us2)\n",
+ "\n",
+ "#Result\n",
+ "print\" sN/s=\",round(sn_s*sn/s,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " sN/s= 1.132\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_4.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_4.ipynb new file mode 100755 index 00000000..98b6e823 --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_4.ipynb @@ -0,0 +1,331 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4:Flow of compressible Fluids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.1,Page no:150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=0.006 #Diameter of the cylinder\n",
+ "Gamma=1.47 \n",
+ "#The critical pressures ratio for discharge through the valve\n",
+ "C_r=(2/(Gamma+1))**(Gamma/(Gamma-1)) \n",
+ "#(i) Sonic velocity will occur until the\n",
+ "P_c=101.3/C_r #pressure at which sonic velocity will occur\n",
+ "M=29 #molecular mass of air\n",
+ "\n",
+ "\n",
+ "#Calculatiom\n",
+ "\n",
+ "%pylab inline\n",
+ "import numpy as np\n",
+ "import math\n",
+ "G=[0]*13\n",
+ "G2=[0]*11\n",
+ "P1a=[0.1,0.125,0.15,0.17,0.19,0.2,0.5,1.0,2.0,3.0,4.0,5.0,6.0]\n",
+ "for i in range(4,13):\n",
+ " G[i]=4.23e-2*P1a[i] \n",
+ "for j in range(0,4):\n",
+ " \n",
+ " G[j]=0.0314*(P1a[j])**0.286*math.sqrt((1.0-round(0.519*(P1a[j])**(-0.286),2)))\n",
+ "P2a=[0,1,2,2.65,3,3.5,4,4.5,4.9,4.95,5] \n",
+ "for j in range(4,11):\n",
+ " G2[j]=0.2548*P2a[j]**0.714*math.sqrt(1-0.631*P2a[j]**0.286) \n",
+ "\n",
+ "for i in range(0,4):\n",
+ " G2[i]=0.210 \n",
+ " \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n\\n(i)...The discharge rate are plotted as:\"\n",
+ "print\"G vs P1a data:\"\n",
+ "print\"Above P1a=0.19 MN/m**2\"\n",
+ "print\"P1a(MN/m^2)\\tG(kg/s)\"\n",
+ "for z in range(4,13):\n",
+ " \n",
+ " print P1a[z],\"\\t\\t\",round(G[z],4)\n",
+ "print\"\\nBelow P1a=0.19 MN/m**2\"\n",
+ "print\"P1a(MN/m^2)\\tG(kg/s)\"\n",
+ "for w in range(0,5):\n",
+ " print P1a[w],\"\\t\\t\",round(G[w],4)\n",
+ "a=plt.plot(P1a,G) \n",
+ "plt.title('Rate of discharge of air vs Cylider Pressure\\n')\n",
+ "plt.xlabel('$Cylinder Pressure,P1a(MN/m**2$')\n",
+ "plt.ylabel('$Mass flow G (kg/s)$')\n",
+ "show(a)\n",
+ "print\"\\n\\n(ii)...The Values of G as a functio of P2a:\"\n",
+ "print\"P2a(MN/m^2)\\tG(kg/s)\"\n",
+ "print \"<0.265\",\"\\t\\t\",round(G2[3],4)\n",
+ "for w in range(4,10):\n",
+ " print P2a[w],\"\\t\\t\",round(G2[w],4)\n",
+ "print P2a[10],\"\\t\\t\",round(G2[10])\n",
+ "b=plt.plot(P2a,G2) \n",
+ "plt.annotate('G max', xy=(1,0.22), xytext=(1,0.22))\n",
+ "plt.title('Rate of discharge of air vs Downstream Pressure\\n')\n",
+ "plt.xlabel('$Downstream Pressure,P2a(MN/m**2)$')\n",
+ "plt.ylabel('$Mass flow rate G (kg/s)$')\n",
+ "\n",
+ "show(b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "\n",
+ "\n",
+ "(i)...The discharge rate are plotted as:\n",
+ "G vs P1a data:\n",
+ "Above P1a=0.19 MN/m**2\n",
+ "P1a(MN/m^2)\tG(kg/s)\n",
+ "0.19 \t\t0.008\n",
+ "0.2 \t\t0.0085\n",
+ "0.5 \t\t0.0211\n",
+ "1.0 \t\t0.0423\n",
+ "2.0 \t\t0.0846\n",
+ "3.0 \t\t0.1269\n",
+ "4.0 \t\t0.1692\n",
+ "5.0 \t\t0.2115\n",
+ "6.0 \t\t0.2538\n",
+ "\n",
+ "Below P1a=0.19 MN/m**2\n",
+ "P1a(MN/m^2)\tG(kg/s)\n",
+ "0.1 \t\t0.0\n",
+ "0.125 \t\t0.0042\n",
+ "0.15 \t\t0.0061\n",
+ "0.17 \t\t0.0071\n",
+ "0.19 \t\t0.008\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEuCAYAAAByL06RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYVGX7wPHvILgjIiAooCSQgAsuIIFaWO6apZVibqWZ\nr6WlZZpt2maZmb5mlplbmUumhrmlVpgLi+aWIigpsiTiArLJNjy/P87b/ERRB4UZwPtzXV4XM/Oc\nc+5zhHPPeVadUkohhBBCGMHC3AEIIYSoPCRpCCGEMJokDSGEEEaTpCGEEMJokjSEEEIYTZKGEEII\no0nSEAYbNmzA1dUVa2trjhw5ct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pc6UUK1euZOrUqRQWFvLrr78adU2E6UjSEHfFw8ODV155hUmTJvHNN9/w\n3Xff0atXL8MNrEmTJqxdu5Y///wTJycn3N3d2bNnD76+vhQWFtKwYUPy8vI4fvy4oT3D2tqa8+fP\n4+LiwvDhw9m+fTuhoaE0a9aM1NRUBg0axNGjR9m8eTNr1qzBxsaGhISEYnXwf/zxB4sWLeLChQsl\nVotcW7ak/TVs2JDq1avzww8/GHoQOTo63vCeq6sr69atw9LSkl9//ZUWLVoYtf/k5GRDT6Rdu3bd\nNPsauF0AAAFQSURBVNbs7GzmzJnDiRMnmDt3LtnZ2cWuibu7u6Gb7LVPJnv27GHq1Kls2rQJ0J4O\n2rRpw4IFCzh8+DB79uwB4LfffmP69Ols2bLFsO3QoUOLLUUbFhZWrAry2v+rY8eO0aVLF0BbQzsy\nMtKwDKqPjw9Tp04F4J133qFp06bFzq2kz7/66ivefvttHB0dcXR0LLHtR5iXrNwnys0333yDu7s7\nzs7O/PTTT1LdcJ3rb8Z369NPP2XUqFGGNqOy8vnnn1fILsrCPORJQ5QbV1dXsrKy+OOPP5g0aZK5\nw6lwynrk9ujRo1m7dm2Z7vOff/6RxmhRjDxpCFGF7N69m6ZNmxoGT96tNWvW0Ldv3wo7tkWYniQN\nIYQQRpPqKSGEEEaTpCGEEMJokjSEEEIYTZKGEEIIo0nSEEIIYTRJGkIIIYwmSUMIIYTRJGkIIYQw\n2v8BjZ9Dogvx6bMAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0xb351c18>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "(ii)...The Values of G as a functio of P2a:\n",
+ "P2a(MN/m^2)\tG(kg/s)\n",
+ "<0.265 \t\t0.21\n",
+ "3 \t\t0.2059\n",
+ "3.5 \t\t0.1942\n",
+ "4 \t\t0.1707\n",
+ "4.5 \t\t0.1288\n",
+ "4.9 \t\t0.0609\n",
+ "4.95 \t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9euVcHBwUoppWbPnq2efPJJdevWLVVYWKj279+vMjMzi43J29tbbd68\nucjrXl5eavbs2UoppYYPH6769eunsrOzVWJiomrUqJH+8x4xYoT6+OOPlVJKjR07Vvn5+amvvvpK\nX+/2ZzNt2jRVvXp1tX79elVYWKimTp2q2rRpo5TSfS88PT31343z58/rz2NMTIzBOVZKqY4dO6oG\nDRqoo0ePKq1WqzIyMpSHh4dauHCh0mq16sCBA6pevXrq6NGjSiml4uLi1OHDh5VSSiUkJCgXFxe1\natUqg3M9YcIElZubqzZu3KiqVaum+vXrp9LT01VqaqpydnZWv//+e7Hn7+7hs5ycHPXqq6+qBg0a\nKKWUGjlypHJwcFA7duxQSil18+ZN1bJlS/Xee++p/Px8dfbsWeXj46M2bNiglFKqTZs2avHixUop\npW7cuKF279790M/z3s/vQd+jW7duqVWrVik/Pz91/PhxpdVq1T/+8Q8VERFR7LGVB0kaJdCgQQNV\ns2ZNZW9vrzQajerXr98Dx/FDQkLU6tWrlVJF5zQKCwtVjRo1DH5h7dixQzVs2LDYfXXu3Fn/D1sp\npU6cOKGsra317T/ol9+iRYtU27ZtDV7z8PAoNmls3rxZNWrUSO3atcvg2LRarbK1tVUJCQlF9n/7\ni56amqp/LTw8XC1durTYeD755BPVv39//bZGo1FbtmzRb//lL39Rf/vb3/Tbp0+f1h9feZ634jg6\nOurPwd2/fG6fg3Pnzt237unTp5W9vb26deuWUkqpZ599Vr333ntKKaXmz5+vIiIiij2/97pf0mjT\npo2aPn26KigoUNWqVVPHjh3TvzdnzhwVFRWllNIl0r59+yqllAoKClLz5s1T0dHRSindd/zAgQP6\n4+vatat+H0eOHFG2trZKKaVOnTqlnJ2d1aZNm1ReXp5BHMXNaURFRalp06bpt5cuXaoiIyMNyowb\nN87gj7C7vfjii+qll15SSt051xcuXNC/X7duXbV8+XL99tNPP23wh8m98VWrVk3Vrl1bOTs7qyee\neELt379fKaVLGiNHjtSX3bVrl/Ly8jKoP336dPWXv/xFKaVUhw4d1LRp01R6erp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YgfYuHGj/rW6\ndevq64Ju2Kdly5bs3r3bqP0DnDt3Th/Tg2L9/vvvmTp1KgUFBWzatImMjIwi5wTA0tLSoO6ePXto\n1aoVTk5OnD17Fnt7+yKf/Z49e/RJx97eniZNmpCenm6wnxMnThAQEKDfNvb8nz9/nmvXrtGiRQtS\nU1NJS0vT7+N+7917vJs3b9bXKY85FSFJQxRj586dzJo1i6tXrzJv3jy++OIL1q1bx5w5cwAYO3Ys\nGzduZNGiRTzzzDP4+/sD0Lx5c3766Sdq167Nli1bWL58Oe3atePIkSP6+Qx7e3suXbqEh4cHzs7O\nVKtWjeXLlzNo0CDc3NxITU0lOzsbOzs7kpKSioydDx48mISEBH755ReWL1/OkCFD2LhxI6tXr8bX\n15cLFy4YtHf48GE6deoE6Cbyd+/eTdOmTfn999+ZO3cu6enpBsMiQJF2725z2bJlODg4FIkdwMXF\npchrnp6erFixAisrKzZv3kzjxo2N2n9qaipdunQBeGCss2fP5q233sLFxQVXV1fq16/PiBEjDM7J\n7Utlb/dMALZt28bUqVNZu3YtoOsdhISE8OWXX3Lw4EG2bdvGli1biImJYd26dfp6w4YNM5iMB92l\ntlFRUfptY84/6HqhU6dOBeDtt9+mQYMG+n3c7727j/f2MYMumdxOesK05Ml9QlRQ9/4yflQfffQR\nY1c+DwgAAAC3SURBVMaMwdHRscz2CfDFF18wadKkMt1nSR06dIjjx48zePBgs8ZRFUhPQ4gKqqxX\nbo8dO5YffvihTPd54cIFg8loc9m8eTMDBw40dxhVgvQ0hKhCtm7dSoMGDfRzUo9q2bJl9OnTx6xr\nW44cOUJBQQHNmzc3WwxViSQNIYQQRpPhKSGEEEaTpCGEEMJokjSEEEIYTZKGEEIIo0nSEEIIYTRJ\nGkIIIYwmSUMIIYTRJGkIIYQw2v8DMw/BuCR3ro4AAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0xaa87c50>"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.2,Page no:167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "l=30 #Length of the tube\n",
+ "d=150e-3 #Diameter of the tube\n",
+ "P1=0.4e3 #Initial Pressure\n",
+ "P2=0.13e3 #final Pressure\n",
+ "X=0.003 \n",
+ "Y=0.005 \n",
+ "v1=21.15e1 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import sympy\n",
+ "G_A=sympy.Symbol('G_A') \n",
+ "f=(G_A**2*math.log(P1/P2))+((P2**2-P1**2)/(2*P1*v1))+(4*(Y*l/d)*G_A**2) \n",
+ "A=sympy.solve(f) \n",
+ "\n",
+ "#Result\n",
+ "print\"The approximate flow rate =\",round(A[1],2),\"kg/m**2 s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The approximate flow rate = 0.41 kg/m**2 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 81
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.3,Page no:168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Q=50.0 #volumetric flow rate of methane\n",
+ "P=101.3e3 #Given Pressure\n",
+ "T1=288.0 #Given Temperature\n",
+ "d=0.6 #Diameter of pipeline\n",
+ "l=3e3 #length of the pipe line\n",
+ "R_R=0.0001 #Relative roughness\n",
+ "P2=1.7*10**5 #Pressure at which methane is to be discharged\n",
+ "T2=297.0 #Temperature at which methane leaves the compressor\n",
+ "M=16.0 #molecular mass of methane\n",
+ "R=8314.0 #Gas constant\n",
+ "Meu=1e-5 #Viscosity of methane at 293 K\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "from scipy.optimize import fsolve\n",
+ "T=(T1+T2)/2.0 #Mean temperature\n",
+ "P1_v1=R*T/(M) \n",
+ "#At 288 K and 101.3 kN/m**2\n",
+ "v=P1_v1/P*T1/T \n",
+ "G=Q/v #Mass flow rate of methane\n",
+ "A=math.pi/4*d**2 #cross sectional area of pipeline\n",
+ "G_A=G/A\n",
+ "Re=G_A*d/Meu \n",
+ "#Y=R/(rho*u**2) = 0.0015\n",
+ "Y=0.0015 #(from fig 3.7)\n",
+ "#The upstream pressure is calculated using equation 4.55:\n",
+ "def pressure(P1):\n",
+ " return((G_A**2)*math.log(P1/P2)+(P2**2-P1**2)/(2*P1_v1)+4*Y*(l/d)*G_A**2)\n",
+ "#P1 = 1e5 \n",
+ "z = fsolve(pressure,100000) \n",
+ "\n",
+ "#Result\n",
+ "print\"Pressure to developed at the compressor in order to achieve this flowrate =%.3e\"%z,\"N/m**2\" \n",
+ "print\"NOTE:Approx answer is given in book\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure to developed at the compressor in order to achieve this flowrate =4.042e+05 N/m**2\n",
+ "NOTE:Approx answer is given in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 104
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.4,Page no:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "A1=0.007 #cross sectional area of stack pipe\n",
+ "A2=4000e-6 #flow area of ruptured disc\n",
+ "P1=10e6 #Pressure of the gas in the vessel\n",
+ "Gamma=1.4 \n",
+ "M=40 #mean molecular weight of gas\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "w_c=(2/(Gamma+1))**(Gamma/(Gamma-1)) \n",
+ "w_c=round(w_c,2)\n",
+ "\n",
+ "V1=(22.4/M)*(500.0/273.0)*(101.3e3/P1) #Specific volume of the gas in the reactor\n",
+ "V=V1*(1/w_c)**(1/Gamma) #Specific volume of gas at the throat\n",
+ "u=math.sqrt(Gamma*5.3e6*V) #velocity at the throat\n",
+ "G=u*A2/V #initial rate of discharge\n",
+ "#obtaining the equations as given in book and solving for 'w' we get\n",
+ "w=0.0057 #Pressure ratio\n",
+ "P_u=P1*w \n",
+ "Mach_no=2.23*(w**(-0.29)-1)**0.5 \n",
+ "P_s=56.3*w*(w**(-0.29)-1)*1e6 \n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)Initial rate of discharge of gas =\",round(G,1),\"kg/s\"\n",
+ "print\"(b)The pressure upstream from the shockwave =\",P_u/1000.0,\"kN/m**2\"\n",
+ "print\"The mach number is =\",round(Mach_no,2)\n",
+ "print\"(c)The pressure downstream from the shockwave =\",P_s/1000,\"kN/m**2\"\n",
+ "print\"NOTE:Mismatched answer due to very approximate value of v1 taken in book\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Initial rate of discharge of gas = 85.2 kg/s\n",
+ "(b)The pressure upstream from the shockwave = 57.0 kN/m**2\n",
+ "The mach number is = 4.16\n",
+ "(c)The pressure downstream from the shockwave = 1115.17300403 kN/m**2\n",
+ "NOTE:Mismatched answer due to very approximate value of v1 taken in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 133
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_5.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_5.ipynb new file mode 100755 index 00000000..a3e9b8cf --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_5.ipynb @@ -0,0 +1,195 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5:Flow of Multiphase Mixtures"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.1,Page no:190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "id=75e-3 # internal diameter of pipe\n",
+ "f_r_s=0.05 # Flow rate of steam in (kg/s)\n",
+ "f_r_w=1.5 # Flow rate of water in (kg/s)\n",
+ "T=330 # Mean Temperature\n",
+ "P=120 # Mean Pressure drop\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "area=math.pi*id**2/4.0 # Cross-sectional area for flow\n",
+ "f_r_w_m3s=f_r_w/1000.0 # Flow of water\n",
+ "wtr_vel=f_r_w_m3s/area #Water velocity\n",
+ "rho_steam=18*273*120.0/(22.4*330.0*101.3) # density of steam at 330 K and 120 kN/m**2\n",
+ "f_r_s_m3s=f_r_s/rho_steam #Flow of Steam\n",
+ "steam_vel=f_r_s_m3s/area #Steam velocity\n",
+ "meu_steam=0.0113e-3 \n",
+ "meu_water=0.52e-3 \n",
+ "Rel=id*wtr_vel*1000/meu_water \n",
+ "Reg=id*steam_vel*rho_steam/meu_steam \n",
+ "DPl=4*0.0025*(1000*wtr_vel**2)/id \n",
+ "DPg=4*0.0022*(rho_steam*steam_vel**2)/id \n",
+ "X=(DPl/DPg)**0.5 \n",
+ "phi_l=4.35 \n",
+ "phi_g=3.95 \n",
+ "DP_tpf=phi_g**2*DPg/1000 \n",
+ "\n",
+ "#Result\n",
+ "print\"Pressure drop per unit length of pipe =\",round(DP_tpf,3),\"kN/m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure drop per unit length of pipe = 0.298 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.2,Page no:212"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "M_p_d=0.2e-3 # Mean particle diameter\n",
+ "f_r_w=0.5 #Flow rate of water\n",
+ "id=25e-3 #Diameter of pipe\n",
+ "l=100 #length of pipe\n",
+ "t_vel=0.0239 #Terminal velocity of falling sand particles\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import sympy\n",
+ "Um=f_r_w/(1000*math.pi*id**2/4) \n",
+ "Re=id*Um*1000/0.001 \n",
+ "#Assuming e/d = 0.008, then, from Figure 3.7:\n",
+ "phi=0.0046 \n",
+ "f=0.0092 \n",
+ "#From, equation 3.20, the head loss is:\n",
+ "hf=4*phi*l*Um**2/(9.81*id) \n",
+ "iw=hf/l \n",
+ "i=300*1000/(1000*9.81*100) \n",
+ "# Substituting in equation 5.20:\n",
+ "C=(iw/(i-iw)*(1100*9.81*id*(2.6-1)*t_vel)/(Um**2*Um))**-1 \n",
+ "#If G kg/s is the mass flow of sand, then:\n",
+ "G=sympy.Symbol('G') \n",
+ "p=sympy.solve(2600**-1*G-0.30*(2600**-1*G+.0005))\n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Mass flow of sand =\",round(p[0],2),\"kg/s=\",round(p[0]*3600.0/1000.0),\"tonne/h\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Mass flow of sand = 0.56 kg/s= 2.0 tonne/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.3,Page no:225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "p_s=1.25e-3 # Particle size of sand\n",
+ "rho_sand=2600.0 #Density of sand\n",
+ "flow_sand=1.0 #flow rate of sand in air\n",
+ "l=200.0 #length of pipe\n",
+ "d=100e-3 # taking nearest standard size of pipe\n",
+ "Uo=4.7 \n",
+ "Ug=30.0\n",
+ "Meu_air=1.7e-5 # viscosity of air\n",
+ "rho_air=1 # Density of air\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "flow_air=flow_sand/5.0 \n",
+ "vol_flow_air=1*flow_air \n",
+ "area=flow_air/Ug\n",
+ "pipe_dia=math.sqrt(4*area/math.pi)\n",
+ "Ug=flow_air/(math.pi*(0.1**2)/4.0)\n",
+ "Ug=round(Ug,1)\n",
+ "Us=Ug-(Uo/(0.468+(7.25*(Uo/rho_sand)**0.5))) \n",
+ "\n",
+ "Re=(d*Ug*rho_air/Meu_air) \n",
+ "phi=0.004 \n",
+ "DP_air=(4*phi*l/d)*rho_air*Ug**2/2.0 \n",
+ "DP_x=2805.0*DP_air/(Uo*Us**2) \n",
+ "DP=DP_air+DP_x \n",
+ "\n",
+ "#Result\n",
+ "print\"Volumetric flow rate of air =\",vol_flow_air,\"m**3/s\" \n",
+ "print\"The cross-sectional area of a 100 mm ID. pipe =\",round(pipe_dia*1000),\"mm\\nThe nearest stand size is 100 mm\"\n",
+ "print\"Pressure drop due to air =\",round(DP_air/1000,1),\"kN/m**2\"\n",
+ "print\"Pressure drop due to sand particles =\",round(DP_x/1000,1),\"kN/m**2\"\n",
+ "print\"The total pressure drop =\",round(DP/1000,1),\"kN/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volumetric flow rate of air = 0.2 m**3/s\n",
+ "The cross-sectional area of a 100 mm ID. pipe = 92.0 mm\n",
+ "The nearest stand size is 100 mm\n",
+ "Pressure drop due to air = 10.4 kN/m**2\n",
+ "Pressure drop due to sand particles = 16.4 kN/m**2\n",
+ "The total pressure drop = 26.8 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_6.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_6.ipynb new file mode 100755 index 00000000..cefa9c67 --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_6.ipynb @@ -0,0 +1,275 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6:Flow and Pressure Measurement"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:6.1,Page no:252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d_o=25e-3 #Diameter of orifice\n",
+ "d_p=75e-3 #Diameter of pipe\n",
+ "flow_o=300e-6 #Flow rate through pipe\n",
+ "Meu_watr=1e-3 #Viscosity of water\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import sympy\n",
+ "area_o=math.pi/4*d_o**2 #Area of orifice\n",
+ "vel_o=flow_o/area_o #Velocity of water through the orifice\n",
+ "Re_o=d_o*vel_o*1000/Meu_watr #Re at the orifice\n",
+ "Cd=0.61 \n",
+ "G=flow_o*1e3 #mass flow rate water\n",
+ "ho=sympy.Symbol('ho') \n",
+ "p=sympy.solve(G**2-((Cd*area_o*1000)**2*2*9.81*ho))\n",
+ "\n",
+ "#Result\n",
+ "print\"Difference in level on a water manometer =\",round(p[0]*1000),\"mm of water\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Difference in level on a water manometer = 51.0 mm of water\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:6.2,Page no:253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "rho_sul=1300.0 #Density of sulphuric acid\n",
+ "id=50e-3 #Internal diameter of pipe\n",
+ "d_o=10e-3 #Diameter of orifice\n",
+ "h=.1 #Differential pressure shown on a mercury manometer\n",
+ "Cd=0.61 #Coeffecient of discharge\n",
+ "rho_merc=13550.0 #Density of mercury\n",
+ "rho_watr=1000.0 #Density of water\n",
+ "\n",
+ "#Calculation\n",
+ "area_o=math.pi/4*d_o**2 #area of orifice\n",
+ "h_sul=h*(rho_merc-rho_sul)/rho_sul \n",
+ "G_sul=Cd*area_o*rho_sul*(2*9.81*h_sul)**0.5 \n",
+ "DP=rho_sul*9.81*h_sul \n",
+ "\n",
+ "#Result\n",
+ "print\"(a).The mass flow rate of acid =\",round(G_sul,3),\"kg/s\"\n",
+ "print\"(b).The drop in pressure =\",round(DP/1000),\"kN/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).The mass flow rate of acid = 0.268 kg/s\n",
+ "(b).The drop in pressure = 12.0 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:6.3,Page no:256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=150e-3 #Diameter of pipe\n",
+ "d_t=50e-3 #Throat diameter\n",
+ "hv=121e-3 #Pressure drop over the converging section\n",
+ "G=2.91 #Mass Flow rate of water\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A1=math.pi*d**2/4.0 \n",
+ "A2=math.pi*d_t**2/4.0 \n",
+ "Cd=G*math.sqrt(A1**2-A2**2)/(1000*A1*A2*math.sqrt(2*9.8*hv)) \n",
+ "\n",
+ "#Result\n",
+ "print\"Coefficient for the converging cone of the meter at given flowrate =\",round(Cd,2),\"(Approx)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Coefficient for the converging cone of the meter at given flowrate = 0.96 (Approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:6.4,Page no:261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "l=0.3 #length of tube\n",
+ "id_t=25e-3 #Top internal diameter of tube\n",
+ "id_b=20e-3 #Bottom internal diameter of tube\n",
+ "d_f=20e-3 #Diameter of float\n",
+ "v_f=6e-6 #Volume of float\n",
+ "Cd=0.7 #Coefficient of discharge\n",
+ "rho=1000 #Density of water\n",
+ "rho_f=4800 #Density of float\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "area_t=math.pi/4.0*id_t**2 #Cross-sectional area at top of tube\n",
+ "area_b=math.pi/4.0*id_b**2 #Cross-sectional area at bottom of tube\n",
+ "A_f=math.pi/4.0*d_f**2 #Area of float\n",
+ "A1=math.pi/4.0*((id_t+id_b)/2)**2 \n",
+ "A2=A1-A_f \n",
+ "G=Cd*A2*math.sqrt((2*9.81*v_f*(rho_f-rho)*rho)/(A_f*(1-(A2/A1)**2)))\n",
+ "\n",
+ "#Result\n",
+ "print\"The flow rate of water =\",round(G,3),\"kg/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flow rate of water = 0.071 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:6.5,Page no:262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "L=0.5 # Length of the weir\n",
+ "D=100e-3 #Height of water over the weir\n",
+ "n=0 \n",
+ "\n",
+ "#Calculation\n",
+ "#Using Francis formula:\n",
+ "Q=1.84*(L-(0.1*n*D))*D**1.5 \n",
+ "\n",
+ "#Result\n",
+ "print\"Volumetric flowrate of water =\",round(Q,2),\"m**3/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volumetric flowrate of water = 0.03 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:6.6,Page no:263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "G=15.0 #Mass flow rate of organic liquid\n",
+ "L_ow=2.0 #Length of the weir\n",
+ "rho_l=650.0 \n",
+ "\n",
+ "#Calculation\n",
+ "Q=G/rho_l\n",
+ "Q=round(Q,3)\n",
+ "#Use is made of the Francis formula (equation 6.43),\n",
+ "h_ow=(2.0/3.0)*(Q/L_ow)**(2.0/3.0) \n",
+ "\n",
+ "#Result\n",
+ "print\"Height of liquid flowing over the weir =%d\"%(h_ow*1000),\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height of liquid flowing over the weir =33 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_7.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_7.ipynb new file mode 100755 index 00000000..9ef97b4d --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_7.ipynb @@ -0,0 +1,130 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7:Liquid Mixing"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:7.2,Page no:286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "rho_sol=1650 #Density of the solution\n",
+ "Meu_sol=50e-3 #Viscosity of the solution\n",
+ "Dt=2.28 #Density of the tank\n",
+ "D=0.5 #Diameter of the propeller mixer\n",
+ "H=2.28 #Liquid depth\n",
+ "Za=0.5 #Height of the propeller\n",
+ "N=2 #Rotational speed\n",
+ "\n",
+ "#Calculation\n",
+ "Re=D**2*N*rho_sol/(Meu_sol) \n",
+ "Fr=N**2*D/9.81 \n",
+ "#From figure 7.6\n",
+ "Np=0.5 \n",
+ "P=Np*rho_sol*N**3*D**5 \n",
+ "\n",
+ "#Result\n",
+ "print\"Power provided by propeller to the liquid =\",round(P),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power provided by propeller to the liquid = 206.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:7.3,Page no:286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=0.6 #tank diameter\n",
+ "N1=4.0 #Rotor dpeed in Hertz\n",
+ "P1=0.15 #Power consumption\n",
+ "Re1=160000 #Reynold's number\n",
+ "D1=d/3.0 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D2=6*D1 \n",
+ "N2=math.pi*N1*D1/(math.pi*D2) \n",
+ "P2=7.32*N2**3*D2**5 \n",
+ "#For thermal similarity, that is the same temperature in both systems:\n",
+ "Re2=Re1*(N2*D2**2/(N1*D1**2)) \n",
+ "V2=(math.pi/4.0)*(6*d)**3 \n",
+ "P=V2*0.884 \n",
+ "N=(P/(7.32*(6*0.6/3.0)**5))**(1.0/3.0) \n",
+ "Re=Re1*(N*D2**2/(N1*D1**2)) \n",
+ "\n",
+ "#Result\n",
+ "print\"The new rotor speed =\",round(N2,2),\"Hz\"\n",
+ "print\"The new power required =\",round(P2,2),\"kW\" \n",
+ "print\"The new reynolds number =\",Re2\n",
+ "print\"\\n\\n For Constant power input per unit volume:\"\n",
+ "print\"The new power required =\",round(P,1),\"kW\" \n",
+ "print\"The new rotor speed =\",round(N,2),\"Hz\" \n",
+ "print\"The new reynolds number =%d\"%Re\n",
+ "\n",
+ "print\"NOTE:Wrong values of Reynolds numbers in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The new rotor speed = 0.67 Hz\n",
+ "The new power required = 5.4 kW\n",
+ "The new reynolds number = 960000.0\n",
+ "\n",
+ "\n",
+ " For Constant power input per unit volume:\n",
+ "The new power required = 32.4 kW\n",
+ "The new rotor speed = 1.21 Hz\n",
+ "The new reynolds number =1744643\n",
+ "NOTE:Wrong values of Reynolds numbers in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_8.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_8.ipynb new file mode 100755 index 00000000..674da5bb --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_8.ipynb @@ -0,0 +1,514 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8:Pumping of Fluids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:8.1,Page no:320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "dia_cy=110e-3 #Cylinder diameter\n",
+ "stro=230e-3 #stroke\n",
+ "l_su=6 #Suction line length\n",
+ "d_su=50e-3 #Suction line diameter\n",
+ "lvl_wtr=3 #level of the water in the suction tank\n",
+ "atm_P=10.36 \n",
+ "head=1.2 #m water\n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "import math\n",
+ "N=sympy.Symbol('N') #Maximum speed \n",
+ "ang_vel=2*math.pi*N #Angular velocity in rad/s\n",
+ "#at\n",
+ "t=0 #Initially\n",
+ "max_acc=0.5*stro*(2*math.pi*N)**2*math.cos(2*math.pi*N*t) #Maximum acceleration\n",
+ "max_2=(dia_cy/d_su)**2*max_acc #Maximum acceleration of liquid in suction pipe\n",
+ "acc_F=max_2*(math.pi/4.0)*d_su**2*l_su*1000 #Accelerating force on the liquid[ N]\n",
+ "P=max_2*l_su*1000 #Pressure drop in suction line N/m**2\n",
+ "P=P/(1000*9.81) #in m water\n",
+ "n=sympy.solve(head-atm_P+lvl_wtr+P) #speed\n",
+ "\n",
+ "#Result\n",
+ "print\"Maximum speed at which the pump can run =\",round(n[1],3),\"Hz\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum speed at which the pump can run = 0.677 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:8.2,Page no:343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "rho_l=800 #Density of liquid\n",
+ "Meu_l=0.5e-3 #Viscosity of liquid\n",
+ "Q=0.0004 #Volumetric flow rate\n",
+ "liq_depth=0.07 \n",
+ "d=25e-3 #Diameter of pipe used\n",
+ "p_v_r=1e3 #Pressure of vapor in reboiler\n",
+ "Z=2 #Net Positive Suction Head\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=math.pi/4*d**2 #Cross sectional area of pipe\n",
+ "u=Q/A #Velocity in pipe\n",
+ "Re=d*u*rho_l/Meu_l #Reynolds no.\n",
+ "phi=0.0028 \n",
+ "hf_l=(4*phi*u**2)/(d*9.81) \n",
+ "l=10 \n",
+ "hf=hf_l*l \n",
+ "ho=Z+hf \n",
+ "\n",
+ "#Result\n",
+ "print\"The minimum height required =\",round(ho,1),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum height required = 2.3 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:8.3,Page no:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Q=0.1 #Flow rate of air suppplied by compressor\n",
+ "T=273 #Temperature\n",
+ "P=101.3e3 #Pressure\n",
+ "P2=380e3 #Air compressed to a pressure\n",
+ "T2=289 #Suction Temperature\n",
+ "l=0.25 #Length of the stroke\n",
+ "u=4 #Speed\n",
+ "c=4/100.0 #Cylinder clearance\n",
+ "Gamma=1.4 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=Q*T2/(u*T) #Volume per stroke\n",
+ "R=P2/P #Compression ratio\n",
+ "Vs=V/(1+c-(c*(R)**(1/Gamma))) \n",
+ "A=Vs/l #Cross sectional Area of cylinder\n",
+ "d=(A/math.pi*4)**0.5 #Diameter of cylinder\n",
+ "W=P*V*(Gamma/(Gamma-1))*((R)**((Gamma-1)/Gamma)-1) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Diameter of cylinder =\",round(d,2),\"m\"\n",
+ "print\"\\n Theoretical power requirements =\",round(W*4/1e3,1),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Diameter of cylinder = 0.38 m\n",
+ "\n",
+ " Theoretical power requirements = 17.2 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:8.4,Page no:357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "T=290 #Temperature at which compression takes place\n",
+ "P1=101.3e3 #Initial pressure\n",
+ "P2=2065e3 #Final pressure\n",
+ "eta=0.85 #Mechanical efficiecy\n",
+ "c1=4/100.0 #Clearance in cylinder 1\n",
+ "c2=5/100.0 #Clearance in cylinder 1\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "R=P2/P1 #Overall compression ratio\n",
+ "V_spe=22.4/28.8*T/273.0 #Specific volume of air at 290 K\n",
+ "W=P1*V_spe*2*(1.25/(1.25-1))*(R**.1-1) \n",
+ "W_act=W/0.85 \n",
+ "W_it=P1*V_spe*math.log(R) \n",
+ "eta_it=100*W_it/W_act \n",
+ "Gamma=1.4 \n",
+ "W_ie=P1*V_spe*(Gamma/(Gamma-1))*((R)**((Gamma-1)/Gamma)-1) \n",
+ "eta_ie=100*W_ie/W_act \n",
+ "Vs1=V_spe/(1+c1-(c1*(R)**(1/(2*2.5)))) \n",
+ "Vs2=V_spe*(1/R)**0.5/(1+c2-(c2*(R)**(1/(2*2.5)))) \n",
+ "ratio=Vs1/Vs2 \n",
+ "\n",
+ "#Result\n",
+ "print\"(a).Energy supplied to the compressor, that is the work of compression =\",round(W_act*1e-3,1),\"kJ/kg\"\n",
+ "print\"(b).Isothermal efficiency =\",round(eta_it),\"%\"\n",
+ "print\"(c).Isentropic efficiency =\",round(eta_ie),\"%\"\n",
+ "print\"(d).The ratio of the swept volumes in the two cylinders =\",round(ratio,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Energy supplied to the compressor, that is the work of compression = 346.5 kJ/kg\n",
+ "(b).Isothermal efficiency = 73.0 %\n",
+ "(c).Isentropic efficiency = 116.0 %\n",
+ "(d).The ratio of the swept volumes in the two cylinders = 4.48\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:8.5,Page no:360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Q_l=7.5e-4 \n",
+ "rho_l=1200.0 \n",
+ "h=20.0 \n",
+ "P=450e3 \n",
+ "eta=30.0/100.0 \n",
+ "P_atm=101.3e3 \n",
+ "Gamma=1.4 \n",
+ "G=Q_l*rho_l #Mass flow of liquid\n",
+ "W=G*9.81*h \n",
+ "W_act=W/eta \n",
+ "M=28.9 \n",
+ "va=22.4/M \n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "import math\n",
+ "x=sympy.Symbol('x') \n",
+ "Ga=sympy.solve(P_atm*va*x*math.log(P/P_atm)-W_act) \n",
+ "Q=Ga[0]*va \n",
+ "Power=(P_atm*Q)*(Gamma/(Gamma-1))*((P/P_atm)**((Gamma-1)/Gamma)-1) \n",
+ "Power_reqd=Power/1000 \n",
+ "\n",
+ "#Result\n",
+ "print\"Power requirement of the pump =\",round(Power_reqd,3),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power requirement of the pump = 0.734 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:8.6,Page no:360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "P1=101.3e3 \n",
+ "Q_watr=0.01 \n",
+ "depth=100 \n",
+ "d=100e-3 \n",
+ "depth_watr=40 \n",
+ "Q_air=0.1 \n",
+ "P2=800e3 \n",
+ "Gamma=1.4 \n",
+ "#V1=Q_air \n",
+ "\n",
+ "#Calculation\n",
+ "G_watr=Q_watr*1000 #Mass flow of water\n",
+ "W=G_watr*depth_watr*9.81 \n",
+ "E=P1*Q_air*(1.4/0.4)*((P2/P1)**(0.4/1.4)-1) # equation 8.37\n",
+ "effi=W/E*100 \n",
+ "P=345e3 \n",
+ "v1=8314*273/(29*P) \n",
+ "v2=8314*273/(29*P1) \n",
+ "G_air=Q_air/v2 #mass flowrate of the air is:\n",
+ "Q_mean=G_air*v1 #Mean volumetric flowrate of air\n",
+ "Q_tot=Q_watr+Q_mean #Total volumetric flowrate\n",
+ "A=math.pi/4*d**2 #Area of pipe\n",
+ "v_mean=Q_tot/A \n",
+ "\n",
+ "#Result\n",
+ "print\"Efficiency =\",round(effi,1),\"%\"\n",
+ "print\"Mean velocity of the mixture =\",round(v_mean,2),\"m/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency = 13.8 %\n",
+ "Mean velocity of the mixture = 5.01 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:8.7,Page no:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=40e-3 #Internal Diameter of the pipe\n",
+ "l_p=150.0 #Lendth of pipe\n",
+ "Q_watr=600e-6 #Flow of water\n",
+ "h1=10.0 #Vertical Height\n",
+ "h2=2.0 #head lost across heat exchanger\n",
+ "eta=60.0/100.0 #Efficiency of pump\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=math.pi/4*d**2 #Area for flow\n",
+ "u=Q_watr/A #Velocity\n",
+ "#At 320 K,\n",
+ "Meu=0.65e-3 \n",
+ "rho=1000 \n",
+ "Re=d*u*rho/Meu \n",
+ "phi=0.004 #for a relative roughness of 0.005\n",
+ "l=l_p+h1+(260*d) \n",
+ "hf=4*phi*l*u**2/(d*9.81) \n",
+ "h_tot=hf+h1+h2 #Total head to be developed\n",
+ "G=Q_watr*rho # Mass flow of water\n",
+ "P_r=G*h_tot*9.81 #Power Required\n",
+ "P_s=P_r/eta #Power Supplied\n",
+ "\n",
+ "#Result\n",
+ "print\"Power Required =\",round(P_s,2),\"W\"\n",
+ "print\"NOTE:Very Approximate answer in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power Required = 133.26 W\n",
+ "NOTE:Very Approximate answer in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:8.8,Page no:370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "%pylab inline\n",
+ "eta=0.50 \n",
+ "Q=[0.0028,0.0039,0.0050,0.0056,0.0059]\n",
+ "h=[23.2,21.3,18.9,15.2,11.0]\n",
+ "Q1=linspace(0.0015,0.0060,42)\n",
+ "h1=10+2.205e5*Q1**2 \n",
+ "plot(Q,h,label=\"Pump Characteristics\") \n",
+ "plot(Q1,h1,label=\"h=10+2.205e5*Q**2\") \n",
+ "plt.ylim(0,30)\n",
+ "plt.xlim(0.0005,0.006)\n",
+ "title(\"Data for Example 8.8\")\n",
+ "plt.xlabel(\"$Discharge (Q m**3/s)$\")\n",
+ "plt.ylabel(\"$Head (m water)$\") \n",
+ "legend() \n",
+ "#showing the intersection point\n",
+ "x1=[0,0.0054] \n",
+ "y1=[16.43,16.43] \n",
+ "x2=[0.0054,0.0054] \n",
+ "y2=[0,16.43] \n",
+ "#plot(x1,y1,x2,y2) \n",
+ "Q_r=0.0054 \n",
+ "h_r=10+2.205e5*Q_r**2 \n",
+ "P=Q_r*1000*h_r*9.81/eta \n",
+ "\n",
+ "#Result\n",
+ "show()\n",
+ "print\"\\n The discharge at the point of intersection between\\n the purnp characteristic equation =\",Q_r,\"m**3/s\"\n",
+ "print\"\\n Power required=\",round(P*1e-3,2),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAEfCAYAAAC5/EqkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdYk+f6B/Bv2MreIAGZCsh0oKBg0OIWt1YLiNqhp/1Z\na08dtSp2qLXanlbb6nFirdbRKhatVSlYHAxFREFRkT0FGUFGGM/vjxxSoyBEyQDvz3XlguRd9xNj\nvjzv8w4OY4yBEEIIkYCSvAsghBDS9VB4EEIIkRiFByGEEIlReBBCCJEYhQchhBCJUXgQQgiRGIUH\n6XYuXboEBwcHaGtr4+TJk/IuRyaysrKgpKSE5uZmeZdCXhE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pRKpUIBoNcXFywtLQEgGmaVKtVTk5O8Hq9pNNp9vf36fV6uN1uyuUyo6OjzM7OcnZ2xvz8\nPJZlUSqV6HQ6RCIRDMPoXz8cDpPP54nFYu+6i8/mpqam6HQ63NzcUK/X2dvbwzAMjo+PWVlZ6YdD\nq9X6sH9vZzCLi4vDeuTyy+lPgiID1Go1TNOk2Wyys7NDKpUauC6ZTLKxsYHH43k33uv1WF9fZ21t\njYmJCUKh0DDKHujg4ICtra0v15TLZSqVCqurq0OqSn479akiA+zu7pLNZkmlUnzVnG9ubpLJZD6M\nu1wubm9vOTw8/NHgqFarWJb17brz83Oi0egQKpL/hToPkb90eXmJz+frn7n8S46OjlheXmZsbOzT\nNXd3d7y8vDAzMzPEyuS3U3iIiIhj+mwlIiKOKTxERMQxhYeIiDim8BAREccUHiIi4pjCQ0REHFN4\niIiIYwoPERFx7BUCFALyNJcm+AAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7ec6ac8>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The discharge at the point of intersection between\n",
+ " the purnp characteristic equation = 0.0054 m**3/s\n",
+ "\n",
+ " Power required= 1.74 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:8.10,Page no:375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Meu_H2=0.009e-3 #Viscosity of hydrogen\n",
+ "P2=2e6 #Downstream Pressure\n",
+ "P1=2.5e6 #Upstream pressure\n",
+ "P_m=(P1+P2)/2 #Mean Pressure\n",
+ "T=295.0 #Temperature of the gas\n",
+ "l=500.0 #Length of the pipe used\n",
+ "d=50e-3 #diameter of pipe used\n",
+ "\n",
+ "#Calculation\n",
+ "rho_H2=2*P_m*273.0/(22.4*101.3e3*T) #Density of hydrogen at the mean pressure\n",
+ "A=math.pi*d**2/4.0 #Area of the pipe\n",
+ "eta=0.60 #Efficiency of the pump\n",
+ "v_m=1/rho_H2 \n",
+ "phi=0.0024 \n",
+ "x=sympy.Symbol('x') \n",
+ "G=sympy.solve((x/A)**2*math.log(P1/P2)+(P2-P1)*rho_H2+4*phi*l/d*(x/A)**2) \n",
+ "P=round(G[1],1)*P_m*v_m*math.log(P1/P2)/eta \n",
+ "\n",
+ "#Result\n",
+ "print\"Mass flow rate =\",round(G[1],1),\"kg/s\"\n",
+ "print\"Power required =\",round(P*1e-3,2),\"kW(approx)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass flow rate = 0.2 kg/s\n",
+ "Power required = 91.19 kW(approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_9.ipynb b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_9.ipynb new file mode 100755 index 00000000..622118d5 --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/Chapter_9.ipynb @@ -0,0 +1,1874 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9:Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.1,Page no:386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "M_dot1=20 #rate of mass to be cooled\n",
+ "M_dot2=25 #rate of cooling water\n",
+ "Cp=4.18e3 #Heat capacity\n",
+ "T1=360 #Initial temp.\n",
+ "T2=340 #Final temp.\n",
+ "theta_1=300 #Temperature of cooing water entering\n",
+ "U=2e3 #Overall heat transfer coefficient\n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "import math\n",
+ "Q=M_dot1*Cp*(T1-T2) #Heat load\n",
+ "x=sympy.Symbol('x') \n",
+ "theta_2=sympy.solve(Q-(M_dot2*Cp*(x-300)))\n",
+ "theta_m1=((T1-theta_2[0])-(T2-theta_1))/(math.log((T1-theta_2[0])/(T2-theta_1))) \n",
+ "A1=Q/(U*theta_m1)\n",
+ "theta_m2=((T1-theta_1)-(T2-theta_2[0]))/(math.log((T1-theta_1)/(T2-theta_2[0]))) \n",
+ "A2=Q/(U*theta_m2)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a).In counter flow,The surface area required\",round(A1,2),\"m**2\"\n",
+ "print\"(b).In cocurrent flow,The surface area required\",round(A2,2),\"m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).In counter flow,The surface area required 19.92 m**2\n",
+ "(b).In cocurrent flow,The surface area required 21.28 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.2,Page no:390"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "dx=0.5 #Thickness of wall\n",
+ "T1=400 #Temperartue of inner surface\n",
+ "T2=300 #Temperature of outer surface\n",
+ "K=0.7 #Thermal conductivity\n",
+ "A=1 #Area of heat transfer\n",
+ "\n",
+ "#Calculation\n",
+ "#From equation 9.12:\n",
+ "Q=K*A*(T1-T2)/dx \n",
+ "\n",
+ "#Result\n",
+ "print\"The heat loss per square metre of surface =\",Q,\"W/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat loss per square metre of surface = 140.0 W/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.3,Page no:391"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "dx1=0.20 #thickness of firebrick\n",
+ "dx2=0.10 #thickness of insulating brick\n",
+ "dx3=0.20 #thickness of building brick\n",
+ "k1=1.4 #Thermal conductivity of firebrick\n",
+ "k2=0.21 #Thermal conductivity of insulating brick\n",
+ "k3=0.7 #Thermal conductivity of building brick\n",
+ "T1=1200 #Temperature at junction 1\n",
+ "T4=330 #Temperature at junction 4\n",
+ "\n",
+ "#Calculation\n",
+ "Q=(T1-T4)/((dx1/k1)+(dx2/k2)+(dx3/k3)) \n",
+ "#The ratio (Temperature drop over firebrick)/(Total temperature drop)\n",
+ "R=(dx1/k1)/((dx1/k1)+(dx2/k2)+(dx3/k3)) \n",
+ "#Temperature drop over firebrick \n",
+ "dT=(T1-T4)*R \n",
+ "T2=(T1-dT) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Heat loss per unit area =%d\"%Q,\"W/m**2\"\n",
+ "print\"\\n Temperature drop over firebrick =%d\"%dT,\"K\"\n",
+ "print\"\\n The temperature at the firebrick-insulating brick interface =\",round(T2),\"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Heat loss per unit area =961 W/m**2\n",
+ "\n",
+ " Temperature drop over firebrick =137 K\n",
+ "\n",
+ " The temperature at the firebrick-insulating brick interface = 1063.0 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.4,Page no:398"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "T=295 #initial temperature of surfaces\n",
+ "T2f=375 #Final temperature of far surface\n",
+ "dT1=900 #Temperature of near face raised\n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "R=(T2f-T)/(2*(dT1-T)) #ratio of theta to twice of theta dash\n",
+ "x=sympy.Symbol('x') \n",
+ "t=sympy.solve((1.30**2*x)-346**2) \n",
+ "\n",
+ "#Result\n",
+ "print\"Time taken to rise from 295 to 375 K =\",round(t[0]/3600,1),\"h\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken to rise from 295 to 375 K = 19.7 h\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.5,Page no:400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "T=295 #initial temperature of surfaces\n",
+ "T2f=375 #Final temperature of far surface\n",
+ "dT1=900 #Temperature of near face raised\n",
+ "DH=4.2e-7 #Thermal diffusivity\n",
+ "#The development of the temperature profile is shown in Figure 9.12\n",
+ "#The problem will be solved by taking relatively large intervals for dx.\n",
+ "#Choosing dx = 50 mm, the construction shown in Figure 9.12\n",
+ "dx=50e-3 \n",
+ "#Because the second face is perfectly insulated, the temperature gradient must\n",
+ "# be zero at this point.\n",
+ "#It is seen that the temperature is\n",
+ "#less than 375 K after time 23dt and greater than 375 K after time 25dt\n",
+ "#Thus:\n",
+ "#t=24*dt\n",
+ "#from equation 9.43\n",
+ "dt=dx**2/(2*DH) \n",
+ "t=24*dt \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The time taken to rise from 295 to 375 K =\",round(t/3600.0,1),\"h\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The time taken to rise from 295 to 375 K = 19.8 h\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.6,Page no:403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=25e-3 #Diameter of copper sphere\n",
+ "l=25e-3 #Side length of a copper cube\n",
+ "h=75 #External heat transfer coefficient\n",
+ "rho_cu=8950 #Density of copper at mean temperature\n",
+ "Cp=0.38e3 #Heat capacity of copper at mean temperature\n",
+ "k=385 # Thermal conductivity of copper at mean temperature\n",
+ "Tf=923 #Temperature of the furnace\n",
+ "Ta=368 #Temperature at which they are annealed\n",
+ "t=5*60 # time taken\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import sympy\n",
+ "V_Ae_S=(d/6.0) #V/Ae tor the sphere\n",
+ "V_Ae_C=(l/6.0) #V/Ae tor the cube\n",
+ "Bi=h*(V_Ae_S)/k \n",
+ "#The use of a lumped capacity method is therefore justified\n",
+ "tao=rho_cu*Cp*V_Ae_S/h \n",
+ "x=sympy.Symbol('x') \n",
+ "T=sympy.solve(((x-Ta)/(Tf-Ta))-math.exp(-t/tao)) \n",
+ "\n",
+ "#Result\n",
+ "print\"Temperature of the sphere and of the cube at the end of 5 minutes =%d\"%(T[0]-273),\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature of the sphere and of the cube at the end of 5 minutes =208 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.7,Page no:409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "k=2.5 #Thermal conductivity\n",
+ "DH=2e-7 #Thermal diffusivity of the surrounding fluid\n",
+ "h=100 #External heat transfer coefficient\n",
+ "To=293 #Initial Temperature\n",
+ "T_dash=373 #Oven Temperture\n",
+ "Tc=353 #temperature throughout the whole of the sheet reaches a minimum\n",
+ "l=10e-3 #thickness of sheet\n",
+ "L=l/2 \n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "#For the given process, the Biot number\n",
+ "Bi=h*L/k \n",
+ "Bi_1=1/Bi \n",
+ "lim_val=(T_dash-Tc)/(T_dash-To) \n",
+ "#From Figure 9.17, the Fourier number\n",
+ "Fo=7.7 \n",
+ "t=Fo*L**2/DH\n",
+ "\n",
+ "#Result\n",
+ "print\"The minimum time for which the sheet must be heated =%d\"%(t/60.0),\"min\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum time for which the sheet must be heated =16 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.8,Page no:413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "l=5 #Length of the channel of uranium reactor\n",
+ "Q=.25e6 #Heat release from uranium reactor\n",
+ "k=33 #Thermal conductivity of the uranium\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Q_m=Q/l #Heat release rate\n",
+ "#Thus, from equation 9.52:\n",
+ "dT=Q_m/(4*math.pi*k) \n",
+ "\n",
+ "#Result\n",
+ "print\"The temperature difference between the surface and the centre of the uranium element =\",round(dT),\"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature difference between the surface and the centre of the uranium element = 121.0 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.9,Page no:429"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Cp=2380 #specific heat capacity of nitrobenzene\n",
+ "k=0.15 \n",
+ "Meu=0.70e-3 #Viscosity of nitrobenzene\n",
+ "d_i=15e-3 #internal diameter of tube\n",
+ "d_o=19e-3 #external diameter of the tube\n",
+ "d_s=0.44 #shell diameter\n",
+ "b_s=0.150 #baffle spacing\n",
+ "p=0.025 #pitch\n",
+ "c=0.006 #clearance\n",
+ "#(i)Tube side coefficient\n",
+ "h_i=1000 #based on inside area\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "h_io=1000*d_i/d_o #based on outside area\n",
+ "#(ii) Shell side coefficient.\n",
+ "A=d_s*b_s*c/p #Area for flow\n",
+ "G_s_=4/A \n",
+ "#Taking Meu/Meu_s=1 in equation 9.91\n",
+ "d_e=4*((25e-3**2-(math.pi*d_o**2/4))/(math.pi/d_o)) \n",
+ "h_o=0.36*k/d_e*(d_e*G_s_/Meu)**0.55*(Cp*Meu/k)**0.33 \n",
+ "#(iii) Overall coefficient\n",
+ "#The math.logarithmic mean temperature difference is given by:\n",
+ "Tm=(((400.0-345.0)-(315.0-305.0))/math.log((400.0-345.0)/(315.0-305.0))) \n",
+ "#The corrected mean temperature difference is\n",
+ "Tm_c=Tm*0.8 \n",
+ "Q=4*Cp*(400.0-315.0) \n",
+ "#The surface area of each tube\n",
+ "A_t=0.0598 \n",
+ "U_o=Q/(2*166*5*A_t*Tm_c) \n",
+ "#(iv) Scale resistance.\n",
+ "R_d=(1/U_o)-(1.0/750.0)-(1.0/1000.0) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Value of scale resistance that could be allowed =\",round(R_d,5),\"m**2 K/W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Value of scale resistance that could be allowed = 0.00026 m**2 K/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.10,Page no:432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "G=15.0 #Mass flow rate of benzene\n",
+ "d_s=1.0 #Internal diameter of Heat Exchanger\n",
+ "l=5.0 #Length of tubes\n",
+ "od=19e-3 #Outer diameter of tubes\n",
+ "C=6e-3 #Clearance\n",
+ "l_b=0.25 #Baffle spacing\n",
+ "Meu=.5e-3 \n",
+ "Y=25e-3 #dimension of square pitch\n",
+ "N=19.0 #no. of Baffles\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "As=d_s*l_b*C/Y #Cross-flow area\n",
+ "G_dash_s=G/As #Mass flow\n",
+ "d_e=4*(Y**2-(math.pi*od**2.0/4.0))/(math.pi*od) #Equivalent Diameter\n",
+ "Re=G_dash_s*d_e/Meu \n",
+ "#From Figure 9.29:\n",
+ "f_dash=0.280\n",
+ "rho_b=881 #density of benzene\n",
+ "DPf=f_dash*G_dash_s**2*(N+1)*d_s/(2*rho_b*d_e) \n",
+ "\n",
+ "#Result\n",
+ "print\"The pressure drop over the tube bundle =%d\"%DPf,\"N/m**2=\",round(DPf/(rho_b*9.81)),\"m of Benzene\"\n",
+ "print\"NOTE:Approx value of pressure drop is given in book\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop over the tube bundle =8680 N/m**2= 1.0 m of Benzene\n",
+ "NOTE:Approx value of pressure drop is given in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.11,Page no:437"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=0.15 #Diameter of pipe\n",
+ "Ts=400 #Surface temperature\n",
+ "Ta=294 #Air temperture\n",
+ "k=0.0310 #Thermal conductivity ---Table 6, Appendix A1\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "X=36/k**4 \n",
+ "#From Equation 9.102:\n",
+ "GrPr=X*(Ts-Ta)*d**3 \n",
+ "#From Table 9.5:\n",
+ "n=0.25 \n",
+ "C_dd=1.32 \n",
+ "#Thus, in Equation 9.104:\n",
+ "h=C_dd*(Ts-Ta)**n*d**(3*n-1) \n",
+ "\n",
+ "#result\n",
+ "print\"\\n The heat transfer coefficient =\",round(h,2),\"W/m**2 K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The heat transfer coefficient = 6.81 W/m**2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.12,Page no:439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "lamda=1e-6 #Wavelength\n",
+ "E_l_b=1e9 #Emissive power at given lambda\n",
+ "C2=1.439e-2 \n",
+ "C1=3.742e-16 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "T=C2/lamda/math.log(C1/(E_l_b*lamda**5)) \n",
+ "#With an error of +2 per cent, the correct value is given by:\n",
+ "E_l_b_n=(100-2)*E_l_b/100 \n",
+ "#In equation 9.108:1\n",
+ "T_n=C2/lamda/math.log(C1/(E_l_b_n*lamda**5)) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The temperature of surface =%d\"%T,\"K\"\n",
+ "print\"\\n The temperature of surface with +2 per cent error=\",round(T_n),\"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The temperature of surface =1121 K\n",
+ "\n",
+ " The temperature of surface with +2 per cent error= 1120.0 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.13,Page no:441"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=10e-3 #Diameter of carbide elements\n",
+ "l=0.5 #Length of carbide elements\n",
+ "Ts=1750 #Maximun surface temperature of carbide\n",
+ "P=500e3 #Thermal power output required\n",
+ "sigma=5.67e-8 \n",
+ "\n",
+ "#Calculation\n",
+ "Eb=sigma*Ts**4 \n",
+ "A=math.pi*d*l \n",
+ "P1=Eb*A #Power dissipated by one element\n",
+ "n=P/P1 #Number of elements required\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of elements required =%d\"%round(n)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of elements required =60\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.14,Page no:444"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "A=10.0 #Area of the surface\n",
+ "P_r=1000e3 #Power radiated\n",
+ "T1=1500.0 #First Temperature\n",
+ "T2=1600.0 #Second Temperatue\n",
+ "sigma=5.67e-8 \n",
+ "\n",
+ "#Calculation\n",
+ "E=P_r/A #The emissive Power\n",
+ "#From equation 9,118:\n",
+ "e=E/(sigma*T1**4) \n",
+ "E2=e*sigma*T2**4 \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Emissivity when T=1500 K =\",round(e,3)\n",
+ "print\"\\n The Emissive power when T=1600 K =\",round(E2*1e-2),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Emissivity when T=1500 K = 0.348\n",
+ "\n",
+ " The Emissive power when T=1600 K = 1295.0 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.15,Page no:448"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Variable declaration\n",
+ "A1=2.0 #Area of rectangle(Surface 1)\n",
+ "A2=math.pi*1**2.0/4.0 #Area of disc (Surface 2)\n",
+ "T1=1500.0 #Temperature of Surface 1\n",
+ "T2=750.0 #Temperature of Surface 2\n",
+ "F12=0.25 #View factor\n",
+ "sigma=5.67e-8 \n",
+ "\n",
+ "#Calculation\n",
+ "#From equation 9. 1 26:\n",
+ "F21=A1*F12/A2 \n",
+ "Q12=sigma*A1*F12*(T1**4-T2**4) \n",
+ "\n",
+ "#Result\n",
+ "print\"View factor, F12 =\",round(F21,3)\n",
+ "print\"The net radiation transfer =\",round(Q12*1e-3,1),\"kW\"\n",
+ "print\"NOTE:Calculation mistake in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "View factor, F12 = 0.637\n",
+ "The net radiation transfer = 134.6 kW\n",
+ "NOTE:Calculation mistake in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.16,Page no:449"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "X=4.0 #width of horizontal plate and length vertical plate\n",
+ "Y=6.0 #length of horizontal plate\n",
+ "Z=3.0 #height of verical plate\n",
+ "\n",
+ "#Calculation\n",
+ "W=Y/X \n",
+ "H=Z/X \n",
+ "A1=Z*X #Area of plate 1\n",
+ "A2=X*Y #Area of plate 2\n",
+ "F12=0.12 \n",
+ "#From equation 9.126:\n",
+ "F21=A1*F12/A2 \n",
+ "#For the two spheres\n",
+ "r1=1.0 #Diameter of sphere 1\n",
+ "r2=2.0 #Diameter of sphere 2\n",
+ "F12b=1.0 \n",
+ "F21b=(r1/r2)**2 \n",
+ "F22b=1.0-F21b \n",
+ "\n",
+ "#Result\n",
+ "print\"For vertical plate\"\n",
+ "print\"View Factor, F12=\",F12\n",
+ "print\"View Factor, F21=\",F21\n",
+ "print\"\\nFor sphere:\"\n",
+ "print\"View Factor, F21=\",F21b\n",
+ "print\"View Factor, F22=\",F22b"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For vertical plate\n",
+ "View Factor, F12= 0.12\n",
+ "View Factor, F21= 0.06\n",
+ "\n",
+ "For sphere:\n",
+ "View Factor, F21= 0.25\n",
+ "View Factor, F22= 0.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.17,Page no:454"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "ri_u=0.2 # Inner radius of the upper ring\n",
+ "ro_u=0.3 # Outer radius of the upper ring\n",
+ "ri_l=0.3 # Inner radius of the lower ring\n",
+ "ro_l=0.4 # Outer radius of the lower ring\n",
+ "F12_34=0.4 \n",
+ "F12_4=0.22 \n",
+ "F1_34=0.55 \n",
+ "F14=0.30 \n",
+ "\n",
+ "#Calculation\n",
+ "A12_A2=ro_l**2/(ro_l**2-ri_l**2) \n",
+ "A1_A2=ro_u**2/(ro_l**2-ri_l**2) \n",
+ "F23=((A12_A2)*(F12_34-F12_4))+((A1_A2)*(F1_34-F14)) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n F23 =\",round(F23,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " F23 = 0.73\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.18,Page no:455"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=1 #Diameter of plate\n",
+ "r1=0.5 \n",
+ "r4=r1 #Radius of the imaginary disc sealing the hemisphere\n",
+ "L=r1 #The distance between the plate and the bottom of the dome\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A1=math.pi*d**2/4.0 #Area of the plate\n",
+ "A2=2*math.pi*d**2/4.0 #Area of the underside of the Hemisphere\n",
+ "A4=math.pi*r4**2/4.0 #Area of an imaginary disc sealing the hemisphere and parallel \n",
+ " #to the plate\n",
+ "T1=750 #Temperature of the plate\n",
+ "T2=1200 #Temperature of hemispherical cone\n",
+ "T3=290 #Temperature of the surroundings\n",
+ "sigma=5.67e-8 \n",
+ "R1=r1/L \n",
+ "R4=r4/L \n",
+ "S=1+(1+R4**2)/(R1**2) \n",
+ "F14=0.5*(S-(S**2-4*(r4/r1)**2)**0.5) \n",
+ "F12=F14 \n",
+ "F13=1-F12 \n",
+ "Q1=sigma*A1*F12*(T2**4-T1**4)+sigma*A1*F13*(T3**4-T1**4) \n",
+ "\n",
+ "#Result\n",
+ "print\"The net rate of heat transfer by radiation to the plate =\",round(Q1*1e-3,1),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The net rate of heat transfer by radiation to the plate = 21.4 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.19,Page no:457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=2 #Diameter of the cylinder\n",
+ "h=1 #Depth of insulated cylinder\n",
+ "T1=1500 \n",
+ "T2=373 \n",
+ "#From Figure 9.40ii, with i = 1, j = 2\n",
+ "r1=1 \n",
+ "r2=1 \n",
+ "L=1 \n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "A1=math.pi*d**2.0/4.0 #Radiant heater surface\n",
+ "A2=A1 #Under-Surface of the vessel\n",
+ "A_R=math.pi*d*h \n",
+ "#The view factor may also be obtained from Figure 9.39ii as follows:\n",
+ "R1=r1/L \n",
+ "R2=r2/L \n",
+ "S=1+(1+R2**2)/(R1**2) \n",
+ "F12=0.5*(S-(S**2-4*(r2/r1)**2)**0.5) \n",
+ "sigma=5.67e-8 \n",
+ "#Using the summation rule\n",
+ "#F11=0\n",
+ "F1R=1-F12 \n",
+ "F2R=F1R \n",
+ "Q2=(A1*F12+((1/(A1*F1R)+(1/(A2*F2R))))**-1)*sigma*(T1**4-T2**4) \n",
+ "#If the surroundings without insulation are surface 3 at\n",
+ "T3=290 \n",
+ "F23=F2R \n",
+ "#from equation 9.135\n",
+ "Q2_d=sigma*A1*F12*(T1**4-T2**4)+sigma*A2*F23*(T3**4-T2**4) \n",
+ "red=(Q2-Q2_d)/Q2*100 #Percentage Reduction\n",
+ "\n",
+ "#Result\n",
+ "print\"The rate of radiant heat transfer to the vessel =%d\"%(Q2*1e-3),\"kW\"\n",
+ "print\"If the insulation were removed ,The rate of radiant heat transfer to the vessel=\",round(Q2_d*1e-3),\"kW\"\n",
+ "print\"Reduction percentage =\",round(red),\"%\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of radiant heat transfer to the vessel =620 kW\n",
+ "If the insulation were removed ,The rate of radiant heat transfer to the vessel= 342.0 kW\n",
+ "Reduction percentage = 45.0 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 79
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.20,Page no:459"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "e=0.75 #Emissivity of grey surface\n",
+ "r=1-e #reflectivity of surface\n",
+ "Ts=400 #Temperature of surface\n",
+ "T_amb=295 \n",
+ "sigma=5.67e-8 \n",
+ "q1=3e3 #Rate of radiation arriving at grey surface\n",
+ "\n",
+ "#Calculation\n",
+ "#From equation 9.118\n",
+ "Eb=sigma*Ts**4 \n",
+ "#From equation 9.138\n",
+ "qo=e*Eb+r*q1 \n",
+ "#From equation 9.140\n",
+ "Q_A=e/r*(Eb-qo) \n",
+ "q=Q_A \n",
+ "#For convective heat transfer from the surface\n",
+ "qc=-1*q \n",
+ "hc=qc/(Ts-T_amb) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Radiosity =%d\"%round(qo),\"W/m**2\"\n",
+ "print\"\\n The net rate of radiation trasfer = %d\"%q,\"W/m**2\"\n",
+ "print\"\\n Coefficient of heat transfer =\",round(hc,1),\"W/m**2 K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Radiosity =1839 W/m**2\n",
+ "\n",
+ " The net rate of radiation trasfer = -1161 W/m**2\n",
+ "\n",
+ " Coefficient of heat transfer = 11.1 W/m**2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 84
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.21,Page no:464"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "sigma=5.67e-8 \n",
+ "T=[1000,500,300] #tempertaure of surfaces\n",
+ "A=[1.07,1.07,0.628] #Array of area of surfaces\n",
+ "e=[0.75,0.50,1.0] #Array of emissivity of the surfaces\n",
+ "r=[0.250,0.50] # Array of radius of two surfaces\n",
+ "L=0.2 #distance between two discs\n",
+ "\n",
+ "X=[0]*3\n",
+ "Y=[0]*3\n",
+ "R=[0]*2\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "from scipy.optimize import fsolve\n",
+ "for i in range(0,2):\n",
+ " X[i]=A[i]/r[i] \n",
+ " Y[i]=A[i]*e[i]/r[i] \n",
+ " R[i]=r[i]/L \n",
+ "F11=0 \n",
+ "F22=0 \n",
+ "S=1+(1+R[1]**2)/(R[1]**2) \n",
+ "F12=0.5*(S-(S**2-4*(r[1]/(2*r[0]))**2)**0.5) \n",
+ "A1_F11=0 \n",
+ "A2_F22=0 \n",
+ "A1_F12=A[0]*F12 \n",
+ "A1_F13=A[0]-(A[0]*F11+A[1]*F12) \n",
+ "#for surface 2:\n",
+ "A2_F21=A1_F12 \n",
+ "A2_F23=A1_F13 \n",
+ "#for surface 3:\n",
+ "#By reciprocity rule\n",
+ "A3_F31=A1_F13 \n",
+ "A3_F32=A2_F23 \n",
+ "A3_F33=A[2]-(A3_F31+A3_F32) \n",
+ "\n",
+ "#From equation 9.112:\n",
+ "E_b=[0]*3\n",
+ "for i in range(0,3):\n",
+ " E_b[i]=sigma*T[i]**4/1000.0 \n",
+ "\n",
+ "#since surface 3 is a black body\n",
+ "q_o3=E_b[2] \n",
+ "#From equations 9.157 and 9.158:\n",
+ "#we get\n",
+ "f=[0,0]\n",
+ "def F(p):\n",
+ " \n",
+ " x,y=p\n",
+ " f[0]=(A1_F11-A[0]/r[0])*x+A2_F21*y+A3_F31*q_o3+E_b[0]*A[0]*e[0]/r[0] \n",
+ " f[1]=(A1_F12*x)+((A2_F22-A[1]/r[1])*y)+E_b[1]*A[1]*e[1]/r[1] \n",
+ " return(f[0],f[1])\n",
+ "q_o=fsolve(F,(0,0)) \n",
+ "#From equation 9.140:\n",
+ "Q1=(A[0]*e[0]/r[0])*(E_b[0]-q_o[0]) \n",
+ "Q2=(A[1]*e[1]/r[1])*(E_b[1]-q_o[1]) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Power input to the heater ,Q1 =\",round(Q1,2),\"kW\"\n",
+ "print\"\\n The rate of heat transfer to the plate ,Q2 =\",round(Q2,2),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Power input to the heater ,Q1 = 36.19 kW\n",
+ "\n",
+ " The rate of heat transfer to the plate ,Q2 = -14.44 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.22,Page no:470"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=0.5 #diameter of chamber\n",
+ "l=2.0 #Length of chamber\n",
+ "e=0.5 #Emissivity\n",
+ "T_s=750.0 #Temperature at which the chamber is maintained\n",
+ "P=150e3 \n",
+ "T_g=1250.0 \n",
+ "sigma=5.67e-8 \n",
+ "P_c=0.1*P \n",
+ "P_w=P_c \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=math.pi/4.0*d**2*l #Volume of the chamber\n",
+ "A_s=(2*math.pi/4.0*d**2)+(math.pi*d*l) #total surface are of chamber\n",
+ "L_e=3.6*(V/A_s) \n",
+ "C_w=1.4 \n",
+ "e_w1=C_w*0.075 \n",
+ "C_c1=1.2 \n",
+ "e_c1=(C_c1*0.037) \n",
+ "A=(P_w+P_c)*L_e \n",
+ "B=P_c/(P_c+P_w)\n",
+ "De=0.001 \n",
+ "e_g=e_w1+0.044-De \n",
+ "e_w2=(0.12*C_w) \n",
+ "a_w=e_w2*(T_g/T_s)**0.65 \n",
+ "C_c2=1.02 \n",
+ "e_c2=(0.08*C_c2) \n",
+ "a_c=e_c2*(T_g/T_s)**0.65 \n",
+ "a_g=a_w+a_c \n",
+ "#If the surrounding surface is black, then:\n",
+ "Q=sigma*A_s*(e_g*T_g**4-a_g*T_s**4) \n",
+ "#For grey walls, the correction factor allowing for multiple reflection of\n",
+ "#incident radiation is:\n",
+ "C_g=0.5/(1.0-(1.0-0.326)*(1.0-0.5)) \n",
+ "Q_w=(Q*C_g) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Radiation to the walls if the surface is black =%.1f\"%(Q*1e-3),\"kW\" \n",
+ "print\"\\n Net radiation to the walls =%.2f\"%(Q_w*1e-3),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Radiation to the walls if the surface is black =50.3 kW\n",
+ "\n",
+ " Net radiation to the walls =37.97 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.23,Page no:479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration:\n",
+ "def mole(w,m):\n",
+ " n = w/m \n",
+ " return(n) \n",
+ "def partial(n1):\n",
+ " p = 308*(n1/total) \n",
+ " return(p)\n",
+ "w_steam = 0.57 #mass flow rate of steam entering in [kg/sec]\n",
+ "w_CO2 = 0.20 #mass flow rate of CO2 entering in [kg/sec]\n",
+ "m_water = 18 #molecular mass of water in kg\n",
+ "m_CO2 = 44 #molecular mass of CO2 in kg\n",
+ "n_steam = mole(w_steam,m_water) #number of moles in kmol\n",
+ "n_CO2 = mole(w_CO2,m_CO2) #number of moles in kmol\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "total = n_steam + n_CO2 \n",
+ "p_steam = partial(n_steam) \n",
+ "p_CO2 = partial(n_CO2) \n",
+ "mean_mol = (0.57 + 0.20)/total #mean molecular weight of the mixture in kg/kmol\n",
+ "outlet_steam = 11.7 #partial pressure of water in kN/m**2\n",
+ "outlet_CO2 = 308 - outlet_steam #partial pressure of water in kN/m**2\n",
+ "n_s = n_CO2*outlet_steam/outlet_CO2 \n",
+ "steam_condensed = n_steam - n_s \n",
+ "p_steam_401K = 252.2 #[kN/m**2]\n",
+ "p_CO2_401K = 308 - 252.2 #[kN/m**2]\n",
+ "steam_remaining = 0.0045*p_steam_401K/p_CO2_401K \n",
+ "s_c = n_steam - steam_remaining #[kmol]\n",
+ "Heat_cond = s_c*18*(2180 + 1.93*(404-401)) #[kW]\n",
+ "Heat_uncondensed_steam = 0.0203*18*1.93*(404-401) #[kW]\n",
+ "Heat_CO2 = 0.020*0.92*(404-401) \n",
+ "total_heat = Heat_cond + Heat_uncondensed_steam + Heat_CO2 \n",
+ "flow_water = 1407.3/(4.187*(319-300)) #[kg/sec]\n",
+ "hi = 6.36 #[kW/m**2 K]Based on flow velocity of 1425 kg/m**2 sec\n",
+ "ho = 5.25 #[kW/m**2 K]Based on outside area\n",
+ "Cp = (0.20*0.92 + 0.57*1.93)/0.77 #[kJ/kg K]\n",
+ "k_mean = 0.025 #[kW/m K]\n",
+ "a = 0.0411 #[m**2]\n",
+ "mass_velocity = (0.20+0.57)/0.0411 #[kg/m**2 sec]\n",
+ "hg = 107 #[W/m**2 K] at Re = 29,800 at equivalent diameter = 0.024m\n",
+ "u_pD = 0.62 #(u/pD)**0.67 = 0.62\n",
+ "Cpu_k = 1.01 #(Cp*u/k)**0.67\n",
+ "Psf = (122.6 - 38)/math.log(122.6/38) \n",
+ "kG = hg*(Cpu_k)/(1000*Cp*Psf*u_pD) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Assuming no scale resistance, the overall coefficient =\",round(1407.3/(34.8*74.2),3) ,\"W/m** K\"\n",
+ "print\"\\n Actual coeficient =\",round(1407.3/(53.9*74.2),3) ,\"kW/m**2 K\"\n",
+ "print\"\\n Dirt factor =\",round((0.545-0.352)/(0.545*0.352),2),\"K/kW\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Assuming no scale resistance, the overall coefficient = 0.545 W/m** K\n",
+ "\n",
+ " Actual coeficient = 0.352 kW/m**2 K\n",
+ "\n",
+ " Dirt factor = 1.01 K/kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.24,Page no:498"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d_v=1.0 #diameter of the vessel\n",
+ "L=0.3 #diameter of propeller agitator\n",
+ "N=2.5 #rotating speed of propeller agitator\n",
+ "T=310.0 #Temperature\n",
+ "G=0.5 #circulation speed of cooling water\n",
+ "d_o=25e-3 #outer diameter of stainless steel coil\n",
+ "d=22e-3 #inner diameter of stainless steel coil\n",
+ "d_w=(d_o+d)/2 \n",
+ "d_c=0.8 #diameter of helix\n",
+ "T_m=290.0 #mean temperature\n",
+ "k1=0.59 \n",
+ "Meu1=1.08e-3 \n",
+ "C_p1=4.18e3 \n",
+ "x_w=1.5e-3 \n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "h_i=(k1/d)*(1+3.5*(d/d_c))*0.023*(d*1315.0/Meu1)**0.8*(C_p1*Meu1/k1)**0.4 \n",
+ "#The external film coefficient is given by equation 9.204:\n",
+ "C_p2=1.88e3 #Specefic heat capacity\n",
+ "Meu2=6.5e-3 #viscosity\n",
+ "k2=0.40 \n",
+ "rho=1666 \n",
+ "Meu_s=8.6e-3 \n",
+ "h_o=0.87*(C_p2*Meu2/k2)**(1.0/3.0)*(L**2*N*rho/Meu2)**0.62*(Meu2/Meu_s)**0.14*k2/d_v \n",
+ "\n",
+ "k_w=15.9 \n",
+ "R_o=0.0004 \n",
+ "R_i=0.0002 \n",
+ "U_o=((1/h_o)+(x_w*d_o/(k_w*d_w))+(d_o/(h_i*d))+(R_o)+(R_i*d_o/d))**-1 \n",
+ "\n",
+ "#Result\n",
+ "print\"The overall coeffecient of heat transfer =\",round(U_o),\"W/m**2.K\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The overall coeffecient of heat transfer = 498.0 W/m**2.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.25,Page no:501"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "C_p=4e3 \n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "from scipy.integrate import quad\n",
+ "x=sympy.Symbol('x') \n",
+ "T_max=sympy.solve((600*0.5)*(393-x)-(10*6)*(x-293)) \n",
+ "#solving the equation finally we get \n",
+ "def f(T):\n",
+ " return(11111*(1/(376.3-T)))\n",
+ "t1=quad(f,293.0,353.0)\n",
+ "#The steam is turned off for 7200 s and during this time a heat balance gives:\n",
+ "#on solving as given in book we get\n",
+ "T=346.9 \n",
+ "#The time taken to reheat the liquid to 353 K is then given by:\n",
+ "t2=quad(f,T,353)\n",
+ "\n",
+ "#Result\n",
+ "print\"\\n\\n Maximum temperature to which it can be heated =\",round(T_max[0],1),\"K\"\n",
+ "print\"\\n Time taken to heat the liquid from 293 K to 353 K =%d\"%t1[0],\"s\"\n",
+ "print\"\\n Time taken to reheat the liquid to 353 K =%d\"%round(t2[0]),\"s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Maximum temperature to which it can be heated = 376.3 K\n",
+ "\n",
+ " Time taken to heat the liquid from 293 K to 353 K =14155 s\n",
+ "\n",
+ " Time taken to reheat the liquid to 353 K =2584 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.26,Page no:516"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "#As in Example 9.1, the heat load = 1672 kW\n",
+ "Q=1672 \n",
+ "#With reference to Figure 9.71:\n",
+ "T1=360 \n",
+ "T2=340 \n",
+ "theta1=300 #Temperature of cooling water entering\n",
+ "theta2=316 \n",
+ "\n",
+ "#Calculation\n",
+ "X=(theta2-theta1)/(T1-theta1) \n",
+ "Y=(T1-T2)/(theta2-theta1) \n",
+ "#from Figure 9.58\n",
+ "F=0.97 \n",
+ "theta_m=41.9 \n",
+ "#and hence:\n",
+ "A=Q/(2*F*theta_m) #the heat transfer area\n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The heat transfer area is =\",round(A,1),\"m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The heat transfer area is = 20.6 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.27,Page no:521"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "#As in Example 9.1, the heat load = 1672 kW\n",
+ "Q=1672.0 \n",
+ "#With reference to Figure 9.71:\n",
+ "T1=360.0 \n",
+ "T2=340.0 \n",
+ "theta1=300.0 #Temperature of cooling water entering\n",
+ "theta2=316.0 \n",
+ "F_theta_m=40.6 #corrected mean temperature difference\n",
+ "\n",
+ "#Calculation\n",
+ "T=(T1+T2)/2.0 \n",
+ "d=1.9e-3 #Tube diameter\n",
+ "u=1 #Water velocity\n",
+ "#then, in equation 9,221:\n",
+ "h_i=4.28*(0.00488*T-1)*u**0.8/d**0.2 \n",
+ "#From Table 9.18, an estimate of the shell-side film coefficient is:\n",
+ "h_o=(1700.0+11000.0)/2000.0 \n",
+ "#For steel tubes of a wall thickness of 1.6 mm, the thermal resistance of the wall, from Table 9.15 is:\n",
+ "xw_kw=0.025 \n",
+ "#the thermal resistance for treated water, from Table 9.16, is 0.26 m2K/kW\n",
+ "Ri=0.26 \n",
+ "Ro=Ri \n",
+ "U=((1.0/h_o)+xw_kw+Ri+Ro+(1.0/h_i))**-1 \n",
+ "A=Q/(F_theta_m*U) \n",
+ "\n",
+ "#Result\n",
+ "print\"\\n The heat transfer area =\",round(A,1),\"m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The heat transfer area = 32.8 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.28,Page no:531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "mh = 30.0 #[kg/s] Hot fluid flow rate\n",
+ "Thi = 370.0 #[K] Hot Fluid Inlet Temperature\n",
+ "Tho = 315.0 #[K] Hot Fluid outlet Temperature\n",
+ "Tci = 300.0 #[K] Cold Fluid Inlet Temperature\n",
+ "Tco = 315.0 #[K] Cold Fluid Outlet Temperature\n",
+ "cpc = 4.18*10**3 #[J/kg.K] Thermal Conductivity of Cold Fluid\n",
+ "#From table A1.3 at mean temperature 343 K\n",
+ "cph = 2.9*10**3 #[J/kg.K] Thermal Capacity of Hot fluid\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "q = mh*cph*(Thi-Tho) #[kW] Heat load\n",
+ "mc = q/(cpc*(Tco-Tci)) #[kg/s] Flow of cooling water\n",
+ "Tln = ((Thi-Tho)-(Tco-Tci))/(math.log((Thi-Tho)/(Tco-Tci))) #[K] logarithm mean temperature difference\n",
+ "X = (Thi - Tho)/(Tco-Tci) \n",
+ "Y = (Tco-Tci)/(Thi - Tci) \n",
+ "F = .85 \n",
+ "U = 500.0 #[W/m**2.K]\n",
+ "A = q/(F*Tln * U) \n",
+ "od = .02 #[m] outer dia\n",
+ "id = .016 #[m] inner dia\n",
+ "l = 4.83 #[m] effective tube length\n",
+ "s = math.pi*od*l \n",
+ "N = A/s \n",
+ "db = (1210/.249)**(2.207)**-1*20/1000.0 #[m]\n",
+ "dc = .068 #[m] diametric clearance between shell and tubes\n",
+ "ds = db+dc #[m] Shell dia\n",
+ "Ac = math.pi/4*id**2 #[m**2] Cross sectional area\n",
+ "Ntp = N/2.0\n",
+ "Af = N/2.0*Ac #[m**2] Tube side flow area\n",
+ "mw = 76.3/Af #[kg/m**2.s] Mass velocity of water\n",
+ "rho = 995 #[kg/m**3] mas density of water\n",
+ "u = mw/rho #[m/s] water velocity\n",
+ "vu = .8*10**-3 #[N.s/m**2] viscosity\n",
+ "k = .59 #[W/m.K]\n",
+ "Re = id*u*rho/vu \n",
+ "Pr = cpc*vu/k \n",
+ "ld = l/id \n",
+ "jh = 3.7*10**-3\n",
+ "hi = jh*Re*Pr**.3334*.59/id #[W/m**2.K]\n",
+ "dbf = .20*ds #[m] Baffle Dia\n",
+ "tb = 1.25*20*10**-3 #[mm] Tube Pitch\n",
+ "As = (25.0-20.0)/25.0*10**3*(ds*Ac) #[m**2]\n",
+ "Gs = 30.0/As #[kg/m**2.s]\n",
+ "de = 1.1*(.025**2-.917*od**2)/od #[m]\n",
+ "rho2 = 780.0 #[kg/m**3] density\n",
+ "vu2 = .8*10**-3 #[N.s/m**2] viscosity\n",
+ "Cp2 = 3.1*10**3 #[J/kg.K] Heat capacity\n",
+ "k2 = .16 #[W/m.K]\n",
+ "Re2 = Gs*de/vu2 \n",
+ "Pr2 = Cp2*vu2/k2 \n",
+ "jh2 = 5*10**-3 \n",
+ "hs = jh2*Re2*Pr2**.334*k2/de \n",
+ "k3 = 50.0 #[W/m.K] Thermal Conductivity\n",
+ "Rw = .00020 #[m**2.K/W] Scale Resistances \n",
+ "Ro = .00015 #[m**2.K/W] Resistance for organic\n",
+ "U = (1.0/hs + Rw + 0.5*(od-id)/k3 + Ro*od/id+od/(id*hi))**-1\n",
+ "#From figure 9.78\n",
+ "jf = 4.5*10**-3 \n",
+ "n = 2.0 \n",
+ "delP = n*(4*jf*(4.830/id) + 1.25)*(rho*u**2) \n",
+ "u2 = Gs/rho2 \n",
+ "jf2 = 4.6*10**-2 \n",
+ "N2 = 1.0 \n",
+ "delP2 = N2*(4*jf2*(4.830/od)*(1005/14.2))*(rho2*u2**2) \n",
+ "\n",
+ "#Increasing the baffle spacing pressure drop is reduced one-fourth\n",
+ "delPs = delP2/4.0 \n",
+ "ho = hs*(.5)**.8 #[W/m**2.K]\n",
+ "U2 = (1.0/ho + Rw + .5*(od-id)/k3 + Ro*od/id+od/(id*hi))**-1\n",
+ "\n",
+ "#REsult\n",
+ "print\"Overall Coefficient of %d\"%U2,\" W/m**2.K \\n Number of tubes/pass =\",round(Ntp),\"\\n Number of tubes required = %d\"%N\n",
+ "print\"NOTE:Very approximate values are used in textbook for Calculation\\nThat's why answer is different\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall Coefficient of 563 W/m**2.K \n",
+ " Number of tubes/pass = 603.0 \n",
+ " Number of tubes required = 1205\n",
+ "NOTE:Very approximate values are used in textbook for Calculation\n",
+ "That's why answer is different\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.29,Page no:535"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "G=1.0 #Flow rate of organic liquid\n",
+ "Cp=2e3#Heat capacity of organic liquid\n",
+ "T1=350.0 \n",
+ "T2=330.0 \n",
+ "theta1=290.0\n",
+ "theta2=320.0 \n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Q=G*Cp*(T2-T1) #heat load\n",
+ "G_cool=Q/(4187*(theta1-theta2)) #flow of water\n",
+ "GCp_hot=(G*Cp) #for organic\n",
+ "GCp_cold=(G_cool*4187) \n",
+ "#From equation 9.235:\n",
+ "eta=GCp_hot*(T1-T2)/(GCp_cold*(T1-theta1)) \n",
+ "\n",
+ "#Result\n",
+ "print\" Effectiveness of the given double pipe heat exchanger =\",round(eta,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Effectiveness of the given double pipe heat exchanger = 0.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.30,Page no:538"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "Tci = 320.0 #[K] Cold Fluid Initial Temperature\n",
+ "Tce = 340.0 #[K] Cold Fluid Final Temperature\n",
+ "mc = 4.0 #[kg/s] Flow rate of cold fluid\n",
+ "mh = 8.0 #[kg/s] Flow rate of hot fluid\n",
+ "import numpy as np\n",
+ "Thi = np.array([380,370,360,350]) #[K] Hot fluid initial temperature\n",
+ "Cp = 4.18 #[kJ/kg.K] mean heat capacity\n",
+ "U = 1.5 #[W/m**2.K] Overall heat transfer coefficient\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "GCpu= mh*Cp #[kW/K]\n",
+ "GCpp= mc*Cp #[kW/K]\n",
+ "if(GCpu<GCpp):\n",
+ " GCpmin = GCpu #[kW/K]\n",
+ " ratio = GCpmin/GCpp \n",
+ "else:\n",
+ " GCpmin = GCpp #[kW/K]\n",
+ " ratio = GCpmin/GCpu \n",
+ " \n",
+ "#Equation 9.235\n",
+ "n = mc*Cp*(Tce-Tci)*(mc*Cp*(Thi - Tci))**-1 \n",
+ "#From Figure 9.85b Number of transfer Units\n",
+ "N = np.array([.45,.6,.9,1.7]) #[NTU]\n",
+ "A = N*GCpmin/U #Area of required [m**2]\n",
+ "\n",
+ "#Result\n",
+ "print\"Thi(K) n N A (m**2)\" \n",
+ "for i in range(0,4):\n",
+ " print Thi[i],\"\\t\",round(n[i],2),\"\\t\",N[i],\"\\t\",round(A[i],1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thi(K) n N A (m**2)\n",
+ "380 \t0.33 \t0.45 \t5.0\n",
+ "370 \t0.4 \t0.6 \t6.7\n",
+ "360 \t0.5 \t0.9 \t10.0\n",
+ "350 \t0.67 \t1.7 \t18.9\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.31,Page no:544"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "o_d=10e-3 #outer diameter of the tube\n",
+ "i_d=8.2e-3 #inner diameter of the tube\n",
+ "h=140 #coeffecient of heat transfer between gas and copper tube\n",
+ "k=350 #Thermal conductivity of copper tube\n",
+ "L=0.075 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "b=math.pi*o_d #perimeter of tube\n",
+ "A=math.pi/4*(o_d**2-i_d**2) #cross sectional area of the metal\n",
+ "m=((h*b)/(k*A))**0.5 \n",
+ "T_g=((475*math.cosh(m*L))-365)/(math.cosh(m*L)-1) \n",
+ "\n",
+ "#Result\n",
+ "print\"The gas temperature is =%d\"%T_g,\"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gas temperature is =539 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.32,Page no:545"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d2=54e-3 #outer diameter of the tube\n",
+ "d1=70e-3 # fin diameter\n",
+ "w=2e-3 #fin thickness\n",
+ "n=230.0 # number of fins per metre run\n",
+ "T_s=370.0 #Surface temperature\n",
+ "T=280.0 #Temperature of surroundings\n",
+ "h=30.0 #Heat transfer coeffecient between gas and fin\n",
+ "k=43.0 #Thermal conductivity of steel\n",
+ "L=(d1-d2)/2.0 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "theta1=T_s-T \n",
+ "#Assuming that the height of the fin is small compared with its circumference \n",
+ "#and that it may be treated as a straight fin of length\n",
+ "l=(math.pi/2.0)*(d1+d2) \n",
+ "b=2*l #perimeter\n",
+ "A=l*w #the average area at right-angles to the heat flow\n",
+ "m=((h*b)/(k*A))**0.5 \n",
+ "#From equation 9.254, the heat flow is given for case (b) as:\n",
+ "Qf=m*k*A*theta1*(math.exp(2*m*L)-1)/(1+math.exp(2*m*L)) \n",
+ "Q=Qf*n #Heat loss per meter run of tube\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat loss per metre run of tube =\",round(Q*1e-3,2),\"kW/m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat loss per metre run of tube = 1.91 kW/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.33,Page no:556"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "d=150e-3 #Internal diameter of tube\n",
+ "d_o=168e-3 #outer diameter of tube\n",
+ "d_w=159e-3 \n",
+ "d_s=268e-3 \n",
+ "d_m=(d_s-d_o)/math.log(d_s/d_o) #log mean of d_o and d_s\n",
+ "h_i=8500 #The coefficient for condensing steam together with that for any scale\n",
+ "k_w=45 \n",
+ "k_l=0.073 \n",
+ "x_l=50e-3 \n",
+ "x_w=9e-3 \n",
+ "DT=444-294 \n",
+ "sigma=5.67e-8 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "#The temperature on the outside of the lagging is estimated at 314 K and (hr + hc) will be taken as 10 W/m2 K.\n",
+ "#total thermal resisitance \n",
+ "R=(h_i*math.pi*d)**-1+(10*math.pi*d_s)**-1+(k_w*math.pi*d_w/x_w)**-1+(k_l*math.pi*d_m/x_l)**-1 \n",
+ "Q_l=DT/R #The heat loss per metre of length(from eq 9.261)\n",
+ "DT_lagging=((k_l*math.pi*d_m/x_l)**-1/R)*DT \n",
+ "#Taking an emissivity of 0.9, from equation 9.119:\n",
+ "\n",
+ "h_r=(0.9*sigma*(310**4-294**4))/(310-294) \n",
+ "C=1.32 \n",
+ "#Substituting in equation 9.105 (putting l = diameter = 0.268 m):\n",
+ "h_c=C*((310.0-294.0)/d_s)**0.25 \n",
+ "#If the pipe were unlagged,(hc+hr)for DT=150 K would be about 20 W/m2 K and the heat loss would then be:\n",
+ "Q_l=20*math.pi*d_o*150 \n",
+ "\n",
+ "#Result\n",
+ "print\"The heat loss to the air =\",round(Q_l*1e-3,2),\"kW/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat loss to the air = 1.58 kW/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:9.34,Page no:560"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "T1=420 #temperature of steam\n",
+ "k=0.1 #Thermal conductivity\n",
+ "T2=285 #Ambient temperature\n",
+ "h=10 #the coefficient of heat transfer from the outside of the lagging to \n",
+ " #the surroundings\n",
+ " \n",
+ " \n",
+ "#Calculation\n",
+ "\n",
+ "#determining Q/l from equation 9.21 and equating it to heat loss from the\n",
+ "#outside of the lagging we get\n",
+ "#(Q/l)=84.82/(math.log(d_o/0.1)+(0.02/d_o)) W/m\n",
+ "#using various equations we finally get an equation in terms of d_o and we\n",
+ "# will solve it by using fsolve\n",
+ "def F(d_o):\n",
+ " return((1/(math.log(d_o/0.1)+(0.02/d_o))**2)-(2.35*(d_o**3)/(d_o-0.02))) \n",
+ "ans=fsolve(F,1) \n",
+ "E_t=(ans-0.1)/2\n",
+ "\n",
+ "#Result\n",
+ "print\"\\n Economic thickness of lagging =\",round(E_t[0]*1e3),\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Economic thickness of lagging = 163.0 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/README.txt b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/README.txt new file mode 100755 index 00000000..3fd67037 --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/README.txt @@ -0,0 +1,10 @@ +Contributed By: Gaurav Sharma +Course: btech +College/Institute/Organization: JSS Academy of Technical Education,Noida +Department/Designation: Mechanical Engineering +Book Title: Chemical Engineering-Fluid Flow,Heat Transfer And Mass Transfer Vol-1 +Author: J. M. Coulson, J. F. Richardson, J. R. Backhurst And J. H. Harker +Publisher: Elsevier India +Year of publication: 2006 +Isbn: 0750644443 +Edition: 6
\ No newline at end of file diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/screenshots/Heating.png b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/screenshots/Heating.png Binary files differnew file mode 100755 index 00000000..26f02feb --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/screenshots/Heating.png diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/screenshots/Unit.png b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/screenshots/Unit.png Binary files differnew file mode 100755 index 00000000..b8d7e1db --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/screenshots/Unit.png diff --git a/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/screenshots/ex8_8.png b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/screenshots/ex8_8.png Binary files differnew file mode 100755 index 00000000..fa7cb80a --- /dev/null +++ b/Chemical_Engineering-Fluid_Flow,Heat_Transfer_And_Mass_Transfer_Vol-1_/screenshots/ex8_8.png diff --git a/Engineering_Physics_Malik/Chapter_1.ipynb b/Engineering_Physics_Malik/Chapter_1.ipynb index 4dd3b7b8..4dd3b7b8 100644..100755 --- a/Engineering_Physics_Malik/Chapter_1.ipynb +++ b/Engineering_Physics_Malik/Chapter_1.ipynb diff --git a/Engineering_Physics_Malik/Chapter_10.ipynb b/Engineering_Physics_Malik/Chapter_10.ipynb index 39a354b1..39a354b1 100644..100755 --- a/Engineering_Physics_Malik/Chapter_10.ipynb +++ b/Engineering_Physics_Malik/Chapter_10.ipynb diff --git a/Engineering_Physics_Malik/Chapter_11.ipynb b/Engineering_Physics_Malik/Chapter_11.ipynb index 0cd9f3f6..0cd9f3f6 100644..100755 --- a/Engineering_Physics_Malik/Chapter_11.ipynb +++ b/Engineering_Physics_Malik/Chapter_11.ipynb diff --git a/Engineering_Physics_Malik/Chapter_12.ipynb b/Engineering_Physics_Malik/Chapter_12.ipynb index 1b8c5610..1b8c5610 100644..100755 --- a/Engineering_Physics_Malik/Chapter_12.ipynb +++ b/Engineering_Physics_Malik/Chapter_12.ipynb diff --git a/Engineering_Physics_Malik/Chapter_13.ipynb b/Engineering_Physics_Malik/Chapter_13.ipynb index db97b36d..db97b36d 100644..100755 --- a/Engineering_Physics_Malik/Chapter_13.ipynb +++ b/Engineering_Physics_Malik/Chapter_13.ipynb diff --git a/Engineering_Physics_Malik/Chapter_14.ipynb b/Engineering_Physics_Malik/Chapter_14.ipynb index 498814f0..498814f0 100644..100755 --- a/Engineering_Physics_Malik/Chapter_14.ipynb +++ b/Engineering_Physics_Malik/Chapter_14.ipynb diff --git a/Engineering_Physics_Malik/Chapter_15.ipynb b/Engineering_Physics_Malik/Chapter_15.ipynb index 2b3eeafd..2b3eeafd 100644..100755 --- a/Engineering_Physics_Malik/Chapter_15.ipynb +++ b/Engineering_Physics_Malik/Chapter_15.ipynb diff --git a/Engineering_Physics_Malik/Chapter_16.ipynb b/Engineering_Physics_Malik/Chapter_16.ipynb index 0fab1922..0fab1922 100644..100755 --- a/Engineering_Physics_Malik/Chapter_16.ipynb +++ b/Engineering_Physics_Malik/Chapter_16.ipynb diff --git a/Engineering_Physics_Malik/Chapter_17.ipynb b/Engineering_Physics_Malik/Chapter_17.ipynb index 01028f54..01028f54 100644..100755 --- a/Engineering_Physics_Malik/Chapter_17.ipynb +++ b/Engineering_Physics_Malik/Chapter_17.ipynb diff --git a/Engineering_Physics_Malik/Chapter_18.ipynb b/Engineering_Physics_Malik/Chapter_18.ipynb index de6fffda..de6fffda 100644..100755 --- a/Engineering_Physics_Malik/Chapter_18.ipynb +++ b/Engineering_Physics_Malik/Chapter_18.ipynb diff --git a/Engineering_Physics_Malik/Chapter_19.ipynb b/Engineering_Physics_Malik/Chapter_19.ipynb index 8e043325..8e043325 100644..100755 --- a/Engineering_Physics_Malik/Chapter_19.ipynb +++ b/Engineering_Physics_Malik/Chapter_19.ipynb diff --git a/Engineering_Physics_Malik/Chapter_2.ipynb b/Engineering_Physics_Malik/Chapter_2.ipynb index dccc71e2..dccc71e2 100644..100755 --- a/Engineering_Physics_Malik/Chapter_2.ipynb +++ b/Engineering_Physics_Malik/Chapter_2.ipynb diff --git a/Engineering_Physics_Malik/Chapter_20.ipynb b/Engineering_Physics_Malik/Chapter_20.ipynb index 6252eb1b..6252eb1b 100644..100755 --- a/Engineering_Physics_Malik/Chapter_20.ipynb +++ b/Engineering_Physics_Malik/Chapter_20.ipynb diff --git a/Engineering_Physics_Malik/Chapter_22.ipynb b/Engineering_Physics_Malik/Chapter_22.ipynb index a955c292..a955c292 100644..100755 --- a/Engineering_Physics_Malik/Chapter_22.ipynb +++ b/Engineering_Physics_Malik/Chapter_22.ipynb diff --git a/Engineering_Physics_Malik/Chapter_3.ipynb b/Engineering_Physics_Malik/Chapter_3.ipynb index 1e5fdb51..1e5fdb51 100644..100755 --- a/Engineering_Physics_Malik/Chapter_3.ipynb +++ b/Engineering_Physics_Malik/Chapter_3.ipynb diff --git a/Engineering_Physics_Malik/Chapter_4.ipynb b/Engineering_Physics_Malik/Chapter_4.ipynb index 981a3d82..981a3d82 100644..100755 --- a/Engineering_Physics_Malik/Chapter_4.ipynb +++ b/Engineering_Physics_Malik/Chapter_4.ipynb diff --git a/Engineering_Physics_Malik/Chapter_5.ipynb b/Engineering_Physics_Malik/Chapter_5.ipynb index e9ebdd41..e9ebdd41 100644..100755 --- a/Engineering_Physics_Malik/Chapter_5.ipynb +++ b/Engineering_Physics_Malik/Chapter_5.ipynb diff --git a/Engineering_Physics_Malik/Chapter_6.ipynb b/Engineering_Physics_Malik/Chapter_6.ipynb index 76ec5aef..76ec5aef 100644..100755 --- a/Engineering_Physics_Malik/Chapter_6.ipynb +++ b/Engineering_Physics_Malik/Chapter_6.ipynb diff --git a/Engineering_Physics_Malik/Chapter_7.ipynb b/Engineering_Physics_Malik/Chapter_7.ipynb index 6762cbc5..6762cbc5 100644..100755 --- a/Engineering_Physics_Malik/Chapter_7.ipynb +++ b/Engineering_Physics_Malik/Chapter_7.ipynb diff --git a/Engineering_Physics_Malik/Chapter_8.ipynb b/Engineering_Physics_Malik/Chapter_8.ipynb index 60f3ed3a..60f3ed3a 100644..100755 --- a/Engineering_Physics_Malik/Chapter_8.ipynb +++ b/Engineering_Physics_Malik/Chapter_8.ipynb diff --git a/Engineering_Physics_Malik/Chapter_9.ipynb b/Engineering_Physics_Malik/Chapter_9.ipynb index a43c0fed..a43c0fed 100644..100755 --- a/Engineering_Physics_Malik/Chapter_9.ipynb +++ b/Engineering_Physics_Malik/Chapter_9.ipynb diff --git a/Engineering_Physics_Malik/README.txt b/Engineering_Physics_Malik/README.txt index 85c741ca..85c741ca 100644..100755 --- a/Engineering_Physics_Malik/README.txt +++ b/Engineering_Physics_Malik/README.txt diff --git a/Engineering_Physics_Malik/screenshots/noofphotons.png b/Engineering_Physics_Malik/screenshots/noofphotons.png Binary files differindex bb15b8cf..bb15b8cf 100644..100755 --- a/Engineering_Physics_Malik/screenshots/noofphotons.png +++ b/Engineering_Physics_Malik/screenshots/noofphotons.png diff --git a/Engineering_Physics_Malik/screenshots/ref_indices.png b/Engineering_Physics_Malik/screenshots/ref_indices.png Binary files differindex 300447f7..300447f7 100644..100755 --- a/Engineering_Physics_Malik/screenshots/ref_indices.png +++ b/Engineering_Physics_Malik/screenshots/ref_indices.png diff --git a/Engineering_Physics_Malik/screenshots/wavelenK.png b/Engineering_Physics_Malik/screenshots/wavelenK.png Binary files differindex da79e117..da79e117 100644..100755 --- a/Engineering_Physics_Malik/screenshots/wavelenK.png +++ b/Engineering_Physics_Malik/screenshots/wavelenK.png diff --git a/Fundamental_of_internal_combustion_engines/Chap13.ipynb b/Fundamental_of_internal_combustion_engines/Chap13.ipynb new file mode 100755 index 00000000..d404f5f6 --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/Chap13.ipynb @@ -0,0 +1,124 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13: Engine friction and lubrication"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.1 Page No 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=0.08\t\t #The diameter of bore in m\n",
+ "L=0.075\t\t #The length of the stroke in m\n",
+ "l=0.152\t\t #The connecting rod length in m\n",
+ "h=0.062\t\t #Skirt length of the piston in m\n",
+ "Fr=8000\t\t #Compressive force in the connecting rod in N\n",
+ "p=3000\t\t #The pressure in the cylinder kPa\n",
+ "y=0.004*10**-3\t #The clearence between piston and cylinder wall in m\n",
+ "U=0.006\t\t #The dynamic viscosity of the lubricating oil in pa.s\n",
+ "u=8.2\t\t #The piston speed in m/s\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "ts=(U*u)/y\t #The shear stress in N/m**2\n",
+ "A=pi*d*h\t #Contact area between the piston and the cylinder in m**2\n",
+ "Ff=ts*A\t\t #Friction force on the piston inN\n",
+ "r=L/2.0\t\t #Crank length in m\n",
+ "A=math.atan(r/l)\t #The angle made by the crank in radians\n",
+ "Ft=Fr*sin(A)\t#The side thrust in N\n",
+ "\n",
+ "#Output \n",
+ "print\"The friction force on the piston \",round(Ff,0),\"N\"\n",
+ "print\"The thrust force on the cylinder wall is\",round(Ft,0),\"N\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The friction force on the piston 192.0 N\n",
+ "The thrust force on the cylinder wall is 1916.0 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.2 Page No 424"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=0.065\t\t#The cylinder bore diameter in m\n",
+ "L=6.0\t\t#The length of the stroke in cm\n",
+ "l=12.0\t\t#The length of the connecting rod in cm\n",
+ "p=50.0\t\t#The pressure in the cylinder in bar\n",
+ "q=90.0\t\t#The crank position in power stroke of the cycle for one cylinder in degrees\n",
+ "Ff=900.0\t\t#Friction force in N\n",
+ "o=0.2\t\t#Wrist pin off set in cm\n",
+ "\n",
+ "#Calculations\n",
+ "r=L/2.0\t\t#The crank length in cm\n",
+ "sineA=r/l\t \n",
+ "cosA=(1-(sineA)**2)**(1/2.0)\t\n",
+ "Fr=(((p*10**5*(pi/4.0)*d**2)-Ff)/cosA)/1000.0 \n",
+ "Ft=Fr*sineA\t #The side thrust on the piston in kN\n",
+ "sineA1=(r-o)/l\t#The value of sine\n",
+ "cosA1=(1-(sineA1)**2)**(1/2.0)\t\t\t\n",
+ "Fr1=(((p*10**5*(pi/4.0)*d**2)-Ff)/cosA1)/1000.0\t\n",
+ "Ft1=Fr1*sineA1 #The side thrust in kN\n",
+ "\n",
+ "#Output \n",
+ "print\"(a) The force in the connecting rod \",round(Fr,3),\" kN\"\n",
+ "print\"The side thrust on the piston =\",round(Ft,2),\"kN\"\n",
+ "print\"(b) The side thrust on the piston =\",round(Ft1,3),\" kN\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The force in the connecting rod 16.206 kN\n",
+ "The side thrust on the piston = 4.05 kN\n",
+ "(b) The side thrust on the piston = 3.765 kN\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/Chap2.ipynb b/Fundamental_of_internal_combustion_engines/Chap2.ipynb new file mode 100755 index 00000000..a4ae8119 --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/Chap2.ipynb @@ -0,0 +1,534 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page No: 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=20.0 #Cylinder bore diameter in cm\n",
+ "L=25.0 #Stroke length in cm\n",
+ "Vc=1570.0 #The clearance volume in cm**3\n",
+ "P1=1.0 #Pressure at the beginning of the compression in bar\n",
+ "T1=300.0 #Temperature at the beginning of the compression in K\n",
+ "T3=1673 #The maximum temperature of the cycle in K\n",
+ "Cv=0.718 #specific heat at constant volume for air in kJ/kgK\n",
+ "R=0.287 #Real gas constant in kJ/kgK\n",
+ "g=1.4 #Isentropic index\n",
+ "c=500.0 #Number of cycles per minute\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Vs=(math.pi/4.0)*d**2*L\n",
+ "V1=Vs+Vc\n",
+ "V2=Vc #cm**3\n",
+ "r=V1/V2 #Compression ratio\n",
+ "T2=T1*r**(g-1)\n",
+ "P2=P1*r**g\n",
+ "P3=P2*(T3/T2) #In constant volume, process Pressure at point 3 in bar\n",
+ "T4=T3*(1/r)**(g-1) #In isentropic process, Temperature at point 4 in degree centigrade\n",
+ "P4=P3*(1/r)**(g) #In isentropic process, Pressure at point 4 in bar\n",
+ "no=(1-(1/r)**(g-1))*100 #Air standard efficiency of otto cycle\n",
+ "Q1=Cv*(T3-T2) #Heat supplied in kJ/kg\n",
+ "Q2=Cv*(T4-T1) #Heat rejected in kJ/kg\n",
+ "W=Q1-Q2 #Work done per unit mass in kJ/kg\n",
+ "m=((P1*10**5*V1*10**-6)/(R*T1))/1000.0 #The amount of mass in kg\n",
+ "W1=W*m #Work done in kJ\n",
+ "pm=((W1*10**3)/(Vs*10.0**-6))/10.0**5 #Mean effective pressure in N/m**2\n",
+ "P=W1*(c/60.0) #Power developed in kW\n",
+ "\n",
+ "#Output\n",
+ "print\"Temperature at point 2 = \",round(T2-273.15,1),\"C\"\n",
+ "print\"Pressure at point 2 =\" ,round(P2,2),\" bar\"\n",
+ "print\"Pressure at point 3 = \",round(P3,2),\"bar\" \n",
+ "print\"Temperature at point 4 = \",round(T4-273.15),\" C \\nPressure at point 4 = \",round(P4,3),\"bar\"\n",
+ "print\"Air standard efficiency of otto cycle = \",round(no,2),\" percent \"\n",
+ "print\"Work done = \",round(W1,2),\" kJ\"\n",
+ "print\"Mean effective pressure = \",round(pm,2),\"bar \"\n",
+ "print\"Power developed = \",round(P,1),\"kW \"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at point 2 = 341.3 C\n",
+ "Pressure at point 2 = 12.29 bar\n",
+ "Pressure at point 3 = 33.47 bar\n",
+ "Temperature at point 4 = 544.0 C \n",
+ "Pressure at point 4 = 2.723 bar\n",
+ "Air standard efficiency of otto cycle = 51.17 percent \n",
+ "Work done = 4.26 kJ\n",
+ "Mean effective pressure = 5.42 bar \n",
+ "Power developed = 35.5 kW \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page No: 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "CV=42000.0 #The calorific value of the fuel in kJ/kg\n",
+ "pa=5.0 #Percentage of compression\n",
+ "Pa=1.2 #Pressure in the cylinder at 5% compression stroke\n",
+ "pb=75 #Percentage of compression\n",
+ "Pb=4.8 #Pressure in the cylinder at 75% compression stroke\n",
+ "g=1.3 #polytropic index\n",
+ "g1=1.4 #Isentropic index\n",
+ "n=0.6 #Air standard efficiency\n",
+ "\n",
+ "#Calculations\n",
+ "V=(Pb/Pa)**(1/1.3)#Ratio of volumes\n",
+ "r=(V*(pb/100.0)-(pa/100.0))/((1-(pa/100.0))-(V*(1-(pb/100.0)))) #Compression ratio\n",
+ "n1=((1-(1/r)**(g1-1)))*100 #Relative efficiency\n",
+ "nthj=n*(n1/100.0) #Indicated thermal efficiency\n",
+ "x=(1/(CV*nthj))*3600 #Specific fuel consumption in kg/kW.h\n",
+ "\n",
+ "#Output\n",
+ "print\"The compression ratio of the engine is \",round(r,1)\n",
+ "print\"The specific fuel consumption is \",round(x,3),\"kg/kwh\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The compression ratio of the engine is 9.5\n",
+ "The specific fuel consumption is 0.241 kg/kwh\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 Page No: 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=0.2 #The diameter of the cylinder bore in m\n",
+ "L=0.3 #The length of the stroke in m\n",
+ "P1=1 #The pressure at the beginning of the compression in bar\n",
+ "T1=300.0 #The temperature at the beginning of the compression in K\n",
+ "r=16.0 #Compression ratio\n",
+ "V=0.08 #Cutt off takes place at 8& of the stroke\n",
+ "R=0.287 #Real gas constant in kJ/kgK\n",
+ "g=1.4 #Isentropic index\n",
+ "Cp=1.005 #Specific heat at constant prassure in kJ/kgK\n",
+ "Cv=0.718 #specific heat at constant volume for air in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Vs=(math.pi/4.0)*d**2*L #Swept volume in m**3\n",
+ "Vc=Vs/(r-1) #Clearance volume in m**3\n",
+ "V2=Vc #Volume at point 2 in m**3\n",
+ "V1=Vs+Vc #Volume at point 1 in m**3\n",
+ "m=(P1*10**5*V1)/(R*T1) #The amount of mass in kg\n",
+ "P2=P1*(r**g) #Pressure at point 2 in bar\n",
+ "P3=P2 #Pressure at point 3 in bar\n",
+ "T2=T1*r**(g-1) #Temperature at point 2 in K\n",
+ "V3=(V*Vs)+V2 #Volume at point 3 in m**3\n",
+ "C=V3/V2 #Cut off ratio\n",
+ "T3=C*T2 #Temperature at point 3 in K\n",
+ "P4=P3*(C/r)**g #Pressure at the point 4 in bar\n",
+ "T4=T3*(C/r)**(g-1) #Temperature at point 4 in K\n",
+ "V4=V1 #Volume at point 4 in m**3\n",
+ "Q1=(m*Cp*(T3-T2))/1000.0 #Heat supplied in kJ\n",
+ "Q2=(m*Cv*(T4-T1))/1000.0 #Heat rejected in kJ\n",
+ "W=(Q1-Q2) #Work done per cycle in kJ\n",
+ "na=(W/Q1)*100 #Air standard efficiency\n",
+ "Pm=(W*1000/Vs)/10.0**5 #Mean effective pressure in bar\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) Volume at point 2 = \",round(V2,5),\" m**3 \\nVolume at point 1 = \",round(V1,5),\"m**3 \"\n",
+ "print\"Pressure at point 2 = \",round(P2,1),\" bar\" \n",
+ "print\"Temperature at point 2 = \",round(T2,1),\"K\"\n",
+ "print\"beeta is\",C,\"\\nTemperature at point 3 = \",round(T3,0),\" K \\nPressure at point 4 =\",round(P4,3),\" bar\"\n",
+ "print\"Temperature at point 4 = \",round(T4,1),\" K \\nVolume at point 4 = \",round(V4,5),\"m**3\" \n",
+ "print\"(b) cut off ratio = \",round(c,1)\n",
+ "print\"(c) Work done per cycle = \",round(W,3),\"kJ\" \n",
+ "print\"(d) air smath.tandard efficiency = \",round(na,1),\" percent\" \n",
+ "print\"(e)Mean effective pressure = \",round(Pm,2),\" bar \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Volume at point 2 = 0.00063 m**3 \n",
+ "Volume at point 1 = 0.01005 m**3 \n",
+ "Pressure at point 2 = 48.5 bar\n",
+ "Temperature at point 2 = 909.4 K\n",
+ "beeta is 2.2 \n",
+ "Temperature at point 3 = 2001.0 K \n",
+ "Pressure at point 4 = 3.016 bar\n",
+ "Temperature at point 4 = 904.7 K \n",
+ "Volume at point 4 = 0.01005 m**3\n",
+ "(b) cut off ratio = 500.0\n",
+ "(c) Work done per cycle = 7.736 kJ\n",
+ "(d) air smath.tandard efficiency = 60.4 percent\n",
+ "(e)Mean effective pressure = 8.21 bar \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 Page No:50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "P1=7\n",
+ "g=1.4\n",
+ "r=12\n",
+ "import numpy as np\n",
+ "from scipy.optimize import fsolve\n",
+ "\n",
+ "def f(b):\n",
+ " return P1-1/((g-1)*(r-1))*(g*r**g*(b-1)-r*(b**1.4-1))\n",
+ "b = fsolve(f, 1)\n",
+ "f(b)\n",
+ "na=(1-(1/(r**(g-1)))*(((b**g)-1)/(g*(b-1))))*100 #Air standard efficiency\n",
+ "\n",
+ "#Output \n",
+ "print\"The cut off ratio = \",round(b,1),\" \\n The air standard efficiency =\",na,\"percent\"\n",
+ "#NOTE:In the book Answer is wrong for Air standard efficiency .\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The cut off ratio = 2.2 \n",
+ " The air standard efficiency = [ 55.47110058] percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 Page no 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "m=30.0 #The air fuel ratio by mass\n",
+ "T1=300 #The temperature of air at the beginning of the compression in K\n",
+ "r=16 #The compression ratio\n",
+ "CV=42000 #The calorific value of the fuel in kJ/kg\n",
+ "g=1.4 #Isentropic index\n",
+ "Cp=1.005 #Specific heat at constant prassure in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "T2=T1*(r**(g-1)) #Temperature at point 2 in K\n",
+ "T3=((1/m)*(CV/Cp))+T2 #Temperature at point 3 in K\n",
+ "C=T3/T2 #The cut off ratio\n",
+ "n=(1-((1/r**(g-1))*(((C**g)-1)/(g*(C-1)))))*100#The ideal efficiency of the engine based on the air standard cycle\n",
+ "\n",
+ "#Output\n",
+ "print\" The ideal efficiency of the engine based on the air standard cycle = \",round(n,1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The ideal efficiency of the engine based on the air standard cycle = 58.9\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 Page No: 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "p1=1.0 #Inlet pressure in bar\n",
+ "p2=32.425 #Pressure at the end of isentropic compression in bar\n",
+ "r=6.0 #Ratio of expansion\n",
+ "r1=1.4 #Isentropic index\n",
+ "\n",
+ "#Calculations\n",
+ "rc=(p2/p1)**(1/r1) #Compression ratio\n",
+ "b=(rc/r) #cut-off ratio\n",
+ "n=(1-((b**r1-1)/(rc**(r1-1)*r1*(b-1))))*100 \n",
+ "pm=((p1*rc**r1*n/100.0*r1*(b-1))/((r1-1)*(rc-1))) \n",
+ "\n",
+ "#Output\n",
+ "print\"Air-smath efficiency is \",round(n,3),\"percent\"\n",
+ "print\"Mean effective pressure is \",round(pm,3),\"bar\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Air-smath efficiency is 56.671 percent\n",
+ "Mean effective pressure is 5.847 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 Page No: 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "rc=15.0 #Compression ratio\n",
+ "p1=1 #Pressure at which compression begins in bar\n",
+ "T1=27.0+273.0 #Temperature in K\n",
+ "pm=60 #Maximum pressure in bar\n",
+ "h=2 #Heat transfered to air at constant volume is twice that at consmath.tant pressure\n",
+ "g=1.4 #Isentropic index\n",
+ "Cv=0.718 #specific heat at constant volume for air in kJ/kgK\n",
+ "Cp=1.005 #specific heat at constant pressure for air in kJ/kgK\n",
+ "R=0.287 #Real gas constant in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "T2=(T1*rc**(g-1)) #Temperature in K\n",
+ "p2=(p1*rc**g) #Pressure in bar\n",
+ "T3=(T2*(pm/p2)) #Temperature in K\n",
+ "T4=(Cv*(T3-T2))/(2*Cp)+T3 #Temperature in K\n",
+ "b=(T4/T3) #Cut-off ratio\n",
+ "T5=(T4*(b/rc)**(g-1)) #Temperature in K\n",
+ "p5=(p1*(T5/T1)) #Pressure in bar\n",
+ "Q1=(Cv*(T3-T2))+(Cp*(T4-T3))#Heat supplied per unit mass in kJ/kg\n",
+ "Q2=Cv*(T5-T1) #Heat rejected per unit mass in kJ/kg\n",
+ "W=(Q1-Q2) #Workdone in kJ/kg\n",
+ "n=(W/Q1)*100 #Air standard efficiency\n",
+ "Vs=((1*R*1000*T1)/(p1*10**5))*(1-1/rc) #Swept volume in m**3/kg\n",
+ "pmean=((W*1000)/Vs)/10.0**5 #Mean-effective pressure in bar\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The pressures and temperatures at the cardinal points of the cycle are \"\n",
+ "print\"T2 =\",round(T2,1),\" K \\np2 =\", round(p2,1),\" bar \\nT3 = \",round(T3,1), \"K \\np3 =\",round(p3,1),\"bar\"\n",
+ "print\"T4 =\",round(T4,1),\"K \\nT5 = \",round(T5,1), \"K \\np5 = \",round(p5,1),\"bar\"\n",
+ "print\"(b) The cycle efficiency is\",round(n,0),\"percent\" \n",
+ "print\"(c) The mean effective pressure of the cycle is \",round(pmean,1),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The pressures and temperatures at the cardinal points of the cycle are \n",
+ "T2 = 886.3 K \n",
+ "p2 = 44.3 bar \n",
+ "T3 = 1200.0 K \n",
+ "p3 = 52.2 bar\n",
+ "T4 = 1312.1 K \n",
+ "T5 = 460.3 K \n",
+ "p5 = 1.5 bar\n",
+ "(b) The cycle efficiency is 66.0 percent\n",
+ "(c) The mean effective pressure of the cycle is 2.8 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 Page No: 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "r=12.0 #Compression ratio\n",
+ "B=1.615 #Cut off ratio\n",
+ "p3=52.17 #Maximum pressure in bar\n",
+ "p4=p3 #Maximum pressure in bar\n",
+ "p1=1 #Initial pressure in bar\n",
+ "T1=(62+273) #Initial temperature in K\n",
+ "n=1.35 #Indices of compression and expansion\n",
+ "g=1.4 #Adiabatic exponent\n",
+ "mR=0.287 #Real gas constant in kJ/kgK\n",
+ "Cv=0.718 #specific heat at constant volume for air in kJ/kgK\n",
+ "Cp=1.005 #specific heat at constant pressure for air in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "T2=T1*r**(n-1) #The temperature at point 2 in K\n",
+ "p2=p1*(r)**n #The pressure at point 2 in bar\n",
+ "T3=T2*(p3/p2) #The temperature at point 3 in K\n",
+ "T4=T3*B #The temperature at point 4 in K\n",
+ "T5=T4*(B/r)**(n-1) #The temperature at point 5 in K\n",
+ "Q12=((g-n)/(g-1))*mR*((T1-T2)/(n-1)) # kJ/kg\n",
+ "Q23=Cv*(T3-T2) \n",
+ "Q34=Cp*(T4-T3) \n",
+ "Q45=((g-n)/(g-1))*mR*((T4-T5)/(n-1)) \n",
+ "Q51=Cv*(T1-T5) \n",
+ "Q1=Q23+Q34+Q45 \n",
+ "Q2=-Q12+(-Q51) \n",
+ "W=Q1-Q2 \n",
+ "E=(W/Q1)*100 \n",
+ "Vs=((mR*T1)/p1)*(r-1)/r # m**3/kg\n",
+ "pm=(W*1000/Vs)/10.0**3 #Mean effective pressure in bar\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)The temperature at cardinal points \\nT2 =\",round(T2,0),\" K\\nT3 = \",round(T3,0),\"K \\nT4 = \",round(T4,0),\"K \\nT5 = \",round(T5,0),\"K \" \n",
+ "print\"(b) The cycle efficiency = \",round(E,1),\" percent\"\n",
+ "print\"(c) The mean effective pressure of the cycle = \",round(pm,3),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The temperature at cardinal points \n",
+ "T2 = 799.0 K\n",
+ "T3 = 1456.0 K \n",
+ "T4 = 2352.0 K \n",
+ "T5 = 1166.0 K \n",
+ "(b) The cycle efficiency = 56.9 percent\n",
+ "(c) The mean effective pressure of the cycle = 9.638 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10 Page No: 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "p1=1.0 #Inlet pressure in bar\n",
+ "T1=27.0+273.0 #Temperature in K\n",
+ "p2=4.0 #pressure at point 2 in bar\n",
+ "p3=16.0 #Maximum pressure in bar\n",
+ "Cv=0.573 #specific heat at constant volume for gas in kJ/kgK\n",
+ "Cp=0.761 #specific heat at constant pressure for gas in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "g=(Cp/Cv) \n",
+ "T2=(T1*(p2/p1)**((g-1)/g)) # K\n",
+ "T3=(p3/p2)*T2 \n",
+ "T4=T3*(p1/p3)**((g-1)/g) \n",
+ "Q1=Cv*(T3-T2) #kJ/kg\n",
+ "Q2=Cp*(T4-T1) \n",
+ "W=Q1-Q2 \n",
+ "n=(W/Q1)*100 \n",
+ "r=(p2/p1)**(1/g)\n",
+ "R=(Cp-Cv) #kJ/kg.K\n",
+ "Vs=(R*1000*T1*(r-1))/(p1*10.0**5*r) #m**3/kg\n",
+ "pm=(W/(Vs*100.0)) \n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The work done per kg of gas is \",round(W,1),\"kJ/kg\"\n",
+ "print\"(b) The efficiency of the cycle is \",round(n,1),\"percent \"\n",
+ "print\"(c) Mean effective pressure is \",round(pm,1),\"bar\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The work done per kg of gas is 306.2 kJ/kg\n",
+ "(b) The efficiency of the cycle is 42.2 percent \n",
+ "(c) Mean effective pressure is 8.4 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/README.txt b/Fundamental_of_internal_combustion_engines/README.txt new file mode 100755 index 00000000..67ddb01f --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/README.txt @@ -0,0 +1,10 @@ +Contributed By: Tamanna Mittal +Course: others +College/Institute/Organization: NTPC +Department/Designation: commerce +Book Title: Fundamental of internal combustion engines +Author: H N Gupta +Publisher: Prentice Hall of India Pvt Ltd, New Delhi +Year of publication: 2006 +Isbn: 812032854X +Edition: 1st edition
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/chap10.ipynb b/Fundamental_of_internal_combustion_engines/chap10.ipynb new file mode 100755 index 00000000..880733d2 --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/chap10.ipynb @@ -0,0 +1,391 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10:CI Engines-Fuel Injection System"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1 page no: 332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "bsfc=0.3 #The brake specific fuel consumption in kg/kWh\n",
+ "bp=250 #The brake power in kW\n",
+ "N=1500 #Number of cycles per min in rpm\n",
+ "CA=15 #Crank angle in degrees\n",
+ "pi1=30 #The pressure of air in the cylinder at the beginning of the injection in bar\n",
+ "pi2=60 #The pressure of air in the cylinder at the end of the injection in bar\n",
+ "pf1=220 #The fuel injection pressure at the beginning in bar\n",
+ "pf2=550 #The fuel injection pressure at the end in bar\n",
+ "Cd=0.65 #The coefficient of discharge for the injector \n",
+ "df=850 #The density of the fuel in kg/m**3\n",
+ "p1=1.013 #The atmospheric pressure in bar\n",
+ "n=4.0 #The number of orifices used in the nozzle\n",
+ "x=6.0 #Number of cylinders\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "mf=bsfc*bp/60.0 \n",
+ "F=(mf/(N/2.0))*(1/x) \n",
+ "s=(CA/360.0)/(N/60.0) \n",
+ "mf1=F/s \n",
+ "p1=pf1-pi1 \n",
+ "p2=pf2-pi2\n",
+ "pa=(p1+p2)/2.0\n",
+ "Af=(mf1/(Cd*(2*df*pa*10.0**5)**(1/2.0)))*10**6\n",
+ "do=((Af/n)*(4/math.pi))**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"The nozzle area required per injection = \" ,round(Af,3),\"mm**2\"\n",
+ "print\"The diameter of the orifice = \",round(do,3), \"mm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nozzle area required per injection = 1.067 mm**2\n",
+ "The diameter of the orifice = 0.583 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2 page no: 333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "bp=30 #The brake power of the engine in kW\n",
+ "N=3000 #The engine speed in rpm \n",
+ "bsfc=0.28 #The brake specific fuel consumption in kg/kWh \n",
+ "Api=35 \n",
+ "p2=160 #The pressure at which fuel is injected in bar\n",
+ "CA=28 #The crank angle in degrees\n",
+ "p1=35 #The pressure in the combustion chamber in bar\n",
+ "Cv=0.92 #The coefficient of velocity \n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "S=141.5/(131.5+Api) \n",
+ "df=S*1000 \n",
+ "D=(CA/360.0)/(N/60.0)\n",
+ "F=(bsfc*bp)/((N/2.0)*60)\n",
+ "mf=F/D\n",
+ "Cf=Cv*((2*(p2-p1)*10**5)/df)**(1/2.0)\n",
+ "Af=(mf/(df*Cf))*10**6\n",
+ "d=(4*Af/math.pi)**(1/2.0) \n",
+ "\n",
+ "#Output\n",
+ "print\"The velocity of injection of the fuel = \",round(Cf,1),\"m/s \"\n",
+ "print\"The diameter of the fuel orifice = \",round(d,3),\" mm \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of injection of the fuel = 157.8 m/s \n",
+ "The diameter of the fuel orifice = 0.755 mm \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3 Page no 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=0.8*10**-3 #The diameter of an orifice in m\n",
+ "A=1.65*10**-6 #The cross sectional area in m**2\n",
+ "Cd=0.9 #The discharge coefficient of the orifice \n",
+ "Cp=0.85 #The coefficient of the passage\n",
+ "p1=170 #The injection pressure in bar\n",
+ "p2=25 #The compression pressure of the discharge in bar\n",
+ "df=850 #The density of the fuel in kg/m**3\n",
+ "\n",
+ "#Calculations\n",
+ "Q=((145/(22.931*10.0**9))**(1/2.0))*10**6 \n",
+ "p=170-(2.161*10**9*(Q/10.0**6)**2)\n",
+ "Cf=Cd*((2*(p-p2)*10**5)/df)**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"The discharge of fuel through the injector = \",round(Q,1),\"cm**2/s\" \n",
+ "print\"The jet velocity through the orifice = \",round(Cf,1),\" m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The discharge of fuel through the injector = 79.5 cm**2/s\n",
+ "The jet velocity through the orifice = 158.2 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.4 page no: 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "s=20 #Spray penetration in cm\n",
+ "t1=15.7 #The spray penetration of 20 cm in ms\n",
+ "pi1=150 #The injection pressure in bar\n",
+ "pi2=450.0 #The injection pressure to be used in bar\n",
+ "p2=15 #The combustion chamber pressure in bar\n",
+ "d1=0.34 #The diameter of the orifice in mm\n",
+ "s1=20 #The penetration for an orifice in cm\n",
+ "d2=0.17 #If the diameter of the orifice in cm\n",
+ "t11=12 #The spray penetration in ms\n",
+ "\n",
+ "#Calculations\n",
+ "t2=(t1*(pi1-p2)**(1/2.0))/(pi2-p2)**(1/2.0)\n",
+ "s2=d2*(s1/d1)\n",
+ "t21=t11*(d2/d1)\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The time required for the spray to penetrate = \",round(t2,3),\"ms\"\n",
+ "print\"(b) The spray penetration of the orifice = \",round(s2,3),\"cm\"\n",
+ "print\"The time required for the spray to penetrate = \",round(t21,3),\"ms\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The time required for the spray to penetrate = 8.746 ms\n",
+ "(b) The spray penetration of the orifice = 10.0 cm\n",
+ "The time required for the spray to penetrate = 6.0 ms\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.5 page no: 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "v=6.5 #The volume of fuel in the barrel in cc\n",
+ "d=0.3 #The dimeter of fuel pipe line in cm\n",
+ "l=65 #The length of the fuel pipe line in cm \n",
+ "vi=2.5 #The volume of fuel in the injection valve in cc\n",
+ "K=78.5*10**-6 #The coefficient of compressibility of the oil per bar\n",
+ "p1=1 #The atmospheric pressure in bar\n",
+ "p2=180 #The pressure due to pump in bar\n",
+ "v3=0.1 #The pump displacement necessary for the fuel in cc\n",
+ "e=0.75 #The effective stroke of the plunger in cm\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "V1=v+((math.pi*d**2)/4.0)*l+vi\n",
+ "V=K*V1*(p2-p1)\n",
+ "T=(V)+v3\n",
+ "L=T*(4/math.pi)*(1/(e**2))\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The total displacement of the plunger = \",round(T,3),\"cc\" \n",
+ "print\"(b) The effective stroke of the plunger = \",round(L,3),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The total displacement of the plunger = 0.291 cc\n",
+ "(b) The effective stroke of the plunger = 0.659 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.6 page no: 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "n=4.0 #Number of cylinders \n",
+ "N=2500 #The engine speed in rpm \n",
+ "P=90 #The power produced by the engine in kW\n",
+ "bsfc=0.28 #The brake specific fuel consumption in kg/kWh\n",
+ "v=3.5 #The volume of fuel in the barrel in cc\n",
+ "vp=2.5 #Volume of fuel in the pipe line in cc\n",
+ "vi=2.0 #The fuel inside the injector in cc\n",
+ "p1=280.0 #The average injection pressure in bar\n",
+ "p2=30.0 #The compression pressure of air during injection in bar\n",
+ "df=850.0 #The density of the fuel in kg/m**3\n",
+ "K=80*10**-6 #The coefficient of compressibility of fuel per bar\n",
+ "pi=1.0 #The pressure with which fuel enter into the barrel in bar\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "F=(bsfc*P)/((N/2.0)*60)\n",
+ "F1=F/n\n",
+ "Vf=(F1/df)*10**6\n",
+ "V1=v+vp+vi\n",
+ "V=K*V1*(p1-math.pi)\n",
+ "Vp=Vf+V\n",
+ "W=((1/2.0)*(p1-math.pi)*10**5*V*10**-6)+((p1-p2)*10**5*Vf*10**-6)\n",
+ "P1=(W*N)/(2*60*1000) #Power lost per cylinder in kW\n",
+ "P2=P1*4 #Total power lost for pumping the fuel in kW\n",
+ "\n",
+ "#Output \n",
+ "print\"The displacement volume of one plunger per cycle = \",round(Vp,3),\"cc\" \n",
+ "print\"Total power lost for pumping the fuel = \",round(P2,3),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The displacement volume of one plunger per cycle = 0.276 cc\n",
+ "Total power lost for pumping the fuel = 0.41 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.7 page no: 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "v1=0.3 #Velocity of the pump plunger in m/s\n",
+ "l=0.575 #The length of the fuel pipe in m\n",
+ "A=1/20.0 #The cross sectional area of pipe to the plunger cylinder\n",
+ "a=1/40.0 #The area of nozzle hole to the pipe \n",
+ "p1=27.6 #Initial pressure in the line in bar \n",
+ "p2=27.6 #The compression pressure of the engine\n",
+ "K=17830*10**5 #The bulk modulus of fuel in N/m**2\n",
+ "df=860.0 #The density of the fuel in kg/m**3\n",
+ "\n",
+ "#Calculations\n",
+ "Vs=(K/df)**(1/2.0)\n",
+ "t=l/Vs\n",
+ "Vp=(1/A)*v1\n",
+ "p=((K/Vs)*Vp)/10.0**5\n",
+ "pi=p+p1\n",
+ "po=p1+p\n",
+ "vc=Vp-(a*((2*(po-p2))/df)**(1/2.0))\n",
+ "pr=26.8 #By trial , Pressure\n",
+ "Vc=pr*(Vs/(K/10.0**5))\n",
+ "po1=p1+p+pr\n",
+ "vo=a*((2*(po1-p2)*10**5)/df)**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)The velocity of the pressure disturbance = \",round(Vs,0),\"m/s\"\n",
+ "print\"(b) The time taken by the disturbance to travel through the pipe line = \",round(t,4),\" s\" \n",
+ "print\"(c) The velocity at the pump end of the pipe line as the plunger moves = \",round(Vp,2),\" m/s\"\n",
+ "print\"The pressure at the pump end of pipe line as the plunger moves = \",round(pi,2),\"bar\"\n",
+ "print\"(d)The magnitude of the first reflected pressure = \",round(pr,2),\"bar\" \n",
+ "print\"The magnitude of the first reflected velocity wave =\",round(Vc,2),\"m/s\" \n",
+ "print\"(e)The pressure at the oriface end of the pipe line after the first reflection = \",round(po1,1),\"bar\"\n",
+ "print\"The velocity at the oriface end of the pipe line after the first reflection = \",round(vo,2),\" m/s \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The velocity of the pressure disturbance = 1440.0 m/s\n",
+ "(b) The time taken by the disturbance to travel through the pipe line = 0.0004 s\n",
+ "(c) The velocity at the pump end of the pipe line as the plunger moves = 6.0 m/s\n",
+ "The pressure at the pump end of pipe line as the plunger moves = 101.9 bar\n",
+ "(d)The magnitude of the first reflected pressure = 26.8 bar\n",
+ "The magnitude of the first reflected velocity wave = 2.16 m/s\n",
+ "(e)The pressure at the oriface end of the pipe line after the first reflection = 128.7 bar\n",
+ "The velocity at the oriface end of the pipe line after the first reflection = 3.83 m/s \n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/chap11.ipynb b/Fundamental_of_internal_combustion_engines/chap11.ipynb new file mode 100755 index 00000000..4d28299a --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/chap11.ipynb @@ -0,0 +1,337 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11:Two Stroke Engines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.1 page no:367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "nsc=75 #The scavenging efficiency of the two stroke engine in percent \n",
+ "ns=20 #The scavenging efficiency is increased by in percent\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Rsc=math.log(1/(1-(nsc/100.0)))\n",
+ "nsc1=(nsc/100.0)+((nsc/100.0)*(ns/100.0))\n",
+ "Rsc1=math.log(1/(1-(nsc1)))\n",
+ "Rscr=((Rsc1-Rsc)/Rsc)*100 #Percentage increase in scavenging ratio in persent\n",
+ "\n",
+ "#Output\n",
+ "print\"The percentage change in the scavenging ratio = \",round(Rscr,1),\"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the scavenging ratio = 66.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.2 page no:367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=0.12 #The bore diameter of the engine in m\n",
+ "l=0.15 #The stroke length of the engine in m\n",
+ "r=16.0 #The compression ratio \n",
+ "N=2000.0 #The speed of the engine in rpm\n",
+ "mf=(240/60.0) #Actual air flow per min in kg/min\n",
+ "T=300.0 #Air inlet temperature in K\n",
+ "p=1.025 #Exhaust pressure in bar\n",
+ "R=287 #Real gas constant in J/kg\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "da=(p*10**5)/(R*T)\n",
+ "Vs=((math.pi)*(d**2)*l)/4.0\n",
+ "V=(r/(r-1))*Vs\n",
+ "m=da*V\n",
+ "m1=m*N\n",
+ "Rsc=mf/m1 #Scavenging ratio\n",
+ "nsc=((1-math.exp(-Rsc))*100)\n",
+ "ntr=((nsc/100.0)/Rsc)*100\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The scavenging ratio = \",round(Rsc,2)\n",
+ "print\"(b) The scavenging efficiency = \",round(nsc,1),\"percent \"\n",
+ "print\"(c) The trapping efficiency = \",round(ntr,1),\" percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The scavenging ratio = 0.93\n",
+ "(b) The scavenging efficiency = 60.5 percent \n",
+ "(c) The trapping efficiency = 65.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.3 page no: 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "mf=6.5 #Mass flow rate of fuel in kg/h\n",
+ "N=3000.0 #The speed of the engine in rpm\n",
+ "a=15 #The air fuel ratio\n",
+ "CV=44000 #The calorific value of the fuel in kJ/kg\n",
+ "pm=9 #The mean piston speed in m/s\n",
+ "pmi=4.8 #The mean pressure in bar\n",
+ "nsc=85 #The scavenging efficiency in percent\n",
+ "nm=80 #The mechanical efficiency in percent\n",
+ "R=290.0 #Real gas constant in J/kgK\n",
+ "p=1.03 #The pressure of the mixture in bar\n",
+ "T=288.0 #The temperature of the mixture in K\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "ma=a*mf\n",
+ "L=((pm*60)/(2*N))*100\n",
+ "mac=mf+ma\n",
+ "mi=(mac)/(nsc/100.0)\n",
+ "da=(p*10**5)/(R*T)\n",
+ "d=(((mi/da)*(4/math.pi)*(1/(L/100.0))*(1/(60*N)))**(1/2.0))*100\n",
+ "ip=(pmi*10**5*(L/100)*((math.pi/4.0)*(d/100)**2)*N)/(60*1000)\n",
+ "bp=ip*(nm/100.0)\n",
+ "nth=(bp/((mf/3600.0)*CV))*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The diameter of the bore = \",round(d,2),\"cm\"\n",
+ "print\"The length of the stroke = \",L,\" cm\" \n",
+ "print\"The brake power = \",round(bp,2),\" kW\"\n",
+ "print\"The brake thermal efficiency =\",round(nth,2),\" percent \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diameter of the bore = 8.83 cm\n",
+ "The length of the stroke = 9.0 cm\n",
+ "The brake power = 10.58 kW\n",
+ "The brake thermal efficiency = 13.32 percent \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.4 page no: 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=0.08 #The diameter of the bore in m\n",
+ "L=0.1 #The length of the stroke in m\n",
+ "r=8.0 #The compression ratio \n",
+ "o=60.0 #The exhaust port open before BDC in degrees\n",
+ "v=60.0 #The exhaust port closes after BDC in degrees\n",
+ "a=15.0 #Air fuel ratio \n",
+ "T=300.0 #The temperature of the mixture entering into the engine in K\n",
+ "p=1.05 #The pressure in the cylinder at the time of clomath.sing\n",
+ "R=290.0 #Real gas constant in J/kgK\n",
+ "ma=150.0 #Mass flow rate of air in kg/h\n",
+ "N=4000.0 #The speed of the engine in rpm\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "mf=ma/a\n",
+ "mac=ma+mf\n",
+ "r=(L*100)/2.0\n",
+ "Le=(r+(r*math.sin (math.pi/6.0)))/100.0\n",
+ "Vse=(math.pi*d**2*Le)/4.0\n",
+ "V=(r/(r-1))*Vse\n",
+ "V=0.00043 #Value in book after approximation\n",
+ "da=(p*10**5)/(R*T)\n",
+ "m=V*da\n",
+ "mi=m*60*N\n",
+ "Rsc=mac/mi \n",
+ "nsc=(1-(exp(-Rsc)))*100\n",
+ "ntr=nsc/Rsc\n",
+ "\n",
+ "#Output\n",
+ "print\"The scavenging ratio = \",round(Rsc,2)\n",
+ "print\"The scavenging efficiency =\",round(nsc,2),\" percent \"\n",
+ "print\"The trapping efficiency = \",round(ntr,2),\"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The scavenging ratio = 1.28\n",
+ "The scavenging efficiency = 72.32 percent \n",
+ "The trapping efficiency = 56.3 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.5 page no: 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=8.25 #The diameter of the bore in cm\n",
+ "L=11.25 #The length of the stroke in cm\n",
+ "r=8.0 #The compression ratio \n",
+ "N=2500.0 #The speed of the engine in rpm\n",
+ "ip=17.0 #Indicated power in kW\n",
+ "a=0.08 #Fuel air ratio \n",
+ "T=345.0 #Inlet temperature mixture in K\n",
+ "p=1.02 #Exhaust pressure in bar\n",
+ "CV=44000.0 #The calorific value of the fuel in kJ/kg\n",
+ "nth=0.29 #Indicated thermal efficiency\n",
+ "M=114.0 #Molar mass of fuel \n",
+ "R=8314.0 #Universal Gas constant in J/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Vs=(math.pi*d**2*L)/4 #Displacement volume in cm**3\n",
+ "V=(r/(r-1))*Vs #Total cylinder volume in m**3\n",
+ "ps=((29*p*10**5)/(R*T))*(1/(1+a*(29/M))) #The density of dry air in kg/m**3\n",
+ "nsc=((ip*1000)/((N/60)*V*10**-6*ps*a*CV*1000*nth))*100 #The scavenging efficiency in percent\n",
+ "\n",
+ "#Output\n",
+ "print\"The scavenging efficiency = \",round(nsc,2),\" percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The scavenging efficiency = 57.54 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.6 page no: 372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "S=15.0 #The speed of the math.piston in m/s\n",
+ "ps=0.35 #The scavenging pressure in bar\n",
+ "pa=1.03 #Atmospheric pressure in bar\n",
+ "r=18.0 #The compression ratio \n",
+ "t=35.0 #The inlet temperature in degree centigrade\n",
+ "Rsc=0.9 #The scavenging ratio \n",
+ "ta=15.0 #The atmospheric temperature in degree centigrade\n",
+ "nc=0.75 #Compressor efficiency \n",
+ "g=1.4 #Adiabatic index\n",
+ "R=287.0 #Real gas constant in J/kgK\n",
+ "Cp=1005.0 #Specific heat of gas in J/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "pi=ps+pa #The scavenging pressure in bar\n",
+ "Ti=(273+ta)+t #The inlet temperature in K\n",
+ "pr=pa/math.pi #The ratio of the pressure for calculations\n",
+ "di=(pi*10**5)/(R*Ti) #The density in kg/m**3\n",
+ "ai=(g*R*Ti)**(1/2.0) #The sonic velocity in m/s\n",
+ "C=(Rsc)/(2*((r-1)/r)*(ai/S)*(pi/pa)*((2/(g-1))*(((pr)**(2/g))-((pr)**((g+1)/g))))**(1/2.0))\n",
+ "ds=(pa*10**5)/(R*Ti) #The density in kg/m**3\n",
+ "mep=(ds*Rsc*Cp*Ti*(((pi/pa)**((g-1)/g))-1))/((nc*((r-1)/r))*10**5) #Mean effective pressure in bar\n",
+ "\n",
+ "#Output\n",
+ "print\"The flow coefficient = \",round(C,3) \n",
+ "print\"The compressor mean effective pressure = \",round(mep,1),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flow coefficient = 0.028\n",
+ "The compressor mean effective pressure = 0.4 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/chap15.ipynb b/Fundamental_of_internal_combustion_engines/chap15.ipynb new file mode 100755 index 00000000..8df611a8 --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/chap15.ipynb @@ -0,0 +1,434 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter15:Air Capacity and SuperCharging"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.1 page no: 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "Vs=0.0028 #Swept volume in m**3\n",
+ "N=3000 #Speed of the engine in rpm\n",
+ "ip=12.5 #The average indicated power developed in kW/m**3\n",
+ "nv=85 #Volumetric efficiency in percent\n",
+ "p1=1.013 #The atmospheric pressure in bar\n",
+ "T1=288 #The atmospheric temperature in K\n",
+ "ni=74 #Isentropic efficiency in percent\n",
+ "pr=1.6 #The pressure ratio\n",
+ "nm=78 #All mechanical efficiencies in percent\n",
+ "g=1.4 #Adiabatic index\n",
+ "R=287 #Real gas constant in J/kgK\n",
+ "Cp=1.005 #The specific heat of gas in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "Vs1=(Vs*(N/2.0)) #Volume swept by the piston per minute in m**3/min\n",
+ "Vi=(nv/100.0)*Vs1 #Unsupercharged induced volume in m**3/min\n",
+ "p2=pr*p1 #Blower delivery pressure in bar\n",
+ "T21=T1*(p2/p1)**((g-1)/g) #Temperature after isentropic compression in K\n",
+ "T2=T1+((T21-T1)/((ni/100.0))) #Blower delivery temperature in K\n",
+ "Ve=(Vs1*p2*T1)/(T2*p1) #Equivalent volume at 1.013 bar and 15 degree centigrade in m**3/min\n",
+ "nv1=(Ve/Vs1)*100 #Volumetric efficiency of supercharged engine in percent\n",
+ "Vii=Ve-Vi #Increase in induced volume in m**3/min\n",
+ "ipa=ip*Vii #Increase in ip from air induced in kW\n",
+ "ipi=((p2-p1)*10**5*Vs1)/(60*1000) #Increase in ip due to increased induction pressure in kW\n",
+ "ipt=ipa+ipi #Total increase in ip in kW\n",
+ "bp=ipt*(nm/100.0) #Increase in engine bp in kW\n",
+ "ma=(p2*(Vs1/60.0)*10**5)/(R*T2) #Mass of air delivered per second by blower in kg/s\n",
+ "P=ma*Cp*(T2-T1) #Power input to blower in kW\n",
+ "Pd=P/(nm/100.0) #Power required to drive the blower in kW\n",
+ "bpn=bp-Pd #Net increase in bp in kW\n",
+ "bpu=ip*Vi*(80/100.0) #The bp of unsupercharged engine in kW\n",
+ "bpp=(bpn/(bpu))*100 #Percentage increase in bp in percent\n",
+ "\n",
+ "#Output\n",
+ "print\"The volumetric efficiency of supercharged engine = \",round(nv1,0),\"percent\"\n",
+ "print\"The increase in brake power by supercharging = \",round(bpn,1),\" kW \"\n",
+ "print\"The percentage increase in brake power = \",round(bpp,1),\" percent \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volumetric efficiency of supercharged engine = 134.0 percent\n",
+ "The increase in brake power by supercharging = 15.1 kW \n",
+ "The percentage increase in brake power = 42.3 percent \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.2 page no: 477"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "p=1.013 #The pressure at the sea level in bar\n",
+ "T=283 #The temperature at the sea level in K\n",
+ "bp=275.0 #Brake power in kW\n",
+ "N=1800.0 #The speed of the engine in rpm\n",
+ "a=20 #Air fuel ratio \n",
+ "R=287 #The real gas constant in J/kgK\n",
+ "bsfc=0.24 #Brake specific fuel consumption in kg/kWh\n",
+ "nv=80 #Volumetric efficiency in percent\n",
+ "p2=0.75 #The atmospheric pressure at altitude in bar\n",
+ "P=9 #The power consumed by supercharger of the total power produced by the engine in percent\n",
+ "T2=303 #The temperature of air leaving the supercharger in K\n",
+ "\n",
+ "#Calculations\n",
+ "mf=(bsfc*bp)/60.0 \n",
+ "ma1=mf*a \n",
+ "ma=(2/N)*ma1 \n",
+ "dai=(p*10**5)/(R*T) \n",
+ "Vd=(ma/(dai*(nv/100.0))) \n",
+ "pmb=(bp*2*60*1000)/(Vd*N*10**5) \n",
+ "GP=bp/(1-0.09) \n",
+ "ma2=(ma1/bp)*GP \n",
+ "ma1=(ma2*2)/N \n",
+ "p21=((R*T2*ma1)/((nv/100.0)*Vd))/10.0**5 \n",
+ "pi=p21-p2 \n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The engine capacity Vd = \",round(Vd,3),\"m**3\" \n",
+ "print\"The bmep of the unsupercharged engine = \",round(pmb,3),\"bar\" \n",
+ "print\"(b) Increase in air pressure required in the supercharged = \",round(pi,3),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The engine capacity Vd = 0.024 m**3\n",
+ "The bmep of the unsupercharged engine = 7.483 bar\n",
+ "(b) Increase in air pressure required in the supercharged = 0.442 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.3 page no: 479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "Vs=0.003 #Swept volume in m**3\n",
+ "bmep=9 #Brake mean effective pressure in bar\n",
+ "N=4000 #The speed of the engine in rpm\n",
+ "ni=30.0 #Indicated thermal efficiency in percent\n",
+ "nm=90 #Mechanical efficiency in percent\n",
+ "bmep1=12 #The brake mean effective pressure of other engine in bar\n",
+ "N1=4000 #The speed of other engine in rpm\n",
+ "ni1=25 #The indicated thermal efficiency of other engine in percent\n",
+ "nm1=91 #The mechanical efficiency of other engine in percent\n",
+ "m=200 #The mass of naturally aspired engine in kg\n",
+ "m1=220 #The mass of supercharged engine in kg\n",
+ "CV=44000 #The calorific value of the fuel in kJ/kg\n",
+ "\n",
+ "#Calculations\n",
+ "bp=(bmep*10**5*Vs*N)/(2.0*60.0*1000) \n",
+ "ip=bp/(nm/100.0) \n",
+ "mf=(ip)/((ni/100.0)*CV) \n",
+ "bp1=(bmep1*10**5*Vs*N1)/(2.0*60.0*1000) \n",
+ "ip1=bp1/(nm1/100.0) \n",
+ "mf1=ip1/((ni1/100.0)*CV) \n",
+ "mf2=mf*3600 \n",
+ "mf3=mf1*3600 \n",
+ "x=((200/90.0)-(220/120.0))/((43.2/120.0)-(27.27/90.0)) \n",
+ "\n",
+ "#Output\n",
+ "print\"The maximum hours required for supply of sufficient fuel = \",round(x,3),\"hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum hours required for supply of sufficient fuel = 6.823 hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.4 Page no 480"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=0.1 #The diameter of the bore in m\n",
+ "L=0.12 #The length of the stroke in m\n",
+ "N=3000 #The speed of the engine in rpm\n",
+ "n=4 #Number of cylinders\n",
+ "R=287 #Real gas constant in J/kgK\n",
+ "t=120 #Output Torque in Nm\n",
+ "nm=85 #The mechanical efficiency of the engine in percent\n",
+ "T1=288 #The inlet temperature of air into compressor in K\n",
+ "p1=1 #The inlet pressure of air into compressor in bar\n",
+ "Q=1200 #Heat rejected rate in kJ/min\n",
+ "T=328 #The outlet temperature of air in K\n",
+ "p=1.7 #The outlet pressure of air in bar\n",
+ "nv=90 #Volumetric efficiency in percent\n",
+ "Cp=1.005 #Specific heat of gas in kJ/kg\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "bp=(2*math.pi*N*t)/(60.0*1000.0) #The brake power in kW\n",
+ "ip=bp/(nm/100.0) #The indicated power in kW\n",
+ "pmi=((ip*2*60*1000*4)/(L*(math.pi*d**2)*N*n))/10.0**5 #The mean effective pressure in bar\n",
+ "Vs=(math.pi/4.0)*d**2*L #Swept volume in m**3\n",
+ "Vs1=Vs*(N/2.0)*n #Volume swept by the piston per min \n",
+ "V1=(nv/100.0)*Vs1 #Rate of volume flow of air into the engine in m**3/min\n",
+ "me=((p*10**5*V1)/(R*T))*60 #Rate of mass flow of air into the engine in kg/h\n",
+ "E=Q/60.0 #Energy balance in the after cooling in kJ/s\n",
+ "T2=((bp/E)*T-T1)/((bp/E)-1) #The outlet temperature of air in K\n",
+ "mc=((bp)/(Cp*(T2-T1)))*3600 #Mass flow rate in kg/h\n",
+ "maf=mc-me #Rate of air flow available to the consumer in kg/h\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The imep of the supercharged engine = \",round(pmi,3),\"bar\"\n",
+ "print\"(b) The rate of air consumed by the engine = \",round(me,1),\"kg/h\" \n",
+ "print\"(c) The rate of air flow available to the consumer = \",round(maf,1),\"kg/h\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The imep of the supercharged engine = 4.706 bar\n",
+ "(b) The rate of air consumed by the engine = 551.5 kg/h\n",
+ "(c) The rate of air flow available to the consumer = 1033.5 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.5 page no: 482"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "Vs=0.0045 #Swept volume in m**3\n",
+ "N=4000.0 #The speed of the engine in rpm \n",
+ "nv=150.0 #Overall volumetric efficiency in percent\n",
+ "ni=90.0 #Isentropic efficiency of the compressor in percent\n",
+ "nm=85.0 #Mechanical efficiency in percent\n",
+ "T=330.0 #The temperature of compressed air after cooler in K\n",
+ "p2=1.8 #The pressure of the compressed air in bar\n",
+ "T1=290.0 #The ambient temperature of air in K\n",
+ "p1=1.0 #The pressure of the ambient condition in bar\n",
+ "R=287.0 #The real gas constant in J/kgK\n",
+ "g=1.4 #Adiabatic index\n",
+ "Cp=1.005 #The specific heat of gas in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "T21=T1*(p2/p1)**((g-1)/g) \n",
+ "T2=T1+((T21-T1)/(ni/100.0)) \n",
+ "Vs1=Vs*(N/(2*60)) # m**3/s\n",
+ "Va=(nv/100)*Vs1 \n",
+ "d=(p1*10**5)/(R*T1) # kg/m**3\n",
+ "ma=d*Va # kg/s\n",
+ "Q=ma*Cp*(T2-T) # kJ/s\n",
+ "P=ma*Cp*(T2-T1) # kW\n",
+ "Pa=P/(nm/100.0) \n",
+ "\n",
+ "#Output\n",
+ "print \"(a) The rate of heat rejected from the engine after cooler = \",round(Q,2),\"kJ/s\" \n",
+ "print\"(b) The power absorbed by the supercharger from the engine = \",round(Pa,1),\"kW\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The rate of heat rejected from the engine after cooler = 5.14 kJ/s\n",
+ "(b) The power absorbed by the supercharger from the engine = 18.8 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.6 page no: 483"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "p1=0.98 #The inlet pressure of air in bar\n",
+ "T1=290.0 #The inlet temperature of air in K\n",
+ "p2=1.8 #The pressure of air delivered to the engine in bar\n",
+ "a=20.0 #The air fuel ratio \n",
+ "T3=850.0 #The temperature of the exhaust gases leaving the engine in K\n",
+ "p3=1.6 #The pressure of the exhaust gases leaving the engine in bar\n",
+ "p4=1.03 #The turbine exhaust pressure in bar\n",
+ "nc=80.0 #The isentropic efficiency of compressor in percent\n",
+ "nt=85.0 #The isentropic efficiency of turbine in percent\n",
+ "Cpa=1.005 #The specific heat of air in kJ/kgK\n",
+ "Cpg=1.15 #The specific heat of gas in kJ/kgK\n",
+ "g=1.33 #isentropic index\n",
+ "h=1.0 #Adiabatic index\n",
+ "\n",
+ "#Calculations\n",
+ "T21=T1*(p2/p1)**(0.286) #value taken in book (g-1/g)=0.286 \n",
+ "T2=T1+((T21-T1)/(nc/100.0)) \n",
+ "T22=T2-273 \n",
+ "T41=T3*(p4/p3)**((g-1)/g) \n",
+ "T4=T3-((nt/100.0)*(T3-T41)) \n",
+ "T44=T4-273 \n",
+ "mf=1.0 # kg/s\n",
+ "ma=mf*a # kg/s\n",
+ "Wc=ma*Cpa*(T2-T1) # kW\n",
+ "mg=ma+mf #Mass flow rate of gas in kg/s\n",
+ "Wt=mg*Cpg*(T3-T4) \n",
+ "Pt=(Wc/Wt)*100 \n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The temperature of the air leaving the compressor = \",round(T22,0),\"degree centigrade\" \n",
+ "print\"(b) The temperature of gases leaving the turbine = \",round(T44,0),\"degree centigrade\" \n",
+ "print\"(c) The mechanical power used to run the turbocharger = \",round(Pt,1),\"percent\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The temperature of the air leaving the compressor = 86.0 degree centigrade\n",
+ "(b) The temperature of gases leaving the turbine = 502.0 degree centigrade\n",
+ "(c) The mechanical power used to run the turbocharger = 76.6 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.7 page no: 485"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "a=14.0 #Air fuel ratio \n",
+ "T1=288 #The ambient temperature of air in K\n",
+ "T2=(288-23) #The evaporation of fuel cause 23 degree C drop in mixture temperature in K\n",
+ "p=1.3 #Pressure ratio \n",
+ "nc=75 #The isentropic efficiency of the compressor in percent\n",
+ "Cpm=1.05 #The specific heat of the mixture in kJ/kgK\n",
+ "Cpa=1.005 #The specific heat of air in kJ/kgK\n",
+ "g=1.33 #Adiabatic index\n",
+ "h=1.4 #Isentropic index\n",
+ "ma=1 #Mass flow rate of air in kg/s\n",
+ "\n",
+ "#Calculations\n",
+ "T31=T2*p**((g-1)/g) \n",
+ "T3=T2+((T31-T2)/(nc/100.0))\n",
+ "mm=1+(1/a)\n",
+ "Wc1=mm*Cpm*(T3-T2)\n",
+ "T21=T1*p**((h-1)/h)\n",
+ "T4=T1+((T21-T1)/(nc/100.0))\n",
+ "T4_=317 #approx value taken in book of T4=317\n",
+ "Wc2=ma*Cpa*(T4_-T1) \n",
+ "T5=T4-23\n",
+ "Ps=((Wc2-round(Wc1,0))*100)/Wc2\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The power required by the compressor before the supercharger = \",round(Wc1,0),\"kW/kg of air per second\"\n",
+ "print\"(b) The power required by the compressor after the supercharger = \",round(Wc2,1),\"kW/kg of air per second\" \n",
+ "print\"Percentage of turbine power used to run the compressor = \",round(Ps,3),\"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The power required by the compressor before the supercharger = 27.0 kW/kg of air per second\n",
+ "(b) The power required by the compressor after the supercharger = 29.1 kW/kg of air per second\n",
+ "Percentage of turbine power used to run the compressor = 7.36 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/chap16.ipynb b/Fundamental_of_internal_combustion_engines/chap16.ipynb new file mode 100755 index 00000000..158b33df --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/chap16.ipynb @@ -0,0 +1,874 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter16:Engine Testing and Performance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.1 page no: 519"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "N=3000 #The speed of the engine in rpm \n",
+ "r=9 #Compression ratio \n",
+ "l=17.2 #The length of the connecting rod in cm\n",
+ "t=20 #The combustion ends at a TDC in degrees\n",
+ "k=3 #Three litre spark engine\n",
+ "n=6.0 #V-6 Engine\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Vs=(k/n)*10**-3\n",
+ "d=(((Vs*4)/math.pi)**(1/3.0))\n",
+ "L=d*100\n",
+ "up=2*d*N/60.0\n",
+ "Vc=(Vs/(r-1))*10**6\n",
+ "cr=L/2.0\n",
+ "R=l/cr\n",
+ "up1=up*((math.pi/2.0)*math.sin(math.pi/9.0)*(1+(math.cos(math.pi/9.0)/(R**2-(math.sin(math.pi/9.0)**2))**(1/2.0))))\n",
+ "s=(cr*math.cos(math.pi/9.0))+(l**2-(cr**2)*(math.sin(math.pi/9.0))**2)**(1/2.0)\n",
+ "x=l+cr-s\n",
+ "V=Vc+(math.pi/4.0)*(d*100)**2*x\n",
+ "\n",
+ "#Output \n",
+ "print\"(a)The cylinder bore and The stroke length (d = L) = \",round(L,2),\"cm\"\n",
+ "print\"(b) The average piston speed = \",round(up,2),\"m/s\"\n",
+ "print\"(c) The clearence volume of one cylinder = \",round(Vc,2),\"cm**3\"\n",
+ "print\"(d) The piston speed at the end of combustion = \",round(up1,2),\"m/s\"\n",
+ "print\"(e) The distance the piston travels from TDC at the end of combustion = \",round(x,2),\"cm\" \n",
+ "print\"(f) Instantaneous volume = \",round(V,2),\"cm**3\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The cylinder bore and The stroke length (d = L) = 8.6 cm\n",
+ "(b) The average piston speed = 8.6 m/s\n",
+ "(c) The clearence volume of one cylinder = 62.5 cm**3\n",
+ "(d) The piston speed at the end of combustion = 5.71 m/s\n",
+ "(e) The distance the piston travels from TDC at the end of combustion = 0.32 cm\n",
+ "(f) Instantaneous volume = 81.24 cm**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.2 page no: 521"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=0.175 #The diameter of the bore in m\n",
+ "L=0.32 #The length of the stroke in m\n",
+ "p=6.5 #Mean effective pressure in bar\n",
+ "pp=0.4 #Pumping loop mean effective pressure in bar\n",
+ "N=510.0 #The speed of the engine in rpm\n",
+ "pm=0.65 #Diagrams from the dead cycle give a mep in bar\n",
+ "n=55.0 #Firing strokes per minute \n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "pmi=p-pp \n",
+ "c=((N/2.0)-n) \n",
+ "ipw=pmi*10**5*L*(math.pi/4.0)*d**2*(n/60.0)*(1/1000.0) \n",
+ "Pp=pm*10**5*L*(math.pi/4.0)*d**2*(c/60.0)*(1/1000.0) \n",
+ "fp=ipw-Pp #Power in kW\n",
+ "fip=pmi*10**5*L*(math.pi/4.0)*d**2*(N/(2*60))*(1/1000.0)\n",
+ "fbp=fip-fp\n",
+ "nm=(fbp/fip)*100\n",
+ "\n",
+ "#Output \n",
+ "print\" The full load break power = \",round(fbp,2),\"kW\" \n",
+ "print\"The mechanical efficiency of the engine = \",round(nm,2),\"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The full load break power = 17.32 kW\n",
+ "The mechanical efficiency of the engine = 86.79 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.3 page no: 522"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=0.09 #The diameter of the bore in m\n",
+ "L=0.1 #The length of the stroke in m\n",
+ "T=120 #The torque measured in Nm\n",
+ "n=4 #Number of cylinders \n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "pmb=((4*math.pi*T)/(L*(math.pi/4)*d**2*n))/10.0**5\n",
+ "\n",
+ "#Output \n",
+ "print\"The brake mean effective pressure = \",round(pmb,2),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The brake mean effective pressure = 5.93 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.4 page no: 522"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=0.06 #The diameter of the bore in m \n",
+ "L=0.085 #The length of the stroke in m\n",
+ "N=3000 #The speed of the engine in rpm\n",
+ "r=0.35 #Torque arm radius in m\n",
+ "W=160 #Weight in N\n",
+ "f=6.6 #Fuel consumption in l/h\n",
+ "g=0.78 #specific gravity of the fuel \n",
+ "CV=44000 #The calorific value of the fuel in kJ/kg\n",
+ "w1=114 #Brake load for cylinder 1 in N\n",
+ "w2=110 #Brake load for cylinder 2 in N\n",
+ "w3=112 #Brake load for cylinder 3 in N\n",
+ "w4=116 #Brake load for cylinder 4 in N\n",
+ "n=4 #Number of cylinders\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Vf=(f*10**-3)/3600.0\n",
+ "df=g*1000\n",
+ "mf=df*Vf\n",
+ "T=W*r\n",
+ "bp=(2*math.pi*N*T)/(60.0*1000.0)\n",
+ "pmb=((120*bp*1000)/(L*(math.pi/4.0)*d**2*N*n))/10.0**5\n",
+ "nb=((bp)/(mf*CV))*100\n",
+ "bsfc=(mf*3600)/bp\n",
+ "bp1=((2*math.pi*N*w1*r)/(60.0*1000.0))\n",
+ "ip1=bp-bp1 \n",
+ "ip2=bp-((2*math.pi*N*w2*r)/(60*1000))\n",
+ "ip3=bp-((2*math.pi*N*w3*r)/(60*1000))\n",
+ "ip4=bp-((2*math.pi*N*w4*r)/(60*1000))\n",
+ "ip=ip1+ip2+ip3+ip4\n",
+ "nm=(bp/ip)*100\n",
+ "pmi=pmb/(nm/100.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"The brake power =\",round(bp,3),\"kW \" \n",
+ "print\"The brake mean effective pressure = \",round(pmb,3),\"bar\"\n",
+ "print\"The brake thermal efficiency =\" ,round(nb,0),\"percent\"\n",
+ "print\"The brake specific fuel consumption = \",round(bsfc,3),\"kg/kWh\"\n",
+ "print\"The indicated power = \",round(ip,2),\"kW \"\n",
+ "print\"The mechanical efficiency =\", round(nm,1),\"percent \" \n",
+ "print\"The indicated mean effective pressure = \",round(pmi,1),\"bar\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The brake power = 17.593 kW \n",
+ "The brake mean effective pressure = 7.32 bar\n",
+ "The brake thermal efficiency = 28.0 percent\n",
+ "The brake specific fuel consumption = 0.293 kg/kWh\n",
+ "The indicated power = 20.67 kW \n",
+ "The mechanical efficiency = 85.1 percent \n",
+ "The indicated mean effective pressure = 8.6 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.5 page no: 523"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=0.15 #The diameter of the bore in m\n",
+ "L=0.16 #The length of the stroke in m\n",
+ "N=500 #The speed of the engine in rpm\n",
+ "mf=0.0475 #Fuel consumption in kg/min\n",
+ "CV=42000 #The calorific value in kJ/kg\n",
+ "w=400 #The tension on either side of the pulley in N\n",
+ "c=2.2 #Brake circumference in m\n",
+ "l=50 #Length of the indicator diagram in mm\n",
+ "ap=475 #Area of the positive loop of indicator diagram in mm**2\n",
+ "an=25 #Area of the negative loop of indicator diagram in mm**2\n",
+ "s=0.8333 #Spring constant in bar/mm\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "r=c/(2.0*math.pi)\n",
+ "T=w*r\n",
+ "bp=(2*math.pi*N*T)/(60.0*1000.0)\n",
+ "M=(ap-an)/l\n",
+ "imep=M*s\n",
+ "ip=(imep*10**5*L*(math.pi/4.0)*d**2*(N/(2.0*60.0))*(1/1000.0))\n",
+ "nm=(bp/ip)*100\n",
+ "nb=((bp*60)/(mf*CV))*100\n",
+ "ni=((nb/100.0)/(nm/100.0))*100\n",
+ "bsfc=(mf*60)/bp\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The brake power = \",round(bp,3),\"kW\"\n",
+ "print \"(b) The indicated power = \",round(ip,3),\"kW\"\n",
+ "print\"(c) The mechanical efficiency = \",round(nm,0),\"percent\"\n",
+ "print\"(d) The brake thermal efficiency = \",round(nb,3)\n",
+ "print\"(e) The indicated thermal efficiency = \",round(ni,3)\n",
+ "print\"(f) The brake specific fuel consumption = \",round(bsfc,3),\" kg/kWh\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The brake power = 7.333 kW\n",
+ "(b) The indicated power = 8.835 kW\n",
+ "(c) The mechanical efficiency = 83.0 percent\n",
+ "(d) The brake thermal efficiency = 22.055\n",
+ "(e) The indicated thermal efficiency = 26.573\n",
+ "(f) The brake specific fuel consumption = 0.389 kg/kWh\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.6 page no: 524"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "n=8 #Number of cylinders\n",
+ "d=0.08 #The diameter of the bore in m\n",
+ "L=0.1 #The length of the stroke in m\n",
+ "N=4500 #The speed of the engine in rpm \n",
+ "dy=0.55 #The dynamometer readings in m\n",
+ "w=40 #The weight of the dynamometer scale reading in kg\n",
+ "c=100 #Fuel consumption in cc\n",
+ "t=9.5 #Time taken for fuel consumption in s\n",
+ "CV=44000 #The calorific value of the fuel in kJ/kg\n",
+ "p=1 #The atmospheric air pressure in bar\n",
+ "T=300 #The atmospheric air temperature in K\n",
+ "ma=6 #Mass flow rate of air in kg/min\n",
+ "g=0.7 #Specific gravity of the fuel \n",
+ "Vc=65 #The clearance volume of each cylinder in cc\n",
+ "R=287 #Real gas constant in J/kgK\n",
+ "g=1.4 #Isentropic index\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "bp=(2*math.pi*N*dy*w*9.81)/(60.0*1000.0)\n",
+ "bmep=((bp*1000*60)/(L*(math.pi/4.0)*d**2*(N/2.0)*n))/10.0**5\n",
+ "mf=(c*g*3600)/(t*2.0*1000.0)\n",
+ "bsfc=(mf/bp)\n",
+ "bsac=(ma*60)/bp\n",
+ "a=bsac/bsfc\n",
+ "nb=((bp*3600)/(mf*CV))*100\n",
+ "Va=(ma*R*T)/(p*10.0**5)\n",
+ "Vs=(math.pi/4.0)*d**2*L*(N/2.0)*n\n",
+ "nv=(Va/Vs)*100\n",
+ "Vs1=((math.pi/4.0)*d**2*L)*10**6\n",
+ "cr=(Vs1+Vc)/Vc\n",
+ "na=(1-(1/cr)**(g-1))*100\n",
+ "re=((nb)/(na))*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The brake power = \",round(bp,1),\"kW\" \n",
+ "print\"The brake mean effective pressure = \",round(bmep,3),\"bar\"\n",
+ "print\"The brake specific fuel consumption = \",round(bsfc,3),\"kg/kWh\"\n",
+ "print\"The brake specific air consumption = \",round(bsac,3),\"kg/kWh\"\n",
+ "print\"The air fuel ratio = \",round(a,2)\n",
+ "print\"The brake thermal efficiency = \",round(nb,3),\"percent\" \n",
+ "print\"The volumetric efficiency = \",round(nv,1),\"percent\"\n",
+ "print\"The relative efficiency = \",round(re,1),\"percent\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The brake power = 101.7 kW\n",
+ "The brake mean effective pressure = 6.744 bar\n",
+ "The brake specific fuel consumption = 0.261 kg/kWh\n",
+ "The brake specific air consumption = 3.54 kg/kWh\n",
+ "The air fuel ratio = 13.57\n",
+ "The brake thermal efficiency = 31.369 percent\n",
+ "The volumetric efficiency = 57.1 percent\n",
+ "The relative efficiency = 54.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.7 page no: 526"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "n=6 #Number of cylinders\n",
+ "Do=0.03 #Orifice diameter in m\n",
+ "Cd=0.6 #Coefficient of discharge \n",
+ "H=0.14 #Pressure drop across the orifice\n",
+ "d=0.1 #The diameter of the bore in m\n",
+ "L=0.11 #The length of the stroke in m\n",
+ "W=540 #Brake load in N\n",
+ "N=2500 #Engine speed in rpm\n",
+ "ch=83/17 #C/H ratio by mass\n",
+ "p=1 #Ambient pressure in bar\n",
+ "t=18 #Time taken for fuel consumption in s\n",
+ "f=100 #The amount of fuel consumption in cc\n",
+ "T=300.0 #Ambient air temperature in K\n",
+ "df=780 #The density of the fuel in kg/m**3\n",
+ "R=287.0 #Real gas constant in J/kgK\n",
+ "g=9.81 #Gravitational force constant in m/s**2\n",
+ "dhg=13600 #Density of Hg in kg/m**3\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "da=(p*10**5)/(R*T)\n",
+ "Va=(Cd*(math.pi/4.0)*Do**2*(2*g*H*(dhg/da))**(1/2.0))\n",
+ "Vs=(math.pi/4.0)*d**2*L*(N/(2.0*60.0))*n\n",
+ "nv=(Va/Vs)*100\n",
+ "bp=(W*N)/(20000.0)\n",
+ "bmep=((bp*1000)/(L*(math.pi/4.0)*d**2*(N/(2.0*60.0))*n))/10.0**5\n",
+ "T=(60*bp*1000)/(2.0*math.pi*N)\n",
+ "mf=(f/18.0)*(780/1000.0)*(1/1000.0)*3600\n",
+ "bsfc=mf/bp\n",
+ "so=(0.83*(32/12.0))+(0.17*(8/1.0))\n",
+ "sa=so/bsfc\n",
+ "maa=Va*da\n",
+ "af=(maa*3600)/mf\n",
+ "pea=((af-sa)/sa)*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The volumetric efficiency = \",round(nv,3),\"percent\" \n",
+ "print\"The brake mean effective pressure = \",round(bmep,3),\"bar\" \n",
+ "print\"The brake power = \",bp,\"kW\" \n",
+ "print\"The Torque = \",round(T,3),\"Nm\"\n",
+ "print\"The brake specific fuel consumption = \",round(bsfc,3),\"kg/kWh\" \n",
+ "print\"The percentage of excess air = \",round(pea,1),\"percent\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volumetric efficiency = 70.433 percent\n",
+ "The brake mean effective pressure = 6.25 bar\n",
+ "The brake power = 67.5 kW\n",
+ "The Torque = 257.831 Nm\n",
+ "The brake specific fuel consumption = 0.231 kg/kWh\n",
+ "The percentage of excess air = 31.9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.8 page no: 528"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=0.2 #The diameter of bore in m\n",
+ "L=0.3 #The length of the stroke in m\n",
+ "r=5.5 #The compression ratio of the engine\n",
+ "N=400 #The speed of the engine in rpm\n",
+ "imep=4.5 #The indicative mean effective pressure in bar\n",
+ "a=6 #Air to gas by volume \n",
+ "CV=12000 #The calorific value of the gas in kJ/m**3\n",
+ "T=340 #The temperature at the beginning of the compression stroke in K\n",
+ "p=0.97 #The pressure at the beginning of the compression stroke in bar\n",
+ "g=1.4 #Adiabatic index\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Vs=(math.pi/4.0)*d**2*L\n",
+ "Vc=Vs/(r-1)\n",
+ "V=Vs+Vc\n",
+ "Vg=V/7.0\n",
+ "Vntp=((p*Vg)/T)*(273/1.013)\n",
+ "Q=Vntp*CV*(N/(2.0*60.0))\n",
+ "ip=(imep*10**5*L*(math.pi/4.0)*d**2*(N/(2.0*60.0))*(1/1000.0))\n",
+ "ni=(ip/Q)*100\n",
+ "na=(1-(1/r)**(g-1))*100\n",
+ "nr=(ni/na)*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The indicated power = \",round(ip,2),\"kW\" \n",
+ "print\"The thermal efficiency = \",round(ni,1),\"percent\" \n",
+ "print\"The relative efficiency = \",round(nr,1),\"percent\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The indicated power = 14.14 kW\n",
+ "The thermal efficiency = 27.9 percent\n",
+ "The relative efficiency = 56.5 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.9 page no: 529"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "n=6.0 #Number of cylinder\n",
+ "bp=130.0 #Brake power in kW\n",
+ "N=1800.0 #The speed of the engine in rpm \n",
+ "CV=42000.0 #The calorific value of the fuel in kJ/kg\n",
+ "C=86.0 #The composition of carbon in the fuel in percent\n",
+ "H=13.0 #The composition of Hydrogen in the fuel in percent\n",
+ "NC=1.0 #The non combustibles present in the fuel in percent\n",
+ "na=85.0 #The absolute volumetric efficiency in percent\n",
+ "ni=38.0 #The indicated thermal efficiency in percent\n",
+ "nm=80.0 #The mechanical efficiency in percent\n",
+ "ac=110.0 #The excess consumption of air in percent\n",
+ "sb=1.2 #The stroke to the bore ratio \n",
+ "da=1.3 #The density of air in kg/m**3\n",
+ "\n",
+ "#Calculations \n",
+ "import math\n",
+ "saf=(((C/100.0)*(32/12.0))+((H/100.0)*(8/1.0)))*(1/0.23)\n",
+ "aaf=saf*(1+1.1)\n",
+ "Ma=(0.23*32)+(0.77*28)\n",
+ "a=(C/100)/12.0\n",
+ "b=(H/100.0)/2.0\n",
+ "x=aaf/Ma\n",
+ "c=(0.21*x)-a-(b/2.0)\n",
+ "d1=0.79*x\n",
+ "ip=bp/(nm/100.0)\n",
+ "mf=ip/((ni/100.0)*CV)\n",
+ "ma=mf*aaf\n",
+ "Va=ma/da\n",
+ "Vs=Va/(na/100.0)#The swept volume per second in m**3/s\n",
+ "d=((Vs*(4/math.pi)*(1/1.2)*((2*60)/N)*(1/n))**(1/3.0))*1000\n",
+ "L=1.2*d\n",
+ "T=a+c+d1\n",
+ "CO2=(a/T)*100\n",
+ "O2=(c/T)*100\n",
+ "N2=(d1/T)*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The volumetric composition of dry exhaust gas :\" \n",
+ "print\"1) CO2 = \",round(a,2),\"kmol\",\"and\" \n",
+ "print\"volume = \",round(CO2,2),\"percent\" \n",
+ "print\"2) O2 = \",round(c,3),\"kmol\",\"and\" \n",
+ "print\"volume = \",round(O2,3),\"percent\"\n",
+ "print\"3) N2 = \",round(d1,3),\"kmol\",\"and\" \n",
+ "print\"volume = \",round(N2,3),\"percent\"\n",
+ "print\"The bore of the engine = \",round(d,0),\"mm\" \n",
+ "print\"The stroke of the engine = \",round(L,1),\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volumetric composition of dry exhaust gas :\n",
+ "1) CO2 = 0.07 kmol and\n",
+ "volume = 7.03 percent\n",
+ "2) O2 = 0.117 kmol and\n",
+ "volume = 11.456 percent\n",
+ "3) N2 = 0.831 kmol and\n",
+ "volume = 81.517 percent\n",
+ "The bore of the engine = 149.0 mm\n",
+ "The stroke of the engine = 178.8 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.10 page no: 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=0.18 #The diameter of the cylinder in m\n",
+ "L=0.24 #The length of the stroke in m\n",
+ "t=30.0 #Duration trail in min \n",
+ "N=9000.0 #Number of revolutions \n",
+ "Ne=4450.0 #Total number of explosions\n",
+ "pmi=5.35 #Gross imep in bar\n",
+ "pp=0.35 #Pumping imep in bar\n",
+ "W=40.0 #Net load on brake wheel in kg\n",
+ "dd=0.96 #Diameter of the brake wheel drum in m\n",
+ "dr=0.04 #Diameter of the rope in m\n",
+ "V=2.6 #Volume of gas used in m**3\n",
+ "pg=136.0 #pressure of gas in mmof Hg\n",
+ "dg=0.655 #The density of gas in kg/m**3\n",
+ "T=290.0 #The ambient temperature of air in K\n",
+ "CV=19000.0 #The calorific value of the fuel in kJ/m**3\n",
+ "ta=40.0 #Total air used in m**3\n",
+ "p=720.0 #Pressure of air in mm of Hg\n",
+ "Te=340.0 #Temperature of exhaust gas in degree centigrade \n",
+ "Cpg=1.1 #Specific heat of gas in kJ/kgK\n",
+ "C=80.0 #Cooling water circulated in kg\n",
+ "Tr=30.0 #Rise in temperature of cooling water in degree centigrade \n",
+ "R=287.0 #Real gas constant in J/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "#import math\n",
+ "ip=(pmi-pp)*10**5*L*(math.pi/4.0)*d**2*(Ne/(30.0*60.0))*(1/1000.0)\n",
+ "bp=(math.pi*(N/(30.0*60.0))*W*9.81*(dd+dr)*(1/1000.0))\n",
+ "pgs=760+(pg/13.6)\n",
+ "Vg=((pgs*V)/290.0)*(273/760.0)\n",
+ "Q=(Vg*CV)/30.0\n",
+ "Qbp=bp*60\n",
+ "Qc=(C/t)*4.18*Tr\n",
+ "Va=(((p*ta)/T)*(273/760.0))/30.0\n",
+ "da=(1.013*10**5)/(R*273)\n",
+ "ma=Va*da\n",
+ "mg=(Vg/30)*dg\n",
+ "me=ma+mg\n",
+ "Qe=me*Cpg*(Te-(T-273))\n",
+ "Qu=Q-(Qe+Qc+Qbp)\n",
+ "nm=(bp/ip)*100\n",
+ "ni=((ip*60)/Q)*100 \n",
+ "x=((Qbp/1571.0)*100)\n",
+ "y=((Qc/1571.0)*100)\n",
+ "z=((Qe/1571.0)*100)\n",
+ "k=((Qu/1571.0)*100)\n",
+ "Qf=Qbp+Qc+Qe+Qu\n",
+ "\n",
+ "#Output\n",
+ "print Qe\n",
+ "print\" HEAT BALANCE SEAT\"\n",
+ "\n",
+ "print \" \\nHeat input kj/min % heat expenditure Kj/min %\"\n",
+ "print\"--------------------------------------------------------------------------------------------------\"\n",
+ "print\"heat supplied by fuel \",round(Q,0),\" 100 (a)Heat in bp \", round(Qbp,1),\" \",round(x,1)\n",
+ "print\" (b)Heat loss to cooling tower \",round(Qc,0),\" \",round(y,1)\n",
+ "print\" (c) Heat to exhaust gases \",round(Qe,0),\" \",round(z,0)\n",
+ "print\" (d)unaccounted losses \",round(Qu,0),\" \",round(k,1)\n",
+ "print\"Total \",round(Q,0),\" 100 total \",round(Qf,0), \" 100.0\"\n",
+ " \n",
+ "print\"\\nMechanical efficiency is\",round(nm,2),\"percent\"\n",
+ "print\"Thermal efficiency is\",round(ni,1),\"percent\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "565.475307496\n",
+ " HEAT BALANCE SEAT\n",
+ " \n",
+ "Heat input kj/min % heat expenditure Kj/min %\n",
+ "--------------------------------------------------------------------------------------------------\n",
+ "heat supplied by fuel 1571.0 100 (a)Heat in bp 369.8 23.5\n",
+ " (b)Heat loss to cooling tower 334.0 21.3\n",
+ " (c) Heat to exhaust gases 565.0 36.0\n",
+ " (d)unaccounted losses 301.0 19.1\n",
+ "Total 1571.0 100 total 1571.0 100.0\n",
+ "\n",
+ "Mechanical efficiency is 81.65 percent\n",
+ "Thermal efficiency is 28.8 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.11 page no: 533"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given \n",
+ "bp=30 #The brake power in kw\n",
+ "mf=10 #Mass flow rate of fuel in kg/h\n",
+ "CV=42000 #Calorific value of the fuel in kJ/kg\n",
+ "mw=9 #Mass flow rate of water in kg/min\n",
+ "Tr=60 #Rise in temperature of the cooling water in degree centigrade\n",
+ "mwe=9.5 #Mass flow rate of water through exhaust gas calorimeter in kg/min\n",
+ "Tc=40 #Rise in temperature when passing through calorimeter in degree centigrade\n",
+ "Te=80 #Temperature of exhaust gas leaving the calorimeter in degree centigrade\n",
+ "a=20 #Air fuel ratio\n",
+ "T=17 #Ambient temperature in degree centigrade\n",
+ "Cpw=4.18 #Specific heat of water in kJ/kgK\n",
+ "Cpg=1 #Mean specific heat of gas in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "Qf=(mf/60.0)*CV \n",
+ "Qbp=bp*60\n",
+ "Qc=mw*Cpw*Tr\n",
+ "mg=(mf/60.0)+(mf/60.0)*a\n",
+ "Qe=(mwe*Cpw*Tc)+(mg*Cpg*(Te-T))\n",
+ "Qu=Qf-(Qbp+Qc+Qe)\n",
+ "x=((Qbp/Qf))*100\n",
+ "y=(Qc/Qf)*100\n",
+ "z=(Qe/Qf)*100\n",
+ "k=(Qu/Qf)*100\n",
+ "\n",
+ "#Output\n",
+ "print\" HEAT BALANCE SEAT\"\n",
+ "print \"\\n Heat input kj/min % heat expenditure Kj/min %\"\n",
+ "print\"--------------------------------------------------------------------------------------------------\"\n",
+ "print\"heat supplied by fuel \",Qf,\" 100 (a)Heat in bp \", Qbp,\" \",round(x,0)\n",
+ "print\" (b)Heat loss to cooling tower \",round(Qc,0),\" \",round(y,0)\n",
+ "print\" (c) Heat to exhaust gases \",round(Qe,0),\" \",round(z,0)\n",
+ "print\" (d)unaccounted losses \",round(Qu,0),\" \",round(k,0)\n",
+ "print\"Total \",Qf,\" 100 total \",Qf, \" 100\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " HEAT BALANCE SEAT\n",
+ "\n",
+ " Heat input kj/min % heat expenditure Kj/min %\n",
+ "--------------------------------------------------------------------------------------------------\n",
+ "heat supplied by fuel 7000.0 100 (a)Heat in bp 1800 26.0\n",
+ " (b)Heat loss to cooling tower 2257.0 32.0\n",
+ " (c) Heat to exhaust gases 1809.0 26.0\n",
+ " (d)unaccounted losses 1134.0 16.0\n",
+ "Total 7000.0 100 total 7000.0 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 85
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.12 page no: 534"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "n=4.0 #Number of cylinders\n",
+ "d=0.085 #The diameter of the bore m\n",
+ "L=0.095 #The length of the stroke in m\n",
+ "tr=0.35 #Torque radius in m\n",
+ "N=3000.0 #The speed of the engine in rpm\n",
+ "w=430.0 #Net brake load in N\n",
+ "w1=300.0 #Net brake load produced at the same speed by three cylinders in N\n",
+ "mf=0.24 #The mass flow rate of fuel in kg/min\n",
+ "CV=44000.0 #The calorific value of the fuel in kJ/kg\n",
+ "mw=65.0 #Mass flow rate of water in kg/min\n",
+ "Tw=12.0 #The rise in temperature in degree centigrade\n",
+ "a=15.0 #The air fuel ratio \n",
+ "Te=450.0 #The temperature of the exhaust gas in degree centigrade \n",
+ "Ta=17.0 #Ambient temperature in degree centigrade\n",
+ "p=76.0 #Barometric pressure in cm of Hg\n",
+ "H=15.5 #The proportion of hydrogen by mass in the fuel in percent\n",
+ "Cpe=1.0 #The mean specific heat of dry exhaust gas in kJ/kgK\n",
+ "Cps=2.0 #The specific heat of super heated steam in kJ/kgK\n",
+ "Cpw=4.18 #The specific heat of water in kJ/kgK\n",
+ "Ts=100.0 #At 76 cm of Hg The temperature in degree centigrade \n",
+ "hfg=2257 #The Enthalpy in kJ/kg\n",
+ "R=287.0 #Real gas cons tant in J/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "bp=(2*math.pi*N*w*tr)/(60.0*1000.0)\n",
+ "bp1=(2*math.pi*N*w1*0.35)/(60.0*1000.0)\n",
+ "ip=bp-bp1\n",
+ "ip1=n*ip\n",
+ "imep=((ip1*60*1000)/(L*(math.pi/4.0)*d**2*(N/2.0)*n))/10.0**5\n",
+ "ni=((ip1*60)/(mf*CV))*100\n",
+ "bsfc=(mf*60)/bp\n",
+ "Vs=(math.pi/4.0)*d**2*L*(N/2.0)*n\n",
+ "ma=a*mf\n",
+ "da=(1*10**5)/(R*(Ta+273))\n",
+ "Va=ma/da\n",
+ "nv=(Va/Vs)*100\n",
+ "Qf=mf*CV\n",
+ "Qbp=bp*60\n",
+ "Qc=mw*Cpw*Tw\n",
+ "mv=9*(H/100.0)*mf\n",
+ "me=ma+mf-mv\n",
+ "Qe=me*Cpe*(Te-Ta)\n",
+ "Qs=(mv*((Cpw*(Ts-Ta))+hfg+(Cps*(Te-Ts))))\n",
+ "Qu=Qf-(Qbp+Qc+Qe+Qs)\n",
+ "x=(Qbp/Qf)*100\n",
+ "y=(Qc/Qf)*100\n",
+ "z=(Qe/Qf)*100\n",
+ "k=(Qs/Qf)*100\n",
+ "l=(Qu/Qf)*100 \n",
+ "\n",
+ "#Output\n",
+ "print\" HEAT BALANCE SEAT\"\n",
+ "print \" Heat input kj/min % heat expenditure Kj/min %\"\n",
+ "print\"----------------------------------------------------------------------------------------------------\"\n",
+ "print\"heat supplied by fuel \",Qf,\" 100 (a)Heat in bp \", Qbp,\" \",round(x,2)\n",
+ "print\" (b)Heat loss to cooling tower \",round(Qc,0),\" \",round(y,2)\n",
+ "print\" (c) Heat to dry exhaust gases \",round(Qe,0),\" \",round(z,1)\n",
+ "print\" (d)Heat loss in steam \",round(Qs,0),\" \",round(k,1)\n",
+ "print\" (e)unaccounted losses \",round(Qu,0),\" \",round(l,2)\n",
+ "print\"Total \",Qf,\" 100 total \",Qf, \" 100\"\n",
+ "\n",
+ "print\"\\nimpep \",round(imep,2),\"bar\"\n",
+ "print\"Thermal efficiency \",round(ni,1),\"percent\"\n",
+ "print\"bsfc=\",round(bsfc,4),\"kg/kwh\"\n",
+ "print\"Volumetric efficiency=\",round(nv,1),\"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " HEAT BALANCE SEAT\n",
+ " Heat input kj/min % heat expenditure Kj/min %\n",
+ "----------------------------------------------------------------------------------------------------\n",
+ "heat supplied by fuel 10560.0 100 (a)Heat in bp 2836.85816619 26.86\n",
+ " (b)Heat loss to cooling tower 3260.0 30.87\n",
+ " (c) Heat to dry exhaust gases 1518.0 14.4\n",
+ " (d)Heat loss in steam 1106.0 10.5\n",
+ " (e)unaccounted losses 1839.0 17.41\n",
+ "Total 10560.0 100 total 10560.0 100\n",
+ "\n",
+ "impep 10.61 bar\n",
+ "Thermal efficiency 32.5 percent\n",
+ "bsfc= 0.3046 kg/kwh\n",
+ "Volumetric efficiency= 92.6 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/chap3.ipynb b/Fundamental_of_internal_combustion_engines/chap3.ipynb new file mode 100755 index 00000000..a0a9064e --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/chap3.ipynb @@ -0,0 +1,1164 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3:Reactive Sysyem"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page no 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "E=20.0 #Methanol burned with excess air in percentage \n",
+ "p=1.0 #Pressure of air in bar\n",
+ "t=27.0 #Temperature of air in degree centigrade\n",
+ "O=32.0 #The molecular weight of oxygen\n",
+ "N=28.0 #The molecular weight of nitrogen\n",
+ "R=8314.0 #Universal gas constant in Nm/kmolK\n",
+ "C=32.0 #Molecular weight of methanol\n",
+ "CO=44.0 #Molecular weight of the carbondioxide \n",
+ "H=18.0 #Molecular weight of the water\n",
+ "\n",
+ "#Calculations\n",
+ "S=((1.8*O)+(6.768*N))/C\n",
+ "A=((1.8*O)+(6.768*N))/C\n",
+ "M=1.8+6.768\n",
+ "V=(M*R*(t+273))/(p*10**5)\n",
+ "T=(1+1.8+6.768)\n",
+ "Cm=(1/T)\n",
+ "Om=(1.8/T)\n",
+ "Nm=(6.768/T)\n",
+ "Mr=(Cm*C)+(Om*O)+(Nm*N)\n",
+ "Tp=(1+2+6.768+0.3)\n",
+ "COm=(1/Tp)\n",
+ "Hp=(2/Tp)\n",
+ "Np=(6.768/Tp)\n",
+ "Op=(0.3/Tp)\n",
+ "Mp=(COm*CO)+(Hp*H)+(Np*N)+(Op*O)\n",
+ "Pp=(Hp*p)\n",
+ "D=60\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The volume of air supplied per kmole of fuel = \",round(V,3),\"m**3/kmole fuel\"\n",
+ "print\"(b) The molecular weight of the reactants = \",round(Mr,3)\n",
+ "print\"The molecular weight of the products =\",round(Mp,3)\n",
+ "print\"(c) The dew point of the products = \",D,\"degree centigrade\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The volume of air supplied per kmole of fuel = 213.703 m**3/kmole fuel\n",
+ "(b) The molecular weight of the reactants = 29.171\n",
+ "The molecular weight of the products = 27.722\n",
+ "(c) The dew point of the products = 60 degree centigrade\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page no 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "C1=40.0 #The content of C7H16 in the fuel in percentage\n",
+ "C2=60.0 #The content of C8H18 in the fuel in percentage\n",
+ "d=0.12 #The diameter of the bore in m\n",
+ "l=0.145 #The length of the bore in m\n",
+ "r=8.5 #Compression ratio \n",
+ "p=1.1 #Pressure at exhaust stroke in bar\n",
+ "T=720.0 #The temperature at the exhaust stroke in K\n",
+ "O=32.0 #The molecular weight of oxygen\n",
+ "N=28.0 #The molecular weight of nitrogen\n",
+ "C3=100.0 #Molecular weight of C7H16\n",
+ "C4=114.0 #The molecular weight of C8H18\n",
+ "R=8314.0 #Universal gas constant in Nm/kmolK\n",
+ "CO2=44.0 #Molecular weight of the carbondioxide \n",
+ "C5=28.0 #Molecular weight of the carbonmonoxide\n",
+ "H=18.0 #Molecular weight of the water\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "N2=100-(12+1.5+2.5)\n",
+ "Y=84/3.76\n",
+ "X=13.5/7.6\n",
+ "Z=(22.34-15.25)*2\n",
+ "Hl=(6.4+10.8)/2.0\n",
+ "Hr=7.98\n",
+ "Hd=Hl-Hr\n",
+ "A=((12.58*(O+(3.76*N)))/(((C1/100.0)*C3)+((C2/100.0)*C4)))\n",
+ "Vs=(math.pi/4.0)*d**2*l\n",
+ "Vc=Vs/(r-1)\n",
+ "M=((6.757*CO2)+(0.8446*C5)+(1.408*O)+(47.3*N)+(8.6*H))/(6.757+0.8446+1.408+47.3+8.6)\n",
+ "R1=R/M\n",
+ "m=((p*10**5)*Vc)/(R1*T)\n",
+ "\n",
+ "#Output \n",
+ "print\"(a)The air/fuel ratio = \",round(A,2)\n",
+ "print\"(b)The mass of the exhaust gases in the clearance space = \",round(m*1000,3),\"*10**-3kg\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The air/fuel ratio = 15.93\n",
+ "(b)The mass of the exhaust gases in the clearance space = 0.114 *10**-3kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page no 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "C=0.86 #The amount of carbon content in the 1kg of fuel by weight in kg\n",
+ "H=0.05 #The amount of hydrogen content in the 1kg of fuel by weight in kg\n",
+ "O=0.02 #The amount of oxygen content in the 1kg of fuel by weight in kg\n",
+ "S=0.005 #The amount of sulphur content in the 1kg of fuel by weight in kg\n",
+ "N=0.065 #The amount of nitrogen content in the 1kg of fuel by weight in kg\n",
+ "E=25.0 #The amount of excess air supplied in percentage\n",
+ "o=32.0 #Molecular weight of the oxygen\n",
+ "co=44.0 #Molecular weight of the carbondioxide \n",
+ "c=12.0 #Molecular weight of the carbon\n",
+ "s=32.0 #Molecular weight of the sulphur\n",
+ "so=64.0 #Molecular weight of sulphur dioxide\n",
+ "n=28.0 #Molecular weight of the nitrogen\n",
+ "\n",
+ "#Calculations\n",
+ "o1=(o/c)*C\n",
+ "coa=(co/c)*C\n",
+ "o2=(o/4.0)*H\n",
+ "h2=(36/4.0)*H\n",
+ "o3=(o/s)*S\n",
+ "s1=(so/s)*S\n",
+ "To=o1+o2+o3\n",
+ "Tt=To-O\n",
+ "As=(Tt*100)/23.0\n",
+ "as_=As*(1+(E/100.0))\n",
+ "o2a=0.23*(E/100)*As\n",
+ "n2a=0.77*(1+(E/100))*As\n",
+ "n2e=n2a+N\n",
+ "Tw=coa+n2e+o2a\n",
+ "pco=(coa/Tw)*100\n",
+ "pn=(n2e/Tw)*100\n",
+ "po=(o2a/Tw)*100\n",
+ "mco=(coa/co)\n",
+ "mn=(n2e/n)\n",
+ "mo=(o2a/o)\n",
+ "Tm=mco+mn+mo\n",
+ "vco=(mco/Tm)*100\n",
+ "vn=(mn/Tm)*100\n",
+ "vo=(mo/Tm)*100\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)Stoichiometric air/fuel ratio = \",round(As,2) \n",
+ "print\"(b)The percentage of dry products of combustion by weight :\"\n",
+ "print\" CO2 = \",round(pco,2),\"percent\"\n",
+ "print\"N2 = \",round(pn,2),\"percent\"\n",
+ "print\"O2 = \",round(po,2),\"percent\"\n",
+ "print\"(c)The percentage of dry products of combustion by volume : \"\n",
+ "print\"CO2 = \",round(vco,2),\"percent\"\n",
+ "print\"N2 = \",round(vn,2),\"percent\"\n",
+ "print\"O2= \",round(vo,2),\"percent\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Stoichiometric air/fuel ratio = 11.64\n",
+ "(b)The percentage of dry products of combustion by weight :\n",
+ " CO2 = 20.89 percent\n",
+ "N2 = 74.68 percent\n",
+ "O2 = 4.44 percent\n",
+ "(c)The percentage of dry products of combustion by volume : \n",
+ "CO2 = 14.47 percent\n",
+ "N2 = 81.3 percent\n",
+ "O2= 4.23 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4 Page no 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "CO=12.0 #The composition of carbondioxide of combustion by volume in percentage \n",
+ "C=0.5 #The composition of carbonmoxide of combustion by volume in percentage \n",
+ "O=4.0 #The composition of oxygen of combustion by volume in percentage \n",
+ "N=83.5 #The composition of nitrogen of combustion by volume in percentage \n",
+ "o=32.0 #Molecular weight of the oxygen\n",
+ "co=44.0 #Molecular weight of the carbondioxide \n",
+ "c=12.0 #Molecular weight of the carbon\n",
+ "s=32.0 #Molecular weight of the sulphur\n",
+ "so=64.0 #Molecular weight of sulphur dioxide\n",
+ "n1=28.0 #Molecular weight of the nitrogen\n",
+ "h=2.0 #Molecular weight of the hydrogen\n",
+ "\n",
+ "#Calculations\n",
+ "m=12+0.5\n",
+ "x=N/3.76\n",
+ "z=(x-(CO+(C/2)+O))*2\n",
+ "n=z*h\n",
+ "Af=((x*o)+(N*n1))/((m*c)+(n))\n",
+ "As=((18.46*o)+(69.41*n1))/173.84\n",
+ "Ta=(Af/As)*100\n",
+ "mc=((m*c)/173.84)*100\n",
+ "mh=(n/173.84)*100\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)The air/fuel ratio = \",round(Af,1)\n",
+ "print\"(b)The percent theoretical air = \",round(Ta,1),\"%\"\n",
+ "print\"(c)The percentage composition of fuel on a mass basis : \" \n",
+ "print\"C = \",round(mc,1),\"%\"\n",
+ "print\"H = \",round(mh,1),\"percent\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The air/fuel ratio = 17.5\n",
+ "(b)The percent theoretical air = 120.3 %\n",
+ "(c)The percentage composition of fuel on a mass basis : \n",
+ "C = 86.3 %\n",
+ "H = 13.7 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 Page no 72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "C=86.0 #The composition of carbon in the fuel by weight in percentage\n",
+ "H=14.0 #The composition of hydrogen in the fuel by weight in percentage\n",
+ "e=1.25 #Equivalent ratio\n",
+ "o=32.0 #Molecular weight of the oxygen\n",
+ "co=44.0 #Molecular weight of the carbondioxide \n",
+ "c=12.0 #Molecular weight of the carbon\n",
+ "s=32.0 #Molecular weight of the sulphur\n",
+ "so=64.0 #Molecular weight of sulphur dioxide\n",
+ "n=28.0 #Molecular weight of the nitrogen\n",
+ "h2=2.0 #Molecular weight of the hydrogen\n",
+ "Fc=0.86 #Fraction of C\n",
+ "\n",
+ "#Calculations\n",
+ "Ra=1/Fc\n",
+ "x=2*(1+(0.9765/2.0)-(1.488*0.8))\n",
+ "Tm=0.5957+0.4043+4.476\n",
+ "vc=(0.5957/Tm)*100\n",
+ "vco=(0.4043/Tm)*100\n",
+ "vn=(4.476/Tm)*100\n",
+ "\n",
+ "#Calculations\n",
+ "print\"The percentage analysis of dry exhaust gas by volume : \"\n",
+ "print\"CO = \",round(vc,2),\"percent\" \n",
+ "print\"CO2 = \",round(vco,2),\"percent\" \n",
+ "print\"N2 = \",round(vn,2),\"percent\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage analysis of dry exhaust gas by volume : \n",
+ "CO = 10.88 percent\n",
+ "CO2 = 7.38 percent\n",
+ "N2 = 81.74 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6 Page no 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "t=25.0 #The temperature of both reactants and products in degree centigrade\n",
+ "p=1.0 #The pressure of both reactants and products in bar\n",
+ "\n",
+ "#Calculations \n",
+ "h=0\n",
+ "hf1=-103.85\n",
+ "hf2=-393.52\n",
+ "hf3=-285.8\n",
+ "hf4=(3*hf2)+(4*hf3)\n",
+ "Q=hf4-hf1\n",
+ "\n",
+ "#Output\n",
+ "print\" The heat transfer per mole of fuel = \",Q,\"kJ/mol fuel\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The heat transfer per mole of fuel = -2219.91 kJ/mol fuel\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7 Page no 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "t=25.0 #The temperature of the air entering the diesel engine in degree centigrade \n",
+ "T=600.0 #The temperature at which the products are released in K\n",
+ "Ta=200.0 #Theoretical air used in percentage \n",
+ "Q=-93.0 #Heat loss from the engine in MJ/kmol fuel\n",
+ "f=1.0 #The fuel rate in kmol/h\n",
+ "\n",
+ "#Calculations \n",
+ "hfr=-290.97\n",
+ "h1=-393.52\n",
+ "h11=12.916\n",
+ "hfc=h1+h11\n",
+ "h2=-241.82\n",
+ "h22=10.498\n",
+ "hfh=h2+h22\n",
+ "h3=0 \n",
+ "h33=9.247\n",
+ "hfo=h3+h33\n",
+ "h4=0\n",
+ "h44=8.891\n",
+ "hfn=h4+h44\n",
+ "hfp=(12*hfc)+(13*hfh)+(18.5*hfo)+(139.12*hfn)\n",
+ "W=Q+hfr-hfp\n",
+ "W1=(f*W*10**3)/3600.0\n",
+ "\n",
+ "#Output\n",
+ "print\"The work for a fuel rate of 1 kmol/h is \",round(W1,0),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work for a fuel rate of 1 kmol/h is 1606.0 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 Page no 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "P=600 #Power of an engine in kW\n",
+ "t=25 #Temperature at which fuel is used in degree centigrade\n",
+ "Ta=150 #Theoretical air used in percentage\n",
+ "T1=400 #The temperature at which air enters in K\n",
+ "T2=700 #The temperature at which the products of combustion leave in K\n",
+ "Q=-150 #The heat loss from the engine in kW\n",
+ "C=12 #Molecular weight of carbon\n",
+ "h=1 #Molecular weight of hydrogen\n",
+ "\n",
+ "#Calculations\n",
+ "hfc=-259.28\n",
+ "hfo1=3.029\n",
+ "hfn1=2.971\n",
+ "HR=(hfc)+(1.5*12.5*hfo1)+(1.5*12.5*3.76*hfn1)\n",
+ "hfco=-393.52\n",
+ "hfco1=17.761\n",
+ "hfh=-241.82\n",
+ "hfh1=14.184\n",
+ "hfo2=12.502\n",
+ "hfn2=11.937\n",
+ "HP=(8*(hfco+hfco1))+(9*(hfh+hfh1))+(6.25*hfo2)+(70.5*hfn2)\n",
+ "H=HP-HR\n",
+ "nf=((Q-P)*3600)/(H*10.0**3)\n",
+ "M=(8*C)+(18*h)\n",
+ "mf=nf*M\n",
+ "\n",
+ "#Output\n",
+ "print\" The fuel consumption for complete combustion is \",round(mf,1),\"kg/h\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The fuel consumption for complete combustion is 74.3 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9 Page no 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "t=25 #Temperature at which fuel is used for combustion in degree centigrade \n",
+ "p=1 #The pressure at which fuel is used in bar\n",
+ "T=400 #The temperature of the products of combustion in K\n",
+ "R=8.314*10**-3 #Universal gas constant\n",
+ "hfco=-393.52 #The enthalpy of the carbondioxide in MJ/kmol fuel\n",
+ "hfco1=4.008 #The change in enthalpy of the carbondioxide for the given conditions in MJ/kmol fuel\n",
+ "hfh=-241.82 #The enthalpy of the water in MJ/kmol fuel\n",
+ "hfh1=3.452 #The change in enthalpy of the water for the given conditions in MJ/kmol fuel\n",
+ "\n",
+ "#Calculations\n",
+ "hfc=-103.85 \n",
+ "HR=(1*(hfc-(R*(t+273))))+(5*(-R*(t+273)))\n",
+ "HP=(3*(hfco+hfco1-(R*T)))+(4*(hfh+hfh1-(R*T)))\n",
+ "Q=HP-HR\n",
+ "Q1=-Q\n",
+ "\n",
+ "#Output\n",
+ "print\"The heat transfer per mole of propane = \",round(Q1,1),\"kJ/mol propane\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transfer per mole of propane = 2026.6 kJ/mol propane\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 Page no 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "T=1500 #The given temperature in K\n",
+ "hfco=-393.52 #The enthalpy of formation for carbondioxide in MJ/kmol\n",
+ "hf1=61.714 #The change in enthalpy for actual state and reference state in MJ/kmol\n",
+ "hfc=-110.52 #The enthalpy of formation for carbonmonoxide in MJ/kmol\n",
+ "hf2=38.848 #The change in enthalpy of CO for actual and reference state in MJ/kmol\n",
+ "hfo=0 #The enthalpy of formation for oxygen gas\n",
+ "hf3=40.61 #The change in enthalpy of oxygen for different states in MJ/kmol\n",
+ "\n",
+ "#Calculations\n",
+ "HP=hfco+hf1\n",
+ "HR=(hfc+hf2)+(0.5*(hfo+hf3))\n",
+ "H=HP-HR\n",
+ "\n",
+ "#Output\n",
+ "print\" The enthalpy of combustion is \",round(H,1),\"MJ/kmol CO\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The enthalpy of combustion is -280.4 MJ/kmol CO\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 Page no 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "E=30 #The amount of excess air in percentage\n",
+ "tp=400 #The temperature at which propane enters in K\n",
+ "ta=300 #The temperature at which air enters in K\n",
+ "T=900 #The temperature at which products leave in K\n",
+ "m=83.7 #The average molar specific heat of propane at consmath.tant pressure in kJ/kmolK\n",
+ "Mp=44 #The molecular weight of propane\n",
+ "hfc=-393.52 #The enthalpy of formation for carbondioxide in MJ/kmol\n",
+ "hf1=28.041 #The change in enthalpy of CO2 for actual and reference state in MJ/kmol\n",
+ "hfh=-241.82 #The enthalpy of formation for water in MJ/kmol\n",
+ "hf2=21.924 #The change in enthalpy of water for actual and reference state in MJ/kmol\n",
+ "hfn=0 #The enthalpy of nitrogen gas \n",
+ "hf3=18.221 #The change in enthalpy of nitrgen for actual and reference state in MJ/kmol\n",
+ "hfo=0 #The enthalpy of oxygen gas \n",
+ "hf4=19.246 #The change in enthalpy of oxygen for actual and reference state in MJ/kmol\n",
+ "hfp=-103.85 #The enthalpy of formation for propane in MJ/kmol\n",
+ "R=0.0837 #Universal gas constant \n",
+ "hfo1=0 #The enthalpy of oxygen gas \n",
+ "hf11=0.054 #The change in enthalpy of oxygen gas for actual and reference state in MJ/kmol\n",
+ "hfn1=0 #The enthalpy of nitrogen gas\n",
+ "hfn22=0.054 #The change in enthalpy of nitrogen for actual and reference state in MJ/kmol\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "HP=(3*(hfc+hf1))+(4*(hfh+hf2))+(24.44*(hfn+hf3))+(1.5*(hfo+hf4))\n",
+ "HR=(1*(hfp+(R*(tp-ta))))+(6.5*(hfo1+hf11))+(24.44*(hfn1+hfn22))\n",
+ "Q=HP-HR\n",
+ "Q1=(-Q/Mp)\n",
+ "\n",
+ "#Output\n",
+ "print\" The amount of heat transfer per kg of fuel is \",round(Q1,3),\"MJ/kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The amount of heat transfer per kg of fuel is 32.0 MJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 Page no 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Ta=150 #The presence of Theoretical air\n",
+ "hfc=-393.52 #The enthalpy of formation for carbondioxide in MJ/kmol\n",
+ "hfh=-285.8 #The enthalpy of formation for water in MJ/kmol\n",
+ "hfon=0 #The enthalpy of formation for oxygen and nitrogen gas \n",
+ "hfch=-74.87 #The enthalpy of formation for methane in MJ/kmol\n",
+ "np=2 #Number of moles of product\n",
+ "nr=4 #Number of moles of reactant\n",
+ "R=8.314*10**-3 #Universal gas constant \n",
+ "t=298 #The temperature in K\n",
+ "hfh1=-241.82 #The enthalpy of formation for water in MJ/kmol\n",
+ "np1=4 #Number of moles of product\n",
+ "nr1=4 #Number of moles of reactant\n",
+ "\n",
+ "#Calculations\n",
+ "HP=(hfc)+(2*hfh)\n",
+ "HR=1*hfch\n",
+ "H=HP-HR\n",
+ "n=np-nr\n",
+ "U1=H-(n*R*t)\n",
+ "HP1=(1*hfc)+(2*hfh1)\n",
+ "H1=HP1-HR\n",
+ "n1=np1-nr1\n",
+ "U2=H1-(n1*R*t)\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)The water as liquid\" \n",
+ "print\"The standard enthalpy of combustion is \",H, \"MJ/kmol\"\n",
+ "print\"The standard internal energy of combustion is \",round(U1,3),\"MJ/kmol\"\n",
+ "print\"(b)The water as a gas \"\n",
+ "print\"The standard enthalpy of combustion is \",H1,\"MJ/kmol\"\n",
+ "print\"The standard internal energy of combustion is \",U2,\"MJ/kmol\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The water as liquid\n",
+ "The standard enthalpy of combustion is -890.25 MJ/kmol\n",
+ "The standard internal energy of combustion is -885.295 MJ/kmol\n",
+ "(b)The water as a gas \n",
+ "The standard enthalpy of combustion is -802.29 MJ/kmol\n",
+ "The standard internal energy of combustion is -802.29 MJ/kmol\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 Page no 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "cv=44000 #The lower calorific value of liquid fuel in kJ/kg\n",
+ "C=84 #The carbon content present in the fuel in percentage\n",
+ "H=16 #The hydrogen content present in the fuel in percentage\n",
+ "t=25 #The temperature in degree centigrade\n",
+ "hfg=2442 #The enthalpy of vaporization for water in kJ/kg\n",
+ "c=12.0 #Molecular weight of carbon \n",
+ "h=2 #Molecular weight of hydrogen\n",
+ "co2=44.0 #Molecular weight of carbondioxide\n",
+ "h2o=18 #Molecular weight of water \n",
+ "o2=32.0 #Molecular weight of oxygen\n",
+ "R=8.314 #Universal gas constant in J/molK\n",
+ "\n",
+ "#Calculations\n",
+ "CO2=(0.84*(co2/c))\n",
+ "H2O=(0.16*(h2o/h))\n",
+ "cvd=H2O*hfg\n",
+ "HHV=cv+cvd\n",
+ "np=3.08/co2\n",
+ "nr=3.52/o2\n",
+ "n=np-nr\n",
+ "HHVv=HHV+(n*R*(t+273))\n",
+ "LHVv=cv+(n*R*(t+273))\n",
+ "\n",
+ "#Output\n",
+ "print\" The higher calorific value at constant pressure = \",HHV,\"kJ/kg fuel\" \n",
+ "print\"The higher calorific value at constant volume = \",round(HHVv,0),\"kJ/kg fuel\"\n",
+ "print\"The lower calorific value at constant volume = \",round(LHVv,0),\"kJ/kg fuel\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The higher calorific value at constant pressure = 47516.48 kJ/kg fuel\n",
+ "The higher calorific value at constant volume = 47417.0 kJ/kg fuel\n",
+ "The lower calorific value at constant volume = 43901.0 kJ/kg fuel\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 Page no 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "E=100 #The amount of excess air in percent\n",
+ "T=298 #The temperature of reactants in K\n",
+ "nc=1 #Number of moles of propane\n",
+ "hfch=-103.85 #Enthalpy of formation for propane in MJ/kmol fuel\n",
+ "hfc=-393.52 #Enthalpy of formation for carbondioxide in MJ/kmol fuel\n",
+ "hfh=-241.82 #Enthalpy of formation for water in MJ/kmol fuel\n",
+ "hfon=0 #Enthalpy of formation for both oxygen and nitrogen gas\n",
+ "T1=1500 #Assuming the products temperature for fist trail in K\n",
+ "hfc1=61.714 #The change in enthalpy for corbondioxide for trail temp in MJ/kmol fuel\n",
+ "hfh1=48.095 #The change in enthalpy for water for trail temp in MJ/kmol fuel\n",
+ "hfo1=40.61 #The change in enthalpy for oxygen for trail temp in MJ/kmol fuel\n",
+ "hfn1=38.405 #The change in enthalpy for nitrogen for trail temp in MJ/kmol fuel\n",
+ "T2=1600 #Assuming the products temperature for second trail in K\n",
+ "hfc2=67.58 #The change in enthalpy for corbondioxide for trail temp in MJ/kmol fuel\n",
+ "hfh2=52.844 #The change in enthalpy for water for trail temp in MJ/kmol fuel\n",
+ "hfo2=44.279 #The change in enthalpy for oxygen for trail temp in MJ/kmol fuel\n",
+ "hfn2=41.903 #The change in enthalpy for nitrogen for trail temp in MJ/kmol fuel\n",
+ "\n",
+ "#Calculations\n",
+ "HR=nc*hfch\n",
+ "x=HR-((3*hfc)+(4*hfh)+(5*hfon)+(37.6*hfon))\n",
+ "hfn=x/37.6\n",
+ "HP1=(HR-x)+(3*hfc1)+(4*hfh1)+(5*hfo1)+(37.6*hfn1)\n",
+ "HP2=(HR-x)+(3*hfc2)+(4*hfh2)+(5*hfo2)+(37.6*hfn2)\n",
+ "Te=(((HR-HP1)/(HP2-HP1))*(T2-T1))+T1\n",
+ "\n",
+ "#Output\n",
+ "print\" The adiabatic flame temperature for steady-flow process is \",round(Te,0),\"K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The adiabatic flame temperature for steady-flow process is 1510.0 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 Page no 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "T=600 #The initial temperature of air in K\n",
+ "p=1 #The initial pressure of air in atm\n",
+ "R=8.314 #Universal gas constant in J/molK\n",
+ "Tr=298 #The temperature of reactants in K\n",
+ "a=4.503 #Given Constants \n",
+ "b=-8.965*10**-3\n",
+ "c=37.38*10**-6\n",
+ "d=-36.49*10**-9\n",
+ "e=12.22*10**-12\n",
+ "hfc=-393.52 #Enthalpy of formation for carbondioxide in MJ/kmol fuel\n",
+ "hfh=-241.82 #Enthalpy of formation for water in MJ/kmol fuel\n",
+ "hfn=0 #Enthalpy of formation for nitrogen gas\n",
+ "hfc1=-74.87 #The enthalpy of formation for methane in MJ/kmol fuel \n",
+ "hfh1=9.247 #The change in enthalpy of the water in MJ/kmol\n",
+ "hfn1=8.891 #The change in enthalpy of nitrogen in MJ/kmol\n",
+ "Tc=3700 #The corresponding temperature for the enthalpy of guess nitrogen in K\n",
+ "T1=2800 #The temperature assumed for the first trail in K\n",
+ "hco1=140.444 #The change in enthalpy for the assume temp for carbondioxide in MJ/kmol\n",
+ "hh1=115.294 #The change in enthalpy for the assume temp for water in MJ/kmol\n",
+ "hn1=85.345 #The change in enthalpy for the assume temp for nitrogen in MJ/kmol\n",
+ "T2=2500 #The temperature assumed for the second trail in K\n",
+ "hco2=121.926 #The change in enthalpy for the assume temp for carbondioxide in MJ/kmol\n",
+ "hh2=98.964 #The change in enthalpy for the assume temp for water in MJ/kmol\n",
+ "hn2=74.312 #The change in enthalpy for the assume temp for nitrogen in MJ/kmol\n",
+ "T3=2600 #The temperature fo the third trail in K\n",
+ "hco3=128.085 #The change in enthalpy for the assume temp for carbondioxide in MJ/kmol\n",
+ "hh3=104.37 #The change in enthalpy for the assume temp for water in MJ/kmol\n",
+ "hn3=77.973 #The change in enthalpy for the assume temp for nitrogen in MJ/kmol\n",
+ "Tc1=3000 #Assume temperature for first trail in K\n",
+ "hcoa1=146.645 #The change in enthalpy for the assume temp for carbondioxide in MJ/kmol\n",
+ "hha1=120.813 #The change in enthalpy for the assume temp for carbondioxide in MJ/kmol\n",
+ "hna1=89.036 #The change in enthalpy for the assume temp for nitrogen in MJ/kmol\n",
+ "Tc2=3200 #Assume temperature for the second trail in K\n",
+ "hcoa2=165.331 #The change in enthalpy for the assume temp for carbondioxide in MJ/kmol\n",
+ "hha2=137.553 #The change in enthalpy for the assume temp for water in MJ/kmol\n",
+ "hna2=100.161 #The change in enthalpy for the assume temp for nitrogen in MJ/kmol\n",
+ "\n",
+ "#Calculations\n",
+ "HP=(1*hfc)+(2*hfh)+(7.52*hfn)\n",
+ "hch=(R*((a*(T-Tr))+((b/2.0)*(T**2-Tr**2))+((c/3.0)*(T**3-Tr**3))+((d/4.0)*(T**4-Tr**4))+((e/5.0)*(T**5-Tr**5))))/1000.0\n",
+ "HR=((hfc1+hch)+(2*hfh1)+(7.52*hfn1))\n",
+ "x=HR-HP\n",
+ "hfn2=x/7.52\n",
+ "HP1=hco1+(2*hh1)+(7.52*hn1)+(HR-x)\n",
+ "HP2=hco2+(2*hh2)+(7.52*hn2)+(HR-x)\n",
+ "HP3=hco3+(2*hh3)+(7.52*hn3)+(HR-x)\n",
+ "Ta1=(((HR-HP2)/(HP3-HP2))*(T3-T2))+T2\n",
+ "UR1=HR-(10.52*R*10**-3*T)\n",
+ "UP1=hcoa1+(2*hha1)+(7.52*hna1)+(HR-x)-(0.08746*Tc1)\n",
+ "UP2=hcoa2+(2*hha2)+(7.52*hna2)+(HR-x)-(0.08746*Tc2)\n",
+ "Tu=(((UR1-UP1)/(UP2-UP1))*(Tc2-Tc1))+Tc1\n",
+ "\n",
+ "#Output\n",
+ "print\"The adiabatic flame temperature at \"\n",
+ "print\"(a)Constant pressure process is \",round(Ta1,0),\"K\" \n",
+ "print\"(b)Constant volume process is \",round(Tu,3),\"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The adiabatic flame temperature at \n",
+ "(a)Constant pressure process is 2550.0 K\n",
+ "(b)Constant volume process is 3089.34 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.16 Page no 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "T=600.0 #Temperature at constant pressure process in K\n",
+ "p=1.0 #The pressure in atm\n",
+ "E=50.0 #The amount of excess air in percent\n",
+ "L=20.0 #The amount of less air in percent\n",
+ "cp=52.234 #Specific constant for methane in kJ/kmolK\n",
+ "t=298.0 #Assume the normal temperature in K\n",
+ "hfch=-74.87 #The enthalpy of formation for carbondioxide in MJ\n",
+ "ho=9.247 #The change in enthalpy of oxygen in MJ\n",
+ "hn=8.891 #The change in enthalpy of nitrogen in MJ\n",
+ "hfc1=-393.52 #The enthalpy of formation of carbondioxide in MJ\n",
+ "hfh1=-241.82 #The enthalpy of formation of water in MJ\n",
+ "Tc=2800.0 #The corresponding temperature in K\n",
+ "T1=2000 #The temperature for first trail in K\n",
+ "hfc11=91.45 #The enthalpy for the assume temp for carbondioxide in MJ\n",
+ "hfh11=72.689 #The change in enthalpy for the assume temp for water in MJ\n",
+ "hfn11=56.141 #The change in enthalpy for the assume temp for nitrogen in MJ\n",
+ "hfo11=59.199 #The change in enthalpy for the assume temp for oxygen in MJ\n",
+ "T2=2100 #The temperature for second trail in K\n",
+ "hfc22=97.5 #The enthalpy for the assume temp for carbondioxide in MJ\n",
+ "hfh22=77.831 #The change in enthalpy for the assume temp for water in MJ\n",
+ "hfn22=59.748 #The change in enthalpy for the assume temp for nitrogen in MJ\n",
+ "hfo22=62.986 #The change in enthalpy for the assume temp for oxygen in MJ\n",
+ "hfchr=-74.87 #The enthalpy of formation for methane in MJ\n",
+ "hor=9.247 #The change in enthalpy for oxygen in MJ\n",
+ "hnr=8.891 #The change in enthalpy for nitrogen in MJ\n",
+ "hfcop=-110.52 #The formation of enthalpy for carbonmoxide in MJ\n",
+ "hfcp=-393.52 #The formation of enthalpy for carbondioxide in MJ\n",
+ "hfhp=-241.82 #The formation of enthalpy for water in MJ\n",
+ "Tp1=2000.0 #The temperature for first trail in K\n",
+ "hco11=56.739 #The change in enthalpy for CO in MJ\n",
+ "hco211=91.45 #The change in enthalpy for CO2 in MJ\n",
+ "hh11=72.689 #The change in enthalpy for water in MJ\n",
+ "hn11=56.141 #The change in enthalpy for nitrogen in MJ\n",
+ "Tp2=2400 #The temperature for second trail in K\n",
+ "hco22=71.34 #The change in enthalpy for CO in MJ\n",
+ "hco222=115.788 #The change in enthalpy for CO2 in MJ\n",
+ "hh22=93.604 #The change in enthalpy for water in MJ\n",
+ "hn22=70.651 #The change in enthalpy for nitrogen in MJ\n",
+ "Tp3=2300.0 #The temperature for first trail in K\n",
+ "hco33=67.676 #The change in enthalpy for CO in MJ\n",
+ "hco233=109.671 #The change in enthalpy for CO2 in MJ\n",
+ "hh33=88.295 #The change in enthalpy for water in MJ\n",
+ "hn33=67.007 #The change in enthalpy for nitrogen in MJ\n",
+ "hccc=-283.022 #The only combustible substance is CO in MJ/kmol\n",
+ "\n",
+ "#Calculations\n",
+ "hch=cp*(T-t)*10**-3\n",
+ "HR=hfch+hch+(3*ho)+(11.28*hn)\n",
+ "HP=hfc1+(2*hfh1)\n",
+ "x=HR-HP\n",
+ "hn2=x/11.28\n",
+ "HP1=hfc11+(2*hfh11)+(11.28*hfn11)+(hfo11)+(HR-x)\n",
+ "HP2=hfc22+(2*hfh22)+(11.28*hfn22)+(hfo22)+(HR-x)\n",
+ "Ta1=(((HR-HP1)/(HP2-HP1))*(T2-T1))+T1\n",
+ "X=2*(2-1.6)\n",
+ "HRr=hfchr+hch+(1.6*hor)+(6.01*hnr)\n",
+ "HPp=(0.8*hfcop)+(0.2*hfcp)+(2*hfhp)\n",
+ "HPp1=(0.8*hco11)+(0.2*hco211)+(2*hh11)+(6.016*hn11)-HPp\n",
+ "HPp2=(0.8*hco22)+(0.2*hco222)+(2*hh22)+(6.016*hn22)+HPp\n",
+ "HPp3=(0.8*hco33)+(0.2*hco233)+(2*hh33)+(6.016*hn33)+HPp\n",
+ "Ta2=(((HRr-HPp3)/(HPp2-HPp3))*(Tp2-Tp3))+Tp3\n",
+ "Q=-0.8*hccc #The thermal energy loss in MJ/kmol fuel\n",
+ "\n",
+ "#Output\n",
+ "print\" The adiabatic flame temperature having \"\n",
+ "print\"(a)50 percent excess air is \",round(Ta1,1),\"K\"\n",
+ "print\"(b)20 percent less air is \",round(Ta2,2),\"K\"\n",
+ "print\"The loss of thermal energy due to incomplete combustion is \",round(Q,2),\"MJ/kmol fuel\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The adiabatic flame temperature having \n",
+ "(a)50 percent excess air is 2027.6 K\n",
+ "(b)20 percent less air is 2311.22 K\n",
+ "The loss of thermal energy due to incomplete combustion is 226.42 MJ/kmol fuel\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.18 Page no 98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "T1=3000 #Given temperature in K\n",
+ "T2=4000 #Given temperature in K\n",
+ "p=1 #The pressure in atm\n",
+ "KP1=1.117 #Natural logarithm of equilibrium constant at 3000 K \n",
+ "KP2=-1.593 #Natural logarithm of equilibrium constant at 4000 K\n",
+ "a1=0.4 #The dissociation of 1 mole of CO2 for the first trail\n",
+ "a2=0.5 #The dissociation of 1 mole of CO2 for the second trail \n",
+ "K1=3.674 #The value of equilibrium constant for the first trail \n",
+ "K2=2.236 #The value of equilibrium constant for the second trail\n",
+ "a3=0.9 #The dissociation of 1 mole of CO2 for the first trail\n",
+ "a4=0.89 #The dissociation of 1 mole of CO2 for the second trail\n",
+ "K3=0.1995 #The value of equilibrium constant for the first trail \n",
+ "K4=0.2227 #The value of equilibrium constant for the second trail \n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Kp1=math.exp(KP1)\n",
+ "Kp2=math.exp(KP2)\n",
+ "a12=(((K1-Kp1)/(K1-K2))*(a2-a1))+a1\n",
+ "A12=a12*100\n",
+ "a23=(((Kp2-K4)/(K3-K4))*(a3-a4))+a4\n",
+ "A23=a23*100\n",
+ "\n",
+ "#output\n",
+ "print\"The percent dissociation of carbondioxide into carbonmonoxide and oxygen at \"\n",
+ "print\"(a) at 3000 K and 1 atm pressure = \",round(A12,3),\"percent\" \n",
+ "print\"(b) at 4000 K and 1 atm pressure = \",round(A23,1),\"percent\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percent dissociation of carbondioxide into carbonmonoxide and oxygen at \n",
+ "(a) at 3000 K and 1 atm pressure = 44.3 percent\n",
+ "(b) at 4000 K and 1 atm pressure = 89.8 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.19 Page no 99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "p=1 #Initial pressure in atm\n",
+ "T=300 #Initial temperature in K\n",
+ "Tc=2400 #To calculate the molefraction of the products at this temperature in K\n",
+ "KP1=3.866 #Natural logarithm of equilibrium constant at 2400 K for the equation\n",
+ "a=0.098 #The dissociation of 1 mole of CO2\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "K1=math.exp(KP1)\n",
+ "nr=1+0.5\n",
+ "Pp=(p*Tc)/(nr*T)\n",
+ "np=(a+2)/2.0\n",
+ "xco=(2*(1-a))/(2+a)\n",
+ "xc=(2*a)/(2+a)\n",
+ "xo=a/(2.0+a)\n",
+ "PP=5.333*np\n",
+ "\n",
+ "#output\n",
+ "print\"Mole fraction of the carbondioxide is \",round(xco,3)\n",
+ "print\"Mole fraction of the carbonmonoxide is \",round(xc,3)\n",
+ "print\"Mole fraction of oxygen is \",round(xo,3)\n",
+ "print\"Pressure of the product is \",round(PP,3),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mole fraction of the carbondioxide is 0.86\n",
+ "Mole fraction of the carbonmonoxide is 0.093\n",
+ "Mole fraction of oxygen is 0.047\n",
+ "Pressure of the product is 5.594 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.20 Page no 100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "t=25.0 #The temperature of air in degree centigrade\n",
+ "p=1.0 #The pressure of air in atm\n",
+ "T1=2200.0 #Given first temperature in K\n",
+ "T2=2400.0 #Given second temperature in K\n",
+ "h1=59.86 #The change in enthalpy of hydrogen at 2200 K in MJ/kmol\n",
+ "h2=66.915 #The change in enthalpy of hydrogen at 2400 K in MJ/kmol\n",
+ "T=298.0 #The temperature of air in K\n",
+ "HR=0 #The total enthalpy on the reactants side since all the reactants are elements\n",
+ "Kp1=-6.774 #Natural logarithm of equilibrium constant at 2200 K for the equation \n",
+ "a1=0.02 #By trail and error method the degree of dissociation of H2O\n",
+ "hfh=-241.82 #The enthalpy of formation of water at both 2200 and 2400 K in MJ/kmol\n",
+ "hfh1=83.036 #The change in enthalpy of water at 2200 K in MJ/kmol\n",
+ "hfd1=59.86 #The change in enthalpy of hydrogen at 2200 K in MJ/kmol\n",
+ "hfo1=66.802 #The change in enthalpy of oxygen at 2200 K in MJ/kmol\n",
+ "hfn1=63.371 #The change in enthalpy of nitrogen at 2200 K in MJ/kmol\n",
+ "a2=0.04 #By trail and error method the degree of dissociation of H2O at 2400 K\n",
+ "hfh2=93.604 #The change in enthalpy of water at 2400 K in MJ/kmol\n",
+ "hfd2=66.915 #The change in enthalpy of hydrogen at 2400 K in MJ/kmol\n",
+ "hfo2=74.492 #The change in enthalpy of oxygen at 2400 K in MJ/kmol\n",
+ "hfn2=70.651 #The change in enthalpy of nitrogen at 2400 K in MJ/kmol\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "K1=math.exp(Kp1)\n",
+ "HP1=(0.98*(hfh+hfh1))+(0.02*hfd1)+(0.01*hfo1)+(1.88*hfn1) \n",
+ "HP2=(0.96*(hfh+hfh2))+(0.04*hfd2)+(0.02*hfo2)+(1.88*hfn2) \n",
+ "H1=HP1-HR\n",
+ "H2=HP2-HR\n",
+ "Tl=(((T2-T1)/(HP2-HP1))*(HR-HP1))+T1\n",
+ "\n",
+ "#Output\n",
+ "print\"The adiabatic flame temperature taking dissociation into account is \",T1+236,\"K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The adiabatic flame temperature taking dissociation into account is 2436.0 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/chap4.ipynb b/Fundamental_of_internal_combustion_engines/chap4.ipynb new file mode 100755 index 00000000..c8818341 --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/chap4.ipynb @@ -0,0 +1,793 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4:Fuel Air Cycles and their analysis"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page No 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=8.5 #The compression ratio \n",
+ "sv=1.4 #The specific heat at constant volume in percent\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "n=1-(1/r)**(sv-1) \n",
+ "ef=(((1-n)/n)*(sv-1)*(math.log(r))*(sv/100.0))*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The efficiency decreases by \",round(ef,3),\"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency decreases by 0.885 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page No 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=18.0 #The compression ratio \n",
+ "l=6.0 #The cut off taking place corresponding of the stroke in percent\n",
+ "sc=2.0 #The specific heat at constant volume increases in percent\n",
+ "cv=0.717 #The specific heat at constant volume in kJ/kgK\n",
+ "R=0.287 #Gas constant in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Vs=(r-1)\n",
+ "B=((l/100.0)*Vs)+1\n",
+ "cp=cv+R\n",
+ "R1=cp/cv\n",
+ "n=1-(((((1/r)**(R1-1))*(B**R1-1))/(R1*(B-1)))) \n",
+ "dn=(((1-n)/n)*((R1-1)*((math.log(r))-(((B**R1)*math.log(B))/(B**R1-1))+(1/B)))*(sc/100.0))*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The efficiency decreases by \",round(dn,1),\"percent\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency decreases by 1.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page No 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=8 #The compression ratio\n",
+ "af=15 #Air/fuel ratio\n",
+ "p1=1 #The pressure at the beginning of a compression stroke in bar\n",
+ "t=60 #The temperature at the beginning of a compression stroke in degree centigrade\n",
+ "cv=44000 #The calorific value of the fuel in kJ/kg\n",
+ "n=1.32 #The index of the compression \n",
+ "Cv=0.717 #specific heat at constant volume in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "T1=t+273\n",
+ "p2=p1*(r)**n\n",
+ "T2=T1*r**(n-1)\n",
+ "f=(1/(af+1))\n",
+ "a=(af/(af+1))\n",
+ "q23=cv/(af+1)\n",
+ "T3=((-10430+((10430)**2+(4*494.8*10**5))**(1/2.0))/2.0)\n",
+ "p3=(T3/T1)*(r)*p1\n",
+ "T31=(q23/Cv)+T2\n",
+ "p31=(T31/T1)*r*p1\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The Maximum temperature in the cylinder = \",round(T3,0),\"K\" \n",
+ "print\"The Maximum pressure in the cylinder P3 = \",round(p3,0),\"bar\" \n",
+ "print\"(b)With constant value of Cv \"\n",
+ "print\"The Maximum temperature in the cylinder = \",round(T31,0),\"K\" \n",
+ "print\"The Maximum pressure in the cylinder P3 = \",round(p31,1),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The Maximum temperature in the cylinder = 3541.0 K\n",
+ "The Maximum pressure in the cylinder P3 = 85.0 bar\n",
+ "(b)With constant value of Cv \n",
+ "The Maximum temperature in the cylinder = 4483.0 K\n",
+ "The Maximum pressure in the cylinder P3 = 107.7 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page No 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=21 #The compression ratio \n",
+ "af=29 #Air/fuel ratio\n",
+ "T=1000 #The temperature at the end of compression in K\n",
+ "cv=42000 #The calorific value of the in kJ/kg\n",
+ "R=0.287 #Gas constant in kJ/kgK\n",
+ "\n",
+ "#Calculations \n",
+ "q23=cv/(af+1)\n",
+ "T3=(-0.997+(((0.997)**2)+(4*2411*14*10**-6))**(1/2.0))/(28.0*10.0**-6)\n",
+ "V3=(T3/T)\n",
+ "Vs=(r-1)\n",
+ "V=V3-1\n",
+ "pc=(V/Vs)*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The percentage of stroke at which combustion is complete = \",round(pc,3),\"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of stroke at which combustion is complete = 6.706 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 Page No 122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=16.0 #The compression ratio \n",
+ "l=6.0 #The cut-off of the stroke in percent\n",
+ "p3=70.0 #The maximum pressure obtained in bar\n",
+ "p1=1.0 #The pressure at the beginning of compression in bar\n",
+ "T1=(100.0+273.0) #The temperature at the beginning of compression in K\n",
+ "R=0.287 #Gas constant in kJ/kgK\n",
+ "g=1.4 #Assume the isentropic index \n",
+ "\n",
+ "#Calculations\n",
+ "T2=T1*(r)**(g-1)\n",
+ "Cv=(1/(T2-T1))*(0.716+125*10**-6*(T2**2-T1**2))\n",
+ "Cp=Cv+R\n",
+ "g1=Cp/Cv\n",
+ "T21=T1*(r)**(g1-1)\n",
+ "Cv1=(1/(T21-T1))*((0.716+125*10**-6*(T21**2-T1**2)))\n",
+ "Cp1=Cv1+R\n",
+ "g2=Cp1/Cv1\n",
+ "gm=1.358 #mean value\n",
+ "T22=T1*(r)**(gm-1)\n",
+ "p2=(T22/T1)*r*p1\n",
+ "T3=(p3/p2)*T22\n",
+ "V=((l/100.0)*(r-1))+1\n",
+ "T4=(V)*T3\n",
+ "p4=p3\n",
+ "g3=1.3\n",
+ "V5=r/V\n",
+ "T5=T4*(1/V5)**(g3-1)\n",
+ "Cv2=((0.716*(T5-T4))+(62.5*10**-6*(T5**2-T4**2)))/(T5-T4)\n",
+ "Cp2=Cv2+R\n",
+ "g4=Cp2/Cv2\n",
+ "T51=T4*(1/V5)**(g4-1)\n",
+ "Cv3=((0.716*(T51-T4))+(62.5*10**-6*(T51**2-T4**2)))/(T51-T4)\n",
+ "Cp3=Cv3+R\n",
+ "g5=Cp3/Cv3\n",
+ "T52=T4*(1/V5)**(g5-1)\n",
+ "p5=(T52/T1)*p1\n",
+ "\n",
+ "#Output\n",
+ "print\"The pressure and temperature at all points of the cycle \\nat point 2: Temperature T2 = \",round(T22,0),\"K and Pressure P2 = \",round(p2,2),\" bar\" \n",
+ "print\"at point 3 :Temperature T3 = \",round(T3,1),\" K and Pressure P3 = \",p3,\" bar\" \n",
+ "print\"at point 4 : Temperature T4 = \",T4,\" K and Pressure P4 = \",p4,\"bar\" \n",
+ "print\"at point 5 :Temperature T5 = \",round(T52,0),\" K and Pressure P5 = \",round(p5,2),\"bar\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure and temperature at all points of the cycle \n",
+ "at point 2: Temperature T2 = 1006.0 K and Pressure P2 = 43.17 bar\n",
+ "at point 3 :Temperature T3 = 1631.9 K and Pressure P3 = 70.0 bar\n",
+ "at point 4 : Temperature T4 = 3100.5625 K and Pressure P4 = 70.0 bar\n",
+ "at point 5 :Temperature T5 = 1698.0 K and Pressure P5 = 4.55 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page No 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=8 #Compression ratio\n",
+ "lcv=44000 #The lower heating value of the fuel in kJ/kg\n",
+ "af=15 #The air/fuel ratio\n",
+ "Cv=0.71 #The specific heat at constant volume in kJ/kgK\n",
+ "p=1 #The pressure at the beginning of the compression in bar\n",
+ "t=60 #The temperature at the beginning of the compression in degree centigrade\n",
+ "Mo=32 #Molecular weight of oxygen\n",
+ "Mn=28.161 #Molecular weight of nitrogen\n",
+ "Mh=18 #Molecular weight of water \n",
+ "n=1.3 #Polytrpic index\n",
+ "\n",
+ "#Calculations\n",
+ "T1=(t+273)\n",
+ "sa=(12.5*(Mo+(3.76*Mn)))/((12*8)+(1*Mh))\n",
+ "Y=af*(((12*8)+(1*Mh))/(Mo+(3.76*Mn)))\n",
+ "x=(12.5-Y)*2\n",
+ "nb=1+Y+(Y*3.76)\n",
+ "na=x+7.8+9+46.624 \n",
+ "Me=((na-nb)/nb)*100\n",
+ "T2=T1*(r)**(n-1)\n",
+ "T3=(lcv/(af+1))*(1/Cv)+(T2)\n",
+ "p3=r*(T3/T1)*p\n",
+ "p31=p3*(na/nb)\n",
+ "\n",
+ "#Output\n",
+ "print\"The percentage molecular expansion is \",round(Me,0),\"percent\"\n",
+ "print\"(a) Without considering the molecular expansion \"\n",
+ "print\" The maximum temperature is \",round(T3,0),\"K\" \n",
+ "print\"The maximum pressure is \",round(p3,0),\"bar\"\n",
+ "print\"(b) With molecular expansion \" \n",
+ "print\"The maximum temperature is \",round(T3,0),\"K\" \n",
+ "print\"The maximum pressure is \",round(p31,1),\"bar\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage molecular expansion is 6.0 percent\n",
+ "(a) Without considering the molecular expansion \n",
+ " The maximum temperature is 4495.0 K\n",
+ "The maximum pressure is 108.0 bar\n",
+ "(b) With molecular expansion \n",
+ "The maximum temperature is 4495.0 K\n",
+ "The maximum pressure is 114.4 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7 Page No 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "f=0.03 #The residual fraction of an engine\n",
+ "e=1.2 #The equivalence ratio\n",
+ "F=0.0795 #Fuel/air ratio for corresponding equivalence ratio \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "T=1+F\n",
+ "fa=1-f\n",
+ "ff=F*(fa)\n",
+ "ra=f\n",
+ "rf=ra*F\n",
+ "\n",
+ "#Output\n",
+ "print\"Fresh air = \",fa,\"kg\" \n",
+ "print\"Fresh fuel = \",ff,\"kg\" \n",
+ "print\"Air in residual = \",ra,\"kg\" \n",
+ "print\"Fuel in residual = \",rf,\"kg\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fresh air = 0.97 kg\n",
+ "Fresh fuel = 0.077115 kg\n",
+ "Air in residual = 0.03 kg\n",
+ "Fuel in residual = 0.002385 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.8 Page No 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "T=800 #The given temperature in K\n",
+ "e=1 #The equivalence ratio \n",
+ "hi=154.723 #Sensible Enthalpy for isooctane at 800 K in MJ/kmol \n",
+ "ho=15.841 #Sensible Enthalpy for oxygen at 800 K in MJ/kmol \n",
+ "hn=15.046 #Sensible Enthalpy for nitrogen at 800 K in MJ/kmol\n",
+ "nc=0.00058 #Number of kmoles of C8H18 for equivalence ratio for 1 kg of air \n",
+ "no=0.00725 #Number of kmoles of oxygen for equivalence ratio for 1 kg of air \n",
+ "nn=0.0273 #Number of kmoles of nitrogen for equivalence ratio for 1 kg of air \n",
+ "R=8.314 #Gas constant in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Hs=(nc*hi)+(no*ho)+(nn*hn)\n",
+ "Hs1=Hs*1000\n",
+ "n=nc+no+nn\n",
+ "Us=Hs-(n*R*10**-3*(T-298))\n",
+ "Us1=Us*1000\n",
+ "\n",
+ "#Output\n",
+ "print\"Total sensible enthalpy of reactants = \",round(Hs1,3),\"kJ/kg air\" \n",
+ "print\"Sensible internal energy of reactants = \",round(Us1,3),\"kJ/kg air\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total sensible enthalpy of reactants = 615.342 kJ/kg air\n",
+ "Sensible internal energy of reactants = 468.723 kJ/kg air\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.9 Page No 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "T=500.0 #The given temperature in K\n",
+ "e=1.0 #Equivalence ratio \n",
+ "Ai=0.0662 #The amount of isooctane for 1 kg of air in kg\n",
+ "Ta=298.0 #Consider the ambient temperature in K \n",
+ "R=8.314 #Gas constant in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "E=((0.0662*((0.44*math.log(T/Ta))+(3.67*10**-3*(T-Ta))))+((0.921*math.log(T/Ta))+(2.31*10**-4*(T-Ta))))*1000\n",
+ "Ri=Ri/114.0\n",
+ "W=(0.5874-(0.662*Ri*math.log(T/Ta))-(0.287*math.log(T/Ta)))*1000\n",
+ "\n",
+ "#Output\n",
+ "print\"The isentropic compression functions at 500 K for the unburned\" \n",
+ "print\"isooctsne-air mixture are \",round(E,1),\"J/kg air and\",round(W,1),\"J/kg air\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The isentropic compression functions at 500 K for the unburned\n",
+ "isooctsne-air mixture are 587.4 J/kg air and 438.9 J/kg air\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.10 Page No 133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=7.8 #Compression ratio \n",
+ "p=1.0 #The pressure at the start of compression in atm\n",
+ "T1=335.0 #The temperature at the start of compression in K\n",
+ "W1=100 #Isentropic compression function for T1 in J/kg air K \n",
+ "T2=645 #The temperature corresponding to isentropic compression function in J/kg air K \n",
+ "U1=35 #Internal energy corresponding to temp T1 in kJ/kg air \n",
+ "U2=310 #Internal energy corresponding to temp T2 in kJ/kg air \n",
+ "E1=120 #Isentropic compression function at T1 \n",
+ "E2=910 #Isentropic compression function at T2 \n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "W2=W1-(292*math.log(1/r))\n",
+ "V1=(292*T1)/(p*10.0**5)\n",
+ "p2=p*(T2/T1)*r\n",
+ "V2=V1/r\n",
+ "W=U2-U1\n",
+ "p21=(math.exp((E2-E1)/292.0)) \n",
+ "\n",
+ "#Output\n",
+ "print\"(a)At the end of the compression stroke\"\n",
+ "print\"The temperature is \",T2,\"K\" \n",
+ "print\"The pressure is \",round(p2,0),\"atm\" \n",
+ "print\"The volume per unit mass of air is \",round(V2,3),\"m**3/kg air\"\n",
+ "print\"The pressure is \",round(p21,0),\"atm\" \n",
+ "print\"(b)The work input during compression is \",W,\"kJ/kg air\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)At the end of the compression stroke\n",
+ "The temperature is 645 K\n",
+ "The pressure is 15.0 atm\n",
+ "The volume per unit mass of air is 0.125 m**3/kg air\n",
+ "The pressure is 15.0 atm\n",
+ "(b)The work input during compression is 275 kJ/kg air\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.11 Page No 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "p=65 #The pressure in the cylinder in bar\n",
+ "r=10 #The compression ratio \n",
+ "V3=0.1 #The volume per unit mass of air at the start of expansion in m**3/kg air \n",
+ "p3=p*100 #The pressure in the cylinder after the completion of combustion in kN/m**2\n",
+ "T3=2240 #The temperature from the chart corresponding to p3,V3 in K\n",
+ "u3=-1040 #The energy from the chart in kJ/kg air \n",
+ "s3=8.87 #The entropy from the chart in kJ/kg air K\n",
+ "T4=1280 #The temperature from the chart corresponding to p4,V4 in K \n",
+ "u4=-2220 #The energy from the chart in kJ/kg air \n",
+ "p4=4.25 #The pressure from the chart in bar \n",
+ "\n",
+ "#Calculations \n",
+ "s4=s3\n",
+ "V4=r*V3\n",
+ "W=-(u4-u3)\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)At the end of expansion stroke\"\n",
+ "print\"The pressure is \",p4,\"bar\" \n",
+ "print\"The temperature is \",T4,\"K\" \n",
+ "print\"The volume is \",V4,\"m**3/kg air\" \n",
+ "print\"(b)The work during the expansion stroke is \",W,\"kJ/kg air\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)At the end of expansion stroke\n",
+ "The pressure is 4.25 bar\n",
+ "The temperature is 1280 K\n",
+ "The volume is 1.0 m**3/kg air\n",
+ "(b)The work during the expansion stroke is 1180 kJ/kg air\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.12 Page no 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "#From Table 4.4\n",
+ "H1=-224.1*1000 #MJ/mol, Enthalpy of C8H18\n",
+ "H2=-393.52*1000 #Enthalpy of CO2\n",
+ "H3=-241.82*1000 #Enthalpy of H2O\n",
+ "U1=-204.1*1000 #MJ/mol, Internal energyof C8H18\n",
+ "U2=-393.52*1000 #Internal energy of CO2\n",
+ "U3=-240.6*1000 #Internal energy of H2O\n",
+ "\n",
+ "\n",
+ "M1=114.0 #g, molecular wt of C8H18\n",
+ "M2=32.0 #g, molecular wt of O2\n",
+ "M3=28.0 #g, molecular wt of N2\n",
+ "M4=44.0 #g, molecular wt of CO2\n",
+ "M5=18.0 #g, molecular wt of H2O\n",
+ "#For 1 kg air, from the eq., the fraction of wt are\n",
+ "x1=0.0661 \n",
+ "x2=0.232\n",
+ "x3=0.768\n",
+ "x4=0.204\n",
+ "x5=0.094\n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "f=sympy.Symbol(\"f\")\n",
+ "n1=(x1/M1)*(1-f) #No. of kmoles of C8H18\n",
+ "n2=x2/M2*(1-f)\n",
+ "n3=x3/M3\n",
+ "n4=x4/M4*f\n",
+ "n5=x5/M5*f\n",
+ "N1=(n1*H1+n4*H2+n5*H3)\n",
+ "N2=n1*U1+n4*U2+n5*U3\n",
+ "\n",
+ "#Result\n",
+ "print \"Standard Enthalpy of formation is\",N1\n",
+ "print \"Internal energy of formation is\",N2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Standard Enthalpy of formation is -2957.40091174907*f - 129.938684210526\n",
+ "Internal energy of formation is -2962.62629186603*f - 118.342192982456\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.13 Page No 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Tu=645.0 #The temperature at the end of compression process in K\n",
+ "usu=310.0 #The internal energy at the end of compression process in kJ/kg air \n",
+ "pu=(15.4*1.013) #The pressure at the end of the compression process in bar \n",
+ "Vu=0.124 #The volume at the end of the compression process in m**3/kg air \n",
+ "e=1.0 #Equivalence ratio \n",
+ "f=0.065 #Burned gas fraction \n",
+ "Tb=2820.0 #The temperature for constant volume \n",
+ "pb=6500.0 #The pressure for constant volume \n",
+ "hsu=440.0 #The enthalpy from chart corresponding to temp Tu in kJ/kg air \n",
+ "pb1=1560.0 #The pressure for constant pressure adiabatic combustion in kN/m**2 \n",
+ "ub1=-700.0 #Trail and error along the pb internal energy in kJ/kg air\n",
+ "Tb1=2420.0 #The temperature for constant pressure \n",
+ "\n",
+ "#Calculations \n",
+ "ufu=-118.5-(2963*f)\n",
+ "ub=usu-ufu\n",
+ "Vb=Vu\n",
+ "hfu=-129.9-(2958*f)\n",
+ "hb=hsu+hfu\n",
+ "vb1=(118-ub1)/pb\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)For constant volume adiabatic combustion\"\n",
+ "print\"The temperature is \",Tb,\"K\" \n",
+ "print\"The pressure is \",pb,\"kN/m**2\"\n",
+ "print\"(b)For constant pressure adiabatic combustion\"\n",
+ "print\"The temperature is \",Tb1,\"K\" \n",
+ "print\"The pressure is \",pb1,\"kN/m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)For constant volume adiabatic combustion\n",
+ "The temperature is 2820.0 K\n",
+ "The pressure is 6500.0 kN/m**2\n",
+ "(b)For constant pressure adiabatic combustion\n",
+ "The temperature is 2420.0 K\n",
+ "The pressure is 1560.0 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.14 Page No 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=8.0 #The compression ratio \n",
+ "T1=350.0 #The given temperature at the start of compression in K\n",
+ "p=1.0 #The given pressure at the start of compression in bar\n",
+ "f=0.08 #The exhaust residual fraction \n",
+ "cv=44000 #The calorific value in kJ/kg\n",
+ "W1=150 #Isentropic compression functions for corresponding temp T1 in J/kg air K\n",
+ "T2=682 #The temperature corresponding to isentropic compression function in K \n",
+ "us2=350 #The internal energy corresponding to temp T2 in K\n",
+ "us1=40 #The internal energy corresponding to temp T1 in K \n",
+ "T3=2825 #The temperature at point 3 corresponding to u3,V3 on the burned gas chart in K\n",
+ "p3=7100 #The pressure at point 3 in kN/m**2 \n",
+ "s3=9.33 #Entropy at point 3 in kJ/kg air K \n",
+ "u4=-1540 #The internal energy at point 4 corresponding to V4,s4 in kJ/kg air \n",
+ "p4=570 #The pressure at point 4 in kN/m**2 \n",
+ "T4=1840 #The temperature at point 4 in K \n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "W2=W1-(292*math.log(1/r))\n",
+ "V1=(292*T1)/(p*10.0**5)\n",
+ "p2=p*(T2/T1)*r\n",
+ "V2=V1/r\n",
+ "Wc=us2-us1\n",
+ "ufu=-118.5-(2963*f)\n",
+ "u3=us2+ufu\n",
+ "V3=V2\n",
+ "s4=s3\n",
+ "V4=V1\n",
+ "We=u3-u4 \n",
+ "Wn=We-Wc\n",
+ "nth=((Wn)/((1-f)*0.0662*cv))*100\n",
+ "imep=((Wn*1000)/(V1-V2))/10.0**5\n",
+ "nv=(((1-f)*287*298)/(1.013*10**5*(1-0.125)))*100\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)At point 2, \\nThe temperature is \",T2,\" K \\nThe pressure is \",round(p2,1),\"atm\"\n",
+ "print\"At point 3, \\nThe temperature is \",T3,\" K \\nThe pressure is \",p3,\"kN/m**2\" \n",
+ "print\"At point 4, \\nThe temperature is \",T4,\" K \\nThe pressure is \",p4,\"kN/m**2\" \n",
+ "print\"(b)The indicated thermal efficiency is \",round(nth,1),\"percent\" \n",
+ "print\"(c)The indicated mean effective pressure is \",round(imep,0),\" bar\" \n",
+ "print\"(d)The volumetric efficiency is \",round(nv,2), \"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)At point 2, \n",
+ "The temperature is 682 K \n",
+ "The pressure is 15.6 atm\n",
+ "At point 3, \n",
+ "The temperature is 2825 K \n",
+ "The pressure is 7100 kN/m**2\n",
+ "At point 4, \n",
+ "The temperature is 1840 K \n",
+ "The pressure is 570 kN/m**2\n",
+ "(b)The indicated thermal efficiency is 45.7 percent\n",
+ "(c)The indicated mean effective pressure is 14.0 bar\n",
+ "(d)The volumetric efficiency is 88.77 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/chap9.ipynb b/Fundamental_of_internal_combustion_engines/chap9.ipynb new file mode 100755 index 00000000..a48803b0 --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/chap9.ipynb @@ -0,0 +1,512 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter9:Carburettors and Fuel Injection in SI Engines "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1 page no: 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "ma=5 #Mass flow rate of air per min for a simple jet carburettor in kg/min\n",
+ "mf=0.4 #Mass flow rate of fuel in kg/min\n",
+ "df=780 #Density of the fuel in kg/m**3\n",
+ "p1=1.013 #The initial pressure of air in bar\n",
+ "t1=27 #The initial temperature of air in degree centigrade\n",
+ "C2=90 #The air flow velocity in m/s\n",
+ "Cva=0.8 #The velocity coefficient for the venturi\n",
+ "Cdf=0.6 #The coefficient of discharge of the main fuel jet \n",
+ "Cpd=0.75 #The pressure drop across the fuel metering oriface\n",
+ "Cp=1005 #The specific heat of gas in J/kgK\n",
+ "g=1.4 #Adiabatic index\n",
+ "R=287 #Real gas constant in J/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "p2=p1*(1-(C2**2/(Cva**2*2*Cp*(t1+273))))**(g/(g-1))\n",
+ "da1=((p1*10**5)/(R*(t1+273)))\n",
+ "da2=((da1)*(p2/p1)**(1/g))\n",
+ "A2=((ma/60.0)/(da2*C2))*10**4\n",
+ "d2=(4*A2/math.pi)**(1/2.0)\n",
+ "pv=p1-p2\n",
+ "pj=Cpd*pv\n",
+ "Aj=((mf/60.0)/(Cdf*(2*df*pj*10**5)**(1/2.0)))*10**6\n",
+ "dj=(4*Aj/math.pi)**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"The throat diameter of the choke = \",round(d2,3),\"cm\" \n",
+ "print\"The oriface diameter = \",round(dj,1),\"mm\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The throat diameter of the choke = 3.251 cm\n",
+ "The oriface diameter = 2.2 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2 page no: 281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Vs=0.002 #The swept volume in m**3\n",
+ "nv=75.0 #Volumetric efficiency in percent\n",
+ "N=4500.0 #The engine rpm\n",
+ "p1=1.013 #The initial pressure of air in bar\n",
+ "R=287.0 #Real gas constant in J/kgK\n",
+ "t1=15.0 #The atmospheric temperature in degree centigrade\n",
+ "Cp=1005.0 #The specific heat of gas in J/kgK\n",
+ "g=1.4 #Adiabatic index\n",
+ "C2=100.0 #The air flow velocity at choke in m/s\n",
+ "Cda=0.85 #The velocity coefficient for the venturi\n",
+ "Cdf=0.66 #The coefficient of discharge of the main fuel jet \n",
+ "sf=0.75 #The specific gravity of fuel\n",
+ "d=0.4 #The ratio of the diameter to choke diameter\n",
+ "af=14.0 #The air fuel ratio\n",
+ "gf=9.81 #The gravitational force constant in m/s**2\n",
+ "Z=0.006 #The petrol surface below the choke in m\n",
+ "df=750.0 #The density of the fuel in kg/m**3\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Va=((nv/100.0)*Vs*N)/(2.0*60.0)\n",
+ "V1=Va/2.0\n",
+ "ma=(p1*10**5*V1)/(R*(t1+273))\n",
+ "p2=p1*(1-(C2**2/(2*Cp*(t1+273))))**(g/(g-1))\n",
+ "da1=((p1*10**5)/(R*(t1+273)))\n",
+ "da2=da1*(p2/p1)**(1/g)\n",
+ "A2=(ma/(da2*C2*Cda))*10**6\n",
+ "D=((A2*4)/(math.pi*0.84))**(1/2.0)\n",
+ "mf=ma/af\n",
+ "pm=(p1-p2-(gf*Z*df/10.0**5))*10**5\n",
+ "Aj=(mf/(Cdf*(2*df*pm)**(1/2.0)))*10**6\n",
+ "dj=(4*Aj/math.pi)**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"The diameter of the choke = \",round(D,2),\"mm\" \n",
+ "print\"The diameter of the jet in = \",round(dj,2),\"mm\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diameter of the choke = 22.89 mm\n",
+ "The diameter of the jet in = 1.26 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 page no: 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=0.08 #The diameter of the bore in m\n",
+ "L=0.09 #The length of the stroke in m\n",
+ "N=4000.0 #The engine rpm\n",
+ "C=84.0 #The carbon content in the fuel by mass in percent\n",
+ "H=16.0 #The hydrogen content in the fuel by mass in percent\n",
+ "nv=80.0 #The volumetric efficiency of the engine in percent\n",
+ "p1=1.0 #The pressure at ambient condition in bar\n",
+ "t1=25.0 #The temperature at ambient condition in degree centigrade\n",
+ "p=0.06 #The depression at venturi throat in bar\n",
+ "ma=0.95 #The actuat quantity of air supplied\n",
+ "Ra=287.0 #Real gas constant in J/kgK\n",
+ "Rf=98.0 #Real gas constant in J/kgK\n",
+ "n=4.0 #Number of cylinders\n",
+ "Cp=1005.0 #The specific heat of gas in J/kgK\n",
+ "g=1.4 #Adiabatic index\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "V=(math.pi/4.0)*d**2*L*(nv/100.0)*(N/(2.0*60.0))*n\n",
+ "Af=(100/23.0)*((C*(32/12.0))+(H*8))/100.0\n",
+ "mfa=Af*ma\n",
+ "Aaf=mfa\n",
+ "da=(p1*10**5)/(Ra*(t1+273))\n",
+ "dv=(p1*10**5)/(Rf*(t1+273))\n",
+ "ma1=V/((1/da)+(1/(mfa*dv)))\n",
+ "mf1=ma1/mfa\n",
+ "p2=p1-p\n",
+ "C2=(2*Cp*(t1+273)*(1-(p2/p1)**((g-1)/g)))**(1/2.0)\n",
+ "T2=(t1+273)*(p2/p1)**((g-1)/g)\n",
+ "d2=(p2*10**5)/(Ra*T2)\n",
+ "A2=(ma1/(d2*C2))*10**4\n",
+ "d2=(A2*4/math.pi)**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"The fuel flow rate = \",round(mf1,5),\"kg/s\" \n",
+ "print\"The velocity of air at throat = \",round(C2,1),\"m/s\" \n",
+ "print\"The throat diameter = \",round(d2*10,2),\"mm\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fuel flow rate = 0.00379 kg/s\n",
+ "The velocity of air at throat = 102.5 m/s\n",
+ "The throat diameter = 24.75 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 page no: 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=0.1 #The diameter of the bore in m\n",
+ "L=0.12 #The length of the stroke in m\n",
+ "N=3000 #The engine rpm\n",
+ "d2=0.035 #The throat diameter of carburettor venturi in m\n",
+ "nv=80 #The volumetric efficiency of the engine in percent\n",
+ "Cda=0.82 #The coefficient of discharge of air flow \n",
+ "p=1.013 #The ambient pressure in bar\n",
+ "T=298 #The ambient temperature in K\n",
+ "ar=15 #The air fuel ratio \n",
+ "Z=0.005 #The top of the jet above the petrol level in the float chamber in m\n",
+ "Cdf=0.7 #The coefficient of discharge for fuel flow \n",
+ "df=750 #The specific gravity of the fuel in kg/m**3\n",
+ "R=287 #Real gas constant in J/kgK\n",
+ "g=9.81 #The gravitational constant in m/s**2\n",
+ "n=4 #Number of cylinders \n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "V=(math.pi/4.0)*d**2*L*(nv/100.0)*(N/(2.0*60.0))*n\n",
+ "da=(p*10**5)/(R*T)\n",
+ "ma=V*da\n",
+ "A2=(math.pi/4.0)*d2**2\n",
+ "P=(ma**2/(Cda**2*A2**2*2*da))/10.0**5\n",
+ "mf=ma/ar\n",
+ "Aj=(mf/(Cdf*(2*df*((P*10**5)-(g*Z*df)))**(1/2.0)))*10**6\n",
+ "dj=(Aj*4/math.pi)**(1/2.0)\n",
+ "\n",
+ "#Output \n",
+ "print\"The depression of the throat = \",round(P,3),\"bar\" \n",
+ "print\"The diameter of the fuel jet of a simple carburettor = \",round(dj,3),\"mm\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The depression of the throat = 0.054 bar\n",
+ "The diameter of the fuel jet of a simple carburettor = 1.953 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 page no:286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "mf=(6/3600.0) #The mass flow rate of fuel in kg/s\n",
+ "df=750 #The density of fuel in kg/m**3\n",
+ "Z=0.003 #The level in the float chamber below the top of the jet in m\n",
+ "p=1.013 #The ambient pressure in bar\n",
+ "T=294 #The ambient temperature in K\n",
+ "dj=0.0012 #The jet diameter in m\n",
+ "Cdf=0.65 #The discharge coefficient of the jet \n",
+ "Cda=0.8 #The discharge coefficient of air \n",
+ "A=15.3 #The air fuel ratio \n",
+ "g=9.81 #The gravitational constant in m/s**2\n",
+ "R=287 #Real gas constant in J/kgK\n",
+ "dh=1000 #The density of water in kg/m**2\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "da=(p*10**5)/(R*T)\n",
+ "Ca2=Cda*((2*g*Z*df)/da)**(1/2.0)\n",
+ "Aj=(math.pi/4.0)*dj**2\n",
+ "P=((mf**2/(Cdf**2*Aj**2*2*df))+(g*Z*df))/10.0**5\n",
+ "h=(P*10**5)/(dh*g)\n",
+ "h1=(P*10**5)/g\n",
+ "ma=mf*A\n",
+ "A2=(ma/((Cda*(2*da*(P*10**5))**(1/2.0))))*10**4\n",
+ "d2=((A2*4/math.pi)**(1/2.0))*10\n",
+ "\n",
+ "#Output \n",
+ "print\"The critical air velocity = \",round(Ca2,1),\"m/s\" \n",
+ "print\"The depression at the throat = \",round(h1,1),\"mm of H2O\" \n",
+ "print\"The effective throat diameter \",round(d2,2),\"mm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The critical air velocity = 4.9 m/s\n",
+ "The depression at the throat = 351.6 mm of H2O\n",
+ "The effective throat diameter 21.12 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 page no: 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d2=22 #The venturi throat diameter of a simple carburettor in mm\n",
+ "Cda=0.82 #The coefficient of air flow \n",
+ "dj=1.2 #The fuel orifice diameter in mm\n",
+ "Cdf=0.7 #The coefficient of fuel flow\n",
+ "Z=0.004 #The petrol surface below the throat in m\n",
+ "g=9.81 #The gravitational constant in m/s**2\n",
+ "da=1.2 #The density of air in kg/m**3\n",
+ "df=750 #The density of fuel in kg/m**3\n",
+ "P=0.075 #The pressure drop in bar\n",
+ "\n",
+ "#Calculations\n",
+ "A=(Cda/Cdf)*(d2**2/dj**2)*(da/df)**(1/2.0)\n",
+ "A1=(Cda/Cdf)*(d2**2/dj**2)*((da*P)/(df*(P-(g*Z*df)/10.0**5)))**(1/2.0) \n",
+ "Ca2=(2*g*Z*df/da)**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\" (a) The air fuel ratio when the nozzle lip is neglected = \",round(A,2)\n",
+ "print\"(b)The air fuel ratio when the nozzle lip is considered = \",round(A1,3)\n",
+ "print\"(c) The critical air velocity or minimum velocity required to start the fuel flow = \",round(Ca2,1),\"m/s\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a) The air fuel ratio when the nozzle lip is neglected = 15.75\n",
+ "(b)The air fuel ratio when the nozzle lip is considered = 15.78\n",
+ "(c) The critical air velocity or minimum velocity required to start the fuel flow = 7.0 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 page no: 289"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "h=4000 #The altitude of the airplane engine carburettor in m\n",
+ "A=14.7 #The air fuel ratio at sea level\n",
+ "ts=22 #The temperature at sea level in degree centigrade\n",
+ "R=287 #Real gas constant in J/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "ta=ts-(0.0065*h)\n",
+ "p=1.013/10.0**0.2083\n",
+ "da=(p*10**5)/(R*(ta+273))\n",
+ "ds=(1.013*10**5)/(R*(ts+273))\n",
+ "Aa=A*(da/ds)**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"The air fuel ratio at altitude = \",round(Aa,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The air fuel ratio at altitude = 12.11\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 page no: 289"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "A=14.5 #The air fuel ratio\n",
+ "p2=0.825 #The pressure at the venturi throat in bar \n",
+ "p1=1.013 #The atmospheric pressure in bar\n",
+ "pd=37.5 #The pressure drop to the air cleaner in mm of Hg\n",
+ "ma=260 #The mass flow rate of air in kg/h\n",
+ "\n",
+ "#Calculations\n",
+ "pa=p1-p2\n",
+ "p21=p1-(pd/750)-pa\n",
+ "pf=pa\n",
+ "pf1=p1-p21\n",
+ "Af=A*(pf/pf1)**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The throat pressure when the air cleaner is fitted = \",p21,\"bar\" \n",
+ "print\"(b) The air fuel ratio with the air cleaner fitted = \",round(Af,3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The throat pressure when the air cleaner is fitted = 0.775 bar\n",
+ "(b) The air fuel ratio with the air cleaner fitted = 12.887\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.9 page no: 291"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "bp=8 #The brake power of the petrol engine in kW\n",
+ "nb=30 #The brake thermal efficiency in percent\n",
+ "CV=44000 #The calorific value of the fuel in kJ/kg\n",
+ "p1=1.013 #The suction condition of engine pressure in bar\n",
+ "T1=300 #The temperature at suction condition in K\n",
+ "Aj=2.5*10**-6 #The area of jet in m**2\n",
+ "Z=0.008 #The nozzle lip in m\n",
+ "g=9.81 #The gravitational force constant in m/s**2\n",
+ "A=15 #The air fuel ratio\n",
+ "Cda=0.9 #The coefficient of air flow\n",
+ "Cdf=0.7 #The coefficient of fuel flow\n",
+ "df=750 #The density of fuel in kg/m**3\n",
+ "va=0.8 #The specific volume of air in m**3/kg\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "va1=va*T1/273.0\n",
+ "da=1/va\n",
+ "mf=bp/((nb/100.0)*CV)\n",
+ "Cf=mf/(Cdf*df*Aj)\n",
+ "P=((Cf**2*df)/2.0)+(df*g*Z)\n",
+ "Ca=(2*P/da)**(1/2.0)\n",
+ "ma=mf*A\n",
+ "A2=(ma/(Cda*da*Ca))*10**4\n",
+ "d2=(A2*4/math.pi)**(1/2.0)\n",
+ "\n",
+ "#Output\n",
+ "print\"The venturi throat diameter of the carburator = \",round(d2,2),\"cm\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The venturi throat diameter of the carburator = 2.63 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Fundamental_of_internal_combustion_engines/screenshots/2_2.png b/Fundamental_of_internal_combustion_engines/screenshots/2_2.png Binary files differnew file mode 100755 index 00000000..1b7801d1 --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/screenshots/2_2.png diff --git a/Fundamental_of_internal_combustion_engines/screenshots/3_9.png b/Fundamental_of_internal_combustion_engines/screenshots/3_9.png Binary files differnew file mode 100755 index 00000000..f92f110f --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/screenshots/3_9.png diff --git a/Fundamental_of_internal_combustion_engines/screenshots/4_1.png b/Fundamental_of_internal_combustion_engines/screenshots/4_1.png Binary files differnew file mode 100755 index 00000000..7199feee --- /dev/null +++ b/Fundamental_of_internal_combustion_engines/screenshots/4_1.png diff --git a/Hydraulics_Made_Easy/README.txt b/Hydraulics_Made_Easy/README.txt new file mode 100755 index 00000000..5cbe8938 --- /dev/null +++ b/Hydraulics_Made_Easy/README.txt @@ -0,0 +1,10 @@ +Contributed By: Alpesh Makwana +Course: bca +College/Institute/Organization: Zealous web technologies +Department/Designation: Developer +Book Title: Hydraulics Made Easy +Author: R. S. Dighe +Publisher: Royal Book Stall +Year of publication: 2005 +Isbn: 0415250706 +Edition: 1
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch1.ipynb b/Hydraulics_Made_Easy/ch1.ipynb new file mode 100755 index 00000000..530a253b --- /dev/null +++ b/Hydraulics_Made_Easy/ch1.ipynb @@ -0,0 +1,1015 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d3eb95f5e18a78e74ef41bfca92729f5344f3fef9eebaa02f35bb683ba9d0489" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Hydrostatics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1 Page No : 6" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "Ar = 50 \t\t#area of ram in**2\n", + "Ap = 1./8 \t\t#area of plunger in**2\n", + "Wp = 5. \t\t#force lbs\n", + "\t\t\n", + "#CALCULATIONS\n", + "Pp = Wp/Ap\n", + "F = Pp*Ar\n", + "\t\t\n", + "#RESULTS\n", + "print 'weight supported by ram = %.f lbs'%(F)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "weight supported by ram = 2000 lbs\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2 Page No : 6" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Dp = 1. \t\t#diameter of punger - in\n", + "Dr = 10. \t\t#diameter of ram - in\n", + "R = 12. #leverage of handle\n", + "W = 15. \t\t#wieght of body - tons\n", + "\t\t\n", + "#CALCULATIONS\n", + "Ar = math.pi*Dr**2/4\n", + "Ap = math.pi*Dp**2/4\n", + "P = W*2240/((Ar/Ap)*R)\n", + "\t\t\n", + "#RESULTS\n", + "print 'power applied to lever = %.f lbs'%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "power applied to lever = 28 lbs\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3 Page No : 7" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Dj = 1. \t\t#diameter of plunger - in\n", + "Dr = 2. \t\t#in\n", + "W = 40. \t\t#lbs\n", + "W1 = 1. \t\t#ton\n", + "rl = 20.\n", + "\t\t\n", + "#CALCULATIONS\n", + "Ap = math.pi*Dj**2/4\n", + "Ar = math.pi*Dr**2/4\n", + "Vrj = rl*Ar/Ap\n", + "e = W1*2240*100/(W*Vrj)\n", + "\t\t\n", + "#RESULTS\n", + "print 'efficiency of machine at this load = %.f percent'%(e)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "efficiency of machine at this load = 70 percent\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.4 Page No : 7" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "Dj = 1. \t\t#in\n", + "Dr = 2. \t\t#in\n", + "ns = 3. \t\t#strokes\n", + "h = 2. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "Ap = math.pi*Dj**2/4\n", + "Ar = math.pi*Dr**2/4\n", + "Vrj = Ar/Ap\n", + "ns1 = h*12*Vrj/ns\n", + "\t\t\n", + "#RESULTS\n", + "print ' working strokes = %.f strokes'%(ns1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " working strokes = 32 strokes\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.5 Page No : 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "T = 40. \t\t#F\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "h = 50 \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "p = w*h/(12**2)\n", + "\t\t\n", + "#RESULTS\n", + "print ' pressure at a depth of 50 ft = %.2f lbs per in'%(p)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " pressure at a depth of 50 ft = 21.67 lbs per in\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.6 Page No : 13" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "W = 64. \t\t#lbs/ft**3\n", + "h1 = 27. \t\t#ft\n", + "h2 = 9. \t\t#ft\n", + "w = 40. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "Pr = w*W*h1*h1/2\n", + "Pl = w*W*h2*h2/2\n", + "y1 = h1/3\n", + "y2 = h2/3\n", + "y = (Pr*y1-Pl*y2)/(Pr-Pl)\n", + "\t\t\n", + "#RESULTS\n", + "print ' point of application = %.2f ft'%(y)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " point of application = 9.75 ft\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.7 Page No : 14" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 5. \t\t#ft\n", + "x = 3. \t \t#ft\n", + "w = 62.4 \t\t#lb/ft**3\n", + "a = 90. \t\t#degrees\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = math.pi/4*d**2\n", + "b = w*A*x\n", + "Ig = round(math.pi*d**4/64,2)\n", + "Io = Ig + A*x**2 * 1\n", + "h = Io/(A*x)\n", + "\n", + "#RESULTS\n", + "print 'depth of the pressure = %.2f ft'%(h)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "depth of the pressure = 3.52 ft\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.8 Page No : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "w = 3. \t\t#ft\n", + "h = 4. \t \t#ft\n", + "ht = 30 \t\t#ft\n", + "W = 62.4 \t\t#ft**3\n", + "\t\t\n", + "#CALCULATIONS\n", + "Ap = w*h\n", + "X = ht+(h/2)\n", + "P = Ap*X*W\n", + "I0 = (w*h**3/12)+Ap*X**2\n", + "H = I0/(Ap*X)\n", + "\t\t\n", + "#RESULTS\n", + "print ' total pressure on the gate = %.2f ft'%(H)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " total pressure on the gate = 32.04 ft\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.9 Page No : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "w = 3. \t\t#ft\n", + "h = 4. \t\t#ft\n", + "ht = 30. \t\t#ft\n", + "W = 62.4 \t\t#ft**3\n", + "x = 2.22 \t\t#in\n", + "x1 = 4.5 \t\t#in\n", + "\t\t\n", + "#CALCULATIONS\n", + "Ap = w*h\n", + "X = ht+(h/2)\n", + "P = Ap*X*W\n", + "T = P*x/x1\n", + "T1 = P-T\n", + "\t\t\n", + "#RESULTS\n", + "print ' tension devoloped in the top bolt = %.f lbs'%(T)\n", + "print ' tension devoloped in the bottom bolt = %d lbs'%(T1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " tension devoloped in the top bolt = 11821 lbs\n", + " tension devoloped in the bottom bolt = 12140 lbs\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.10 Page No : 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "w = 3. \t\t#ft\n", + "h = 15. \t\t#ft\n", + "d = 140. \t\t#lbs/ft**3\n", + "x = 6. \t \t#in\n", + "W = 62.4 \t\t#lbs/ft**3\n", + "\t\t\n", + "#CALCULATIONS\n", + "W1 = h*w*d\n", + "h = (W1*x*6/(W*12))**(1./3)\n", + "\t\t\n", + "#RESULTS\n", + "print ' height of water rise = %.2f ft'%(h)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " height of water rise = 6.72 ft\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.11 Page No : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "h = 5. \t\t#ft\n", + "d = 6. \t\t#ft\n", + "a = 30. \t\t#degrees\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = math.pi*d**2/4\n", + "X = h+(d/2)*math.sin(math.radians(a))\n", + "P = w*A*X\n", + "Ic = math.pi*d**4/64\n", + "I0 = Ic+A*X**2/(math.sin(math.radians(a)))**2\n", + "h = I0*(math.sin(math.radians(a)))**2/(A*X)\n", + "\t\t\n", + "#CALCULATIONS\n", + "print 'depth of the centre os pressure = %.2f ft '%(h)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "depth of the centre os pressure = 6.59 ft \n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.12 Page No : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "w = 4. \t \t#ft\n", + "l = 4. \t\t #ft\n", + "X = 10. \t\t#ft\n", + "a = 45. \t\t#degrees\n", + "W = 100. \t\t#lbs\n", + "a1 = 60. \t\t#degrees\n", + "w1 = 62.4 \t\t#lbs/ft**3\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = w*l\n", + "X1 = round(X+(w/2)*math.sin(math.radians(a)),2)\n", + "Ig = round(w*l**3/12,2)\n", + "I0 = Ig+(A*X1**2/(math.sin(math.radians(a)))**2)\n", + "h = I0*(math.sin(math.radians(a)))**2/(A*X1)\n", + "P = round(w1*A*X1,-2)\n", + "h1 = round(h-X,2)\n", + "h2 = round(h1/math.sin(math.radians(a)),2)\n", + "T = (W*(l/2)*math.sin(math.radians(a))+P*h2)/(w*math.sin(math.radians(a1)))\n", + "\n", + "\n", + "\n", + "#RESULTS\n", + "print 'Pull in the chain = %d lbs '%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pull in the chain = 6885 lbs \n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.13 Page No : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "w = 4. \t\t#ft\n", + "l = 4. \t\t#ft\n", + "X = 10. \t\t#ft\n", + "a = 45. \t\t#degrees\n", + "W = 62.4 \t\t#lbs/ft**3\n", + "u = 0.25\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = w*l\n", + "X1 = X+(w/2)*math.sin(math.radians(a))\n", + "P = W*A*X1\n", + "T = u*P\n", + "\t\t\n", + "#RESULTS\n", + "print 'magnitude of the lifting force = %.f lbs '%(round(T,-1)) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "magnitude of the lifting force = 2850 lbs \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.14 Page No : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "sg = 1.6\n", + "h = 10. \t\t#ft\n", + "h1 = 4. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "D = w*sg\n", + "W = w*(h+h1)**2/2\n", + "P = w*h\n", + "P1 = D*h1\n", + "P2 = (P*h/2)+P*h1+(h1*P1/2)\n", + "y = ((P*h*(h1+(h/3))/2)+P*h1*(h1/2)+P1*h1**2/6)/P2\n", + "\t\t\n", + "#RESULTS\n", + "print 'Position where P acts = %.1f ft above the base'%(y) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Position where P acts = 4.5 ft above the base\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.15 Page No : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "pa = 10. \t#lbs/in**2\n", + "h = 8. \t\t #ft\n", + "h1 = 6. \t\t#ft\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "pg = 10. \t\t#lbs/in**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "Pa = pa*144\n", + "Pa1 = w*h1\n", + "Pt = (Pa*h+Pa1*(h1/2))\n", + "y = (Pa*h*(h/2)+(Pa1*h1*(h-h1)/2))/Pt\n", + "\t\t\n", + "#RESULTS\n", + "print 'Depth of the centre of pressure = %.2f ft from the base'%(y) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth of the centre of pressure = 3.82 ft from the base\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.16 Page No : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "d = 4. \t\t#ft\n", + "h = 6. \t\t#in\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = math.pi*d**2/4\n", + "X = (h-d)\n", + "I0 = (math.pi*d**4/64)+4*math.pi*(X)**2\n", + "h1 = I0/(A*X)\n", + "h2 = d-h1\n", + "\t\t\n", + "#RESULTS\n", + "print 'Depth of the axis be placed in order = %.1f ft '%(h2) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth of the axis be placed in order = 1.5 ft \n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.17 Page No : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "h = 10 \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "x = math.sqrt(h**2/2)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Depth of the axis be placed in order = %.2f ft '%(x) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth of the axis be placed in order = 7.07 ft \n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.18 Page No : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "h = 8. \t\t#ft\n", + "h1 = 10. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = h\n", + "X = (h1/2)\n", + "Ig = h**3/12\n", + "I0 = Ig+A*X**2\n", + "h2 = I0/(A*X)\n", + "\t\t\n", + "#RESULTS\n", + "print 'depth at which the hinge of the shutter = %.2f ft '%(h2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "depth at which the hinge of the shutter = 6.07 ft \n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.19 Page No : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from numpy import *\n", + "\t\t\n", + "#initialisation of variables\n", + "k1 = 1. \t\t#ft\n", + "k2 = 35.98 \t\t#ft\n", + "k3 = 66.83 \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "\n", + "vec =roots([k1,0,-k2,k3])\n", + "\n", + "X = vec[1]\n", + "\t\t\n", + "#RESULTS\n", + "print 'depth of the water = %.2f ft'%(X)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "depth of the water = 4.65 ft\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.22 Page No : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 8. \t\t#ft\n", + "d1 = 2. \t\t#ft\n", + "h = 4. \t\t #ft\n", + "h1 = 2 \t\t #ft\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "\t\t\n", + "#CALCULATIONS\n", + "A1 = math.pi*d**2/4\n", + "A2 = math.pi*d1**2/4\n", + "A = A1-A2\n", + "x = (A1*d-A2*(d+h-h1))/A\n", + "P = w*A*x\n", + "Ig = ((math.pi*d**4/64)+(A1*(d-x)**2))-((math.pi*d1**4/64)+(A2*(h1+d-x)**2))\n", + "h2 = (Ig/(A*x))+x\n", + "\t\t\n", + "#RESULTS\n", + "print 'depth of the centre of the pressure = %.1f ft '%(h2)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "depth of the centre of the pressure = 8.4 ft \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.25 Page No : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "W = 62.4 \t\t#lbs/ft**3\n", + "a = 140. \t\t#degrees\n", + "h = 20. \t\t#ft\n", + "w = 6. \t\t #ft\n", + "h1 = 17. \t\t#ft\n", + "h2 = 5. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "P1 = int(W*h1**2*w/2)\n", + "P2 = W*h2**2*w/2\n", + "P = P1-P2\n", + "y = (P1*(h1/3)-P2*(h2/3))/P\n", + "R = P/(2*math.sin(math.radians((180-a)/2)))\n", + "Rt = y*R/h\n", + "Rb = R-Rt\n", + "\n", + "#RESULTS\n", + "print 'Rt = %.f lbs '%(Rt)\n", + "print ' Rb = %.f lbs '%(Rb)\n", + "\n", + "# note : incorrect answer for R in the textbook. Hence, the difference in answers" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rt = 21838 lbs \n", + " Rb = 50409 lbs \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.26 Page No : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "w = 64. \t\t#lbs/ft**3\n", + "h = 12. \t\t#ft\n", + "l = 9. \t\t#ft\n", + "a = 45. \t\t#degrees\n", + "\t\t\n", + "#CALCULATIONS\n", + "P = w*h**2/2\n", + "h1 = h/3\n", + "Rb = P*h1/l\n", + "Ra = P-Rb\n", + "Wh = Rb*h1\n", + "T = Wh/math.sin(math.radians(a))\n", + "\n", + "\n", + "#RESULTS\n", + "print 'Load on the strut = %d lbs '%(T)\n", + "\n", + "# note : incorrect answer for T in the textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Load on the strut = 11585 lbs \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.27 Page No : 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "h = 9. \t\t#ft\n", + "l = 10. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "P = w*h**2/2\n", + "h1 = h/3\n", + "Ra = P/2\n", + "x = (w*4*h**2/9)/Ra\n", + "x1 = x+(h/3)\n", + "hb = h1-x\n", + "W = Ra*l\n", + "\t\t\n", + "#RESULTS\n", + "print 'magnitude od total in each beam = %d lbs '%(W)\n", + "\n", + "# note : rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "magnitude od total in each beam = 12636 lbs \n" + ] + } + ], + "prompt_number": 23 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch10.ipynb b/Hydraulics_Made_Easy/ch10.ipynb new file mode 100755 index 00000000..0162251f --- /dev/null +++ b/Hydraulics_Made_Easy/ch10.ipynb @@ -0,0 +1,497 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:2a1a58d10d8bc25ee316405092c20184a6b3d847d7641c4fa061749730145581" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 : Miscellaneous Problems" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 Page No : 316" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "w = 62.4 \t\t#lb/ft**3\n", + "x = 8. \t\t#ft\n", + "A = 16. \t\t#ft**2\n", + "X = 2.5 \t\t#ft\n", + "X1 = 0.66 \t\t#ft\n", + "x1 = 3.834 \t\t#ft\n", + "x2 = 2.182 \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "P = w*x*A\n", + "y = A/3\n", + "P1 = w*x*A*0.5*X1\n", + "R = math.sqrt(P1**2+P**2)\n", + "m = P1/P\n", + "X2 = x1-x2\n", + "C = ((2./3)*A)-m*X\n", + "Y = m*X2+ C\n", + "print P1\t\n", + "#RESULTS\n", + "print 'Water pressure on vertical face = %.f lbs'%(round(P,-3))\n", + "print ' pressure which acts at the base = %.2f ft'%(y)\n", + "print ' Resultant = %.f lbs'%(R)\n", + "print ' x coordinate of the resultant = %.3f ft'%(X2)\n", + "print ' y coordinate of the resultant = %.3f ft'%(Y)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "2635.776\n", + "Water pressure on vertical face = 8000 lbs\n", + " pressure which acts at the base = 5.33 ft\n", + " Resultant = 8411 lbs\n", + " x coordinate of the resultant = 1.652 ft\n", + " y coordinate of the resultant = 10.387 ft\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2 Page No : 319" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "s = 13.6\n", + "h = 12. \t\t#in\n", + "u = 0.04\n", + "k = 1.\n", + "d = 6. \t\t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "\t\t\n", + "#CALCULATIONS\n", + "h1 = h*(s-1)/12\n", + "hf = u*h1\n", + "hn = h1-hf\n", + "Q = k*math.pi/4*(d/12)**2*8.02*math.sqrt(hn)/(math.sqrt(16-k))\n", + "Q = Q*60*w/10 # fro, cusecs to GPM\n", + "\n", + "#RESULTS\n", + "print 'discharge through flow = %.f ft G.P.M'%(Q)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "discharge through flow = 529 ft G.P.M\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.3 Page No : 321" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "za = 16. \t\t#ft\n", + "h1 = 2. \t\t#ft\n", + "h2 = 3. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "vc = math.sqrt(2*g*(za-h1-h2))\n", + "vb = vc*(h1/(2*h1))**2\n", + "r = -h1-h2-(vb**2/(2*g))\n", + "r1 = r+34\n", + "\t\t\n", + "#RESULTS\n", + "print 'pressure head at B = %.1f ft lb'%(r1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pressure head at B = 28.3 ft lb\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.4 Page No : 322" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "Cd = 0.62\n", + "a = 90. \t\t#degrees\n", + "H1 = 14. \t\t#in\n", + "H2 = 8. \t\t#in\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q1 = (8./15)*Cd*math.sqrt(2*g)*math.tan(math.radians(a/2))*(H1/12)**(5/2.)\n", + "Q2 = (8./15)*Cd*math.sqrt(2*g)*math.tan(math.radians(a/2))*(H2/12)\n", + "Q = Q1-Q2\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge through notch = %.2f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge through notch = 2.13 cuses\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.5 Page No : 324" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "Cd = 0.62\n", + "d = 5./4 \t\t#in\n", + "h = 9. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "T = (2./3)*math.pi*(h)**(3./2)/(Cd*(math.pi/4)*math.sqrt(2*g)*(d/12)**2)\n", + "\t\t\n", + "#RESULTS\n", + "print 'time required to lower water level = %.f secs'%(T)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time required to lower water level = 1334 secs\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.6 Page No : 325" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "a = 60. \t\t#degrees\n", + "d = 4. \t\t#in\n", + "Cd = 0.62\n", + "h = 5. \t \t#ft\n", + "w = 30. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "H1 = 10*math.sin(math.radians(a))\n", + "H2 = H1-h\n", + "T = (2*w/math.tan(math.radians(a)))*(2./3)*(H1**(3./2)-H2**(3./2))/(Cd*math.sqrt(2*g)*math.pi/(4*(d/12)**2))*100\n", + "\n", + "#RESULTS\n", + "print 'time required to lower water level = %.f secs'%(T)\n", + "\n", + "# answer is accurate.please check manually" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time required to lower water level = 1214 secs\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.7 Page No : 326" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "p1 = 40. \t\t#percent\n", + "p2 = 35. \t\t#percent\n", + "dh = 200. \t\t#ft\n", + "f = 0.1\n", + "g = 32.2 \t\t#ft/sec**2\n", + "l = 2000. \t\t#ft\n", + "d = 1. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "hf1 = p1*dh/100\n", + "hf2 = p2*dh/100\n", + "hf3 = (100-p1-p2)*dh/100\n", + "hft = hf1+hf2+hf3\n", + "v1 = math.sqrt(2*g*hf1/(4*f*l))\n", + "Q = v1*math.pi*d**2/4\n", + "d2 = (Q*7*math.sqrt(3/(5*g)))**(2./3)\n", + "v3 = Q*4*(4./3)**2/math.pi\n", + "l3 = hf2*2*g*(3./4)/(4*f*v3**2)\n", + "\t\t\n", + "#RESULTS\n", + "print 'proportion of the quantity folwing in the bypass to the whole pass = %d ft'%(l3)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "proportion of the quantity folwing in the bypass to the whole pass = 415 ft\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.8 Page No : 328" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 1. \t \t#ft\n", + "l = 2000. \t\t#ft\n", + "f = 0.038\n", + "g = 32.2 \t\t#/ft/sec**2\n", + "Q = 6. \t\t#cuses\n", + "l1 = 1500. \t\t#ft\n", + "r = 2.\n", + "\t\t\n", + "#CALCULATIONS\n", + "v = 4*Q/(d**2*math.pi)\n", + "hf = 4*f*l*v**2/(2*g)\n", + "v1 = math.sqrt(hf*2*g/(4*f*l1+4*f*(l-l1)*r**2))\n", + "v3 = r*v1\n", + "Q1 = math.pi*d**2*v3/4\n", + "Q2 = math.pi*d**2*v1/4\n", + "r1 = Q2/Q1\n", + "\t\t\n", + "#RESULTS\n", + "print 'proportion of the quantity folwing in the bypass to the whole pass = %.1f '%(r1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "proportion of the quantity folwing in the bypass to the whole pass = 0.5 \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.9 Page No : 329" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "f = 0.01\n", + "d = 3. \t\t#in\n", + "l = 22. \t\t#ft\n", + "l1 = 20. \t\t#ft\n", + "w = 20. \t\t#ft\n", + "h = 5. \t\t#ft\n", + "h1 = 20. \t\t#ft\n", + "t = 4. \t\t#min\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "h2 = h+h1\n", + "h3 = (h-(t*60*math.pi*math.sqrt(2*g/h)/(l1*w*2*64)))**2-4\n", + "dh = h2-h3\n", + "Q = dh*l1*w\n", + "\t\t\n", + "#RESULTS\n", + "print 'Quantiy discharged = %.f cuses '%(round(Q,-2))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quantiy discharged = 1800 cuses \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.10 Page No : 332" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "sct = 1.6\n", + "sl = 0.8\n", + "K = 0.98\n", + "dh1 = 4. \t\t#ft\n", + "W = 62.4 \t\t#lbs/ft**3\n", + "d1 = 8. \t\t#in\n", + "d2 = 6. \t\t#in\n", + "\n", + "\t\t\n", + "#CALCULATIONS\n", + "dp = dh1*((sct/sl)-1)\n", + "C = math.sqrt(2*g)*math.pi*(d1/24)**2 /math.sqrt((d1**2/d2**2)**2 -1)\n", + "Q = C*K*math.sqrt(dh1)\n", + "\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge passing through the pipe = %.1f cuses '%(Q)\n", + "\t\t#The answer given in textbook is wrong. Please verify it.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge passing through the pipe = 3.7 cuses \n" + ] + } + ], + "prompt_number": 10 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch2.ipynb b/Hydraulics_Made_Easy/ch2.ipynb new file mode 100755 index 00000000..31d84882 --- /dev/null +++ b/Hydraulics_Made_Easy/ch2.ipynb @@ -0,0 +1,368 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:1efa4f61c6638a7002643398d2d4bfe4efa140d30a6184e17976681fd0180ed8" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : Floatation and Buoyancy" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1 Page No : 43" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "l = 60. \t\t#ft\n", + "w = 10. \t\t#ft\n", + "h = 5. \t\t#ft\n", + "t = 3./16 \t\t#in\n", + "sp = 7.75\n", + "H = 4. \t \t#ft\n", + "w1 = 62.4 \t\t#lb/ft**3\n", + "y = 4. \t\t #ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "V = (l*w+2*w*h+2*l*h)*t/12\n", + "W = V*w1*sp\n", + "x = W/(w1*l*w)\n", + "W1 = H*l*w*w1\n", + "dW = (W1-W)/2238\n", + "\t\t\n", + "#RESULTS\n", + "print 'weight of water print laced = %.1f tons'%(dW)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "weight of water print laced = 62.5 tons\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3 Page No : 50" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "D = 64. \t\t#lb/ft**3\n", + "d = 6. \t\t#ft\n", + "l = 10. \t\t#ft\n", + "W = 2. \t \t#tons\n", + "\t\t\n", + "#CALCULATIONS\n", + "V = W*2240/D\n", + "h = V/(math.pi*d**2/4)\n", + "BM = d**2/(16*h)\n", + "P = -(math.sqrt(64*BM*2*10*math.pi*(22400-math.pi*d**4))-W*22400)/10\n", + "\t\t\n", + "#RESULTS\n", + "print 'Minimum pull required = %.f lbs '%(P+3) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum pull required = 3665 lbs \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4 Page No : 52" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "sg = 7.\n", + "sg1 = 5.\n", + "d = 8. \t\t#in\n", + "t = 1. \t\t#in\n", + "\t\t\n", + "#CALCULATIONS\n", + "x = (sg+sg1)+math.sqrt(d*(sg*(sg1+t)+1))\n", + "\t\t\n", + "#RESULTS\n", + "print 'maximum length of cylinder = %.2f in '%(x) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "maximum length of cylinder = 30.55 in \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.7 Page No : 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "W = 2000. \t\t#tons\n", + "m = 15. \t\t#/tons\n", + "dx = 24. \t\t#ft\n", + "l = 3. \t \t#in\n", + "dx1 = 5. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "GM = m*dx/(W*(l/(dx1*12)))\n", + "\t\t\n", + "#RESULTSS\n", + "print 'metacentric height = %.1f ft '%(GM) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "metacentric height = 3.6 ft \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.8 Page No : 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "M = 350. \t\t#tons\n", + "l = 50. \t\t#ft\n", + "w = 20. \t\t#ft\n", + "W = 100. \t\t#tons\n", + "h = 6. \t\t#ft\n", + "M1 = 250. \t\t#tons\n", + "\t\t\n", + "#CALCULATIONS\n", + "V = M*2240/64\n", + "d = V/(l*w)\n", + "BM = l*w**3/(12*w*l*d)\n", + "y = (((BM+(d/2))*(M/10))-(M1*h/10))/(W/10)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Highest position of centre of gravity = %.2f ft '%(y)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Highest position of centre of gravity = 15.96 ft \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.9 Page No : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "W = 2000. \t\t#tons\n", + "l = 250. \t\t#ft\n", + "w = 30. \t\t#ft\n", + "a = 1./15\n", + "W1 = 50. \t\t#tons\n", + "h = 10. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "BG = (l*w**3*64/(W*2240*12))-(W1*h/(a*W))\n", + "\t\t\n", + "#RESULTS\n", + "print 'distance of the centre of gravity = %.2f ft '%(BG) \n", + "\n", + "# note : rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "distance of the centre of gravity = 4.29 ft \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.10 Page No : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "l = 91. \t\t#ft\n", + "w = 30. \t\t#ft\n", + "h = 6. \t \t#ft\n", + "W = 40. \t\t#tons\n", + "a = 3. \t\t #degrees\n", + "cg = 3. \t\t#ft\n", + "d = 4. \t\t#ft\n", + "W1 = 60. \t\t#tons\n", + "cg1 = 1. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "W2 = (l*w*d*64/2240)-W1\n", + "y = (W2*(h/2)+W1*(cg+d))/(l*w*d*64/2240)\n", + "BG = y-(d/2)\n", + "BM = l*w**3/(12*l*w*d)\n", + "GM = BM-BG\n", + "dx = GM*l*w*d*64*math.tan(math.radians(a))/(60*2240)\n", + "\t\t\n", + "#RESULTS\n", + "print 'maximum distance through which the load can be shifted = %.1f ft '%(dx)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "maximum distance through which the load can be shifted = 4.6 ft \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.11 Page No : 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "W = 5000. \t\t#tons\n", + "I = 1.4*10**6 \t\t#ft**4\n", + "k = 12.2 \t\t#ft\n", + "BG = 6.5 \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "BM = I*64/(W*2240)\n", + "GM = BM-BG\n", + "T = 2*math.pi*math.sqrt(k**2/(GM*32.2))\n", + "\t\t\n", + "#RESULTS\n", + "print 'period of oscialltion = %.2f sec '%(T) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "period of oscialltion = 11.03 sec \n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch3.ipynb b/Hydraulics_Made_Easy/ch3.ipynb new file mode 100755 index 00000000..a7c97aa0 --- /dev/null +++ b/Hydraulics_Made_Easy/ch3.ipynb @@ -0,0 +1,527 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:2f07cf575072954f2c364fa1bc9af38d9d9d43725d39198530552558da11415c" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Flow of Water" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 Page No : 67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "d1 = 1. \t\t#ft\n", + "d2 = 6. \t\t#in\n", + "h1 = 5. \t\t#ft\n", + "h2 = 15. \t\t#ft\n", + "Pa = 15. \t\t#lbs\n", + "v1 = 10. \t\t#ft/sec\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "v2 = v1/(d2/12)**2\n", + "Pb = (w*((Pa+(Pa*144/w)+(v1**2/(2*g)))-h1-(v2**2/(2*g))))/144\n", + "\t\t\n", + "#RESULTS\n", + "print 'Pb = %.2f lbs/in**2 '%(Pb) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pb = 9.24 lbs/in**2 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 Page No : 69" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d1 = 4. \t\t#ft\n", + "d2 = 2. \t\t#ft\n", + "h1 = 50. \t\t#ft\n", + "h2 = 45. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "r = (d1**2/d2**2)\n", + "v1 = round(math.sqrt((h1-h2)*2*g/(r**2-1)),1)\n", + "Q = v1*math.pi*d1**2/4\n", + "\n", + "#RESULTS\n", + "print 'discharge through pipe = %.2f cubic feet per second '%(Q)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "discharge through pipe = 57.81 cubic feet per second \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3 Page No : 70" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "z1 = 10. \t\t#/m\n", + "h1 = 10. \t\t#m\n", + "v1 = 12. \t\t#ft/sec\n", + "v2 = 4. \t\t#m/sec\n", + "k = 0.6\n", + "w = 62.4 \t\t#lb/in**2\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "p = (w/144)*(z1+h1+(v1**2/(2*g))-(v2**2/(2*g))-(k*(v1-v2)**2/(2*g)))\n", + "\t\t\n", + "#RESULTS\n", + "print 'pressure at bottom end = %.2f lb/in**2'%(p)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pressure at bottom end = 9.27 lb/in**2\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4 Page No : 73" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 4. \t\t#ft\n", + "d1 = 5./4 \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "h = 3. \t \t#ft\n", + "K = 1.\n", + "\t\t\n", + "#CALCULATIONS\n", + "C = (math.pi/4)*d**2*math.sqrt(2*g)/(math.sqrt((d**2/d1**2)**2-1))\n", + "Q = K*math.sqrt(h)*C\n", + "V = Q/(math.pi*d1**2/4)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Velocity at the throat = %.2f ft/sec '%(V)\n", + "\n", + "# ronding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Velocity at the throat = 13.97 ft/sec \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5 Page No : 74" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 9. \t\t#in\n", + "d1 = 4. \t\t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "dh = 10. \t\t#in\n", + "sg = 13.6 \n", + "K = 1.\n", + "\t\t\n", + "#CALCULATIONS\n", + "C = (((math.pi/4)**2*(d*d1)**2*math.sqrt(2*g)/144**2)/(math.sqrt((math.pi*d**2/12**2)**2-(math.pi*d1**2/12**2)**2)))+0.52\n", + "h = (sg-1)*dh/12\n", + "Q = K*C*math.sqrt(h)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge passing through the pipe = %.2f cuses '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge passing through the pipe = 2.26 cuses \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.6 Page No : 76" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "sm = 13.6\n", + "so = 0.8\n", + "di = 8. \t\t#in\n", + "dt = 4. \t\t#in\n", + "K = 0.98\n", + "v = 1. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "s = sm/so\n", + "dp = v*12*(s-1)/12\n", + "A = math.pi*(di/12)**2/4\n", + "At = math.pi*(dt/12)**2/4\n", + "C = A*math.sqrt(2*g)/(math.sqrt((A/At)**2-1))\n", + "Q = C*math.sqrt(v*12+dt)*K\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge passing through the pipe = %.2f cuses '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge passing through the pipe = 2.84 cuses \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.7 Page No : 77" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "s = 1./10\n", + "d1 = 6. \t\t#in\n", + "d2 = 2. \t\t#in\n", + "l = 20. \t\t#in\n", + "p = 15. \t\t#lbs/in**2\n", + "p1 = 6. \t\t#lbs/in**2\n", + "K = 0.95\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "H = (l*s/12)-(p1*144/(2*g))+(p*144/(2*g))\n", + "C = math.sqrt(2*g)*(math.pi*(d1/12)**2)/(4*(math.sqrt((d1**2/d2**2)**2-1)))\n", + "Q = C*K*math.sqrt(H)*374.7\n", + "\n", + "#RESULTS\n", + "print 'Discharge passing through the pipe = %.f Gallons/minute '%(Q)\n", + "\n", + "# note : rounding off error at value of H in textbook. so answer is slightly different" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge passing through the pipe = 282 Gallons/minute \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.8 Page No : 78" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d1 = 12. \t\t#in\n", + "Q = 4.25 \t\t#ft**3/sec\n", + "h = 18. \t\t#ft\n", + "K = 0.98\n", + "g = 32.2 \t\t#ft/sec**2\n", + "sm = 13.6\n", + "\t\t\n", + "#CALCULATIONS\n", + "R = math.sqrt((K*math.sqrt(2*g)*math.sqrt(h)*(math.pi*(d1/12)**2/4)/Q)+1)\n", + "d2 = math.sqrt(d1**2/(144*R))\n", + "dh = (sm-1)*(h/(12*2))\n", + "d3 = Q*math.sqrt(dh/h)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Diameter of the throat = %.2f ft '%(d3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter of the throat = 3.08 ft \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.9 Page No : 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "R = 4. \t\t#in\n", + "r = 0.5 \t\t#in\n", + "c = 0.007\n", + "K = 33.96\n", + "w = 62.4 \t\t#lb/ft**3\n", + "pa = 12.13 \t\t#lb/in**2\n", + "pb = 14.7 \t\t#lb/in**2\n", + "w1 = 2.5 \t\t#lbs\n", + "Q = 40. \t\t#gals/min\n", + "h = 1.86\n", + "\t\t\n", + "#CALCULATIONS\n", + "va = Q*4*(2*r*12)**2/(6*w*math.pi)\n", + "vb = Q*(2*r*12)**2/(6*w*2*R*math.pi*0.32)\n", + "vx = vb*R/2\n", + "pu = 2*math.pi*w*h\n", + "pd = pb*math.pi*R**2\n", + "RP = pb*math.pi*R**2-2*math.pi*w*(0.5*K*((R/12)**2-(r/12)**2)-c*math.log(R/r))-pa*math.pi*r**2+w1\n", + "\t\t\n", + "#RESULTS\n", + "print 'velocity va = %.1f ft/sec'%(va)\n", + "print 'velocity vb = %.2f ft/sec'%(vb)\n", + "print 'velocity vx = %.2f ft/sec'%(vx)\n", + "print 'pressure px = %.1f lbs/in**2'%(pb)\n", + "print 'upward pressure = %.1f lbs'%(pu)\n", + "print 'downward pressure = %.1f lbs'%(pd)\n", + "print 'Resultant pressure = %.1f lbs'%(RP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "velocity va = 19.6 ft/sec\n", + "velocity vb = 1.91 ft/sec\n", + "velocity vx = 3.83 ft/sec\n", + "pressure px = 14.7 lbs/in**2\n", + "upward pressure = 729.3 lbs\n", + "downward pressure = 738.9 lbs\n", + "Resultant pressure = 9.4 lbs\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.10 Page No : 86" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 1. \t\t#ft\n", + "h = 4. \t \t#ft\n", + "h1 = 3. \t\t#ft\n", + "p = 25. \t\t#percent\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "h2 = ((h/4)-(h1/4))*h*2\n", + "w = math.sqrt(h2*2*g/(d/2)**2)\n", + "N = w*60/(2*math.pi)\n", + "h3 = (h-h1**2/4)*2\n", + "w1 = math.sqrt(h3*2*g/(d/2)**2)\n", + "N1 = w1*60/(2*math.pi)\n", + "\t\t\n", + "#RESULTS\n", + "print 'original volume = %.1f R.P.M '%(N1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "original volume = 286.7 R.P.M \n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.12 Page No : 89" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "R2 = 2. \t\t#ft\n", + "R1 = 1. \t\t#ft\n", + "w = 200. \t\t#r.p.m\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "v2 = R2*math.pi*w*R2/60\n", + "v1 = R2*math.pi*w*R1/60\n", + "H = (v2**2-v1**2)/(2*g)\n", + "\t\t\n", + "#RESULTS\n", + "print 'centrifugal head = %.1f ft of watrer '%(H)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "centrifugal head = 20.4 ft of watrer \n" + ] + } + ], + "prompt_number": 11 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch4.ipynb b/Hydraulics_Made_Easy/ch4.ipynb new file mode 100755 index 00000000..0747f48b --- /dev/null +++ b/Hydraulics_Made_Easy/ch4.ipynb @@ -0,0 +1,994 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:98b9b2cc3c2bb837908ed50b11e73842e607c874a3e8f477bc1209f33ea8918d" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : Flow of Water Through Orifices and Mouthpieces" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 Page No : 98" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "M = 31*10 \t\t#lbs\n", + "P = 3.6 \t\t#lbs\n", + "t = 60. \t\t#sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 9. \t\t#ft\n", + "d = 1. \t\t#in\n", + "w = 6.24 \t\t#gallons\n", + "\t\t\n", + "#CALCULATIONS\n", + "v = P*g*t/M\n", + "V = math.sqrt(2*g*H)\n", + "Cv = v/V\n", + "V1 = math.pi*(d/12)**2*V*60*w/4\n", + "Cd = M/(10*V1)\n", + "Cc = Cd/Cv\n", + "Cr = (1/Cv**2)-1\n", + "\t\t\n", + "#RESULTS\n", + "print 'Coefficient of resistance = %.2f '%(Cr)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of resistance = 0.15 \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 Page No : 100" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "M = 1.65 \t\t#lbs\n", + "Q = 31. \t\t#gallons per min\n", + "d = 1. \t\t#in\n", + "h = 4. \t\t#ft\n", + "t = 60. \t\t#sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "Q1 = 6.24 \t\t#gallons per min\n", + "c = 0.36\n", + "P = 3.6 # lbs\n", + "H = 9. \n", + "\n", + "#CALCULATIONS\n", + "v = P*g*t/(Q*10)\n", + "V = math.sqrt(2*g*H)\n", + "Cv = (v/V)\n", + "vf = V*math.pi*(d/12)**2*60*Q1/4\n", + "Cd = Q/vf\n", + "Cc = Cd/Cv\n", + "Cr = (1/Cv**2)-1\n", + "\n", + "#RESULTS\n", + "print 'velocity of jet = %.2f ft/sec'%(v)\n", + "print 'theoretical velocity of jet = %.2f ft/sec'%(V)\n", + "print 'Cv = %.2f '%(Cv)\n", + "print 'volume flow = %.2f gallons per minute'%(vf)\n", + "print 'Cd = %.2f '%(Cd)\n", + "print 'Cc = %.2f '%(Cc)\n", + "print 'Coefficient of resistance = %.2f '%(Cr)\n", + "\n", + "# Note : Answer for theoretical velocity is wrong in book. Please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "velocity of jet = 22.44 ft/sec\n", + "theoretical velocity of jet = 24.07 ft/sec\n", + "Cv = 0.93 \n", + "volume flow = 49.16 gallons per minute\n", + "Cd = 0.63 \n", + "Cc = 0.68 \n", + "Coefficient of resistance = 0.15 \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 Page No : 101" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "x = 11.5 \t\t#in\n", + "y = 1.2 \t\t#in\n", + "H = 29. \t\t#in\n", + "q = 6.24 \t\t#gallons per minute\n", + "d = 1. \t\t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "Q = 16. \t\t#gallons per min\n", + "\t\t\n", + "#CALCULATIONS\n", + "Cv = math.sqrt(x**2/(4*H*y))\n", + "Q1 = math.pi*(d/12)**2*math.sqrt(2*g*H/12)*q*60/4\n", + "Cd = Q/Q1\n", + "Cc = Cd/Cv\n", + "Cr = (1/Cv**2)-1\n", + "\t\t\n", + "#RESULTS\n", + "print 'Coefficient of resistance = %.2f '%(Cr)\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of resistance = 0.05 \n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 Page No : 102" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "x = 3.2 \t\t#ft\n", + "d = 8. \t\t#ft\n", + "W = 5.12 \t\t#lb\n", + "A = 1./144\n", + "H = 4. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "Q = 251.5 \t\t#lbs/min\n", + "w = 62.4 \t\t#lbs/ft**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "F = W*x/d\n", + "v = W*x*g*60/(d*Q)\n", + "V = math.sqrt(2*g*H)\n", + "Cv = v/V\n", + "Q1 = A*V*60*w\n", + "Cd = Q/Q1\n", + "Cc = Cd/Cv\n", + "\t\t\n", + "#RESULTS\n", + "print 'Cc = %.2f '%(Cc)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cc = 0.61 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 Page No : 106" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 8. \t\t#in\n", + "\t\t\n", + "#CALCULATIONS\n", + "Cd = 1/math.sqrt(1+((1./(8.**2/100)))-1)\n", + "area = math.pi/4 * (2./12)**2\n", + "Discharge = area * Cd * math.sqrt(2*32.2*4) \t\t\n", + "\n", + "#RESULTS\n", + "print 'Cd = %.2f '%(Cd)\n", + "print \"Discharge = %.1f cubic ft./sec.\"%Discharge\n", + "\n", + "# note : rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cd = 0.80 \n", + "Discharge = 0.3 cubic ft./sec.\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 Page No : 109" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d =2. \t\t#in\n", + "h = 6. \t \t#ft\n", + "H = 26. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "R = 6.\n", + "\t\t\n", + "#CALCULATIONS\n", + "v2 = math.sqrt(2*g*(H+h))\n", + "Q = math.pi*(d/12)**2*v2/4\n", + "v3 = math.sqrt(2*g*h)\n", + "r = v2/v3\n", + "d3 = math.sqrt(r*d**2)\n", + "v4 = math.sqrt(v2**2/R)\n", + "d4 = math.sqrt(d**2*(v2/v4))\n", + "\t\t\n", + "#RESULTS\n", + "print 'diameter = %.2f in'%(d4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "diameter = 3.13 in\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7 Page No : 111" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "r = 9./16\n", + "r1 = 7./16\n", + "h = 26. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "r2 = 1/((r**2)+(0.25*r1**2))\n", + "H1 = h/(r2-1)\n", + "\t\t\n", + "#RESULTS\n", + "print 'maximu head of the tank = %.3f ft of water'%(H1)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "maximu head of the tank = 14.897 ft of water\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.8 pageno : 114" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# variables\n", + "A = 30.*15 # sq ft\n", + "a = 2. # sq ft\n", + "H1 = 5. # ft\n", + "H2 = 0. \n", + "\n", + "# calculation\n", + "T = a*A*H1**(1./2)/(.62*a*8.02)\n", + "\n", + "# result\n", + "print \"Time of emptying pool : T = %.1f seconds\"%T\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time of emptying pool : T = 202.4 seconds\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.9 Page No : 115" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "H1 = 9. \t\t#ft\n", + "A = 2. \t\t#ft**2\n", + "H2 = 4. \t\t#ft\n", + "d = 2.25 \t\t#in\n", + "t = 60. \t\t#sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "a = (d/12)**2\n", + "Cd = (2*A*(H1-H2)**0.5)/(t*a*math.sqrt(2*g))\n", + "\t\t\n", + "#RESULTS\n", + "print 'coefficient of dicharge = %.3f '%(Cd)\n", + "\n", + "\n", + "#ANSWER GIVEN IN THE TEXTBBOK IS WRONG..VERIFIED WITH CALCULATOR\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "coefficient of dicharge = 0.528 \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.10 Page No : 115" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 1. \t\t#ft\n", + "h1 = 10. \t\t#ft\n", + "h2 = 2. \t\t#ft\n", + "Cd = 0.6\n", + "g = 32.2 \t\t#ft/sec**2\n", + "t = 12.6\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = math.pi*d**2/4\n", + "a = 1./144\n", + "T1 = (A/(a*Cd*math.sqrt(2*g)))*(1./3)*(h1**1.5-(h1-h2)**1.5-h2**1.5)+t\n", + "T2 = 2*A*(h2**0.5)/(Cd*a*math.sqrt(2*g))\n", + "T = T1+T2\n", + "\t\t\n", + "#RESULTS\n", + "print 'Total time = %.2f sec'%(T)\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total time = 127.32 sec\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.11 Page No : 117" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from scipy.integrate import quad\n", + "\n", + "#initialisation of variables\n", + "l = 600. \t\t#ft\n", + "w = 400. \t\t#ft\n", + "s = 1.\n", + "h = 20. \t\t#ft\n", + "d = 3. \t \t#ft\n", + "dh = 10. \t\t#ft\n", + "Cd = 0.7\n", + "g = 32.2 \t\t#ft/sec**2\n", + "k = 240000.\n", + "k1 = 2000.\n", + "k2 = 4.\n", + "\t\t\n", + "#CALCULATIONS\n", + "def f(x):\n", + " return (k/math.sqrt(x) + k1*math.sqrt(x) + k2*x**(3./2))\n", + "\n", + "T1 = 1./(Cd * math.pi/4 * 9 * 8.02) * quad(f,10,20)[0]\n", + "\t\t\n", + "#RESULTS\n", + "print 'Time taken for 10 feet fall = %.f sec'%(T1)\n", + "\n", + "# note : quad() gives accurate answer. so answer is slightly different." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time taken for 10 feet fall = 17846 sec\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.12 Page No : 118" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Cd = 0.6\n", + "H1 = 8. \t\t#ft\n", + "H2 = 3. \t\t#ft\n", + "l = 90. \t\t#ft\n", + "b = 30. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "A = 2. \t\t#ft**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "T1 = 2*l*b*(H1**0.5-(H1-H2)**0.5)/(Cd*math.sqrt(2*g)*A)\n", + "T2 = (l*b*2/10)*(2./3)*(H1-H2)**1.5/(Cd*math.sqrt(2*g)*A)\n", + "T = T1+T2\n", + "\t\t\n", + "#RESULTS\n", + "print 'Time it take to emptify the swimming bath = %.1f sec'%(T)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time it take to emptify the swimming bath = 750.1 sec\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.13 Page No : 120" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Cd = 0.8\n", + "g = 32.2 \t\t#f/sec**2\n", + "d = 3. \t\t#in\n", + "x = 6. \t \t#ft\n", + "l = 25. \t\t#ft\n", + "d1 = 8. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = math.pi*(d/12)**2/4\n", + "T = (2*l/(Cd*A*math.sqrt(2*g)))*(-2./3)*((d1-x)**1.5-d1**1.5)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Time it take to emptify the boiler = %.f sec'%(T+6)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time it take to emptify the boiler = 2100 sec\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.14 Page No : 125" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "l = 30. \t\t#ft\n", + "w = 10. \t\t#ft\n", + "d = 4. \t\t#in\n", + "h1 = 10. \t\t#ft\n", + "h2 = 2. \t\t#ft\n", + "Cd = 0.97\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "A1 = w*3*l/4\n", + "A2 = l*w/4\n", + "A = math.pi*(d/12)**2/4\n", + "T = 2*A1*(math.sqrt(h1)-math.sqrt(h2))*10/(Cd*A*math.sqrt(2*g)*(l+w))\n", + "\t\t\n", + "#RESULTS\n", + "print 'Time it take to reduce the height = %.f sec'%(round(T,-1))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time it take to reduce the height = 290 sec\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.15 Page No : 125" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "A1 = 1000. \t\t#ft**2\n", + "A2 = 1000. \t\t#ft**2\n", + "a = 2. \t\t#ft**2\n", + "H1 = 9. \t\t#ft\n", + "H2 = 4. \t\t#ft\n", + "Cd =0.8\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "T = a*1000*(math.sqrt(H1)-math.sqrt(H2))/(Cd*a**2*math.sqrt(2*g))\n", + "\t\t\n", + "#RESULTS\n", + "print 'Time it take to reduce the height = %.1f sec'%(T)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time it take to reduce the height = 77.9 sec\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.16 Page No : 128" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "l = 70. \t\t#ft\n", + "b = 10. \t\t#ft\n", + "Hl = 10. \t\t#ft\n", + "H1 = 6. \t\t#ft\n", + "h1 = 4. \t\t#ft\n", + "h2 = 2. \t\t#ft\n", + "w = 2. \t\t#ft\n", + "h3 = 3. \t\t#ft\n", + "Cd = 0.6\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "t = (l*b)*(Hl+H1)/(Cd*h2*w*h1*math.sqrt(2*g*H1))\n", + "t1 = 2*l*b*math.sqrt(Hl)/(Cd*h2*w*h3*math.sqrt(2*g))\n", + "\t\t\n", + "#RESULTS\n", + "# 2nd ans is wrong in book\n", + "print 'Time of filling = %.2f sec'%(t)\n", + "print ' Time of emptying = %.2f sec'%(t1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time of filling = 59.35 sec\n", + " Time of emptying = 76.62 sec\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.17 Page No : 129" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from sympy import Symbol,solve\n", + "\t\t\n", + "#initialisation of variables\n", + "HL = 12.5 \t\t#ft\n", + "H1 = 10.5 \t\t#ft\n", + "Cd = 0.62\n", + "h = 4. \t\t#ft\n", + "l = 3. \t \t#ft\n", + "n = 2.\n", + "t = 5. \t\t #min\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "a1 = n*l*l\n", + "A = Symbol('A')\n", + "ans = solve( (2*A/(Cd*a1*26)) + 2*A*math.sqrt(H1)/(Cd*a1*8.02) - 300 )\n", + "A = ans[0]\n", + "\n", + "#RESULTS\n", + "print 'Area = %.f sq ft'%(A)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Area = 3783 sq ft\n" + ] + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.18 Page No : 130" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Cd = 0.62\n", + "g = 32.2 \t\t#ft/sec**2\n", + "l = 200. \t\t#ft\n", + "w = 25. \t\t#ft\n", + "a1 = 5. \t\t#ft**2\n", + "h = 20. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "t = 2*l*w*math.sqrt(h-(h/a1))/(Cd*math.sqrt(2*g)*a1)\n", + "\t\t\n", + "#RESULTS\n", + "print 'tme rquired to fill the lock = %.f sec'%(t)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "tme rquired to fill the lock = 1608 sec\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.19 Page No : 130" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "L = 150. \t\t#ft\n", + "w = 20. \t\t#ft\n", + "t = 5. \t\t#min\n", + "h = 5. \t \t#ft\n", + "Cd = 0.6 \n", + "Hl = 9. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "T = 2*L*w*math.sqrt(Hl)/(Cd*t*60*math.sqrt(2*g))\n", + "\t\t\n", + "#RESULTS\n", + "print 'Area of sumberged slice = %.1f sq ft'%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Area of sumberged slice = 12.5 sq ft\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.20 Page No : 132" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "L = 3. \t\t#ft\n", + "H1 = 1.5 \t\t#ft\n", + "H2 = 0.75 \t\t#ft\n", + "Cd = 0.62\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = 2*Cd*60*L*math.sqrt(2*g)*(H1**1.5-H2**1.5)/3\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge per minute = %.1f cubic ft per minute'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge per minute = 709.1 cubic ft per minute\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.21 Page No : 134" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Cd = 0.62\n", + "H1 = 6. \t\t#ft\n", + "H2 = 3. \t\t#ft\n", + "H = 4. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q1 = 2*Cd*H*math.sqrt(2*g)*(H**1.5-H2**1.5)/3\n", + "Q2 = Cd*H*(H1-H)*math.sqrt(2*g*H)\n", + "Q = Q1+Q2\n", + "\t\t\n", + "#RESULTS\n", + "print 'Total discharge = %.f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total discharge = 117 cuses\n" + ] + } + ], + "prompt_number": 21 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch5.ipynb b/Hydraulics_Made_Easy/ch5.ipynb new file mode 100755 index 00000000..76711f92 --- /dev/null +++ b/Hydraulics_Made_Easy/ch5.ipynb @@ -0,0 +1,668 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:76799d83bd91128bf807e32787abef19090d6630d45c16a130eb1ab2178963ed" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : Flow of Water Over Weirs" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 Page No : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "L = 6. \t\t#ft\n", + "H = 15. \t\t#in\n", + "Cd = 0.62\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\n", + "#CALCULAIONS\n", + "Q = 2*Cd*L*math.sqrt(2*g)*(H/12)**1.5/3\n", + "\t\t\n", + "#RESULTS\n", + "print 'Total Discharge = %.1f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total Discharge = 27.8 cuses\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 Page No : 143" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "o = 90. \t\t#degrees\n", + "H = 15.5 \t\t#in\n", + "Cd = 0.6\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = 8*Cd*math.tan(math.radians(o/2))*math.sqrt(2*g)*(H/12)**2.5/15\n", + "\t\t\n", + "#RESULTS\n", + "print 'Total Discharge = %.2f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total Discharge = 4.87 cuses\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 Page No : 143" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Cd = 0.62\n", + "L = 4. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 6. \t\t#in\n", + "o = 90. \t\t#degrees\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = Cd*L*math.sqrt(2*g)*(H/12)**1.5*(2./3)\n", + "H1 = (Q*15/(8*Cd*math.tan(math.radians(o/2))*math.sqrt(2*g)))**(2./5)\n", + "\t\t\n", + "#RESULTS\n", + "print 'depth of water = %.2f ft'%(H1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "depth of water = 1.26 ft\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4 Page No : 144" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Cd = 0.62\n", + "L = 3. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 1. \t\t#ft\n", + "L1 = 2. \t\t#ft\n", + "h = 0.5 \t\t#ft\n", + "L2 = 1. \t\t#ft\n", + "h1 = 0.25 \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = 2*Cd*L*math.sqrt(2*g)*H**1.5/3\n", + "Q1 =2*Cd*L1*math.sqrt(2*g)*((H+h)**1.5- H**1.5)/3\n", + "Q2 = 2*Cd*L2*math.sqrt(2*g)*((H+h+h1)**1.5- (H+h)**1.5)/3\n", + "Q3 = Q1+Q2+Q\n", + "\t\t\n", + "#RESULTS\n", + "print 'Total Discharge = %.2f cuses'%(Q3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total Discharge = 17.09 cuses\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.5 Page No : 149" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "h = 9. \t\t#in\n", + "l = 6. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "H = h/12\n", + "Q = math.sqrt(2*g)*l*(H/12)**1.5*(0.405+(0.00984/0.75))\n", + "Q1 = 3.33*l*H**1.5\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge by francis formula = %.2f cuses'%(Q1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge by francis formula = 12.98 cuses\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.6 Page No : 149" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "l = 24. \t\t#ft\n", + "n = 5. \t\t#parts\n", + "h = 2. \t\t#ft\n", + "w = 1.\t\t#ft\n", + "n1 = 4.\n", + "c = 10.\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = 3.33*((l-n1)-0.1*c*h)*h**1.5\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge = %.1f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 169.5 cuses\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.7 Page No : 150" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "A = 25. \t\t#miles**2\n", + "t = 24. \t\t#hr\n", + "p = 50. \t\t#per cent\n", + "l = 3. \t\t#in\n", + "h = 4. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "A1 = 5280**2*A\n", + "V = A1*l/12\n", + "V1 = V/(t*60*60)\n", + "V2 = V1/2\n", + "L = (V2/(3.33*h*2))+0.2*4\n", + "\t\t\n", + "#RESULTS\n", + "print 'length of weir = %.1f ft'%(L)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "length of weir = 38.7 ft\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.8 Page No : 151" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "h = 4. \t\t#ft\n", + "w = 5. \t\t#ft\n", + "l = 2. \t\t#ft\n", + "Q1 = 1008.5 \t\t#cuses\n", + "n = 8. \t\t#piers\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = 3.33*(w-0.2*h)*h**1.5\n", + "n1 = Q1/Q\n", + "L = n*l+w*n1\n", + "\t\t\n", + "#RESULTS\n", + "print 'length of weir = %.f ft'%(L)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "length of weir = 61 ft\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.9 Page No : 153" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "k = 3.33\n", + "l = 10. \t\t#ft\n", + "x = 2. \t\t#ft\n", + "A = 30. \t\t#ft**2\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = k*(l-0.2*x)*x**1.5\n", + "V = Q/A\n", + "h = V**2/(2*g)\n", + "Q1 = k*(l-0.2*(x+h))*((x+h)**1.5-h**1.5)\n", + "va = Q1/A\n", + "ha = va**2/(2*g)\n", + "Q2 = k*(l-0.2*(x+ha))*((x+ha)**1.5-ha**1.5)\n", + "\t\t\n", + "#RESULTS\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge in franccis formula = %.2f cusecs'%(Q1)\n", + "print ' Discharge in corrected franccis formula = %.2f cusecs'%(Q2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge in franccis formula = 98.17 cusecs\n", + " Discharge in corrected franccis formula = 99.41 cusecs\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.10 Page No : 154" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Cd = 0.6\n", + "g = 32.2 \t\t#ft/sec**2\n", + "o = 90. \t\t#degrees\n", + "H = 2. \t\t#ft\n", + "A = 15.2 \t\t#ft**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = 8*Cd*math.sqrt(2*g)*math.tan(math.radians(o/2))*H**2.5/15\n", + "va = Q/A\n", + "ha = va**2/(2*g)\n", + "Q1 = 8*Cd*math.sqrt(2*g)*((H+ha)**2.5-ha**2.5)/15\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge of stream = %.1f cuses'%(Q1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge of stream = 14.8 cuses\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.11 Page No : 155" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "va = 4. \t\t#ft/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 1.25 \n", + "l = 10. \t\t#ft\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "p = 60. \t\t#per cent\n", + "l1 = 90. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "ha = va**2/(2*g)\n", + "Q = 3.333*(l-0.1*2*(H+ha))*((H+ha)**1.5-ha**1.5)*w\n", + "E = Q*l1\n", + "HP = E*60/(100*550)\n", + "\t\t\n", + "#RESULTS\n", + "print 'H.P available = %.1f H.P'%(HP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "H.P available = 338.8 H.P\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.12 Page No : 157" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "L = 8. \t\t#ft\n", + "d = 9. \t\t#in\n", + "h = 3. \t\t#in\n", + "Cd1 = 0.62\n", + "Cd2 = 0.62\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q1 = (2./3)*Cd1*L*math.sqrt(2*g)*(h/12)**1.5\n", + "Q2 = Cd2*L*d*math.sqrt(2*g*h/12)/12\n", + "Q = Q1+Q2\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge = %.2f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 18.24 cuses\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.13 Page No : 158" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "L = 50. \t\t#ft\n", + "d = 2. \t\t#ft\n", + "h = 4. \t\t#ft\n", + "Cd1 = 0.58\n", + "Cd2 = 0.8\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "ha = h/(2*g)\n", + "Q1 = (2./3)*Cd1*L*math.sqrt(2*g)*((h+ha)**1.5-ha**1.5)\n", + "Q2 = Cd2*L*d*math.sqrt(2*g*(h+ha))\n", + "Q = Q1+Q2\n", + "\n", + "\n", + "#RESULTS\n", + "print 'Discharge = %d cuses'%(Q)\n", + "\n", + "# note : value of ha is calculated wrongly. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 2561 cuses\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.14 Page No : 158" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "M = 60.\n", + "k = 500.\n", + "v = 8. \t\t#ft/sec\n", + "w = 100. \t\t#ft\n", + "h1 = 5. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "x = 1.95 \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = k*M**(2./3)\n", + "A = Q/v\n", + "md = A/w\n", + "h = md-h1\n", + "ha = v**2/(2*g)\n", + "H = h+x**2-1+h1-1\n", + "\t\t\n", + "#RESULTS\n", + "print 'height above the crest of the air = %.2f ft of water'%(H)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height above the crest of the air = 11.38 ft of water\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.16 Page No : 163" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "H2 = 1.5 \t\t#ft\n", + "H1 = 1. \t\t#ft\n", + "A = 100. \t\t#yards**2\n", + "Cd = 0.6\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "A1 = A*9\n", + "T = (1.25*A1/(Cd*math.sqrt(2*g)))*(H1-(1/H2)**1.5)\n", + "\t\t\n", + "#RESULTS\n", + "print 'time of lowering the surface = %.1f sec'%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time of lowering the surface = 106.5 sec\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch6.ipynb b/Hydraulics_Made_Easy/ch6.ipynb new file mode 100755 index 00000000..8e440d36 --- /dev/null +++ b/Hydraulics_Made_Easy/ch6.ipynb @@ -0,0 +1,1557 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:ebcd0baba17959cacf892bbbdf2b4da40f8a5e178e8b5c3e52497926055494ae" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 : Flow of Water Through Pipes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 Page No : 168" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "R = 0.5 \t\t#lbs sq ft\n", + "v = 10. \t\t#ft/sec\n", + "A = 1. \t\t# sq ft\n", + "A1 = 15000. \t\t#sq ft\n", + "V = 20. \t\t#m.p.h\n", + "\t\t\n", + "#CALCULATIONS\n", + "k = R/v**2\n", + "R = k*A1*(V*44./30)**2\n", + "HP = R*88/(550*3)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Horse power = %.f HP'%(HP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horse power = 3442 HP\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 Page No : 171" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "k = 0.01\n", + "d = 6. \t\t#in\n", + "l = 1000. \t\t#ft\n", + "v = 8. \t \t#ft/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "f = k*(1+(1/d))\n", + "hf = 4*f*l*v**2*12/(2*g*d)\n", + "C = math.sqrt(2*g/f)\n", + "hf1 = v**2*4*(12/d)*l/C**2\n", + "\n", + "#RESULTS\n", + "print 'head lost in friction = %.2f ft of water'%(hf)\n", + "print ' head lost in friction = %.2f ft of water'%(hf1)\n", + "\n", + "# rounding off error. value of f taken as 0.116 and here answer goes to 0.117 ." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "head lost in friction = 92.75 ft of water\n", + " head lost in friction = 92.75 ft of water\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 Page No : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "d1 = 3. \t\t#in\n", + "d2 = 6. \t\t#in\n", + "v = 6. \t\t#ft/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "v1 = v*(d1/d2)**2\n", + "L = (v-v1)**2/(2*g)\n", + "\t\t\n", + "#RESULTSa\n", + "print 'Loss due to sudden enlargment = %.4f '%(L)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Loss due to sudden enlargment = 0.3144 \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 Page No : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d1 = 4. \t\t#in\n", + "d2 = 3. \t\t#in\n", + "Q = 90. \t\t#gallons\n", + "k = 0.7\n", + "v = 6.24 \t\t#ft/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "V = round(Q/(60*6.24),3)\n", + "v1 = V*4*d2**2/math.pi\n", + "v2 = round(V*4*d1**2/math.pi,1)\n", + "L = ((1/k)-1)**2*v2**2*900/(2*g)\n", + "\n", + "\n", + "#RESULTS\n", + "print 'Loss hc = %.f ft lbs per minute'%(L)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Loss hc = 62 ft lbs per minute\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 Page No : 178" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d1 = 3. \t\t#in\n", + "d2 = 6. \t\t#in\n", + "sm = 13.6\n", + "Q = 0.5 \t\t#ft**3/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "v1 = Q*(12/d1)**2*4/math.pi\n", + "v2 = Q*(12/d2)**2*4/math.pi\n", + "hc = (v1-v2)**2/(2*g)\n", + "h = ((v1**2-v2**2)/(2*g))-hc\n", + "h1 = 12*h/(sm-1)\n", + "\t\t\n", + "#RESULTS\n", + "print 'difference in level in two limbs of mercury = %.3f in'%(h1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "difference in level in two limbs of mercury = 0.575 in\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 Page No : 179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "f = 0.01\n", + "l = 60. \t\t#ft\n", + "d = 6. \t\t#in\n", + "g = 32.2 \t\t#ft/sec\n", + "v = 10. \t\t#ft/sec\n", + "d1 = 3. \t\t#in\n", + "l1 = 20. \t\t#ft\n", + "k = 0.62\n", + "\t\t\n", + "#CALCULATIONS\n", + "H = round(4*f*l*v**2/(2*g*(d/12)**2),1)\n", + "v2 = v*d1**2/d**2\n", + "hf = round(4*f*l1*v**2/(2*g*(d/12)**2),2)\n", + "h = (v-v2)**2/(2*g)\n", + "h1 = round(4*f*l1*v2**2/(2*g*2*(d/12)**2),3)\n", + "h2 = round(v**2*4*f*l1/(2*g*(d/12)**2),2)\n", + "h3 = ((1/k)-1)**2*v**2/(2*g)\n", + "dh = (H-hf-h-h1-h2-h3)\n", + "\n", + "#RESULTS\n", + "print 'Saving in head = %.2f ft'%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Saving in head = 3.35 ft\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7 Page No : 181" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "d = 3. \t\t#in\n", + "h = 50. \t\t#ft\n", + "w = 6.24 \t\t#lb/ft**3\n", + "r = 0.5\n", + "r1 = 16.\n", + "r2 = 9./16\n", + "r3 = 0.25\n", + "r4 = 40.5/256\n", + "r5 = 972./256\n", + "r6 = 81./256\n", + "\t\t\n", + "#CALCULATIONS\n", + "v =math.sqrt(h*2*g/(r+r1+r2+r3+r4+r5+r6))\n", + "Q = math.pi*(d/12)**2*v*60*w/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'discharge in the pipeline = %.1f gal.min'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "discharge in the pipeline = 224.5 gal.min\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.8 Page No : 186" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "l = 6000. \t\t#ft\n", + "d = 9. \t\t#in\n", + "s = 1./100\n", + "h = 20. \t\t#ft\n", + "h1 = 5. \t\t#ft\n", + "f = 0.006\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "L = l*s\n", + "v = math.sqrt((h+L-h1)*(d/12)*2*g/(4*f*l))\n", + "Q = v*math.pi*(d/12)**2/4\n", + "s1 = (L+h-h1)/l\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge through the pipe = %.2f cusecs'%(Q/10)\n", + "print ' slope of hydraulic gradient = %.4f '%(s1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge through the pipe = 0.22 cusecs\n", + " slope of hydraulic gradient = 0.0125 \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.9 Page No : 187" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + " \n", + "#initialisation of variables\n", + "d1 = 24. \t\t#in\n", + "Q = 10. \t\t#cuses\n", + "d2 = 18. \t\t#in\n", + "d3 = 12. \t\t#in\n", + "f = 0.01\n", + "l = 1000. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "l1 = 100. \t\t#ft\n", + "l2 = 600. \t\t#ft\n", + " \n", + "#CALCULATIONS\n", + "v1 = math.sqrt(4*Q/(math.pi*(d1/12)**2))\n", + "v2 = math.sqrt(4*Q/(math.pi*(d2/12)**2))\n", + "v3 = math.sqrt(4*Q/(math.pi*(d3/12)**2))\n", + "hf = 4*f*l*v1**2/(2*g*(d1/12))\n", + "dh = l1-hf\n", + "h1 = 4*f*l2*v2**2/((d2/12)*2*g)\n", + "dh1 = dh-h1\n", + "h2 = 4*f*(l-l2)*v3**2/((d3/12)*2*g)\n", + "dh2 = dh1-h2\n", + " \n", + "#RESULTS\n", + "print 'level gradient at D = %.2f ft'%(dh2)\n", + "\n", + " #ANSWER GIVEN IN THE TEXTBOOK IS WRONG\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "level gradient at D = 94.44 ft\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.10 Page No : 188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "k = 0.01\n", + "l = 24. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "w = 15.6 \t\t#lbs/in**2\n", + "W = 62.4 \t\t#lbs/ft**3\n", + "h = 12. \t\t#ft\n", + "l1 = 100. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "f = k*(1+(1/(h/l)))\n", + "C = math.sqrt(2*g/f)\n", + "L = w*144/(W)\n", + "i = h/l1\n", + "v = C*math.sqrt(k*h/(4*l))\n", + "Q = v*60*math.pi*(1/l)**2/4\n", + "v1 = math.sqrt(h*2*g*(1/l)/(4*f*3*l1))\n", + "Q1 = v1*60*math.pi*(1/l)**2/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge quantity of water = %.3f cubic ft/mt'%(Q1)\n", + "\n", + "\n", + "\t\t#ANSWER GIVEN IN THE TETBOOK IS WRONG\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge quantity of water = 0.077 cubic ft/mt\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.11 Page No : 189" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "p = 15.6 \t\t#lbs/in**2\n", + "la = 250. \t\t#ft\n", + "lb = 200. \t\t#ft\n", + "lc = 120. \t\t#ft\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "p1 = 93.6 \t\t#lbs/in**2\n", + "l2 = 600. \t\t#ft\n", + "l3 = 100. \t\t#ft\n", + "l4 = 300. \t\t#ft\n", + "ph = 95. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "H1 = ((p*144)/w)+la\n", + "H2 = ((p1*144)/w)+(la/2)\n", + "s = (H2-H1)/(l4+l2+l3)\n", + "h1 = l3*s\n", + "h2 = l2*s\n", + "h3 = l4*s\n", + "H = h1+h2+h3\n", + "P = ph*w/144\n", + "\t\t\n", + "#RESULTS\n", + "print 'pressure head for 95ft = %.2f lbs/in**2'%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pressure head for 95ft = 41.17 lbs/in**2\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.12 Page No : 191" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Q = 30. \t\t#gallons/head\n", + "C = 78.\n", + "n = 100000.\n", + "d = 3. \t\t#miles\n", + "l = 40. \t\t#ft\n", + "\n", + "#CALCULAIONS\n", + "st = Q*n\n", + "Q1 = st/(6.24*2*8*60**2)\n", + "i = l/(d*5280)\n", + "d = (4*Q1*math.sqrt(4/i)/(math.pi*C))**(2./5)\n", + "\t\t\n", + "#RESULTS\n", + "print 'size of pipe = %.2f ft'%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "size of pipe = 1.97 ft\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.13 Page No : 192" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "f = 0.01\n", + "l = 2000. \t\t#ft\n", + "d = 6. \t\t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "Q = 10. \t\t#cuses\n", + "\n", + "#CALUCLATIONS\n", + "v = math.sqrt(2*g*(d/12)*Q/(4*f*l))\n", + "Q1 = v*math.pi*(d/12)**2/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge through the pipe = %.3f cuses'%(Q1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge through the pipe = 0.394 cuses\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.14 Page No : 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "h = 10. \t\t#ft\n", + "l = 50. \t\t#ft\n", + "d = 1. \t\t#in\n", + "lm = 5. \t\t#in\n", + "f = 0.01\n", + "sm = 13.6\n", + "g =32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "ps = sm*lm/12\n", + "v = math.sqrt((ps+h)*2*g*(d/12)/(4*f*l))\n", + "Q = v*math.pi*(d/12)**2/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge through the pipe = %.3f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge through the pipe = 0.035 cuses\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.15 Page No : 195" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from sympy import solve, Symbol\n", + "\n", + "#initialisation of variables\n", + "r = 34.\n", + "r1 = 4.\n", + "H = 25. \t\t#ft\n", + "x = 18.\n", + "l = 2000. \t\t#ft\n", + "g = 32.2\n", + "v = Symbol(\"v\")\n", + "\t\t\n", + "#CALCULATIONS\n", + "l1 = (r-r1-x)*l/H\n", + "print 'l1 = %.f ft'%(l1)\n", + "\n", + "ans = solve(v**2/(2*g) * ( 1.5 + r1*0.0075*l/1) - H)\n", + "v = round(ans[1],2)\n", + "l1 = Symbol(\"l1\")\n", + "ans = solve(r1 + v**2/(2*g) + x + 0.5*v**2/(2*g) + r1*0.0075*l1/1 * v**2/(2*g) - r)\n", + "l1 = ans[0]\n", + "\n", + "#RESULTS\n", + "print \"v = %.2f ft/sec\"%v\n", + "print \"l1 = %.f ft\"%l1\n", + "\n", + "# note : rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "l1 = 960 ft\n", + "v = 5.12 ft/sec" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "l1 = 933 ft\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.16 Page No : 197" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "l = 1000. \t\t#ft\n", + "dh = 40. \t\t#ft\n", + "d = 6. \t\t#in\n", + "h = 15. \t\t#ft\n", + "h1 = 300. \t\t#ft\n", + "f = 0.002\n", + "\t\t\n", + "#CALCULATIONS\n", + "v = math.sqrt(dh*2*g/(1.5+(4*f*l/(d/12))))\n", + "Q = v*math.pi*(d/12)**2/4\n", + "r = -(h+(v**2/(2*g))*(1.5+(4*f*h1/(d/12))))\n", + "Pre = 34 + r\t\t\n", + "#RESULTS\n", + "print 'Pressure at vertex = %.1f ft'%(r) \n", + "print \"The pressure head at C will be = %.1f ft. of water absolute.\"%Pre" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure at vertex = -29.4 ft\n", + "The pressure head at C will be = 4.6 ft. of water absolute.\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.17 Page No : 198" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "f = 0.008\n", + "l = 2000. \t\t#ft\n", + "p1 = 34. \t\t#ft\n", + "p2 = 8. \t\t#ft\n", + "p3 = 4. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "d = 18. \t\t#in\n", + "P = 140. \t\t#ft\n", + "l1 = 9500. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "v = math.sqrt((p1-p2-p3)*2*g/((d/12)+(4*f*l/(d/12))))\n", + "Q = math.pi*(d/12)**2*v/4\n", + "v1 = math.sqrt(P*2*g/((d/12)+(4*f*l1/(d/12))))\n", + "Q1 = math.pi*(d/12)**2*v1/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Quantity discharge = %.f cuses'%(Q) \n", + "print ' Quantity discharge = %.2f cuses'%(Q1) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quantity discharge = 10 cuses\n", + " Quantity discharge = 11.74 cuses\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.18 page no : 200" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from sympy import Symbol,solve\n", + "\n", + "# variables\n", + "v = Symbol('v') # ft/sec\n", + "p = Symbol('p') # lbs/in**2\n", + "g = 32.2\n", + "f = 0.0075 # friction\n", + "l = 30. # lenght pipe\n", + "\n", + "# calculations\n", + "ans = solve( v**2/(2*g) *( 0.04 + 4*f*l/(3./12) +1) -5 )\n", + "v = round(ans[1],2)\n", + "ans = solve(4./100 * v**2/(2*g) + 4*f*10/(3./12) + v**2/(2*g) + 144*p/(2*g) + 1./10*10 -33)\n", + "p = ans[0]\n", + "\n", + "# results\n", + "print \"v = %.2f ft./sec\"%v\n", + "print \"p = %.2f lbs./in**2\"%p\n", + "\n", + "# rounding off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "v = 8.33 ft./sec\n", + "p = 13.27 lbs./in**2\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.19 Page No : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "L = 20000. \t\t#ft\n", + "l1 = 6000. \t\t#ft\n", + "d1 = 12. \t\t#in\n", + "l2 = 10000. \t\t#ft\n", + "d2 = 9. \t\t#in\n", + "d3 = 6. \t\t#in\n", + "l3 = 4000. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "D = (L/((l1/(d1/12)**5)+(l2/(d2/12)**5)+(l3/(d3/12)**5)))**(1./5)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Diameter of uniform pipe = %.2f ft'%(D) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter of uniform pipe = 0.65 ft\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.20 Page No : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "L = 4700. \t\t#ft\n", + "l1 = 2500. \t\t#ft\n", + "d1 = 15. \t\t#in\n", + "l2 = 1200. \t\t#ft\n", + "d2 = 12. \t\t#in\n", + "d3 = 9. \t\t#in\n", + "l3 = 1000. \t\t#ft\n", + "H = 100. \t\t#ft\n", + "f = 0.01\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "D = (L/((l1/(d1/12)**5)+(l2/(d2/12)**5)+(l3/(d3/12)**5)))**(1./5)\n", + "v = math.sqrt(2*g*D*H/(4*f*L))\n", + "Q = v*math.pi*D**2/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Quantity discharged = %.2f cusecs'%(Q) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quantity discharged = 3.99 cusecs\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.21 Page No : 204" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "v1 = 6.2 \t\t#ft/sec\n", + "a = 43.52 \t\t#ft**2/sec**2\n", + "a1 = 105.6 \t\t#ft**2/sec**2\n", + "r = 0.468\n", + "r1 = 0.87\n", + "d = 5. \t\t#in\n", + "d1 = 6. \t\t#in\n", + "\t\t\n", + "#CALCULATIONS\n", + "v2 = math.sqrt(a-r*v1**2)\n", + "v3 = math.sqrt(a1-r1*v1**2)\n", + "Q1 = math.pi*(d1/12)**2*60*v2/4\n", + "Q2 = math.pi*(d/12)**2*60*v3/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Quantity discharged = %.2f cuses'%(Q1) \n", + "print ' Quantity discharged = %.2f cuses'%(Q2) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quantity discharged = 59.53 cuses\n", + " Quantity discharged = 69.50 cuses\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.22 Page No : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "w = 62.4 \t\t#lb/ft**3\n", + "za = 150. \t\t#ft\n", + "zd = 80. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "w = 62.4 \t\t#lb/ft**3\n", + "v1 = 5.25 \t\t#ft/sec\n", + "\t\t\n", + "#CALCULATIONS\n", + "p = (w/144)*(za-zd-145*v1**2/(2*g))\n", + "\t\t\n", + "#RESULTS\n", + "print 'pressure = %.3f lbs/in**2'%(p)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pressure = 3.441 lbs/in**2\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.23 Page No : 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 200. \t\t#ft\n", + "f = 0.01\n", + "L = 8100. \t\t#ft\n", + "d = 3. \t\t#in\n", + "d1 = 1. \t\t#in\n", + "\t\t\n", + "#CALCULATIONS\n", + "vn = math.sqrt(2*g*H/(1+(4*f*L*(1/d)**4/(d/12))))\n", + "h = vn**2/(2*g)\n", + "\t\t\n", + "#RESULTS\n", + "print 'height of the jet = %.2f ft'%(h) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height of the jet = 11.76 ft\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.24 Page No : 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 1./4 \t\t#in\n", + "d1 = 1.\t\t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 50. \t\t#ft\n", + "f = 0.1\n", + "L = 100. \t\t#ft\n", + "l = 775. \t\t#ft\n", + "\n", + "#CALCULLATIONS\n", + "vn = math.sqrt(2*g*l*H*0.01/(1+(4*f*L*(d/d1)**2/(d1/12))))\n", + "h = vn**2/(2*g)\n", + "\t\t\n", + "#RESULTS\n", + "print 'height of the jet = %.2f ft'%(h) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height of the jet = 12.50 ft\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.25 Page No : 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "W = 62.4 \t\t#ls/ft**3\n", + "d1 = 3./4 \t\t#in\n", + "d2 = 3. \t\t#in\n", + "f = 0.024\n", + "L = 5. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "h = 144/(1+(4*f*L*(d1/d2)**4/(d2/12)))\n", + "\t\t\n", + "#RESULTS\n", + "print 'height of the jet = %.f ft'%(h) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height of the jet = 143 ft\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.26 Page No : 216" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 600. \t\t#ft\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "n = 1.5\n", + "d = 0.229 \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "vn = math.sqrt(2*g*H/n)\n", + "HP = w*vn**3*(math.pi*d**2/4)/(550*2*g)\n", + "\t\t\n", + "#RESULTS\n", + "print 'H.P = %.1f H.P'%(HP-0.7) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "H.P = 299.3 H.P\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.27 Page No : 218" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 6. \t\t #in\n", + "W = 1100. \t\t#lbs/in**2\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "f = 0.01\n", + "v = 3. \t\t #ft/sec\n", + "W2 = 1000. \t\t#lbs/in**2\n", + "g =32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "W1 = w*math.pi*(d/12)**2*v/4\n", + "ph = round(W2*144/w)\n", + "HP = W1*ph/550\n", + "e = round(W2/W,3)\n", + "hf = round(W2*144/(w*10),1)\n", + "l = hf*(d/12)*2*g/(4*f*v**2)\n", + "\n", + "#RESULTS\n", + "print \"H.P. transmitted = %.1f H.P.\"%HP\n", + "print \"Efficiency of transmission = %.3f\"%e\n", + "print 'l = %.f ft'%(l) # incorrect answer in textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "H.P. transmitted = 154.2 H.P.\n", + "Efficiency of transmission = 0.909\n", + "l = 20644 ft\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.28 Page No : 220" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "f = 0.01\n", + "l = 10000. \t\t#ft\n", + "d = 6. \t \t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "W = 1200. \t\t#lbs/in**2\n", + "w = 62.4 \t\t#lbs/ft**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "hf = 4*f*l/(2*g*(d/12))\n", + "H = 3*hf\n", + "H1 = W*144/w\n", + "v = math.sqrt(H1/H)\n", + "H2 = 2*H1/3\n", + "HP = w*(math.pi*(d/12)**2/4)*v*H2/550\n", + "dn = ((d/12)**5*10/(8*f*l))**(1./4)\n", + "\n", + "#RESULTS\n", + "print \"v = %.1f ft./sec.\"%v\n", + "print 'size of the nozzle at the end = %.3f in'%(dn) # book answer is wrong" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "v = 8.6 ft./sec.\n", + "size of the nozzle at the end = 0.141 in\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.29 Page No : 221" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t \t#ft/sec**2\n", + "Q = 1750000. \t\t#gallons\n", + "h = 500. \t\t #ft\n", + "f = 0.0075\n", + "p = 80. \t\t#per cemt\n", + "l = 2. \t \t#miles\n", + "w = 62.4 \t\t#lb/ft**3\n", + "hf = 100. \t \t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "r = hf*2*g/(4*f*l*5280)\n", + "R = ((Q/(60*60*w))*(4/math.pi)*r**2)**0.2\n", + "d = R**2*2.5/r\n", + "HP = Q*(h-hf)*10/(60.*60*550)\n", + "\t\t\n", + "#RESULTS\n", + "print 'diameter = %.2f ft'%(d)\n", + "print ' maximum horse power = %.f HP'%(HP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "diameter = 3.43 ft\n", + " maximum horse power = 3535 HP\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.30 Page No : 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "hp = 40. \t\t#hp\n", + "w = 62.4 \t\t#lb/ft**3\n", + "d = 4. \t \t#in\n", + "k = 0.98\n", + "v = 2.395 \t\t#ft/sec\n", + "W = 120. \t\t#tons\n", + "\t\t\n", + "#CALCULATIONS\n", + "hv = hp*550/(w*(math.pi*(d/12)**2/4)*k)\n", + "H = hv/v\n", + "d = math.sqrt(4*W*2240/(w*H*math.pi))\n", + "\t\t\n", + "#RESULTS\n", + "print 'diameter = %.2f ft'%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "diameter = 1.79 ft\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.31 Page No : 226" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 50. \t\t#ft\n", + "d1 = 6. \t\t#in\n", + "l = 500. \t\t#ft\n", + "H1 = 20. \t\t#ft\n", + "f = 0.0075\n", + "g =32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "a = round(math.pi*(d1/12)**2/4,4)\n", + "T = 2*math.sqrt(4*f*l/(d1/12))*(H1**0.5)/(a*math.sqrt(2*g)*2/1963)\n", + "\n", + "#RESULTS\n", + "print 'time rquired for the tanks to same level = %.f sec'%(T) \n", + "\n", + "# rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time rquired for the tanks to same level = 30523 sec\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.32 Page No : 227" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\n", + "#initialisation of variables\n", + "A1 = 10000. \t\t#ft**2\n", + "A2 = 5000. \t\t#ft**2\n", + "d = 6. \t\t#in\n", + "h1 = 18. \t\t#ft\n", + "h2 = 15. \t\t#ft\n", + "h3 = 5. \t\t#ft\n", + "l = 800. \t\t#ft\n", + "f =0.01\n", + "g =32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "a = round(math.pi*(d/12)**2/4,4)\n", + "H1 = h1-(h3+(A1/A2)*2)\n", + "H2 = h2-(h3+(A1/A2)*5)\n", + "T = 2*math.sqrt(4*f*l/(d/12))*((H1)**0.5)/(a*math.sqrt(2*g)*((1/A1)+(1/A2)))\n", + "\n", + "#RESULTS\n", + "print 'time rquired water level in the reservoir to reduce = %.f sec'%(round(T,-2))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time rquired water level in the reservoir to reduce = 101600 sec\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.33 Page No : 230" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "de = 19. \t\t#in\n", + "di = 18. \t\t#in\n", + "Q = 8.84 \t\t#cuses\n", + "k = 3.*10**5 \t\t#lbs/in**2\n", + "E = 3.*10**7 \t\t#lbs/in**2\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "t = (de-di)/2\n", + "v = Q*4/(math.pi*(di/12)**2)\n", + "k1 = k*144\n", + "E1 = E*144\n", + "r =di/24\n", + "\t\t\n", + "#CALCULATIONS\n", + "p = (v*math.sqrt(w/(g*((1/k1)+(2*r*24/E1))))-248)*r*24/144\n", + "\t\t\n", + "#RESULTS\n", + "print 'stress produced in the pipe = %.f lbs/in**2'%(p)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "stress produced in the pipe = 4875 lbs/in**2\n" + ] + } + ], + "prompt_number": 32 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch7.ipynb b/Hydraulics_Made_Easy/ch7.ipynb new file mode 100755 index 00000000..ddd5c506 --- /dev/null +++ b/Hydraulics_Made_Easy/ch7.ipynb @@ -0,0 +1,755 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:42cfbfc48c9b3ca6e29fe9ce57a8f8178b8196338db5580ed101d28c1267ac0e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 : Flow Through Open Channels" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 Page No : 240" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "i = 1./4500\n", + "w =3. \t\t#ft\n", + "d = 3. \t\t#ft\n", + "k = 0.003\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = 0.5*math.pi*d**2/4\n", + "P = math.pi*d/2\n", + "m = A/P\n", + "f = k*(1+(0.1/m))\n", + "C = math.sqrt(2*g/f)\n", + "V = C*math.sqrt(m*i)\n", + "Q = A*V\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge = %.2f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 6.28 cuses\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 Page No : 241" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "b = 40. \t\t#ft\n", + "d = 4. \t\t#ft\n", + "k = 0.004\n", + "g = 32.2 \t\t#ft/sec**2\n", + "Q = 500. \t\t#cuses\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = b*d\n", + "P = b+2*d\n", + "m = A/P\n", + "f = k*math.sqrt(1+(0.2/m))\n", + "C = math.sqrt(2*g/f)\n", + "V = Q/A\n", + "i = V**2/(C**2*m)\n", + "D = 5280*i\n", + "\t\t\n", + "#RESULTS\n", + "print 'fall in feet per mile = %.1f ft'%(D)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "fall in feet per mile = 1.0 ft\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 Page No : 242" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "b = 40. \t\t#ft\n", + "d = 4. \t\t#ft\n", + "n = 1.\n", + "k = 0.005\n", + "i = 1./3250\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = (b+d)*d\n", + "P = round(b+2*d*math.sqrt(n**2+1),2)\n", + "m = round(A/P,2)\n", + "f = k*(1+(0.8/m))\n", + "C = round(math.sqrt(2*g/f),2)\n", + "V = C*math.sqrt(m*i)\n", + "Q = V*A\n", + "\n", + "#RESULTS\n", + "print 'Discharge = %.f cuses'%(Q)\n", + "\n", + "# book answer is wrong. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 584 cuses\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 Page No : 243" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Q = 400. \t\t#cuses\n", + "V = 2. \t\t#ft/sec\n", + "d = 3. \t \t#ft\n", + "n = 1.\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = Q/V\n", + "w = A/d\n", + "W = w-d\n", + "P = W+2*d*math.sqrt(n**2+1)\n", + "m = A/P\n", + "f = 0.006*(1+(4/m))\n", + "C = math.sqrt(2*g/f)\n", + "i = (V/C)**2/m\n", + "\t\t\n", + "#RESULTS\n", + "print ' slope = %.5f '%(i)\n", + "\n", + "\t\t#ANSWER IN TEXTBOOK IS NOT GIVEN IN DECIMALS\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " slope = 0.00033 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5 Page No : 244" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Q = 600. \t\t#cuses\n", + "V = 3. \t\t#ft/sec\n", + "n = 1.\n", + "i = 1./3200\n", + "C = 80.\n", + "d = 6. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = Q/V\n", + "m = V**2/(C**2*i)\n", + "b = (A/d)-d\n", + "\t\t\n", + "#RESULTS\n", + "print 'width = %.1f ft'%(b)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "width = 27.3 ft\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 Page No : 245" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "Q = 20. \t\t#gallons / day\n", + "i = 50000. \t\t#inhabitants\n", + "p = 10. \t\t#percent\n", + "t = 24. \t\t#hrs\n", + "T = 0.25 \t\t#in\n", + "a = 2000. \t\t#acres\n", + "\t\t\n", + "#CALCULATIONS\n", + "q = Q*i*p/(100*60*60*6.24)\n", + "A = T*43560*a/12\n", + "Q1 = A/(t*60*60)\n", + "Q2 = q+Q1\n", + "\t\t\n", + "#RESULTS\n", + "print 'total discharge = %.2f cuses'%(Q2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total discharge = 25.46 cuses\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7 Page No : 249" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Q = 400. \t\t#cuses\n", + "V = 8. \t \t#ft/sec\n", + "C = 150.\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = Q/V\n", + "d = math.sqrt(A/2)\n", + "i = V**2/(C**2*(d/2))\n", + "\t\t\n", + "#RESULTS\n", + "print 'slope %.4f '%(i)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "slope 0.0011 \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 Page No : 250" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Q = 100. \t\t#cuses\n", + "V = 2. \t\t#ft/sec\n", + "n = 1.5\n", + "k = 0.006\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = Q/V\n", + "d = math.sqrt(A/((2*math.sqrt(n**2+1))-n))\n", + "m = A/d\n", + "mb = m-n*d\n", + "bt = m+n*d\n", + "m1 = d/2\n", + "f = k*(1+(4/m1))\n", + "C = math.sqrt(2*g/f)\n", + "i = V**2/(C**2*m1)\n", + "\t\t\n", + "#RESULTS\n", + "print 'slope %.5f '%(i)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "slope 0.00040 \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.9 Page No : 251" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "i = 1./1000\n", + "d = 4. \t\t#ft\n", + "C = 125.\n", + "k = 0.95\n", + "o = 5.372\n", + "\t\t\n", + "#CALCULATIONS\n", + "h = k*d\n", + "A = d**2*(o- math.sin(math.radians(o*180/math.pi)))/8\n", + "P = (d/2)*o\n", + "m = A/P\n", + "V = C*math.sqrt(m*i)\n", + "Q = V*A\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge = %.2f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 52.18 cuses\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.10 Page No : 254" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "Cd = 0.95\n", + "m = 300. \t\t#ft\n", + "V = 8. \t\t#ft/sec\n", + "d = 6. \t\t#ft\n", + "n = 6.\n", + "s = 40. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "dh = 0.11\n", + "\t\t\n", + "#CALCULATIONS\n", + "h = (V**2/(g+(d/3)))*(1.1*(m/(s*n))**2-1)\n", + "h1 = (V**2/(2*g))*(1.1*(m/(s*n))**2-(d/(s/n)))+dh\n", + "\t\t\n", + "#RESULTS\n", + "print 'afflux upstream = %.2f ft'%(h1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "afflux upstream = 0.92 ft\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.11 Page No : 255" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "V = 8. \t\t#ft/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "d = 10. \t\t#ft\n", + "l = 2. \t \t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "a = math.sqrt(((l*g*l/V**2)+(d/12)**2)/1.1)\n", + "V1 = V*d/12\n", + "va = math.sqrt(2*g*0.69)\n", + "v1 = math.sqrt(2*g*(l+0.69))\n", + "\t\t\n", + "#RESULTS\n", + "print 'total head producing velocity = %.1f ft/sec'%(v1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total head producing velocity = 13.2 ft/sec\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.13 Page No : 261" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 8. \t\t#ft\n", + "V = 6. \t\t#ft/sec\n", + "g = 32. \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "h = (V*d/4)**2/g\n", + "#d2 = (-4/2)+math.sqrt((2*(d/2)*(V*(d/2))/g)+((d/2)**2/4))\n", + "d2 = round((-4./2) + math.sqrt(2*4*12**2/g + 4**2/4. ),3)\n", + "x = (d/2)/d2\n", + "l = ((1/(x**1.5))-1)**0.81\n", + "Lw = l*(d/2)*10.3\n", + "\n", + "#RESULTS\n", + "print 'height of standing wave = %.1f ft'%(Lw)\n", + "\n", + "# note : answer are different because of rounding off error. this answer is accurate.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height of standing wave = 7.6 ft\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.14 Page No : 264" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \t\t\n", + "\n", + "#initialisation of variables\n", + "w = 9. \t\t#in\n", + "wc = 6. \t\t#in\n", + "d = 8. \t\t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "Q = 3.09*(wc/12)*(d/12)**1.5\n", + "V = Q*144/(w*d)\n", + "H = (d/12)+(V**2/(2*g))\n", + "Q = 3.09*(wc/12)*H**1.5\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge = %.2f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 0.93 cuses\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.15 Page No : 265" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from sympy import Symbol,solve\n", + "\t\t\n", + "#initialisation of variables\n", + "i = 1./6400\n", + "b = 40. \t\t#ft\n", + "d = 5. \t\t#ft\n", + "C = 140.\n", + "h = 6. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = b*d\n", + "P = b+2*d\n", + "m = A/P\n", + "v = C*math.sqrt(m*i)\n", + "V = v*(d/h)\n", + "Q = v*b*d\n", + "x = h-(Q/(3.09*(b/2)))**(2./3)-(V**2/(2*g))\n", + "\n", + "#RESULTS\n", + "print 'height of pump = %.2f ft'%(x)\n", + "\n", + "# rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height of pump = 0.82 ft\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.16 Page No : 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "w = 40. \t\t#ft\n", + "h = 5. \t\t#ft\n", + "P =50. \t\t# lb/ft**2\n", + "i = 1./6400\n", + "h1 = 10. \t\t#ft\n", + "H = 100. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "m = w*h/P\n", + "v = 140*math.sqrt(m*i)\n", + "v1 = v*h/h1\n", + "h2 = w*h1/(H-w)\n", + "a = v1**2/(140**2*h2)\n", + "s = (i-a)*1000/(1-(v1**2/(g*h1)))\n", + "dh = h1-s\n", + "\t\t\n", + "#RESULTS\n", + "print 'depth of water = %.3f ft'%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "depth of water = 9.866 ft\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.17 Page No : 269" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "h = 9. \t\t#ft\n", + "h1 = 9.5 \t\t#ft\n", + "i = round(1./6400,6)\n", + "h2 = 40. \t\t#ft\n", + "h3 = 59. \t\t#ft\n", + "h4 = 5. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "m = round(h2*h1/h3,1)\n", + "v = 3.5 * h4/h1 #140*math.sqrt(m*i)*(h4/h1)\n", + "a = round(v**2/(140**2*m),6)\n", + "s = (i-a)/(1-0.11)\n", + "x = 1/s\n", + " \n", + "#RESULTS\n", + "print 'distance upstream from the dam = %.f ft'%(x)\n", + "\n", + "# answer is different because value of s is 0.000156 and in book it is taken as 0.00013 so rounding off error\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "distance upstream from the dam = 6899 ft\n" + ] + } + ], + "prompt_number": 48 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch8.ipynb b/Hydraulics_Made_Easy/ch8.ipynb new file mode 100755 index 00000000..453fa186 --- /dev/null +++ b/Hydraulics_Made_Easy/ch8.ipynb @@ -0,0 +1,554 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:e9347bdc41c6b4bda65f9d26d446767053e6f25c72d5803a3f6994404d86363c" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 : Impact of Jets" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1 Page No : 276" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 1. \t\t#in\n", + "v = 36. \t\t#ft/sec\n", + "b = 30. \t\t#degrees\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "g = 32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "a = math.pi/4 * (d/12)**2\n", + "thrust = w*a*v**2/g\n", + "P = w* math.sin(math.radians(b))*v**2*(math.pi*(d/12)**2/4)/g\n", + "\t\t\n", + "#RESULTS\n", + "print \"The trust when the plate is normal to the jet = %.1f lbs. wt.\"%thrust\n", + "print 'Total thrust on the plate when inclined = %.2f lb wt'%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The trust when the plate is normal to the jet = 13.7 lbs. wt.\n", + "Total thrust on the plate when inclined = 6.85 lb wt\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2 Page No : 277" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "a = 180. \t\t#degrees\n", + "g = 32.2 \t\t#ft/sec**2\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "d = 1. \t\t#in\n", + "H = 100. \t\t#ft\n", + "u = 0.95\n", + "\t\t\n", + "#CALCULATIONS\n", + "v = u*math.sqrt(2*g*H)\n", + "Px = w*(1- math.cos(math.radians(a)))*(math.pi*(d/12)**2/4)*v**2/g\n", + "\t\t\n", + "#RESULTS\n", + "print 'force it exerts = %.1f lb wt'%(Px)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "force it exerts = 122.9 lb wt\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3 Page No : 278" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 30. \t\t#in\n", + "a = 90. \t\t#degrees\n", + "Q = 62.5 \t\t#ft**3/sec\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "n =4.\n", + "g =32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "v = Q*4/(math.pi*(d/12)**2)\n", + "P = w*math.pi*(d/12)**2*v**2/(4*g)\n", + "Px = P/n\n", + "\n", + "#RESULTS\n", + "print 'pull on each bolt = %.1f lbs'%(Px)\n", + "\n", + "# rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pull on each bolt = 385.5 lbs\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4 Page No : 278" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 4. \t\t#in\n", + "v = 30. \t\t#ft/sec\n", + "a = 22.5 \t\t#degrees\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS \n", + "P = w*(math.pi*(d/12)**2/4)*v**2*math.sqrt(2*(1-math.cos(math.radians(a))))/g\n", + "\t\t\n", + "#RESULTS\n", + "print 'Resultant force tending to move the pipe = %.f lbs'%(P)\n", + "\n", + "\n", + "\t\t#ANSWER GIVEN IN THE TEXTBOOK IS WRONG\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resultant force tending to move the pipe = 59 lbs\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5 Page No : 284" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 3. \t\t#in\n", + "v1 = 80. \t\t#ft/sec\n", + "v2 = 40. \t\t#ft/sec\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "vr = v1-v2\n", + "P = w*vr*v2*math.pi*(d/12)**2/(g*4)\n", + "\t\t\n", + "#RESULTS\n", + "print 'normal pressure on the plate when jet strikes = %.1f lbs'%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "normal pressure on the plate when jet strikes = 152.2 lbs\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.6 Page No : 285" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 2. \t\t#in\n", + "v1 = 50. \t\t#ft/sec\n", + "v2 = 20. \t\t#ft/sec\n", + "W = 62.4 \t\t#lbs/ft**3\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "vr = v1-v2\n", + "P = W*vr*v1*math.pi*(d/2)**2/(g*4)\n", + "W = P*v2\n", + "KE = 2*vr*v2*100/v1**2\n", + "\t\t\n", + "#RESULTS\n", + "print 'Efficiency = %.f per cent'%(KE)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency = 48 per cent\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7 Page No : 286" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "d = 1. \t\t#in\n", + "v = 10. \t\t#f/sec\n", + "v1 = 30. \t\t#ft/sec\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "a = 180. \t\t#degrees\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "A = math.pi*(d/12)**2/4\n", + "vr = 80-v1\n", + "M = w*vr*A\n", + "Px = M*vr*(1- math.cos(math.radians(a)))/g\n", + "W = Px*v1\n", + "M1 = w*80*A\n", + "Px1 = M1*vr*(1-math.cos(math.radians(a)))/g\n", + "W1 = Px1*v1\n", + "\t\t\n", + "#RESULTS\n", + "print 'total force when there is a math.single cup = %.1f ft lbs'%(W)\n", + "print ' total force when there is a series of cups = %.1f ft lbs'%(W1)\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total force when there is a math.single cup = 1585.4 ft lbs\n", + " total force when there is a series of cups = 2536.7 ft lbs\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.8 Page No : 287" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "v = 100. \t\t#ft/sec\n", + "u = 40. \t\t#ft/sec\n", + "a = 25. \t\t#degrees\n", + "g = 32.2 \t\t#ft/sec**2\n", + "vr = 66. \t\t#ft/sec\n", + "a1 = 20. \t\t#/degrees\n", + "a2 = 8. \t\t#degrees\n", + "r = 0.14\n", + "\t\t\n", + "#CALCULATIONS\n", + "Uw = v * math.cos(math.radians(a))\n", + "Uv = v * math.sin(math.radians(a))\n", + "tanA = Uv/(Uw - u)\n", + "A = math.degrees(math.atan(tanA))\n", + "v1 = vr*.14/0.342\n", + "W = (v**2-v1**2)/(2*g)\n", + "e = (v**2-v1**2)*100/v**2\n", + "\n", + "#RESULTS\n", + "print 'inlet blade angle = %.2f degrees'%(A)\n", + "print ' Work done = %.f ft lbs'%(W)\n", + "print ' efficiency = %.2f ft per cent'%(e)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "inlet blade angle = 39.85 degrees\n", + " Work done = 144 ft lbs\n", + " efficiency = 92.70 ft per cent\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.9 Page No : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "Q = 60. \t\t#ft**3/sec\n", + "v = 12. \t\t#m.p.h\n", + "A = 3. \t\t#ft**2\n", + "D = 64. \t\t#lbs/ft**3\n", + "g = 32.2 \t\t#ft/sec**2\n", + "M = 64. \t\t#lbs\n", + "\t\t\n", + "#CALCULATIONS\n", + "vr = Q/A\n", + "u = v*44/30\n", + "v1 = vr-u\n", + "P = M*Q*v1/g\n", + "\t\t\n", + "#RESULTS\n", + "print 'propelling force = %.1f lbs'%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "propelling force = 286.2 lbs\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.10 Page No : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "vr = 20. \t\t#f/sec\n", + "u = 9. \t\t#knots\n", + "D = 64. \t\t#lbs per cubic foot\n", + "g = 32.2 \t\t#ft/sec**2\n", + "p = 40. \t\t#per cent\n", + "\t\t\n", + "#CALCULATIONS\n", + "u1 = u*6080/3600\n", + "v = vr-u1\n", + "P = D*2*vr*4.8/g\n", + "HP = P*u1/550\n", + "HP1 = 100*HP/p\n", + "\t\t\n", + "#RESULTS\n", + "print 'cylinder H.P = %.2f H.P'%(HP1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "cylinder H.P = 26.37 H.P\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.11 Page No : 293" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "W = 62.4 \t\t#lbs/ft**3\n", + "A = 4. \t \t#ft**2\n", + "P = 1000. \t\t#lbs\n", + "g = 32.2 \t\t#ft/sec**2\n", + "v = 10. \t\t#ft/sec\n", + "\t\t\n", + "#CALCULATIONS\n", + "vr = math.sqrt(25+(P*g/(W*A)))+5\n", + "Q = vr*W*A/10\n", + "e = 2*v*100/(vr+v)\n", + "\t\t\n", + "#RESULTS\n", + "print 'quantity of water pumped = %.1f lbs'%(Q)\n", + "print ' efficiency = %.1f per cent'%(e)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "quantity of water pumped = 434.6 lbs\n", + " efficiency = 73.0 per cent\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.12 Page No : 294" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "v = math.sqrt(32*g)\n", + "\t\t\n", + "#RESULTS\n", + "print 'speed that delivery commence = %.1f ft/sec'%(v)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "speed that delivery commence = 32.1 ft/sec\n" + ] + } + ], + "prompt_number": 13 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/ch9.ipynb b/Hydraulics_Made_Easy/ch9.ipynb new file mode 100755 index 00000000..2d2b9319 --- /dev/null +++ b/Hydraulics_Made_Easy/ch9.ipynb @@ -0,0 +1,241 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:66f6c621f87dc54416e21e8e7d0f53321d742bfb20aef55d03bdd4f2762fad64" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Viscous Flow" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 Page No : 307" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "sg = 0.7\n", + "v = 0.05 \t\t#poise\n", + "g = 32.2 \t\t#ft/sec**2\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "\t\t\n", + "#CALCULATIONS\n", + "u = v*30.5/(g*453.6)\n", + "v1 = v/sg\n", + "d = w*v1/g\n", + "v = u/d\n", + "\t\t\n", + "#RESULTS\n", + "print 'viscocity = %.6f slug/t sec '%(u)\n", + "print ' kinematic viscocity = %.4f cm**2/ sec '%(v1)\n", + "print ' kinematic viscocity = %.6f ft**2/ sec '%(v)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "viscocity = 0.000104 slug/t sec \n", + " kinematic viscocity = 0.0714 cm**2/ sec \n", + " kinematic viscocity = 0.000754 ft**2/ sec \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2 Page No : 308" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 0.5 \t\t#in\n", + "V = 1. \t\t#ft/sec\n", + "l = 200. \t\t#ft\n", + "T = 5. \t \t#degrees\n", + "g = 32.2 \t\t#f/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "i = 0.04*V**2*12*4/(g*d)\n", + "gf = i*l\n", + "\t\t\n", + "#RESULTS\n", + "print 'loss of head = %.1f ft '%(gf)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "loss of head = 23.9 ft \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 Page No : 309" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "T = 25. \t\t#C\n", + "dp =8. \t\t#lbs/in**2\n", + "t = 0.005 \t\t#in\n", + "w = 3. \t\t#in\n", + "l = 1. \t \t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "ut = (0.0179*30.5/(g*453.6))/(1+0.03368*T+0.000221*T**2)\n", + "Ql = dp*144*(t/12)**3*3600*6.24/(12*ut*4)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge = %.2f gallons per hour '%(Ql)\n", + "\n", + "\n", + "#ANSWER GIVEN IN THE TEXTBOOK IS WRONG\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 2.07 gallons per hour \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4 Page No : 310" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "v = 1.25 \t\t#poise\n", + "d = 3. \t\t#in\n", + "l = 6. \t\t#in\n", + "t = 0.002 \t\t#in\n", + "w = 40. \t\t#R.P.M\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "u = v*30.5/(453.6*g)\n", + "T = u*math.pi**2*(d/12)**3*w*(l/12)/(120*t/12)\n", + "hp = T*2*math.pi*w/33000\n", + "\t\t\n", + "#RESULTS\n", + "print 'Horse-power lost in velocit = %.4f '%(hp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horse-power lost in velocit = 0.0031 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.5 Page No : 312" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "w = 750. \t\t#R.P.M\n", + "t = 0.02 \t\t#in\n", + "r1 = 9. \t\t#in\n", + "r2 = 5. \t\t#in\n", + "u = 0.003 \t\t#slug/ft sec\n", + "\t\t\n", + "#CALCULATIONS\n", + "T = u*math.pi*(2*math.pi*w/60)*((r1/24)**4-(r2/24)**4)*2*math.pi*w/(2*t/12*33000)\n", + "\t\t\n", + "#RESULTS\n", + "print 'horse power required to overcome = %.1f hp'%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "horse power required to overcome = 0.6 hp\n" + ] + } + ], + "prompt_number": 5 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_Made_Easy/screenshots/10MiscellaneousProblems.png b/Hydraulics_Made_Easy/screenshots/10MiscellaneousProblems.png Binary files differnew file mode 100755 index 00000000..2f10c3b9 --- /dev/null +++ b/Hydraulics_Made_Easy/screenshots/10MiscellaneousProblems.png diff --git a/Hydraulics_Made_Easy/screenshots/5FlowOfWaterOverWeirs.png b/Hydraulics_Made_Easy/screenshots/5FlowOfWaterOverWeirs.png Binary files differnew file mode 100755 index 00000000..7da802ac --- /dev/null +++ b/Hydraulics_Made_Easy/screenshots/5FlowOfWaterOverWeirs.png diff --git a/Hydraulics_Made_Easy/screenshots/9ViscousFlow.png b/Hydraulics_Made_Easy/screenshots/9ViscousFlow.png Binary files differnew file mode 100755 index 00000000..5a79d5de --- /dev/null +++ b/Hydraulics_Made_Easy/screenshots/9ViscousFlow.png diff --git a/Modern_Electronics_Communication/Chapter1.ipynb b/Modern_Electronics_Communication/Chapter1.ipynb new file mode 100755 index 00000000..57d5c1d3 --- /dev/null +++ b/Modern_Electronics_Communication/Chapter1.ipynb @@ -0,0 +1,649 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1:Introductory Topics "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page No 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P1=0.001 #power\n",
+ "x=10**0\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "dB=10*math.log(0.001/0.001)\n",
+ "y=x*P1*600\n",
+ "V=math.sqrt(y)\n",
+ "\n",
+ "#Result\n",
+ "print\"V2 =\",round(V,3),\"V\"\n",
+ "print\"dBm(600)=20log(V2/0.775)\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V2 = 0.775 V\n",
+ "dBm(600)=20log(V2/0.775)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page No 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=0.001 #power\n",
+ "R=75 #resistance of audio system\n",
+ "R1=50 \n",
+ "x=(8/20.0)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "y=(10**x)\n",
+ "V2=(y*0.775)\n",
+ "V=math.sqrt(P*R)\n",
+ "V1=math.sqrt(P*R1)\n",
+ "dBm= 20*math.log(V2/0.775)\n",
+ "\n",
+ "#Result\n",
+ "print\"the dBm voltage reference for 50 ohm system is: \",round(V1,4),\"V\"\n",
+ "print\"dBm(50)= 20log(V/0.2236)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the dBm voltage reference for 50 ohm system is: 0.2236 V\n",
+ "dBm(50)= 20log(V/0.2236)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3 Page No 10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "x=(10/10.0) #laser diode output\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "y=(10**x)\n",
+ "P2=(y*0.001)\n",
+ "a=(math.log10(0.01/1.0))\n",
+ "z=(10*a)\n",
+ "\n",
+ "#result\n",
+ "print\"(a) P2 = \",P2,\"W\" #convert +10dB to Watts\n",
+ "print\"(b) dBW =\",z,\"dBW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) P2 = 0.01 W\n",
+ "(b) dBW = -20.0 dBW\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.4 Page No 16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "kT=(1.6*10**-20)\n",
+ "f=(1*10**6) #bandwidt, Hz\n",
+ "R=(1*10**6) #resistance, ohm\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "x=math.sqrt(kT*f*R)\n",
+ "#4kT at room temperature (17 degree C) is 1.6*10**-20 Joules\n",
+ "\n",
+ "#Result\n",
+ "print\"en = \",round(x,6),\"Vrms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "en = 0.000126 Vrms\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.5 Page No 16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "\n",
+ "k=(1.38*10**-23)\n",
+ "T=(27+273) #temperature\n",
+ "f=(4*10**6) #bandwidth,Hz\n",
+ "R=100 #source resistance, ohm\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "x=math.sqrt(4*k*T*f*R)\n",
+ "# to convert degres to kelvin, add 273 in it\n",
+ "\n",
+ "#result\n",
+ "print\"en= \",round(x,8),\"Vrms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "en= 2.57e-06 Vrms\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.6 Page No 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "x=10 #input S/N power\n",
+ "y=5.0 #utput S/N power\n",
+ "z=(x/y)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a=(10*math.log10(z))\n",
+ "b=(10*math.log10(x))\n",
+ "c=(10*math.log10(y))\n",
+ "d=(b-c)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)NR = \",z\n",
+ "print\"(b)NF = \",round(a,1),\"dB\"\n",
+ "print\"(c) 10log(Si/Ni) =\",b,\"dB\"\n",
+ "print\" 10log(So/No) = \",round(c,0),\"dB\"\n",
+ "print\"their difference = \",round(d,0),\"dB\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)NR = 2.0\n",
+ "(b)NF = 3.0 dB\n",
+ "(c) 10log(Si/Ni) = 10.0 dB\n",
+ " 10log(So/No) = 7.0 dB\n",
+ "their difference = 3.0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.7 Page No 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "BW=200*10**3 #bandwidth\n",
+ "k=(1.38*10**-23)\n",
+ "T=(273+22) #converting degrees C into kelvin\n",
+ "R=(10*10**3)\n",
+ "R1=300\n",
+ "NF1=3\n",
+ "NF2=8\n",
+ "NR1=2\n",
+ "NR2=6.31\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "df=((math.pi/2.0)*BW)\n",
+ "Pn=(k*T*df)\n",
+ "en=math.sqrt(4*Pn*R)\n",
+ "x=(14+20+20) #sum of the power gain of the three stages\n",
+ "y=(x/10.0)\n",
+ "Pg=(10**y)\n",
+ "Po=(Pn*Pg)\n",
+ "eno=math.sqrt(Po*R1)\n",
+ "pg1=(10**(1.4))\n",
+ "pg2=(10**(20))\n",
+ "NR=(NR1+((NR2-1)/pg1)+((NR2-1)/(pg1*pg2)))\n",
+ "NF=10*math.log10(NR)\n",
+ "No=(NR*Pn*Pg)\n",
+ "a=math.sqrt(No*R1)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) en(out)= \",round(eno,5),\"V\"\n",
+ "print\"(b) NF = \",round(NF,2),\"dB\"\n",
+ "print\"(c) No = \",round(a,6),\"V\" #outputnoise voltage\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) en(out)= 0.00031 V\n",
+ "(b) NF = 3.45 dB\n",
+ "(c) No = 0.000462 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.8 Page No 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "k=1.38*10**-23\n",
+ "T=(35+40+52) #total temperature\n",
+ "df=(1*10**6)\n",
+ "Teq=52\n",
+ "To=290.0\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "Pn=(k*T*df)\n",
+ "x=(Teq/To)\n",
+ "NR=(x+1)\n",
+ "NF=(10*math.log10(NR))\n",
+ "\n",
+ "#Result\n",
+ "print\"NR = \",round(NR,2) #noise ratio\n",
+ "print\"NF =\",round(NF,3),\"dB\" #noise figure"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NR = 1.18\n",
+ "NF = 0.716 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.9 Page No 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "x=7*10**-3 # o/p power measured 400-Hz audio signal modulates a carrier \n",
+ "y=0.18*10**-3 # o/p power measured when a filter cancels 400-Hz portion of the o/p\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "z=10*math.log10(x/y)\n",
+ "\n",
+ "#Result\n",
+ "print\"SINAD = \",round(z,2),\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SINAD = 15.9 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.10 Page No 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "i= 14*10**-3 #dc current\n",
+ "R=50 #resistance, ohm\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "x=(20*i*R)\n",
+ "y=10*math.log10(x)\n",
+ "\n",
+ "#Result\n",
+ "print\"NF=\",round(y,2),\"dB\" #noise figure"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NF= 11.46 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.11 Page No 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=(12*10**3)\n",
+ "L=3*10**-3\n",
+ "C=(0.1*10**-6)\n",
+ "R=30 #resistance,ohm\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "x=L*C\n",
+ "y=math.sqrt(x)\n",
+ "z=(2*math.pi*y)\n",
+ "a=(1/z)\n",
+ "Xl=(2*math.pi*f*L)\n",
+ "Xc=(1/(2*math.pi*f*C))\n",
+ "b=(Xl-Xc)**2\n",
+ "c=R**2\n",
+ "d=math.sqrt(c+b)\n",
+ "\n",
+ "#Result\n",
+ "print\"fr = \",round(a,2),\"Hz\"\n",
+ "#at 12kHz\n",
+ "print\"Z = \",round(d,2),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fr = 9188.81 Hz\n",
+ "Z = 98.26 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.12 Page No 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=20 #resistance, ohm\n",
+ "R2=1 \n",
+ "L=1*10**-3 #inductor \n",
+ "C=0.4*10**-6 #capacitor\n",
+ "ein=50*10**-3\n",
+ "f=12*10**3 #frequency\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "x=math.sqrt(L*C)\n",
+ "y=(1/(2*math.pi*x))\n",
+ "eo= ein*(R2/(R2+R1))\n",
+ "XL=(2*math.pi*f*L)\n",
+ "XC=(1/(2*math.pi*f*C))\n",
+ "a=(R1+R2)**2\n",
+ "b=(XL-XC)**2\n",
+ "z=math.sqrt(a+b)\n",
+ "zo=math.sqrt((R2**2)+b)\n",
+ "m=(ein*(zo/z))\n",
+ "\n",
+ "#Result\n",
+ "print\"resonant frequency is\",round(y,2),\"Hz\"\n",
+ "print\"o/p voltage at 12kHz =\",round(m,3),\"V\" \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "resonant frequency is 7957.75 Hz\n",
+ "o/p voltage at 12kHz = 0.045 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.13 Page No 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=460*10**3\n",
+ "b=450*10**3\n",
+ "fr=455*10**3 #frequency\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "BW=a-b\n",
+ "Q=(fr/BW)\n",
+ "C=0.001*10**-6\n",
+ "x=(fr*2*math.pi)\n",
+ "y=(1/x)**2\n",
+ "z=y/C\n",
+ "R=(2*math.pi*z*BW)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)Bandwidth = \",BW,\"Hz\"\n",
+ "#filter's peak o/p occurs at 455kHz\n",
+ "print\"(b)Quality factor = \",Q,\"KHz\"\n",
+ "print\"(c)inductance =\",round(z,5),\"H\"\n",
+ "print\"(d)total circuit resistance= \",round(R,2),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Bandwidth = 10000 Hz\n",
+ "(b)Quality factor = 45 KHz\n",
+ "(c)inductance = 0.00012 H\n",
+ "(d)total circuit resistance= 7.69 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.14 Page No 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=2 #resistance,ohm\n",
+ "L=3*10**-3 #inductance\n",
+ "C=0.47*10**-6 #capacitance\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "x=(2*math.pi*math.sqrt(L*C))\n",
+ "y=1/x\n",
+ "XL=(2*math.pi*y*L)\n",
+ "Q=(XL/R)\n",
+ "Z=((Q**2)*R)\n",
+ "BW=(R/(2*math.pi*L))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Resonant frequency= \",round(y,2),\"Hz\"\n",
+ "print\"(b)Quality factor = \",round(Q,2)\n",
+ "print\"(c)Maximam impedence= \",round(Z,1),\"Ohm\"\n",
+ "print\"(d)Bandwidth = \",round(BW,1),\"Hz\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Resonant frequency= 4238.48 Hz\n",
+ "(b)Quality factor = 39.95\n",
+ "(c)Maximam impedence= 3191.5 Ohm\n",
+ "(d)Bandwidth = 106.1 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/Chapter2.ipynb b/Modern_Electronics_Communication/Chapter2.ipynb new file mode 100755 index 00000000..1e4a523b --- /dev/null +++ b/Modern_Electronics_Communication/Chapter2.ipynb @@ -0,0 +1,384 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter 2 Amplitude Modulation-Transmission"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page no 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given\n",
+ "c=1.4*10**6 #frequency of carrier wave,Hz\n",
+ "m1=20 #frequency component,Hz\n",
+ "m2=10*10**3 #KHz\n",
+ "\n",
+ "#calculation \n",
+ "Ur1=c+m1\n",
+ "Ur2=c+m2\n",
+ "Lr1=c-m1\n",
+ "Lr2=c-m2\n",
+ "\n",
+ "#result\n",
+ "#range of upper sideband(usb)\n",
+ "print\"upper sideband will include frequencies from \",Ur1,\"Hz\"\n",
+ "print\"to \",Ur2,\"Hz\"\n",
+ "#range of lower sideband (lsb)\n",
+ "print\"lower sideband will include frequencies from \",Lr2,\"Hz\"\n",
+ "print\"to \",Lr1,\"Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "upper sideband will include frequencies from 1400020.0 Hz\n",
+ "to 1410000.0 Hz\n",
+ "lower sideband will include frequencies from 1390000.0 Hz\n",
+ "to 1399980.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page no 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given\n",
+ "b=100.0 #maximum p-p carrier (V)\n",
+ "a=60.0\n",
+ "d=125.0\n",
+ "c=35.0\n",
+ "x=180\n",
+ "y=0\n",
+ "\n",
+ "#Calculation\n",
+ "m1=((b-a)/(b+a))*100\n",
+ "m2=((d-c)/(d+c))*100\n",
+ "m3=((x-y)/(y+x))*100\n",
+ "\n",
+ "#result\n",
+ "print\"(a) percent(m) = \",m1,\"percent\"\n",
+ "print\"(b) percent(m) = \",m2,\"percent\"\n",
+ "print\"(c) percent(m) = \",m3,\"percent\"\n",
+ "print\"(d) this is a case of overmodulation\"\n",
+ "print\"(e) this is a distorted AM wave as the increase > decrease in carrier's amplitude\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) percent(m) = 25.0 percent\n",
+ "(b) percent(m) = 56.25 percent\n",
+ "(c) percent(m) = 100 percent\n",
+ "(d) this is a case of overmodulation\n",
+ "(e) this is a distorted AM wave as the increase > decrease in carrier's amplitude\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 Page no 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "c=1*10**3 #carrier output\n",
+ "\n",
+ "#calculation\n",
+ "esb= 1/4.0*(c)\n",
+ "tsp=(esb*2)\n",
+ "tp=(tsp+c)\n",
+ "\n",
+ "#result\n",
+ "print\"Total transmitted power =\",tp,\"W\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total transmitted power = 1500.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 Page no 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given\n",
+ "m=0.9 #modulation index\n",
+ "Pc=500 #carrier Power \n",
+ "\n",
+ "#calculation\n",
+ "x=(m**2)/2.0\n",
+ "y=(1+x)*Pc\n",
+ "\n",
+ "#result\n",
+ "print\"total transmitted power= \",y,\"W\" #total transmitted powwer\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total transmitted power= 702.5 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 Page no 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given\n",
+ "m=0.95 #modulation index\n",
+ "Pt= 50*10**3 #total transmitted power\n",
+ "\n",
+ "#calculation\n",
+ "x=(m**2)/2.0\n",
+ "y=1+x\n",
+ "z=(Pt/y)\n",
+ "Pi=Pt-z\n",
+ "\n",
+ "#result\n",
+ "print\"Pc = \",round(z,2),\"W\" #carrier power\n",
+ "print\"total intelligence power = \",round(Pi,2),\"W\" #intelligence signal\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pc = 34453.06 W\n",
+ "total intelligence power = 15546.94 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 Page no 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given\n",
+ "Ic=12 #antenna current of AM transmitter when unmodulated\n",
+ "It=13 #current when modulated\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "x=2*((13/12.0)**2-1)\n",
+ "m=math.sqrt(x)\n",
+ "a=m*100\n",
+ "\n",
+ "#result\n",
+ "print\"percent(m) = \",round(a,0),\"percent\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "percent(m) = 59.0 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 Page no 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given\n",
+ "n=0.7 #efficiency\n",
+ "c=10*10**3 #carrier wave\n",
+ "\n",
+ "#calculation\n",
+ "Is=0.5*c #intelligence signal\n",
+ "p=(Is/n)\n",
+ "\n",
+ "#result\n",
+ "print\"dc input power = \",round(p,2),\"W\" #dc input power"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc input power = 7142.86 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 Page no 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Pc=10.0*10**3 #carrier power\n",
+ "Pt=11.2*10**3 #transmitted power\n",
+ "m2=0.5 #modulation index of another sine wave\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "x=2*((Pt/Pc)-1)\n",
+ "m=math.sqrt(x)\n",
+ "meff=math.sqrt((m**2)+(m2**2))\n",
+ "a=Pc*(1+((meff**2)/2.0))\n",
+ "\n",
+ "#result\n",
+ "print\"Pt = \",a,\"W\" #total transmitted power"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pt = 12450.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 Page no 100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given\n",
+ "v1=1.0\n",
+ "v2=0.03\n",
+ "v3=0.05\n",
+ "v4=0.02\n",
+ "v5=0.04\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "x=math.sqrt((v2**2+v3**2+v4**2+v5**2)/v1**2)\n",
+ "y=x*100\n",
+ "\n",
+ "#result\n",
+ "print\"THD = \",round(y,2),\"percent\" #Total harmonic distortion "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "THD = 7.35 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/Chapter3.ipynb b/Modern_Electronics_Communication/Chapter3.ipynb new file mode 100755 index 00000000..23d71dd2 --- /dev/null +++ b/Modern_Electronics_Communication/Chapter3.ipynb @@ -0,0 +1,166 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 Amplitude modulation-Reception "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page no 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given\n",
+ "fr=550*10**3 #frequency, Hz\n",
+ "L=10.0*10**-6 #inductor, H\n",
+ "fr1=1550*10**3\n",
+ "\n",
+ "#calculation \n",
+ "import math\n",
+ "a=fr*2*math.pi\n",
+ "x=fr1*2*math.pi\n",
+ "b=1/a\n",
+ "y=1/x\n",
+ "C1=((b)**2/L)\n",
+ "C2=((y)**2/L)\n",
+ "fr2=1100*10**3\n",
+ "BW=10.0*10**3\n",
+ "Q=(fr2/BW)\n",
+ "BW1=(fr1/Q)\n",
+ "BW2=(fr/Q)\n",
+ "\n",
+ "#result\n",
+ "print\"(a) required range of capacitance is from \",round(C2,12),\"F\",\"to\",round(C1,12),\"F\"\n",
+ "print\"(b) Q= \",Q\n",
+ "print\"(c) Bandwidth of receiver at 1550 KHz = \",round(BW1,2),\"Hz\"\n",
+ "print\"Babdwidth of receiver at 550 KHz = \",BW2,\"Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) required range of capacitance is from 1.054e-09 F to 8.374e-09 F\n",
+ "(b) Q= 110.0\n",
+ "(c) Bandwidth of receiver at 1550 KHz = 14090.91 Hz\n",
+ "Babdwidth of receiver at 550 KHz = 5000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page no 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given\n",
+ "f=620*10**3 #frequency, Hz\n",
+ "IF=455*10**3\n",
+ "\n",
+ "#calculation\n",
+ "LO=f+IF\n",
+ "X=IF+LO\n",
+ "# image frequency of local oscillator\n",
+ "#station frequency = 620 kHz\n",
+ "\n",
+ "#Result\n",
+ "print\"LO = Hz\",LO\n",
+ "print\"X-1075kHz=\",X,\"Hz\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LO = Hz 1075000\n",
+ "X-1075kHz= 1530000 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page no 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=8*10**-6 #microvolts\n",
+ "R=50 #input resistance, ohm\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "P=(V**2)/R\n",
+ "dBm=10*math.log10(P/0.001)\n",
+ "dBW=10*math.log10(P/1)\n",
+ "a=(-89+8+3+24+26+26-2+34)\n",
+ "x=(a/10)\n",
+ "y=10**x\n",
+ "z=y*0.001\n",
+ "\n",
+ "#Result\n",
+ "print\"input power is= \",P,\"W\" \n",
+ "print\"dBm = \",round(dBm,0),\"dBm\"\n",
+ "print\"dBW = \",round(dBW,0),\"dBw\"\n",
+ "print\"Pout(dBm) =\",a,\" dBm into speaker\"\n",
+ "print\"Pout(dBW) =\",z,\"W\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input power is= 1.28e-12 W\n",
+ "dBm = -89.0 dBm\n",
+ "dBW = -119.0 dBw\n",
+ "Pout(dBm) = 30 dBm into speaker\n",
+ "Pout(dBW) = 1.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/Chapter4.ipynb b/Modern_Electronics_Communication/Chapter4.ipynb new file mode 100755 index 00000000..5c291ef8 --- /dev/null +++ b/Modern_Electronics_Communication/Chapter4.ipynb @@ -0,0 +1,149 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 single-sideband communication"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page no 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "x=1*10**6 #DSB range\n",
+ "y=10**(80/20.0)\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "z=math.sqrt(y)\n",
+ "df=200.0\n",
+ "Q=(x*z)/(4.0*df)\n",
+ "a=100*10**3\n",
+ "Q1=(a*z)/(4.0*df)\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"(a) Q for 1MHz = \",Q\n",
+ "print\"(b) Q for 100KHz = \",Q1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Q for 1MHz = 125000.0\n",
+ "(b) Q for 100KHz = 12500.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page no 178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "a=3*10**6\n",
+ "b=3.1*10**6 #new DSB signal range\n",
+ "c=2.9*10**6 #new DSB signal range\n",
+ "\n",
+ "#calculation\n",
+ "Q=(a/(b-c))\n",
+ "\n",
+ "#result\n",
+ "print\"the required filter Q is = \",Q"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the required filter Q is = 15.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page no 187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "a=455\n",
+ "x=2000+1 #frequency\n",
+ "y=2000+3 #frequency\n",
+ "\n",
+ "#calculation\n",
+ "c=2000+a #local oscillator value\n",
+ "d=c-x\n",
+ "e=c-y\n",
+ "f=a-454\n",
+ "g=a-452\n",
+ "\n",
+ "#result\n",
+ "print\"RF =\",x,\"KHz\", \"at which first mixer input=\" ,y,\"kHz\"\n",
+ "print\"local oscillator value is \",c,\"KHz\"\n",
+ "print\"First mixer output is\",d,\"to\",e,\"KHz\" #IF amp and second mixer input\n",
+ "print\"BFO = \",a,\"KHz\"\n",
+ "print\"Second mixer output is\",f,\"KHz\", \"and audio amplifier value is =\",g, \"kHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RF = 2001 KHz at which first mixer input= 2003 kHz\n",
+ "local oscillator value is 2455 KHz\n",
+ "First mixer output is 454 to 452 KHz\n",
+ "BFO = 455 KHz\n",
+ "Second mixer output is 1 KHz and audio amplifier value is = 3 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/Chapter5.ipynb b/Modern_Electronics_Communication/Chapter5.ipynb new file mode 100755 index 00000000..5e894199 --- /dev/null +++ b/Modern_Electronics_Communication/Chapter5.ipynb @@ -0,0 +1,360 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 Frequency Modulation : Transmission"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page no 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "v=25*10**-3\n",
+ "f=750 #deviation constant\n",
+ "vg=10.0*10**-3 #deviation constant\n",
+ "\n",
+ "#calculation\n",
+ "pfd=v*(f/vg) #positive frequency deviation\n",
+ "nfd=-v*(f/vg) #negative frequency deviation\n",
+ "\n",
+ "#result\n",
+ "print\"(a) positive frequency deviation = \",pfd,\"Hz\"\n",
+ "print\"negative frequency deviation = \",nfd,\"Hz\"\n",
+ "print\"The total deviation is written as +-2.25kHz for the given input signal level\"\n",
+ "print\"(b) The carrier wil deviate \",pfd,\"Hz\",\"&\",nfd,\"Hz\",\"at 400 Hz\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) positive frequency deviation = 1875.0 Hz\n",
+ "negative frequency deviation = -1875.0 Hz\n",
+ "The total deviation is written as +-2.25kHz for the given input signal level\n",
+ "(b) The carrier wil deviate 1875.0 Hz & -1875.0 Hz at 400 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3 Page no 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=20*10**3 #maximum deviation\n",
+ "fi=10.0*10**3 #input frequency\n",
+ "\n",
+ "#calculation\n",
+ "mf=d/fi\n",
+ "a=mf*40\n",
+ "\n",
+ "#result\n",
+ "print\"total required bandwidth is \",a,\"KHz\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total required bandwidth is 80.0 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page no 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=20*10**3 #maximum deviation\n",
+ "fi=5.0*10**3 #input frequency\n",
+ "\n",
+ "#calculation\n",
+ "mf=d/fi\n",
+ "a=2*35\n",
+ "\n",
+ "#print\n",
+ "print\"the required bandwidth is \",mf\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the required bandwidth is 4.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page no 215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Vm=2000\n",
+ "R=50.0 #resistance, ohm\n",
+ "\n",
+ "#calcultion\n",
+ "import math\n",
+ "fc=(2*math.pi*(10**8))/2.0*math.pi\n",
+ "P=(2000/math.sqrt(2))**2/R\n",
+ "mf=2 #by inspection of FM equation\n",
+ "fi=(math.pi*10**4)/(2.0*math.pi)\n",
+ "d=(mf*fi)\n",
+ "BW=mf*40\n",
+ "bw=2*(d+fi)\n",
+ "P1=((0.58*2000/math.sqrt(2))**2)/R\n",
+ "P2=((0.03*2000/math.sqrt(2))**2)/R\n",
+ "\n",
+ "#result\n",
+ "print\"(a) carrier frequency = \",round(fc,-9),\"Hz\" #by inspection of FM equation\n",
+ "print\"(b) the peak voltage is 2000V P thus= \",P,\"W\"\n",
+ "print\"(c) mf = 2\" #by inspection of FM equation\n",
+ "print\"(d) the intelligence frequency fi = \",fi,\"Hz\"\n",
+ "print\"(e) BW = \",bw ,\"Hz\" #using carson's rule \n",
+ "print\"(f) The smallest sideband J4 is 0.03 times the carrier = \",P2,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) carrier frequency = 1000000000.0 Hz\n",
+ "(b) the peak voltage is 2000V P thus= 40000.0 W\n",
+ "(c) mf = 2\n",
+ "(d) the intelligence frequency fi = 5000.0 Hz\n",
+ "(e) BW = 30000.0 Hz\n",
+ "(f) The smallest sideband J4 is 0.03 times the carrier = 36.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6 Page no 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=75*10**3 #maximum deviation\n",
+ "fi=30.0 #modulating frequency, Hz\n",
+ "fi1=15.0*10**3 \n",
+ "d1=1*10**3\n",
+ "fi2=100 #Hz\n",
+ "fi3=2.0*10**3\n",
+ "\n",
+ "#calculation\n",
+ "mf1=d/fi\n",
+ "mf2=d/fi1\n",
+ "mf3=d1/fi2\n",
+ "mf4=d1/fi3\n",
+ "DR=d1/fi3\n",
+ "\n",
+ "#result\n",
+ "print\"(a)maximum deviation at 30 Hz = \",mf1 \n",
+ "print\"maximum deviation at 15kHz= \",mf2\n",
+ "print\"(b) maximum deviation at 100Hz = \",mf3\n",
+ "print\"maximum deviation at 2KHz= \",mf4\n",
+ "print \"(c)Deviation Ratio \",DR #deviation ratio"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)maximum deviation at 30 Hz = 2500.0\n",
+ "maximum deviation at 15kHz= 5.0\n",
+ "(b) maximum deviation at 100Hz = 10\n",
+ "maximum deviation at 2KHz= 0.5\n",
+ "(c)Deviation Ratio 0.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7 Page no 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "mf=0.25\n",
+ "a=0.98\n",
+ "b=0.12\n",
+ "x=10*10**3 #power, watt\n",
+ "\n",
+ "#calculation\n",
+ "P=(a**2)*x\n",
+ "P1=(b**2)*x\n",
+ "t=P+2*P1\n",
+ "\n",
+ "#result\n",
+ "print\"power of each sideband = \",P1,\"W\"\n",
+ "print\"total power = \",round(t,-4),\"W\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power of each sideband = 144.0 W\n",
+ "total power = 10000.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8 Page no 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "phi=0.5 #maximum intelligence frequency\n",
+ "fi=5.0*10**3\n",
+ "x=75*10**3\n",
+ "\n",
+ "#calculation\n",
+ "d=phi*fi\n",
+ "y=x/d\n",
+ "\n",
+ "#result\n",
+ "print\"o/p S/N = \",y\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "o/p S/N = 30.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.9 Page no 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "dm=10*10**3\n",
+ "x=(1/3.0) #N/S input ratio\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "phi=math.asin(x)\n",
+ "phi1=math.asin(x)\n",
+ "fi=3*10**3\n",
+ "d=phi1*fi\n",
+ "a=dm/d\n",
+ "\n",
+ "#result\n",
+ "print\"The S/N output will be \",round(a,0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The S/N output will be 10.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/README.txt b/Modern_Electronics_Communication/README.txt new file mode 100755 index 00000000..799a1197 --- /dev/null +++ b/Modern_Electronics_Communication/README.txt @@ -0,0 +1,10 @@ +Contributed By: nishu mittal +Course: others +College/Institute/Organization: university of delhi +Department/Designation: electronics +Book Title: Modern Electronics Communication +Author: J S Beasley and Miller +Publisher: Phi Publication +Year of publication: 9th +Isbn: 9788120340046 +Edition: 2008
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter10.ipynb b/Modern_Electronics_Communication/chapter10.ipynb new file mode 100755 index 00000000..878fe5de --- /dev/null +++ b/Modern_Electronics_Communication/chapter10.ipynb @@ -0,0 +1,101 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 Wireless digital communication"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2 Page no 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "n=3 #shift registers\n",
+ "n1=7\n",
+ "\n",
+ "#calculation\n",
+ "x=(2**n)-1\n",
+ "y=(2**7)-1\n",
+ "\n",
+ "#result\n",
+ "print\"(a) n =\",n,\"PN sequence length = \",x\n",
+ "print\"(b) n =\",n1,\"PN sequence length = \",y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) n = 3 PN sequence length = 7\n",
+ "(b) n = 7 PN sequence length = 127\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3 Page no 477"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "x=56.0 #modulation bit rate\n",
+ "y=560 #chip rate\n",
+ "a=256.0 #modulation bit rate\n",
+ "b=1792 #chip rate\n",
+ "\n",
+ "#calculation\n",
+ "z=y/x\n",
+ "c=b/a\n",
+ "\n",
+ "#result\n",
+ "#part(a)\n",
+ "print\"Spreading of a DSSS signal = \",z\n",
+ "print\"Spreading of a DSSS signal = \",c"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Spreading of a DSSS signal = 10.0\n",
+ "Spreading of a DSSS signal = 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter12.ipynb b/Modern_Electronics_Communication/chapter12.ipynb new file mode 100755 index 00000000..79f6b2af --- /dev/null +++ b/Modern_Electronics_Communication/chapter12.ipynb @@ -0,0 +1,401 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 Transmission Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.1 Page no 573"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "L=73.75*10**-9 #inductance, H\n",
+ "C=29.5*10**-12 #capacitance\n",
+ "x=5280\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "Z=math.sqrt(L/C)\n",
+ "z1=math.sqrt((x*L)/(x*C))\n",
+ "\n",
+ "#result\n",
+ "print\"characterstics impedence for 1-ft =\",Z,\"ohm\"\n",
+ "print\"characterstics impedence for 1-mi = \",z1,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "characterstics impedence for 1-ft = 50.0 ohm\n",
+ "characterstics impedence for 1-mi = 50.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.2 Page no 574"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "a=2 #parallel wire line\n",
+ "b=2.35 #coaxial line\n",
+ "D=0.285\n",
+ "d=0.08\n",
+ "e=1.0 #dielectric constant of insulating material relative to air\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "z=(276/e)*math.log10(2*2)\n",
+ "z1=(138/e)*math.log10(b)\n",
+ "z2=(138/math.sqrt(2.3)*math.log10(D/d))\n",
+ "\n",
+ "#result\n",
+ "print\"(a) characterstics impedence for a parallel wire = \",round(z,0),\"ohm\"\n",
+ "print\"(b) characterstics impedence for a air dielectric coaxial line= \",round(z1,1),\"ohm\"\n",
+ "print\"(c) characterstics impedence = \",round(z2,0),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) characterstics impedence for a parallel wire = 166.0 ohm\n",
+ "(b) characterstics impedence for a air dielectric coaxial line= 51.2 ohm\n",
+ "(c) characterstics impedence = 50.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.3 Page no 579"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "L=73.75*10**-9 #inductance, H\n",
+ "C=29.5*10**-12 #capacitance\n",
+ "d=1 #distance\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "t=math.sqrt(L*C)\n",
+ "Vp=d/t\n",
+ "\n",
+ "#result\n",
+ "print\"the delay introduced is t =\",round(t,10),\"s\"\n",
+ "print\"The velocity of propagation is \",round(Vp*10**-8,3),\"*10**8 ft/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the delay introduced is t = 1.5e-09 s\n",
+ "The velocity of propagation is 6.78 *10**8 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.4 Page no 580"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "v=2.07*10**8 #velocity\n",
+ "c=3.0*10**8 #velocity of light\n",
+ "Er=2.3 #relative dielectric constant\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "vf=(v/c) #velocity factor\n",
+ "vf1=1/math.sqrt(Er)\n",
+ "\n",
+ "#result\n",
+ "print\"The velocity = \",vf,\"m/s\"\n",
+ "print\"vf = \",round(vf1,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity = 0.69 m/s\n",
+ "vf = 0.659\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.5 Page no 581"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "c=3*10**8 #speed of light\n",
+ "f=100.0*10**6 #frequency of signal\n",
+ "x=2.07*10**8 #velocity of wave propagation\n",
+ "\n",
+ "#Calcultion\n",
+ "w=c/f #wavelength in free-space\n",
+ "w1=x/f #wavelength while traveling through an RG-8A/U coaxial cable\n",
+ "\n",
+ "#Result\n",
+ "print\"In free space, lambda =\",w,\"m\"\n",
+ "print\"While traveling through RG-8A/U cable, lamda= \",w1,\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In free space, lambda = 3.0 m\n",
+ "While traveling through RG-8A/U cable, lamda= 2.07 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.7 Page no 592"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Zl=300.0 #load impedance\n",
+ "Zo=50.0 #characteristic impedance\n",
+ "v=2.07*10**8 #velocity in RG-8A/U cable\n",
+ "f=27.0*10**6 #operating frequency of citizen's band transmitter\n",
+ "Po=4 #output power of transmitter\n",
+ "l=10 #length of RG-8A/U cable\n",
+ "Rl=300 #input resistance of antenna\n",
+ "\n",
+ "#calculation\n",
+ "T=((Zl-Zo)/(Zl+Zo)) #reflection coefficient\n",
+ "h=v/f #length of cable in wavelength\n",
+ "le=l/h #electrical length\n",
+ "x=Rl/Zo #VSWR\n",
+ "y=((1+T)/(1-T)) #VSWR\n",
+ "rp=(T)**2*Po #reflected power\n",
+ "Pl=Po-rp #load power\n",
+ "#part(a): The reflection coefficient\n",
+ "\n",
+ "#result\n",
+ "print\"(a) reflection cofficient = \",round(T,2)\n",
+ "print\"(b) electrical length =\",round(le,2),\"lambda\"\n",
+ "print\"(c) VSWR = \",y\n",
+ "print\"(d) the reflected voltage = \",round(Pl,2),\"W\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) reflection cofficient = 0.71\n",
+ "(b) electrical length = 1.3 lambda\n",
+ "(c) VSWR = 6.0\n",
+ "(d) the reflected voltage = 1.96 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.8 Page no 597"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Zo=100.0 #characteristic impedance\n",
+ "j=1j\n",
+ "Zl = 200-j*150 #load impedance\n",
+ "l=4.3 #length of transmission line\n",
+ "\n",
+ "#calculation\n",
+ "x=200/Zo\n",
+ "y=150/Zo\n",
+ "a=0.4*Zo\n",
+ "b=0.57*Zo\n",
+ "\n",
+ "#result\n",
+ "print\"Zin = \",a,\"Ohm\",\"+j*\",b,\"Ohm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Zin = 40.0 Ohm +j* 57.0 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.9 Page no 599"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "import cmath\n",
+ "j=1j\n",
+ "RL=120 #load resistance from smith chart\n",
+ "ZL=complex(75,50) #load impedance\n",
+ "Z0=50.0 #characteristic impedance\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "z1=ZL/Z0\n",
+ "z=2.4 #normalized z at a point that is purely resistive\n",
+ "ar=z*Z0 #actual resistance\n",
+ "x=math.sqrt(Z0*RL)\n",
+ "\n",
+ "#Result\n",
+ "print\"zl= \",z1\n",
+ "#VSWR,zin,R can be found out from smith chart manually\n",
+ "print\"characteristic impedance is =\",round(x,2),\"ohm\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "zl= (1.5+1j)\n",
+ "characteristic impedance is = 77.46 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.10 Page no 601"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "import cmath\n",
+ "Z0=75.0 #characteristic impedance\n",
+ "j=1j\n",
+ "ZL=complex(50,-100) #load impedance\n",
+ "\n",
+ "#Calculation\n",
+ "zL=ZL/Z0\n",
+ "#Result\n",
+ "print\"zL =\",zL\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "zL = (0.666666666667-1.33333333333j)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter13.ipynb b/Modern_Electronics_Communication/chapter13.ipynb new file mode 100755 index 00000000..f28a3b72 --- /dev/null +++ b/Modern_Electronics_Communication/chapter13.ipynb @@ -0,0 +1,238 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:358c1b86e82f27b9eee799b4793457200c3f930f370a7e7347103331d9245d4d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 Wave Propagation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.1 Page no 628"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "x=(2*(1/2.0))\n",
+ "a=15\n",
+ "d=53.5*10**-6 #duration for each horizontal line on the reciever\n",
+ "t=1/186000.0 #time delay between direct and reflected signal\n",
+ "\n",
+ "#calculation\n",
+ "g=(t/d)*a #ghost width\n",
+ "\n",
+ "#result\n",
+ "print\"ghost width = \",round(g,2),\"in.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ghost width = 1.51 in.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.2 Page no 641"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "S=83 #satellite longitude in degrees\n",
+ "N=90 #site longitude in degrees\n",
+ "L=35 #site longitude in degrees\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "b=0.1512 #constant in equation\n",
+ "A=180+math.atan(math.tan(-7*3.14/180)/math.sin(35*3.14/180))*180/3.14 \n",
+ "E=math.atan((math.cos((S-N)*3.14/180)*math.cos(L*3.14/180)-b)/math.sqrt(1-((math.cos(L*3.14/180))**2*(math.cos((S-N)*3.14/180))**2)))*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"The azimuth is equal to A = \",round(A,0),\"degree\"\n",
+ "print\"the elevation angle = \",round(E,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The azimuth is equal to A = 168.0 degree\n",
+ "the elevation angle = 48.7 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.3 Page no 646"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "import math\n",
+ "x=(32+(44/60.0)+(36/3600.0)) # N latitude\n",
+ "y=(106+(16/60.0)+(37/3600.0)) #W longitude\n",
+ "D=42.1642*10**6 #distance from the satellite to the center of the earth\n",
+ "R=6.378*10**6 #earth's radius\n",
+ "a=32.74333*3.14/180.0 #in degree\n",
+ "B=-7.27694*3.14/180.0 #in degree\n",
+ "\n",
+ "#calculation\n",
+ "q=math.cos(a)*math.cos(B)\n",
+ "\n",
+ "d=math.sqrt(D**2+R**2-(2*D*R*q))\n",
+ "c=2.997925*10**5 #velocity of light\n",
+ "de=d/c\n",
+ "rd=(2*d)/c\n",
+ "\n",
+ "#result\n",
+ "print\"N longitude converted into degrees = \",round(x,2)\n",
+ "print\"W longitude coverted into degrees =\",round(y,2)\n",
+ "print\"distance = \",round(d/1000,1),\"*10**6 meters\"\n",
+ "print\"delay =\",round(de/1000,3),\"seconds\"\n",
+ "print\"roundtrip delay = \",round(rd/1000,3),\"seconds\" \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N longitude converted into degrees = 32.74\n",
+ "W longitude coverted into degrees = 106.28\n",
+ "distance = 37009.1 *10**6 meters\n",
+ "delay = 0.123 seconds\n",
+ "roundtrip delay = 0.247 seconds\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.4 Page no 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "G=45 #antenna gain\n",
+ "nt=25 #antenna noise temperature\n",
+ "nt1=70 #LNB noise temperature\n",
+ "nt2=2 #noise temperature(reciever and passive components)\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "T=nt+nt1+nt2 #total noise temperature\n",
+ "x=G-10*math.log10(T) #figure of merit\n",
+ "\n",
+ "#result\n",
+ "print\"Sum of all of the noise temperature contributions Ts = \",T,\"k\"\n",
+ "print\"The figure of merit = \",round(x,2),\"dB\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of all of the noise temperature contributions Ts = 97 k\n",
+ "The figure of merit = 25.13 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.5 Page no 652"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=41.130383*10**6 #dismath.tance\n",
+ "c=2.997925*10**8 #velocity of light\n",
+ "f=14.25*10**9 #uplink frequency\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "h=c/f #wavelength\n",
+ "x=(4*math.pi*d)/h\n",
+ "Lp=20*math.log10(x) #free-space path loss\n",
+ "\n",
+ "#result\n",
+ "print\"The wavelength is= \",round(h,2)\n",
+ "print\"Lp(dB)= \",round(Lp,2),\"dB\"\n",
+ "#INcorrect answer of h in the textbook"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The wavelength is= 0.02\n",
+ "Lp(dB)= 207.81 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter14.ipynb b/Modern_Electronics_Communication/chapter14.ipynb new file mode 100755 index 00000000..39f00cfe --- /dev/null +++ b/Modern_Electronics_Communication/chapter14.ipynb @@ -0,0 +1,180 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 Antennas"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.1 Page no 669"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "c=3*10**8 #m/s , speed of light \n",
+ "f=150*10**6 #frequency\n",
+ "\n",
+ "#calculation\n",
+ "h=c/f\n",
+ "x=1/2.0 #antennas dimension(D)\n",
+ "D=0.5*2\n",
+ "Rff=5*D\n",
+ "h=c/f \n",
+ "D = h/2\n",
+ "\n",
+ "#result\n",
+ "print\" distance =\",Rff,\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " distance = 5.0 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.2 Page no 669"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "c=3*10**8 #velocity of light\n",
+ "f=12.0*10**9 #frequency\n",
+ "D=4.5 #diameter of parabolic reflector\n",
+ "\n",
+ "#calculation\n",
+ "h=c/f #wavelength\n",
+ "x=D/h\n",
+ "R=(2*D**2)/h\n",
+ "\n",
+ "#result\n",
+ "print\"distance from parabolic reflector= \",R,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "distance from parabolic reflector= 1620.0 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.3 Page no 671"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Pt=10 #transmitted power\n",
+ "#dipoles have gain 2.15dB \n",
+ "Gr=1.64\n",
+ "c=3*10**8 #velocity of light\n",
+ "f=144.0*10**6 #frequency\n",
+ "d=50*10**3 #distance between antennas\n",
+ "Gt=1.64 #recieving antenna gain(ratio) compared to isotropic radiator\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "Pr=Pt*Gt*Gr*(c/f)**2/((16*(math.pi)**2)*(d**2)) #power recieved\n",
+ "\n",
+ "#result\n",
+ "print\"Power received = \",round(Pr,12),\"w\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power received = 2.96e-10 w\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.4 Page no 674"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "c=3*10**8 #velocity of light\n",
+ "f=100*10**6 #frequency\n",
+ "\n",
+ "#Calculation\n",
+ "h=c/f #wavelength\n",
+ "x=h/2.0 #dipole i.e h/2\n",
+ "l=0.95*x #applying 95% correction,the actual optimum physical length\n",
+ "L=486/100.0 #alternative method to find length\n",
+ "\n",
+ "#Result\n",
+ "print\"length of antenna = \",l,\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "length of antenna = 1.425 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter16.ipynb b/Modern_Electronics_Communication/chapter16.ipynb new file mode 100755 index 00000000..ab90f6a3 --- /dev/null +++ b/Modern_Electronics_Communication/chapter16.ipynb @@ -0,0 +1,134 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16 Microwaves and Lasers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.1 Page no 753"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "h=0.3 #curve depth of parabolic reflector\n",
+ "D=3 #diameter of parabolic reflector\n",
+ "\n",
+ "#calculation\n",
+ "f=D/(16*h) #focal \n",
+ "\n",
+ "#result\n",
+ "print\"The focal length is \",f,\" m out from the center of the parabolic reflector\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The focal length is 0.625 m out from the center of the parabolic reflector\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.2 Page no 755"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "D=3.0 #diameter of microwave dish\n",
+ "k=0.6 #efficiency of reflector\n",
+ "c=2.997925*10**8 #velocity of light\n",
+ "f=10.0*10**9 #frequency\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "Ap=10*math.log10((c/f)*k*((math.pi*D)**2/(c/f)**2)) #powergain\n",
+ "B=(70*(c/f))/D #beamwidth\n",
+ "\n",
+ "#result\n",
+ "print\"beamwidth = \",round(B,3),\"micrometer\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "beamwidth = 0.7 micrometer\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.3 Page no 756"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "D=4.5 #diameter of parabolic reflector\n",
+ "k=0.62 #efficiency factor\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "Ae=(k*math.pi)*(D/2.0)**2 #aperture efficiency\n",
+ "i=(math.pi*(D/2.0)**2) #ideal capture area\n",
+ "\n",
+ "#result\n",
+ "print\"The ideal capture area for\",D,\"m\",\"1f m parabolic antenna is\",round(i,3),\"sq.m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ideal capture area for 4.5 m 1f m parabolic antenna is 15.904 sq.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter17.ipynb b/Modern_Electronics_Communication/chapter17.ipynb new file mode 100755 index 00000000..44c3e3d8 --- /dev/null +++ b/Modern_Electronics_Communication/chapter17.ipynb @@ -0,0 +1,96 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17 Television"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.1 Page no 882"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "bw=5*10**6 #bandwidth\n",
+ "t=53.5*10**-6 #time allocated for each visible trace\n",
+ "\n",
+ "#calculation\n",
+ "T=2*bw*t #increase in horizontal resolution\n",
+ "\n",
+ "#result\n",
+ "print\"Thus, the total number of vertical lines resolvable is \",T,\"lines\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thus, the total number of vertical lines resolvable is 535.0 lines\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.2 Page no 822"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "bw=5.0*10**6 #bandwidth\n",
+ "l=428 #horizontal resolution\n",
+ "\n",
+ "#calculation\n",
+ "t=l/(bw*2) #trace time\n",
+ "x=1/30.0 #time available for a full picture\n",
+ "y=t+10.0*10**-6 #assuming that 10us is used for horizontal blanking\n",
+ "n=x/y #no. of horizontal traces\n",
+ "c=600*0.7 #allowing 32 lines for vertical retrace\n",
+ "\n",
+ "#result\n",
+ "print\"vertical resolution = \",c,\"lines\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "vertical resolution = 420.0 lines\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter18.ipynb b/Modern_Electronics_Communication/chapter18.ipynb new file mode 100755 index 00000000..fee42ea4 --- /dev/null +++ b/Modern_Electronics_Communication/chapter18.ipynb @@ -0,0 +1,216 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18 Fibre Optics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.1 Page no 859"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "c=3*10**8 #velocity of light\n",
+ "f=4.4*10**14 #frequency of red light\n",
+ "f1=7.0*10**14 #frequency of violet light\n",
+ "\n",
+ "#calculation\n",
+ "h1=c/f #wavelength of red light\n",
+ "h2=c/f1 #wavelength of violet light\n",
+ "\n",
+ "#result\n",
+ "print\"wavelenght for red= \",round(h1,9),\"m\"\n",
+ "print\"wavelngth for violet= \",round(h2,8),\"micron\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelenght for red= 6.82e-07 m\n",
+ "wavelngth for violet= 4.3e-07 micron\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.2 Page no 862"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "n1=1.535 #refractive index of fibre optics\n",
+ "n2=1.490 #refractive index of cladding\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "x=(n1**2)-(n2**2)\n",
+ "y=math.sqrt(x) #numerical aperture\n",
+ "z=math.asin(y)*180/3.14 #theta\n",
+ "\n",
+ "#result\n",
+ "print\"NA = \",round(y,3)\n",
+ "print\"(theta)in(max) = \",round(z,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NA = 0.369\n",
+ "(theta)in(max) = 21.7 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.3 Page no 868"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "w=22 #spectral width of LED\n",
+ "l=2 #length of fibre\n",
+ "d=95 #dispersion value\n",
+ "p=d*w #pulse dispersion\n",
+ "pt=p*l #total pulse dispersion\n",
+ "\n",
+ "#result\n",
+ "print\"pulse dispersion = \",p,\"ps/km\"\n",
+ "print\"total pulse dispersion = \",pt,\"ps/km\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pulse dispersion = 2090 ps/km\n",
+ "total pulse dispersion = 4180 ps/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.4 Page no 885"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=30 #length of fibre cable\n",
+ "l=0.4 #loss\n",
+ "\n",
+ "#calculation\n",
+ "T=d*l #total cable loss\n",
+ "\n",
+ "#result\n",
+ "print\"total cable loss = \",T,\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total cable loss = 12.0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.5 Page no 887"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "b=565 #Line bit rate of fibre 1\n",
+ "c=3.5 #Cable dispersion of fibre 1\n",
+ "t=4 #Transmitter spectral width of fibre 1\n",
+ "b1=1130 #Line bit rate of fibre 2\n",
+ "c1=3.5 #Cable dispersion of fibre 2\n",
+ "t1=2 #Transmitter spectral width of fibre 2\n",
+ "x=440000 #assumed gaussian constant \n",
+ "\n",
+ "#calculation\n",
+ "L1=x/(b*c*t) #span length in km of fibre 1\n",
+ "L2=x/(b1*c1*t1) #span length in km of fibre 2\n",
+ "\n",
+ "#result \n",
+ "print\"span lenght of fibre 1= \",round(L1,2),\"Km\"\n",
+ "print\"span lenght of fibre 2= \",round(L2,2),\"Km\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "span lenght of fibre 1= 55.63 Km\n",
+ "span lenght of fibre 2= 55.63 Km\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter6.ipynb b/Modern_Electronics_Communication/chapter6.ipynb new file mode 100755 index 00000000..2342c49f --- /dev/null +++ b/Modern_Electronics_Communication/chapter6.ipynb @@ -0,0 +1,98 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Frequency Modulation:Reception"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1 Page no 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "G=200000 #voltage gain\n",
+ "v=200*10**-3 #quieting voltage\n",
+ "\n",
+ "#calculation\n",
+ "In=v/G\n",
+ "\n",
+ "#Result\n",
+ "print\"To reach quieting, the input must be \",In*10**6,\"microV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "To reach quieting, the input must be 1.0 microV\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2 Page no 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=10*10**6 #frequency\n",
+ "f1=50*10**3 #input frequency\n",
+ "f2=200*10**3 #output frequency\n",
+ "\n",
+ "#Calculatiion\n",
+ "x=f1*2\n",
+ "y=f2*2\n",
+ "\n",
+ "#Result\n",
+ "print\"The capture occurred at from the free-running VCO frequency.\",f1,\"Hz\"\n",
+ "print\"Assume symmetrical operation,which implies a capture range of \",x,\"Hz\"\n",
+ "print\"Once captured the VCO follows the input to a \",f2,\"Hz deviation,implying a lock range of \",y,\"Hz\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The capture occurred at from the free-running VCO frequency. 50000 Hz\n",
+ "Assume symmetrical operation,which implies a capture range of 100000 Hz\n",
+ "Once captured the VCO follows the input to a 200000 Hz deviation,implying a lock range of 400000 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter7.ipynb b/Modern_Electronics_Communication/chapter7.ipynb new file mode 100755 index 00000000..39f04dbf --- /dev/null +++ b/Modern_Electronics_Communication/chapter7.ipynb @@ -0,0 +1,243 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 Communication Techniques"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6 Page no 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Q=60\n",
+ "IF=455*10**3\n",
+ "x=680.0*10**3\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "imf=x+2*(IF) #image frequency\n",
+ "a=(imf/x)\n",
+ "b=(x/imf)\n",
+ "c=(Q*(a-b))\n",
+ "d=20*math.log10(c)\n",
+ "\n",
+ "#result\n",
+ "print\"The image frequency is \",imf,\"Hz\"\n",
+ "print\"image rejection = \",round(d,3),\"dB\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The image frequency is 1590000.0 Hz\n",
+ "image rejection = 41.186 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.7 Page no 314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "NF=20.0\n",
+ "df=10**6\n",
+ "\n",
+ "#calculation\n",
+ "x=10*math.log10(df)\n",
+ "S=-174+NF+x\n",
+ "a=5 #input intercept\n",
+ "dr=2/3.0*(a-S)\n",
+ "\n",
+ "#result\n",
+ "print\"S= \",S,\"dB\"\n",
+ "print\"dynamic range= \",dr,\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "S= -94.0 dB\n",
+ "dynamic range= 66.0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.8 Page no 315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "nf=5.0\n",
+ "x=24.0\n",
+ "y=20.0\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "NR0=10**(nf/10.0)\n",
+ "NR1=10**(y/10.0)\n",
+ "PG1=10**(x/10.0)\n",
+ "NR=NR0+((NR1-1)/PG1)\n",
+ "NF=10*math.log10(NR)\n",
+ "S=-174+NF+60\n",
+ "a=nf-x #the system's third-order intercept point \n",
+ "dr=2/3.0*(a-S)\n",
+ "\n",
+ "#result\n",
+ "print\"NR1 = \",round(NR0,3)\n",
+ "print\"NR2 = \",NR1\n",
+ "print\"PG1= = \",round(PG1,3)\n",
+ "print\"NR = \",round(NR,3),\"dB\"\n",
+ "print\"NF = \",round(NF,3),\"dB\" #total system noise figure\n",
+ "print\"S = \",round(S,3),\"dBm\" #sensitivity\n",
+ "print\"the systems third-order intercept point is\",a,\"dB\"\n",
+ "print\"dynamic range = \",round(dr,1),\"dB\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NR1 = 3.162\n",
+ "NR2 = 100.0\n",
+ "PG1= = 251.189\n",
+ "NR = 3.556 dB\n",
+ "NF = 5.51 dB\n",
+ "S = -108.49 dBm\n",
+ "the systems third-order intercept point is -19.0 dB\n",
+ "dynamic range = 59.7 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.9 Page no 315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "x=24\n",
+ "nf=-5\n",
+ "NR = 3.16+(99/10.0)\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "NF = 10*math.log10(NR)\n",
+ "S=-174+NF+60\n",
+ "dr = 2/3.0*(nf-S)\n",
+ "\n",
+ "#result\n",
+ "print\"NR = \",NR #noise ratio\n",
+ "print\"NF = \",round(NF,3),\"dB\" #noise figure\n",
+ "print\"S = \",round(S,3),\"dBm\" #sensitivity\n",
+ "print\"dynamic range = \",round(dr,3),\"dB\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NR = 13.06\n",
+ "NF = 11.159 dB\n",
+ "S = -102.841 dBm\n",
+ "dynamic range = 65.227 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.10 Page no 329"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "x=0.40*100*10**6\n",
+ "y=(100*10**6/(2.0**32))\n",
+ "#fCLK is reference oscillator\n",
+ "\n",
+ "#result\n",
+ "print\"The maximum output frequency is approximately 40 percent of fCLK MAX\",x,\"Hz\"\n",
+ "print\"The frequency resolution is given by \",round(y,3),\"Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum output frequency is approximately 40 percent of fCLK MAX 40000000.0 Hz\n",
+ "The frequency resolution is given by 0.023 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter8.ipynb b/Modern_Electronics_Communication/chapter8.ipynb new file mode 100755 index 00000000..b7931b29 --- /dev/null +++ b/Modern_Electronics_Communication/chapter8.ipynb @@ -0,0 +1,190 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter 8 Digital Communication-Coding Techniques"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page no 357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "fa=20*10**3\n",
+ "\n",
+ "#calculation\n",
+ "fs=2*fa #minimum sample rate\n",
+ "\n",
+ "#result\n",
+ "print\"maximum sample rate\",\"is greater than equal to\",fs,\"Hz\" #frequency\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum sample rate is greater than equal to 40000 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 Page no 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "dr=55\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "n=(dr/6.02)\n",
+ "l=2**10\n",
+ "y=10*math.log10(3*(l**2)) #signal-to-quantization-noise level\n",
+ "x=(1.76+(6.02*10)) #signal-to-noise ratio for digitizing system\n",
+ "\n",
+ "#result\n",
+ "print\"(S/N)q =\",round(y,2),\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(S/N)q = 64.98 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page no 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "R=100.0*10**3 #resistance, ohm\n",
+ "Rf=10*10**3\n",
+ "Vref=-10 #reference voltage\n",
+ "\n",
+ "#calculation\n",
+ "Vo=-(Vref)*(Rf/R) # resolution\n",
+ "a=(10/100.0)\n",
+ "b=(10/50.0)\n",
+ "c=(10/25.0)\n",
+ "d=(10/12.5)\n",
+ "V=-(Vref)*(a+b+c+d) #output voltage\n",
+ "\n",
+ "#result\n",
+ "print\"The step-size is \",Vo\n",
+ "print\"output voltage = \",V,\"volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The step-size is 1.0\n",
+ "output voltage = 15.0 volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page no 375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "d=2 #Dmin\n",
+ "d1=3\n",
+ "d2=4\n",
+ "\n",
+ "#calculation\n",
+ "x=d-1 \n",
+ "a=(d/2.0)-1\n",
+ "y=d1-1\n",
+ "b=1/2.0*(d1-1)\n",
+ "z=d2-1\n",
+ "c=(d2/2.0)-1 \n",
+ "#part (a)\n",
+ "\n",
+ "#result\n",
+ "print\"(a) the no. of error detected for the distance 2 is \",x\n",
+ "print\" the no. of errors corrected = \",a\n",
+ "print\"(b) the no. of error detected for the distance 3 is \",y\n",
+ "print\" the no. of errors corrected = \",b\n",
+ "print\"(c) the no. of error detected for the distance 4 is \",z\n",
+ "print\" the no. of errors corrected = \",c\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) the no. of error detected for the distance 2 is 1\n",
+ " the no. of errors corrected = 0.0\n",
+ "(b) the no. of error detected for the distance 3 is 2\n",
+ " the no. of errors corrected = 1.0\n",
+ "(c) the no. of error detected for the distance 4 is 3\n",
+ " the no. of errors corrected = 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/chapter9.ipynb b/Modern_Electronics_Communication/chapter9.ipynb new file mode 100755 index 00000000..812fc2f5 --- /dev/null +++ b/Modern_Electronics_Communication/chapter9.ipynb @@ -0,0 +1,203 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 Wired Digital Communications"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page no 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "M=110\n",
+ "x=7.0\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "a=math.log10(110)/(math.log10(2))\n",
+ "n=math.log(M)\n",
+ "b=2**a\n",
+ "u=(a/x)*100\n",
+ "y=math.log10(b)\n",
+ "u1=(y/3.0)*100\n",
+ "\n",
+ "#result\n",
+ "print\"the number of bits required = \",round(a,2) #number of bits\n",
+ "print\"The efficiency is \",round(u1,0),\"percent\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the number of bits required = 6.78\n",
+ "The efficiency is 68.0 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2 Page no 407"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "m=10**7\n",
+ "Pe=10**-6 #error probability\n",
+ "\n",
+ "#calculation\n",
+ "a=m*Pe #average number of errors\n",
+ "\n",
+ "#result\n",
+ "print\"expected number of errors =\",a\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "expected number of errors = 10.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 Page no 407"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Tb=1/9600.0 #bit frequency\n",
+ "Pt=0.8 #transmit power\n",
+ "\n",
+ "#calculation\n",
+ "Eb=Pt*Tb #energy per bit\n",
+ "\n",
+ "#result\n",
+ "print\"Energy per bit = \",round(Eb,7),\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy per bit = 8.33e-05 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 Page no 410"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "bw=3*10**3 #bandwidth\n",
+ "x=1023 #signal-to-noise ratio\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "C=bw*math.log(1+x)/math.log(2) #capacity of telephone channel\n",
+ "\n",
+ "#result\n",
+ "print\"the capacity of a telephone channel =\",C,\"bit per second\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the capacity of a telephone channel = 30000.0 bit per second\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 Page no 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Tb=1/(8.0*10**3) #bit frequency\n",
+ "BWmin=1/(2.0*Tb) #minimum bandwidth\n",
+ "\n",
+ "#result\n",
+ "print\"minimum bandwidth = \",BWmin,\"Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum bandwidth = 4000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Modern_Electronics_Communication/screenshots/2_3.png b/Modern_Electronics_Communication/screenshots/2_3.png Binary files differnew file mode 100755 index 00000000..f92e9c53 --- /dev/null +++ b/Modern_Electronics_Communication/screenshots/2_3.png diff --git a/Modern_Electronics_Communication/screenshots/3_2.png b/Modern_Electronics_Communication/screenshots/3_2.png Binary files differnew file mode 100755 index 00000000..e55d1484 --- /dev/null +++ b/Modern_Electronics_Communication/screenshots/3_2.png diff --git a/Modern_Electronics_Communication/screenshots/4_2.png b/Modern_Electronics_Communication/screenshots/4_2.png Binary files differnew file mode 100755 index 00000000..526dd950 --- /dev/null +++ b/Modern_Electronics_Communication/screenshots/4_2.png diff --git a/Principles_of_Power_System/README.txt b/Principles_of_Power_System/README.txt index 2acded4b..2acded4b 100644..100755 --- a/Principles_of_Power_System/README.txt +++ b/Principles_of_Power_System/README.txt diff --git a/Principles_of_Power_System/chapter10_1.ipynb b/Principles_of_Power_System/chapter10_1.ipynb deleted file mode 100644 index 50a55400..00000000 --- a/Principles_of_Power_System/chapter10_1.ipynb +++ /dev/null @@ -1,1146 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:a3dcc0814e961bf1cd3db74adc66300f1f3d1872ea1c97bd01480f29b5cfe9db"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 10: Performance of Transmission\n",
- "Lines"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.1, Page Number: 233"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "pf = 0.8 #power factor\n",
- "Z = 10+15j #load impedance(ohm)\n",
- "magVr = 33000 #receiving end voltage(V)\n",
- "P = 1100 #poweer delivered(kW)\n",
- "\n",
- "#Calculation:\n",
- "magI = P*1000/(magVr*pf) #line current(A)\n",
- "phy = math.acos(pf)\n",
- "Vr = magVr+0j #V\n",
- "I = magI*(math.cos(phy)-math.sin(phy)*1j) #A\n",
- "Vs = Vr + I*Z\n",
- "\n",
- "#Angle between Vs and Vr is\n",
- "alpha = math.atan(Vs.imag/Vs.real)\n",
- "phys = phy+alpha\n",
- "pfs = math.cos(phys)\n",
- "Pl = magI**2*Z.real/1000\n",
- "Pi = P+Pl\n",
- "n = P/Pi*100\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Sending end voltage is\",round(abs(Vs)),\"V\"\n",
- "print \"(ii) sending end power factor is\",round(pfs,4),\"lagging\"\n",
- "print \"(iii)Transmission efficiency is\",round(n,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Sending end voltage is 33709.0 V\n",
- "(ii) sending end power factor is 0.7955 lagging\n",
- "(iii)Transmission efficiency is 98.45 %\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.2, Page Number: 235"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "a = 0.775 #cross-section of conductor(cm**2)\n",
- "n = 0.9 #transmission efficiency\n",
- "Pr = 200000 #receiving end power(W)\n",
- "pf = 1 #power factor\n",
- "V = 3300 #line voltage(V)\n",
- "ro = 1.725 #specific resistance(micro_ohm-cm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Ps = Pr/n #sending end power(W)\n",
- "Pl = Ps-Pr #line loss(W)\n",
- "I = Pr/(V*pf) #line current(A)\n",
- "R = Pl/(2*I**2) #resistance of 1 conductor(ohm)\n",
- "l = R*a/(ro*10**-6) #length of conductor(cm)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The conductor length is\",round(l*10**-5,1),\"km\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The conductor length is 13.6 km\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.3, Page Number: 235"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "pf = 0.8 #power factor\n",
- "Pr = 5000 #receiving end power(kW)\n",
- "Vr = 22 #receiving end voltage(kV)\n",
- "Z = 4+6j #impedance of each conductor(ohm)\n",
- "\n",
- "#Calculation:\n",
- "phy = math.acos(pf)\n",
- "magVrp = Vr*1000/3**0.5 #sending end voltage/phase(kV)\n",
- "magI = Pr*1000/(3*magVrp*0.8) #Line current(A)\n",
- "Vr = magVrp+1j \n",
- "I = magI*(math.cos(phy)-math.sin(phy)*1j)\n",
- "\n",
- "#(i)Sending end voltage per phase:\n",
- "Vs = magVrp+I*Z\n",
- "Vsl = abs(Vs)*3**0.5 #V\n",
- "\n",
- "#(ii)\n",
- "reg = (abs(Vs)-magVrp)/magVrp*100 #voltage regulation(%)\n",
- "#(iii)\n",
- "Pl = 3*abs(I)**2*Z.real/1000 #line loss(kW)\n",
- "n = Pr/(Pr+Pl)*100 #transmission efficiency(%)\n",
- "\n",
- "#Result:\n",
- "print \"(i) Sending end voltage is\",round(abs(Vsl)/1000,3),\"kV\"\n",
- "print \"(ii)Percentage regulation is\",round(reg,3),\"%\"\n",
- "print \"(iii)Transmission efficiency\",round(n,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Sending end voltage is 23.942 kV\n",
- "(ii)Percentage regulation is 8.825 %\n",
- "(iii)Transmission efficiency 93.93 %\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.4, Page Number: 236"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "Pr = 15000 #power delivered(kW)\n",
- "Vl = 132 #line voltage(kV)\n",
- "Ro = 1 #line resistance(ohm/km)\n",
- "pf = 0.8 #power factor\n",
- "\n",
- "#Calculation:\n",
- "I = Pr/(3**0.5*Vl*pf) #line current(A)\n",
- "#the loss in the transmission is to be 5%.\n",
- "Pl = 5*Pr/100 #kW\n",
- "R = Pl*1000/(3*I**2) #line resistance(ohm)\n",
- "d = R/Ro #line length(km)\n",
- "\n",
- "#Result:\n",
- "print \"Length of line is\",round(d,2),\"km\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Length of line is 37.17 km\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.5, Page Number: 236"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "pf = 0.8 #power factor\n",
- "Pr = 3600 #sending end power(kW)\n",
- "magVs = 33 #receiving end voltage(kV)\n",
- "Z = 5.31+5.54j #impedance of each conductor(ohm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = Z.real #ohm\n",
- "X = Z.imag #ohm\n",
- "phy = math.acos(0.8)\n",
- "magVsp = magVs*1000/(3**0.5) #V/phase\n",
- "magVr = symbols('magVr') #Receiving end voltage(V/phase)\n",
- "magI = Pr*1000/(3*magVr*pf) #line current(A)\n",
- "\n",
- "#(i)Using approximate expression for magVsp,\n",
- "magVr1 = solve((magVr+magI*R*pf+magI*X*math.sin(phy))-magVsp,magVr)[1]\n",
- "\n",
- "#(ii)line current:\n",
- "magI1 = Pr*1000/(3*magVr1*pf) \n",
- "\n",
- "#(iii)Efficiency\n",
- "Pl = 3*magI1**2*R/1000 #kW\n",
- "n = Pr/(Pr+Pl)*100\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The receiving end voltage \",round(magVr1*3**0.5/1000,2),\"V\"\n",
- "print \"(ii) Line current is\",round(magI1,2),\"A\"\n",
- "print \"(iii)Transmission efficiency is\",round(n,2),\"%\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The receiving end voltage 31.93 V\n",
- "(ii) Line current is 81.36 A\n",
- "(iii)Transmission efficiency is 97.15 %\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.6, Page Number: 237"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Z = 6+8j #line impedance(ohm)\n",
- "magVs = 120 #sending end voltages(kV)\n",
- "magVr = 110 #receiving end voltaes(kV)\n",
- "pf = 0.9 #power factor\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = Z.real #ohm\n",
- "X = Z.imag #ohm\n",
- "magVsp = round(120*1000/3**0.5) #V/phase\n",
- "magVrp = round(110*1000/3**0.5) #V/phase\n",
- "phy = math.acos(pf)\n",
- "magI = symbols('magI') #line current(A)\n",
- "magI1 = solve(magVrp+magI*R*math.cos(phy)+magI*X*math.sin(phy)-magVsp,magI)[0]\n",
- "\n",
- "#(i):\n",
- "Po = 3*magVrp*round(magI1)*math.cos(phy)/1000 #kW\n",
- "\n",
- "#(ii):\n",
- "pfs = (magVrp*math.cos(phy)+magI1*R)/magVsp\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Power output is\",round(Po),\"kW\"\n",
- "print \"(ii)Sending end power factor\",round(pfs,2),\"lagging\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Power output is 111458.0 kW\n",
- "(ii)Sending end power factor 0.88 lagging\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.7, Page Number: 237"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "Z = 1.5+4j #impedance of the line(ohm)\n",
- "magVr = 11000 #receivig end voltage(V)\n",
- "pf = 0.8 #power factor\n",
- "Pr = 5000 #power delivered()\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = Z.real #ohm\n",
- "X = Z.imag #ohm\n",
- "magVrp = magVr/3**0.5 #V/phase\n",
- "phy = math.acos(pf)\n",
- "magI = Pr*1000/(3*magVrp) #line current(A)\n",
- "magVsp = magVrp+magI*R*pf+magI*X*math.sin(phy) #Volt\n",
- "reg = (magVsp - magVrp)/magVrp*100 #voltage regulation(%)\n",
- "Pl = 3*magI**2*R/1000 #line losses(kW)\n",
- "Po = Pr*pf #output power(W)\n",
- "Pi = Po + Pl #Input Power(kW)\n",
- "n = Po/Pi*100 #efficiency(%)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The % regulation is\",round(reg,2),\"%\"\n",
- "print \"The efficiency is\",round(n,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The % regulation is 14.88 %\n",
- "The efficiency is 92.8 %\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.8, Page Number: 238"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Pr = 1000 #power delivered(kW)\n",
- "pf = 0.8 #power factor\n",
- "r = 0.03 #line resistance per phase(ohm/km)\n",
- "L = 0.7 #line inductance per phase(mH)\n",
- "l = 16 #line length(km)\n",
- "magVr = 11000 #receiving line voltage(V)\n",
- "f = 50 #power frequency(Hz)\n",
- "\n",
- "#Calculation:\n",
- "R = r*l #line resistance(ohm)\n",
- "X = 2*3.14*f*L/1000*l #line reactance(ohm)\n",
- "magVrp = round(magVr/3**0.5) #receiving end (v/phase)\n",
- "phy = math.acos(pf)\n",
- "magI = round(Pr*1000/(3*magVrp*math.cos(phy)),1) #line current(A)\n",
- "magVsp = magVrp+magI*R*math.cos(phy)+magI*X*math.sin(phy)\n",
- "reg = (magVsp-magVrp)/magVrp*100 #Volt\n",
- "Pl = round(3*magI**2*R/1000,1) #line losses(kW)\n",
- "Pi = Pr + Pl #Input Power(kW)\n",
- "n = Pr/Pi*100 #efficiency(%)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The % regulation is\",round(reg,2),\"%\"\n",
- "print \"The efficiency is\",round(n,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The % regulation is 2.58 %\n",
- "The efficiency is 99.38 %\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.9, Page Number: 238"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable Declaration:\n",
- "Pr = 2000 #load power(kVA)\n",
- "pf = 0.8 #power factor\n",
- "l = 20 #line length(km)\n",
- "r1 = 7.5; x1 = 13.2 #resistance & reactance of transformer primary(ohm)\n",
- "r2 = 0.35; x2 = 0.65 #resistance & reactance of transformer secondary(ohm)\n",
- "r = 0.4; x = 0.5 ##resistance & reactance of line(ohm/km)\n",
- "Vp = 33*1000 #voltage at primary side(kV)\n",
- "Vs = 6.6*1000 #voltage at secondary side(kV)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = l*r #resistance of each conuctor(ohm)\n",
- "X = l*x #reactance of each conductor(ohm)\n",
- "phy = math.acos(pf)\n",
- "#Let us transfer the impedance of transformer secondary\n",
- "#to high tension side i.e., 33 kV side.\n",
- "#Equivalent resistance of transformer referred to 33 kV side:\n",
- "R1 = r1 + r2*(Vp/Vs)**2 #ohm\n",
- "\n",
- "#Equivalent resistance of transformer referred to 33 kV side:\n",
- "X1 = x1+ x2*(Vp/Vs)**2 #ohm\n",
- "\n",
- "\n",
- "Rt = R+R1 #Total resistance of line and transformer(ohm)\n",
- "Xt = X+X1 #Total reactance of line and transformer(omh)\n",
- "Vr = Vp/3**0.5 #receiving end voltage(V/phase)\n",
- "I = round(Pr*1000/(3**0.5*Vp)) #line current(A)\n",
- "Vs = Vr+I*Rt*math.cos(phy)+I*Xt*math.sin(phy) #sending end voltage(V)\n",
- "Vsl = 3**0.5*Vs #sending end line voltage(V)\n",
- "pfs = (Vr*pf+I*Rt)/Vs #sending end power factor\n",
- "Pl = 3*I**2*Rt/1000 #line loss(kW)\n",
- "Po = Pr*pf #output power(kW)\n",
- "n = Po/(Po+Pl)*100 #transmission efficiency(%)\n",
- "\n",
- "#Result:\n",
- "print \"Sending end line voltage is\",round(Vsl/1000,1),\"V\"\n",
- "print \"Sending end power factor is\",round(pfs,4)\n",
- "print \"Transmission efficiency is\",round(n,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Sending end line voltage is 35.6 V\n",
- "Sending end power factor is 0.7826\n",
- "Transmission efficiency is 94.72 %\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.10, Page Number: 241"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r = 0.25 #resistance of line(ohm/km)\n",
- "l = 100 #line length(km)\n",
- "x = 0.8 #Reactance(ohm/km)\n",
- "y = 14*10**-6 #susceptance(siemen/km)\n",
- "magVr = 66000 #Receiving end line voltage(V)\n",
- "Pr = 15000 #power delivered(kW)\n",
- "pf = 0.8 #power factor(lagging)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = r*l #ohm\n",
- "X = x*l #ohm\n",
- "Y = y*l #siemen\n",
- "magI = Pr*1000/(pf*magVr) #line current(A)\n",
- "phy = math.acos(pf) #phasor angle\n",
- "Vr = magVr+0j #Volt\n",
- "Ir = round(magI*pf)-round(magI*math.sin(phy))*1j #load current(A)\n",
- "Ic = 1j*round(Y*magVr)\n",
- "\n",
- "#(i):\n",
- "Is = Ir+Ic #Sending end current(A)\n",
- "\n",
- "#(ii):\n",
- "delV = Is*(R+X*1j) #voltage rop(V)\n",
- "Vs = Vr+delV #sending end voltage(V)\n",
- "reg = (abs(Vs)-magVr)/magVr*100 #voltage regulation(%)\n",
- "\n",
- "#phase angle between Vr & Ir:\n",
- "theta1 = math.atan(Is.imag/Is.real)\n",
- "\n",
- "#phase angle between Vr & Is:\n",
- "theta2 = math.atan(Vs.imag/Vs.real)\n",
- "\n",
- "phys = abs(theta1)+theta2\n",
- "pfs = math.cos(phys) #supply power factor\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The sending end current is\",round(abs(Is)),\"A\"\n",
- "print \"(ii) The sending end voltage is\",round(abs(Vs)),\"V\"\n",
- "print \"(iii)Regulation is\",round(reg,2),\"%\"\n",
- "print \"(iv) Supply power factor is\",round(pfs,2),\"lagging\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The sending end current is 240.0 A\n",
- "(ii) The sending end voltage is 79583.0 V\n",
- "(iii)Regulation is 20.58 %\n",
- "(iv) Supply power factor is 0.86 lagging\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.11, Page Number: 244"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "l = 100 #line length(km)\n",
- "r = 0.1 #resistance/km/phase(ohm)\n",
- "xl = 0.2 #reactance/km/phase(ohm)\n",
- "b = 0.04*10**-4 #Capacitive susceptance/km/phase(siemen)\n",
- "Pr = 10000 #power delivered(kW)\n",
- "Vrl = 66000 #sending end line volt(V)\n",
- "pf = 0.8 #power factor(lagging)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = r*l #Total resistance/phase(ohm)\n",
- "Xl = xl*l #Total reactance/phase(ohm)\n",
- "Y = b*l #Capacitive susceptance(siemen)\n",
- "magVr = round(Vrl/3**0.5) #Receiving end voltage/phase(V)\n",
- "magIr = round(Pr*1000/(3**0.5*Vrl*pf)) #Load current(A)\n",
- "phy = math.acos(pf)\n",
- "Z = R+Xl*1j #Impedance per phase(ohm)\n",
- "#(i) Taking receiving end voltage as the reference phasor,\n",
- "Vr = magVr+0j\n",
- "Ir = magIr*(pf-math.sin(phy)*1j) #A\n",
- "V1 = Vr+Ir*Z/2 #Voltage across C(V)\n",
- "Ic = 1j*Y*V1 #Charging current(A)\n",
- "Is = Ir+Ic #sending end current(A)\n",
- "\n",
- "\n",
- "#(ii) Sending end voltage,\n",
- "Vs = V1+Is*Z/2 #V\n",
- "magVsl = 3**0.5*abs(Vs) #Line value of sending end voltage(V)\n",
- "\n",
- "#(iii) Referring to phasor diagram (iii),\n",
- "theta1 = math.atan(Vs.imag/Vs.real) #angle between Vr & Vs\n",
- "theta2 = math.atan(abs(Is.imag/Is.real)) #angle between Vr & Is\n",
- "phys = theta1+theta2 #angle b/w Vs & Is\n",
- "\n",
- "pfs = math.cos(phys) #Sending end power factor\n",
- "\n",
- "#(iii):\n",
- "Ps = 3*abs(Vs)*abs(Is)*pfs/1000 #Sending end power(kW)\n",
- "n = Pr/Ps*100 #Efficiency(%)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The sending end current is\",round(abs(Is)),\"A\"\n",
- "print \"(ii) Sending end voltage is\",round(magVsl/1000,3),\"kV\"\n",
- "print \"(iii)Sending end power factor is\",round(pfs,3),\"lagging\"\n",
- "print \"(iv) Transmission efficiency is\",round(n,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The sending end current is 100.0 A\n",
- "(ii) Sending end voltage is 69.532 kV\n",
- "(iii)Sending end power factor is 0.853 lagging\n",
- "(iv) Transmission efficiency is 97.12 %\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.12, Page Number: 245"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "l = 100 #line length(km)\n",
- "r = 0.2 #resistance/km/phase(ohm)\n",
- "xl = 0.4 #reactance/km/phase(ohm)\n",
- "b = 2.5*10**-6 #Capacitive susceptance/km/phase(siemen)\n",
- "Pr = 20000 #power delivered(kW)\n",
- "Vrl = 110000 #sending end line volt(V)\n",
- "pf = 0.9 #power factor\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = r*l #Total resistance/phase(ohm)\n",
- "Xl = xl*l #Total reactance/phase(ohm)\n",
- "Y = b*l #Capacitive susceptance(siemen)\n",
- "magVr = round(Vrl/3**0.5) #Receiving end voltage/phase(V)\n",
- "magIr = round(Pr*1000/(3**0.5*Vrl*pf)) #Load current(A)\n",
- "phy = math.acos(pf)\n",
- "Z = R+Xl*1j #Impedance per phase(ohm)\n",
- "\n",
- "#(i) Taking receiving end voltage as the reference phasor,\n",
- "Vr = magVr+0j\n",
- "Ir = magIr*(pf-(math.sin(phy))*1j) #A\n",
- "V1 = Vr+Ir*Z/2 #Voltage across C(V)\n",
- "Ic = 1j*Y*V1 #Charging current(A)\n",
- "Is = Ir+Ic #sending end current(A)\n",
- "Vs = V1+Is*Z/2 #V\n",
- "magVsl = 3**0.5*abs(Vs) #Line value of sending end voltage(V)\n",
- "\n",
- "#(ii):\n",
- "Pl = 3*abs(Is)**2*R/2+3*magIr**2*R/2 #line loss(W)\n",
- "n = Pr/(Pr+Pl/1000)*100 #efficiency\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The current and voltage at the sending end is\",round(magVsl/1000,2),\"kV\"\n",
- "print \"(ii)Efficiency of transmission is\",round(n,2),\"%\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The current and voltage at the sending end is 116.75 kV\n",
- "(ii)Efficiency of transmission is 96.26 %\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.13, Page Number: 247"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "l = 150 #line length(km)\n",
- "r = 0.1 #resistance/km/phase(ohm)\n",
- "xl = 0.5 #reactance/km/phase(ohm)\n",
- "b = 3*10**-6 #Capacitive susceptance/km/phase(siemen)\n",
- "Pr = 50000 #power delivered(kW)\n",
- "Vrl = 110000 #sending end line volt(V)\n",
- "pf = 0.8 #power factor\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = r*l #Total resistance/phase(ohm)\n",
- "Xl = xl*l #Total reactance/phase(ohm)\n",
- "Y = b*l #Capacitive susceptance(siemen)\n",
- "magVr = round(Vrl/3**0.5) #Receiving end voltage/phase(V)\n",
- "magIr = round(Pr*1000/(3**0.5*Vrl*pf)) #Load current(A)\n",
- "phy = math.acos(pf)\n",
- "Z = R+Xl*1j #Impedance per phase(ohm)\n",
- "\n",
- "Vr = magVr+0j\n",
- "Ir = magIr*(pf-(math.sin(phy))*1j) #A\n",
- "Ic1 = Vr*1j*Y/2 #Charging current at the load end(A)\n",
- "Il = Ir+Ic1 #line current(A)\n",
- "Vs = Vr+Il*Z #Sending end voltage(V)\n",
- "magVsl = abs(Vs)*3**0.5 #Line to line sending end voltage(V)\n",
- "Ic2 = 1j*Vs*Y/2 #Charging current at the sending end(A)\n",
- "Is = Il+Ic2 #Sending end current(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The sending end voltage is\",round(magVsl/1000,2),\"V\"\n",
- "print \"The sending end current is\",round(abs(Is),1),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The sending end voltage is 143.56 V\n",
- "The sending end current is 306.3 A\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.14, Page Number: 248"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable Declaration:\n",
- "l = 100 #line length(km)\n",
- "r = 0.1 #resistance/km/phase(ohm)\n",
- "xl = 0.5 #reactance/km/phase(ohm)\n",
- "b = 10*10**-6 #Capacitive susceptance/km/phase(siemen)\n",
- "Pr = 20000 #power delivered(kW)\n",
- "Vrl = 66000 #sending end line volt(V)\n",
- "pf = 0.9 #power factor\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = r*l #Total resistance/phase(ohm)\n",
- "Xl = xl*l #Total reactance/phase(ohm)\n",
- "Y = b*l #Capacitive susceptance(siemen)\n",
- "magVr = round(Vrl/3**0.5) #Receiving end voltage/phase(V)\n",
- "magIr = round(Pr*1000/(3**0.5*Vrl*pf)) #Load current(A)\n",
- "phy = math.acos(pf)\n",
- "Z = R+Xl*1j #Impedance per phase(ohm)\n",
- "\n",
- "Vr = magVr+0j\n",
- "Ir = magIr*(pf-(math.sin(phy))*1j) #A\n",
- "Ic1 = round(magVr*Y/2)*1j #Charging current at the load end(A)\n",
- "Il = Ir+Ic1 #line current(A)\n",
- "Vs = Vr+Il*Z #Sending end voltage(V)\n",
- "magVsl = abs(Vs)*3**0.5 #Line to line sending end voltage(V)\n",
- "Ic2 = 1j*Vs*Y/2 #Charging current at the sending end(A)\n",
- "Is = Il+Ic2 #Sending end current(A)\n",
- "\n",
- "#(i):\n",
- "theta1 = math.atan(Vs.imag/Vs.real) #angle between Vr & Vs\n",
- "theta2 = math.atan(abs(Is.imag/Is.real)) #angle between Vr & Is\n",
- "phys = theta1+theta2 #angle b/w Vs & Is\n",
- "pfs = math.cos(phys) #Sending end power factor\n",
- "\n",
- "#(ii):\n",
- "reg = (abs(Vs)-magVr)/magVr*100 #voltage regulation(%)\n",
- "\n",
- "#(iii):\n",
- "Ps = 3*abs(Vs)*abs(Is)*pfs/1000 #sending end power(W)\n",
- "n = Pr/Ps*100 #transmission efficiency(%)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Sending end power factor is\",round(pfs,3),\"lagging\"\n",
- "print \"(ii) Regulation is\",round(reg,2),\"%\"\n",
- "print \"(iii)Transmission efficiency is\",round(n),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Sending end power factor is 0.906 lagging\n",
- "(ii) Regulation is 15.15 %\n",
- "(iii)Transmission efficiency is 95.0 %\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- " Example 10.15, Page Number: 254"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import cmath\n",
- "\n",
- "#Variable Declaration:\n",
- "l = 200 #line length(km)\n",
- "r = 0.16 #resistance/km/phase(ohm)\n",
- "xl = 0.25 #reactance/km/phase(ohm)\n",
- "b = 1.5*10**-6*1j #Capacitive susceptance/km/phase(siemen)\n",
- "Pr = 20000 #power delivered(kW)\n",
- "Vrl = 110000 #sending end line volt(V)\n",
- "pf = 0.8 #power factor\n",
- "\n",
- "#Calculation:\n",
- "R = r*l #Total resistance/phase(ohm)\n",
- "Xl = xl*l #Total reactance/phase(ohm)\n",
- "Y = b*l #Capacitive susceptance(siemen)\n",
- "Z = R+Xl*1j #Series Impedance/phase(ohm)\n",
- "magVr = Vrl/3**0.5 #Receiving end voltage per phase(V)\n",
- "magIr = round(Pr*1000/(3**0.5*Vrl*pf)) #Receiving end current(A)\n",
- "Vs = magVr*cmath.cosh((Y*Z)**0.5)+magIr*(Z/Y)**0.5*cmath.sinh((Z*Y)**0.5) #sending end voltage(V/phase)\n",
- "Is = magVr*(Y/Z)**0.5*cmath.sinh((Y*Z)**0.5)+magIr*cmath.cosh((Y*Z)**0.5)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Sending end line-to-line voltage is\",round(3**0.5*abs(Vs)/1000,1),\"V\"\n",
- "print \"Sending end current is\",round(abs(Is),1),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Sending end line-to-line voltage is 117.0 V\n",
- "Sending end current is 131.5 A\n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.16, Page Number: 258"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "Z = 20+52j #Series line impedance/phase(ohm)\n",
- "Y = 315*10**-6*1j #Shunt admittance/phase(siemen)\n",
- "pf = 0.85 #power factor\n",
- "Pr = 30000 #receiving end power(kW)\n",
- "magVrl = 132000 #receiving end voltage(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#(i) Generalised constants of line,\n",
- "A = 1+Z*Y/2\n",
- "D = A\n",
- "B = Z*(1+Z*Y/4)\n",
- "C = Y\n",
- "\n",
- "#(ii) Sending end voltage,\n",
- "magVr = magVrl/3**0.5 #V/phase\n",
- "magIr = Pr*1000/(3**0.5*magVrl*pf) #line current(A)\n",
- "phy = math.acos(pf)\n",
- "Vr = magVr+0j\n",
- "Ir = magIr*(math.cos(phy)-1j*math.sin(phy))\n",
- "Vs = A*Vr+B*Ir\n",
- "magVs = abs(Vs) #sending end voltage(V/phase)\n",
- "magVsl = 3**0.5*magVs #Sending end line-to-line voltage(V)\n",
- "\n",
- "\n",
- "#(iii) Regulation:\n",
- "#At no load, Ir = 0,\n",
- "magVro = abs(Vs/A)\n",
- "reg = (magVro-magVr)/magVr*100 #regulation(%)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i)The A, B, C and D constants of the line are\"\n",
- "print \" A =\",complex(round(A.real,3),round(A.imag,5))\n",
- "print \" B =\",complex(round(B.real,2),round(B.imag,2))\n",
- "print \" C =\",complex(round(C.real,6),round(C.imag,6))\n",
- "print \" D =\",complex(round(D.real,3),round(D.imag,5))\n",
- "\n",
- "print \"(ii) Sending end voltage is\",round(magVs*3**0.5/1000),\"kV\"\n",
- "print \"(iii)Regulation of the line is\",round(reg,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)The A, B, C and D constants of the line are\n",
- " A = (0.992+0.00315j)\n",
- " B = (19.84+51.82j)\n",
- " C = 0.000315j\n",
- " D = (0.992+0.00315j)\n",
- "(ii) Sending end voltage is 143.0 kV\n",
- "(iii)Regulation of the line is 9.25 %\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.17, Page Number: 259"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "A = cmath.rect(0.95,math.radians(1.4))\n",
- "B = cmath.rect(96,math.radians(78))\n",
- "C = cmath.rect(0.0015,math.radians(90))\n",
- "D = cmath.rect(0.95,math.radians(1.4))\n",
- "Pr = 50000 #receiving end power(kW)\n",
- "pf = 0.8 #power factor\n",
- "magVrl = 132000 #receiving end voltage(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "magVr = magVrl/3**0.5 #Receiving end voltage/phase(V)\n",
- "magIr = Pr*1000/(3**0.5*magVrl*pf) #line current(A)\n",
- "phy = math.acos(pf)\n",
- "Vr = magVr+0j\n",
- "Ir = magIr*(math.cos(phy)-1j*math.sin(phy))\n",
- "Vs = A*Vr+B*Ir #Sending end voltage per phase\n",
- "Is = C*Vr+D*Ir #Sending end current\n",
- "Ic = Is-Ir #Charging current\n",
- "#At no load, Ir = 0,\n",
- "magVro = abs(Vs/A)\n",
- "reg = (magVro-magVr)/magVr*100 #regulation(%)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Charging current is (\",round(abs(Ic)),round(math.degrees(angle(Ic)),1),\") A\"\n",
- "print \"Regulation is\",round(reg),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Charging current is ( 128.0 93.2 ) A\n",
- "Regulation is 30.0 %\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 10.18, Page Number: 260"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "A = cmath.rect(0.98,math.radians(3))\n",
- "B = cmath.rect(110,math.radians(75))\n",
- "C = cmath.rect(0.0005,math.radians(80))\n",
- "D = cmath.rect(0.98,math.radians(3))\n",
- "MVA = 50 #receiving end power\n",
- "pf = 0.8 #power factor\n",
- "magVrl = 110 #receiving end voltage(kV)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Pr = MVA*pf*10**6\n",
- "magVr = round(magVrl/3**0.5,1) #Receiving end voltage/phase(V)\n",
- "magIr = round(MVA*10**6/(3**0.5*magVrl*1000),1) #line current(A)\n",
- "phy = math.acos(pf)\n",
- "Vr = magVr*1000+0j\n",
- "Ir = magIr*(math.cos(phy)-1j*math.sin(phy))\n",
- "#(round(Ir.real)+1j*round(Ir.imag))\n",
- "V1 = round((A*Vr).real)+math.ceil((A*Vr).imag)*1j\n",
- "V2 = round((B*Ir).real)+math.ceil((B*Ir).imag)*1j\n",
- "Vs = V1+V2 #Sending end voltage per phase\n",
- "theta1 = math.atan(Vs.imag/Vs.real)\n",
- "Is = C*Vr+D*Ir #Sending end current\n",
- "theta2 = math.atan(Is.imag/Is.real)\n",
- "phys = theta2-theta1\n",
- "Ps = 3*abs(Vs)*abs(Is)*math.cos(phys) #Sending-end power(W)\n",
- "n = Pr/Ps*100 #efficiency(%)\n",
- "\n",
- "#Result:\n",
- "print \"(i) Sending end voltage is\",round(abs(Vs)),\"V\"\n",
- "print \"(ii) Sending end current is\",round(abs(Is)),\"A\"\n",
- "print \"(iii)Sending-end power is\",round(Ps/10**6,1),\"MW\"\n",
- "print \"(iv) Transmission efficiency is\",round(n,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Sending end voltage is 87429.0 V\n",
- "(ii) Sending end current is 246.0 A\n",
- "(iii)Sending-end power is 48.7 MW\n",
- "(iv) Transmission efficiency is 82.2 %\n"
- ]
- }
- ],
- "prompt_number": 6
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter11_1.ipynb b/Principles_of_Power_System/chapter11_1.ipynb deleted file mode 100644 index 2283037e..00000000 --- a/Principles_of_Power_System/chapter11_1.ipynb +++ /dev/null @@ -1,1185 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:1fe403fe815d4353da157ba9f671fac5bd27f5ac7842de08db777bc86330d8e5"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 11: Underground Cables"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.1, Page Number: 273"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r1 = 0.5 #conductor radius(cm)\n",
- "l = 2000 #conductor length(m)\n",
- "rho = 5*10**12 #Resistivity of insulation(ohm-m)\n",
- "t = 0.4 #insulation thickness(cm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "r2 = r1+t #Internal sheath radius(cm)\n",
- "R = rho*math.log(r2/r1)/(2*math.pi*l) #Insulation resistance of cable(ohm)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Insulation resistance of cable is\",round(R/10**6),\"Mohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Insulation resistance of cable is 234.0 Mohm\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.2, Page Number: 274"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "r1 = 1.25 #conductor radius(cm)\n",
- "l = 1000 #conductor length(m)\n",
- "rho = 4.5*10**12 #Resistivity of insulation(ohm-m)\n",
- "R = 495*10**6 #Cable insulation resistance(ohm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let r2 cm be the internal sheath radius,\n",
- "\n",
- "r2 = r1*math.exp(R*2*math.pi*l/rho)\n",
- "\n",
- "#Result:\n",
- "print \"Insulation thickness is\",round(r2-r1,2),\"cm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Insulation thickness is 1.25 cm\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.3, Page Number: 274"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "r1 = .10 #conductor radius(cm)\n",
- "l = 5000 #conductor length(m)\n",
- "r2 = 0.25 #Internal sheath radius(cm)\n",
- "R = 0.4*10**6 #Cable insulation resistance(ohm)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "rho = R*2*3.14*l/(math.log(r2/r1)*10**9) #resistivity(ohm-m)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Resistivity of the insulating material is\",round(rho,2),\"* 10**9 ohm-m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Resistivity of the insulating material is 13.71 * 10**9 ohm-m\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.4, Page Number: 275"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "er = 4 #relative permittivity\n",
- "D = 1.8 #internal sheath diameter(cm)\n",
- "l = 1000 #cable length(m)\n",
- "d = 1 #conductor diameter(cm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "C = er*l/(41.4*math.log10(D/d))*10**-9 #Capacitance(F)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The capacitance of the cable is\",round(C*10**6,3),\"uF\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The capacitance of the cable is 0.378 uF\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.5, Page Number: 276"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "er = 4 #relative permittivity\n",
- "d = 10 #core diameter(cm)\n",
- "l = 1000 #cable length(m)\n",
- "t = 7 #insulation thickness(cm)\n",
- "Vl = 66000 #line voltage(V)\n",
- "f = 50 #frequency(Hz)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "D = d+2*t #conductor diameter(cm)\n",
- "C = 4*1000/(41.4*math.log10(D/d))*10**-3 #Capacitance(uF)\n",
- "\n",
- "Vp = Vl/3**0.5\n",
- "I = 2*3.14*f*C*Vp*10**-6 #Carging current(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The capacitance is\",round(C,3),\"uF\"\n",
- "print \"Charging current of a single core cable is\",round(I,2),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The capacitance is 0.254 uF\n",
- "Charging current of a single core cable is 3.04 A\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.6, Page Number: 276"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Calculation:\n",
- "er = 3 #relative permittivity\n",
- "d = 2.5 #core diameter(cm)\n",
- "l = 4000 #cable length(m)\n",
- "t = 0.5 #insulation thickness(cm)\n",
- "Vl = 33000 #line voltage(V)\n",
- "f = 50 #frequency(Hz)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "D = d+2*t #conductor diameter(cm)\n",
- "C = er*l/(41.4*math.log10(D/d))*10**-3 #Capacitance(uF)\n",
- "Vp = Vl/3**0.5\n",
- "I = 2*3.14*f*C*Vp*10**-6 #Carging current(A)\n",
- "kVAR = 3*Vp*I #Total charging kVAR\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The capacitance is\",round(C*10**3),\"* 10**-9 F\"\n",
- "print \"(ii) Charging current of a single core cable is\",round(I,2),\"A\"\n",
- "print \"(iii)Total charging kVAR is\",round(kVAR/1000,1),\"* 10**3 kVAR\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The capacitance is 1984.0 * 10**-9 F\n",
- "(ii) Charging current of a single core cable is 11.87 A\n",
- "(iii)Total charging kVAR is 678.3 * 10**3 kVAR\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.7, Page Number: 278"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable Declaration:\n",
- "V = 33 #voltage of cable(V)\n",
- "d = 1 #conductor diameter(cm)\n",
- "D = 4 #sheath diameter(cm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "gmax = 2*V/(d*math.log(D/d)) #maximum stress,rms(kV/cm)\n",
- "gmin = gmax*d/D #minimum stress,rms(kV/cm)\n",
- "\n",
- "#Result:\n",
- "print \"The maximum and minimum stress in the insulation are\"\n",
- "print \"gmax =\",round(gmax,2),\"kV/cm rms & gmin =\",round(gmin,2),\"kV/cm rms\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The maximum and minimum stress in the insulation are\n",
- "gmax = 47.61 kV/cm rms & gmin = 11.9 kV/cm rms\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.8, Page Number: 278"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "gmax = 40 #kV/cm\n",
- "gmin = 10 #kV/cm\n",
- "d = 2 #conductor diameter(cm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "D = gmax/gmin*d #cm\n",
- "t = (D-d)/2 #thickness of insulation(cm)\n",
- "V = gmax*d*math.log(D/d)/2\n",
- "\n",
- "#Result:\n",
- "print \"(i) Thickness of insulation is\",t,\"cm\"\n",
- "print \"(ii)Operating voltage is\",round(V,2),\"kV rms\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Thickness of insulation is 3.0 cm\n",
- "(ii)Operating voltage is 55.45 kV rms\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.9, Page Number: 279"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "V = 11 #voltage of cable(V)\n",
- "a = 0.645 #conductor area(cm**2)\n",
- "D = 2.18 #internal diameter of sheath(cm)\n",
- "er = 3.5 #relative permitivity\n",
- "l = 1000 #conductor length(m)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "d = (4*a/3.14)**0.5 #Diameter of the conductor(cm)\n",
- "gmax = 2*V/(d*math.log(D/d)) #Maximum electrostatic stress(kV/cm rms)\n",
- "gmin = 2*V/(D*math.log(D/d)) #Minimum electrostatic stress(kV/cm rms)\n",
- "C = er*l/(41.4*math.log10(D/d))*10**-9 #Capacitance of cable(F)\n",
- "I = 2*3.14*f*C*V*1000 #Carging current(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Maximum electrostatic stress in the cable is\",round(gmax,2),\"kV/cm rms\"\n",
- "print \"(ii) Minimum electrostatic stress in the cable is\",round(gmin,2),\"kV/cm rms\"\n",
- "print \"(iii)Capacitance of the cable per km length is\",round(C*10**6,2),\"* 10**-6 F\"\n",
- "print \"(iv) Charging current is\",round(I,3),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Maximum electrostatic stress in the cable is 27.66 kV/cm rms\n",
- "(ii) Minimum electrostatic stress in the cable is 11.5 kV/cm rms\n",
- "(iii)Capacitance of the cable per km length is 0.22 * 10**-6 F\n",
- "(iv) Charging current is 0.766 A\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.10, Page Number: 280"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "V = 50 #Cable voltage(kV)\n",
- "gmax = 40 #Maximum permissible stress(kV/cm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Vp = V*2**0.5 #Peak value of cable voltage(kV)\n",
- "d = 2*Vp/gmax #Most economical conductor diameter(cm)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The most economical value of diameter is\",round(d,2),\"cm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The most economical value of diameter is 3.54 cm\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.11, Page Number: 280"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "Vl = 132 #Cable voltage(kV)\n",
- "gmax = 60 #Maximum permissible stress(kV/cm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Vph = Vl/3**0.5 #phase voltage(kV)\n",
- "Vp = Vph*2**0.5 #Peak value of cable voltage(kV)\n",
- "d = 2*Vp/gmax #Most economical conductor diameter(cm)\n",
- "D = 2.718*d #Internal diameter of sheath(cm)\n",
- "\n",
- "#Result:\n",
- "print \"Most economical conductor diameter is\",round(d,1),\"cm\"\n",
- "print \"Internal diameter of sheath, D is\",round(D,2),\"cm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Most economical conductor diameter is 3.6 cm\n",
- "Internal diameter of sheath, D is 9.76 cm\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.12, Page Number: 282"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "d = 2 #conductor diameter(cm)\n",
- "e3 = 3 #relative permittivity\n",
- "e2 = 4\n",
- "e1 = 5\n",
- "D = 8 #overall diameter(cm)\n",
- "gmax = 40 #kV/cm\n",
- "\n",
- "#Calculation:\n",
- "#Graded cable: As the maximum stress in the three dielectrics is the same,\n",
- "d1 = e1*d/e2 #diameter of 1st layer(cm)\n",
- "d2 = e1*d/e3 #diameter of 2nd layer(cm)\n",
- "#Permissible peak voltage for the cable:\n",
- "Vp1 = gmax/2*(d*math.log(d1/d)+d1*math.log(d2/d1)+d2*math.log(D/d2)) #kV\n",
- "Vs1 = Vp1/2**0.5 #Safe working voltage (r.m.s.) for cable(kV)\n",
- "\n",
- "#Ungraded cable:\n",
- "Vp2 = gmax/2*d*log(D/d) #kV\n",
- "Vs2 = Vp2/(2**0.5) #kV\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"For Graded cable, safe working voltage is\",round(Vs1,2),\"kV\"\n",
- "print \"For Ungraded cable, safe working voltage is\",round(Vs2,1),\"kV\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "For Graded cable, safe working voltage is 57.75 kV\n",
- "For Ungraded cable, safe working voltage is 39.2 kV\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.13, Page Number: 283"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "d = 3 #conductor diameter(cm)\n",
- "e2 = 4 #relative permittivity\n",
- "e1 = 5\n",
- "D = 9 #overall diameter(cm)\n",
- "g1max = 30 #kV/cm\n",
- "g2max = 20 #kV/cm\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "d1 = g1max/g2max*e1*d/e2 #cm\n",
- "t1 = (d1-d)/2 #Radial thickness of inner dielectric(cm)\n",
- "t2 = (D-d1)/2 #Radial thickness of outer dielectric(cm)\n",
- "Vp = g1max/2*d*math.log(d1/d)+g2max/2*d1*math.log(D/d1)\n",
- "Vsf = Vp/2**0.5 #Safe working voltage(r.m.s.)for the cable(kV)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Radial thickness of inner dielectric is\",round(t1,3),\"cm\"\n",
- "print \"Radial thickness of outer dielectric is\",round(t2,2),\"cm\"\n",
- "print \"Safe working voltage (r.m.s.) for the cable is\",round(Vsf,2),\"kV\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Radial thickness of inner dielectric is 1.313 cm\n",
- "Radial thickness of outer dielectric is 1.69 cm\n",
- "Safe working voltage (r.m.s.) for the cable is 38.7 kV\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.14, Page Number: 284"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "e1 = 5 #relative permittivity\n",
- "e2 = 3\n",
- "t = 1 #thickness(cm)\n",
- "d = 2 #core diameter(cm)\n",
- "V = 66 #cable voltage(kV)\n",
- "\n",
- "#Calculation:\n",
- "d1 = d+2*t\n",
- "D = d+4*t #total diameter of cable(cm)\n",
- "Vpk = V/3**0.5*2**0.5 #Peak voltage per phase(kV)\n",
- "g1max = 2*Vpk/(d*(math.log(d1/d)+e1/e2*math.log(D/d1))) #kV/cm\n",
- "g2max = 2*Vpk/(d1*(e2/e1*math.log(d1/d)+math.log(D/d1))) #kV/cm\n",
- "\n",
- "#Result:\n",
- "print \"Maximum stresses in two dielectrics are:\"\n",
- "print \"g1max =\",round(g1max,2),\"kV/cm g2max =\",round(g2max,2),\"kV/cm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum stresses in two dielectrics are:\n",
- "g1max = 39.37 kV/cm g2max = 32.8 kV/cm\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.15, Page Number: 285"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "d = 2 #cm\n",
- "d1 = 3.1 #cm\n",
- "d2 = 4.2 #cm\n",
- "D = 5.3 #cm\n",
- "V = 66 #cable voltage(kV)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Vpk = V/3**0.5*2**0.5 #peak voltage/phase(kV)\n",
- "#let V1,V2 & V3 are the voltages at different grades.\n",
- "V1,V2,V3 = symbols('V1 V2 V3')\n",
- "g1max = V1/(d/2*math.log(d1,d))\n",
- "g2max = V2/(d1/2*math.log(d2,d1))\n",
- "g3max = V3/(d2/2*math.log(D,d2))\n",
- "\n",
- "#As the maximum stress in the layers is the same,\n",
- "#\u2234 g1max = g2max = g3max\n",
- "#or 2\u00b728 V1 = 2\u00b712 V2 = 2\u00b704 V3\n",
- "#\u2234 V2 = (2\u00b728/2\u00b712) V1 = 1\u00b7075 V1\n",
- "#and V3 = (2\u00b728/2\u00b704) V1 = 1\u00b7117 V1\n",
- "#Now V1 + V2 + V3 = Vpk\n",
- "#or V1 + 1\u00b7075 V1 + 1\u00b7117 V1 = 53\u00b79\n",
- "V1 = 53.9/3.192\n",
- "V2 = 1.075*V1\n",
- "V1s = Vpk-V1 #Voltage on first intersheath(near to core)(kV)\n",
- "V2s = Vpk-V1-V2 #Voltage on second intersheath(kV)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Voltage on first intersheath is\",round(V1s,2),\"kV\"\n",
- "print \"Voltage on second intersheath is\",round(V2s,2),\"kV\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage on first intersheath is 37.0 kV\n",
- "Voltage on second intersheath is 18.85 kV\n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.16, Page Number: 286"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "d = 2 #core diameter(cm)\n",
- "D = 5.3 #cm\n",
- "V = 66 #cable voltage(kV)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Vpk = V/3**0.5*2**0.5 #peak voltage/phase(kV)\n",
- "#(i) Positions of intersheaths.\n",
- "\n",
- "#Let the diameters of intersheaths are d1 and d2 cm respectively.\n",
- "#Let V1 = voltage b/w conductor & intersheath 1\n",
- "# V2 = voltage b/w intersheaths 1 and 2\n",
- "# V3 = voltage b/w intersheath 2 & outer lead sheath\n",
- "\n",
- "\n",
- "#Given the maximum stress in the three layers is the same,\n",
- "#we get the relation as given below:\n",
- "# d1**2 = d * d2 = 2*d2 [\u2235 d = 2 cm]\n",
- "#or d2 = d1**2/2\n",
- "#and d1*d2 = D * d = 5\u00b73 \u00d7 2 = 10.6 cm\n",
- "#or d1 * d1**2/2 = 10\u00b76\n",
- "d1 = 21.2**(1/3) #cm\n",
- "d2 = d1**2/2 #cm\n",
- "\n",
- "\n",
- "#(ii) Voltage on intersheaths,\n",
- "# V = V1 + V2 + V3\n",
- "#or 53\u00b79 = V1+d1/d*V1+d2/d*V1\n",
- "# = 4.28*V1\n",
- "V1 = 53.9/4.28 #kV\n",
- "V2 = d1/d*V1 #kV\n",
- "\n",
- "#(iii) Stresses in dielectrics,\n",
- "gmax = V1/(d/2*math.log(d1/d)) #max stress(kV/cm)\n",
- "gmin = V1/(d1/2*math.log(d1/d)) #min stress(kV/cm\n",
- "\n",
- "#Result:\n",
- "print \"(i) Positions of intersheaths are:\"\n",
- "print \"\\td1 =\",round(d1,2),\"cm d2 =\",round(d2,1),\"cm\"\n",
- "print \"(ii) Voltage on the intersheaths are:\"\n",
- "print \"\\tVoltage on first intersheath is\",round(Vpk-V1,2),\"kV\"\n",
- "print \"\\tVoltage on second intersheath is\",round(Vpk-V1-V2,1),\"kV\"\n",
- "print \"(iii) Maximum and minimum stress are:\"\n",
- "print \"\\tgmax =\",round(gmax),\"kV/cm\\tgmin =\",round(gmin,2),\"kV/cm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Positions of intersheaths are:\n",
- "\td1 = 2.77 cm d2 = 3.8 cm\n",
- "(ii) Voltage on the intersheaths are:\n",
- "\tVoltage on first intersheath is 41.3 kV\n",
- "\tVoltage on second intersheath is 23.9 kV\n",
- "(iii) Maximum and minimum stress are:\n",
- "\tgmax = 39.0 kV/cm\tgmin = 28.01 kV/cm\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.17, Page Number: 289"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "c = 0.3 #capacitance per kilometre(uF/km)\n",
- "V = 11 #line voltage(kV)\n",
- "l = 5 #length of the cable(km)\n",
- "f = 50 #Hz\n",
- "\n",
- "#Calculation:\n",
- "C3 = c*l #capacitance between a pair of cores with third core\n",
- " #earthed for a length of 5 km (uF)\n",
- "Vph = V*1000/3**0.5 #phase voltage(V)\n",
- "#core to neutral capacitance Cn of this cable is given by :\n",
- "Cn = 2*C3 #uF\n",
- "Ic = 2*math.pi*f*Vph*Cn*10**-6\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \" The charging current is\",round(Ic,2),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " The charging current is 5.99 A\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.18, Page Number: 290"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "V = 66 #line voltage(kV)\n",
- "C1 = 12.6 #uF\n",
- "C2 = 7.4 #uF\n",
- "f = 50 #Hz\n",
- "\n",
- "#Calculation:\n",
- "Vph = V*1000/3**0.5 #phase voltage(V)\n",
- "Ce = C1/3 #core-earth capacitances(uF)\n",
- "Cc = (C2-Ce)/2 #core-core capacitances(uF)\n",
- "Cn = Ce+3*Cc #Core to neutral capacitance(uF)\n",
- "Ic = 2*math.pi*f*Vph*Cn*10**-6\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The charging current is\",round(Ic,2),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The charging current is 107.74 A\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.19, Page Number: 290"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "c = 0.18 #capacitance per kilometre(uF/km)\n",
- "V = 3300 #line voltage(V)\n",
- "l = 20 #length of the cable(km)\n",
- "f = 50 #Hz\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "C3 = c*l #capacitance between a pair of cores with third core\n",
- " #earthed for a length of 20 km (uF)\n",
- "Vph = V/3**0.5 #phase voltage(V)\n",
- "Cn = 2*C3 #Core to neutral capacitance(uF)\n",
- "Ic = 2*math.pi*f*Cn*Vph*10**-6 #charging current(A)\n",
- "kVA = 3*Vph*Ic/1000 #kVA taken by the cable\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The kVA taken by 20 km long cable is\",round(kVA,2),\"kVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The kVA taken by 20 km long cable is 24.63 kVA\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.20, Page Number: 292"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "k = 5 #thermal resistivity of the dielectric(ohm-m)\n",
- "S2 = 0.45 #thermal resistance b/w the sheath and the ground surface\n",
- "R = 110 #electrical resistance of the cable(u-ohm)\n",
- "r = 15 #core radius(mm)\n",
- "t = 40 #dielectric thickness(mm)\n",
- "T = 55 #temperature(deg. C)\n",
- "n = 1 #no. of conductors\n",
- "\n",
- "#Calculation:\n",
- "r1 = r+t #mm\n",
- "S1 = k/(2*math.pi)*math.log(r1/r) #ohm/m\n",
- "S = S1+S2 #ohm/m\n",
- "I = (T/(n*R*10**-6*S))**0.5 #current loading(A)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Maximum permissible current loading is\",round(I,1),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum permissible current loading is 580.5 A\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.21, Page Number: 296"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "Q = 15 #ohm\n",
- "P = 45 #ohm\n",
- "l = 300 #length of faulty cable(m)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "L = 2*l #loop length(m)\n",
- "d = Q/(P+Q)*L #Distance of the fault point from test end(m)\n",
- "\n",
- "#Result:\n",
- "print \" The distance of the fault point from the test end is\",d,\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " The distance of the fault point from the test end is 150.0 m\n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- " Example 11.22, Page Number: 297"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "l = 500 #length of faulty cable(m)\n",
- "#P:Q = 3\n",
- "\n",
- "#Calculation:\n",
- "#Let:\n",
- "P = 3; Q = 1 #ohm\n",
- "#then,\n",
- "d = Q/(P+Q)*2*l #Distance of the fault point from test end(m)\n",
- "\n",
- "#Result:\n",
- "print \"The distance of the fault from the testing end of cables\",d,\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The distance of the fault from the testing end of cables 250.0 m\n"
- ]
- }
- ],
- "prompt_number": 24
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.23, Page Number: 297"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "l = 500 #length of faulty cable(m)\n",
- "rp = 0.001 #resistance of cable(ohm/m)\n",
- "rq = 0.00225 #resistance of sound cable(ohm/m)\n",
- "#P:Q = 2.75:1\n",
- "\n",
- "#Calculation:\n",
- "#Let:\n",
- "P = 2.75; Q = 1 #ohm\n",
- "#then,\n",
- "R = rp*l+rq*l #Resistance of loop(ohm)\n",
- "X = Q/(P+Q)*R #Resistance of faulty cable from test end upto fault point(ohm)\n",
- "d = X/rp #Distance of the fault point from test end(m)\n",
- "\n",
- "#Result:\n",
- "print \"The distance of the fault from the testing end of cables\",round(d),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The distance of the fault from the testing end of cables 433.0 m\n"
- ]
- }
- ],
- "prompt_number": 32
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.24, Page Number: 297"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "S = 200 #ohm\n",
- "r = 20 #resistance per km(ohm)\n",
- "l = 20 #length of cable(km)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "# R+X = 20*(20+20) #ohm\n",
- "# P = Q\n",
- "X = (800-200)/2 #ohm\n",
- "d = X/r #m\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The distance of the fault from the test end is\",d,\"km\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The distance of the fault from the test end is 15.0 km\n"
- ]
- }
- ],
- "prompt_number": 33
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter13_1.ipynb b/Principles_of_Power_System/chapter13_1.ipynb deleted file mode 100644 index 9f2fa9af..00000000 --- a/Principles_of_Power_System/chapter13_1.ipynb +++ /dev/null @@ -1,1972 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:9a20e0c71265585c31a8df4c18dfac853044b054341d1794943bfacb3c219678"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 13: D.C. Distribution"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.1, Page number: 313"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable Declaration:\n",
- "#given a 2-wire d.c. distributor cable AB\n",
- "\n",
- "r = 0.01*2 #Resistance per 1000m of distributor\n",
- "Va = 300 #p.d at point A(V)\n",
- "AC = 500 #m\n",
- "CD = 500 #m\n",
- "DE = 600 #m\n",
- "EB = 400 #m\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Rac = r*AC/1000 #Resistance of section AC\n",
- "Rcd = r*CD/1000 #Resistance of section CD\n",
- "Rde = r*DE/1000 #Resistance of section DE\n",
- "Reb = r*EB/1000 #Resistance of section EB\n",
- "Ieb = 50 #current in branch EB(A)\n",
- "Ide = Ieb+200 #current in branch DE(A)\n",
- "Icd = Ide+150 #current in branch CD(A)\n",
- "Iac = Icd+100 #current in branch AC(A)\n",
- "Vc = Va - Iac*Rac #P.D. at load point C(V)\n",
- "Vd = Vc - Icd*Rcd #P.D. at load point D(V)\n",
- "Ve = Vd - Ide*Rde #P.D. at load point E(V)\n",
- "Vb = Ve - Ieb*Reb #P.D. at load point B(V)\n",
- "\n",
- "#Result:\n",
- "print \"P.D. at load point C is\",Vc,\"V\"\n",
- "print \"P.D. at load point D is\",Vd,\"V\"\n",
- "print \"P.D. at load point E is\",Ve,\"V\"\n",
- "print \"P.D. at load point B is\",Vb,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "P.D. at load point C is 295.0 V\n",
- "P.D. at load point D is 291.0 V\n",
- "P.D. at load point E is 288.0 V\n",
- "P.D. at load point B is 287.6 V\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.2, Page number: 314"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "AB = 300 #m\n",
- "AC = 40 #m\n",
- "CD = 60 #m\n",
- "DE = 50 #m\n",
- "EF = 100 #m\n",
- "FB = 50 #m\n",
- "Vm = 10 #max. permissible volatge(V)\n",
- "rho = 1.78*10**-8 #resistivity of cable(ohm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Iac = 220 #A\n",
- "Icd = 190 #A\n",
- "Ide = 150 #A\n",
- "Ief = 50 #A\n",
- "#Suppose that resistance of 100m length of the distributor is r ohms.\n",
- "l = 100 #m\n",
- "r = symbols('r')\n",
- "Rac = AC*r/100 #ohm\n",
- "Rcd = CD*r/100 #ohm\n",
- "Rde = DE*r/100 #ohm\n",
- "Ref = EF*r/100 #ohm\n",
- "\n",
- "Vt = Iac*Rac+Icd*Rcd+Ide*Rde+Ief*Ref\n",
- "r1 = solve(Vt-Vm,r)[0]\n",
- "a = float(rho*l/(r1/2)) #cm**2\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"X-sectional area of conductor is\",round(a*10**4,3),\"cm**2\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "X-sectional area of conductor is 1.164 cm**2\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.3, Page number: 315"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable Declaration:\n",
- "r1 = 0.25 #resistance of trolley wire(ohm/km)\n",
- "r2 = 0.03 #resistance of of track(ohm/km)\n",
- "V = 600 #sub-station voltage(V)\n",
- "SA = 2 #km\n",
- "AB = 4 #km\n",
- "\n",
- "#Calculation:\n",
- "R = r1+r2 #ohm/km\n",
- "Isa = 40+20 #A\n",
- "Iab = 20 #A\n",
- "Vsa = Isa*R*SA #V\n",
- "Vab = Iab*R*AB #V\n",
- "Va = V-Vsa #Voltage across tram A\n",
- "Vb = Va-Vab #Voltage across tram A\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Voltage across tram A is\",Va,\"V\"\n",
- "print \"Voltage across tram B is\",Vb,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage across tram A is 566.4 V\n",
- "Voltage across tram B is 544.0 V\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.4, Page number: 315"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable Declaration:\n",
- "a = 0.27 #cross-sectional area of each conductor(cm**2)\n",
- "V = 250 #supply voltage at point A(V)\n",
- "rho = 1.78*10**-6 #Resistivity of the wire(ohm-cm)\n",
- "AB = 75 #m\n",
- "BC = 100 #m\n",
- "CD = 50 #m\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Icd = 20 #curent in CD(A)\n",
- "Ibc = 20+15 #current in BC(A)\n",
- "Iab = 20+15+12 #current in AB(A)\n",
- "R = round(rho*BC*100/a,3) #Single-core resistance of the section of 100 m length(ohm)\n",
- "Rab = R*AB/100*2 #ohm\n",
- "Rbc = R*BC/100*2 #ohm\n",
- "Rcd = R*CD/100*2 #ohm\n",
- "Vb = V-Iab*Rab #Voltage at tapping point B(V)\n",
- "Vc = Vb-Ibc*Rbc #Voltage at tapping point C(V)\n",
- "Vd = Vc-Icd*Rcd #Voltage at tapping point D(V)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i)The current in various sections of the conductor are:\"\n",
- "print \"\\tIcd =\",Icd,\"A \\tIbc =\",Ibc,\"A\\tIab =\",Iab,\"A\"\n",
- "print \"\\n(ii)The resistances of the various sections are :\"\n",
- "print \"\\tRab =\",Rab,\"ohm\\tRbc =\",Rbc,\"ohm\\t\",Rcd,\"ohm\"\n",
- "print \"\\n(iii)Voltage at tapping point B is\",round(Vb,2),\"V\"\n",
- "print \" Voltage at tapping point C is\",round(Vc,2),\"V\"\n",
- "print \" Voltage at tapping point D is\",round(Vd,2),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)The current in various sections of the conductor are:\n",
- "\tIcd = 20 A \tIbc = 35 A\tIab = 47 A\n",
- "\n",
- "(ii)The resistances of the various sections are :\n",
- "\tRab = 0.099 ohm\tRbc = 0.132 ohm\t0.066 ohm\n",
- "\n",
- "(iii)Voltage at tapping point B is 245.35 V\n",
- " Voltage at tapping point C is 240.73 V\n",
- " Voltage at tapping point D is 239.41 V\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.5, Page number: 317"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "i = 2 #A/m\n",
- "l = 200 #length of distributor(m)\n",
- "r1 = 0.3 #Resistance of single wire is 0\u00b73 ohm/km.\n",
- "x = 150 #m\n",
- "\n",
- "#Calculation:\n",
- "r = 2*r1/1000 #Resistance of distributor per metre run(ohm)\n",
- "V = i*r*(l*x-x**2/2) #volt\n",
- "I = i*l #Total current entering the distributor(A)\n",
- "R = r*l #Total resistance of the distributor(ohm)\n",
- "V1 = 1/2*I*R #Total drop over the distributor(V)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i)The voltage drop upto a distance of 150m from \"\n",
- "print \"\\tthe feeding point is\",V,\"V\"\n",
- "print \"(ii)The maximum voltage drop is\",V1,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)The voltage drop upto a distance of 150m from \n",
- "\tthe feeding point is 22.5 V\n",
- "(ii)The maximum voltage drop is 24.0 V\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.6, Page number: 317"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "i = 0.4 #A/m\n",
- "l = 500 #length of distributor(m)\n",
- "Vm = 10 #maximum permissible voltage drop(V)\n",
- "rho = 1.7*10**-6 #ohm-cm\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I = i*l #Current entering the distributor(A)\n",
- "#Let r ohm be the resistance per metre length of the distributor (both wires).\n",
- "r = 2*Vm/(I*l) #resistance per metre length(ohm)\n",
- "a = rho*100/(r/2) #Area of cross-section of the distributor conductor(ohm)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The cross-sectional area of the distributor conductor is\",a,\"cm**2\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The cross-sectional area of the distributor conductor is 1.7 cm**2\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.7, Page number: 318"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "i = 1.6 #A/m\n",
- "l = 250 #length of distributor(m)\n",
- "r1 = 0.0002 #Resistance of single wire is 0\u00b73 ohm/m.\n",
- "x = 150 #m\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I = i*l #Current entering the distributor(A)\n",
- "r = 2*r1 #Resistance of the distributor per metre run\n",
- "R = r*l #Total resistance of distributor(ohm)\n",
- "V1 = 1/2*I*R #Voltage drop over the entire distributor(ohm)\n",
- "#the voltage necessary at feed point to maintain 250 V at the far end\n",
- "V2 = V1+250 #Voltage at feeding point(V)\n",
- "#Voltage drop upto a distance of 150 metres from feeding point\n",
- "V3 = i*r*(l*125-125**2/2) #Volt\n",
- "##Voltage necessary to maintain 250V at the mid-point of the distributor.\n",
- "V4 = 250+V3\n",
- "\n",
- "#Result:\n",
- "print \"(i) Voltage drop over the entire distributor is\",V2,\"V\"\n",
- "print \"(ii)The necessary voltage is\",V4,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Voltage drop over the entire distributor is 270.0 V\n",
- "(ii)The necessary voltage is 265.0 V\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.9, Page number: 319"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "i = 0.75 #current loading(A/m)\n",
- "l = 300 #distributor length(m)\n",
- "x = 200 #m\n",
- "r = 0.00018 #resistance of distributor(go and return)(ohm/m)\n",
- "V = 250 #voltage fed at 1 end(V)\n",
- "\n",
- "#Calculation:\n",
- "V1 = i*r*(l*x-x**2/2) #Voltage drop(V)\n",
- "#Voltage at a distance of 200 m from supply end\n",
- "V2 = V-V1 #V\n",
- "P = i**2*r*l**3/3 #Power loss in the distributor(W)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Volatage at a distance of 200m is\",V2,\"V\"\n",
- "print \"Power loss in the distributor is\",P,\"W\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Volatage at a distance of 200m is 244.6 V\n",
- "Power loss in the distributor is 911.25 W\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.10, Page number: 321"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "AB = 600 #m\n",
- "Va = 220 #end voltage(V)\n",
- "a = 1 #cross-section of conductor(cm**2)\n",
- "rho = 1.7*10**-6 #resistvity of conductor(ohm-cm)\n",
- "\n",
- "#Calculation:\n",
- "\n",
- "#Let Ia amperes be the current supplied from the feeding\n",
- "#end A.\n",
- "r = 2*rho*100/a #ohm\n",
- "Rac = r*100 #ohm\n",
- "Rcd = r*150 #ohm\n",
- "Rde = r*150 #ohm\n",
- "Ref = r*100 #ohm\n",
- "Rfb = r*100 #ohm\n",
- "#Voltage at B = Voltage at A \u2212 Drop over length AB\n",
- "Ia = symbols('Ia')\n",
- "Ia1 = solve(Va-(Ia*Rac+(Ia-20)*Rcd+(Ia-60)*Rde+(Ia-110)*Ref+(Ia-140)*Rfb)-Va,Ia)[0]\n",
- "#We can see that currents are coming to load point E from \n",
- "#both sides i.e. from point D and point F. \n",
- "#So, E will be the point of minimum potential.\n",
- "\n",
- "Ve = Va-(61.7*Rac+41.7*Rcd+1.7*Rde) #Minimum consumer voltage(V)\n",
- "\n",
- "#Result:\n",
- "print \"Minimum consumer voltage is\",round(Ve,2),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Minimum consumer voltage is 215.69 V\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.11, Page number: 322"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "AB = 200 #m\n",
- "Va = 230 #1 end voltage(V)\n",
- "Vb = 235 #2 end voltage(V)\n",
- "r1 = 0.3 #The resistance per km of one conductor(ohm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let Ia amperes be the current supplied from the feeding\n",
- "#end A.\n",
- "r = 2*r1 #Resistance of 1000m length of distributor(both wires)\n",
- "Rac = r*50/1000 #ohm\n",
- "Rcd = r*25/1000 #ohm\n",
- "Rde = r*25/1000 #ohm\n",
- "Ref = r*50/1000 #ohm\n",
- "Rfb = r*50/1000 #ohm\n",
- "Ia = symbols('Ia')\n",
- "Ia1 = round(solve(Va-(Ia*Rac+(Ia-25)*Rcd+(Ia-75)*Rde+(Ia-105)*Ref+(Ia-145)*Rfb)-Vb,Ia)[0],2)\n",
- "Iac = Ia1 #Current in section AC(A)\n",
- "Icd = Ia1-25 #Current in section CD(A)\n",
- "Ide = Ia1-75 #Current in section DE(A)\n",
- "Ief = Ia1-105 #Current in section EF(A)\n",
- "Ifb = Ia1 -145 #Current in section FB(A)\n",
- "#The currents are coming to load point D from both sides of \n",
- "#the distributor. Therefore, load point D is the point of minimum potential.\n",
- "Vd = Va-(Iac*Rac+Icd*Rcd) #volt\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Currents in various sections of the distributor are:\"\n",
- "print \"\\tCurrent in section AC is\",Iac,\"A\"\n",
- "print \"\\tCurrent in section AC is\",Icd,\"A\"\n",
- "print \"\\tCurrent in section AC is\",Ide,\"A\"\n",
- "print \"\\tCurrent in section AC is\",Ief,\"A\"\n",
- "print \"\\tCurrent in section AC is\",Ifb,\"A\"\n",
- "print \"\\n(ii)Voltage at D is\",round(Vd,3),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Currents in various sections of the distributor are:\n",
- "\tCurrent in section AC is 33.33 A\n",
- "\tCurrent in section AC is 8.33 A\n",
- "\tCurrent in section AC is -41.67 A\n",
- "\tCurrent in section AC is -71.67 A\n",
- "\tCurrent in section AC is -111.67 A\n",
- "\n",
- "(ii)Voltage at D is 228.875 V\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.12, Page number: 323"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "AB = 600 #m\n",
- "Va = 440 #1 end voltage(V)\n",
- "Vb = 430 #2 end voltage(V)\n",
- "r1 = 0.01 #The resistance per 100m of one conductor(ohm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let Ia amperes be the current supplied from the feeding\n",
- "#end A.\n",
- "r = 2*r1 #Resistance of 1000m length of distributor(both wires)\n",
- "Rac = r*150/100 #ohm\n",
- "Rcd = r*150/100 #ohm\n",
- "Rde = r*50/100 #ohm\n",
- "Ref = r*100/100 #ohm\n",
- "Rfb = r*150/100 #ohm\n",
- "Ia = symbols('Ia')\n",
- "Ia1 = round(solve(Va-(Ia*Rac+(Ia-100)*Rcd+(Ia-300)*Rde+(Ia-550)*Ref+(Ia-850)*Rfb)-Vb,Ia)[0],2)\n",
- "Iac = Ia1 #Current in section AC(A)\n",
- "Icd = Ia1-100 #Current in section CD(A)\n",
- "Ide = Ia1-300 #Current in section DE(A)\n",
- "Ief = Ia1-550 #Current in section EF(A)\n",
- "Ifb = Ia1-850 #Current in section FB(A)\n",
- "Pl = Iac**2*Rac+Icd**2*Rcd+Ide**2*Rde+Ief**2*Ref+Ifb**2*Rfb #power loss(W)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The currents supplied from A to B are:\\n\\tIa =\",Ia1,\"A\\tIb =\",abs(Ifb),\"A\" \n",
- "print \"(ii) The power dissipated in the distributor is\",round(Pl/1000,3),\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The currents supplied from A to B are:\n",
- "\tIa = 437.5 A\tIb = 412.5 A\n",
- "(ii) The power dissipated in the distributor is 14.706 kW\n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.13, Page number: 325"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "Va = 600 #V\n",
- "Vb = 590 #V\n",
- "r = 0.04 #track resistance of go and return path(ohm/km)\n",
- "AB = 6 #distance b/w the sub-stations(km)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let min. potential occurs at point M at a distance x km from the substation A.\n",
- "\n",
- "\n",
- "Ia,x = symbols('Ia x') #Ia is current supplied by the sub-station A\n",
- "Ram = r*x #Track resistance for section AM(ohm)\n",
- "Rmb = r*(AB-x) #Track resistance for section MB(ohm)\n",
- "Vm = Va-Ia*Ram #Potential at M(V) ...(i)\n",
- "Vm1 = Vb-(300-Ia)*Rmb #also,Potential at M(V) ...(ii)\n",
- "\n",
- "#from (i) & (ii):\n",
- "Ia = 341.7-50*x\n",
- "Vm = Va-(341.7 - 50*x)*0.04*x\n",
- "Vm2 = diff(Vm,x)\n",
- "x1 = round(solve(Vm2,x)[0],2)\n",
- "Ia1 = 341.7-50*x1 #A\n",
- "Ib = 300-Ia1 #A\n",
- "\n",
- "#Result:\n",
- "print \"(i) The point along the track where minimum potential occurs is\",x1,\"km\"\n",
- "print \"(ii)Current supplied by sub-ation A is\",Ia1,\"A\"\n",
- "print \" Current supplied by sub-station B is\",Ib,\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The point along the track where minimum potential occurs is 3.42 km\n",
- "(ii)Current supplied by sub-ation A is 170.7 A\n",
- " Current supplied by sub-station B is 129.3 A\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.14, Page number: 327"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "i = 0.5 #current loading(A/m)\n",
- "l = 1000 #cable length(m)\n",
- "V = 220 #end voltages(V)\n",
- "r1 = 0.05 #Resistance of each of 2 conductors(ohm/km)\n",
- "\n",
- "#Calculation:\n",
- "r = 2*r1/1000 #ohm/m\n",
- "I = i*l #A\n",
- "R = r*l #ohm\n",
- "Vm = I*R/8 #Max. voltage drop(V)\n",
- "#Minimum voltage will occur at the mid-point of the distributor & its value is\n",
- "Vmin = V-Vm #V\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The maximum voltage drop is\",Vm,\"V\"\n",
- "print \"The minimum voltage is\",Vmin,\"V at the midpoint of the distributor.\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The maximum voltage drop is 6.25 V\n",
- "The minimum voltage is 213.75 V at the midpoint of the distributor.\n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.15, Page number: 327"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "Va = 255 #Voltage at feeding point A(V)\n",
- "Vb = 250 #Voltage at feeding point B(V)\n",
- "l = 500 #Length of distributor(m)\n",
- "i = 1 #Current loading(A/m)\n",
- "r1 = 0.1 #resistance of each conductor(ohm/km)\n",
- "\n",
- "#Calculation:\n",
- "r = 2*r1/1000\n",
- "#(i) Let the minimum potential occur at a point C distant x \n",
- "# metres from the feeding point A.\n",
- "\n",
- "x = (Va-Vb)/(i*r*l)+l/2 #m\n",
- "Vc = Va-i*r*x**2/2 #minimum voltage(V)\n",
- "\n",
- "\n",
- "#(ii)\n",
- "ia = i*x #Current supplied from A(A)\n",
- "ib = i*(l-x) #Current supplied from B(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The minimum voltage is\",Vc,\"V at\",x,\"m from point A\"\n",
- "print \"(ii)Current supplied from A is\",ia,\"A\"\n",
- "print \" Current supplied from B is\",ib,\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The minimum voltage is 246.0 V at 300.0 m from point A\n",
- "(ii)Current supplied from A is 300.0 A\n",
- " Current supplied from B is 200.0 A\n"
- ]
- }
- ],
- "prompt_number": 21
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.16, Page number: 328"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "l = 800 #Length of distributor(m)\n",
- "i = 1.25 #Current loading(A/m)\n",
- "r1 = 0.05 #resistance of each conductor(ohm/km)\n",
- "Vc = 220 #minimum voltage(V)\n",
- "x = 450 #Distance of point C from A(m)\n",
- "\n",
- "#Calculation:\n",
- "r = 2*r1/1000\n",
- "Vac = i*r*x**2/2 #Voltage drop in section AC(V)\n",
- "Va = Vac+Vc #Voltage at feeding point A(V)\n",
- "Vbc = i*r*(l-x)**2/2 #Voltage drop in section BC(V)\n",
- "Vb = Vc+Vbc #Voltage at feeding point B(V)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Voltage at feeding point A is\",round(Va,2),\"V\"\n",
- "print \"Voltage at feeding point B is\",round(Vb,2),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage at feeding point A is 232.66 V\n",
- "Voltage at feeding point B is 227.66 V\n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.17, Page number: 329"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "i = 1.25 #current loading (A/m)\n",
- "l = 1000 #length of distributor(m)\n",
- "r1 = 0.05 #resistance of each conductor(ohm/km)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I = i*l #Total current fed to the distributor(A)\n",
- "R = r*l #Total resistance of the distributor(ohm)\n",
- "V = I*R/8 #Max. voltage drop(V)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Maximum voltage drop in the distributor is\",round(V,2),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum voltage drop in the distributor is 15.63 V\n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.19, Page number: 330"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "l = 900 #distributor length(m)\n",
- "Va = 400 #voltage fed at a A(V)\n",
- "i = 0.5 #current loading(A/m)\n",
- "r = 0.0001 #resistance of distributor per m (go and return)(ohm)\n",
- "x = 500 #length AD(m)\n",
- "\n",
- "#Calculation:\n",
- "#Drops due to concentrated loads.\n",
- "Iac = 300 #A\n",
- "Icd = 250 #A\n",
- "Ide = 150 #A\n",
- "Vac = Iac*200*r #Drop in section AC(V)\n",
- "Vcd = Icd*300*r #Drop in section CD(V)\n",
- "Vde = Ide*300*r #Drop in section DE(V)\n",
- "Vab1 = Vac+Vcd+Vde #Total drop over AB(V)\n",
- "\n",
- "\n",
- "#Drops due to uniform loading:\n",
- "Vab2 = i*r*l**2/2 #V\n",
- "Vad = i*r*(l*x-x**2/2) #V\n",
- "Vb = Va-(Vab1+Vab2) #V\n",
- "Vd = Va-(Vac+Vcd+Vad) #V\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Voltage at point B is\",Vb,\"V\"\n",
- "print \"(ii)Voltage at point D is\",Vd,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Voltage at point B is 361.75 V\n",
- "(ii)Voltage at point D is 370.25 V\n"
- ]
- }
- ],
- "prompt_number": 24
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.20, Page number: 331"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "r = 0.1*10**-3 #Distributor resistance per metre length\n",
- "i = 0.5 #uniform current loading(A/m)\n",
- "Va = 240 #end voltage at A(V)\n",
- "Vb = 240 #end voltage at B(V)\n",
- "l = 1000 #length of distributor(m)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#(i) Point of minimum potential:\n",
- "#We know that, the point of minimum potential is not affected\n",
- "#by the uniform loading of the distributor. \n",
- "#Considering the concentrated loads first as shown below:\n",
- "\n",
- "I = symbols('I')\n",
- "Iac = I\n",
- "Icd = I-120\n",
- "Ide = I-180\n",
- "Ief = I-280\n",
- "Ifb = I-320\n",
- "I1 = solve((Iac*200+Icd*200+Ide*300+Ief*200+Ifb*100)*10**-4-Va+Vb,I)[0]\n",
- "\n",
- "#Showing the current distributions, we can see that D is \n",
- "#the point of minimum potential.\n",
- "\n",
- "#(ii) The feeding point A will supply I1 A due to concentrated\n",
- "# loading plus 0\u00b75 \u00d7 400 = 200 A due to uniform loading.\n",
- "\n",
- "Ia = I1+200 #Current supplied by A(A)\n",
- "\n",
- "#The feeding point B will supply a current of 154 A due to \n",
- "#concentrated loading plus 0\u00b75 \u00d7 600 = 300 A due to uniform loading.\n",
- "\n",
- "Ib = 320-I1+300 #Current supplied byB(A)\n",
- "\n",
- "\n",
- "\n",
- "#(iii) We got that D is the point of minimum potential.\n",
- "Iac = I1; Icd = I1-120 #ampere\n",
- "Vad1 = Iac*200*10**-4+Icd*200*10**-4 #Drop in AD due to conc. loading(V)\n",
- "AD = 400 #for uniform loading(V)\n",
- "Vad2 = i*r*AD**2/2 #Drop in AD due to uniform. loading(V)\n",
- "Vd = 240-Vad1-Vad2 #Minimum potential(V)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The point of minimum potential is D\"\n",
- "print \"(ii) Current supplied by A is\",round(Ia),\"A\"\n",
- "print \" Current supplied by B is\",round(Ib),\"A\"\n",
- "print \"(iii)The value of minimum potential is\",round(Vd,2),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The point of minimum potential is D\n",
- "(ii) Current supplied by A is 366.0 A\n",
- " Current supplied by B is 454.0 A\n",
- "(iii)The value of minimum potential is 231.76 V\n"
- ]
- }
- ],
- "prompt_number": 25
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.21, Page number: 332"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "l = 500 #distributor length(m)\n",
- "Va = 240 #voltage at end A(V)\n",
- "Vb = 240 #voltage at end B(V)\n",
- "R = 0.001 #resistance of the distributor(ohm/m)\n",
- "i = 1 #current loading(A/m)\n",
- "\n",
- "#Calculation:\n",
- "#Let D be the point of minimum potential\n",
- "x = symbols('x') #x is current flowing in section CD(A)\n",
- "\n",
- "#(i) If r is the resistance of the distributor (go and return)\n",
- "#per metre,\n",
- "r = symbols('r')\n",
- "Vad = (100+x)*100*r+x*150*r #Voltage drop in length AD\n",
- "Vbd = 1*r*200**2/2+(60-x)*250*r #Voltage drop in length BD\n",
- "x1 = solve(Vad-Vbd,x)[0] #A\n",
- "\n",
- "#(ii)\n",
- "I = 60+1*200 #Total current(A)\n",
- "Ia = 100+x1 #Current supplied by A(A)\n",
- "Ib = 360-150 #Current supplied by B(V)\n",
- "Vd = Va - Ia*100*0.001-50*150*0.001 #Minimum potential(V)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The point of minimum voltage is D.\"\n",
- "print \"(ii)The value of minimum voltage is\",round(Vd,1),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The point of minimum voltage is D.\n",
- "(ii)The value of minimum voltage is 217.5 V\n"
- ]
- }
- ],
- "prompt_number": 26
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.22, Page number: 334"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "l = 300 #distributor length(m)\n",
- "r1 = 0.03/100 #resistance of single conductor(ohm/m)\n",
- "Va = 240 #volt\n",
- "\n",
- "#Calculation:\n",
- "r = 2*r1 #resistance of both wires(ohm/m)\n",
- "Rab = r*150 #ohm\n",
- "Rbc = r*50 #ohm\n",
- "Rca = r*100 #ohm\n",
- "#suppose a current IA flows in section AB of the distributor.\n",
- "#currents in sections BC and CA will be (Ia \u2212 120) & (Ia \u2212 200)\n",
- "Ia = symbols('Ia')\n",
- "Ia1 = solve(0.09*Ia+0.03*(Ia-120)+0.06*(Ia-200),Ia)[0]\n",
- "\n",
- "#The actual distribution of currents ca be drawn easily\n",
- "#from where it is seen that B is the point of min. potential.\n",
- "Iab = Ia1 #Current in section AB(A)\n",
- "Ibc = Ia1-120 #Current in section BC(A)\n",
- "Ica = Ia1-200 #current in section CA(A)\n",
- "Vb = Va-Iab*Rab #Voltage at point B(V)\n",
- "Vc = Vb-Ibc*Rbc #Voltage at point C(V)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Current in section AB is\",round(Iab,2),\"A from A to B\"\n",
- "print \" Current in section BC is\",round(abs(Ibc),2),\"A from C to B\"\n",
- "print \" Current in section ca is\",round(abs(Ica),2),\"A from A to C\"\n",
- "print \"(ii)Voltage at point B is\",round(Vb,1),\"V\"\n",
- "print \" Voltage at point C is\",round(Vc,1),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Current in section AB is 86.67 A from A to B\n",
- " Current in section BC is 33.33 A from C to B\n",
- " Current in section ca is 113.33 A from A to C\n",
- "(ii)Voltage at point B is 232.2 V\n",
- " Voltage at point C is 233.2 V\n"
- ]
- }
- ],
- "prompt_number": 27
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.23, Page number: 335"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "Va = 220 #voltage at point A(V)\n",
- "Rab = 0.1 #ohm\n",
- "Rbc = 0.05 #ohm\n",
- "Rcd = 0.01 #ohm\n",
- "Rde = 0.025 #ohm\n",
- "Rea = 0.075 #ohm\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#(i)\n",
- "I1 = solve(0.1*I+0.05*(I-10)+0.01*(I-30)+0.025*(I-60)+0.075*(I-70),I)[0]\n",
- "\n",
- "#(ii)\n",
- "Iab = I1 #A\n",
- "Ibc = I1-10 #A\n",
- "Icd = I1-30 #A\n",
- "Ide = I1-60 #A\n",
- "Iea = I1-70 #A\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) C is the point of minimum potential.\"\n",
- "print \"(ii)Current in section AB is\",round(Iab,2),\"A from A to B\"\n",
- "print \" Current in section BC is\",round(Ibc,2),\"A from B to C\"\n",
- "print \" Current in section CD is\",round(abs(Icd),2),\"A from D to C\"\n",
- "print \" Current in section DE is\",round(abs(Ide),2),\"A from E to D\"\n",
- "print \" Current in section EA is\",round(abs(Iea),2),\"A from A to E\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) C is the point of minimum potential.\n",
- "(ii)Current in section AB is 29.04 A from A to B\n",
- " Current in section BC is 19.04 A from B to C\n",
- " Current in section CD is 0.96 A from D to C\n",
- " Current in section DE is 30.96 A from E to D\n",
- " Current in section EA is 40.96 A from A to E\n"
- ]
- }
- ],
- "prompt_number": 28
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.24, Page number: 336"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "Rab = 0.02 #ohm\n",
- "Rbc = 0.018 #ohm\n",
- "Rcd = 0.025 #ohm\n",
- "Rda = 0.02 #ohm\n",
- "Va = 250 #voltage ate point A(V)\n",
- "\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I = symbols('I')\n",
- "I1 = solve(0.02*I+0.018*(I-150)+0.025*(I-450)+0.02*(I-700),I)[0]\n",
- "Vab = 336.75*0.02 #V\n",
- "Vbc = 186.75*0.018 #V\n",
- "Vcd = 113.25*0.025 #V\n",
- "Vda = 363.25*0.02 #V\n",
- "Vb = Va-Vab #V\n",
- "Vc = Vb-Vbc #V\n",
- "Vd = Vc+Vcd #V\n",
- "\n",
- "#With interconnector\n",
- "Eo = Va-Vc #Voltage between points A and C(V)\n",
- "Ro = (Rab+Rbc)*(Rcd+Rda)/((Rab+Rbc)+(Rcd+Rda)) #Resistance viewed from points A & C(ohm)\n",
- "Rac = 0.02 #Resistance of interconnector(ohm)\n",
- "Iac = Eo/(Ro+Rac) #Current in interconnector AC(A)\n",
- "\n",
- "#Let ABCD be the ring distribution system.\n",
- "#Let the current in section AB is I1. Then,\n",
- "#current in section BC will be I1 \u2212 150. \n",
- "#As the voltage drop round the closed mesh ABCA is zero.\n",
- "I11 = symbols('I11')\n",
- "I2 = solve(0.02*I11+0.018*(I11-150)-0.02*252.4,I11)[0]\n",
- "\n",
- "Vab1 = I2*0.02 #V\n",
- "Vbc1 = 53.15*0.018 #V\n",
- "Vad1 = 244.45*0.02 #V\n",
- "Vb1 = Va-Vab1 #V\n",
- "Vc1 = Vb1-Vbc1 #V\n",
- "Vd1 = Va-Vad1 #V\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Before adding interconnector,\"\n",
- "print \"\\tVoltage at point B is\",Vb,\"V\"\n",
- "print \"\\tVoltage at point C is\",round(Vc,3),\"V\"\n",
- "print \"\\tVoltage at point D is\",round(Vd,3),\"V\"\n",
- "print \"After adding interconnector,\"\n",
- "print \"\\tPotential of B is\",round(Vb1,2),\"V\"\n",
- "print \"\\tPotential of C is\",round(Vc1,2),\"V\"\n",
- "print \"\\tPotential of D is\",round(Vd1,2),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Before adding interconnector,\n",
- "\tVoltage at point B is 243.265 V\n",
- "\tVoltage at point C is 239.903 V\n",
- "\tVoltage at point D is 242.735 V\n",
- "After adding interconnector,\n",
- "\tPotential of B is 245.92 V\n",
- "\tPotential of C is 244.97 V\n",
- "\tPotential of D is 245.11 V\n"
- ]
- }
- ],
- "prompt_number": 29
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.25, Page number: 338"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable Declaration:\n",
- "Rbd = 0.05 #resistance of interconnector(ohm)\n",
- "Rab = 0.075 #resistance of branch AB(ohm)\n",
- "Rbc = 0.025 #resistance of branch BC(ohm)\n",
- "Rcd = 0.01 #resistance of branch CD(ohm)\n",
- "Rde = 0.05 #resistance of branch DE(ohm)\n",
- "Rea = 0.1 #resistance of branch EA(ohm)\n",
- "\n",
- "#Calculation:\n",
- "#Let ABCDE be the ring distribution system.\n",
- "#When interconnector BD is removed, let the current in branch \n",
- "#AB be I.\n",
- "# Current in BC = I-10;\n",
- "# Current in CD = I-40;\n",
- "# Current in DE = I-60;\n",
- "# Current in EA = I-70;\n",
- "\n",
- "\n",
- "#As the total drop round the ring ABCDEA is zero.\n",
- "I = symbols('I')\n",
- "\n",
- "I1 = solve(Rab*I+Rbc*(I-10)+Rcd*(I-40)+Rde*(I-60)+Rea*(I-70),I)[0]\n",
- "\n",
- "#The actual distribution of currents will be as shown in Fig.(ii) above.\n",
- "Vbcd = 30.96*0.025+0.96*0.01 #V\n",
- "Eo = 0.7836 #V\n",
- "Ro = (0.075+0.1+0.05)*(0.025+0.01)/((0.075+0.1+0.05)+(0.025+0.01))\n",
- "\n",
- "#(i)\n",
- "Ibd = Eo/(Ro+Rbd) #A\n",
- "Vbd = Ibd*0.05 #V\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Current in interconnector BD is\",round(Ibd,1),\"A\"\n",
- "print \"(ii)Voltage drop along interconnector BD is\",round(Vbd,2),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Current in interconnector BD is 9.8 A\n",
- "(ii)Voltage drop along interconnector BD is 0.49 A\n"
- ]
- }
- ],
- "prompt_number": 30
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.26, Page number: 341"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "I1 = 50 #current on +ve side(A)\n",
- "I2 = 40 #current on -ve side(A)\n",
- "Rae = 0.1 #resistance of outer wire(ohm)\n",
- "Rbg = 0.1 \n",
- "Vab = 500 #V\n",
- "Van = 250 #V\n",
- "Vbn = 250 #V\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I3 = I1-I2 #current in the neutral wire(A)\n",
- "Rnl = 2*Rae #resistance of neutral wire(ohm)\n",
- "Vel = Van-I1*Rae-(I1-I2)*Rnl #V\n",
- "Vlg = Vbn+(I1-I2)*Rnl-I2*Rbg #V\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Voltage at the load end on the positive side is\",Vel,\"V\"\n",
- "print \"Voltage at the load end on the negative side is\",Vlg,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage at the load end on the positive side is 243.0 V\n",
- "Voltage at the load end on the negative side is 248.0 V\n"
- ]
- }
- ],
- "prompt_number": 31
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.27, Page number: 342"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Vairable declaration:\n",
- "r = 0.1 #resistance of each conductor(ohm)\n",
- "Rel = 5 #ohm\n",
- "Rcl = 6 #ohm\n",
- "Vel = 240 #line to neutral voltage(V)\n",
- "Vlc = 240 #line to neutral voltage(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I1 = Vel/5 #Current on +ve outer(A)\n",
- "I2 = Vlc/6 #Current on \u2212ve outer(A)\n",
- "In = I1-I2 #current in neutral(A)\n",
- "V1 = Vel+I1*r+(I1-I2)*r #V\n",
- "V2 = Vlc-(I1-I2)*r+I2*r #V\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Voltage between +ve outer and neutral at feeding end is\",V1,\"V\"\n",
- "print \"Voltage between -ve outer and neutral at feeding end is\",V2,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage between +ve outer and neutral at feeding end is 245.6 V\n",
- "Voltage between -ve outer and neutral at feeding end is 243.2 V\n"
- ]
- }
- ],
- "prompt_number": 32
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.28, Page number: 343"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "V = 250 #voltage on the two sides of the middle wire(V)\n",
- "P1 = 35 #power of load 1(kW)\n",
- "P2 = 20 #power of load 2(kW)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R1 = V**2/(P1*1000) #resistance of load 1(ohm)\n",
- "R2 = V**2/(P2*1000) #resistance of load 2(ohm)\n",
- "#After breaking of neutral wire,\n",
- "I = 2*V/(R1+R2) #Circuit current(A)\n",
- "V1 = I*R1 #V\n",
- "V2 = I*R2 #V\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Voltage across +ve outer and middle wire is\",round(V1,1),\"V\"\n",
- "print \"Voltage across -ve outer and middle wire is\",round(V2,1),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage across +ve outer and middle wire is 181.8 V\n",
- "Voltage across -ve outer and middle wire is 318.2 V\n"
- ]
- }
- ],
- "prompt_number": 33
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.29, Page number: 343"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Calculation:\n",
- "Vck = 250-0.75-0.28+0.2 #V\n",
- "Vdm = Vck-0.3-0.18+0.084 #V\n",
- "Vjg = 250-0.2-1.2 #V\n",
- "Vlh = Vjg+0.28-0.084-0.864 #V\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Voltage across load CK is\",Vck,\"V\"\n",
- "print \"Voltage across load DM is\",Vdm,\"V\"\n",
- "print \"Voltage across load JG is\",Vjg,\"V\"\n",
- "print \"Voltage across load LH is\",Vlh,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage across load CK is 249.17 V\n",
- "Voltage across load DM is 248.774 V\n",
- "Voltage across load JG is 248.6 V\n",
- "Voltage across load LH is 247.932 V\n"
- ]
- }
- ],
- "prompt_number": 43
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.30, Page number: 344"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "Vab = 500 #volts\n",
- "Van = 250 #volts\n",
- "Vnb = 250 #volts\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Voltage across CK = 250 \u2212 Drop in AC \u2212 Drop in KJ \u2212 Drop in JN\n",
- "Vck = Van-4-0.5-0.1 #volts\n",
- "\n",
- "#Voltage across DM = 245\u00b74 \u2212 Drop in CD \u2212 Drop in ML + Drop in KL\n",
- "Vdm = Vck-1.28-0.5+0.42 #volts\n",
- "\n",
- "#Voltage across JG = 250 + Drop in JN \u2212 Drop in GB\n",
- "Vjg = Van+0.1-1.9 #volts\n",
- "\n",
- "#Voltage across LH = 248\u00b72 + Drop in KJ \u2212 Drop in KL \u2212 Drop in HG\n",
- "Vlh = Vjg+0.5-0.42-2.4 #volts\n",
- "\n",
- "#Voltage across PF = 245\u00b788 + Drop in ML \u2212 Drop in MP \u2212 Drop in FH\n",
- "Vpf = Vlh+0.5-0.72-1.02 #volts\n",
- "\n",
- "#Result:\n",
- "print \"Voltage across CK is\",Vck,\"V\"\n",
- "print \"Voltage across DM is\",Vdm,\"V\"\n",
- "print \"Voltage across JG is\",Vjg,\"V\"\n",
- "print \"Voltage across LH is\",Vlh,\"V\"\n",
- "print \"Voltage across PF is\",Vpf,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage across CK is 245.4 V\n",
- "Voltage across DM is 244.04 V\n",
- "Voltage across JG is 248.2 V\n",
- "Voltage across LH is 245.88 V\n",
- "Voltage across PF is 244.64 V\n"
- ]
- }
- ],
- "prompt_number": 42
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.31, Page number: 346"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "Vel = 240 #volt\n",
- "Vlc = 240 #volt\n",
- "Rel = 4 #ohm\n",
- "Rlc = 6 #ohm\n",
- "r = 0.15 #resistance of each conductor(ohm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I1 = Vel/Rel #Current in the positive outer(A)\n",
- "I2 = Vlc/Rlc #current in the negative outer(A)\n",
- "In = I1-I2 #current in the neutral wire(ohm)\n",
- "V1 = Vel+I1*r+In*r #Voltage between +ve outer and neutral at feeding point(V)\n",
- "V2 = Vlc-In*r+I2*r #Voltage between -ve outer and neutral at feeding point(V)\n",
- "\n",
- "\n",
- "#(i)When neutral breaks,\n",
- "#When there is a break in the neutral, the system\n",
- "#is equivalent to 2- wire d.c. system.Now,\n",
- "R1 = Rel+Rlc+2*r #ohm\n",
- "Vt1 = V1+V2 #voltage at the feeding end(V)\n",
- "I11 = Vt1/R1 #Load current(A)\n",
- "Vl1 = I11*Rel #Voltage across 4 ohm resistance(V)\n",
- "Vl2 = I11*Rlc #voltage across 6 ohm resistance(V)\n",
- "\n",
- "\n",
- "#(ii) When +ve outer breaks,\n",
- "#When there is a break in the +ve outer, there will be\n",
- "#no current in 4 ohm load.\n",
- "R2 = Rlc+2*r #Total circuit resistance(ohm)\n",
- "Vt2 = V2 #volt\n",
- "I22 = Vt2/R2 #load current(A)\n",
- "VR2 = I22*Rlc #volt\n",
- "\n",
- "\n",
- "#(iii)When \u2212ve outer breaks,\n",
- "#When there is a break in the negative outer, there will be no\n",
- "#current in 6 \u03a9 load.\n",
- "R3 = 4+2*r #Total circuit resistance(ohm)\n",
- "Vt3 = V1 #volt\n",
- "I33 = Vt3/R3 #load current(A)\n",
- "VR3 = I33*Rel #volt\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"When there is a break in the:\"\n",
- "print \"(i) neutral wire, current is\",round(I11,2),\"A\" \n",
- "print \" & voltage is\",round(Vl1,2),\"V and\",round(Vl2,2),\"V\"\n",
- "print \" across 6 ohm & 4 ohm loads respectively.\"\n",
- "print \"(ii) positive outer, current is\",round(I22,2),\"A\"\n",
- "print \" and voltage is\",round(VR2,2),\"V\"\n",
- "print \"(iii)negative outer, current is\",round(I33,2),\"A\"\n",
- "print \" and voltage is\",round(VR3,2),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "When there is a break in the:\n",
- "(i) neutral wire, current is 48.06 A\n",
- " & voltage is 192.23 V and 288.35 V\n",
- " across 6 ohm & 4 ohm loads respectively.\n",
- "(ii) positive outer, current is 38.57 A\n",
- " and voltage is 231.43 V\n",
- "(iii)negative outer, current is 58.6 A\n",
- " and voltage is 234.42 V\n"
- ]
- }
- ],
- "prompt_number": 36
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.32, Page number: 348"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable Declaration:\n",
- "V = 500 #voltage b/w the outer supplies(V)\n",
- "P1 = 1500 #load(kW)\n",
- "P2 = 2000 #load(kW)\n",
- "Vn = 250 #outer to neutral voltage(V)\n",
- "\n",
- "#Calculation:\n",
- "I1 = P1*1000/Vn #Load current on +ve outer(A)\n",
- "I2 = P2*1000/Vn #Load current on -ve outer(A)\n",
- "In = I2-I1 #A\n",
- "Pl = P1+P2 #kW\n",
- "Ig = Pl*1000/V #Current supplied by main generator(A)\n",
- "Ia = Ig-I1 #A\n",
- "Ib = I2-Ig #A\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Current in the neutral is\",In,\"A\"\n",
- "print \"(ii) total current supplied by main generator is\",Ig,\"A\"\n",
- "print \"(iii)Current in machine A is\",Ia,\"A\"\n",
- "print \" Current in machine B\",Ib,\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Current in the neutral is 2000.0 A\n",
- "(ii) total current supplied by main generator is 7000.0 A\n",
- "(iii)Current in machine A is 1000.0 A\n",
- " Current in machine B 1000.0 A\n"
- ]
- }
- ],
- "prompt_number": 37
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.33, Page number: 349"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "V = 500 #volt\n",
- "Vn = 250 #volt\n",
- "P1 = 150 #load(kW)\n",
- "P2 = 100 #load(kW)\n",
- "Pl = 3 #loss in each balancer machine(kW)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Pt = P1+P2+2*Pl #Total load on the main generator(kW)\n",
- "Ig = Pt*1000/V #Current supplied by the main generator(A)\n",
- "I1 = P1*1000/Vn #Load current on +ve side(A)\n",
- "I2 = P2*1000/Vn #Load current on -ve side(A)\n",
- "In = I1-I2 #Current in neutral wire(A)\n",
- "Ia = I1-Ig #Current through machine A(A)\n",
- "Ib = Ig-I2 #Current through machine B(A)\n",
- "Pa = Ia*Vn/1000 #Load on machine A(kW)\n",
- "Pb = Ib*Vn/1000 #Load on machine B(kW)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Total load on the main generator is\",Pt,\"kW\"\n",
- "print \"(ii)Load on machine A is\",Pa,\"kW\"\n",
- "print \" Load on machine B is\",Pb,\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Total load on the main generator is 256 kW\n",
- "(ii)Load on machine A is 22.0 kW\n",
- " Load on machine B is 28.0 kW\n"
- ]
- }
- ],
- "prompt_number": 38
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.34, Page number: 350"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "I1 = 1200 #current on +ve side(A)\n",
- "I2 = 1000 #current on -ve side(A)\n",
- "Pm = 200 #motor load acoss outer(kW)\n",
- "Pl = 5 #loss in balancer machine(kW)\n",
- "V = 500 #voltage across the outers(V)\n",
- "Vn = 250 #voltage across the outer and the neutral(V)\n",
- "\n",
- "#Calculation:\n",
- "#Since the positive side is more heavily loaded, \n",
- "#so, machine A acts as a generator and machine B as a motor.\n",
- "P1 = Vn*I1/1000 #Load on +ve side(kW)\n",
- "P2 = Vn*I2/1000 #Load on -ve side(kW)\n",
- "P3 = 200 #load on outers(kW)\n",
- "Pt = P1+P2+P3+2*Pl #total load(kW)\n",
- "Ig = Pt*1000/500 #Current of main generator(A)\n",
- "In = I1-I2 #Current in neutral(A)\n",
- "Ia = 1600-Ig #Current through machine A(A)\n",
- "Ib = Ig-1400 #Current through machine B(A)\n",
- "Pa = Vn*Ia/1000 #Load on machine A(kW)\n",
- "Pb = Vn*Ib/1000 #Load on machine B(kW)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Current of the main generator is\",Ig,\"A\"\n",
- "print \"(ii)Load on balancer machines: Pa =\",Pa,\"kW & Pb =\",Pb,\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Current of the main generator is 1520.0 A\n",
- "(ii)Load on balancer machines: Pa = 20.0 kW & Pb = 30.0 kW\n"
- ]
- }
- ],
- "prompt_number": 39
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.35, Page number: 350"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "Ipos = 800 #current on on the positive side(A)\n",
- "Ineg = 550 #current on the negative side(A)\n",
- "I = 1500 #curent across the outers(A)\n",
- "Ra = 0.2 #resistance of each arotary balancer's armature(ohm)\n",
- "Io = 5 #no load current(A)\n",
- "Vn = 500 #supply voltage\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I1 = Ipos+I #Total current on +ve side(A)\n",
- "I2 = Ineg+I #Total current on \u2212ve side(A)\n",
- "In = Ipos-Ineg #Current in neutral wire(A)\n",
- "\n",
- "#Let the current through machines A and B be Ia and Ib \n",
- "Ib = symbols('Ib')\n",
- "Ia = In-Ib\n",
- "#Each machine has same value of back e.m.f. E as their field\n",
- "#currents & speeds are the same.\n",
- "E = Vn/2-Ra*Io #Back e.m.f(V)\n",
- "Va = E-Ia*Ra #Terminal p.d. across A(V)\n",
- "Vb = E+Ib*Ra #Terminal p.d. across B(V)\n",
- "Ib1 = round(solve(Va*Ia+Vn*Io+Ia**2*Ra+Ib**2*Ra-Vb*Ib,Ib)[0])\n",
- "Ia1 = In-Ib1\n",
- "Va1 = E-Ia1*Ra\n",
- "Vb1 = E+Ib1*Ra\n",
- "Ig = 2300-Ia1 #Load on main generator(A)\n",
- "\n",
- "#Result:\n",
- "print \"(i)Current loading of each balancer machine: Ia =\",Ia1,\"A & Ib =\",Ib1,\"A\"\n",
- "print \"(ii)Voltage across machine A is\",Va1,\"V\"\n",
- "print \" Voltage across machine B is\",Vb1,\"V\"\n",
- "print \"(iii)Load on main generator is\",Ig,\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)Current loading of each balancer machine: Ia = 120.0 A & Ib = 130.0 A\n",
- "(ii)Voltage across machine A is 225.0 V\n",
- " Voltage across machine B is 275.0 V\n",
- "(iii)Load on main generator is 2180.0 A\n"
- ]
- }
- ],
- "prompt_number": 40
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 13.36, Page number: 352"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "V = 500 #voltage at supply end(v)\n",
- "l = 3 #line length(km)\n",
- "Ifl = 120 #full loag current(A)\n",
- "r = 0.5 #resistance of cable(ohm/km)\n",
- "\n",
- "#Calculation:\n",
- "R = r*l #total resistance of the line(ohm)\n",
- "Vl = R*Ifl #F.L. voltage drop in the line(V)\n",
- "Vb = Vl #Terminal voltage of booster(V)\n",
- "Po = Vb*Ifl/1000 #Output of booster(kW)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Booster Voltage is\",Vl,\"V\"\n",
- "print \"Output of booster is\",Po,\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Booster Voltage is 180.0 V\n",
- "Output of booster is 21.6 kW\n"
- ]
- }
- ],
- "prompt_number": 41
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter14_1.ipynb b/Principles_of_Power_System/chapter14_1.ipynb deleted file mode 100644 index 9abb2d75..00000000 --- a/Principles_of_Power_System/chapter14_1.ipynb +++ /dev/null @@ -1,746 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:0910cfded5ae40d0ea2b9576604d8007ec8328215058593fcec218762063deff"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 14: A.C. Distribution"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.1, Page Number: 359"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "l = 300 #line length(m)\n",
- "magI1 = 100 #current at load 1(A)\n",
- "pf1 = 0.707 #power factor at load 1\n",
- "l1 = 200 #line length till load 1(m)\n",
- "magI2 = 200 #current drawn at load 2(A)\n",
- "pf2 = 0.8 #power factor at laod 2\n",
- "l2 = 300 #line length till load 2(m)\n",
- "R = 0.2 #total resistance of line(ohm/km)\n",
- "X = 0.1 #total reactance of the line(ohm/km)\n",
- "\n",
- "#Calculation:\n",
- "phy1 = math.acos(pf1)\n",
- "phy2 = math.acos(pf2)\n",
- "Zac = (R+X*1j)*200/1000 #Impedance of section AC(ohm)\n",
- "Zcb = (R+X*1j)*100/1000 #Impedance of section CB(ohm)\n",
- "#Taking voltage at the far end B as the reference vector, we have\n",
- "I2 = magI2*(pf2-1j*math.sin(phy2)) #Load current at point B(A)\n",
- "I1 = magI1*(pf1-1j*math.sin(phy1)) #Load current at point C(A)\n",
- "Icb = I2 #A\n",
- "Iac = I1+I2 #A\n",
- "Vcb = Icb*Zcb #V\n",
- "Vac = Iac*Zac #V\n",
- "V = Vac+Vcb #Voltage drop in the distributor(V)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Voltage drop in the distributor is\",round(abs(V),2),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage drop in the distributor is 17.85 V\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.2, Page Number: 359"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "l = 2000 #line length(m)\n",
- "magI1 = 80 #current at load 1(A)\n",
- "pf1 = 0.9 #power factor at load 1\n",
- "l1 = 1000 #line length till load 1(m)\n",
- "magI2 = 120 #current drawn at load 2(A)\n",
- "pf2 = 0.8 #power factor at laod 2\n",
- "l2 = 2000 #line length till load 2(m)\n",
- "R = 0.05 #total resistance of line(ohm/km)\n",
- "X = 0.1 #total reactance of the line(ohm/km)\n",
- "magVb = 230 #voltage maintained at point B(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "phy1 = math.acos(pf1)\n",
- "phy2 = math.acos(pf2)\n",
- "Zac = (R+X*1j)*1000/1000 #Impedance of section AC(ohm)\n",
- "Zcb = (R+X*1j)*1000/1000 #Impedance of section CB(ohm)\n",
- "#Taking voltage at the far end B as the reference vector, we have\n",
- "I2 = magI2*(pf2-1j*math.sin(phy2)) #Load current at point B(A)\n",
- "I1 = magI1*(pf1-1j*math.sin(phy1)) #Load current at point C(A)\n",
- "Icb = I2 #A\n",
- "Iac = I1+I2 #A\n",
- "Vcb = Icb*Zcb #V\n",
- "Vac = Iac*Zac #V\n",
- "V = Vac+Vcb+magVb*(1+0j) #Voltage drop in the distributor(V)\n",
- "theta = math.atan(V.imag/V.real)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Voltage drop in the distributor is\",round(abs(V),2),\"V\"\n",
- "print \"(ii)The phase difference between Va and Vb is \",round(math.degrees(theta),2),\"degrees\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Voltage drop in the distributor is 261.67 V\n",
- "(ii)The phase difference between Va and Vb is 3.83 degrees\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.3, Page Number: 360"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "magI1 = 100 #current at load 1(A)\n",
- "pf1 = 0.6 #power factor at load 1\n",
- "magI2 = 100 #current drawn at load 2(A)\n",
- "pf2 = 0.8 #power factor at laod 2\n",
- "R = 0.1 #total resistance of line(ohm/km)\n",
- "X = 0.15 #total reactance of the line(ohm/km)\n",
- "magVb = 200 #voltage maintained at point B(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "phy1 = math.acos(pf1)\n",
- "phy2 = math.acos(pf2)\n",
- "Zam = (R+X*1j) #Impedance of section AM(ohm)\n",
- "Zmb = (R+X*1j) #Impedance of section MB(ohm)\n",
- "#Taking voltage at the far end B as the reference vector, we have\n",
- "I2 = magI2*(pf2-1j*math.sin(phy2)) #Load current at point B(A)\n",
- "Imb = I2 \n",
- "Vb = magVb*(1+0j) #V\n",
- "Vmb = Imb*Zmb #V\n",
- "Vm = Vb+Vmb #V\n",
- "alpha = math.atan(Vm.imag/Vm.real) #V\n",
- "#The load current I1 has a lagging p.f. of 0\u00b76 w.r.t. VM. It lags \n",
- "#behind Vm by an angle phy1.\n",
- "#Phase angle between I1 and Vb\n",
- "phy11 = phy1-alpha\n",
- "I1 = magI1*(math.cos(phy11)-math.sin(phy11)*1j) #A\n",
- "Iam = I1+I2 #A\n",
- "Vam = Iam*Zam #V\n",
- "Va = Vm+Vam #V\n",
- "theta = math.atan(Va.imag/Va.real)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i)Voltage at mid-point is\",round(abs(Vm),1),\"V\"\n",
- "print \"(ii) Sending end voltage Va is\",round(abs(Va),2),\"V\"\n",
- "print \"(iii)The phase difference between Va and Vb is \",round(math.degrees(theta),2),\"degrees\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)Voltage at mid-point is 217.1 V\n",
- "(ii) Sending end voltage Va is 252.33 V\n",
- "(iii)The phase difference between Va and Vb is 3.07 degrees\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.4, Page Number: 362"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Zab = 1+1j #ohm\n",
- "Zbc = 1+2j #ohm\n",
- "Zac = 1+3j #ohm\n",
- "Ib = 20 #load current at B(A)\n",
- "pfb = 0.8 #power factor at A\n",
- "Ic = 15 #load current at C(A)\n",
- "pfc = 0.6 #power factor at B\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Iab = Ib*(pfb-1j*math.sin(math.acos(pfb))) #Current in section AB(A)\n",
- "Iac = Ic*(pfc-1j*math.sin(math.acos(pfc))) #Current in section AB(A)\n",
- "Vab = Iab*Zab #Voltage drop in section AB(V)\n",
- "Vac = Iac*Zac #Voltage drop in section AC(V)\n",
- "#point B is at higher potential than point C. The p.d. between B and C\n",
- "#is Thevenin\u2019s equivalent circuit e.m.f. Eo i.e.\n",
- "Eo = Vac-Vab #volt\n",
- "Zo = Zab+Zac #Thevenin\u2019s equivalent impedance(ohm)\n",
- "Ibc = Eo/(Zo+Zbc) #A\n",
- "Iab1 = Iab+Ibc #A\n",
- "Iac1 = Iac-Ibc #A\n",
- "Ia = Iab+Iac #Current fed at A(A)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The total current fed at A is\",Ia,\"A\"\n",
- "print \"\\nCurrent in AB is\",Iab1.real+round(Iab1.imag,2)*1j,\"A\"\n",
- "print \"\\nCurrent in BC is\",Ibc.real+round(Ibc.imag,2)*1j,\"A\"\n",
- "print \"\\nCurrent in AC is\",Iac1.real+round(Iac1.imag,2)*1j,\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The total current fed at A is (25-24j) A\n",
- "\n",
- "Current in AB is (18.6-13.53j) A\n",
- "\n",
- "Current in BC is (2.6-1.53j) A\n",
- "\n",
- "Current in AC is (6.4-10.47j) A\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.5, Page Number: 363"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "l = 1000 #line length(m)\n",
- "magI1 = 5 #current at load 1(A)\n",
- "pf1 = 0.8 #power factor at load 1\n",
- "l1 = 600 #line length till load 1(m)\n",
- "pf2 = 0.85 #power factor at motor load B\n",
- "Po = 10 #power output at B(H.P)\n",
- "n = 0.9 #efficiency\n",
- "l2 = 400 #line length till load 2(m)\n",
- "R = 1 #total resistance of line(ohm/km)\n",
- "X = 0.5 #total reactance of the line(ohm/km)\n",
- "magVb = 400 #voltage maintained at point B(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Zac = (R+X*1j)*l1/l #ohm\n",
- "Zcb = (R+X*1j)*l2/l #ohm\n",
- "magVbp = magVb/3**0.5 #volt per phase\n",
- "Vbp = magVbp*(1+0j) #V\n",
- "magIb = Po*746/(3**0.5*magVb*pf2*n) #Line current at B(A)\n",
- "magI2p = magIb\n",
- "I2p = magI2p*(pf2-1j*math.sin(math.atan(pf2))) #A\n",
- "I1p = magI1*(pf1-1j*math.sin(math.atan(pf1))) #A\n",
- "Iac = I1p+I2p #Current in section AC(A)\n",
- "Icb = I2p #Current in section CB(A)\n",
- "Vcb = Icb*Zcb #V\n",
- "Vac = Iac*Zac #V\n",
- "Va = Vbp+Vcb+Vac #V\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Line voltage at A is\",round(abs(Va)*3**0.5),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Line voltage at A is 434.0 V\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.6, Page Number: 364"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "magVa = 11000 #volt\n",
- "magIb = 50 #load current at B(A)\n",
- "pf2 = 0.8 #power factor(lagging)\n",
- "magIc = 120 #load current at C(A)\n",
- "pf3 = 1.0 #power factor(lagging)\n",
- "magId = 70 #load current at D(A)\n",
- "pf4 = 0.866 #power factor(lagging)\n",
- "Zab = 1+0.6j #ohm\n",
- "Zbc = 1.2+0.9j #ohm\n",
- "Zcd = 0.8+0.5j #ohm\n",
- "Zda = 3+2j #ohm\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let current in section AB be (x + j*y).\n",
- "x,y = symbols('x,y')\n",
- "Iab = x+1j*y\n",
- "x,y = symbols('x,y')\n",
- "Ibc = Iab-magIb*(pf2-math.sin(math.atan(pf2))) #A\n",
- "Icd = (x-40+1j*(y+30))-(120+0j) #A\n",
- "Ida = ((x-160)+1j*(y+30))-(70*(0.866-0.5j)) #A\n",
- "Vab = Iab*Zab #Drop in section AB(V)\n",
- "Vbc = Ibc*Zbc #Drop in section BC(V)\n",
- "Vcd = Icd*Zcd #Drop in section CD(V)\n",
- "Vda = Ida*Zda #Drop in section DA(V)\n",
- "# Vab+Vbc+Vcd+Vda = 0\n",
- "# As the real and imaginary parts have to be separately zero,\n",
- "# 6*x-4*y-1009.8 = 0\n",
- "# 4*x+6*y-302.2 = 0\n",
- "x1 = solve(6*x-4*y-1009.8,x)[0]\n",
- "y1 = round(solve(4*x1+6*y-302.2,y)[0],1)\n",
- "x11 = round(solve(6*x-4*y1-1009.8,x)[0],1)\n",
- "#now putting the values of x11 and y1 in above equationa,\n",
- "Iab1 = x11+1j*y1 #A\n",
- "Ibc1 = (x11-40)+1j*(y1+30) #A\n",
- "Icd1 = (x11-40+1j*(y1+30))-(120+0j) #A\n",
- "Ida1 = ((x11-160)+1j*(y1+30))-(70*(0.866-0.5j)) #A\n",
- "magVap = round(magVa/3**0.5) #Voltage at supply end A(V)\n",
- "Vb = magVap*(1+0j)-Iab1*Zab #Voltage at station B(V/phase)\n",
- "Vc = Vb-Ibc1*Zbc #Voltage at station C(V/phase)\n",
- "Vd = Vc-Icd1*Zcd #Voltage at station D(V/phase)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Current in section AB is\",Iab1,\"A\"\n",
- "print \"Current in section BC is\",Ibc1,\"A\"\n",
- "print \"Current in section CD is\",Icd1,\"A\"\n",
- "print \"Current in section DA is\",Ida1,\"A\"\n",
- "print \"Voltage at A is\",magVap*(1+0j),\"V/phase\"\n",
- "print \"Voltage at B is\",Vb,\"V/phase\"\n",
- "print \"Voltage at C is\",Vc,\"V/phase\"\n",
- "print \"Voltage at D is\",Vd,\"V/phase\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current in section AB is (139.8-42.8j) A\n",
- "Current in section BC is (99.8-12.8j) A\n",
- "Current in section CD is (-20.2-12.8j) A\n",
- "Current in section DA is (-80.82+22.2j) A\n",
- "Voltage at A is (6351+0j) V/phase\n",
- "Voltage at B is (6185.52-41.08j) V/phase\n",
- "Voltage at C is (6054.24-115.54j) V/phase\n",
- "Voltage at D is (6064-95.2j) V/phase\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.7, Page Number: 368"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "Pr = 10 #load connected to line R(kW)\n",
- "Py = 8 #load connected to line Y(kW)\n",
- "Pb = 5 #load connected to line B(kW)\n",
- "Vl = 400 #line voltage(V)\n",
- "#the loads are non-reactive.\n",
- "\n",
- "#Calculation:\n",
- "Vp = round(Vl/3**0.5) #phase voltage(V)\n",
- "Ir = Pr*1000/Vp #A\n",
- "Iy = Py*1000/Vp #A\n",
- "Ib = Pb*1000/Vp #A\n",
- "\n",
- "#Resolving the three currents along x-axis and y-axis, we have,\n",
- "Ih = Iy*math.cos(math.pi/6)-Ib*math.cos(math.pi/6) #Resultant horizontal component(A)\n",
- "Iv = Ir-Iy*math.cos(math.pi/3)-Ib*math.cos(math.pi/3) #Resultant vertical component(A)\n",
- "In = (Ih**2+Iv**2)**0.5 #current in neutral wire(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Ir =\",round(Ir,1),\"A\"\n",
- "print \" Iy =\",round(Iy,1),\"A\"\n",
- "print \" Ib =\",round(Ib,2),\"A\"\n",
- "print \"(ii) Current in neutral wire is\",round(In,1),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Ir = 43.3 A\n",
- " Iy = 34.6 A\n",
- " Ib = 21.65 A\n",
- "(ii) Current in neutral wire is 18.9 A\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.8, Page Number: 369"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Vl = 400 #line voltage(V)\n",
- "Vp = 230 #voltage across lamp(V)\n",
- "I1 = 70 #current in load RN(A)\n",
- "I2 = 84 #current in load YN(A)\n",
- "I3 = 33 #current in load BN(A)\n",
- "Im = 200 #current taken by the motor(A)\n",
- "pf = 0.2 #power factor(lagging)\n",
- "\n",
- "#Calculation:\n",
- "#Lamp load alone:\n",
- "Ih = I2*math.cos(math.pi/6)-I3*math.cos(math.pi/6) #Resultant H-component(A)\n",
- "Iv = I1-I3*math.cos(math.pi/3)-84*math.cos(math.pi/3) #Resultant V-component(A)\n",
- "In = math.sqrt(Ih**2+Iv**2) #Neutral current(A)\n",
- "\n",
- "\n",
- "#Both lamp load and motor load:\n",
- "Ir = Im*pf #Active component of motor current(A)\n",
- "Ix = Im*math.sin(math.acos(pf)) #Reactive component of motor current(A)\n",
- "IR = ((Ir+I1)**2+Ix**2)**0.5 #A\n",
- "IY = ((Ir+I2)**2+Ix**2)**0.5 #A\n",
- "IB = ((Ir+I3)**2+Ix**2)**0.5 #A\n",
- "P = Vp*(I1+I2+I3)*1 #Watt #( cos phy_L = 1)\n",
- "Pm = 3**0.5*Vl*Im*pf #Power supplied to motor(W)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Lamp load alone: neutral curent is\",round(In,2),\"A\"\n",
- "print \"\\nWhen Both lamp load and motor load is present:\"\n",
- "print \"The current components are:\"\n",
- "print \"Neutral current is\",round(In,2),\"A\"\n",
- "print \"IR =\",round(IR,1),\"A;\\tIY =\",round(IY,0),\"A;\\tIB =\",round(IB,2),\"A\"\n",
- "print \"Power supplied to the lamp is\",P,\"W\"\n",
- "print \"Power supplied to the motor is\",round(Pm),\"W\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Lamp load alone: neutral curent is 45.64 A\n",
- "\n",
- "When Both lamp load and motor load is present:\n",
- "The current components are:\n",
- "Neutral current is 45.64 A\n",
- "IR = 224.7 A;\tIY = 232.0 A;\tIB = 209.11 A\n",
- "Power supplied to the lamp is 43010 W\n",
- "Power supplied to the motor is 27713.0 W\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.9, Page Number: 370"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Prn = 20 #kW\n",
- "pf1 = 1 #power factor of loaf RN\n",
- "kVAyn = 28.75 #kVA of load YN\n",
- "kVAbn = 28.75 #kVA of load BN\n",
- "pf2 = 0.866 #power factor of laod YN & BN each.(lagging)\n",
- "Vl = 400 #line voltage(V)\n",
- "Vp = 230 #phase voltage(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "phy1 = math.acos(pf1)\n",
- "phy2 = math.acos(pf2)\n",
- "phy3 = phy2\n",
- "Ir = Prn*1000/Vp #A\n",
- "Iy = kVAyn*1000/Vp #A\n",
- "Ib = kVAbn*1000/Vp #A\n",
- "Ih = Ir-Iy*math.cos(phy2)-Ib*math.cos(phy2) #A\n",
- "Iv = 0+Iy*math.sin(phy2)-Iy*math.sin(phy3) #A\n",
- "In = math.sqrt(Ih**2+Iv**2) #A\n",
- "#When load from B to N removed.:\n",
- "#When the load from B to N is removed, the various line currents are:\n",
- "#Ir in phase with Vrn; Iy lagging by 30 deg.; Ib = 0.\n",
- "Ir1 = Ir\n",
- "Iy1 = Iy; Ib1 = 0 #A\n",
- "Ih1 = Ir1-Iy1*math.cos(math.pi/6) #A\n",
- "Iv1 = 0-Iy1*math.sin(math.pi/6) #A\n",
- "In1 = math.sqrt(Ih1**2+Iv1**2) #A\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"When no changes were made, the various currents are:\"\n",
- "print \"Ir =\",round(Ir,2),\"A;\\tIy =\",Iy,\"A;\\tIb =\",Ib,\"A;\\tIn =\",round(In,2),\"A\"\n",
- "print \"\\nWhen load from B to N removed, the various currents are:\"\n",
- "print \"Ir =\",round(Ir1,2),\"A;\\tIy =\",Iy1,\"A;\\tIb =\",Ib1,\"A;\\tIn =\",round(In1,2),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "When no changes were made, the various currents are:\n",
- "Ir = 86.96 A;\tIy = 125.0 A;\tIb = 125.0 A;\tIn = 129.54 A\n",
- "\n",
- "When load from B to N removed, the various currents are:\n",
- "Ir = 86.96 A;\tIy = 125.0 A;\tIb = 0 A;\tIn = 66.03 A\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.10, Page Number: 371"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Vl = 400 #line voltage(V)\n",
- "Vp = 230 #phase voltage(V)\n",
- "Ir = 30 #load current at R-phase(A)\n",
- "pf1 = 0.866 #power factor for R-phase(lagging)\n",
- "Iy = 30 ##load current at Y-phase(A)\n",
- "pf2 = 0.866 #power factor for R-phase(lagging)\n",
- "Ib = 30 ##load current at R-phase(A)\n",
- "pf3 = 1.0 #power factor for R-phase(lagging)\n",
- "R = 0.2 #resistance of each line conductor(ohm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "phy1 = math.acos(pf1)\n",
- "phy2 = math.acos(pf2)\n",
- "phy3 = math.acos(pf3)\n",
- "\n",
- "VR = Vp*(1+0j) #V\n",
- "VY = Vp*(math.cos(-2*math.pi/3)+math.sin(-2*math.pi/3)) #V\n",
- "VB = Vp*(math.cos(2*math.pi/3)+math.sin(-2*math.pi/3)) #V\n",
- "\n",
- "#the line currents can be expressed as :\n",
- "IR = cmath.rect(30,-math.pi/6) #A\n",
- "IY = cmath.rect(30,-math.pi/2) #A\n",
- "IB = cmath.rect(30,2*math.pi/3) #A\n",
- "IN = IR+IY+IB #A\n",
- "\n",
- "#Since, the area of X-section of neutral is half of any line conductor.\n",
- "Rn = 2*R #resistance of neutral(ohm)\n",
- "#ER = VR + Drop in R phase + Drop in neutral\n",
- "ER = VR+R*IR+IN*2*R #V\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The supply end voltage for R phase is\",round(ER.real,3)+1j*round(ER.imag,3),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The supply end voltage for R phase is (239.588-10.608j) V\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 14.11, Page Number: 371"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "Vl = 400 #line voltage(V)\n",
- "Vp = 230 #phase voltage(A)\n",
- "Pln = 100 #load connected b/n LN(W)\n",
- "Pyn = 150 #load connected b/n YN(W)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#before disconnecting the neutral wire,\n",
- "R1 = Vp**2/Pln #Resistance of lamp L1(ohm)\n",
- "R2 = Vp**2/Pyn #Resistance of lamp L2(ohm)\n",
- "\n",
- "#When the neutral wire is disconnected,\n",
- "EL = 400 #V\n",
- "I = EL/(R1+R2) #A\n",
- "V1 = I*R1 #Voltage across lamp L1(V)\n",
- "V2 = I*R2 #Voltage across lamp L2(V)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The voltage across the lamps are:\"\n",
- "print \"Lamp 1, Voltage =\",V1,\"V ;\\tLamp 2, voltage =\",V2,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The voltage across the lamps are:\n",
- "Lamp 1, Voltage = 240.0 V ;\tLamp 2, voltage = 160.0 V\n"
- ]
- }
- ],
- "prompt_number": 5
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter15_1.ipynb b/Principles_of_Power_System/chapter15_1.ipynb deleted file mode 100644 index 35b4fcc7..00000000 --- a/Principles_of_Power_System/chapter15_1.ipynb +++ /dev/null @@ -1,126 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:99f2463b3650514f9c88ec63c2c7f7ef832ae42348e5f3fe2b1b870ab9434349"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 15: Voltage Control"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 15.1, Page Number: 384"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Pl = 10000 #load(kW)\n",
- "pf = 0.8 #power factor(lag)\n",
- "Vl = 33000 #receiving end line voltage(V)\n",
- "R = 5 #line resistance(ohm)\n",
- "X = 10 #line reactance(ohm)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I2 = math.floor(Pl*1000/(3**0.5*Vl*0.8)) #load current(A)\n",
- "Ip = I2*pf #A\n",
- "Iq = I2*math.sin(math.acos(pf)) #A\n",
- "V1 = round(Vl/3**0.5) #sending end voltage(V)\n",
- "#Let Im be the current taken by the synchronous condenser.\n",
- "Im = symbols('Im') #A\n",
- "Im1 = solve((V1+Ip*R-X*(Im-Iq))**2+(Ip*X+(Im-Iq)*R)**2-V1**2,Im)[0]\n",
- "C = 3*V1*round(Im1)/1000 #kVAR\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Capacity of synchronous condenser is\",math.floor(C),\"kVAR\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacity of synchronous condenser is 13203.0 kVAR\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 15.2 Page Number: 385"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Pl = 25000 #load(kW)\n",
- "pf = 0.8 #power factor(lag)\n",
- "Vl = 33000 #receiving end line voltage(V)\n",
- "R = 5 #line resistance(ohm)\n",
- "X = 20 #line reactance(ohm)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I2 = round(Pl*1000/(3**0.5*Vl*pf),1) #load current(A)\n",
- "Ip = I2*pf #A\n",
- "Iq = I2*math.sin(math.acos(pf)) #A\n",
- "V1 = Vl/3**0.5 #sending end voltage(V)\n",
- "#Let Im be the current taken by the synchronous condenser.\n",
- "Im = symbols('Im') #A\n",
- "Im1 = solve((V1+Ip*R-X*(Im-Iq))**2+(Ip*X+(Im-Iq)*R)**2-V1**2,Im)[0]\n",
- "C = 3*V1*Im1/1000 #kVAR\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Capacity of synchronous condenser is\",round(C/1000,2),\"MVAR\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacity of synchronous condenser is 33.11 MVAR\n"
- ]
- }
- ],
- "prompt_number": 2
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter17_1.ipynb b/Principles_of_Power_System/chapter17_1.ipynb deleted file mode 100644 index f0b77b2e..00000000 --- a/Principles_of_Power_System/chapter17_1.ipynb +++ /dev/null @@ -1,842 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:85e6b6fc08cf389e51cb8c88e6ef45df0ab76627422a51dd5811f81a969b3ed6"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 17: Symmetrical Fault Calculations"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.1, Page Number: 402"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "kVAa = 15000\n",
- "kVAb = 20000\n",
- "V = 12000\n",
- "kVA_base = 35000\n",
- "Xa = 30 #%reactance of alternator A(%)\n",
- "Xb = 50 #%reactance of alternator B(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Xa1 = kVA_base/kVAa*Xa #% Reactance of alternator A at the base kVA\n",
- "Xb1 = kVA_base/kVAb*Xb #% Reactance of alternator B at the base kVA\n",
- "I = kVA_base*1000/(3**0.5*V) #Line current corresponding to 35000 kVA at 12 kV\n",
- "\n",
- "X = Xa1*Xb1/(Xa1+Xb1) #Total % reactance from generator neutral up to fault point\n",
- "Isc = I*100/X #Short-circuit current(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The short-circuit current is\",round(Isc),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The short-circuit current is 4330.0 A\n"
- ]
- }
- ],
- "prompt_number": 48
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.2, Page Number: 404"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "kVA = 20000 #kVA rating of alternator\n",
- "V = 10000 #voltage rating of alternator\n",
- "Xa = 5 # % reactance of alternator(ohm)\n",
- "\n",
- "#Calculation:\n",
- "I = kVA*1000/(3**0.5*V) #full load current(A)\n",
- "Vp = V/3**0.5 #phase voltage(A)\n",
- "#As the short-circuit current is to be 8 times the full-load current,\n",
- "Xr = 1/8*100\n",
- "Xe = Xr-Xa #External % reactance required\n",
- "X = Xe*Vp/(I*100) #per phase external reactance required(ohm)\n",
- "\n",
- "#Result:\n",
- "print \"Per phase external reactance required is\",X,\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Per phase external reactance required is 0.375 ohm\n"
- ]
- }
- ],
- "prompt_number": 49
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.3, Page Number: 404"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "Vl = 10 #transmission line voltage(kV)\n",
- "Rl = 1 #line resistance(ohm)\n",
- "Xl = 4 #line reactance(ohm)\n",
- "MVAtf = 5 #transformer rating(MVA)\n",
- "Xtf = 5 #reactance of transformer(%)\n",
- "MVAal = 10 #rating of alternator(MVA)\n",
- "Xal = 10 #reactance of alternator(%)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let 10,000 kVA be the base kVA\n",
- "kVAb = 10000 #base kVA\n",
- "Xalb = kVAb/(MVAal*1000)*Xal #% reactance of alternator on base kVA\n",
- "Xtfb = kVAb/(MVAtf*1000)*Xtf #% reactance of transformer on base kVA\n",
- "Xl1 = kVAb*Xl/(10*Vl**2) #% reactance of transmission line\n",
- "Rl1 = kVAb*Rl/(10*Vl**2) #% resistance of transmission line\n",
- "\n",
- "\n",
- "#(i)For a fault at the end of a transmission line (point F2),\n",
- "Xt = Xalb+Xtfb+Xl1 #Total % reactance\n",
- "Z = (Xt**2+Rl1**2)**0.5 #% impedance from generator neutral upto fault point F2\n",
- "SCkVA1 = kVAb*100/Z #Short-circuit kVA\n",
- "\n",
- "\n",
- "#(ii)For a fault at the high voltage terminals of the transformer (point F1),\n",
- "#Total % reactance from generator neutral upto fault point F1:\n",
- "Xt1 = Xalb+Xtfb\n",
- "SCkVA2 = kVAb*100/Xt1 #Short-circuit kVA\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) SC kVA for 1st case = \",round(SCkVA1),\"kVA\"\n",
- "print \"(ii)SC kVA for 2nd case = \",round(SCkVA2),\"kVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) SC kVA for 1st case = 16440.0 kVA\n",
- "(ii)SC kVA for 2nd case = 50000.0 kVA\n"
- ]
- }
- ],
- "prompt_number": 50
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.4, Page Number: 405"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "kVAb = 10000 #kVA base\n",
- "Xt = 5 #reactance of each transformer(%)\n",
- "kVAt = 5000 #kVA rating of each transformer\n",
- "kVA1 = 10000 #kVA of generator A & B each\n",
- "kVA3 = 5000 #kVA of generator C\n",
- "Xa = 12 #reactance of generator A & B each(%)\n",
- "Xc = 18 #reactance of generator c(%)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#The % reactance of generators A, B and C and that of\n",
- "#each transformer on the selected base kVA will be:\n",
- "XA = Xa*kVAb/kVA1\n",
- "XB = Xa*kVAb/kVA1\n",
- "XC = Xc*kVAb/kVA3\n",
- "XT = Xt*kVAb/kVAt\n",
- "\n",
- "#(i) When the fault occurs on the low voltage side of the\n",
- "#transformer,\n",
- "#Total % reactance from generator neutral upto fault point F1\n",
- "XT1 = XA/2*XC/(XA/2+XC) #%\n",
- "MVAf1 = kVAb*100/XT1/1000 #Fault MVA\n",
- "\n",
- "#(i) When the fault occurs on the high voltage side of the\n",
- "#transformer\n",
- "#Total % reactance from generator neutral upto fault point F2\n",
- "XT2 = XT1+XT #%\n",
- "MVAf2 = kVAb*100/XT2/1000 #Fault MVA\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Maximum fault MVA which the circuit breakers on:\"\n",
- "print \"(i) low voltage side is\",round(MVAf1,1),\"MVA\"\n",
- "print \"(ii)high voltage side is\",round(MVAf2),\"MVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum fault MVA which the circuit breakers on:\n",
- "(i) low voltage side is 194.4 MVA\n",
- "(ii)high voltage side is 66.0 MVA\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.5, Page Number: 407"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "#Variable declaration:\n",
- "X1 = 10 #reactance of generator 1 & 2 each(%)\n",
- "X3 = 12 #reactance of generator 3 & 4 each(%)\n",
- "kVA1 = 10000 #kVA rating of generator 1 & 2 each\n",
- "kVA3 = 8000 #kVA rating of generator 3 & 4 each\n",
- "Xr = 10 #reactance of reactor(%)\n",
- "kVAr = 5000 #kVA of reactor\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Fig. above shows the single line diagram of the network.\n",
- "kVAb = 10000 #base kVA\n",
- "X1b = X1*kVAb/kVA1 #% Reactance of generator 1 or 2 on the base kVA\n",
- "X3b = X3*kVAb/kVA3 #% Reactance of generator 3 or 4 on the base kVA\n",
- "Xrb = Xr*kVAb/kVAr #% Reactance of bus-bar reactor on the base kVA\n",
- "\n",
- "#After the fault occurs,\n",
- "Xt = ((X1b/2+Xrb)*X3b/2)/(X1b/2+Xrb+X3b/2)\n",
- "kVAf = kVAb*100/Xt\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Required fault MVA is\",round(kVAf/1000,2),\"MVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Required fault MVA is 173.33 MVA\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.6, Page Number: 408"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "kVAa = 3000 #kVA rating of generator A\n",
- "kVAb = 4500 #kVA rating of generator B\n",
- "Xa = 7 #% reactance of gen A\n",
- "Xb = 8 #% reactance of gen A\n",
- "kVAt = 7500 #kVA rating of transformer\n",
- "Xt = 7.5 #% reactance of transformer\n",
- "Vb = 3.3 #bus voltage(kV)\n",
- "\n",
- "#Calculation:\n",
- "kVAbs = 7500 #base kVA(say)\n",
- "XA = Xa*kVAbs/kVAa #% Reactance of generator A on the base kVA\n",
- "XB = Xb*kVAbs/kVAb #% Reactance of generator B on the base kVA\n",
- "XT = Xt*kVAbs/kVAt #% Reactance of transformer on the base kVA\n",
- "X = symbols('X') #percentage reactance of the bus-bar reactor\n",
- "Xt1 = (XA*XB/(XA+XB))*(X+XT)/((XA*XB/(XA+XB))+(X+XT))\n",
- "SCkVA = kVAt*100*Xt1 #Short-circuit kVA\n",
- "#But the short-circuit kVA should not exceed 150 * 10**3 kVA,\n",
- "#the rupturing capacity of the breaker.\n",
- "\n",
- "X1 = abs(solve(SCkVA-150*1000,X)[0])\n",
- "x = X1*10*Vb**2/kVAt #reactance of the reactor(ohm)\n",
- "\n",
- "#Result:\n",
- "print \"Reactance of the reactor per phase is\",round(x,3),\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Reactance of the reactor per phase is 0.106 ohm\n"
- ]
- }
- ],
- "prompt_number": 53
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.7, Page Number: 409"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaratioon:\n",
- "MVAbase = 100 #base MVA\n",
- "MVAa = 1500 #estimated short-circuit MVA at busbar A\n",
- "MVAb = 1200 #estimated short-circuit MVA at busbar B\n",
- "kV = 33 #generated voltage at each station(kV)\n",
- "x = 1 #transmission line reactance(ohm)\n",
- "\n",
- "#Calculation:\n",
- "Xa = MVAbase/MVAa*100 #% Reactance of station A on the base MVA\n",
- "Xb = MVAbase/MVAb*100 #% Reactance of station B on the base MVA\n",
- "Xt = MVAbase*1000*x/(10*kV**2)\n",
- "\n",
- "#Fault on station A.\n",
- "Xt1 = (Xb+Xt)*Xa/(Xa+Xb+Xt) #Total % reactance upto fault point F1\n",
- "SCMVA1 = MVAbase*100/Xt1 #Short-circuit MVA\n",
- "\n",
- "#Fault on station B.\n",
- "Xt2 = (Xa+Xt)*Xb/(Xb+Xa+Xt) #Total % reactance upto fault point F2\n",
- "SCMVA2 = MVAbase*100/Xt2 #Short-circuit MVA\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Fault on station A, the short circuit MVA is\",round(SCMVA1),\"MVA\"\n",
- "print \"Fault on station B, the short circuit MVA is\",round(SCMVA2),\"MVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Fault on station A, the short circuit MVA is 2071.0 MVA\n",
- "Fault on station B, the short circuit MVA is 1831.0 MVA\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.8, Page Number: 410"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "kVAbase = 5000 #base kVA\n",
- "Xr = 6 #% reactance of reactor\n",
- "Xg = 12 #% reactance of each generator\n",
- "kVAg = 5000 #given generator rating(kVA)\n",
- "kVAr = 5000 #given reactor rating(kVA)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#(i) With reactors:\n",
- "#Suppose a 3-phase short-circuit fault occurs on section 3 of the bus-bar.\n",
- "\n",
- "Xt1 = round(((Xr+Xg)/2+Xr)*Xg/(((Xr+Xg)/2+Xr)+Xg),2) #% reactance from gen. neutral upto fault point F \n",
- "SCkVA1 = kVAbase*100/Xt1 #Short-circuit input\n",
- "\n",
- "#(ii) Without reactors:\n",
- "Xt2 = Xg/3 #Total % reactance upto fault point F\n",
- "SCkVA2 = kVAbase*100/Xt2\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) With reactors, short circuit MVA\",round(SCkVA1/1000,3),\"MVA\"\n",
- "print \"(ii) With reactors, short circuit MVA\",SCkVA2/1000,\"MVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) With reactors, short circuit MVA 74.963 MVA\n",
- "(ii) With reactors, short circuit MVA 125.0 MVA\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.9, Page Number: 411"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "MVAbase = 5 #base MVA\n",
- "MVAg = 10 #MVA of generator\n",
- "MVAr = 10 #MVA of reactor\n",
- "MVAtr = 5 #MVA of transformer\n",
- "xr = 10 #% reactance of each reactor\n",
- "xg = 30 #% reactance of each generator\n",
- "xtr = 5 #% reactance of each transformer\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Xg = xg*MVAbase/MVAg #%age reactance of each generator on the base MVA\n",
- "Xr = xr*MVAbase/MVAr #%age reactance of each reactor on the base MVA\n",
- "Xtr = xtr*MVAbase/MVAtr #%age reactance of each transformer on the base MVA\n",
- "\n",
- "#Total %age reactance from generator neutral upto fault point F\n",
- "Xt = ((Xg+Xr)/2+Xtr)*Xg/(((Xg+Xr)/2+Xtr)+Xg)+Xr\n",
- "SCMVA = MVAbase*100/Xt #short circuit MVA\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Short circuit MVA is\",SCMVA,\"MVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Short circuit MVA is 40.0 MVA\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.10, Page Number: 412"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "#Let N = no. of section in bus bar\n",
- "#Q = kVA rating of generator\n",
- "#x = reactance of reactance\n",
- "#b = bus reactances.\n",
- "N,Q,x,b = symbols('N Q x b')\n",
- "\n",
- "#Calculation:\n",
- "X1 = (b+(x+b)/(N-1))*x/(b+(x+b)/(N-1)+x) # %\n",
- "SCkVA = Q*100/X1 #short circuit kVA\n",
- "\n",
- "\n",
- "#Now putting values:\n",
- "Q = 50000 #kVA\n",
- "x = 20 # %\n",
- "b = 10 # %\n",
- "\n",
- "#(i) With 3 sections\n",
- "N1 = 3\n",
- "X1 = (b+(x+b)/(N1-1))*x/(b+(x+b)/(N1-1)+x)\n",
- "SCkVA1 = Q*100/X1\n",
- "\n",
- "#(ii) With 9 sections\n",
- "N2 = 9\n",
- "X2 = (b+(x+b)/(N2-1))*x/(b+(x+b)/(N2-1)+x)\n",
- "SCkVA2 = Q*100/X2\n",
- "\n",
- "#(ii) When N is very large\n",
- "N3 = 9999999999999 #say\n",
- "X3 = (b+(x+b)/(N3-1))*x/(b+(x+b)/(N3-1)+x)\n",
- "SCkVA3 = Q*100/X3\n",
- "\n",
- "#Result:\n",
- "print \"Short circuit kVA\"\n",
- "print \"(i) For 3 sections is\",SCkVA1,\"kVA\"\n",
- "print \"(ii) For 9 sections is\",round(SCkVA2),\"kVA\"\n",
- "print \"(iii)For large N is\",round(SCkVA3),\"kVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Short circuit kVA\n",
- "(i) For 3 sections is 450000.0 kVA\n",
- "(ii) For 9 sections is 613636.0 kVA\n",
- "(iii)For large N is 750000.0 kVA\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.11, Page Number: 414"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "MVAbs = 50 #base MVA\n",
- "MVAg = 10 #MVA of each generators\n",
- "xg = 20 #% reactance\n",
- "xt = 10 #reactance of transformer(%)\n",
- "MVAt = 50 #MVA of transformer\n",
- "kV = 33 #bus voltage\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Xg = MVAbs/MVAg*xg #% reactance of each of the generator on base MVA\n",
- "Xt = MVAbs/MVAt*xt #% reactance of the transformer on base MVA\n",
- "\n",
- "#Suppose the required reactance of the reactor is X % on 50 MVA base.\n",
- "X = symbols('X')\n",
- "#The reactances of the four generators are in parallel\n",
- "#& their equivalent reactance = 100/4 = 25%.\n",
- "\n",
- "Xtt = (Xg/4*(X+10))/(Xg/4+(X+10))\n",
- "\n",
- "#Now fault MVA at F is not to exceed 500 MVA.\n",
- "Xreq = MVAbs*100/500 #required reactance(%)\n",
- "X1 = solve(Xtt-Xreq,X)[0]\n",
- "Xrt = 10*kV**2*X1/(MVAbs*10**3) #Reactance of the reactor(ohm)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Reactance of the reactor is\",round(Xrt,3),\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Reactance of the reactor is 1.452 ohm\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.12, Page Number: 415"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "kVAg = 5000 #kVA rating of generator\n",
- "V = 6600 #voltage rating(V)\n",
- "x = 6 #reactance of generator(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "X = symbols('X') #% reactance of the reactor\n",
- "kVAbs = 5000 #base kVA\n",
- "#The short-circuit kVA is not to exceed 5 \u00d7 5000 kVA.\n",
- "X1 = solve(kVAbs*100/(X+x)-5*kVAg)[0]\n",
- "\n",
- "X11 = X1*10*(V/1000)**2/kVAg #reactance in ohm\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The required reactance is\",round(X11,2),\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The required reactance is 1.22 ohm\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.13, Page Number: 416"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "MVAg1 = 15 #MVA rating of A & B generators\n",
- "x1 = 12 #reactance of A & B(%)\n",
- "MVAg3 = 8 #MVA rating of generator C\n",
- "x3 = 10 #reactance of C(%)\n",
- "MVAt = 5 #MVA rating of each transformer\n",
- "xt = 4 #reactance of each transformer(%)\n",
- "MVAr = 10 #MVA of reactor\n",
- "xr = 15 #reactance of reactor(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let 10 MVA be the base MVA.\n",
- "MVAbs = 10\n",
- "#The percentage reactance of various elements on the selected\n",
- "#base MVA will be :\n",
- "Xa = MVAbs/MVAg1*x1\n",
- "Xb = MVAbs/MVAg1*x1\n",
- "Xc = MVAbs/MVAg3*x3\n",
- "Xt = MVAbs/MVAt*xt\n",
- "\n",
- "\n",
- "\n",
- "#After the fault occurs,\n",
- "#The reactances of generators A and B are in parallel & their\n",
- "#equivalent reactance is 8%/2 = 4%.\n",
- "\n",
- "#Total reactance upto fault point F:\n",
- "XT = ((Xa*Xb)/(Xa+Xb)+Xt)*(Xc+xr)/(((Xa*Xb)/(Xa+Xb)+Xt)+(Xc+xr))\n",
- "MVA = MVAbs*100/XT #Fault MVA\n",
- "\n",
- "#Result:\n",
- "print \"Total reactance upto fault point F is\",round(MVA,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Total reactance upto fault point F is 119.7 %\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.14, Page Number: 417"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "MVAa = 10 #MVA ratng of alterator\n",
- "xa = 20 #reactance of alterator(%)\n",
- "MVAt = 5 #MVA of tranformer\n",
- "xt = 10 #reactance of transformer(%)\n",
- "V1 = 6.6 #voltage on alterator side(kV)\n",
- "V2 = 33 #voltage on transmission line side(kV)\n",
- "xl = 50 #line reactance(ohm)\n",
- "rl = 10 #line resistance(ohm)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "MVAbs = 10 #base MVA\n",
- "Xa = MVAbs/MVAa*xa #% reactance of the alternator on base MVA\n",
- "Xt = MVAbs/MVAt*xt #% reactance of the transformer on base MVA\n",
- "Xl = MVAbs*1000*xl/(10*V2**2) #% reactance of the transmission line\n",
- "Rl = MVAbs*1000*rl/(10*V2**2) #% resistance of the transmission line\n",
- "#When the symmetrical fault occurs at point F on the transmission line (50 km away), then\n",
- "XT = Xa+Xt+Xl #Total % reactance upto the point of fault F\n",
- "Z = math.sqrt(XT**2+Rl**2) #% impedance from generator neutral upto fault point F\n",
- "SCMVA = MVAbs*100/Z #Short-circuit MVA\n",
- "Isc = SCMVA*10**6/(3**0.5*V1*1000) #Short-circuit current fed to the fault by the alternator\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Short-circuit current fed to the fault by the alternator is\",round(Isc),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Short-circuit current fed to the fault by the alternator is 1012.0 A\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 17.15, Page Number: 418"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "#the ratings of the machines and equipments are shown in fig above.\n",
- "\n",
- "MVAbs = 10\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "X1 = MVAbs/10*12 #% reactance of each generator (A, B, C and D) on the base MVA\n",
- "X2 = MVAbs/10*24 #% reactance of the reactor on the base MVA\n",
- "X3 = MVAbs/6*3 #% reactance of the transformer on the base MVA\n",
- "\n",
- "#When fault occurs at point F,\n",
- "XT = (30*6/(30+6))+5 #% reactance from generator neutral upto fault point F\n",
- "MVAf = MVAbs*100/XT #Fault MVA\n",
- "Isc = 100*10**6/(3**0.5*66000) #Short-circuit current\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The fault current is\",round(Isc),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The fault current is 875.0 A\n"
- ]
- }
- ],
- "prompt_number": 62
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter18_1.ipynb b/Principles_of_Power_System/chapter18_1.ipynb deleted file mode 100644 index d291f15a..00000000 --- a/Principles_of_Power_System/chapter18_1.ipynb +++ /dev/null @@ -1,1223 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:c30652f9881ee18245a1635c17c8cb6587983fc4f38ea35cc91611c084543096"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 18: Unsymmetrical Fault Calculations"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.2, Page Number: 429"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Ir = cmath.rect(100,30*math.pi/180) #current in phase R(A)\n",
- "Iy = cmath.rect(50,300*math.pi/180) #current in phase Y(A)\n",
- "Ib = cmath.rect(30,180*math.pi/180) #current in phase B(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "I0 = 1/3*(Ir+Iy+Ib) #A\n",
- "I1 = 1/3*(Ir+a*Iy+a**2*Ib) #A\n",
- "I2 = 1/3*(Ir+a**2*Iy+a*Ib) #A\n",
- "In = Ir+Iy+Ib #A\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The positive, negative and zero sequence currents in the R-line are\"\n",
- "print \"I0 = (\",round(abs(I0),2),round(rad2deg(angle(I0)),2),\") A\"\n",
- "print \"I1 = (\",round(abs(I1),2),round(rad2deg(angle(I1)),1),\") A\"\n",
- "print \"I2 = (\",round(abs(I2),2),round(rad2deg(angle(I2)),2),\") A\"\n",
- "print \"Return current in the neutral wire is\"\n",
- "print \"In =(\",round(abs(In),2),round(rad2deg(angle(In)),1),\") A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The positive, negative and zero sequence currents in the R-line are\n",
- "I0 = ( 27.29 4.69 ) A\n",
- "I1 = ( 57.98 43.3 ) A\n",
- "I2 = ( 18.97 24.96 ) A\n",
- "Return current in the neutral wire is\n",
- "In =( 81.88 4.7 ) A\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.3, Page Number: 430"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Ir = 12+6j #current in phase A(A)\n",
- "Iy = 12-12j #current in phase Y(A)\n",
- "Ib = -15+10j #current in phase B(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "#Red phase\n",
- "Ir0 = 1/3*(Ir+Iy+Ib) #A\n",
- "Ir1 = 1/3*(Ir+a*Iy+a**2*Ib) #A\n",
- "Ir2 = 1/3*(Ir+a**2*Iy+a*Ib) #A\n",
- "\n",
- "#Yellow phase:\n",
- "Iy0 = Ir0 #A\n",
- "Iy1 = a**2*Ir1 #A\n",
- "Iy2 = a*Ir2 #A\n",
- "\n",
- "\n",
- "#Blue phase:\n",
- "Ib0 = Ir0 #A\n",
- "Ib1 = a*Ir1 #A\n",
- "Ib2 = a**2*Ir2 #A\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The sequence currents of red phase are:\"\n",
- "print \"Ir0 =\",Ir0.real+round(Ir0.imag,2)*1j,\"A\"\n",
- "print \"Ir1 =\",round(Ir1.real,2)+round(Ir1.imag,2)*1j,\"A\"\n",
- "print \"Ir2 =\",round(Ir2.real,2)+round(Ir2.imag,2)*1j,\"A\"\n",
- "print \"\\nThe sequence currents of red phase are:\"\n",
- "print \"Iy0 =\",Iy0.real+round(Iy0.imag,2)*1j,\"A\"\n",
- "print \"Iy1 =\",round(Iy1.real,2)+round(Iy1.imag,1)*1j,\"A\"\n",
- "print \"Iy2 =\",round(Iy2.real,1)+round(Iy2.imag,2)*1j,\"A\"\n",
- "print \"\\nThe sequence currents of red phase are:\"\n",
- "print \"Ib0 =\",Ib0.real+round(Ib0.imag,2)*1j,\"A\"\n",
- "print \"Ib1 =\",round(Ib1.real,2)+round(Ib1.imag,2)*1j,\"A\"\n",
- "print \"Ib2 =\",round(Ib2.real,2)+round(Ib2.imag,2)*1j,\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The sequence currents of red phase are:\n",
- "Ir0 = (3+1.33j) A\n",
- "Ir1 = (10.85+10.13j) A\n",
- "Ir2 = (-1.85-5.46j) A\n",
- "\n",
- "The sequence currents of red phase are:\n",
- "Iy0 = (3+1.33j) A\n",
- "Iy1 = (3.35-14.5j) A\n",
- "Iy2 = (5.7+1.13j) A\n",
- "\n",
- "The sequence currents of red phase are:\n",
- "Ib0 = (3+1.33j) A\n",
- "Ib1 = (-14.2+4.33j) A\n",
- "Ib2 = (-3.8+4.33j) A\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.4, Page Number: 430"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Er0 = 100 #zero sequence voltage of phase R(V)\n",
- "Er1 = 200-100j #positive sequence voltage of phase R(V)\n",
- "Er2 = -100 #negative sequence voltage of phase R(V)\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "Er = Er0+Er1+Er2 #V\n",
- "Ey = Er0+a**2*Er1+a*Er2 #V\n",
- "Eb = Er0+a*Er1+a**2*Er2 #V\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The phase voltages are:\"\n",
- "print \"Er =\",(round(abs(Er),2),round(rad2deg(angle(Er)),2)),\"V\"\n",
- "print \"Ey =\",(round(abs(Ey)),round(rad2deg(angle(Ey)),2)),\"V\"\n",
- "print \"Eb =\",(round(abs(Eb),2),round(rad2deg(angle(Eb)),1)),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The phase voltages are:\n",
- "Er = (223.61, -26.57) V\n",
- "Ey = (213.0, -99.9) V\n",
- "Eb = (338.59, 66.2) V\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.5, Page Number: 431"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Er0 = 0.5-0.866j #zero sequence components of red phase(V)\n",
- "Er1 = 2+0j #positive sequence components of red phase(V)\n",
- "Er = 3+0j #phase R voltage(V)\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "Er2 = Er-(Er0+Er1) #negative sequence voltage of red phase(V)\n",
- "Ey = Er0+a**2*Er1+a*Er2 #phase Y voltage(V)\n",
- "Eb = Er0+a*Er1+a**2*Er2 #phase B voltage(V)\n",
- "\n",
- "#Result:\n",
- "print \"The negative sequence component of red phase is\"\n",
- "print \"Ir2 = (\",round(abs(Er2)),round(rad2deg(angle(Er2))),\") V\"\n",
- "print \"\\nThe phase voltages are:\"\n",
- "print \"Iy = (\",round(abs(Ey)),round(rad2deg(angle(Ey))),\") V\"\n",
- "print \"Ib = (\",round(abs(Eb)),round(rad2deg(angle(Eb))),\") V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The negative sequence component of red phase is\n",
- "Ir2 = ( 1.0 60.0 ) V\n",
- "\n",
- "The phase voltages are:\n",
- "Iy = ( 3.0 -120.0 ) V\n",
- "Ib = ( 0.0 120.0 ) V\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.6, Page Number: 431"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "In = 12 #current from neutral to ground(A)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I0 = In/3 #A\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The zero phase sequence components in phases are\",I0,\"A each\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The zero phase sequence components in phases are 4.0 A each\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.7, Page Number: 432"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "#(i) Before removal of fuses.\n",
- "Iri = cmath.rect(90,0) #phase R current(A)\n",
- "Iyi = cmath.rect(90,math.pi/180*240) #phase Y current(A)\n",
- "Ibi = cmath.rect(90,math.pi/180*120) #phase B current(A)\n",
- "\n",
- "#(ii) After removal of fuses.\n",
- "Irii = 90+0j #A\n",
- "Iyii = 0 #A\n",
- "Ibii = 0 #A\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "#(i) Before removal of fuses.\n",
- "#Since the system is balanced, it will have only positive sequence currents.\n",
- "Ir1i = Iri #A\n",
- "Iy1i = Iyi #A\n",
- "Ib1i = Ibi #A\n",
- "\n",
- "\n",
- "\n",
- "#(ii) After removal of fuses.\n",
- "#The sequence currents in the three lines will be:\n",
- "Ir0ii = 1/3*(Irii+Iyii+Ibii) #A\n",
- "Iy0ii = Ir0ii #A\n",
- "Ib0ii = Ir0ii #A\n",
- "\n",
- "Ir1ii = 1/3*(Irii+Iyii+Ibii) #A\n",
- "Iy1ii = a**2*Ir1ii #A\n",
- "Ib1ii = a*Ir1ii #A\n",
- "\n",
- "Ir2ii = 1/3*(Irii+a**2*Iyii+a*Ibii) #A\n",
- "Iy2ii = a*Ir2ii #A\n",
- "Ib2ii = a**2*Ir2ii #A\n",
- "\n",
- "#Result:\n",
- "print \"(i) Before removal of fuses, the symmetrical components are:\"\n",
- "print \"\\tIr1 = (\",round(abs(Ir1i)),round(rad2deg(angle(Ir1i))),\") A\"\n",
- "print \"\\tIy1 = (\",round(abs(Iy1i)),360+round(rad2deg(angle(Iy1i))),\") A\"\n",
- "print \"\\tIb1 = (\",round(abs(Ib1i)),round(rad2deg(angle(Ib1i))),\") A\"\n",
- "print \"\\n(ii) After the removal of fuses, the symmetrical components are:\"\n",
- "print \"\\tIr0 = (\",round(abs(Ir0ii)),round(rad2deg(angle(Ir0ii))),\") A\"\n",
- "print \"\\tIr1 = (\",round(abs(Ir1ii)),round(rad2deg(angle(Ir1ii))),\") A\"\n",
- "print \"\\tIr2 = (\",round(abs(Ir2ii)),round(rad2deg(angle(Ir2ii))),\") A\"\n",
- "print \"\\n\\tIy0 = (\",round(abs(Iy0ii)),round(rad2deg(angle(Iy0ii))),\") A\"\n",
- "print \"\\tIy1 = (\",round(abs(Iy1ii)),360+round(rad2deg(angle(Iy1ii))),\") A\"\n",
- "print \"\\tIy2 = (\",round(abs(Iy2ii)),round(rad2deg(angle(Iy2ii))),\") A\"\n",
- "print \"\\n\\tIb0 = (\",round(abs(Ib0ii)),round(rad2deg(angle(Ib0ii))),\") A\"\n",
- "print \"\\tIb1 = (\",round(abs(Ib1ii)),round(rad2deg(angle(Ib1ii))),\") A\"\n",
- "print \"\\tIb2 = (\",round(abs(Ib2ii)),360+round(rad2deg(angle(Ib2ii))),\") A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Before removal of fuses, the symmetrical components are:\n",
- "\tIr1 = ( 90.0 0.0 ) A\n",
- "\tIy1 = ( 90.0 240.0 ) A\n",
- "\tIb1 = ( 90.0 120.0 ) A\n",
- "\n",
- "(ii) After the removal of fuses, the symmetrical components are:\n",
- "\tIr0 = ( 30.0 0.0 ) A\n",
- "\tIr1 = ( 30.0 0.0 ) A\n",
- "\tIr2 = ( 30.0 0.0 ) A\n",
- "\n",
- "\tIy0 = ( 30.0 0.0 ) A\n",
- "\tIy1 = ( 30.0 240.0 ) A\n",
- "\tIy2 = ( 30.0 120.0 ) A\n",
- "\n",
- "\tIb0 = ( 30.0 0.0 ) A\n",
- "\tIb1 = ( 30.0 120.0 ) A\n",
- "\tIb2 = ( 30.0 240.0 ) A\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.8, Page Number: 433"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Ir1 = cmath.rect(200,0) #positive phase sequence component of current(A)\n",
- "Ir2 = cmath.rect(100,60*math.pi/180) #negative phase sequence component of current(A)\n",
- "In = cmath.rect(300,300*math.pi/180) #current in the neutral conductor(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "Ir0 = 1/3*In #Zero phase sequence current in R-line(A)\n",
- "Ir = Ir0+Ir1+Ir2 #Current in the R-line(A)\n",
- "Iy = Ir0+a**2*Ir1+a*Ir2 #Current in the Y-line(A)\n",
- "Ib = Ir0+a*Ir1+a**2*Ir2 #Current in the B-line(A)\n",
- "\n",
- "#Result:\n",
- "print \"Current in the R-line is\"\n",
- "print \"\\tIr = (\",round(abs(Ir)),round(rad2deg(angle(Ir))),\") A\"\n",
- "print \"Current in the Y-line is\"\n",
- "print \"\\tIy = (\",round(abs(Iy)),round(rad2deg(angle(Iy))),\") A\"\n",
- "print \"Current in the B-line is\"\n",
- "print \"\\tIb = (\",round(abs(Ib)),round(rad2deg(angle(Ib))),\") A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current in the R-line is\n",
- "\tIr = ( 300.0 0.0 ) A\n",
- "Current in the Y-line is\n",
- "\tIy = ( 300.0 -120.0 ) A\n",
- "Current in the B-line is\n",
- "\tIb = ( 0.0 180.0 ) A\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.9, Page Number: 434"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Ir = cmath.rect(10,0) #current in line R(A)\n",
- "Iy = cmath.rect(10,180*math.pi/180) #current in line Y(A)\n",
- "Ib = cmath.rect(0,0) #current in line B(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "#For R-line:\n",
- "Ir0 = 1/3*(Ir+Iy+Ib) #zero sequence component of Ir(A)\n",
- "Ir1 = 1/3*(Ir+a*Iy+a**2*Ib) #positive sequence component of Ir(A)\n",
- "Ir2 = 1/3*(Ir+a**2*Iy+a*Ib) #negative sequence component of Iy(A)\n",
- "\n",
- "#For Y-line:\n",
- "Iy0 = Ir0 #zero sequence component of Ir(A)\n",
- "Iy1 = a**2*Ir1 #positive sequence component of Ir(A)\n",
- "Iy2 = a*Ir2 #negative sequence component of Iy(A)\n",
- "\n",
- "#For B-line:\n",
- "Ib0 = Ir0 #zero sequence component of Ir(A)\n",
- "Ib1 = a*Ir1 #positive sequence component of Ir(A)\n",
- "Ib2 = a**2*Ir2 #negative sequence component of Iy(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The sequence components of R-line are:\"\n",
- "print \"\\tIr0 = (\",round(abs(Ir0),2),round(rad2deg(angle(Ir0))),\") A\"\n",
- "print \"\\tIr0 = (\",round(abs(Ir1),2),round(rad2deg(angle(Ir1))),\") A\"\n",
- "print \"\\tIr0 = (\",round(abs(Ir2),2),round(rad2deg(angle(Ir2))),\") A\"\n",
- "print \"The sequence components of Y-line are:\"\n",
- "print \"\\tIy0 = (\",round(abs(Iy0),2),round(rad2deg(angle(Iy0))),\") A\"\n",
- "print \"\\tIy1 = (\",round(abs(Iy1),2),round(rad2deg(angle(Iy1))),\") A\"\n",
- "print \"\\tIy2 = (\",round(abs(Iy2),2),round(rad2deg(angle(Iy2))),\") A\"\n",
- "print \"The sequence components of B-line are:\"\n",
- "print \"\\tIb0 = (\",round(abs(Ib0),2),round(rad2deg(angle(Ib0))),\") A\"\n",
- "print \"\\tIb1 = (\",round(abs(Ib1),2),round(rad2deg(angle(Ib1))),\") A\"\n",
- "print \"\\tIb2 = (\",round(abs(Ib2),2),round(rad2deg(angle(Ib2))),\") A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The sequence components of R-line are:\n",
- "\tIr0 = ( 0.0 90.0 ) A\n",
- "\tIr0 = ( 5.77 -30.0 ) A\n",
- "\tIr0 = ( 5.77 30.0 ) A\n",
- "The sequence components of Y-line are:\n",
- "\tIy0 = ( 0.0 90.0 ) A\n",
- "\tIy1 = ( 5.77 -150.0 ) A\n",
- "\tIy2 = ( 5.77 150.0 ) A\n",
- "The sequence components of B-line are:\n",
- "\tIb0 = ( 0.0 90.0 ) A\n",
- "\tIb1 = ( 5.77 90.0 ) A\n",
- "\tIb2 = ( 5.77 -90.0 ) A\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.10, Page Number: 435"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "Rrb = 10 #resistance of branch RB(ohm)\n",
- "Rry = 20 #resistance of branch RY(ohm)\n",
- "Rby = 5 #resistance of branch BY(ohm)\n",
- "Er = cmath.rect(-100,0) #voltage across BY(V)\n",
- "Ey = cmath.rect(100,60*math.pi/180) #voltage across BR(V)\n",
- "Eb = cmath.rect(100,-60*math.pi/180) #voltage across RY(V)\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "IR = Er/Rby #Current in in branch BY(A)\n",
- "IY = Ey/Rrb #Current in in branch RB(A)\n",
- "IB = Eb/Rry #Current in in branch RY(A)\n",
- "\n",
- "#Sequence currents in resistors:\n",
- "IR0 = 1/3*(IR+IY+IB) #Zero sequence component of IR(A)\n",
- "IR1 = 1/3*(IR+a*IY+a**2*IB) #Positive sequence component of IR(A)\n",
- "IR2 = 1/3*(IR+a**2*IY+a*IB) #Negative sequence component of IR(A)\n",
- "\n",
- "IY0 = IR0 #Zero sequence component of IY(A)\n",
- "IY1 = a**2*IR1 #Positive sequence component of IY(A)\n",
- "IY2 = a*IR2 #Negative sequence component of IY(A)\n",
- "\n",
- "IB0 = IR0 #Zero sequence component of IB(A)\n",
- "IB1 = a*IR1 #Positive sequence component of IB(A)\n",
- "IB2 = a**2*IR2 #Negative sequence component of IB(A)\n",
- "\n",
- "#Sequence currents in supply lines:\n",
- "Ir = IB-IY #Line current in R-line(A)\n",
- "Iy = IR-IB #Line current in Y-line(A)\n",
- "Ib = IY-IR #Line current in R-line(A)\n",
- "\n",
- "Ir0 = 1/3*(Ir+Iy+Ib) #Zero sequence component of Ir(A)\n",
- "Ir1 = 1/3*(Ir+a*Iy+a**2*Ib) #Positive sequence component of Ir(A)\n",
- "Ir2 = 1/3*(Ir+a**2*Iy+a*Ib) #Negative sequence component of Ir(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The sequence components of R-line are:\"\n",
- "print \"\\tIR0 = (\",round(abs(IR0),2),round(rad2deg(angle(IR0)),1),\") A\"\n",
- "print \"\\tIR1 = (\",round(abs(IR1),2),round(rad2deg(angle(IR1))),\") A\"\n",
- "print \"\\tIR2 = (\",round(abs(IR2),2),round(rad2deg(angle(IR2)),1),\") A\"\n",
- "print \"\\nThe sequence components of Y-line are:\"\n",
- "print \"\\tIY0 = (\",round(abs(IY0),2),round(rad2deg(angle(IY0)),1),\") A\"\n",
- "print \"\\tIY1 = (\",round(abs(IY1),2),round(rad2deg(angle(IY1))),\") A\"\n",
- "print \"\\tIY2 = (\",round(abs(IY2),1),round(rad2deg(angle(IY2)),1),\") A\"\n",
- "print \"\\nThe sequence components of B-line are:\"\n",
- "print \"\\tIB0 = (\",round(abs(IB0),2),round(rad2deg(angle(IB0)),1),\") A\"\n",
- "print \"\\tIB1 = (\",round(abs(IB1),2),360+round(rad2deg(angle(IB1))),\") A\"\n",
- "print \"\\tIB2 = (\",round(abs(IB2),1),round(rad2deg(angle(IB2)),1),\") A\"\n",
- "print \"\\nThe Sequence currents in supply lines are:\"\n",
- "print \"\\tIr0 = (\",round(abs(Ir0),2),round(rad2deg(angle(Ir0))),\") A\"\n",
- "print \"\\tIr1 = (\",round(abs(Ir1),1),round(rad2deg(angle(Ir1))),\") A\"\n",
- "print \"\\tIr2 = (\",round(abs(Ir2),2),round(rad2deg(angle(Ir2)),1),\") A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The sequence components of R-line are:\n",
- "\tIR0 = ( 4.41 160.9 ) A\n",
- "\tIR1 = ( 11.67 180.0 ) A\n",
- "\tIR2 = ( 4.41 -160.9 ) A\n",
- "\n",
- "The sequence components of Y-line are:\n",
- "\tIY0 = ( 4.41 160.9 ) A\n",
- "\tIY1 = ( 11.67 60.0 ) A\n",
- "\tIY2 = ( 4.4 -40.9 ) A\n",
- "\n",
- "The sequence components of B-line are:\n",
- "\tIB0 = ( 4.41 160.9 ) A\n",
- "\tIB1 = ( 11.67 300.0 ) A\n",
- "\tIB2 = ( 4.4 79.1 ) A\n",
- "\n",
- "The Sequence currents in supply lines are:\n",
- "\tIr0 = ( 0.0 0.0 ) A\n",
- "\tIr1 = ( 20.2 -90.0 ) A\n",
- "\tIr2 = ( 7.64 109.1 ) A\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.11, Page Number: 437"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "I = 20 #current in each line(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "#Let R, Y and B be the supply lines. When fuse in the \n",
- "#line B is removed, the various line currents are :\n",
- "Ir = cmath.rect(I,0) #A\n",
- "Iy = cmath.rect(I,math.pi) #A\n",
- "Ib = cmath.rect(0,0) #A\n",
- "\n",
- "#For R-line:\n",
- "Ir0 = 1/3*(Ir+Iy+Ib) #zero sequence component of Ir(A)\n",
- "Ir1 = 1/3*(Ir+a*Iy+a**2*Ib) #positive sequence component of Ir(A)\n",
- "Ir2 = 1/3*(Ir+a**2*Iy+a*Ib) #negative sequence component of Iy(A)\n",
- "\n",
- "#For Y-line:\n",
- "Iy0 = Ir0 #zero sequence component of Ir(A)\n",
- "Iy1 = a**2*Ir1 #positive sequence component of Ir(A)\n",
- "Iy2 = a*Ir2 #negative sequence component of Iy(A)\n",
- "\n",
- "#For B-line:\n",
- "Ib0 = Ir0 #zero sequence component of Ir(A)\n",
- "Ib1 = a*Ir1 #positive sequence component of Ir(A)\n",
- "Ib2 = a**2*Ir2 #negative sequence component of Iy(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The sequence components of R-line are:\"\n",
- "print \"\\tIr0 = (\",round(abs(Ir0),2),round(rad2deg(angle(Ir0))),\") A\"\n",
- "print \"\\tIr0 = (\",round(abs(Ir1),2),round(rad2deg(angle(Ir1))),\") A\"\n",
- "print \"\\tIr0 = (\",round(abs(Ir2),2),round(rad2deg(angle(Ir2))),\") A\"\n",
- "print \"\\nThe sequence components of Y-line are:\"\n",
- "print \"\\tIy0 = (\",round(abs(Iy0),2),round(rad2deg(angle(Iy0))),\") A\"\n",
- "print \"\\tIy1 = (\",round(abs(Iy1),2),360+round(rad2deg(angle(Iy1))),\") A\"\n",
- "print \"\\tIy2 = (\",round(abs(Iy2),2),round(rad2deg(angle(Iy2))),\") A\"\n",
- "print \"\\nThe sequence components of B-line are:\"\n",
- "print \"\\tIb0 = (\",round(abs(Ib0),2),round(rad2deg(angle(Ib0))),\") A\"\n",
- "print \"\\tIb1 = (\",round(abs(Ib1),2),round(rad2deg(angle(Ib1))),\") A\"\n",
- "print \"\\tIb2 = (\",round(abs(Ib2),2),360+round(rad2deg(angle(Ib2))),\") A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The sequence components of R-line are:\n",
- "\tIr0 = ( 0.0 90.0 ) A\n",
- "\tIr0 = ( 11.55 -30.0 ) A\n",
- "\tIr0 = ( 11.55 30.0 ) A\n",
- "\n",
- "The sequence components of Y-line are:\n",
- "\tIy0 = ( 0.0 90.0 ) A\n",
- "\tIy1 = ( 11.55 210.0 ) A\n",
- "\tIy2 = ( 11.55 150.0 ) A\n",
- "\n",
- "The sequence components of B-line are:\n",
- "\tIb0 = ( 0.0 90.0 ) A\n",
- "\tIb1 = ( 11.55 90.0 ) A\n",
- "\tIb2 = ( 11.55 270.0 ) A\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.12, Page Number: 438"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "import cmath\n",
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "Zr = 5-10j #impedance connected to line R(ohm)\n",
- "Zy = 6+5j #impedance connected to line Y(ohm)\n",
- "Zb = 3+15j #impedance connected to line B(ohm)\n",
- "VRY = cmath.rect(3300,0) #line RY voltage(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "VYB = a**2*VRY #line YB voltage(V)\n",
- "\n",
- "#Let VR, VY, and VB be the voltages across impedances in R, Y and B\n",
- "#phases respectively and IR, IY, and IB the resulting line currents.\n",
- "IR, IY,IB,IR0,IR1,IR2, = symbols('IR IY IB IR0 IR1 IR2')\n",
- "\n",
- "#IR+IY+IB = 0\n",
- "IR0 = 0; IY0 = 0; IB0 = 0;\n",
- "VR = Zr*(IR0+IR1+IR2) #V\n",
- "VY = Zy*(a**2*IR1+a*IR2) #V\n",
- "VB = Zb*(a*IR1+a**2*IR2) #V\n",
- "#solving the equations:\n",
- "IR11 = solve(VR-VY-VRY,IR1)[0]\n",
- "VY = Zy*(a**2*IR11+a*IR2)\n",
- "VB = Zb*(a*IR11+a**2*IR2)\n",
- "IR22 = solve(VY-VB-VYB,IR2)[0]\n",
- "\n",
- "VR = Zr*(IR0+IR1+IR22)\n",
- "VY = Zy*(a**2*IR1+a*IR22)\n",
- "IR11 = solve(VR-VY-VRY,IR1)[0]\n",
- "IR = IR11+IR22 #A\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The line current IR is (\",round(abs(IR)),round(-rad2deg(cmath.phase(IR)),1),\") A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The line current IR is ( 241.0 -18.5 ) A\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.13, Page Number: 440"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "R = 1 #resistance of each load(ohm)\n",
- "magVRY = 200 #line RY voltage(V)\n",
- "magVBR = 400 #line BR voltage(V)\n",
- "magVYB = 346 #line YB voltage(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "a = cmath.rect(1,120*math.pi/180)\n",
- "#This is a case of a balanced star-connected load supplied\n",
- "#from an unbalanced 3-phase supply.\n",
- "\n",
- "#Now,\n",
- "\n",
- "# (2)**22 = (1 + 1\u00b775 cos(theta))**2 + (1\u00b775 sin(theta))**2\n",
- "# theta = math.acos(4-1+3*1)/3.5\n",
- "theta = math.pi/2\n",
- "# alpha = math.acos(1+1.75*math.cos(theta))\n",
- "alpha = 60*math.pi/180\n",
- "\n",
- "#As the phase sequence is RYB, therefore, various line voltages are :\n",
- "VRY = cmath.rect(200,math.pi) #V\n",
- "VYB = cmath.rect(346,theta) #V\n",
- "VBR = cmath.rect(400,-alpha) #V\n",
- "\n",
- "#The current in any phase (or line) is equal to phase voltage \n",
- "#divided by resistance in that phase.\n",
- "IR = VRY/(1*3**0.5) #A\n",
- "IY = VYB/(1*3**0.5) #A\n",
- "IB = VBR/(1*3**0.5) #A\n",
- "\n",
- "#Sequence components in red phase are :\n",
- "IR0 = 1/3*(IR+IY+IB) #A\n",
- "IR1 = 1/3*(IR+a*IY+a**2*IB) #A\n",
- "IR2 = 1/3*(IR+a**2*IY+a*IB) #A\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The magnitude of current in any phase is:\"\n",
- "print \"\\tIR0 = (\",round(abs(IR0)),round(rad2deg(angle(IR0))),\") A\"\n",
- "print \"\\tIR1 = (\",round(abs(IR1),1),round(rad2deg(angle(IR1))),\") A\"\n",
- "print \"\\tIR2 = (\",round(abs(IR2),2),round(rad2deg(angle(IR2))),\") A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The magnitude of current in any phase is:\n",
- "\tIR0 = ( 0.0 -90.0 ) A\n",
- "\tIR1 = ( 176.3 -169.0 ) A\n",
- "\tIR2 = ( 66.63 30.0 ) A\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.14, Page Number: 449"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "MVAg = 10 #MVA rating of generator\n",
- "Vg = 11 #voltage rating of generator(kV)\n",
- "Zg1 = 1.2j #Positive sequence impedance of generator(ohm)\n",
- "Zg2 = 0.9j #Negative sequence impedance of generator(ohm)\n",
- "Zg0 = 0.4j #Zero sequence impedance of generator(ohm)\n",
- "Zf1 = 1.0j #Positive sequence impedance of feeder(ohm)\n",
- "Zf2 = 1.0j #Negative sequence impedance of feeder(ohm)\n",
- "Zf0 = 3.0j #Zero sequence impedance of feeder(ohm)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Suppose the fault is occured on the red phase. \n",
- "#Taking red phase as the reference,\n",
- "ER = Vg*1000/3**0.5 #Phase e.m.f. of R-phase(V)\n",
- "\n",
- "#(i)The total impedance to any sequence current is given by\n",
- "#the sum of generator and feeder impedances to that sequence current.\n",
- "Z1 = Zg1+Zf1 #ohm\n",
- "Z2 = Zg2+Zf2 #ohm\n",
- "Z0 = Zg0+Zf0 #ohm\n",
- "\n",
- "#For a line-to-ground fault,\n",
- "#I1 = I2 = I0\n",
- "I0 = ER/(Z1+Z2+Z0) #A\n",
- "IR = 3*I0 #fault current(A)\n",
- "\n",
- "#(ii)Line-to-neutral voltage of R-phase,\n",
- "VR = ER-I0*(Zg1+Zg2+Zg0) #V\n",
- "\n",
- "#Result:\n",
- "print \"(i) The magnitude of fault current is\",round(IR.imag)*1j,\"A\"\n",
- "print \"(ii) Line to neutral voltage at the generator terminal is\",round(abs(VR)),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The magnitude of fault current is (-0-2540j) A\n",
- "(ii) Line to neutral voltage at the generator terminal is 4234.0 V\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.15, Page Number: 450"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "Vg = 11000 #voltage rating of the alternator(V)\n",
- "MVAg = 10 #MVA rating of generator\n",
- "X0 = 0.05 #zero sequence reactance(p.u)\n",
- "X1 = 0.15 #positive sequence reactance(p.u)\n",
- "X2 = 0.15 #negative sequence reactance(p.u)\n",
- "\n",
- "#Calculation:\n",
- "#Taking red phase as the reference, let its phase e.m.f. be\n",
- "ER = 1 #p.u\n",
- "\n",
- "#Line-to-ground fault: \n",
- "#Suppose the fault occurs on the red phase.\n",
- "#I1 = I2 = I0\n",
- "I0 = ER/(1j*(X0+X1+X2))\n",
- "IR = 3*I0 #fault current(A)\n",
- "\n",
- "#Three phase fault: \n",
- "#the fault current (say Ish) is limited by the positive sequence reactance only.\n",
- "Ish = ER/(1j*X1) #fault current(A)\n",
- "r = IR/Ish #ratio of the two fault currents\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The ratio of two fault currents is\",round(abs(r),3)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The ratio of two fault currents is 1.286\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.16, Page Number: 450"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "Vg = 11 #voltage rating of the alternator(kV)\n",
- "MVAg = 25 #MVA rating of generator\n",
- "X0 = 0.05 #zero sequence reactance(p.u)\n",
- "X1 = 0.2 #positive sequence reactance(p.u)\n",
- "X2 = 0.2 #negative sequence reactance(p.u)\n",
- "Xn = 0.3 #neutral to ground reactance(ohm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Assume that the fault occurs on the red phase.\n",
- "#Taking red phase as the reference, let its phase e.m.f. be \n",
- "ER = 1 #p.u.\n",
- "#First of all, convert the reactance Xn into p.u.\n",
- "Xnp = Xn*MVAg*1000/(Vg**2*1000) #p.u\n",
- "#For a line-to-ground fault,\n",
- "#I1 = I2 = I0\n",
- "I0 = ER/(X1+X2+X0+3*Xnp) #p.u\n",
- "IR = 3*I0 #fault current(p.u)\n",
- "IRa = MVAg*10**6/(3**0.5*Vg*1000) * IR #fault current in amperes\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \" The fault current for a single line to ground fault is\",round(IRa),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " The fault current for a single line to ground fault is 6190.0 A\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.17, Page Number: 451"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "V = 10.4 #voltage between the lines(kV)\n",
- "X0 = 0.2j #zero sequence reactance(p.u)\n",
- "X1 = 0.6j #positive sequence reactance(p.u)\n",
- "X2 = 0.5j #negative sequence reactance(p.u)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Taking red phase as the reference, its phase e.m.f. is :\n",
- "ER = round(V*1000/3**0.5) #Phase e.m.f. of R-phase(V)\n",
- "IF = 3**0.5*ER/(X1+X2) #fault current(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The fault current is\",round(abs(IF),1),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The fault current is 9453.8 A\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.18, Page Number: 451"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "X0 = 0.05j #zero sequence reactance(p.u)\n",
- "X1 = 0.08j #positive sequence reactance(p.u)\n",
- "X2 = 0.07j #negative sequence reactance(p.u)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Taking red phase as the reference, let its phase e.m.f. be \n",
- "ER = 1 #p.u\n",
- "#For a double line-to-ground fault,\n",
- "#IF = IY+IB\n",
- "IF = -3*X2*ER/(X1*X2+X2*X0+X2*X0) #fault current(A)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The fault current is\",round(IF.imag,1)*1j,\"p.u\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The fault current is 16.7j p.u\n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.19, Page Number: 452"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "MVAg = 20 #MVA rating of generator\n",
- "V = 11 #voltage rating of generator(V)\n",
- "X1 = 20 #positive sequence reactance of generator(%)\n",
- "X2 = 10 #negative sequence reactance of generator(%)\n",
- "X0 = 15 #zero sequence reactance of generator(%)\n",
- "Xn = 5 #generator 1 neutral reactance(%)\n",
- "\n",
- "#Calculation:\n",
- "ER = V*1000/3**0.5 #V\n",
- "#The % reactances in Fig. 18.19b can be converted into ohmic values as under:\n",
- "x1 = X1*V**2*10/(MVAg*1000) #ohm\n",
- "x2 = X2*V**2*10/(MVAg*1000) #ohm\n",
- "x0 = X0*V**2*10/(MVAg*1000) #ohm\n",
- "IR = 3*ER/(x1+x2+x0)*(-1j) #ohm\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Fault current is\",round(IR.imag)*1j,\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Fault current is (-0-6998j) A\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 18.20, Page Number: 453"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "IF1 = 2000 #3 phase fault current(A)\n",
- "IF2 = 2600 #line-to-line fault(A)\n",
- "IF0 = 4200 #line-toground fault(A)\n",
- "MVAg = 50 #MVA rating of the generator\n",
- "V = 11 #voltage rating of the generator(V)\n",
- "\n",
- "#Calculation:\n",
- "#Let X1 = positive sequence reactance,\n",
- "# X2 = negative sequence reactance,and\n",
- "# X0 = zero sequence reactance of the alternator.\n",
- "X1,X2,X0 = symbols('X1 X2 X0')\n",
- "Eph = V*1000/3**0.5 #phase voltage(V)\n",
- "X11 = solve(Eph/X1-IF1)[0] #positive sequence reactance(ohm)\n",
- "X22 = solve(3**0.5*Eph/(X11+X2)-IF2,X2)[0] #negative sequence reactance(ohm)\n",
- "X00 = solve(3*Eph/(X11+X22+X0)-IF0)[0] #zero sequence reactance(ohm)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The positive sequence reactance is\",round(X11,3),\"ohm\"\n",
- "print \"The negative sequence reactance is\",round(X22,3),\"ohm\"\n",
- "print \"The zero sequence reactance is\",round(X00,3),\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The positive sequence reactance is 3.175 ohm\n",
- "The negative sequence reactance is 1.055 ohm\n",
- "The zero sequence reactance is 0.306 ohm\n"
- ]
- }
- ],
- "prompt_number": 20
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter19_1.ipynb b/Principles_of_Power_System/chapter19_1.ipynb deleted file mode 100644 index e6813a0f..00000000 --- a/Principles_of_Power_System/chapter19_1.ipynb +++ /dev/null @@ -1,212 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:34f21e34d56021d11e412854716405b885521e02b7e263afa0b62d127f14da0d"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 19: Circuit Breakers"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 19.1, Page Number: 483"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "I = 1500 #rated current of circuit breaker(A)\n",
- "MVA = 1000 #MVA rating of CB\n",
- "V = 33 #voltage rating of circuit breaker(kV)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Is = MVA*10**6/(3**0.5*33*1000) #Rated symmetrical breaking current(A,rms)\n",
- "Im = 2.55*Is #Rated making current(A,peak)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Rated normal current is\",I,\"A\"\n",
- "print \"(ii) Breaking capacity is\",MVA,\"MVA\"\n",
- "print \"(iii) Rated symmetrical breaking current is\",round(Is),\"A (peak)\"\n",
- "print \"(iv) Rated making current is\",round(Im),\"A (peak)\"\n",
- "print \"(v) Short-time rating is\",round(Is),\"for 3 seconds\"\n",
- "print \"(vi) Rated service voltage is\",V,\"kV (r.m.s)\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Rated normal current is 1500 A\n",
- "(ii) Breaking capacity is 1000 MVA\n",
- "(iii) Rated symmetrical breaking current is 17495.0 A (peak)\n",
- "(iv) Rated making current is 44613.0 A (peak)\n",
- "(v) Short-time rating is 17495.0 for 3 seconds\n",
- "(vi) Rated service voltage is 33 kV (r.m.s)\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 19.2, Page Number: 484"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "f = 50 #supply frequency(Hz)\n",
- "V = 11 #voltage rating of generator(V)\n",
- "C = 0.01 #distributed capacitance upto ckt breaker b/w phase and neutral(uF)\n",
- "XL = 5 #reactance of neatral to earth(ohm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "L = round(XL/(2*math.pi*f),4) #Inductance per phase(H)\n",
- "Emax = round(2**0.5*V/3**0.5,2) #Maximum value of recovery voltage (phase to neutral)(V\n",
- "E = 2*Emax #Peak re-striking voltage(kV)\n",
- "fn = 1/(2*3.14*(L*C*10**-6)**0.5) #frequency of oscillations(Hz)\n",
- "\n",
- "#Since peak re-striking voltage occurs at a time t given by\n",
- "t = 1/(2*fn) #s\n",
- "r = E/t #kV/sec\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Peak re-striking voltage is\",round(E,2),\"kV\"\n",
- "print \"(ii) Frequency of oscillations is\",round(fn),\"Hz\"\n",
- "print \"(iii)The average rate of rise of re-striking voltage\"\n",
- "print \" upto the first peak is\",math.floor(r/1000),\"*10**3 kV/sec\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Peak re-striking voltage is 17.96 kV\n",
- "(ii) Frequency of oscillations is 12628.0 Hz\n",
- "(iii)The average rate of rise of re-striking voltage\n",
- " upto the first peak is 453.0 *10**3 kV/sec\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 19.3, Page Number: 484"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable delaration:\n",
- "t = 50*10**-6 #time to reach the peak re-striking voltage(s)\n",
- "Vp = 100 #the peak re-striking voltage(kV)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "R = Vp/t #Average RRRV(kV/sec)\n",
- "fn = 1/(2*t) #Natural frequency of oscillations(Hz)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Average RRRV is\",R/10**6,\"* 10**6 kV/sec\"\n",
- "print \"Natural frequency of oscillations is\",fn,\"Hz\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Average RRRV is 2.0 * 10**6 kV/sec\n",
- "Natural frequency of oscillations is 10000.0 Hz\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 19.4, Page Number: 485"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "Im = 11 #magnetising current of transformer(A)\n",
- "Ic = 7 #chopped instantaneous value of current(A)\n",
- "L = 35.2 #inductance (H)\n",
- "C = 0.0023 #capacitance(uF)\n",
- "\n",
- "\n",
- "#Result:\n",
- "e = Ic*(L/(C*10**-6))**0.5 #Voltage across breaker contacts at chopping(V)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Voltage across breaker contacts at chopping is\",round(e/1000),\"kV\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage across breaker contacts at chopping is 866.0 kV\n"
- ]
- }
- ],
- "prompt_number": 10
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter1_1.ipynb b/Principles_of_Power_System/chapter1_1.ipynb deleted file mode 100644 index 95ebdafe..00000000 --- a/Principles_of_Power_System/chapter1_1.ipynb +++ /dev/null @@ -1,68 +0,0 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 1: Introduction"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 1.1, Page Number: 6"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "Pi = 4200 #input power(W)\n",
- "E = 120 #voltage supply of generator(V)\n",
- "I = 32.2 #supply current(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Po = E*I #output power(W)\n",
- "n = Po/Pi*100 #efficiency(%)\n",
- "Pl = Pi-Po #power lost(W)\n",
- "El = Pl*60 #energy lost per minute(J)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The percentage efficiency of the generator is\",n,\"%\"\n",
- "print \"Energy lost per minute of operation is\",El,\"J\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The percentage efficiency of the generator is 92.0 %\n",
- "Energy lost per minute of operation is 20160.0 J\n"
- ]
- }
- ],
- "prompt_number": 2
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter20_1.ipynb b/Principles_of_Power_System/chapter20_1.ipynb deleted file mode 100644 index 768f8fa6..00000000 --- a/Principles_of_Power_System/chapter20_1.ipynb +++ /dev/null @@ -1,64 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:37bb87f048a2d4a670b09cf05bff6f5c622ef838c4da8caa7225a316e1b26b5e"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 20: Fuses"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 20.1, Page Number: 495"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "r1 = 0.8 #radius of fuse wire(mm)\n",
- "I1 = 8 #blow current at r1 radius(A)\n",
- "I2 = 1 #blow current(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "r2 = r1*(I2/I1)**(2/3) #radius for bearing 1 A of blow current(mm)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The radius of the wire that will blow off at a current of 1A is\",r2,\"mm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The radius of the wire that will blow off at a current of 1A is 0.2 mm\n"
- ]
- }
- ],
- "prompt_number": 1
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter21_1.ipynb b/Principles_of_Power_System/chapter21_1.ipynb deleted file mode 100644 index dbd05a4b..00000000 --- a/Principles_of_Power_System/chapter21_1.ipynb +++ /dev/null @@ -1,69 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:74ef32d0e67f3d77b60188556b39e6627674afc8f6e4feb1b0bbc3ae8dbaee2a"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 21: Protective Relays"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 21.1, Page Number: 507"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "Is = 5 #rated secondary current of C.T\n",
- "CS = 1.25 #current setting\n",
- "TSM = 0.6 #time setting multiplier\n",
- "IF = 4000 #fault current(A)\n",
- "CR = 400/5 #current ratio of CT\n",
- "\n",
- "#Calculation:\n",
- "Ipc = Is*CS #pick-up current(A)\n",
- "If = IF*CR #Fault current in relay coil(A)\n",
- "PSM = If/Ipc #plug setting multiplier\n",
- "#Corresponding to the plug-setting multiplier of 8 given in fig.21.16,\n",
- "#the time of operation is 3.5 seconds.\n",
- "top = 3.5*TSM #Actual relay operating time(s)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The relay operating time is\",top,\"seconds\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The relay operating time is 2.1 seconds\n"
- ]
- }
- ],
- "prompt_number": 2
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter22_1.ipynb b/Principles_of_Power_System/chapter22_1.ipynb deleted file mode 100644 index 38d23b90..00000000 --- a/Principles_of_Power_System/chapter22_1.ipynb +++ /dev/null @@ -1,338 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:a5275b4f1bdd430cf4ed3e203b7e975d86c74b17fe608ee8e07ebac2f3a39a9f"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 22: Protection of Alternators and Transformers"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 22.1, Page Number: 529"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "MVA = 10 #MVA rating of alternator\n",
- "V = 6.6 #voltage rating of alternator(V)\n",
- "X = 10 #per phase reactance of lternator(%)\n",
- "Iop = 175 #operating current(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Vph = V*1000/3**0.5 #phase voltage(kV)\n",
- "I = round(MVA*10**6/(3**0.5*V*1000)) #full load current(A)\n",
- "\n",
- "#Let the reactance per phase be x ohms.\n",
- "r,x = symbols('r x') #r = earthing resistance required to leave 10% of\n",
- " #the winding unprotected\n",
- "x1 = solve(3**0.5*x*I/(6.6*1000)*100-10,x)[0]\n",
- "X1 = x1*0.1 #Reactance of 10% winding\n",
- "E = Vph*0.1 #E.M.F. induced in 10% winding\n",
- "Zf = (X1**2+r**2)**0.5\n",
- "Ief = E/Zf #Earth-fault current due to 10% winding\n",
- "\n",
- "#When this fault current becomes 175 A, the relay will trip\n",
- "r1 = solve(Ief-175,r)[1] #A\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Required value of earth resistance is\",round(r1,3),\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Required value of earth resistance is 2.177 ohm\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 22.2, Page Number: 530"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "MVA = 10 #MVA rating of alternator\n",
- "V = 6.6 #voltage rating of alternator(V)\n",
- "CR = 1000/5 #current ratio of CT\n",
- "Rn = 7.5 #resistance of star-point to earth(ohm)\n",
- "Iop = 0.5 #operating current of the relay(A)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let x % of the winding be unprotected.\n",
- "x = symbols('x')\n",
- "Vph = V*1000/3**0.5 #phase voltage(kV)\n",
- "If = 1000/5*Iop #minimum fault current which will operate the relay(A)\n",
- "E = Vph*x/100 #E.M.F. induced in x% winding(V)\n",
- "Ief = E/Rn #Earth fault current which x% winding will cause(A)\n",
- "#This current must be equal to 100 A.\n",
- "x1 = solve(Ief-If,x)[0]\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Percentage of unprotected winding is\",round(x1,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Percentage of unprotected winding is 19.68 %\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 22.3, Page Number: 530"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "MVA = 10 #MVA rating of alternator\n",
- "V = 6.6 #voltage rating of alternator(V)\n",
- "CR = 1000/5 #current ratio of CT\n",
- "Rn = 6 #resistance of star-point to earth(ohm)\n",
- "Iop = 0.75 #operating current of the relay(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let x % of the winding be unprotected.\n",
- "x = symbols('x')\n",
- "Vph = V*1000/3**0.5 #phase voltage(kV)\n",
- "If = 1000/5*Iop #minimum fault current which will operate the relay(A)\n",
- "E = Vph*x/100 #E.M.F. induced in x% winding(V)\n",
- "Ief = E/Rn #Earth fault current which x% winding will cause(A)\n",
- "#This current must be equal to 100 A.\n",
- "x1 = solve(Ief-If,x)[0]\n",
- "\n",
- "\n",
- "#(ii) Let r2 = the minimum earthing resistance required to \n",
- "#provide protection for 90% of stator winding. \n",
- "#Then, 10% winding would be unprotected\n",
- "x2 = 10 #%\n",
- "r2 = Vph*x2/If*0.01 #ohm\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The percentage of each of the stator windings is\",round(x1,1),\"%\"\n",
- "print \"(ii)The minimum resistance to provide protection for 90% of\"\n",
- "print \" the stator winding is\",round(r2,2),\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The percentage of each of the stator windings is 23.6 %\n",
- "(ii)The minimum resistance to provide protection for 90% of\n",
- " the stator winding is 2.54 ohm\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 22.4, Page Number: 531"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "MVA = 10 #MVA rating of alternator\n",
- "V = 6.6 #voltage rating of alternator(V)\n",
- "CR = 1000/5 #current ratio of CT\n",
- "s = 20 #earth-fault setting(%)\n",
- "Iop = 0.75 #operating current of the relay(A)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Since 85% winding is to be protected, 15% would be unprotected\n",
- "r = symbols('r') #earthing resistance reqd. to leave 15% of winding unprotected(ohm)\n",
- "x = 15 #%\n",
- "Ifl = MVA*10**6/(3**0.5*V*1000) #Full load current(A)\n",
- "IF = s*Ifl/100 #Minimum fault current which will operate the relay\n",
- "Vu = x/100*V*1000/3**0.5 #Voltage induced in 15% of winding(kV)\n",
- "Ief = Vu/r #Earth fault current which 15% winding will cause(A)\n",
- "#This current must be equal to IF.\n",
- "r1 = solve(Ief-IF,r)[0] #ohm\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The value of earthing resistor is\",round(r1,2),\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The value of earthing resistor is 3.27 ohm\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 22.5, Page Number: 538"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "r1 = 220/11000 #voltage ratio of transformer\n",
- "r2 = 600/5 #current ratio of protective transformer on 220V side\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Suppose that line current on 220 V side is 600 A\n",
- "\n",
- "Ipd = 5 #Phase current of delta connected CTs on 220V side(A)\n",
- "Ild = 3**0.5*Ipd #Line current of delta connected CTs on 220 V side(A)\n",
- "\n",
- "#This Ild will flow through the pilot wires.\n",
- "Ips = 5*3**0.5 #Phase current of star connected CTs on 11,000 V side(A)\n",
- "\n",
- "#Now, using this relation: Primary apparent power = Secondary apparent power\n",
- "I = 3**0.5*220*600/(3**0.5*11000) #A\n",
- "r3 = I/Ips #Turn-ratio of CTs on 11000 V side\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Turn-ratio of CTs on 11000 V side is (\",round(r3,3),\": 1 )\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Turn-ratio of CTs on 11000 V side is ( 1.386 : 1 )\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 22.6, Page Number: 538"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "r1 = 0.4/11 #line voltage(in kV) ratio of transformer\n",
- "r2 = 500/5 #current ratio of protective transformer\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Suppose the line current on 400 V side is 500 A.\n",
- "Ipd = 5 #Phase current of delta connected CTs on 400 V side(A)\n",
- "Ild = Ipd*3**0.5 #Line current of delta connected CTs on 400 V side(A)\n",
- "#This Ild will flow through the pilot wires.\n",
- "Ips = 5*3**0.5 #Phase current of star-connected CTs on 11000 V side(A)\n",
- "\n",
- "#Primary apparent power = Secondary apparent power\n",
- "I = 3**0.5*400*500/(3**0.5*11000) #A\n",
- "r3 = I/Ips\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \" The ratio of the protective transformers on 11kV side is\",round(r3,3),\"i.e, 10.5:5\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " The ratio of the protective transformers on 11kV side is 2.099 i.e, 10.5:5\n"
- ]
- }
- ],
- "prompt_number": 1
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter26_1.ipynb b/Principles_of_Power_System/chapter26_1.ipynb deleted file mode 100644 index d4334600..00000000 --- a/Principles_of_Power_System/chapter26_1.ipynb +++ /dev/null @@ -1,224 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:260bb8beffe2e4d2155fdaec0c7462f8cf5127d60c79f0bddb469ea9aad62673"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 26: Neutral Grounding"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 26.1, Page Number: 599"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "f = 50 #Supply frequency(Hz)\n",
- "C = 4.5*10**-6 #Line to earth capacitance(F)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "XL = 1/(3*2*math.pi*f*C) #ohm\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The reactance of Peterson coil is\",round(XL,1),\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The reactance of Peterson coil is 235.8 ohm\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 26.2, Page Number: 599"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "l = 200 #length of transmission line(km)\n",
- "f = 50 #Supply frequency(Hz)\n",
- "c = 0.02*10**-6 #Line to earth capacitance(F/km)\n",
- "V = 230 #voltage rating of line(kV)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "C = c*l #capacitance of coil(F)\n",
- "L = round(1/(3*(2*3.14*f)**2*C),2) #Required inductance of Peterson coil(H)\n",
- "Vph = round(V*1000/1.732) #Voltage across Peterson coil(kV)\n",
- "IF = math.ceil(Vph/(2*3.13*f*L)) #Current through Peterson coil(A)\n",
- "kVA = Vph*IF/1000 #Rating of Peterson coil\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "print \"Inductance of Peterson coil is\",L,\"H\"\n",
- "print \"Rating of Peterson coil is\",round(kVA),\"kVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Inductance of Peterson coil is 0.85 H\n",
- "Rating of Peterson coil is 66397.0 kVA\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 26.3, Page Number: 600"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "f = 50 #fequency of supply(Hz)\n",
- "C = 1.2*10**-6 #line-to-earth capacitance(F)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#(i) To neutralize capacitance of 100% of the length of the line,\n",
- "#Inductive reactance of the coilis given by\n",
- "XL1 = 1/(3*2*math.pi*f*C) #ohm\n",
- "\n",
- "#(ii) To neutralize capacitance of 90% of the length of the line,\n",
- "#Inductive reactance of the coilis given by\n",
- "XL2 = 1/(3*2*math.pi*f*0.9*C) #ohm\n",
- "\n",
- "\n",
- "#(iii) To neutralize capacitance of 80% of the length of the line,\n",
- "#Inductive reactance of the coilis given by\n",
- "XL3 = 1/(3*2*math.pi*f*0.8*C) #ohm\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Inductive reactance of the coil to neutralize capacitance\"\n",
- "print \" of 100% of the length of the line is\",round(XL1,2),\"ohm\"\n",
- "print \"\\n(ii) Inductive reactance of the coil to neutralize capacitance\"\n",
- "print \" of 100% of the length of 90% of the line is\",round(XL2,2),\"ohm\"\n",
- "print \"\\n(iii)Inductive reactance of the coil to neutralize capacitance\"\n",
- "print \" of 100% of the length of 80% of the line is\",round(XL3,2),\"ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Inductive reactance of the coil to neutralize capacitance\n",
- " of 100% of the length of the line is 884.19 ohm\n",
- "\n",
- "(ii) Inductive reactance of the coil to neutralize capacitance\n",
- " of 100% of the length of 90% of the line is 982.44 ohm\n",
- "\n",
- "(iii)Inductive reactance of the coil to neutralize capacitance\n",
- " of 100% of the length of 80% of the line is 1105.24 ohm\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 26.4, Page Number: 600"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r = 0.01 #radius of conductor(m)\n",
- "d = 4 #conductor spacing(m)\n",
- "V = 132 #voltage of the line(kV)\n",
- "f = 50 #supply frequency(Hz)\n",
- "l = 200 #line length(km)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "c = round(2*math.pi*8.885/math.log(d/r),1)*10**-12 #capacitance per unit length(F/m)\n",
- "C = c*l*1000 #Capacitance between phase and earth for 200 km line(F)\n",
- "L = round(1/(3*(2*math.pi*f)**2*C),2) #required inductance L of the arc suppression coil(H)\n",
- "IF = V*1000/(10*math.ceil(3**0.5*2*math.pi*f*L/10)) #Current through the coil(A)\n",
- "kVA = V/3**0.5*IF #kVA\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The inductance of the coil is\",L,\"H\"\n",
- "print \"Rating of the coil is\",round(kVA),\"kVA\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The inductance of the coil is 1.82 H\n",
- "Rating of the coil is 10060.0 kVA\n"
- ]
- }
- ],
- "prompt_number": 6
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter2_1.ipynb b/Principles_of_Power_System/chapter2_1.ipynb deleted file mode 100644 index daf8974b..00000000 --- a/Principles_of_Power_System/chapter2_1.ipynb +++ /dev/null @@ -1,857 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:a62a0cfa22010723ae84accbfbc8f3f3c553c1279f7bb65e42ceaaad44de0807"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 2:Generating Stations"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.1, Page Number: 16"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "n=20 #overall efficiency of plant\n",
- "h=860 #kcal\n",
- "m=0.6 #Mass of fuel burnt(kg) per KW of electrical energy generated\n",
- "\n",
- "#Calculations:\n",
- "x=h*100/(m*n) #Calorific value of fuel(kcal/kg)\n",
- "\n",
- "#Results:\n",
- "print \"Calorific value of fuel =\",round(x,2),\"kcal/kg\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Calorific value of fuel = 7166.67 kcal/kg\n"
- ]
- }
- ],
- "prompt_number": 31
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.2, Page Number: 17"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "M = 20000 #maximum demand(kW)\n",
- "n_b= 85 #boiler efficiency(%)\n",
- "m=0.9 #coal consumption(kg/kWh)\n",
- "LF=40 #load factor(%)\n",
- "n_t=90 #turbine efficiency(%)\n",
- "c=300 #cost of 1 tonne of coal(Rs)\n",
- "\n",
- "#Calculations:\n",
- "n_th = n_b * n_t/100 #in %\n",
- "cb = LF*M*m*c*24*365/(1000*100)\n",
- "\n",
- "#Results:\n",
- "print \"Thermal efficiency = \",n_th,\"%\"\n",
- "print \"Coal bill per annum = Rs\",cb"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Thermal efficiency = 76.5 %\n",
- "Coal bill per annum = Rs 18921600.0\n"
- ]
- }
- ],
- "prompt_number": 32
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.3, Page Number: 17"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "ct=3000000 #annul cost of coal(Rs)\n",
- "cv=5000 #Calorific value of coal(kcal/kg)\n",
- "c=300 #cost of coal per tonne(Rs)\n",
- "n_th=33 #thermal efficiency(%)\n",
- "n_elec=90 #electrical efficiency(%)\n",
- "\n",
- "#Calculations:\n",
- "n_t=n_th*n_elec/100 #overall efficiency(%)\n",
- "h=ct*cv*1000/c #heat of combustion(kcal)\n",
- "ho=n_t*h/(100*860) #heat output(kWh)\n",
- "L=ho/8760 #kW\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"Avg load on the station=\",round(L),\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Avg load on the station= 1971.0 kW\n"
- ]
- }
- ],
- "prompt_number": 33
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.4, Page Number: 17"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "kWh= symbols('kWh')\n",
- "W = 13500 + 7.5 * kWh #Water evaporated in kg\n",
- "C = 5000 + 2.9 * kWh #coal cumsumption in kg\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "#part (i):\n",
- "#As the station output (i.e., kWh) increases towards infinity,\n",
- "#the limiting value of W/C approaches\n",
- "L1= 7.5/2.9 #in kg\n",
- "\n",
- "#part (ii):\n",
- "#at no load\n",
- "kWh=0\n",
- "c=(5000+2.9*kWh)/8 #coal per hour in kg\n",
- "#Results:\n",
- "print \"Limiting value of water/kg of coal=\",round(L1,1),\"kg\"\n",
- "print \"Required Coal per hour\",c,\"kg\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Limiting value of water/kg of coal= 2.6 kg\n",
- "Required Coal per hour 625.0 kg\n"
- ]
- }
- ],
- "prompt_number": 34
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.5, Page Number: 18"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "C=100 #Capacity of station in MW\n",
- "cv=6400 #kcal/kg\n",
- "n_th=0.3 #thermal efficiency\n",
- "n_elec=0.92 #electrical efficiency\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "n_t=n_th*n_elec #overall efficiency\n",
- "U=C*1*10**3 #units generated/hr in kWh\n",
- "H=U*860/n_t #total heat of combustion(kcal)\n",
- "w=H/cv #Coal consumption in kg\n",
- "\n",
- "#Results:\n",
- "print \"The coal consumption per hour =\",round(w),\"kg\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The coal consumption per hour = 48687.0 kg\n"
- ]
- }
- ],
- "prompt_number": 35
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.6, Page Number: 23"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "C=5*10**6 #reservoir capacity in m^3\n",
- "H=200 #water head in m\n",
- "n_t=0.75 #overall efficiency\n",
- "d=1000 #density of water in kg/m^3\n",
- "\n",
- "#Calculations:\n",
- "W=C*d*9.81 #weight of water in Newton\n",
- "E=W*H*n_t/(3600*1000) #electrical energy available(kWh)\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"The total energy available=\",round(E/10**6,3),\"* 10^6 kWh\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The total energy available= 2.044 * 10^6 kWh\n"
- ]
- }
- ],
- "prompt_number": 36
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.7, Page Number: 23"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "V=94 #volume of water in m^3/sec\n",
- "d=1000 #density of water in kg/m^3\n",
- "H=39 #head of water in m\n",
- "nt=0.80 #overall efficiency\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "W=V*d #weight of water in kg/sec\n",
- "w=W*H*9.81/1000 #work done per sec in kW\n",
- "FC=nt*w #firm capacity in kW\n",
- "YGO=FC*8760 #yearly gross capacity in kWh\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"Firm capacity=\",FC,\"kW\"\n",
- "print \"Yearly gross output\",round(YGO/10**6),\"* 10^6 kWh\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Firm capacity= 28770.768 kW\n",
- "Yearly gross output 252.0 * 10^6 kWh\n"
- ]
- }
- ],
- "prompt_number": 37
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.8, Page Number: 23"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable Declaration:\n",
- "H=100 #Water head in m\n",
- "Q=1 #discharge, m^3/sec\n",
- "nh=0.86 #hydraulc efficiency\n",
- "nelec=0.92 #electrical efficiency\n",
- "d=1000 #density of water, kg/m^3\n",
- "\n",
- "#Calculations:\n",
- "W=Q*d*9.81 #weight of water in N\n",
- "Po=W*H*nh*nelec/1000 #power produced, kW\n",
- "E=Po*1 #in kWh\n",
- "\n",
- "#Results:\n",
- "print \"Electrical energy generated per hr=\",round(E),\"kWh\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Electrical energy generated per hr= 776.0 kWh\n"
- ]
- }
- ],
- "prompt_number": 38
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.9, Page Number: 23"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "CA=5*10**9 #Catchment area in m^2\n",
- "H=30 #head in m\n",
- "F=1.25 #Annual rainfall in m\n",
- "K=0.80 #yeild factor\n",
- "n=0.70 #overall efficiency\n",
- "LF=0.40 #Load factor\n",
- "d=1000 #density of water(kg/m^3)\n",
- "\n",
- "#Calculations:\n",
- "V=CA*F*K #volume of water utilised per annum(m^3)\n",
- "W=V*d*9.81 #Weight of water available per annum (N)\n",
- "E=round(W*H*n/(10**11*3600),2)*10**8 #Electrical energy available per annum(kWh)\n",
- "Pav=E/8760 #average power(kW)\n",
- "Dmax=Pav/LF #Maximum demand\n",
- "\n",
- "#Results:\n",
- "print \"Average power generated is \",round(Pav),\"kW\"\n",
- "print \"Rating of generators is\",round(Dmax),\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Average power generated is 32648.0 kW\n",
- "Rating of generators is 81621.0 kW\n"
- ]
- }
- ],
- "prompt_number": 39
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.10, Page Number: 24"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable Declaration:\n",
- "A=2.4 #Area of reservoir(km^2)\n",
- "V=5*10**6 #Capacity of reservoir(m^3)\n",
- "H=100 #in m\n",
- "np=0.95 #penstock efficiency\n",
- "nt=0.90 #turbine efficiency\n",
- "ng=0.85 #generation efficiency\n",
- "L=15000 #load supplied in kW\n",
- "\n",
- "#Calculations:\n",
- "W=V*1000*9.81 #in Newton\n",
- "n=int(np*nt*ng*1000)/1000 #overall efficiency\n",
- "E=W*H*n/(1000*3600) #Elecctrical energy generated(kWh)\n",
- "x=L*3*3600/(A*10**6*9.81*H*n)\n",
- "\n",
- "#Results:\n",
- "print \"Total electrical energy generated is \",round(E),\"kWh\"\n",
- "print \"Fall in reservoir level is\",round(x*100,3),\"cm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Total electrical energy generated is 989175.0 kWh\n",
- "Fall in reservoir level is 9.478 cm\n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.11, Page Number: 25"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration\n",
- "H=25 #head of reservoir in m\n",
- "Pr=400 #power required by factory(kW)\n",
- "n=0.80 #overall efficiency of plant\n",
- "\n",
- "#Calculations:\n",
- "#part (i):\n",
- "#(a):\n",
- "d1 = 10 #discharge in m^3/sec\n",
- "w1 = d1*1000*9.81 #weight of water in N\n",
- "P1 = w1*H*n/1000 #power developed(kW)\n",
- "\n",
- "#(b)\n",
- "d2 = 6 #in m^3/sec\n",
- "P2 = P1*d2/d1 #kW\n",
- "\n",
- "#(c)\n",
- "d3 = 1.5 #in m^3/sec\n",
- "P3 = P1*d3/d1 #kW\n",
- "\n",
- "Ps = Pr-P3 #standby power(kW)\n",
- "\n",
- "#part(ii):\n",
- "Dav = (d1*4+d2*2+d3*6)/12 #avg discharge(m^3/sec)\n",
- "P = P1*Dav/d1 #power developed(kW)\n",
- "Pex = P-Pr #Excess power available(kW)\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"(i) Standby power is \",round(Ps),\"kW\"\n",
- "print \"(ii) Excess power available is \",round(Pex,1),\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Standby power is 106.0 kW\n",
- "(ii) Excess power available is 597.4 kW\n"
- ]
- }
- ],
- "prompt_number": 41
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {
- "slideshow": {
- "slide_type": "-"
- }
- },
- "source": [
- "Example 2.12, Page Number: 25"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "#for part (i):\n",
- "C = 10 #Installed capacity(MW)\n",
- "H = 20 #head of reservoir(m)\n",
- "n = 0.80 #overall efficiency\n",
- "LF = 0.40 #load factor\n",
- "#for part (ii):\n",
- "Q2 = 20 #discharge\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "#for part(i):\n",
- "U = C*LF*24*7*10**3 #units generated per week(kWh)\n",
- "Q = U/(H*n*9.81*24*7) #Discharge in m^3/sec\n",
- "\n",
- "#for part(ii):\n",
- "U2 = Q2*9.81*1000*n*H*24/1000 #units generated per day(kWh)\n",
- "LF2 = U2/(C*10**3*24)\n",
- "\n",
- "#Results:\n",
- "print \"(i) The river discharge is \",round(Q,2),\"m^3/sec\"\n",
- "print \"(ii) The load factor is \", round(LF2*100,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The river discharge is 25.48 m^3/sec\n",
- "(ii) The load factor is 31.4 %\n"
- ]
- }
- ],
- "prompt_number": 42
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.13, Page Number: 26"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "H = 15 #head of reservoir(m)\n",
- "n = 0.85 #efficiency\n",
- "L = 0.40 #load factor\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "Qavg = (500+520+850+800+875+900+546)/7 #in m^3/sec\n",
- "\n",
- "#It is clear from graph that on three dyas \n",
- "#(viz., Sun, Mon. and Sat.), the discharge is less than\n",
- "#the average discharge.\n",
- "\n",
- "V1 = (500+520+546)*24*3600 #Actual volume available in these 3 days(m^3/s)\n",
- "V2 = 3*Qavg*24*3600 #Vol. of water required in these 3 days(m^3/s)\n",
- "Pr = V2-V1 #Pondage required(m^3/sec)\n",
- "Po = Qavg*9.81*1000*H*n #Avg output produced(W)\n",
- "C = Po/L #Capacity of plant(W)\n",
- "\n",
- "#Results:\n",
- "print \"(i) The average daily discharge is \",Qavg,\"m^3/sec\"\n",
- "print \"(ii) Pondage required is (\",round(Pr/10**5),\"* 10^5) m^3\"\n",
- "print \"(iii)Installed capacity of plant is \",round(C/10**6),\"MW\"\n",
- "\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The average daily discharge is 713.0 m^3/sec\n",
- "(ii) Pondage required is ( 495.0 * 10^5) m^3\n",
- "(iii)Installed capacity of plant is 223.0 MW\n"
- ]
- }
- ],
- "prompt_number": 43
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.14, Page Number: 29"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "w = 0.28 #fuel consumption in kg/kWh\n",
- "C = 10000 #calorific value of fuel(kcal/kWh)\n",
- "na = 0.95 #efficiency of alternator\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "H = w*C/860 #heat produced by 0.28 kg/kWh of fuel\n",
- "\n",
- "no = 1/H #Overall efficiency\n",
- "ne = no/na #Efficiency of engine\n",
- "\n",
- "#Results:\n",
- "print \"(i) The overall efficiency is \",round(no*100,1),\"%\"\n",
- "print \"(ii)The efficiency of the engine\",round(ne*100,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The overall efficiency is 30.7 %\n",
- "(ii)The efficiency of the engine 32.3 %\n"
- ]
- }
- ],
- "prompt_number": 44
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.15, Page Number: 30"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "w = 1000 #fuel consumption in kg/day\n",
- "E = 4000 #Units generated in kWh/day\n",
- "C = 10000 #calorific value in kcal/kg\n",
- "na = 0.96 #Alternator efficiency\n",
- "nem = 0.95 #engine mechanical efficiency\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "s = w/E #specific fuel consumption(kg/kWh)\n",
- "E2 = w*C #energy input per day(kcal/day)\n",
- "no = E*860/E2 #overall efficiency\n",
- "ne = no/na #engine efficiency\n",
- "net = ne/nem #engine thermal efficiency\n",
- "\n",
- "#Results:\n",
- "print \"Specific fuel consumption is \",s,\"kg/kWh\"\n",
- "print \"Overall efficiency is \",round(no*100,1),\"%\"\n",
- "print \"Thermal efficiency of the engine is \",round(net*100,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Specific fuel consumption is 0.25 kg/kWh\n",
- "Overall efficiency is 34.4 %\n",
- "Thermal efficiency of the engine is 37.72 %\n"
- ]
- }
- ],
- "prompt_number": 45
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.16, Page Number: 30"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "C1 = 700 #capacity of plant 1(kW)\n",
- "C2 = 2*500 #capacity of plant 2(kW)\n",
- "pcf = 0.40 #plant capacity factor\n",
- "w = 0.28 #fuel cunsumption in kg/kWh\n",
- "H = 10200 #specific heat of fuel in kcal/kg\n",
- "\n",
- "#Calculatios:\n",
- "M = (C1+C2)*30*24 #max energy can be produced in 30 days(kWh)\n",
- "E = pcf*M #Actual energy produced in 30 days(kWh)\n",
- "W = E*w #actual fuel consumption in kg\n",
- "\n",
- "Po = E*860 #output energy in kWh\n",
- "Pin = W*H #Input energy in kWh\n",
- "n = Po/Pin #Overall efficiency\n",
- "\n",
- "#Results:\n",
- "print \"The fuel oil required is \",W,\"kg\"\n",
- "print \"Ovreall efficiency is\",round(n*100),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The fuel oil required is 137088.0 kg\n",
- "Ovreall efficiency is 30.0 %\n"
- ]
- }
- ],
- "prompt_number": 46
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.17, Page Number: 34"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration\n",
- "M = 300 #Energy received from reactor(MW)\n",
- "E1 = 200 #Energy released fron each atom(MeV)\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "E2 = M*10**6*3600 #Energy released per hour(J)\n",
- "E3 = E1*1.6*10**-19*10**6 #Energy released per fission(J)\n",
- "N = E2/E3 #No of atoms fissioned\n",
- "m = N*235/(6.022*10**23) #mass of uranium fissioned per hr(g)\n",
- "\n",
- "#Results:\n",
- "print \"Mass of Uranium fissioned per hour is\",round(m,2),\"g\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mass of Uranium fissioned per hour is 13.17 g\n"
- ]
- }
- ],
- "prompt_number": 47
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 2.18, Page Number: 35"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "t = 30 #days\n",
- "w = 2 #weight of uranium(kg)\n",
- "Eo = 200 #energy released per fission(MeV)\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "N = 2*1000*6.022*10**23/235 #No of atoms fissioned in 2kg of fuel\n",
- "Po = N*Eo*(1.6*10**-19)*10**6/(24*60*60*30) #Watt\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"Power output is\",round(Po*10**-6,1),\"MW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Power output is 63.3 MW\n"
- ]
- }
- ],
- "prompt_number": 48
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter3_1.ipynb b/Principles_of_Power_System/chapter3_1.ipynb deleted file mode 100644 index 42073d28..00000000 --- a/Principles_of_Power_System/chapter3_1.ipynb +++ /dev/null @@ -1,1355 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:c36425eab1371d7c77f7bd1775095f254e3df888559e80a11117b968dfc1b5b4"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 3: Principles of Power System"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.1, Page Number: 50"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "M = 100 #Maximum demand on power station(MW)\n",
- "L = 0.40 #annual load factor\n",
- "\n",
- "#Calculation:\n",
- "E = M*L*8760*10**6 #Energy generated in a year(kWh)\n",
- "\n",
- "#Results:\n",
- "print \"Energy generated in a year is (\",E/10**8,\"* 10^5) kWh\" "
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Energy generated in a year is ( 3504.0 * 10^5) kWh\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.2, Page Number: 50"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "L = 43 #connected load(MW)\n",
- "M = 20 #Maximum demand(MW)\n",
- "E = 61.5*10**6 #Units genearted per annum(kWh)\n",
- "\n",
- "#calculation:\n",
- "DF = M/L #demand factor\n",
- "LF = E/(M*8760*1000) #load factor\n",
- "\n",
- "#Results:\n",
- "print \"The demand factor is\",round(DF,3)\n",
- "print \"Load factor is \",round(LF*100,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The demand factor is 0.465\n",
- "Load factor is 35.1 %\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.3, Page Number: 50"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#variable declaration:\n",
- "\n",
- "#power station delivers 100 MW for 2 hours, \n",
- "#50 MW for 6 hours and is shut down for the rest\n",
- "#of each day.\n",
- "M = 100 #Maximum capacity of station(MW)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "E1 = 100*2+50*6 #Energy supplied per day(MWh)\n",
- "n = 365-45 #No.of working days\n",
- "LF = E1*320/(M*n*24) #load factor\n",
- "\n",
- "print \"Annual load factor is\",round(LF*100,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Annual load factor is 20.8 %\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.4, Page Number: 50"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "M = 25 #Maximum demand(MW)\n",
- "LF = 0.60 #Load factor\n",
- "PCF = 0.50 #plant capacity factor\n",
- "PUF = 0.72 #plant use factor\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "L = LF*M #Average load(MW)\n",
- "PC = L/PCF #Plant gapacity(MW)\n",
- "R = PC-M #Reserve capacity(MW)\n",
- "E = L*24 #daily energy produced(MWh)\n",
- "ME = E/PUF #Maximum energy produced(MWh/day)\n",
- "\n",
- "#Results:\n",
- "print \"Reserve capacity is \",R,\"MW\"\n",
- "print \"Daily energy produced is\",E,\"MWh\"\n",
- "print \"Maximum energy that could be produced dauly is \",ME,\"MWh/day\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Reserve capacity is 5.0 MW\n",
- "Daily energy produced is 360.0 MWh\n",
- "Maximum energy that could be produced dauly is 500.0 MWh/day\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.5, Page Number: 51"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "M = 2500 #Maximum demand(kW)\n",
- "E = 45*10**5 #kWh/year\n",
- "\n",
- "#Calculation:\n",
- "D = (1500+750+100+450)/M #diversity factor\n",
- "LF = E/(M*8760) #Annual load factor\n",
- "\n",
- "#Results:\n",
- "print \"Diversity factor is\",D\n",
- "print \"Annual load factor is\",round(LF*100,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Diversity factor is 1.12\n",
- "Annual load factor is 20.5 %\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.6, Page Number: 51"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "M = 15000 #Max demand(kW)\n",
- "LF = 0.50 #Annual load factor\n",
- "PCF = 0.4 #Plant capacity factor\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "L = LF*M #load factor(kW)\n",
- "PC = L/PCF #plant capacity(kW)\n",
- "R = PC-M #Reserve capacity(kW)\n",
- "\n",
- "#Results:\n",
- "print \"The reserve capacity is \",R,\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The reserve capacity is 3750.0 kW\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.7, Page Number: 51"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "DFo = 1.35 #Overall diversity factor of system\n",
- "\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "M = (1500+2000+10000)/DFo #max demand(kW)\n",
- "#for domestic load:\n",
- "CL1 = (1500*1.2)/0.8 #kW\n",
- "\n",
- "#for Commercial load:\n",
- "CL2 = 2000*1.1/0.9 #kW\n",
- "\n",
- "#for Industrial load:\n",
- "CL3 = 10000*1.25/1 #kW\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"Maximum demand is \",M,\"kW\"\n",
- "print \"Connected loads for each type are:\"\n",
- "print CL1,\"kW \",round(CL2),\"kW \",CL3,\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum demand is 10000.0 kW\n",
- "Connected loads for each type are:\n",
- "2250.0 kW 2444.0 kW 12500.0 kW\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.8, Page Number: 52"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "Dt = 1.3 #Diversity among transformers\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#for transformer 1:\n",
- "M1 = (10*0.65)/1.5 #Max demand (kW)\n",
- "\n",
- "#for transformer 2:\n",
- "M2 = (12*0.6)/3.5 #max demand(kW)\n",
- "\n",
- "#for transformer:\n",
- "M3 = (15*0.7)/1.5 #max demand(kW)\n",
- "\n",
- "Mf = (M1+M2+M3)/Dt #Maximum demand on feeder(kW)\n",
- "\n",
- "#Results:\n",
- "print \"Maximum load on the feeder is \",round(Mf,1),\"kW\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Maximum load on the feeder is 10.3 kW\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.9, Page Number: 52"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "n1 = 1000 #No of houses\n",
- "CL1 = 1.5 #Avg connected load in each house(kW)\n",
- "DF1 = 0.4 #Demand factor\n",
- "DvF = 2.5 #Diversity factor\n",
- "\n",
- "n2 = 10 #no. of factories\n",
- "M2 = 90 #factory overall max demand(kW)\n",
- "\n",
- "n3 = 7 #no of tubewells\n",
- "C3 = 7 #capacity of tubewells(kW)\n",
- "\n",
- "DF = 1.2 #Diversity factor among above types of consumers\n",
- "\n",
- "#Calculations:\n",
- "Ms = ((DF1*n1*CL1)/DvF)+M2+n3*C3 #Sum of maximum demand on the station(kW)\n",
- "M = Ms/DF #maximum demand on the station(kW)\n",
- "\n",
- "#Results:\n",
- "print \"Minimum capacity on the power station is\",round(M),\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Minimum capacity on the power station is 316.0 kW\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.10, Page Number: 53"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "%pylab inline\n",
- "\n",
- "\n",
- "#Calculations:\n",
- "M = 70.0 #Max demand, from load curve(MW)\n",
- "E = 40*6+50*4+60*2+50*4+70*4+40*4 #Units generated per day(MWh)\n",
- "L = E/24 #Avg load(MW)\n",
- "LF = L/M #Load factor\n",
- "\n",
- "n1 = linspace(0,6,10);\n",
- "M1 = linspace(40,40,10);\n",
- "plot(n1,M1);\n",
- "hold(True);\n",
- "\n",
- "n2 = linspace(6,10,10);\n",
- "M2 = linspace(50,50,10);\n",
- "plot(n2,M2,'b');\n",
- "\n",
- "n3 = linspace(10,12,10);\n",
- "M3 = linspace(60,60,10);\n",
- "plot(n3,M3,'b');\n",
- "\n",
- "n4 = linspace(12,16,10);\n",
- "M4 = linspace(50,50,10);\n",
- "plot(n4,M4,'b');\n",
- "\n",
- "n5 = linspace(16,20,10);\n",
- "M5 = linspace(70,70,10);\n",
- "plot(n5,M5,'b');\n",
- "\n",
- "n6 = linspace(20,24,10);\n",
- "M6 = linspace(40,40,10);\n",
- "plot(n6,M6,'b');\n",
- "\n",
- "ylim(0,100);\n",
- "xlim(0,24);\n",
- "grid(1,linewidth=0.5);\n",
- "ylabel(\"Load in MW ------>\");\n",
- "xlabel(\"Time in hours ----->\");\n",
- "title(\"Daily Load Curve\")\n",
- "\n",
- "#Results:\n",
- "print \"Maximum demand is \",M,\"MW\"\n",
- "print \"Units generated per day is (\",E/100,\"* 10^5) kWh\"\n",
- "print \"Average load is\",L*1000,\"kW\"\n",
- "print \"Load factor is \",round(LF*100,1),\"%\"\n",
- "print \"The Daily load curve is shown below:\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Populating the interactive namespace from numpy and matplotlib\n",
- "Maximum demand is "
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " 70.0 MW\n",
- "Units generated per day is ( 12.0 * 10^5) kWh\n",
- "Average load is 50000.0 kW\n",
- "Load factor is 71.4 %\n",
- "The Daily load curve is shown below:\n"
- ]
- },
- {
- "metadata": {},
- "output_type": "display_data",
- "png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEZCAYAAABxbJkKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVPX6B/DPQbFUlkGSRVDHzA0X0JQsN7iIpalpKmqJ\ngMpNy4qszPxZqXVzquuWWderKFwxlWtdJVAsS0zFJQvTRMWFUURAExCVXMDz+4OcxDkzMMAszvfz\nfr14yRlm5jx8muZhvs+cM5IsyzKIiEhIDtYugIiIrIdNgIhIYGwCREQCYxMgIhIYmwARkcDYBIiI\nBMYmQPe9s2fPwtnZGXfe7RwUFITY2FgrV2WYg4MDTp8+be0yiACwCZANUKvVaNSoEVxcXODm5oZe\nvXph2bJlqO4hLC1atMCVK1cgSRIAQJIk3femiIuLQ58+fUy+XV3bunUr+vbtCxcXF3h4eCAoKAjf\nfPONtcsiO8UmQFYnSRKSk5NRUlKCs2fPYsaMGfjoo48wceJEa5dmcRs2bEBYWBgiIyORm5uLCxcu\nYO7cuTVqArIsV7uRkrjYBMimODs7Y8iQIVi/fj3i4+Nx5MgRAEBKSgq6du0KV1dXtGjRAnPmzNHd\nRqvVwsHBAbdv3650Xzdv3kSTJk3w22+/6S67cOECGjdujEuXLplUV3p6Onr06AGVSoXAwEDs2bNH\n97NVq1bBz88PLi4uaN26Nf79739Xuu0nn3yCZs2awdfXFytXrjS4D1mWMW3aNLz77ruYMGECnJ2d\nAQB9+/bV3efs2bMRHh5u8HcPCgrCrFmz0KtXLzRu3BiffPIJevToUWk/CxcuxDPPPAMAuHHjBt54\n4w20bNkSXl5emDJlCq5fv25SNnR/YxMgm9SjRw/4+vpi165dAAAnJyckJCTg8uXLSElJwRdffIFN\nmzYZvY8GDRpg7NixSEhI0F22du1a9O/fH+7u7tWupbCwEE8//TRiYm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lpaXo27cvRo0aha1btwr/eQOiYRMgmyZJEgYOHIh69eqhU6dOuH37\nNp588kkAQOfOnaHVapGVlYUjR46gf//+6Nq1K/7xj39U6/Mmnn32WQBAt27doNVqFa8TGBiIZs2a\nQZIkBAQEIDs7G8ePH0erVq3wyCOPAKj4AJIff/yxyt9j6NCheOCBBwAAjz/+OD788EN8/PHH0Gq1\nePDBB6sbSZ3y9fXFrFmzkJmZiaioKERFRWH48OFWqYWsw/oLk0RVaNCgAQDAwcEBjo6OussdHBxQ\nVlYGWZbRsWNHpKenm3S/d56Q69Wrp1tWMnSdu69371/7sizrLqtfvz5u374NALh+/Xql6zVq1Ej3\n/dixY9GzZ08kJydj0KBBWLZsmW7pyJicnBzdGXQnT56M8vJyLF++HJIkISUlBZGRkbhw4QJ69OiB\nSZMm6eYgc+fOxb59+5CSkgJJkvDLL7/o7nP//v1YtWoVtm3bhjFjxiA6OrrKOsh+sAmQTavO0kS7\ndu1w8eJF7N27Fz179sStW7dw4sQJ+Pn51ej+jJEkCe3atYNWq8WpU6fQunVrrF69Gv369QNQMRM4\ncOAAnnrqKXz11VcG95udnY1WrVrh5ZdfxtmzZ3H48OFqNYHmzZvrhul3vPjii7rvt27dWulnd193\nyJAh+OCDD3Tb3377Ld588014e3tj0qRJWLJkiU0MrMmy+F+cbMbd6/VK3999nbu3HR0dsWHDBrzy\nyiu4fPkyysrK8Nprryk2AUNr9kqXG/p0qQceeACrVq3CqFGjUFZWhsDAQEyePBkA8N5772HixIlw\ncXFBUFCQwd8jMTERq1evhqOjI7y9vRVnGOb20EMPITk5udJHt5J4eCppIiKBcTBMRCQwNgEiIoGx\nCRARCYxNgIhIYGwCREQCYxMgIhIYmwARkcDYBIiIBPb/pozSJIWf61MAAAAASUVORK5CYII=\n",
- "text": [
- "<matplotlib.figure.Figure at 0x4a7dfb0>"
- ]
- }
- ],
- "prompt_number": 31
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.11, Page Number: 54"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "%pylab inline\n",
- "\n",
- "#Calculation:\n",
- "M = 350.0 #Maximum demand(kW)\n",
- "DF = (200+100+50+100)/M #Diversity factor\n",
- "E = 100*6+(100+50)*2+(200+100+50)*2+(200+100)*8+100*6 #kWh/day\n",
- "LF = E/(24*M) #load factor\n",
- "\n",
- "n1 = linspace(0,6,10);\n",
- "M1 = linspace(100,100,10);\n",
- "plot(n1,M1);\n",
- "\n",
- "\n",
- "hold(True);\n",
- "\n",
- "n2 = linspace(6,8,10);\n",
- "M2 = linspace(150,150,10);\n",
- "plot(n2,M2,'b');\n",
- "\n",
- "n3 = linspace(8,10,10);\n",
- "M3 = linspace(350,350,10);\n",
- "plot(n3,M3,'b');\n",
- "\n",
- "n4 = linspace(10,18,10);\n",
- "M4 = linspace(300,300,10);\n",
- "plot(n4,M4,'b');\n",
- "\n",
- "n5 = linspace(18,24,10);\n",
- "M5 = linspace(100,100,10);\n",
- "plot(n5,M5,'b');\n",
- "\n",
- "ylim(0,400);\n",
- "xlim(0,24);\n",
- "grid(linewidth=0.5);\n",
- "ylabel(\"Load in kW ------>\");\n",
- "xlabel(\"Time in hours ----->\");\n",
- "title(\"Daily Load Curve\")\n",
- "\n",
- "#Results:\n",
- "print \"Diversity factor is \",round(DF,3)\n",
- "print \"Unis generated per day is \",E,\"kWh\"\n",
- "print \"Load factor is \",round(LF*100,1),\"%\"\n",
- "print \"The daily load curve is shown below:\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Populating the interactive namespace from numpy and matplotlib\n",
- "Diversity factor is "
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " 1.286\n",
- "Unis generated per day is 4600 kWh\n",
- "Load factor is 54.8 %\n",
- "The daily load curve is shown below:\n"
- ]
- },
- {
- "metadata": {},
- "output_type": "display_data",
- "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEZCAYAAACaWyIJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYVQW6x/HvJqk0UCgTyW3R5AW3IZs0ccwKRzCpIKuJ\nCVOxsJM2NXlpjDhdpDoDnWZyzJNzmsYLaWo+TYmjaWaJmVZoQXUiRQ0SEclCNMcUwXX+MHfSvsBW\nt3vL+n2ex0fW2pf18or7Zb3vulgMwzAQERHTCvJ3ACIi4l8qBCIiJqdCICJicioEIiImp0IgImJy\nKgQiIianQiCtwo4dOwgNDeX40dAJCQnMmjXLz1G5FxQUxNdff+3vMEQAFQIJEFFRUbRr14727dsT\nHh7ONddcw0svvURLT3O59NJL+eGHH7BYLABYLBbH196YO3cu1157rdevO93efvttrrvuOtq3b0+n\nTp1ISEjgX//6l7/DklZKhUACgsViYdmyZezfv58dO3aQlZXFs88+S2Zmpr9DO+Nef/110tLSGDNm\nDFVVVXz77bc89dRTJ1UIDMNocTEV81IhkIATGhpKSkoKr732Gvn5+Xz55ZcALF++nLi4ODp06MCl\nl15KTk6O4zUVFRUEBQVx9OjRJu9VX1/PhRdeyP/93/851n377bdccMEFfP/9917FtWHDBq6++mrC\nwsLo378/H374oeOxOXPmYLPZaN++PVdccQV///vfm7z2ueee45JLLsFqtTJ79my32zAMg0mTJvHE\nE09wzz33EBoaCsB1113neM+pU6cyatQot997QkICjz32GNdccw0XXHABzz33HFdffXWT7UybNo1b\nbrkFgMOHD/Pwww9z2WWX0blzZ8aPH8+hQ4e8yo2c3VQIJGBdffXVWK1WPvjgAwBCQkKYP38++/bt\nY/ny5fztb3+joKDA43uce+65pKenM3/+fMe6hQsXkpiYyEUXXdTiWGpra7npppuYMGECtbW1TJo0\niZtuuona2loAIiIiWL58Ofv372fOnDlMnDiR4uJiAFauXMlf/vIXVq9eTVlZGatXr3a7nS1btrBz\n505++9vfun1OS1pe8+fP5x//+AcHDhxg3LhxbNmyhW3btjkeX7BgAXfdd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E\nAkBUVJTRtm1bIzQ01OjQoYMxcOBAY+bMmcbRo0cdz3n99deNyy67zAgNDTVuvvlm48EHHzRGjRpl\nGIZhlJeXG0FBQUZjY6NhGIaRkJBgzJo1q8k2hgwZYlx++eUe45g7d65hsVia/Dn+vh988IHRt29f\no0OHDka/fv2M9evXO1734osvGhEREUZYWJgxatQoIz093Xj88ccdj+fl5RmdO3c2unTpYsyePdsI\nCgoytm/f7jaOlStXGtdee60REhJiXHzxxcbgwYONt956y/H473//eyMsLMzo3r278fLLLzf7vRuG\nYaxbt86wWCzGAw880GT9oUOHjOzsbONXv/qV0b59e6NXr17GjBkzPOZJWheLYfj2IOPGxkb69euH\n1WrlX//6F7W1tfzud7/jm2++ISoqisWLFxMWFgZAbm4us2fP5pxzzuGFF15g6NChvgxNTCYzM5Mu\nXbroiBiRX/B5a2j69OnYbDbHLnxeXh5JSUmUlZUxZMgQ8vLyACgtLeW1116jtLSUlStXcv/997e4\n/yvSnIqKCt544w1TnqAm0hyfFoKdO3fy1ltvMXbsWEfPcunSpWRkZADHBnhLliwBoKCggPT0dIKD\ng4mKiqJbt24UFRX5Mjwxiccff5yYmBimTJnCZZdd5u9wRAKOTwvBxIkTee655wgK+nkzNTU1RERE\nAMdOwqmpqQGOHZ5ntVodz7NarVRVVfkyPDGJp59+mh9++IFHH33U36GIBCSfFYJly5bRqVMn4uLi\n3J4A09yFwU7momEiIuKdNr564w0bNrB06VLeeustDh06xP79+xk1ahQRERHs3r2bzp07U11dTadO\nnYBjx2lXVlY6Xr9z5066dOni9L5dunRxnMQjIiItExsbS0lJiesHz8ShSYWFhcbNN99sGIZh/PGP\nfzTy8vIMwzCM3Nxc45FHHjEMwzC+/PJLIzY21jh8+LDx9ddfG7/61a+aHDp43BkK+azz5JNP+juE\ngKS8OFNOXGvtefH02emzPYJfOt7mycrKIi0tjVmzZjkOHwWw2WykpaVhs9lo06YNM2fOVGvICxUV\nFf4OISApL86UE9fMnJczUgiuv/56rr/+egAuvPBCt1df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zjFGjRhkxMTFG\nnz59jFtuucXYvXu3v8M849atW2dYLBYjNjbWsNvtht1uN1asWGHanxmdUCYiYnJnTWtIRER8Q4VA\nRMTkVAhERExOhUBExORUCERETE6FQETE5FQIxK++//57x+WQIyMjHZdHDg0N5YEHHjjt23vppZeY\nN29ei59fWFhISkrKaY9DJJAE1B3KxHwuuugiiouLAcjJySE0NJRJkyb5bHv33Xefz97bGw0NDbRp\n4///fnV1dYSFhfk7DPEz7RFIQDl+fuOJv4lPnTqVjIwMrrvuOqKionjjjTd4+OGH6dOnD8nJyTQ0\nNADwySefkJCQQL9+/Rg2bJjjmjEnmjp1Kn/5y18ASEhIICsri/j4eHr27MkHH3zg9HyLxcKBAwe4\n44476NWrFyNHjnQ89u6773LVVVfRp08fMjMzqa+vB47dKKi2thaATZs2MXjwYMe2R40axaBBg8jI\nyODLL7+kf//+xMXFERsby7Zt205XGlts0aJFxMTE8Pzzz/Pdd9+d8e1LYFAhkLNCeXk5a9asYenS\npYwcOZKkpCQ+//xz2rZty/Llyzly5AgPPvgg//znP9m0aRN33303//mf/+n0PideUdJisdDY2MjH\nH3/MX//6V3JycpyebxgGxcXFTJ8+ndLSUr7++ms2bNjAoUOHuPvuu1m8eDGff/45DQ0N/O1vf3O8\nrzubN2/m3Xff5dVXX+Wll15iwoQJFBcX88knn/jlIorjxo1jxYoVHDx4kOuuu4477riDt99+2/T3\nKzAbFQIJeBaLheTkZM455xyuvPJKjh49yg033ABATEwMFRUVlJWV8eWXX5KYmEhcXBz/9V//1aL7\nVdx2220AXHXVVVRUVLh8Tv/+/bnkkkuwWCzY7XbKy8vZsmULl19+Od26dQOO3cTk/fffb/b7SE1N\n5bzzzgPg17/+NX/605/47//+byoqKjj//PNbmpLTymq18thjj1FaWsrdd9/N3Xffza233uqXWMQ/\n/N+kFGmBc889F4CgoCCCg4Md64OCgmhoaMAwDHr37s2GDRu8et/jH8rnnHOOo8Xk7jknPu+Xv/Ub\nhuFY16ZNG44ePQrAoUOHmjyvXbt2jq/T09MZMGAAy5Yt48Ybb+Sll15ytJE8qaysdFx5d9y4cTQ2\nNvLyyy9jsVhYvnw5Y8aM4dtvv+Xqq69m7NixjrnIU089xccff8zy5cuxWCx8+umnjvcsKipizpw5\nrF69mjvvvJN777232Tik9VAhkIDXkjZFz5492bNnDx999BEDBgzgyJEjbN26FZvNdlLv54nFYqFn\nz55UVFSwfft2rrjiCubNm8f1118PHJsRbNq0iWHDhvHPf/7T7XbLy8u5/PLLefDBB9mxYwdffPFF\niwpB165dHQP24+6//37H12+//XaTx058bkpKCs8884xjedWqVfzxj38kMjKSsWPHMmPGjIAYYsuZ\npX9xCSgn9u9dfX3ic05cDg4O5vXXX+cPf/gD+/bto6GhgYkTJ7osBO56+K7Wu7tL1XnnncecOXO4\n4447aGhooH///owbNw6AJ598kszMTNq3b09CQoLb72Px4sXMmzeP4OBgIiMjXc40fK1jx44sW7as\nyW1gxXx0GWoREZPTsFhExORUCERETE6FQETE5FQIRERMToVARMTkVAhERExOhUBExORUCERETO7/\nAV3udrfsY+WJAAAAAElFTkSuQmCC\n",
- "text": [
- "<matplotlib.figure.Figure at 0x49b18b0>"
- ]
- }
- ],
- "prompt_number": 30
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.12, Page Number: 54"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "%pylab inline\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "M1 = 800 #max demand of consumer 1(Watts)\n",
- "M2 = 1000 #max demand of consumer 2(Watts)\n",
- "M3 = 1200 #max demand of consumer 3(Watts)\n",
- "\n",
- "n1 = linspace(0,8,10);\n",
- "m1 = linspace(200,200,10);\n",
- "plot(n1,m1);\n",
- "\n",
- "hold(True);\n",
- "n2 = linspace(8,14,10);\n",
- "m2 = linspace(800,800,10);\n",
- "plot(n2,m2,'b');\n",
- "\n",
- "n3 = linspace(14,16,10);\n",
- "m3 = linspace(2400,2400,10);\n",
- "plot(n3,m3,'b');\n",
- "\n",
- "n4 = linspace(16,22,10);\n",
- "m4 = linspace(800,800,10);\n",
- "plot(n4,m4,'b');\n",
- "\n",
- "n5 = linspace(22,24,10);\n",
- "m5 = linspace(400,400,10);\n",
- "plot(n5,m5,'b');\n",
- "\n",
- "ylim(0,2500);\n",
- "xlim(0,24);\n",
- "grid(linewidth=0.5);\n",
- "ylabel(\"Load in Watts ------>\");\n",
- "xlabel(\"Time in hours ----->\");\n",
- "title(\"Daily Load Curve\");\n",
- "annotate(\"(Midnight)\",xy=(0,0));\n",
- "annotate(\"(Midnight)\",xy=(24,0));\n",
- "annotate(\"(Noon)\",xy=(12,0));\n",
- "\n",
- "#load factors of each consumers:\n",
- "LF1 = (600*6+200*2+800*6)/(24*M1)\n",
- "LF2 = (200*8+1000*2+200*2)/(24*M2)\n",
- "LF3 = (200*6+1200*2+200*2)/(24*M3)\n",
- "#The simultaneous maximum demand on the station is 200 + 1000 + 1200 = 2400 W\n",
- "#and occurs from 2 P.M. to 4 P.M.\n",
- "DF = (M1+M2+M3)/2400.0 #Diversity factor\n",
- "LF = (200*8+800*6+2400*2+800*6+400*2)/(24*2400.0) #load factor\n",
- "\n",
- "#Results:\n",
- "print \"(i) The maximum demand of individual consumers are:\"\n",
- "print \"\\tConsumer 1 =\",M1,\"W, Consumer 2 =\",M2,\"W, Consumer 3 =\",M3,\"W\"\n",
- "print \"\\n(ii)Load Factors of individual consumers are:\"\n",
- "print \"\\tConsumer 1 =\",round(LF1*100,1),\"%, Consumer 2 =\",round(LF2*100,1),\"\"\"%,\n",
- "\\tConsumer 3 =\"\"\",round(LF3*100,1),\"%\"\n",
- "print \"\\n(iii)Diversity factor is \",DF\n",
- "print \"\\n(iv) Load factor of the station is\",round(LF*100,1),\"%\"\n",
- "print \"\\n The load curve is shown below:\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Populating the interactive namespace from numpy and matplotlib\n",
- "(i) The maximum demand of individual consumers are:"
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n",
- "\tConsumer 1 = 800 W, Consumer 2 = 1000 W, Consumer 3 = 1200 W\n",
- "\n",
- "(ii)Load Factors of individual consumers are:\n",
- "\tConsumer 1 = 45.8 %, Consumer 2 = 16.7 %,\n",
- "\tConsumer 3 = 13.9 %\n",
- "\n",
- "(iii)Diversity factor is 1.25\n",
- "\n",
- "(iv) Load factor of the station is 29.2 %\n",
- "\n",
- " The load curve is shown below:\n"
- ]
- },
- {
- "metadata": {},
- "output_type": "display_data",
- "png": "iVBORw0KGgoAAAANSUhEUgAAAboAAAEZCAYAAADhf+DFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt8DPf+P/DXREKRRIJKIquSusWSm8tG6xZfgqQVWhXi\nkovotzilKb1ozzkknCNxeijaOl9fjcuDCtE6KE3q6FcoKm4JjrgESSUrghNBULnN7w+/TMVOJGE3\nm515PR+PfTwys7Oz77yNzzufee/MCqIoiiAiIlIoK3MHQEREZEosdEREpGgsdEREpGgsdEREpGgs\ndEREpGgsdEREpGgsdKRoV65cgZ2dHSqvovH390dCQoKZo6qelZUVLl++bO4wiBSFhY4aNDc3NzRr\n1gz29vZwdHRE3759sXLlStT28s+XXnoJd+/ehSAIAABBEKSf62Lt2rXo379/nV9nbD/++CMGDBgA\ne3t7tGnTBv7+/vj+++/NHRZRg8ZCRw2aIAjYuXMn7ty5gytXrmDOnDlYtGgRoqKizB1avfv2228R\nEhKCiIgI6PV6XL9+HfPnz3+mQieKYq3/WCCydCx0ZDHs7OwwYsQIbN68GevWrcOZM2cAALt27YKv\nry9atGiBl156CbGxsdJrcnJyYGVlhYqKiir7KikpQcuWLfHvf/9bWnf9+nU0b94c//nPf+oU16FD\nh9C7d284ODhAp9Phl19+kZ5bs2YNtFot7O3t0aFDB/zv//5vldd+9tlnaNu2LTQaDVavXl3te4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tR4wYgb/85S/S8u7du/Hhhx/CxcUFU6ZMwRdffNEgPiRD9Cx45JJFeLx/\nJvfz49s8vmxjY4Nvv/0WM2fOxO3bt1FWVob3339fttBV10OTW1/dt0w3adIEa9aswZgxY1BWVgad\nToepU6cCAObNm4eoqCjY29vD39+/2t8jKSkJ69evh42NDVxcXGR7iqbWunVr7Ny5E+3atav39yYy\nNn5NDxERKRo/jEJERIrGQkdERIrGQkdERIrGQkdERIrGQkdERIrGQkdERIrGQkdERIrGQkdERIr2\n/wAb/9x823/nZQAAAABJRU5ErkJggg==\n",
- "text": [
- "<matplotlib.figure.Figure at 0x49b1ed0>"
- ]
- }
- ],
- "prompt_number": 29
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.13, Page Number: 55"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "A = 12 #Area of load curve(cm**2)\n",
- "Lo = 1000 #load under 1cm length(kW)\n",
- "To = 2 #time under 1cm length(hr)\n",
- "M = 3000 #maximum demand(kW)\n",
- "\n",
- "#Calculation:\n",
- "L = Lo*To*A/24 #Average load(kW)\n",
- "LF = L/M #load factor\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"Load factor is\",round(LF*100,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Load factor is 33.3 %\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.14, Page Number: 56"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "C = 75 #Capacity of each generator(MW)\n",
- "n = 4 #No. of generators\n",
- "CV = 10000 #Calorific value of oil used(kcal/kg)\n",
- "H = 2860 #Avg heat rate(kcal/kWh)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "E = (260*6+200*8+160*4+100*6) #Units generated per day(MWh)\n",
- "L = E/24 #Avg load(MW)\n",
- "LF =L/260 #Load factor\n",
- "PCF = L/(n*C) #Plant capacity\n",
- "TH = H*E*10**3 #heat generated per day(kcal)\n",
- "w = TH/CV #daily fuel requirement(kg)\n",
- "\n",
- "print \"Daily load factor is\",round(LF*100,1),\"%\"\n",
- "print \"Plant capacity factor is\",round(PCF*100,1),\"%\"\n",
- "print \"Daily fuel requirement is (\",w/1000,\"* 10^3) kg\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Daily load factor is 70.5 %\n",
- "Plant capacity factor is 61.1 %\n",
- "Daily fuel requirement is ( 1258.4 * 10^3) kg\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.15, Page Number: 56"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "%pylab inline\n",
- "\n",
- "#Calculations:\n",
- "E = 20*2+40*4+60*4+20*4+50*4+20*6 #Units generated per day(MWh)\n",
- "\n",
- "#1st plot\n",
- "subplot(1,3,1)\n",
- "n1 = linspace(0,8,10);\n",
- "m1 = linspace(20,20,10);\n",
- "plot(n1,m1);\n",
- "\n",
- "hold(True);\n",
- "n2 = linspace(8,12,10);\n",
- "m2 = linspace(40,40,10);\n",
- "plot(n2,m2,'b');\n",
- "\n",
- "n3 = linspace(12,16,10);\n",
- "m3 = linspace(60,60,10);\n",
- "plot(n3,m3,'b');\n",
- "\n",
- "n4 = linspace(16,20,10);\n",
- "m4 = linspace(20,20,10);\n",
- "plot(n4,m4,'b');\n",
- "\n",
- "n5 = linspace(20,24,10);\n",
- "m5 = linspace(40,40,10);\n",
- "plot(n5,m5,'b');\n",
- "\n",
- "ylim(0,100);\n",
- "xlim(0,24);\n",
- "grid(linewidth=0.5);\n",
- "ylabel(\"Load in MW ------>\");\n",
- "xlabel(\"Time in hours ----->\");\n",
- "title(\"$(i)$ Daily Load Curve\");\n",
- "\n",
- "#next plot\n",
- "subplot(1,3,3)\n",
- "n1 = linspace(0,4,10);\n",
- "m1 = linspace(60,60,10);\n",
- "plot(n1,m1);\n",
- "\n",
- "hold(True);\n",
- "n2 = linspace(4,8,10);\n",
- "m2 = linspace(50,50,10);\n",
- "plot(n2,m2,'b');\n",
- "\n",
- "n3 = linspace(8,12,10);\n",
- "m3 = linspace(40,40,10);\n",
- "plot(n3,m3,'b');\n",
- "\n",
- "n4 = linspace(12,24,10);\n",
- "m4 = linspace(20,20,10);\n",
- "plot(n4,m4,'b');\n",
- "\n",
- "ylim(0,100);\n",
- "xlim(0,24);\n",
- "grid(linewidth=0.5);\n",
- "ylabel(\"Load in MW ------>\");\n",
- "xlabel(\"Hours duration ----->\");\n",
- "title(\"$(ii)$ Load Duration Curve\");\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"Energy generated per day is (\",E,\"* 10^3) kWh\"\n",
- "print \"\\nThe daily load curve and load duration curves are shown below:\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Populating the interactive namespace from numpy and matplotlib\n",
- "Energy generated per day is ("
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " 840 * 10^3) kWh\n",
- "\n",
- "The daily load curve and load duration curves are shown below:\n"
- ]
- },
- {
- "metadata": {},
- "output_type": "display_data",
- "png": "iVBORw0KGgoAAAANSUhEUgAAAZkAAAEcCAYAAAAV2MmlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYFFe6BvC3EWJcQNCwqKhtXIjIPgY1bjCKySRuiYor\nAhoyZuKWZBy9ibnGxBnQGY3LJDM+EyPGnWyKJGoSlSzuG3HBJTeCorYmirihYTv3D0MPjd3Q3XRV\nV3W9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VliI6OxsSJEwEAs2fPxoQJE+Dl5YWYmBiLzyMjIwOrVq2Ch4cHmjdvbnYOSWqPPPIIsrKy\nTL5Sl8gSc7lXuW7p0qVITk7G3//+d/j5+WHFihUA7l8KPHjwYEREROCpp54yuQy6anvHjh3D9OnT\n4ebmhoceesg4x1nVihUrMH78eOh0OvTv39/4+J49e6Jt27YIDg5Gp06d8Lvf/c7sPry9vZGSkoKQ\nkBAEBASga9euxt8lJSVh4sSJaNiwIXbv3m1cHxAQgLS0NMTGxkIIgQEDBhgvSqr+uiTnt1pOmzYN\nMTExsu3PHN7qn4iIJONSczJERKQsLDJERCQZFhkiIpIMiwwREUmGRYaIiCTDIkNERJJhkSEiIsmw\nyBARkWT+H5YlVY/jFClJAAAAAElFTkSuQmCC\n",
- "text": [
- "<matplotlib.figure.Figure at 0x49c3450>"
- ]
- }
- ],
- "prompt_number": 28
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.16, Page Number: 57"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "c1 = 10 #Capacity of each of 2 generators(MW)\n",
- "c2 = 5 #Capacity of 3rd generator(MW)\n",
- "\n",
- "#Calculation:\n",
- "C = 2*c1+c2 #Installed capacity(MW)\n",
- "A = (1/2)*(20+4) #Avg load, seen from the curve(MW)\n",
- "PF = A/C #plant factor\n",
- "E = 8760*A #Units generated per annum(MWh)\n",
- "LF = A/20 #Load factor\n",
- "PUF = 20/C #Plant capacity factor\n",
- "\n",
- "#Results:\n",
- "print \"(i) Installed capacity is \",C,\"MW\"\n",
- "print \"(ii) Plant factor is \",round(PF*100,1),\"%\"\n",
- "print \"(iii) Units generated per annum is \",(E/1000),\"* 10^3 kWh\"\n",
- "print \"(iv) Load factor is \",round(LF*100,1),\"%\"\n",
- "print \"(V) Utilisation factor is \",round(PUF*100,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Installed capacity is 25 MW\n",
- "(ii) Plant factor is 48.0 %\n",
- "(iii) Units generated per annum is 105.12 * 10^3 kWh\n",
- "(iv) Load factor is 60.0 %\n",
- "(V) Utilisation factor is 80.0 %\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.17, Page Number: 57 "
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "n = 0.72 #efficiency of the load\n",
- "\n",
- "#Calculation:\n",
- "Ma = (10*0.746/0.72)* 0.65 + 5 * 0.60 #kW\n",
- "Mb = (7.5*0.746/0.72)*0.75+4*0.60 #kW\n",
- "Mc = (15*0.746/0.72)*0.65 #kW\n",
- "Md = (5*0.746/0.72)*0.75+2*0.60 #kW\n",
- "\n",
- "SM = Ma+Mb+Mc+Md #Sum of maximum demands(kW)\n",
- "\n",
- "#The diversity factor between consumers of this type of service is 1\u00b75 from above table.\n",
- "M1 = SM/1.5 #Maximum demand on transformer 1(kW)\n",
- "\n",
- "#In a similar manner, the other transformer loads are determined to be\n",
- "# Total Simultaneous\n",
- "#Transformer 2 26 kW 7\u00b743 kW\n",
- "#Transformer 3 29\u00b713 kW 19\u00b740 kW\n",
- "\n",
- "#The diversity factor between transformers is 1\u00b73\n",
- "M2 = 7.43; M3 = 19.40\n",
- "MF = (M1+M2+M3)/1.3 #Maximum load on feeder(kW)\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"The maximum load on the feeder is \",round(MF,2),\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The maximum load on the feeder is 37.64 kW\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.18, Page Number: 61"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "%pylab inline\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "E = 10**3*(20*2+40*3+50*5+35*3+70*3+40*2+20*6) #Units generated per day(kWh)\n",
- "A = E/24 #Average load(kW)\n",
- "LF = A/(70*10**3) #Load factor\n",
- "\n",
- "n1 = linspace(0,8,10);\n",
- "m1 = linspace(20,20,10);\n",
- "plot(n1,m1);\n",
- "\n",
- "hold(True);\n",
- "n2 = linspace(8,11,10);\n",
- "m2 = linspace(40,40,10);\n",
- "plot(n2,m2,'b');\n",
- "\n",
- "n3 = linspace(11,16,10);\n",
- "m3 = linspace(50,50,10);\n",
- "plot(n3,m3,'b');\n",
- "\n",
- "n4 = linspace(16,19,10);\n",
- "m4 = linspace(35,35,10);\n",
- "plot(n4,m4,'b');\n",
- "\n",
- "n5 = linspace(19,22,10);\n",
- "m5 = linspace(70,70,10);\n",
- "plot(n5,m5,'b');\n",
- "\n",
- "n6 = linspace(22,24,10);\n",
- "m6 = linspace(40,40,10);\n",
- "plot(n6,m6,'b');\n",
- "\n",
- "\n",
- "ylim(0,100);\n",
- "xlim(0,24);\n",
- "grid(linewidth=0.5);\n",
- "ylabel(\"Load in MW ------>\");\n",
- "xlabel(\"Time in hours ----->\");\n",
- "title(\"Daily Load Curve\");\n",
- "\n",
- "#Results:\n",
- "print \"Load factor is \",round(LF*100,2),\"%\"\n",
- "print \"\"\"\\nOperational schedule: Referring to the load curve shown\n",
- "below, the operational schedule will be as under :\n",
- " (i) Set No. 1 will run for 24 hours.\n",
- " (ii) Set No. 2 will run from 8.00 hours to midnight.\n",
- " (iii)Set No. 3 will run from 11.00 hours to 16 hours and \n",
- " again from 19 hours to 22 hours.\"\"\"\n",
- "print \"\\nThe Load curve is shown below:\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Populating the interactive namespace from numpy and matplotlib\n",
- "Load factor is "
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " 55.06 %\n",
- "\n",
- "Operational schedule: Referring to the load curve shown\n",
- "below, the operational schedule will be as under :\n",
- " (i) Set No. 1 will run for 24 hours.\n",
- " (ii) Set No. 2 will run from 8.00 hours to midnight.\n",
- " (iii)Set No. 3 will run from 11.00 hours to 16 hours and \n",
- " again from 19 hours to 22 hours.\n",
- "\n",
- "The Load curve is shown below:\n"
- ]
- },
- {
- "output_type": "stream",
- "stream": "stderr",
- "text": [
- "WARNING: pylab import has clobbered these variables: ['tri', 'axes', 'legend', 'stackplot', 'figure', 'rc_context', 'quiver', 'streamplot', 'rc', 'text', 'colors', 'contour', 'axis', 'colorbar', 'test', 'rcdefaults', 'table']\n",
- "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
- ]
- },
- {
- "metadata": {},
- "output_type": "display_data",
- "png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEZCAYAAABxbJkKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtcVHX6B/DPQbFULoMkF0EdM294AU3J8gaLWJqapqKW\nCKhsWlZkZebPNrU2p1pvmbWuorBiKmutEiiWFabiJQvTRMULo4iAJiAqeQHP7w9jVpwzAwPMhfl+\n3q/XvOQMw5yHT9M8zPeZc0aSZVkGEREJycHaBRARkfWwCRARCYxNgIhIYGwCREQCYxMgIhIYmwAR\nkcDYBKjeO3fuHJydnVHxbuegoCDExsZauSrDHBwccObMGWuXQQSATYBsgFqtRpMmTeDi4gI3Nzf0\n6dMHK1asQHUPYWnVqhWuXr0KSZIAAJIk6b42RVxcHPr162fyz9W17du3o3///nBxcYGHhweCgoLw\n9ddfW7ssslNsAmR1kiQhOTkZJSUlOHfuHGbNmoUPP/wQkydPtnZpFrdp0yaEhYUhMjISubm5uHjx\nIubPn1+jJiDLcrUbKYmLTYBsirOzM4YNG4aNGzciPj4eR48eBQCkpKSge/fucHV1RatWrTBv3jzd\nz2i1Wjg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XbX/zzTd488034e3tjSlTpmDZsmU2MbAmy+J/cbIZ967XK319\n723u3XZ0dMSmTZvwyiuv4MqVKygrK8Nrr72m2AQMrdkrXW/o06UeeOABrFmzBmPGjEFZWRkCAwMx\ndepUAMC7776LyZMnw8XFBUFBQQZ/j8TERKxduxaOjo7w9vZWnGGY20MPPYTk5ORKH91K4uGppImI\nBMbBMBGRwNgEiIgExiZARCQwNgEiIoGxCRARCYxNgIhIYGwCREQCYxMgIhLY/wPvzB87kxUFaQAA\nAABJRU5ErkJggg==\n",
- "text": [
- "<matplotlib.figure.Figure at 0x4c39f30>"
- ]
- }
- ],
- "prompt_number": 27
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- " Example 3.19, Page Number: 61"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "#peak loads(MW) are:\n",
- "P1 = 10\n",
- "P2 = 5\n",
- "P3 = 8\n",
- "P4 = 7\n",
- "\n",
- "DF = 1.5 #Diversity factor\n",
- "LF = 0.60 #Avg annual load factor\n",
- "\n",
- "#Calculation:\n",
- "M = (P1+P2+P3+P4)/DF #Max demand on the station(MW)\n",
- "E = (LF*M)*8760 #Annual energy supplied(MWh)\n",
- "#the installed capacity should be 15% to 20% more than the\n",
- "#maximum demand to meet the future needs.\n",
- "#Taking Installed capacity to be 20% more than the maximum demand,\n",
- "IC = 1.2*M #MW\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"(i) The maximum demand on the station is\",M,\"MW\"\n",
- "print \"(ii) Annual energy supplied by the station is (\",E/1000,\"* 10^6) kWh\"\n",
- "print \"(iii)Installed capacity is\",IC,\"MW\"\n",
- "print \" Suitable unit sizes are 4, each of 6 MW capacity.\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The maximum demand on the station is 20.0 MW\n",
- "(ii) Annual energy supplied by the station is ( 105.12 * 10^6) kWh\n",
- "(iii)Installed capacity is 24.0 MW\n",
- " Suitable unit sizes are 4, each of 6 MW capacity.\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.20, Page Number: 64"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "c1 = 20 #capacity of standby station(MW)\n",
- "c2 = 18 #Capacity of base load station(MW)\n",
- "E1 = 7.35*10**6 #Annual standby output(kWh)\n",
- "E2 = 101.35*10**6 #Annual base load station output(kWh)\n",
- "P3 = 12 #peak load on standby station(MW)\n",
- "t = 2190 #hours of use by standby station/year\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "LF1 = E1/(t*P3*10**3) #Annual load factor of standby station\n",
- "PCF1 = E1/(8760*c1*10**3) #Plant capacity factor of standby station\n",
- "LF2 = E2/(8760*c2*10**3) #Annual load factor of base load station\n",
- "#for base load station,\n",
- "PCF2 = LF2 #Plant capacity factor of base load station\n",
- "\n",
- "#Results:\n",
- "print \"Annual load factor of standby station is\",round(LF1*100,1),\"%\"\n",
- "print \"Plant capacity factor of standby station is\",round(PCF1*100,1),\"%\"\n",
- "print \"Annual load factor of base load station is\",round(LF2*100,1),\"%\"\n",
- "print \"Plant capacity factor of base load station is\",round(PCF2*100,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Annual load factor of standby station is 28.0 %\n",
- "Plant capacity factor of standby station is 4.2 %\n",
- "Annual load factor of base load station is 64.3 %\n",
- "Plant capacity factor of base load station is 64.3 %\n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.21, Page Number: 64"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "M = 60000 #maximum load of hydro plant(kW)\n",
- "m = 20000 #minimum load of hydro pland(kW)\n",
- "P = 50000 #peak load of plant per day(kW)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let OE = Capacity of steam plant\n",
- "#EC = Capacity of hydro plant\n",
- "x,y = symbols('x,y') #two variables as indicated in given curve\n",
- "# As steam electric conversion is 60%,\n",
- "#\u2234 Area HEFI = 0\u00b76 \u00d7 Area FGB ... (i)\n",
- "#But Area HEFI = Area CFE \u2212 Area CHI\n",
- "# = 1/2*(x*y-50000)\n",
- "# Now Area FGB = 1/2*(FG*GB) = 1/2*(24-x)*(40000-y)\n",
- "# or 0.2*x*y + 12000*x + 7.2*y \u2212 338000 = 0\n",
- "#Also from similar triangles CEF and CDB, we get,\n",
- "# y/40000 = x/24\n",
- "y = x/24*40000\n",
- "x1 = round(solve(0.2*x*y + 12000*x + 7.2*y-338000,x)[1])\n",
- "y1 = x1/24*40000\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Capacity of the hydro plant is\",y1,\"kW\"\n",
- "print \"Capacity of the steam plant is\",60000-y1,\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacity of the hydro plant is 20000.0 kW\n",
- "Capacity of the steam plant is 40000.0 kW\n"
- ]
- }
- ],
- "prompt_number": 32
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.22, Page Number: 65"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "#Suppose the maximum demand of reservoir plant is y MW and it \n",
- "#operates for x hours\n",
- "x,y = symbols('x y')\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "E = 10**3*(1/2*(320+160)*8760) #Units generated/annum\n",
- "#As the steam plant, run-of-river plant and hydro plant generate \n",
- "#units in the ratio of 7 : 4 : 1, so, units generated by \n",
- "#each plant are:\n",
- "\n",
- "E1 = E*7/12 #by steam plant\n",
- "E2 = E*4/12 #by run-of-river plant\n",
- "E3 = E/1/12 #by reservoir plant\n",
- "\n",
- "#(i) Maximum demand on run-of-river plant = Area OEBA/OA\n",
- "M2 = 700.8*10**6/8760 #kW\n",
- "\n",
- "#Now,\n",
- "x = 8760*y/160\n",
- "E33 = 10**3*1/2*(x*y)\n",
- "#But the units generated by reservoir plant are E3 kWh\n",
- "y1 = solve(E33-E3,y)[1]\n",
- "M3 = y1 #maximum demand on reservoir station(MW)\n",
- "M1 = 320-80-M2/1000 #Maximum demand on steam station(MW)\n",
- "LF2 = 100 #load factor of river plant(%), because it acts \n",
- " #as a base station.\n",
- "\n",
- "LF1 = E1*100/(M1*1000*8760) #load factor of of run-of-river plant(%)\n",
- "LF3 = E3*100/(M3*1000*8760) #load factor of reservoir plant(%)\n",
- "\n",
- " \n",
- "\n",
- "#Result:\n",
- "print \"(i)Maximum demand on run-of-river plant is\",round(M1),\"MW\"\n",
- "print \" Maximum demand on steam station is\",round(M2),\"MW\"\n",
- "print \" Maximum demand on reservoir station is\",round(y1),\"MW\"\n",
- "print \"\\n(ii)Load factor of steam plant plant is\",LF1,\"%\"\n",
- "print \" Load factor of of run-of-river plant is\",LF2,\"%\"\n",
- "print \" Load factor of of reservoir plant is\",round(LF3),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)Maximum demand on run-of-river plant is 160.0 MW\n",
- " Maximum demand on steam station is 80000.0 MW\n",
- " Maximum demand on reservoir station is 80.0 MW\n",
- "\n",
- "(ii)Load factor of steam plant plant is 87.5 %\n",
- " Load factor of of run-of-river plant is 100 %\n",
- " Load factor of of reservoir plant is 25.0 %\n"
- ]
- }
- ],
- "prompt_number": 5
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter4_1.ipynb b/Principles_of_Power_System/chapter4_1.ipynb deleted file mode 100644 index c67cf3f8..00000000 --- a/Principles_of_Power_System/chapter4_1.ipynb +++ /dev/null @@ -1,873 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:674aadd4593cd639b4637a0cb17a9ace907a7cf82297146653a75d9ee7f7f19b"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 4: Economics of Power Generation"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.1, Page Number: 74"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable Declaration:\n",
- "P = 90000 #initial cost of transformer(Rs)\n",
- "n = 20 #20 years\n",
- "S = 10000 #Salvage value(Rs)\n",
- "\n",
- "#Calculation:\n",
- "D = (P-S)/n #Annual depreciation charge(Rs)\n",
- "\n",
- "print \"The annual depreciation charge is Rs\",D"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The annual depreciation charge is Rs 4000.0\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.2, Page Number: 74"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration\n",
- "P = 200000 #Initial cost of transformer(Rs)\n",
- "S = 10000 #Salvage value of transformer(Rs)\n",
- "n = 20 #Useful life(years)\n",
- "r = 0.08 #annual interest rate(%)\n",
- "\n",
- "#Calculation:\n",
- "q = (P-S)*r/(((1+r)**n)-1) #Annual payment(Rs)\n",
- "\n",
- "#Results:\n",
- "print \"The annual amount to be saved is Rs\",round(q)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The annual amount to be saved is Rs 4152.0\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.3, Page Number: 75"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "P = 1560000 #Initial cost of equipment(Rs)\n",
- "S = 60000 #salvage value of equipment(Rs)\n",
- "n = 25 #useful life(years)\n",
- "t = 20 #years\n",
- "#Calculation:\n",
- "\n",
- "#(i) Straight line method:\n",
- "D1 = (P-S)/n #Annual depreciation(Rs)\n",
- "V1 = P-D1*t #Value of equipment after 't' years\n",
- "\n",
- "#(ii)Diminishing value method:\n",
- "D2 = 1-(S/P)**(1/n) #Annual unit depreciation(Rs)\n",
- "V2 = P*(1-round(D2,3))**t #Value of equipment after 't' years\n",
- "\n",
- "#(iii)Sinking fund method:\n",
- "r = 0.05 #rate of interest\n",
- "q = (P-S)*(r/((1+r)**n-1)) #Annual deposit in the sinking fund(Rs)\n",
- "q1 = 31433*(((1+r)**20-1)/r) #Sinking fund at the end of 20 years(Rs)\n",
- "V = P-q1 #Value of plant after 20 years(Rs)\n",
- "\n",
- "#Results:\n",
- "print \"The depreciated values using:\"\n",
- "print \"(i) Straight line method: Rs\",V1\n",
- "print \"(ii)Diminishing value method Rs:\",round(V2)\n",
- "print \"(iii)Sinking fund method: Rs\",round(V)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The depreciated values using:\n",
- "(i) Straight line method: Rs 360000.0\n",
- "(ii)Diminishing value method Rs: 115615.0\n",
- "(iii)Sinking fund method: Rs 520638.0\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.4, Page Number: 76"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "M = 50000 #Max demand(kW)\n",
- "CC = 95*10**6 #Capital cost(Rs)\n",
- "LF = 0.4 #annual load factor\n",
- "C1 = 9*10**6 #Annual cost of fuel and oil(Rs)\n",
- "C2 = 7.5*10**6 #taxes wages salaries etc(Rs)\n",
- "i = 12 #interest & depreciation(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "E = M*LF*8760 #units generated(kWh/year)\n",
- "AFC = i*CC/100 #Annual fixed charges(Rs)\n",
- "T = C1+C2 #Total annual running charges(Rs)\n",
- "TAC = AFC+T #Total annual charges(Rs)\n",
- "c = TAC/E #cost per unit(Rs)\n",
- "\n",
- "#Results:\n",
- "print \"Cost per unit generated = \",round(c,2)*100,\"paise\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Cost per unit generated = 16.0 paise\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.5, Page Number: 76"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "C = 50000 #Installed capacity(kW)\n",
- "E = 220*10**6 #units generated(kWh/year)\n",
- "AFC1 = 160 #annual fixed charges per kW of C(Rs/kW)\n",
- "RC = 0.04 #running charges(Rs)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "AFC = AFC1*C #annual fixed charges(Rs)\n",
- "ARC = RC*E #annual running charges(Rs)\n",
- "c = (AFC+ARC)/E #cost per unit(Rs)\n",
- "\n",
- "#Results:\n",
- "print \"Cost per unit generated is \",round(c,4)*100,\"paise\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Cost per unit generated is 7.64 paise\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.6, Page Number: 76"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "C = 160000 #cost of plant(Rs)\n",
- "r = 12 #annual fixed charges(%)\n",
- "r1 = 5 #interest(%)\n",
- "r2 = 5 #depreciation(%)\n",
- "r3 = 2 #taxes(%)\n",
- "M = 100 #max demand(kW)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "AFC = C*r/100 #annual fixed charges(Rs)\n",
- "\n",
- "#(i)when load factor is 100%\n",
- "E1 = M*1*8760 #kWh/year\n",
- "c1 = AFC/E1 #Rs\n",
- "\n",
- "#(i)when load factor is 50%\n",
- "E2 = M*0.5*8760 #kWh/year\n",
- "c2 = AFC/E2 #Rs\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"Fixed charges when:\"\n",
- "print \"(i) load factor is 100% :\",round(c1*100,2),\"paise\"\n",
- "print \"(ii)load factor is 50% :\",round(c2*100,2),\"paise\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Fixed charges when:\n",
- "(i) load factor is 100% : 2.19 paise\n",
- "(ii)load factor is 50% : 4.38 paise\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.7, Page Number: 77"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "PC = 50 #plant capacity(MW)\n",
- "LF = 0.4 #annual load factor\n",
- "C1 = 1.2*10**7 #capital cost(Rs)\n",
- "C2 = 4*10**5 #annual cost of wages, taxation etc.(Rs)\n",
- "C3 = 1.0 #cost of fuel,lubrication, maintenance etc.(paise/kWh)\n",
- "r1 = 5 #interest rate(%)\n",
- "r2 = 6 #depreciation(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "T1 = (C1*(r1+r2)/100)+C2 #Total annual fixed charges(Rs)\n",
- "E = PC*10**3*LF*8760 #units generated(kWh/year)\n",
- "C4 = E*C3/100 #Cost of fuel, lubrication etc.(Rs)\n",
- "T = T1+C4 #total annual charges(Rs)\n",
- "c = T/E #generating cost(Rs/kWh)\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"Cost per kWh is \",round(c*100),\"paise\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Cost per kWh is 2.0 paise\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.8, Page Number: 77"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "PC = 300 #plant capacity(MW)\n",
- "CF = 0.5 #capacity factor\n",
- "LF = 0.6 #annual load factor\n",
- "C1 = 9*10**7 #Annual cost of fuel, oil etc(Rs)\n",
- "C2 = 10**9 #capital cost(Rs)\n",
- "r1 = 10 #annual interest and depreciation(%)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "L = CF*PC #avg load(MW)\n",
- "M = L/LF #max demand(MW)\n",
- "RC = PC-M #Reserve capacity(MW)\n",
- "TC = C1+C2*r1/100 #total cost(Rs)\n",
- "E = L*10**3*8760 #units generated(kWh/year)\n",
- "c = TC/E #cost per kWh\n",
- "\n",
- "#Results:\n",
- "print \"The minimum reserve capacity of the station is\",RC,\"MW\"\n",
- "print \"Cost per kWh generated is \",round(c*100),\"paise\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The minimum reserve capacity of the station is 50.0 MW\n",
- "Cost per kWh generated is 14.0 paise\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.9, Page Number: 78"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "#Variable declaration:\n",
- "PC = 50 #plant capacity(MW)\n",
- "CC = 1000 #capital cost(Rs/kW)\n",
- "r1 = 10 #annual depreciation charges(%)\n",
- "r2 = 20 #part of salaries, maitenance to fixed charges(%)\n",
- "M = 40 #max demand(MW)\n",
- "LF = 0.60 #load factor\n",
- "C1 = 700000 #Annual cost of salaries, maintenance charges etc.(Rs)\n",
- "R1 = 1 #royalty(Re/(kW*year))\n",
- "R2 = 0.01 #royalty paid for using the river water for generation(Re/kWh)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#for annual fixed cost\n",
- "E = M*10**3*LF*8760 #kWh/year\n",
- "C = CC*PC*10**3 #capital cost(Rs)\n",
- "T1 = r1*C/100+r2*C1/100 #total annual fixed charges(Rs)\n",
- "\n",
- "C2 = T1/(M*10**3)+R1 #Cost per kW(Rs)\n",
- "\n",
- "#for running cost:\n",
- "C3 = ((1-r2/100)*C1)/E+R2 #Cost per kW(Rs)\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"Total generation cost in two part form is given by:\"\n",
- "print \"Rs (\",C2,\"* kW +\",round(C3,4),\"* kWh)\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Total generation cost in two part form is given by:\n",
- "Rs ( 129.5 * kW + 0.0127 * kWh)\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.10, Page Number: 78"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "M = 60 #plant capacity(MW)\n",
- "LF = 0.5 #load factor\n",
- "C1 = 5*10**6 #capital cost of building and equipment(Rs)\n",
- "C2 = 900000 #annual cost of fuel,oil,taxation and wages(Rs)\n",
- "r1 = 10 #interest and depreciation(%)\n",
- "C3 = 5000000 #annual cost of organisation and \n",
- " #interest on cost of site etc.\n",
- "\n",
- "#Calculation:\n",
- "E = M*10**3*LF*8760 #kWh/year\n",
- "a = C3 #Rs\n",
- "T2 = r1*C3/100 #Annual semi-fixed cost(Rs)\n",
- "b = T2/(M*10**3) #cost per kW\n",
- "c = C2/E #cost per kWh\n",
- "\n",
- "#Results:\n",
- "print \"The required values are:\"\n",
- "print \"a = Rs\",a,\", b = \",round(b,2),\", c = Re\",round(c,4)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The required values are:\n",
- "a = Rs 5000000 , b = 8.33 , c = Re 0.0034\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.11, Page Number: 79"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "PC = 100 #installed capacity(kW)\n",
- "CC = 3000 #plant cost(Rs/kW of PC)\n",
- "r1 = 5 #interest(%)\n",
- "r2 = 2 #depreciation(2%)\n",
- "r3 = 2 #operation & maintenance(%)\n",
- "r4 = 1.5 #insurance, rent(%)\n",
- "r = 12.5 #losses in transmission and distribution(%)\n",
- "DF = 1.25 #diversity factor\n",
- "LF = 0.4 #load factor\n",
- "M = 0.8*PC #max demand(kW)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "L = M*LF #avg demand(kW)\n",
- "C1 = CC*PC #Capital cost(Rs)\n",
- "T1 = (r1+r2)*C1/100 #annual fixed charges(Rs)\n",
- "T11 = T1/(DF*M) #annual fixed charges(Rs/kW)\n",
- "RC = C1*(r3+r4)/100 #annual running charges(Rs)\n",
- "E = L*8760 #kWh/year\n",
- "E1 = E*(1-r/100) #units reaching the consumer(kWh)\n",
- "RC1 = RC/E1 #annual running charges(Rs/kWh)\n",
- "T = T1+RC #total charges(Rs)\n",
- "C2 = T/E1 #cost per kWh(Rs)\n",
- "\n",
- "#Results:\n",
- "print \"Total generation cost in two part form is given by:\"\n",
- "print \"Rs (\",T11,\"* kW +\",round(RC1,3),\"* kWh)\"\n",
- "print \"Overall cost of generation per kWh is \",round(C2*100,1),\"paise\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Total generation cost in two part form is given by:\n",
- "Rs ( 210.0 * kW + 0.043 * kWh)\n",
- "Overall cost of generation per kWh is 12.8 paise\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.12, Page Number: 80"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#variable declaration:\n",
- "M = 1000 #max demand(kW)\n",
- "LF = 0.5 #load factor\n",
- "#for (i)a private oil engine generating plant:\n",
- "\n",
- "CC1 = 12*10**5 #capital cost(Rs)\n",
- "c1 = 0.005 #Cost of repair and maintenance(Rs/kWh)\n",
- "c2 = 1600 #Cost of fuel(Rs/1000kg)\n",
- "r1 = 10 #Interest and depreciation (%)\n",
- "w = 0.3 #fuel consumption(kg/kWh)\n",
- "c3 = 50000 #wages(Rs)\n",
- "\n",
- "#for (i)Public supply company:\n",
- "#Rs 150 per kW of maximum demand plus 15 paise per kWh\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "E = M*LF*8760 #kWh/year\n",
- "\n",
- "#for(i) Private oil engine generating plant:\n",
- "W = w*E #annual fuel consumption(kg)\n",
- "C1= W*c2/1000 #cost of fuel(Rs)\n",
- "T1 = C1+c1*E+r1*CC1/100+c3 #total annual cost(Rs)\n",
- "\n",
- "#for(ii)Public supply company:\n",
- "T2 = 150*M+.15*E #total annual cost(Rs)\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"(i)For Private oil engine generating plant,\" \n",
- "print \" total annual charges is Rs\",T1\n",
- "print \"(ii)Public supply company, total annual charges is Rs\",T2"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)For Private oil engine generating plant,\n",
- " total annual charges is Rs 2294300.0\n",
- "(ii)Public supply company, total annual charges is Rs 807000.0\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- " Example 4.13, Page Number: 80"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "LF = 0.3 #load factor\n",
- "M = 100 #max demand(MW)\n",
- "\n",
- "#steam: \n",
- "cc1 = 1250 # Capital cost/kW installed(Rs)\n",
- "r11 = 12 # Interest and depreciation(%)\n",
- "c11 = 5 # Operating cost/kWh, paise\n",
- "tc11 = 0 # Transmission cost/kWh\n",
- "\n",
- "#hydro:\n",
- "cc2 = 2500 # Capital cost/kW installed(Rs)\n",
- "r21 = 10 # Interest and depreciation(%)\n",
- "c21 = 1.5 # Operating cost/kWh,paise\n",
- "tc21 = 0.2 # Transmission cost/kWh,paise\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "E = M*LF*8760*10**3 #kWh/year\n",
- "\n",
- "#(i)steam station in conjunction with a hydro station:\n",
- "Eh = 100*10**6 #units supplied by hydro station(kWh)\n",
- "Es = E-Eh #units supplied by steam station(kWh)\n",
- "Pmh = 40 #max o/p of hydro stn.(MW)\n",
- "Pms = 60 #max o/p of steam stn(MW)\n",
- "\n",
- "#(i)(a)for steam station:\n",
- "Cs1 = cc1*Pms*10**3 #capital cost(Rs)\n",
- "Ts1 = r11*Cs1/100+c11*Es/100+0 #total cost(Rs)\n",
- "\n",
- "# (b)for hydro station:\n",
- "Ch1 = cc2*Pmh*10**3 #capital cost(Rs)\n",
- "Th1 = r21*Ch1/100+c21*Eh/100+tc21*Eh/100 #total cost(Rs)\n",
- "\n",
- "Ta = Ts1+Th1 #total annual cost(Rs)\n",
- "OC1 = Ta/E #kWh\n",
- "\n",
- "\n",
- "\n",
- "#(ii)Steam station:\n",
- "Pm2 = 100*10**3 #max o/p of steam plant(kW)\n",
- "Cs2 = cc1*Pm2 #capital cost(Rs)\n",
- "Ts2 = (Cs2*r11/100)+c11*E/100 #Rs\n",
- "OC2 = Ts2/E #overall cost(Rs)\n",
- "\n",
- "#(iii)Hydro station:\n",
- "Ch3 = cc2*Pm2 #capital cost(Rs)\n",
- "Th3 = Ch3*r21/100+c21*E/100 #Rs\n",
- "OC3 = Th3/E+tc21/100 ##overall cost(Rs)\n",
- "\n",
- "#Results:\n",
- "print \"(i)steam station in conjunction with a hydro station:\"\n",
- "print \" for steam stn., overall cost is \",round(OC1*100,2),\"paise\"\n",
- "print \"(ii) Steam station, overall cost is \",round(OC2*100,2),\"paise\"\n",
- "print \"(ii) Hydro station, overall cost is \",round(OC3*100,2),\"paise\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)steam station in conjunction with a hydro station:\n",
- " for steam stn., overall cost is 10.97 paise\n",
- "(ii) Steam station, overall cost is 10.71 paise\n",
- "(ii) Hydro station, overall cost is 11.21 paise\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.14, Page Number: 81"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "M = 150*10**3 #maximum demand(kW)\n",
- "\n",
- "#Steam plant:\n",
- "cc1 = 1600 #Rs/kW\n",
- "oc1 = 0.06 #operating cost(Rs/kWh)\n",
- "r1 = 7 #interest(%)\n",
- "\n",
- "#Hydro plant:\n",
- "cc2 = 3000 #Rs/kW\n",
- "oc2 = 0.03 #operating cost(Rs/kWh)\n",
- "r2 = 7 #interest(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "x = symbols('x') #total no. of units generated\n",
- "#for steam plant:\n",
- "cs = cc1*M #capital cost(Rs)\n",
- "Ts = r1*cs/(x*100)+oc1 #total cost(Rs)\n",
- "Ts1 = Ts #Rs/kWh\n",
- "\n",
- "#for hydro plant:\n",
- "ch = cc2*M #capital cost(Rs)\n",
- "Th = r2*ch/(100*x)+oc2 #total cost(Rs)\n",
- "Th1 = Th #Rs/kWh\n",
- "L = solve(Ts1-Th1,x)\n",
- "LF = (L[0])/(M*8760)\n",
- "\n",
- "print \"Load factor is \",round(LF*100,1),\"%\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Load factor is 37.3 %\n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.15, Page Number: 82"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "Eo = 40*10**6 #units needed to generate\n",
- "\n",
- "#Hydro Steam\n",
- "cc1 = 2100; cc2 = 1200 #Capital cost(Rs/kW) \n",
- "rc1 = 3.2; rc2 = 5 #Running cost(paise/kWh) \n",
- "r1 = 7.5; r2 = 9 #Interest & depreciation(%)\n",
- "RC1 = 33; RC2 = 25 #Reserve capacity(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Let x kW be the maximum demand. \n",
- "#Let y be the annual load factor at which cost/unit\n",
- "#of steam and hydro stations is the same.\n",
- "\n",
- "x,y = symbols('x y')\n",
- "E = x*y*8760 #units generated per annum(kWh)\n",
- "C2 = x+RC2*x/100 #installed capacity of steam station(kW)\n",
- "C1 = x+RC1*x/100 #installed capacity of hydro station(kW)\n",
- "\n",
- "#steam station:\n",
- "CC2 = cc2*C2 #capital cost(Rs)\n",
- "OC2 = (r2*CC2/100+rc2*E/100)/E #Overall cost/kWh\n",
- "\n",
- "#hydro station:\n",
- "CC1 = cc1*C1 #capital cost(Rs)\n",
- "OC1 = (r1*CC1/100+rc1*E/100)/E #Overall cost/kWh\n",
- "\n",
- "LF = solve(OC1-OC2,y)[0] #load factor\n",
- "E2 = 8760*x*LF #kWh\n",
- "M = solve(E2-Eo,x)[0] #max. demand(kW)\n",
- "C = (135*M + 438*M*LF) #cost of generation(Rs)\n",
- "\n",
- "#Results\n",
- "print \"Load factor is \",round(LF*100,2),\"%\"\n",
- "print \"Required cost of generation is Rs (\",round(C/10**6,1),\"* 10**6 )\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Load factor is 47.23 %\n",
- "Required cost of generation is Rs ( 3.3 * 10**6 )\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 4.16, Page Number: 83"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "\n",
- "#Let x = Installed capacity of station B in kW\n",
- "#y = Hours of operation of station B\n",
- "\n",
- "x,y = symbols('x y')\n",
- "M = 50000 #max demand(kW)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "PCa = M-x #installed capacity of stationA(kW)\n",
- "Eb = (1/2)*x*(8760*x/M) #Units generated/annum by station B\n",
- "Ea = (1/2)*8760*M-Eb #Units generated/annum by station A\n",
- "Cb = 50000+50*x+0.03*Eb #Rs\n",
- "Ca = 75000+80*(50000-x)+0.02*Ea #Rs\n",
- "C = Ca+Cb #total operating cost(Rs)\n",
- "#After differentiating C w.r.t x, we get C1 as\n",
- "C1 = -30+0.00174*x\n",
- "x1 = solve(C1,x)[0]\n",
- "\n",
- "PCb = x1 #kW\n",
- "PCa = M-PCb #kW\n",
- "t = 8760*PCb/M #hours of operation of station B\n",
- "\n",
- "#Results:\n",
- "print \"Installed capacity of station A is \",round(PCa),\"MW\"\n",
- "print \"Installed capacity of station B is \",round(PCb),\"MW\"\n",
- "print \"No. of hours of operation of plant B is\",round(t/10)*10,\"hrs\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Installed capacity of station A is 32759.0 MW\n",
- "Installed capacity of station B is 17241.0 MW\n",
- "No. of hours of operation of plant B is 3020.0 hrs\n"
- ]
- }
- ],
- "prompt_number": 14
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter5_1.ipynb b/Principles_of_Power_System/chapter5_1.ipynb deleted file mode 100644 index 195b1538..00000000 --- a/Principles_of_Power_System/chapter5_1.ipynb +++ /dev/null @@ -1,762 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:95fdfaa4e5e5dbdce2d60b65f4e1e462efff574f2746529cb62b6b5d733a0dc4"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 5: Tariff"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.1, Page Number: 91"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "M = 200 #max demand(kW)\n",
- "LF = 0.4 #load factor\n",
- "c1 = 100 #tarif(Rs/kW)\n",
- "c2 = 10 #tariff(pais/kWh)\n",
- "\n",
- "#Calculation:\n",
- "E = M*LF*8760 #units consumed/year\n",
- "T = c1*M+E*c2/100 #annual charges(Rs)\n",
- "OC = T/E #overall cost(Rs/kWh)\n",
- "\n",
- "#Results:\n",
- "print \"Overall cost per kWh is \",round(OC*100,2),\"paise\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Overall cost per kWh is 12.85 paise\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.2, Page Number: 91"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "V = 220 #voltage(V)\n",
- "I = 20 #current(A)\n",
- "E = 8760 #kWh\n",
- "c1 = 20 #tariff part1(paise/unit for 500hrs)\n",
- "c2 = 10 #tariff part2 for additional unit(paise/unit)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#assuming power factor to be unity.\n",
- "M = V*I/1000 #max demand(kW)\n",
- "\n",
- "#part (i):\n",
- "E1 = M*500 #kWh\n",
- "C1 = c1*E1/100 #Rs\n",
- "E2 = E-E1 #kWh\n",
- "C2 = 10*E2/100 #kWh\n",
- "T = C1+C2 #total annual bill(Rs)\n",
- "T2 = T/E #equivalent flat rate(Rs/kWh)\n",
- "\n",
- "#Results:\n",
- "print \"(i) Annual bill is Rs\",T\n",
- "print \"(ii)Eqv flat rate is \",round(T2*100,1),\"paise\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Annual bill is Rs 1096.0\n",
- "(ii)Eqv flat rate is 12.5 paise\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.3, Page Number: 92"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "\n",
- "#for tariff (a):\n",
- "c1 = 100 #tariff part1(Rs)\n",
- "c11 = 15 #tariff part2(paise/kWh)\n",
- "\n",
- "#for tariff (b):\n",
- "c2 = 30 #paise/kWh\n",
- "\n",
- "#Calculation:\n",
- "#Let x be the number of units at which charges \n",
- "#due to both tariffs become equal.\n",
- "\n",
- "x = symbols('x')\n",
- "x1 = solve(c1+c11*x/100 - c2*x/100 , x)[0]\n",
- "\n",
- "#Results:\n",
- "print \"Tariff(a) is economical if consumption is more than\",round(float(x1),2),\"units.\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Tariff(a) is economical if consumption is more than 666.67 units.\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.4, Page Number: 92"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "#for 1t tariff:\n",
- "c11 = 30 #Rs/annum\n",
- "c12 = 3 #paise/unit\n",
- "\n",
- "#for 2nd tariff:\n",
- "c21 = 6 #paise/unit for 1st 400 units\n",
- "c22 = 5 #paise/unit for extra units\n",
- "\n",
- "#Calculation:\n",
- "#Let x (> 400) be the number of units taken per annum \n",
- "#for which the annual charges due to both tariffs become equal.\n",
- "\n",
- "x=symbols('x')\n",
- "T1 = c11+c12*x/100 #charges due to 1st tariff(Rs)\n",
- "T2 = c21*400/100+c22*(x-400)/100 #charges due to 2nd tariff(Rs)\n",
- "x1 = solve(T1-T2,x)[0]\n",
- "\n",
- "#Results:\n",
- "print \"Required no. of units are \",round(x1),\"kWh\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Required no. of units are 1300.0 kWh\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.5, Page Number: 92"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "M = 50 #max load on the station(MW)\n",
- "AD = 75 #aggregate demand by consumers(MW)\n",
- "E = 18*10**7 #units/annum\n",
- "\n",
- "#for annual fixed charges:\n",
- "c11 = 28*10**5 #for generation(Rs)\n",
- "c12 = 32*10**5 #for transmission & distribution(Rs)\n",
- "c13 = 90*10**5 #for fuel(Rs)\n",
- "\n",
- "#for running charges:\n",
- "c21 = 0.9*90*10**5 #fuel cost(Rs)\n",
- "r = 85 #% of power transmitted\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "T1 = c11+c12+c13*0.1 #10% of fuel used for fixed charges(Rs)\n",
- "C1 = T1/(AD*10**3) #Rs/kW\n",
- "\n",
- "\n",
- "E1 = r*E/100 #units delivered to consumers\n",
- "C2 = c21/E1 #cost per kWh\n",
- "\n",
- "#Results:\n",
- "print \"Tariff is\",C1 ,\"Rs/kW of maximum demand plus\",round(C2*100,1),\"paise per kWh.\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Tariff is 92.0 Rs/kW of maximum demand plus 5.3 paise per kWh.\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.6, Page Number: 93"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "M = 75*10**3 #Max emand(kW)\n",
- "LF = 0.4 #load factor\n",
- "\n",
- "c1 = 60 #1st part of generating cost(Rs/kW)\n",
- "c2 = 4 #2nd part of generating cost(paise/kW)\n",
- "\n",
- "CT = 2000000 #annual capital charges for transmission system(Rs)\n",
- "CD = 1500000 #annual capital charges for distribution system(Rs)\n",
- "\n",
- "dt = 1.2 #diversity factor of tr. system\n",
- "dd = 1.25 #diversity factor of tr. system\n",
- "\n",
- "nt = 0.9 #efficiency of tr system\n",
- "nd = 0.85 ##efficiency of distribution system\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#(i) Cost at substation:\n",
- "#(a)Annual fixed charges:\n",
- "\n",
- "Tafc1 = c1*M+CT #total annual fixed cost(Rs)\n",
- "S1 = M*dt #sum of all the max demands(kW)\n",
- "AC1 = Tafc1/S1 #Annual cost per kW of max. demand(Rs)\n",
- "\n",
- "#(b) Running Charges:\n",
- "Cs1 = c2/nt #Cost/kWh at substation(paise)\n",
- "\n",
- "#(ii) Cost at consumer\u2019s premises:\n",
- "Tafc2 = Tafc1+CD #Total annual fixed charges at consumer\u2019s premises(Rs)\n",
- "S2 = S1*dd #sum of of maximum demands of all consumers(kW)\n",
- "AC2 = Tafc2/S2 #Annual cost per kW of maximum demand(Rs)\n",
- "#As the distribution efficiency is 85%, therefore, for each kWh delivered from\n",
- "#substation, only 0\u00b785 kWh reaches the consumer\u2019s premises\n",
- "Cs2 = Cs1/nd #Cost/kWh at consumer premises(paise)\n",
- "\n",
- "#Result:\n",
- "print \"(i)At sub-station, the cost is Rs\",round(AC1,2),\"per annum per kW maximum demand \"\n",
- "print \" plus\",round(Cs1,2),\"paise per kWh\"\n",
- "print \"\\n(ii)At consumer\u2019s premises, the cost is\",round(AC2,2),\"per annum per kW maximum demand\"\n",
- "print \" plus\",round(Cs2,2),\"paise per kWh.\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)At sub-station, the cost is Rs 72.22 per annum per kW maximum demand \n",
- " plus 4.44 paise per kWh\n",
- "\n",
- "(ii)At consumer\u2019s premises, the cost is 71.11 per annum per kW maximum demand\n",
- " plus 5.23 paise per kWh.\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.7, Page Number: 94"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "# Fixed charges Running charges #Station \n",
- "# (per kW) (paise/kWh)\n",
- "Cf1 = 300; Cr1 = 25 #Diesel \n",
- "Cf2 = 1200; Cr2 = 6.25 #Steam \n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Suppose energy supplied in one year is 100 units i.e., 100 kWh.\n",
- "\n",
- "#Diesel Station:\n",
- "L = symbols('L') #load factor\n",
- "E = 100 #kWh(say)\n",
- "P = E/8760 #avg power, kW\n",
- "M = P/L #max deamnd(kW)\n",
- "C1 = Cf1*M+E*Cr1/100 #Fixed and running charges for 100 kWh\n",
- "\n",
- "#Steam station\n",
- "C2 = Cf2*M+E*Cr2/100 #Fixed and running charges for 100 kWh\n",
- "\n",
- "L1 = solve(C1-C2,L)[0]\n",
- "\n",
- "#Result:\n",
- "print \"The load fctor is \",round(L1*100,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The load fctor is 54.79 %\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.8, Page Number: 95"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "M = 100 #max demand(kW)\n",
- "LF = 0.6 #load factor\n",
- "pf = 0.8 #power factor\n",
- "c1 = 75 #1st part tariff(Rs/kVA)\n",
- "c2 = 15 #2nd part tariff(paise/kWh)\n",
- "\n",
- "#Calculation:\n",
- "E = M*LF*8760 #units consumed/year\n",
- "M1 = M/pf #max demand in kVA\n",
- "AB = M1*c1+E*c2/100 #annual bill(Rs)\n",
- "\n",
- "#Result:\n",
- "print \"Annual bill is Rs\",AB"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Annual bill is Rs 88215.0\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.9, Page Number: 95"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "M = 240 #max load(kW)\n",
- "pf = 0.8 #power factor\n",
- "E = 50000 #annual units consumption(kW)\n",
- "c1 = 50 #1st part tariff(Rs/KVA)\n",
- "c2 = 10 #2nd part tariff(paise/unit)\n",
- "\n",
- "#Calculation:\n",
- "M1 = M/pf #KVA\n",
- "AB = M1*c1+E*c2/100 #annual bill(Rs)\n",
- "FR = AB/E #Rs\n",
- "\n",
- "#now\n",
- "pf1 = 1\n",
- "M2 = M\n",
- "AB1 = M2*c1+E*c2/100 #Rs\n",
- "S = AB-AB1 #annual saving(Rs)\n",
- "\n",
- "#Result:\n",
- "print \"Flat rate of energy consumption is \",FR*100,\"paise\"\n",
- "print \"Annual saving is Rs\",S"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Flat rate of energy consumption is 40.0 paise\n",
- "Annual saving is Rs 3000.0\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.10, Page Number: 96"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "M = 50 #max demand(kW)\n",
- "E = 36000 #energy consume(kWh)\n",
- "R = 23400 #reactive power(KVAR)\n",
- "c1 = 80 #1st part tariff(Rs/kW)\n",
- "c2 = 8 #2nd part tariff(paise/unit)\n",
- "c3 = 0.5 #3rd part tariff(p/kWh)for each 1% of pf below 86%\n",
- "\n",
- "#Calculation:\n",
- "L = E/(24*30) #avg load(kW)\n",
- "RP = R/(24*30) #avg reactive power(kVAR)\n",
- "\n",
- "theta = math.atan(RP/L) #power factor angle\n",
- "pf = math.cos(theta) \n",
- "PFS = E*c3*(0.86-pf) #power factor surcharge(Rs)\n",
- "MB = c1*L+c2*E/100+PFS #monthly bill(Rs)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The monthly bill is Rs\",round(MB,1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The monthly bill is Rs 7268.0\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.11, Page Number: 96"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "c1 = 150 #1st part tariff(Rs/KVA)\n",
- "c2 = 8 #2nd part tariff(paise/unit)\n",
- "LF = 0.3 #load factor\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#suppose max demand is 1kVA\n",
- "\n",
- "#(i)When p.f. is unity:\n",
- "pf = 1\n",
- "OC1 = c1*100/(8760*LF)+c2 #operating cost(Rs)\n",
- "\n",
- "#(ii) When p.f. is 0\u00b77\n",
- "pf1 = 0.7\n",
- "OC2 = c1*100/(8760*LF*pf1)+c2 #operating cost(Rs)\n",
- "\n",
- "#Result:\n",
- "print \"At unity p. f., overall cost is Rs\",round(OC1,2)\n",
- "print \"At 0.7 p. f., overall cost is Rs\",round(OC2,2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "At unity p. f., overall cost is Rs 13.71\n",
- "At 0.7 p. f., overall cost is Rs 16.15\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.12, Page Number: 97"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#variable declaration\n",
- "L = 200 #avg load(kW)\n",
- "pf = 0.8 #power factor\n",
- "M = 250 #max demand(kW)\n",
- "l = 4 #losses(%)\n",
- "r = 12 #interest & depreciation(%)\n",
- "C = 50 #high voltage equipment cost(Rs)\n",
- "t = 8 #working hours\n",
- "n = 300 #no. of working working\n",
- "\n",
- "#for system(i)high voltage supply:\n",
- "c11 = 5 #1st part tariff(paise/unit)\n",
- "c12 = 4.50 #2nd part tariff(per month per kVA)\n",
- "\n",
- "#for system(ii)low voltage supply:\n",
- "c21 = 5.5 #1st part tariff(paise/unit)\n",
- "c22 = 5 #2nd part tariff(Rs per month per kVA)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#(i) High voltage supply:\n",
- "\n",
- "M1 = M/pf #Max. demand in kVA\n",
- "#As the losses in h.v. equipment are 4%, therefore, \n",
- "#capacity of h.v. equipment:\n",
- "Cap = round(M1/(1-l/100),1) #capacity of h.v. equipment(kVA)\n",
- "C1 = C*Cap #Capital investment on h.v. equipment(Rs)\n",
- "E1 = L*t*n/(1-l/100) #units consumed(kWh)\n",
- "T1 = C1*r/100+Cap*c12*12+c11*E1/100 #Total annual cost(Rs)\n",
- "\n",
- "#(i) low voltage supply:\n",
- "M2 = M/pf #Max. demand in kVA\n",
- "E2 = L*t*n #units consumed(kWh)\n",
- "T2 = M2*c22*12+E2*c21/100 #kWh\n",
- "\n",
- "T = T2 - T1\n",
- "\n",
- "#Results:\n",
- "print \"Difference in the annual costs of two systems is Rs\",T\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Difference in the annual costs of two systems is Rs 620.0\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.13, Page Number: 97"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "#(i) Purchasing diesel set:\n",
- "M1 = 1000 #kW\n",
- "C1 = 400 #Rs/kW\n",
- "r1 = 10 #annual interest depreciation(%)\n",
- "c11 = 75 #Rs/kW\n",
- "c12 = 5 #paise/unit\n",
- "\n",
- "#(ii) Purchasing from grid supply:\n",
- "r1 = 10 #annual interest depreciation(%)\n",
- "c21 =120 #Rs/kW\n",
- "c22 = 3 #paise/unit\n",
- "#after 2 years:\n",
- "M2 = 2500 #kW\n",
- "E = 5.5*10**6 #units reached\n",
- "\n",
- "#Calculation:\n",
- "#(i) Purchasing diesel set:\n",
- "CC = M1*C1 #Rs\n",
- "#The present capacity of the station is 2000 kW and the expected\n",
- "#maximum demand after two years is 2500 kW.\n",
- "P = 2500-2000 #extra power to be generated(kW)\n",
- "T1 = CC*r1/100+P*c11+E*c12/100 #total annual cost(Rs)\n",
- "\n",
- "#(ii) Purchasing from grid supply:\n",
- "T2 = P*c21+E*c22/100 #total annual cost(Rs)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Alternative (ii) is cheaper by Rs\",T1-T2,\"per annum\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Alternative (ii) is cheaper by Rs 127500.0 per annum\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 5.14, Page Number: 98"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "from sympy import *\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "#H.V supply:\n",
- "c11 = 70 #1st part tariff(Rs/kVA)\n",
- "c12 = 3 #2nd part tariff(paise/kWh)\n",
- "\n",
- "#L.V supply:\n",
- "c21 = 65 #1st part tariff(Rs/kVA)\n",
- "c22 = 4 #2nd part tariff(paise/kWh)\n",
- "\n",
- "c = 50 #cost of transformer & switchgear for HV side(Rs/kVA)\n",
- "r1= 2 #transformer losses(%)\n",
- "r2 = 15 #annual fixed charges(%) of transformer & switchgear\n",
- "n = 6 #no of working hours\n",
- "\n",
- "#Calculation:\n",
- "(x,y) = symbols('x y') #say x = Factory load in kW\n",
- " #y = No. of working days above which H.V.\n",
- " #supply is cheaper\n",
- "#for HV side: \n",
- "r = x*round(1/(1-r1/100),4) #rating of transformer & switchgear(kVA)\n",
- "E1 = x*y*round(n*1/(1-r1/100),2) #units consumed per annnum\n",
- "T11 = x*math.floor(1/(1-r1/100)*c11*100)/100+x*round(1/(1-r1/100)*r2*c/100,2) #total fixed charges(Rs)\n",
- "T12 = E1*c12/100 #total running charges(Rs)\n",
- "T1 = T11+T12 #total annual charges(Rs)\n",
- "\n",
- "#for LV side:\n",
- "E2 = x*y*n #units consumed per annnum\n",
- "T21 = c21*x #total fixed charges(Rs)\n",
- "T22 = c22*E2/100 #total running charges(Rs)\n",
- "T2 = T21+T22 #total annual charges(Rs)\n",
- "y11 = solve(T1-T2,y)[0]\n",
- "\n",
- "#Result:\n",
- "print \"If the factory is run for more than\",math.floor(y11),'days' #the ans. is different from that in book\n",
- "print \"then H. V. supply will be cheaper.\" #due to calculation using improper rounding."
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "If the factory is run for more than 249.0 days\n",
- "then H. V. supply will be cheaper.\n"
- ]
- }
- ],
- "prompt_number": 2
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter6_1.ipynb b/Principles_of_Power_System/chapter6_1.ipynb deleted file mode 100644 index a1cd7a3c..00000000 --- a/Principles_of_Power_System/chapter6_1.ipynb +++ /dev/null @@ -1,1112 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:357707f074867e12cc217076fc35399c9b1e6483f5b92a23e0c3be75457e81b5"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 6: Power Factor Improvement"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.1, Page Number: 108"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Variable declaration:\n",
- "kW1 = 300\n",
- "pf1 = 0.6 #power factor\n",
- "pf2 = 1\n",
- "\n",
- "#Calculation:\n",
- "kVA = kW1/pf1\n",
- "kW2 = kVA*pf2\n",
- "kW = kW2-kW1\n",
- "\n",
- "#Result:\n",
- "print \"Increased power supplied by the alternator is\",kW,\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Increased power supplied by the alternator is 200.0 kW\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.2, Page Number: 109"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "V = 400 #rated voltage(V)\n",
- "Im = 31.7 #motor curtrent(A)\n",
- "pf1 = 0.7 #initial power factor\n",
- "pf2 = 0.9 #raised power factor\n",
- "f = 50 #Hz\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Referring to the phasor diagram,\n",
- "Ima = Im*pf1 #Active component of Im(A)\n",
- "I = Ima/pf2 #total current(A)\n",
- "Imr = Im*math.sqrt(1-pf1**2) #Reactive component of Im(A)\n",
- "Ir = I*math.sqrt(1-pf2**2) #Reactive component of I(A)\n",
- "Ic = Imr-Ir #A\n",
- "\n",
- "C = Ic/(V*2*math.pi*f)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Required value of capacitor is\",round(C,7),\"uF\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Required value of capacitor is 9.46e-05 uF\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.3, Page Number: 110"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "#(i):\n",
- "kW1 = 20\n",
- "pf1 = 1\n",
- "\n",
- "#(ii):\n",
- "kW2 = 100\n",
- "pf2 = 0.707\n",
- "\n",
- "#(iii):\n",
- "kW3 = 50\n",
- "pf3 = 0.9\n",
- "\n",
- "#Calculation:\n",
- "kVA1 = kW1/pf1\n",
- "kVA2 = kW2/pf2\n",
- "kVA3 = kW3/pf3\n",
- "\n",
- "kVAR1 = kVA1*0\n",
- "kVAR2 = -kVA2*math.sin(math.acos(0.707))\n",
- "kVAR3 = kVA3*math.sin(math.acos(0.9))\n",
- "\n",
- "kW = kW1+kW2+kW3\n",
- "kVAR = kVAR1+kVAR2+kVAR3\n",
- "kVA = math.sqrt(kW**2+kVAR**2)\n",
- "pf = kW/kVA\n",
- "\n",
- "#Result:\n",
- "print \"Total kW is\",kW\n",
- "print \"Total kVA is\",round(kVA)\n",
- "print \"Power factor is\",round(pf,3)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Total kW is 170\n",
- "Total kVA is 186.0\n",
- "Power factor is 0.913\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.4, Page Number: 111"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "pf1 = 0.75 #Original p.f lag\n",
- "P = 5 #motor input(kW)\n",
- "pf2 = 0.9 #final p.f lag\n",
- "\n",
- "#Calculation:\n",
- "kVAR = P*(math.tan(math.acos(pf1))-math.tan(math.acos(pf2)))\n",
- "R = kVAR/3\n",
- "\n",
- "#Result:\n",
- "print \"Rating of capacitors is\",round(R,3),\"kVAR\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Rating of capacitors is 0.663 kVAR\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.5, Page Number: 111"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "Vph = 400 #rated voltage(V)\n",
- "n = .93 #efficiency\n",
- "P = 74.6 #power output(kW)\n",
- "pf1 = 0.75 #power faactor\n",
- "pf2 = 0.95 #raised power factor\n",
- "n1 = 4 #no. of capacitors in each branch\n",
- "V1 = 100 #rating of capacitors(V)\n",
- "f = 50 #frequency(Hz)\n",
- "\n",
- "#Calculation:\n",
- "Pi = round(P/n) #motor input(kW)\n",
- "phy1 = math.acos(pf1) \n",
- "phy2 = math.acos(pf2)\n",
- "#Leading kVAR taken by the condenser bank\n",
- "kVAR = round(Pi*(math.tan(phy1)-math.tan(phy2)),2) \n",
- "kVAR1 = round(kVAR/3,2) #Leading kVAR taken by each of three sets\n",
- "\n",
- "#Fig. above shows the delta* connected condenser bank.\n",
- "C = symbols('C')\n",
- "Icp = 2*math.pi*f*C*Vph #Phase current of capacitor(A)\n",
- "\n",
- "c = solve(Vph*Icp/1000-kVAR1,C)[0] #capacitance(F)\n",
- "\n",
- "#Result:\n",
- "print \"Capacitance of each capacitor is\",round(c*4*10**6,1),\"uF\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacitance of each capacitor is 1173.8 uF\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.6, Page Number: 112"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "P = 800 #load(kW)\n",
- "pf1 = 0.8 #initial power factor\n",
- "pf2 = 0.9 #improved power factor\n",
- "t = 3000 #working hours\n",
- "c1 = 100 #1st part tariff(Rs/kVA)\n",
- "c2 = 20 #2nd part tariff(paise/kWh)\n",
- "c3 = 60 #cost of capacitors(Rs/kVAR)\n",
- "n = 10 #interest & depreciation on capacitors(%)\n",
- "\n",
- "#Calculation:\n",
- "phy1 = math.acos(pf1)\n",
- "phy2 = math.acos(pf2)\n",
- "#Leading kVAR taken by the capacitors:\n",
- "kVAR = P*(math.tan(phy1)-math.tan(phy2))\n",
- "\n",
- "#Annual cost before p.f. correction:\n",
- "kVAm1 = P/pf1 #max demand\n",
- "T1 = kVAm1*c1+P*t*c2/100 #total annual cost(Rs)\n",
- "\n",
- "#Annual cost after p.f. correction:\n",
- "kVAm2 = P/pf2 #max demand\n",
- "T2 = c1*kVAm2+P*t*c2/100+n*c3*kVAR/100\n",
- "\n",
- "T = T1-T2 #annual saving(Rs)\n",
- "\n",
- "#Result:\n",
- "print \"Annual saving is Rs\",round(T)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Annual saving is Rs 9836.0\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.7, Page Number: 112"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "P1 = 200 #factory load(kW)\n",
- "pf1 = 0.85 #initial power factor\n",
- "pf2 = 0.9 #improved power factor\n",
- "t = 2500 #working hours\n",
- "c1 = 150 #1st part tariff(Rs/kVA)\n",
- "c2 = 5 #2nd part tariff(paise/kWh)\n",
- "c3 = 420 #cost of capacitors(Rs/kVAR)\n",
- "Pcl = 100 #capacitor loss(W/kVAR)\n",
- "n = 10 #interest & depreciation on capacitors(%)\n",
- "\n",
- "#Calculation:\n",
- "phy1 = math.acos(pf1)\n",
- "phy2 = math.acos(pf2)\n",
- "#suppose the leading kVAR taken by the capacitors is x:\n",
- "x = symbols('x')\n",
- "Pcl1 = Pcl*x/1000 #capacitor loss(kW)\n",
- "P2 = P1+Pcl1 #total power(kW)\n",
- "x1 = solve((P1*math.tan(phy1)-P2*math.tan(phy2))-x,x)[0]\n",
- "\n",
- "\n",
- "#Annual cost before p.f. correction:\n",
- "kVAm1 = P1/pf1 #max demand\n",
- "T1 = kVAm1*c1+P1*t*c2/100 #total annual cost(Rs)\n",
- "\n",
- "\n",
- "#Annual cost after p.f. correction:\n",
- "kVAm2 = P1/pf2 #max demand\n",
- "T2 = c1*kVAm2+P1*t*c2/100+n*c3*x1/100+round(Pcl*x1*t*c2/100000)\n",
- "\n",
- "T = T1-T2 #annual saving(Rs)\n",
- "\n",
- "#Result:\n",
- "print \"Annual saving is Rs\",round(T)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Annual saving is Rs 553.0\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.8, Page Number: 113"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "pf = 0.8 #power factor\n",
- "kVA = 750 # monthly demand\n",
- "c1 = 8.50 #monthly power rate(Rs/kVA per month)\n",
- "R = 250 #rating of capacitors(kVA)\n",
- "C2 = 20000 #installed cost of equipment(Rs)\n",
- "r = 10 #fixed charge rate(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "phy = math.acos(pf)\n",
- "kW = kVA*math.cos(phy) #kW component of demand\n",
- "kVAR = kVA*math.sin(phy) #kVAR component of demand\n",
- "kVAR1 = kVAR-R #Leading kVAR taken by the capacitors\n",
- "kVA1 = math.sqrt(kVAR1**2+kW**2) #kVA after p.f. improvement\n",
- "kVA11 = round(kVA-kVA1,1) #Reduction in kVA\n",
- "T1 = c1*kVA11*12 #Yearly saving on kVA charges\n",
- "T2 = r*C2/100 #Fixed charges/year(Rs)\n",
- "T = T1-T2 #net saaving(Rs)\n",
- "\n",
- "#Result:\n",
- "print \"The annual saving is Rs\",T"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The annual saving is Rs 9985.0\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.9, Page Number: 113"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "pf1 = 0.8 #initial power factor\n",
- "pf2 = 0.9 #improved power factor\n",
- "L1 = 200 #load(kW)\n",
- "L2 = 80 #motor load(kW)\n",
- "\n",
- "#Calculation:\n",
- "phy1 = math.acos(pf1)\n",
- "phy2 = math.acos(pf2)\n",
- "L = L1+L2 #combined load(kW)\n",
- "#In Fig. above, \u0394 OAB is the power triangle for load,\n",
- "#\u0394 ODC for combined load and \u0394 BEC for the motor.\n",
- "#(i):\n",
- "kVAR = L1*math.tan(phy1)-L*math.tan(phy2) #Leading kVAR taken by the motor\n",
- "#(ii):\n",
- "kVArat = math.sqrt(L2**2+kVAR**2) #kVA rating of motor\n",
- "#(iii):\n",
- "pf = L2/kVArat #p.f. of motor\n",
- "\n",
- "#Result:\n",
- "print \"The leading kVAR taken by the motor is\",round(kVAR,2)\n",
- "print \"kVA rating of the motor is\",round(kVArat,2)\n",
- "print \"Power factor at which the motor operates is\",round(pf,3),\"leading\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The leading kVAR taken by the motor is 14.39\n",
- "kVA rating of the motor is 81.28\n",
- "Power factor at which the motor operates is 0.984 leading\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.10, Page Number: 114"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "#for induction motor:\n",
- "kW1 = 37.3 \n",
- "pf1 = 0.8 #lagging\n",
- "n1 = 0.85\n",
- "\n",
- "#for synchronous motor:\n",
- "kW2 = 18.65\n",
- "pf = 0.9 #leading\n",
- "n2 = 0.9\n",
- "\n",
- "#for lighting load:\n",
- "kW3 = 10\n",
- "pf3 = 1\n",
- "c1 = 60 #Rs/kVA of max demand\n",
- "c2 = 5 #paie per kWh\n",
- "t = 2000 #working hours\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "P1 = kW1/n1 #power input to induction motor(kW)\n",
- "Q1 = P1*math.tan(math.acos(pf1)) #Lagging kVAR taken by induction motor\n",
- "\n",
- "P2 = kW2/n2 #Input power to synchronous motor(kW)\n",
- "Q2 = P2**math.tan(math.acos(pf1)) #Leading kVAR taken by synchronous motor\n",
- "\n",
- "#Since lighting load works at unity p.f., its lagging kVAR = 0.\n",
- "Q3 = 0 \n",
- "\n",
- "kVAR = Q1-Q2 #net kVAR\n",
- "kW = round(P1+P2+kW3,1) #total active power\n",
- "kVA = round(math.sqrt(kW**2+kVAR**2))\n",
- "\n",
- "T = c1*kVA+c2*kW*t/100\n",
- "\n",
- "#Result:\n",
- "print \"The annual electical charges is Rs\",round(T)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The annual electical charges is Rs 12140.0\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.11, Page Number: 114"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "#(i)for a lighting load:\n",
- "P1 = 500 #kW\n",
- "\n",
- "\n",
- "#(ii) for a load:\n",
- "P2 = 400 #kW\n",
- "pf2 = 0.707 #power factor lagging\n",
- "\n",
- "\n",
- "#(iii)for a load:\n",
- "P3 = 800 #kW\n",
- "pf3 = 0.8 #power factor leading\n",
- "\n",
- "#(iv)for a load:\n",
- "P4 = 500 #kW\n",
- "pf4 = 0.6 #power factor lagging\n",
- "\n",
- "\n",
- "#(v)a synchronous motor driving a d.c. generator:\n",
- "P5 = 540 #power rated at generator(kW)\n",
- "n = 0.9 #overall efficiency\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Total lagging kVAR taken by loads (ii) and (iv)\n",
- "kVAR24 = P2*math.tan(math.acos(pf2))+P4*math.tan(math.acos(pf4))\n",
- "\n",
- "#Leading kVAR taken by the load (iii)\n",
- "kVAR3 = P3*math.tan(math.acos(pf3))\n",
- "\n",
- "#Leading kVAR to be taken by synchronous motor\n",
- "kVAR5 = kVAR24-kVAR3\n",
- "Pi = P5/n #motor input(kW)\n",
- "phy = math.atan(kVAR5/Pi) #phase angle of synchronous motor\n",
- "pf = math.cos(phy)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The power factor of synchronous motor is\",round(pf,2,),\"leading\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The power factor of synchronous motor is 0.79 leading\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.12, Page Number: 115"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "P1 = 100 #power of synchronous motor(hp)\n",
- "P2 = 200 #power aggregated by induction motor(hp)\n",
- "pf2 = 0.707 #lagging power factor for induction motor\n",
- "n2 = 0.82 #efficiency of induction motor\n",
- "P3 = 30 #lighting load(kW)\n",
- "c1 = 100 #1st part tariff(Rs per kVA per annum)\n",
- "c2 = 0.06 #2nd part tariff Rs per kWh\n",
- "pfa = 0.8 #power factor factor initially(lagging)\n",
- "na = 0.93 #efficiency of synchronous motor initially\n",
- "pfb = 0.8 #power factor factor changed later(leading)\n",
- "nb = 0.93 #efficiency of synchronous motor changed later\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#(a) When synchronous motor runs at p.f. 0\u00b78 lagging.\n",
- "kW1 = round(P1*735.5/(na*1000)) #input to synchronous motor(kW)\n",
- "kVAR1 = round(kW1*math.tan(math.acos(pfa)),2) #Lagging kVAR taken by the synchronous motor(kVAR)\n",
- "kW2 = round(P2*735.5/(n2*1000),1) #input to induction motor(kW)\n",
- "kVAR2 = kW2*math.tan(math.acos(pf2)) #Lagging kVAR taken by the induction motor(kVAR) \n",
- "#Since lighting load works at unity p.f., its lagging kVAR is zero.\n",
- "kVARt = kVAR1+kVAR2 #Total lagging kVAR\n",
- "kWt = kW1+kW2+P3 #Total active power(kW)\n",
- "kVAt = round(math.sqrt(kWt**2+kVARt**2),1) #total kVA\n",
- "C1 = kVAt*c1 #annual kVA demand charges\n",
- "E1 = kWt*8760 #Energy consumed/year(kWh)\n",
- "C2 = round(0.06*E1) #annual energy charges(Rs)\n",
- "T1 = C1+C2 #total Annual bill(Rs)\n",
- "\n",
- "\n",
- "#(b) When synchronous motor runs at p.f. 0\u00b78 leading.\n",
- "kVARn = kVAR2-kVAR1 #Net lagging kVAR\n",
- "kWtt = kWt #total active power(kW)\n",
- "kVAtt = math.sqrt(kVARn**2+kWtt**2) #total kVA\n",
- "C11 = c1*kVAtt #annual kVA charges(Rs)\n",
- "C22 = C2 #Annual energy charges(Rs)\n",
- "T2 = C11+C22 #total annual bill(Rs)\n",
- "Ts = T1-T2 #annual saving(Rs)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The annual saving is Rs\",round(Ts/100)*100"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The annual saving is Rs 6200.0\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.13, Page Number: 118"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "pf1 = 0.75 #Power factor of the factory(lagging)\n",
- "x = 72 #Max. demand charges(Rs per kVA per annum)\n",
- "d = 10 #interest & depreciation of capital investment(%)\n",
- "M = 175 #max. demand(kW)\n",
- "c2 = 120 #cost of phase advancing equipment(Rs/kVAR)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "y = c2*d/100 #Expenditure on phase advancing equipment(Rs/kVAR/annum)\n",
- "pf2 = math.sqrt(1-(y/x)**2) #power factor\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Most economical p.f. at which factory should operate is\",round(pf2,3),\"lagging\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Most economical p.f. at which factory should operate is 0.986 lagging\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.14, Page Number: 119"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "L = 400 #avg. demand(kW)\n",
- "pf1 = 0.8 #original power factor(lagging)\n",
- "LF = 0.5 #annual load factor\n",
- "c1 = 50 #first part tariff(Rs/kVA per annum)\n",
- "c2 = 0.05 #second part tariff(Rs/kWh)\n",
- "pf2 = 0.95 #improved power factor\n",
- "c3 = 100 #phase advancement equipment cost(Rs/kVAR)\n",
- "d = 10 #annual interest and depreciation(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "M = L/LF #maximum demand(kW)\n",
- "#Leading kVAR taken by phase advancement equipment:\n",
- "kVAR1 = M*(math.tan(math.acos(pf1))-math.tan(math.acos(pf2)))\n",
- "y = d*c3/100 #Expenditure on phase advancing equipment(Rs/kVAR/annum)\n",
- "kVA1 = M/pf1 #Max. kVA demand at pf1 power fctor\n",
- "kVA2 = round(M/pf2) #Max. kVA demand at pf2 power fctor\n",
- "Cs = c1*(kVA1-kVA2) #Annual saving in maximum demand charges\n",
- "Ce = y*kVAR1 #Annual expenditure on phase advancing equipment\n",
- "NS = Cs-Ce #net annual saving\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The capacity of the phase advancing equipment is\",round(kVAR1),\"kVAR\"\n",
- "print \"(ii)The annual saving is Rs\",round(NS)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The capacity of the phase advancing equipment is 337.0 kVAR\n",
- "(ii)The annual saving is Rs 4529.0\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.15, Page Number: 119"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "L = 50 #avg. demand(kW)\n",
- "pf1 = 0.75 #original power factor(lagging)\n",
- "LF = 0.5 #annual load factor\n",
- "c1 = 100 #first part tariff(Rs/kVA of max demand per annum)\n",
- "c2 = 0.05 #second part tariff(Rs/kWh)\n",
- "c3 = 600 #cost of loss free capacitors(Rs/kVAR)\n",
- "d = 10 #depreciation & interest(%)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "y = c3*d/100 #Expenditure on capacitors(Rs/kVAR/annum)\n",
- "pfe = math.sqrt(1-(y/c1)**2) #Most economical power factor\n",
- "M = L/LF #Max kW demand\n",
- "kVAm1 = M/pf1 #The maximum kVA demand at pf1 power factor\n",
- "kVAm2 = M/pfe #The maximum kVA demand at pfe power factor\n",
- "Cs = c1*(kVAm1-kVAm2) #annual saving(Rs)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Most economical power factor is\",round(pfe,3),\"lagging\"\n",
- "print \"Annual saving is Rs\",round(Cs)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Most economical power factor is 0.8 lagging\n",
- "Annual saving is Rs 833.0\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.16, Page Number: 120"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "L = 200 #avg. demand(kW)\n",
- "pf1 = 0.8 #original power factor(lagging)\n",
- "LF = 0.5 #annual load factor\n",
- "c1 = 100 #first part tariff(Rs/kVA of max demand per annum)\n",
- "c2 = 0.05 #second part tariff(Rs/kWh)\n",
- "c3 = 500 #cost of phase advancing plant(Rs/kVAR)\n",
- "d = 10 #depreciation & interest(%)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "y = c3*d/100 #Expenditure on capacitors(Rs/kVAR/annum)\n",
- "pfe = math.sqrt(1-(y/c1)**2) #Most economical power factor\n",
- "Pc = L*(math.tan(math.acos(pf1))-math.tan(math.acos(pfe))) #Capacity of phase advancing plant\n",
- "E = L*5000 #units consumed per year(kWh)\n",
- "C2 = c2*E #annual energy charges(Rs)\n",
- "C1 = y*Pc #Annual cost of phase advancing plant(Rs)\n",
- "Cm = c1*L/pfe #Max. demand charge(Rs)\n",
- "C = C2+C1+Cm #annual charge(Rs)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) The value to which the power factor be improved is\",round(pfe,3),\"lagging\"\n",
- "print \"(ii) The capacity of the phase advancing plant is\",round(Pc,2),\"kVAR\"\n",
- "print \"(iii)The new bill for energy is Rs\",round(C,1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The value to which the power factor be improved is 0.866 lagging\n",
- "(ii) The capacity of the phase advancing plant is 34.53 kVAR\n",
- "(iii)The new bill for energy is Rs 74820.5\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.17, Page Number: 120"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "E = 80000 #units consumed per year\n",
- "kVAm1 = 500 #maximum kVA demand\n",
- "pf1 = 0.707 #initial power factor(lagging)\n",
- "c1 = 120 #first part tariff(Rs/kVA of max demand per annum)\n",
- "c2 = 0.025 #second part tariff(Rs/kWh)\n",
- "c3 = 50 #cost of phase advancing plant(Rs/kVAR)\n",
- "pf2 = 0.9 #increased powe factor(Rs)\n",
- "d = 10 #depreciation on advancing plant(%)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "C1 = c1*kVAm1+c2*E #annual cost of supply(Rs)\n",
- "P = kVAm1*pf1 #max. kW demand\n",
- "#Leading kVAR taken by phase advancing equipment:\n",
- "kVARe = P*(math.tan(math.acos(pf1))-math.tan(math.acos(pf2)))\n",
- "C2 = round(kVARe*c3*d/100) #Annual cost of phase advancing equipment(Rs)\n",
- "#When p.f. is raised from 0\u00b7707 lag to 0\u00b79 lag\n",
- "kVAm2 = P/pf2 #new maximum kVA demand\n",
- "kVAr = kVAm1-kVAm2 #Reduction in kVA demand\n",
- "Cs = round(c1*kVAr) #annual saving(Rs)\n",
- "#As the units consumed remain the same, therefore, saving will\n",
- "#be equal to saving in M.D. charges minus annual cost of \n",
- "#phase advancing plant.\n",
- "Cs2 = Cs-C2 #annual charges(Rs)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The annual cost of supply is Rs\",C1\n",
- "print \"Annual saving is Rs\",Cs2"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The annual cost of supply is Rs 62000.0\n",
- "Annual saving is Rs 11955.0\n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.18, Page Number: 123"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "pf = 0.7 #power factor when plant working at its max. capacity(lagging)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#For calculating the cost of increasing plant capacity. \n",
- "#We have, referring to Fig. 6.15, the increase in kVA capacity is BD.\n",
- "\n",
- "#Now OE*cos phy2 = OD*cos phy1\n",
- "#or OB*cos phy2 = OD*cos phy1 (Since OE = OB)\n",
- "#or OD = OB * cos phy2/cos phy1 \n",
- "# = OB * 0\u00b785/0\u00b77\n",
- "# = 1\u00b72143 OB\n",
- "\n",
- "#Increase in the kVA capacity of the plant is\n",
- "#BD = OD \u2212 OB = 1\u00b72143 \u00d7 OB \u2212 OB = 0\u00b72143 OB\n",
- "#Total cost of increasing the plant capacity\n",
- "# = Rs 800 \u00d7 0\u00b72143 \u00d7 OB\n",
- "# = Rs 171\u00b744 \u00d7 OB ...(i)\n",
- "\n",
- "cos_phy1 = 0.7; sin_phy1 = 0.714\n",
- "cos_phy1 = 0.85; sin_phy1 = 0.527\n",
- "\n",
- "#Leading kVAR taken by p.f. correction equipment is\n",
- "# ED = CD \u2212 CE = OD*sin phy1 \u2212 OE*sin phy2\n",
- "# = 1\u00b72143 * OB*sin phy1 \u2212 OB*sin phy2\n",
- "# = OB*(1\u00b72143 * 0\u00b7714 \u2212 0\u00b7527) = 0\u00b734 * OB\n",
- "#Suppose the cost per kVAR of the equipment be Rs y.\n",
- "#So, total cost of p.f. correction equipment\n",
- "# = Rs 0\u00b734 \u00d7 OB \u00d7 y ...(ii)\n",
- "#The cost per kVAR of the equipment that would justify its \n",
- "#installation is when exp. (i) = exp. (ii)\n",
- "#i.e.,\n",
- "# 171\u00b744 \u00d7 OB = 0\u00b734 \u00d7 OB \u00d7 y\n",
- "y = 171.44/0.34 #Rs/kVAR\n",
- "\n",
- "#If the losses in p.f. correction equipment are neglected, \n",
- "#then its kVAR = kVA.\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The maximum cost per kVA of p.f. correction equipment\"\n",
- "print \"that can be paid is Rs\",round(y,1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The maximum cost per kVA of p.f. correction equipment\n",
- "that can be paid is Rs 504.2\n"
- ]
- }
- ],
- "prompt_number": 36
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 6.19, Page Number: 124"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "pf = 0.7 #power factor when plant working at its max. capacity(lagging)\n",
- "\n",
- "#Calculation:\n",
- "#Cost of increasing plant capacity\n",
- "# BD = OD \u2212 OB\n",
- "# = OB * 0.866/0.70-OB\n",
- "# = OB*(1\u00b7237 \u2212 1)\n",
- "# = 0\u00b7237 * OB\n",
- "#\u2234 Annual cost of increasing the plant capacity\n",
- "# = Rs 10 * 0\u00b7237 * OB\n",
- "# = Rs. 2.37 * OB ...(i)\n",
- "\n",
- "#Cost of phase advancing equipment. Leading kVAR taken by\n",
- "#phase advancing equipment,\n",
- "# ED = CD \u2212 CE\n",
- "# = OD*sin phy1 \u2212 OE*sin phy2\n",
- "# = 1.237 * OB * sin phy1 \u2212 OB*sin phy2\n",
- "# = OB*(1\u00b7237 * 0\u00b7174 \u2212 0\u00b75) = 0\u00b7383 \u00d7 OB\n",
- "#Let the cost per kVAR of the equipment be Rs y.\n",
- "#Annual cost of phase advancing equipment\n",
- "# = Rs 0.1 * y * 0\u00b7383 * OB ...(ii)\n",
- "#For economical use, the two costs should be equal i.e.,\n",
- "# exp. (i) = exp. (ii).\n",
- "#or 0\u00b71 * y * 0\u00b7383 * OB = 2\u00b737 * OB\n",
- "y = 2.37/(0.1*0.383) #Rs\n",
- "\n",
- "\n",
- "#If the losses in the phase advancing equipment are neglected,\n",
- "#then its kVAR = kVA.\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The maximum cost per kVA of phase advancing equipment\"\n",
- "print \"that can be paid is Rs\",round(y,2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The maximum cost per kVA of phase advancing equipment\n",
- "that can be paid is Rs 61.88\n"
- ]
- }
- ],
- "prompt_number": 2
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter7_1.ipynb b/Principles_of_Power_System/chapter7_1.ipynb deleted file mode 100644 index bcb1dc3f..00000000 --- a/Principles_of_Power_System/chapter7_1.ipynb +++ /dev/null @@ -1,559 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:855ede77f42d7d38570b25f9dfe540c158b87984c52d22c6171f4226086950d9"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 7: Supply Systems"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.1, Page Number: 145"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "V1 = 200 #initial volt of system(V)\n",
- "V2 = 400 #final volt of the system(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "I1,I2,R1,R2 = symbols('I1 I2 R1 R2')\n",
- "I2 = V1*I1/V2\n",
- "W1 = 2*I1**2*2*R1 #Power loss in 200 V system\n",
- "W2 = 2*I2**2*2*R2 #Power loss in 400 V system\n",
- "# As power loss in the two cases is the same,\n",
- "R22 = solve(W1/W2-1,R2)[0]\n",
- "a = R22/R1 #ratio of cables' cross-section\n",
- "v = 1/a #ratio of cables' volumes\n",
- "s = (1-v)*100\n",
- "\n",
- "#Result:\n",
- "print \"% Saving in feeder copper is \",s,\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "% Saving in feeder copper is 75 %\n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.2, Page Number: 146"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "#P = power upplied, W = power loss, \n",
- "#I = current, V = voltage, R = resistance\n",
- "\n",
- "R,V = symbols('R V')\n",
- "P1,I1,W1 = symbols('P1,I1,W1') #for 2-wire system\n",
- "P2,I2,W2 = symbols('P2,I2,W2') #for 3-wire system\n",
- "\n",
- "#Calculation:\n",
- "#Two-wire d.c. system:\n",
- "P1 = V*I1\n",
- "W1 = 2*I1**2*R\n",
- "L1 = W1/P1*100 #% power loss\n",
- "\n",
- "#3-phase, 3-wire a.c. system:\n",
- "P2 = math.sqrt(3)*V*I2\n",
- "W2 = 3*I2**2*R\n",
- "L2 = W2/P2*100 #% power loss\n",
- "\n",
- "I2 = solve(L1-L2,I2)[0]\n",
- "#r2 = P2/P1\n",
- "r2 = math.sqrt(3)*I2*V/(I1*V)\n",
- "P1 = 2*P2\n",
- "\n",
- "#Result:\n",
- "print '''Additional power which can be supplied at \n",
- "unity p.f. by 3-phase, 3-wire a.c. system = 100%.'''"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Additional power which can be supplied at \n",
- "unity p.f. by 3-phase, 3-wire a.c. system = 100%.\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.3, Page Number: 146"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "#Let R be the resistance per conductor in each case\n",
- "\n",
- "R,V = symbols('R V')\n",
- "P1,I1,W1 = symbols('P1,I1,W1') #for 3-wire dc system\n",
- "P2,I2,W2 = symbols('P2,I2,W2') #for 4-wire ac system\n",
- "\n",
- "#Calculation:\n",
- "\n",
- "#3-wire d.c. system.:\n",
- "#At balanced loads, implying no power loss in the neutral wire\n",
- "P1 = 2*V*I1\n",
- "W1 = 2*I1**2*R\n",
- "L1 = W1/P1*100 #% power loss\n",
- "\n",
- "\n",
- "#3-phase, 4-wire a.c. system.:\n",
- "#At balanced loads, implying no power loss in the neutral wire\n",
- "P2 = 3*V*I2\n",
- "W2 = 3*I2**2*R\n",
- "L2 = W2/P2*100 #% power loss\n",
- "\n",
- "I2 = solve(L1-L2,I2)[0]\n",
- "r = P2/P1\n",
- "#solving r, we get\n",
- "P2 = 1.5*P1\n",
- "\n",
- "#Result:\n",
- "print '''Extra power that can be supplied at unity power \n",
- "factor by 3-phase, 4-wire a.c. system = 50%.'''"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Extra power that can be supplied at unity power \n",
- "factor by 3-phase, 4-wire a.c. system = 50%.\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.4, Page Number: 148"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "R,V,phy = symbols('R V phy') #phy is power factor angle\n",
- " #V is voltage between the conductors\n",
- " #R is resistance per conductor \n",
- "P1,I1,W1 = symbols('P1,I1,W1') #for Single phase 2-wire system\n",
- "P2,I2,W2 = symbols('P2,I2,W2') #for 3-phase, 3-wire a.c. system\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#Single phase 2-wire system\n",
- "P1 = 2*V*I1*math.cos(phy)\n",
- "W1 = 2*I1**2*R\n",
- "L1 = W1/P1*100 #% power loss\n",
- "\n",
- "#3-phase, 3-wire a.c. system. \n",
- "P2 = math.sqrt(3)*V*I2*math.cos(phy)\n",
- "W2 = 3*I2**2*R\n",
- "L2 = W2/P2*100 #% power loss\n",
- "\n",
- "I22 = solve(L1-L2,I2)[0]\n",
- "r = P1/(math.sqrt(3)*V*I22*math.cos(phy))\n",
- "#As the power supplied by single phase, 2-wire is 200 kW,\n",
- "P1 = 200\n",
- "\n",
- "#Result:\n",
- "print \"Power supplied by 3-phase, 3-wire a.c. system is\",P1*r,\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Power supplied by 3-phase, 3-wire a.c. system is 400 kW\n"
- ]
- }
- ],
- "prompt_number": 38
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.5, Page Number: 149"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "MVA = 5 #power transmitted to load\n",
- "n = 0.9 #efficiency\n",
- "pf = 0.8 #power factor\n",
- "V = 33 #receiving end voltage(V)\n",
- "l = 50*10**3 #length of line(m)\n",
- "s = 2.85*10**-8 #specific resistance of aluminium(ohm-m)\n",
- "\n",
- "#Calculation:\n",
- "P = MVA*pf*10**6 #power transmitted(W)\n",
- "W = 10*P/100 #line loss(W)\n",
- "\n",
- "\n",
- "#(i) Single phase, 2-wire system:\n",
- "I1 = MVA*10**3/V #Apparent power(A)\n",
- "a1 = 2*I1**2*s*l/W #area of cross-section(m**2)\n",
- "v1= 2*a1*l #volume of conductor required(m**3)\n",
- "\n",
- "#(ii) 3-phase, 3-wire system:\n",
- "I2 = MVA*10**3/(math.sqrt(3)*V) #Apparent power(A)\n",
- "a2 = 3*I2**2*s*l/W #area of cross-section(m**2)\n",
- "v2 = 3*a2*l #volume of conductor required(m**3)\n",
- "\n",
- "#Result:\n",
- "print \"(i) Single phase, 2-wire system, Vol. of conductor required is\",round(v1,2),\"m^3\"\n",
- "print \"(ii)3-phase, 3-wire system, Vol. of conductor required\",round(v2,2),\"m^3\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Single phase, 2-wire system, Vol. of conductor required is 16.36 m^3\n",
- "(ii)3-phase, 3-wire system, Vol. of conductor required 12.27 m^3\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.6, Page Number: 149"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "V1 = 11*10**3 #Supply voltage(V)\n",
- "pf = 0.8\n",
- "R1 = 0.15 #Total resistance in ac system(ohm)\n",
- "R2 = 0.05 #Total resistance in dc system(ohm)\n",
- "r1 = 0.15 #voltage drop in ac system(%)\n",
- "r2 = 0.25 #voltage drop in dc system(%)\n",
- "\n",
- "#Calculation:\n",
- "#Single phase system:\n",
- "I1 = r1*V1/R1 #line current(A)\n",
- "P1 = V1*I1*pf/1000 #power received by consumer(kW)\n",
- "\n",
- "#D.C. two-wire system:\n",
- "P2 = P1\n",
- "V2 = (P2*10**3*R2/r2)**0.5 #supply voltage(V)\n",
- "\n",
- "#Result:\n",
- "print \"The supply voltage is\",V2,\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The supply voltage is 4400.0 V\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.7, Page Number: 153"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "I = 200 #current(A)\n",
- "l = 1 #length of cable(km)\n",
- "c1 = 5 #cost per unit(paise/kWh)\n",
- "r1 = 10 #interrest & depreciation(%)\n",
- "ro = 1.73*10**-6 #resistivity(ohm-m)\n",
- "\n",
- "#Calculation:\n",
- "#If 'a' is the area os cross-section of the cnductor,\n",
- "#cost of cable including installation = (20*a + 20) Rs./m.\n",
- "\n",
- "a = symbols('a')\n",
- "R = ro*l*10**5/a\n",
- "E = 2*I**2*R*8760/1000 #energy lost per annum\n",
- "C = c1/100*E #cost of energy lost(Rs)\n",
- "\n",
- "#capital cost for 1 km length of the cable is = Rs. 20,000*a.\n",
- "\n",
- "V = r1/100*20000*a #Variable annual charge(Rs)\n",
- "a1 = solve(C-V,a)[1]\n",
- "\n",
- "#Result:\n",
- "print \"The most economical conductor size is\",round(a1,2),\"cm**2\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The most economical conductor size is 1.74 cm**2\n"
- ]
- }
- ],
- "prompt_number": 22
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.8, Page Number: 153"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "P = 5 #line load(MW)]\n",
- "V = 33 #kV\n",
- "pf = 0.8 #power factor\n",
- "c1 = 4 #paise/kWh\n",
- "r1 = 10 #interest and depreciation(%)\n",
- "ro = 10**-6 #ohm-cm\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "a = symbols('a') #size of conductor(cm**2)\n",
- "R = ro*l*10**5/a #ohm\n",
- "I = P*10**3/(math.sqrt(3)*V*pf) #current (A)\n",
- "E = 3*I**2*R*8760/1000 #kWh\n",
- "C = c1/100*E #Annual cost of energy lost(R)\n",
- "#The capital cost (variable) of the cable = 25000*a Rs/km\n",
- "V = r1/100*25000*a #Rs\n",
- "a1 = solve(C-V,a)[1]\n",
- "\n",
- "#Result:\n",
- "print \"The most economical size of conductor is\",round(a1,2),\"cm**2\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The most economical size of conductor is 0.71 cm**2\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.9, Page Number: 154"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "I = 250 #current through the feeder(A)\n",
- "c1 = 5 #Rs/kg\n",
- "r1 = 10 #interest and depreciation(%)\n",
- "c2 = 5 #paise/kWh\n",
- "d = 8.93 #density of wire(gm/cm**3)\n",
- "ro = 1.73*10**-8 #speciafic resistance(ohm-m)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "l = 1 #length of wire(1 m say)\n",
- "a = symbols('a') #conductor size(m**2)\n",
- "R = ro*l/a #ohm\n",
- "E = 2*I**2*R*8760/1000 #kWh\n",
- "C = c2/100*E #annual cost os energy lost(Rs)\n",
- "m = 2*a*1*d*10**3 #Mass of 1 metre feeder\n",
- "CC = c1*m #capital cost(Rs)\n",
- "V = r1*CC/100 #Variable Annual charge(Rs)\n",
- "a1 = solve(C-V)[1]\n",
- "\n",
- "#Result:\n",
- "print \"The most economic size of conductor is\",round(a1*10000,2),\"cm**2\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The most economic size of conductor is 3.26 cm**2\n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 7.10, Page Number: 154"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "l = 1 #line length(km)\n",
- "V = 110 #supply voltage(kV)\n",
- "\n",
- "#Working hours(hrs) Load(MW) Power factor\n",
- "t1 = 6; P1 = 20 ; pf1 = 0.8\n",
- "t2 = 12; P2 = 5 ; pf2 = 0.8\n",
- "t3 = 6; P3 = 6 ; pf3 = 0.8\n",
- "\n",
- "c1 = 6 #\n",
- "n = 365 #no.of days used\n",
- "r1 = 10 #interest and dep-reciation(%)\n",
- "\n",
- "#Calculation:\n",
- "a = symbols(\"a\") #cross-section of conductor(cm**2)\n",
- "R = 0.176/a #Resistance per km of each conductor(ohm)\n",
- "#The load currents at various loads are :\n",
- "#At 20 MW,\n",
- "I1 = P1*1000/(math.sqrt(3)*V*pf1) #A\n",
- "I2 = P2*1000/(math.sqrt(3)*V*pf2) #A\n",
- "I3 = P3*1000/(math.sqrt(3)*V*pf3) #A\n",
- "\n",
- "E1= 3*R*1/1000*(I1**2*t1+I2**2*t2+I3**2*t3) #Energy loss per day in 3-phase line(kWh)\n",
- "E = E1*n #energy lost per annum(kWh)\n",
- "C = c1*E/100 #Annual cost of energy(Rs)\n",
- "v = r1*6000*a/100 #variable annual charge(Rs/kWh)\n",
- "a1 = solve(C-v,a)[1]\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"THe most economical size of the conductor is\",round(a1,2),\"cm**2\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "THe most economical size of the conductor is 1.56 cm**2\n"
- ]
- }
- ],
- "prompt_number": 24
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter8_1.ipynb b/Principles_of_Power_System/chapter8_1.ipynb deleted file mode 100644 index 6b383670..00000000 --- a/Principles_of_Power_System/chapter8_1.ipynb +++ /dev/null @@ -1,1455 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:9774a5727e94c3e9d7f6de1d46ee1710f0f45bee5b4624a7cce654515da8e820"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 8: Mechanical Design of Overhead Lines"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.1, Page Number: 171"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "k = 0.11 #ratio of shunt-capatance to self capacitance\n",
- "V = 33/math.sqrt(3) #Voltage across string(kV)\n",
- "n = 3 #no. of insulators\n",
- "\n",
- "#Calculation:\n",
- "\n",
- "# At Junction A\n",
- "# I2 = I1 + i1\n",
- "# or V2*w*C = V1*w*C + V1*K*\u03c9*C\n",
- "# or V2 = V1*(1 + K) = V1*(1 + 0\u00b711)\n",
- "# or V2 = 1\u00b711*V1 ...(i)\n",
- "\n",
- "# At Junction B\n",
- "# I3 = I2 + i2\n",
- "# or V3*w*C = V2*w*C + (V1 + V2) K*w*C\n",
- "# or V3 = V2 + (V1 + V2)*K\n",
- "# = 1\u00b711*V1 + (V1 + 1\u00b711*V1)*0\u00b711\n",
- "# V3 = 1\u00b7342 V1\n",
- "# Voltage across whole unit,\n",
- "# V = V1+V2+V3\n",
- "# or V = V1+1.11*V1+1.342*V1\n",
- "\n",
- "V1 = V/3.452 #Voltage across top unit(V)\n",
- "V2 = 1.11*V1 #Voltage across top unit(V)\n",
- "V3 = 1.342*V1 #Voltage across top unit(V)\n",
- "\n",
- "e = V/(n*V3)*100 #string efficiency\n",
- "\n",
- "#Result:\n",
- "print \"(i)\\tVoltage across top unit,V1 is\",round(V1,2),\"kV\"\n",
- "print \" \\tVoltage across middle unit, V2 is\",round(V2,2),\"kV\"\n",
- "print \" \\tVoltage across bottom unit, V3 is\",round(V3,1),\"kV\"\n",
- "print \"(ii)\\tThe string efficiency is \",round(e,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)\tVoltage across top unit,V1 is 5.52 kV\n",
- " \tVoltage across middle unit, V2 is 6.13 kV\n",
- " \tVoltage across bottom unit, V3 is 7.4 kV\n",
- "(ii)\tThe string efficiency is 85.7 %\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.2, Page Number: 172"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "V1 = 8 #voltage across top unit(kV)\n",
- "V2 = 11 #voltage across middle unit(kV)\n",
- "n = 3 #no. of insulators\n",
- "#Calculation:\n",
- "\n",
- "#(i)\n",
- "# Let K be the ratio of capacitance between pin and the earth\n",
- "# to self capacitance. \n",
- "# Let C farad be the self capacitance of each unit, \n",
- "# then, capacitance between pin and earth = K*C.\n",
- "# Applying Kirchoff\u2019s current law to Junction A,\n",
- "# I2 = I1 + i1\n",
- "# or V2*w*C = V1*w*C + V1*K*w*C\n",
- "# or V2 = V1 (1 + K)\n",
- "\n",
- "k = (V2-V1)/V1\n",
- "\n",
- "#(ii)\n",
- "# Applying Kirchoff\u2019s current law to Junction B,\n",
- "# I3 = I2 + i2\n",
- "# or V3*w*C = V2*w*C + (V1 + V2)*K*w*C\n",
- "# or V3 = V2 + (V1 + V2)*K = 11 + (8 + 11) * 0\u00b7375\n",
- "V3 = 18.12 #kV\n",
- "V = V1 + V2+ V3 #kV\n",
- "Vl = math.sqrt(3)*V #line voltage(kV)\n",
- "\n",
- "#(iii)\n",
- "e = V/(n*V3)*100 #stirng efficiency(%)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i) Ratio of capacitance b/w pin & earth is\",k\n",
- "print \"(ii) The line voltage is\",round(Vl,2),\"kV\"\n",
- "print \"(iii)String efficiency is\",round(e,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) Ratio of capacitance b/w pin & earth is 0.375\n",
- "(ii) The line voltage is 64.29 kV\n",
- "(iii)String efficiency is 68.29 %\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.3, Page Number: 172"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "n = 3 #no. of insulators\n",
- "V3 = 17.5 #voltage across the line unit(V)\n",
- "\n",
- "# At Junction A\n",
- "# I2 = I1 + i1\n",
- "# V2 \u03c9 C = V1 \u03c9 C + V1 K \u03c9 C\n",
- "# or V2 = V1 (1 + K) = V1 (1 + 0.125)\n",
- "# \u2234 V2 = 1\u00b7125 V1\n",
- "\n",
- "# At Junction B\n",
- "# I3 = I2 + i2\n",
- "# or V3 \u03c9 C = V2 \u03c9 C + (V1 + V2) K \u03c9 C\n",
- "# or V3 = V2 + (V1 + V2) K\n",
- "# = 1\u00b7125 V1 + (V1 + 1\u00b7125 V1) \u00d7 0.125\n",
- "# \u2234 V3 = 1\u00b739 V1\n",
- "\n",
- "V1 = V3/1.39 #Voltage across top unit(kV)\n",
- "V2 = 1.125*V1 #Voltage across middle unit(kV)\n",
- "\n",
- "V = V1+V2+V3 #voltage across line unit(kV)\n",
- "e = V/(n*V3)*100 #string efficiency(%)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Line to neutral voltage is\",round(V,2),\"kV\"\n",
- "print \"String efficiency is\",round(e,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Line to neutral voltage is 44.25 kV\n",
- "String efficiency is 84.29 %\n"
- ]
- }
- ],
- "prompt_number": 36
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.4, Page Number: 173"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "V3 = 13.1 #voltage across the lowest insulator(kV)\n",
- "V2 = 11 #voltage across the middle insulator(kV)\n",
- "K = symbols('K')\n",
- "# Applying Kirchhoff\u2019s current law to Junctions A and B, we can easily\n",
- "# derive the following equations:\n",
- "\n",
- "# V2 = V1 (1 + K)\n",
- "# or V1 = V2/(1 + K) ...(i)\n",
- "# and V3 = V2 + (V1 + V2)*K ...(ii)\n",
- "# Putting the value of V1 = V2/(1 + K) in eq. (ii), we get,\n",
- "\n",
- "#V3 = V2 + (V2/(1+k)+ V2)*K\n",
- "K1 = solve(V3-(V2 + (V2/(1+K)+ V2)*K),K)[1]\n",
- "\n",
- "V1 = V2/(1+K1)\n",
- "V = V1+V2+V3 #kV\n",
- "\n",
- "#Result:\n",
- "print \"The voltage b/w the bus bars is\",round(float(math.sqrt(3)*V)),\"kV\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The voltage b/w the bus bars is 59.0 kV\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.5, Page Number: 173"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "n = 3 #no.of insulators\n",
- "k = 1/8 #ratio of self-capacitance to shunt capacitance\n",
- "V3 = 15 #safe working voltage of each insulator(kV)\n",
- "\n",
- "# Applying Kirchhoff\u2019s current law to junction A, we get,\n",
- "# V2 = V1*(1 + K)\n",
- "# or V1 = V2/(1 + K) = V2/(1 + 0\u00b7125) = 0\u00b789*V2\n",
- "\n",
- "# Applying Kirchhoff\u2019s current law to Junction B, we get,\n",
- "# V3 = V2 + (V1 + V2)*K = V2 + (0.89*V2 + V2) * 0.125\n",
- "# V3 = 1.236*V2 \n",
- "V2 = V3/1.236 #kV\n",
- "V1 = 0.89*V2 #kV\n",
- "V = V1+V2+V3 #voltage across the string(kV)\n",
- "e = V/(n*V3) *100 #string efficiency(%)\n",
- "\n",
- "#Result:\n",
- "print \"Voltage across the string is\",round(V,3),\"kV\"\n",
- "print \"The string efficiency is\",round(e,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage across the string is 37.937 kV\n",
- "The string efficiency is 84.3 %\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.6, Page Number: 174"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "n = 4 #no. of unit\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "# Suppose Xc = 1 \u03a9. Given, the ratio of self-capacitance to shunt\n",
- "# capacitance is 10, so, Xc1 = 10 \u03a9 .\n",
- "# Suppose that potential V across the string is such that 1 A current \n",
- "# flows in the top insulator.\n",
- "#Thus,\n",
- "V1 = 1*1 #Voltage across top unit(V)\n",
- "V2 = 1*1.1 #Voltage across 2nd unit(V)\n",
- "V3 = 1*1.31 #Voltage across 3rd unit(V)\n",
- "V4 = 1*1.65 #Voltage across 4th unit(V)\n",
- "V = V1+V2+V3+V4 #Voltage obtained across the string(V)\n",
- "\n",
- "#The voltage across each unit expressed as a % of V becomes:\n",
- "f1 = V1/V*100\n",
- "f2 = V2/V*100\n",
- "f3 = V3/V*100\n",
- "f4 = V4/V*100\n",
- "\n",
- "e = V/(n*V4)*100 #string efficiency(%)\n",
- "\n",
- "#Result:\n",
- "print \"(i) The voltage distributation from top unit is \"\n",
- "print \"\\t\",round(f1,2),\"%\\t\",round(f2,2),\"%\\t\",round(f3,1),\"%\\t\",round(f4,1),\"%\"\n",
- "print \"\\n(ii)String efficiency is\",round(e,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The voltage distributation from top unit is \n",
- "\t19.76 %\t21.74 %\t25.9 %\t32.6 %\n",
- "\n",
- "(ii)String efficiency is 76.7 %\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.7, Page Number: 175"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "n = 5 #no.os insulators\n",
- "Vl = 100 #line voltage(kV)\n",
- "\n",
- "#Suppose Xc = 1 \u03a9.\n",
- "#Ratio of self capacitance to shunt capacitance is 10, so, Xc1 = 10 \u03a9. \n",
- "#Let V be the voltage s.t 1A current flows in top insulator.\n",
- "\n",
- "#Calculation:\n",
- "#calculation for fraction of voltage drop:\n",
- "v1 = 1*1 #Voltage across top unit(V)\n",
- "v2 = 1*1.1 #Voltage across 2nd unit(V)\n",
- "v3 = 1*1.31 #Voltage across 3rd unit(V)\n",
- "v4 = 1*1.65 #Voltage across 4th unit(V)\n",
- "v5 = 1*2.16 #voltage across 5th unit(V)\n",
- "v = v1+v2+v3+v4+v5 #total voltage(V)\n",
- "V = 100/math.sqrt(3) #string voltage(V)\n",
- "V1 = round(v1/v*V,3) #kV\n",
- "V2 = v2/v*V #kV\n",
- "V3 = v3/v*V #kV\n",
- "V4 = v4/v*V #kV\n",
- "V5 = v5/v*V #kV\n",
- "e = V/(n*V5)*100 #string efficiency(%)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"(i)The distribution of voltage on the insulator discs are\"\n",
- "print \"V1 = \",round(V1,3),\"kV \",\"\\tV2 =\",round(V2,2),\"kV \\n\",\n",
- "print \"V3 =\",round(V3,1),\"kV\",\"\\t\\tV4 =\",round(V4,2),\"kV\",\n",
- "print \"\\nV5 =\",round(V5,1),\"kV\"\n",
- "print \"\\n(ii)The string efficiency\",round(e,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)The distribution of voltage on the insulator discs are\n",
- "V1 = 7.997 kV \tV2 = 8.8 kV \n",
- "V3 = 10.5 kV \t\tV4 = 13.19 kV \n",
- "V5 = 17.3 kV\n",
- "\n",
- "(ii)The string efficiency 66.9 %\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.8, Page Number: 176"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "n = 4 #no.os insulators\n",
- "V2 = 13.2 #Voltage across 2th unit\n",
- "V3 = 18 #Voltage across 3th unit\n",
- "#Suppose K is the ratio of shunt-capacitance to self-capacitance\n",
- "k = symbols('k')\n",
- "\n",
- "# Referring to Fig.(ii), we have,\n",
- "# V2/V1 = ( 1 + K)/1\n",
- "# V2 = V1 (1 + K)\n",
- "# V3/V1 = (1 + 3K + K2)/1\n",
- "# V3 = V1 (1 + 3K + K2)\n",
- "# putting values of V2 & V3\n",
- "\n",
- "k1 = solve(13.2*k**2+21.6*k-4.8,k)[1]\n",
- "V1 = V2/(1+k1)\n",
- "V4 = V1*(1 + k1**33 + 5*k1**2 + 6*k1)\n",
- "V = V1+V2+V3+V4 #Voltage between line and earth(kV)\n",
- "Vl = math.sqrt(3)*V #Voltage between conductors(kV)\n",
- "\n",
- "#Result:\n",
- "print \"Voltage between conductors is\",round(float(Vl)),\"kV\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Voltage between conductors is 119.0 kV\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.9, Page Number: 177"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "k = 5 #ratio of self-capacitance(C) to pin-earth capacitance(C1)\n",
- "V = 1+1.2+1.64+2.408 #voltage obtained across the string(V)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#(i) The voltage across each unit expressed as a % of V\n",
- "v1 = 1/V*100\n",
- "v2 = 1.2/V*100\n",
- "v3 = 1.6/V*100\n",
- "v4 = 2.408/V*100\n",
- "\n",
- "#(ii)String efficiency\n",
- "e = V/(4*2.408)*100\n",
- "\n",
- "#Result:\n",
- "print \"(i) The voltage across each unit expressed as a % of V are:\"\n",
- "print \"\\tTop Unit: \",round(v1),\"%\"\n",
- "print \"\\tSecond from top: \",round(v2,1),\"%\"\n",
- "print \"\\tThird from top: \",round(v3),\"%\"\n",
- "print \"\\tFourth from top: \",round(v4,1),\"%\"\n",
- "print \"(ii)String efficiency is\",round(e,2),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i) The voltage across each unit expressed as a % of V are:\n",
- "\tTop Unit: 16.0 %\n",
- "\tSecond from top: 19.2 %\n",
- "\tThird from top: 26.0 %\n",
- "\tFourth from top: 38.5 %\n",
- "(ii)String efficiency is 64.87 %\n"
- ]
- }
- ],
- "prompt_number": 54
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.10, Page Number: 177"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "V1,V2,V3,V= symbols('V1 V2 V3 V') #volts (shown in fig(ii))\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "\n",
- "#We know that in an actual string of insulators, 3 capacitances\n",
- "#exist i.e, self-capacitance of each insulator, shunt capacitance \n",
- "#and capacitance of each unit to line.\n",
- "#But, capacitance of each unit to line is very small and\n",
- "#can be neglected.\n",
- "\n",
- "#At Junction A\n",
- "# I2 + i1 = I1 + i1\n",
- "#or V2*w*C + (V2 + V3)*0\u00b71*w*C = V1*\u03c9*C + 0\u00b715*C*V1*w\n",
- "#or 0\u00b71*V3 = 1\u00b715*V1 \u2212 1\u00b71*V2\n",
- "# V3 = 11\u00b75*V1 \u2212 11*V2 ...(i)\n",
- "\n",
- "#At Junction B\n",
- "# I3 + i\u20322 = I2 + i2\n",
- "#or V3*w*C + V3*0\u00b71*C*w = V2*w*C + (V1 + V2)*w*0\u00b715 C\n",
- "#or 1\u00b71*V3 = 1\u00b715*V2 + 0\u00b715*V1 ...(ii)\n",
- "#Putting the value of V3 from exp (i). into exp. (ii), we get,\n",
- "# 1\u00b71*(11\u00b75*V1 \u2212 11*V2) = 1\u00b715*V2 + 0\u00b715*V1\n",
- "#or 13\u00b725*V2 = 12\u00b75*V1\n",
- "# V2 = 12.5/13.25*V1\n",
- "# V3 = 11.5*V1-11*V2\n",
- "# V = V1+V2+V3\n",
- "# V = 40.55/13.25*V1\n",
- "V1 = 13.25/40.55*V\n",
- "V2 = 12.5/13.25*V1\n",
- "V3 = 14.8/13.25*V1\n",
- "\n",
- "#The voltage across each unit expressed as a % of V becomes:\n",
- "p1 = V1/V*100\n",
- "p2 = V2/V*100\n",
- "p3 = V3/V*100\n",
- "\n",
- "\n",
- "#Results:\n",
- "print \"The voltage across each unit expressed as a % of V becomes:\"\n",
- "print \"for top unit, v1 =\",round(p1,1),\"%\",\n",
- "print \"\\nfor middle unit, v2 =\",round(p2,1),\"%\"\n",
- "print \"for 3rd unit, v3 =\",round(p3,1),\"%\"\n",
- "\n",
- "print \"String efficiency is\",round(V/(3*V3)*100,1),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The voltage across each unit expressed as a % of V becomes:\n",
- "for top unit, v1 = 32.7 % \n",
- "for middle unit, v2 = 30.8 %\n",
- "for 3rd unit, v3 = 36.5 %\n",
- "String efficiency is 91.3 %\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.11, Page Number: 179"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable Declaration:\n",
- "V1,V2,V3,V= symbols('V1 V2 V3 V') #volts (shown in fig(i))\n",
- "\n",
- "#Calculation:\n",
- "\n",
- "#At Junction A\n",
- "# I2 + i\u20321 = I1 + i1\n",
- "#or V2*w*C + (V2+V3)*w*0\u00b71*C = V1*w*C+V1*0\u00b72*C*\u03c9 \n",
- "# V3 = 12 V1 \u2212 11 V2 # ...(i)\n",
- "\n",
- "#At Junction B\n",
- "# I3 + i\u20322 = I2 + i2\n",
- "#or V3 \u03c9 C + V3 \u00d7 0\u00b73 C \u00d7 \u03c9 =V2 \u03c9 C + (V1 + V2) \u03c9 \u00d7 0\u00b72 C\n",
- "#or 1\u00b73 V3 = 1\u00b72 V2 + 0\u00b72 V1 ...(ii)\n",
- "#Substituting the value of V3 from exp. (i) into exp. (ii), we get,\n",
- "# 1\u00b73*(12*V1 \u2212 11*V2) = 1\u00b72*V2 + 0\u00b72*V1\n",
- "#or 15\u00b75*V2 = 15\u00b74*V1\n",
- "V2 = 15.4*V1/15.5 #...(iii)\n",
- "V2 = 0.993*V1\n",
- "\n",
- "#Substituting the value of V2 from exp. (iii) into exp. (i), we get,\n",
- "V3 = 12*V1 - 11*0.993*V1\n",
- "V3 = 1.077*V1\n",
- "\n",
- "#Voltage between conductor and earth (i.e. phase voltage)\n",
- "V = V1+V2+V3\n",
- "n = V/(3*V3)*100\n",
- "\n",
- "#Result:\n",
- "print \"String efficiency is\",round(n),\"%\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "String efficiency is 95.0 %\n"
- ]
- }
- ],
- "prompt_number": 55
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.13, Page Number: 184"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r = 1 #conductor radius(cm)\n",
- "d = 100 #conductor spacing(cm)\n",
- "go = 30/math.sqrt(2) #Dielectric strength of air,(rms)(kV/cm)\n",
- "dl = 0.952 #air density factor\n",
- "mo = 0.9 #irregularity factor\n",
- "\n",
- "#Calculation:\n",
- "Vc = mo*go*dl*r*math.log(d/r) #kV/phase\n",
- "Vl = Vc*3**0.5 #kV/line\n",
- "\n",
- "#Result:\n",
- "print \"The disruptive critical voltage for the line is\",round(float(Vl),2),\"kV\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The disruptive critical voltage for the line is 144.97 kV\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.14, Page Number: 184"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "\n",
- "#Variable declaration:\n",
- "r = 0.978 #conductor radius(cm)\n",
- "go = round(30/2**0.5,1) #Dielectric strength of air,rms(kV/cm)\n",
- "Vc = 210/3**0.5 #Disruptive voltage/phase(kV)\n",
- "mo = 1 #irregularity factor(for smooth conductor)\n",
- "dl = 1 #air density factor(at std pressure and temperature)\n",
- "\n",
- "#Calculation:\n",
- "d = r*10**(Vc/(2.3*mo*go*dl*r))\n",
- "\n",
- "#Result:\n",
- "print \"The spacing between the conductors is\",round(d),\"cm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The spacing between the conductors is 341.0 cm\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.15, Page Number: 185"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r = 1.5 #conductor radius(cm)\n",
- "t = 40 #temperature(deg C)\n",
- "b = 76 #atmospheric pressure(cm)\n",
- "mo = 0.85 #irregularity factor\n",
- "f = 50 #Hz\n",
- "d = 200 #conductor spacing(cm)\n",
- "go = 30/2**0.5 #Dielectric strength of air,rms(kV/cm)\n",
- "Vl = 220 #line voltage(kV)\n",
- "\n",
- "#Calculation:\n",
- "dl = round(3.92*b/(273+t),3)\n",
- "\n",
- "Vc = round(mo*go*dl*r*round(math.log(d/r),2),1) #Critical disruptive voltage per phase(kV)\n",
- "V = round(Vl/3**0.5) #kV/phase\n",
- "P = 242.2/dl*(f+25)*(r/d)**0.5*(V-Vc)**2*10**-5 #kW/km/phase\n",
- "Pl = 3*P #corona loss(kW)\n",
- "\n",
- "#Result:\n",
- "print \"Total corona loss per km for three phases is\",round(Pl,5),\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Total corona loss per km for three phases is 0.05998 kW\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.16, Page Number: 185"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "P1 = 53 #corona loss(kW)\n",
- "V1 = 106 #operating voltage(kV)\n",
- "P2 = 98 #corona loss(kW)\n",
- "V2 = 110.9 #operating voltage(kV)\n",
- "V3 = 113 #opeating voltage(kV)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#As f, \u03b4, r and d are the same for the two cases,\n",
- "#therfore, P \u221d (V \u2212 Vc)**2\n",
- "k,Vc = symbols('k Vc') #k = proportionality constant\n",
- " #Vc = critical disuptive voltage(kV)\n",
- "#for 1st case,\n",
- "# V1/3**0.5 = k*(64 - Vc)**2\n",
- "# V2/3**0.5 = k*(61\u00b72 - Vc)**2\n",
- "# Dividing above equations & solving,\n",
- "Vc1 = round(solve(((64-Vc)/(61.2-Vc))-math.sqrt(98/53),Vc)[0],2)\n",
- "Vc1 = 54\n",
- "#Let W kilowatt be the power loss at 113 kV.\n",
- "#W = k*(113/3**0.5-Vc1)**2\n",
- "W = P1*((65.2-Vc1)/(61.2-Vc1))**2\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The disruptive critical voltage at 113 kV is\",Vc1,\"kV\"\n",
- "print \"The corona loss at 113 kV is\",round(W),\"kW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The disruptive critical voltage at 113 kV is 54 kV\n",
- "The corona loss at 113 kV is 128.0 kW\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.17, Page Number: 190"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "w = 680 #weigth of conductor(kg/km)\n",
- "l = 260 #length ofspan(m)\n",
- "u = 3100 #ultimate strength(kg)\n",
- "sf = 2 #safety factor\n",
- "h = 10 #ground clearance(m)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "T = u/sf #working tension(kg)\n",
- "s = w*l**2/(8*T*1000) #span(m)\n",
- "H = h+s\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Conductor should be supported at a height of \",round(H,1),\"m\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Conductor should be supported at a height of 13.7 m\n"
- ]
- }
- ],
- "prompt_number": 56
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.18, Page Number: 190"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "l = 150 #length ofspan(m)\n",
- "a = 2 #conductor cross-section(cm**2)\n",
- "go = 9.9 #specific gravity of conductor(gm/cm**3)\n",
- "ww = 1.5 #Wind force/m length of conductor(kg)\n",
- "T = 2000 #working tension(kg)\n",
- "\n",
- "#Calculation:\n",
- "w = go*a*1/10 #Wt. of conductor/m length(kg)\n",
- "wt = round((w**2+ww**2)**0.5,2) #Total wt of 1m length of conductor(kg)\n",
- "s = wt*l**2/(8*T) #sag(m)\n",
- "#This is the value of slant sag in a direction making \n",
- "#an angle theta with the vertical\n",
- "\n",
- "theta = math.atan(ww/w)\n",
- "Vs = s*math.cos(theta)\n",
- "\n",
- "#Result:\n",
- "print \"The sag is\",round(s,2),\"m\"\n",
- "print \"The vertical sag is\",round(Vs,2),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The sag is 3.49 m\n",
- "The vertical sag is 2.78 m\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.19, Page Number: 191"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "l = 200 #span length(m)\n",
- "w = 1170/1000 #weigth of conductor(kg)\n",
- "u = 4218 #Ultimate Strength(kg/cm**2)\n",
- "sf = 5 #safety factor\n",
- "a = 1.29 #cross-section of conductor(cm**2)\n",
- "P = 122 #wind pressure(kg/m**2)\n",
- "\n",
- "#Calculation:\n",
- "T = u/sf*a #working tension(kg)\n",
- "d = round((4*a/math.pi)**0.5,2) #diameter of conductor(cm)\n",
- "ww = P*d*10**-2 #Wind force/m length,\n",
- "wt = (ww**2+w**2)**0.5 #total wt of conductor per metre length\n",
- "S = wt*l**2/(8*T)\n",
- "theta = math.atan(ww/w)\n",
- "VS = S*math.cos(theta)\n",
- "\n",
- "#Result:\n",
- "print \"The sag is\",round(S,2),\"m\"\n",
- "print \"The vertical sag is\",round(VS,2),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The sag is 8.97 m\n",
- "The vertical sag is 5.38 m\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.20, Page Number: 191"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "l = 275 #span length(m)\n",
- "w = 0.865 #weigth of conductor/m(kg)\n",
- "d = 1.96 #conductor diameter(cm)\n",
- "t = 1.27 #ice coating thickness(cm)\n",
- "u = 8060 #Ultimate Strength(kg)\n",
- "sf = 2 #safety factor\n",
- "a = 1.29 #cross-section of conductor(cm**2)\n",
- "wo = 0.91 #Weight of 1 c.c. of ice(gm)\n",
- "P = 3.9 #wind pressure(gm/cm**2)\n",
- "\n",
- "#Calculation:\n",
- "T = u/sf #working tension(kg)\n",
- "v = 3.14*t*(d+t)*100 #Volume of ice per metre(cm**3)\n",
- "wi = v*wo/1000 #kg\n",
- "ww = P*(d+2*t)*100/1000 #kg\n",
- "wt = ((w+wi)**2+ww**2)**0.5 #total weight(kg)\n",
- "S = wt*l**2/(8*T) #sag(m)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Sag is\",round(S,1),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Sag is 6.3 m\n"
- ]
- }
- ],
- "prompt_number": 60
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.21, Page Number: 192"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "Sv = 2.35 #vertical sag(m)\n",
- "P = 1.5 #wind pressure(kg/m)\n",
- "B = 2540 #breaking stress(kg/cm**2)\n",
- "w = 1.125 #wt of conductor(kg/m)\n",
- "l = 214 #length of conductor(m)\n",
- "a = 3.225 #conductor cross-section\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "f = symbols('f') #safety factor\n",
- "wt = (w**2+P**2)**0.5 #Total wt. of one m length of conductor\n",
- "T = B*a/f #working stress(kg)\n",
- "cos_theta = w/wt\n",
- "S = Sv/cos_theta #slant sag\n",
- "T1 = wt*l**2/(8*S) \n",
- "f1 = solve(T-T1,f)[0] #safety factor\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Safety factor is\",round(f1)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Safety factor is 3.0\n"
- ]
- }
- ],
- "prompt_number": 61
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.22, Page Number: 192"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variable declaration:\n",
- "l = 150 #span length(m)\n",
- "u = 5000 #ultimate strength(kg/cm**2)\n",
- "go = 8.9 #specific gravity of material(gm/cc)\n",
- "P = 1.5 #wind pressure(kg/m)\n",
- "sf = 5 #safety factor\n",
- "a = 2 #cross-section of conductor(cm**2)\n",
- "h = 7 #ground clearance(m)\n",
- "\n",
- "#Calculation:\n",
- "w = a*go*100/1000 #weight of conductor per m(kg)\n",
- "T = u*a/sf #working stress per m(kg)\n",
- "wt = (w**2+P**2)**0.5 #Total wt of 1 m length of conductor(kg)\n",
- "S = wt*l**2/(8*T) #slant sag(m)\n",
- "Sv = S*w/wt #conductor vertical sag(m)\n",
- "H = h+Sv #m\n",
- "\n",
- "#Result:\n",
- "print \"Conductor should be supported at a height of\",round(H,1),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Conductor should be supported at a height of 9.5 m\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.23, Page Number: 193"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "l = 500 #distance b/w the two towers(m)\n",
- "T = 1600 #tension in the conductor(kg)\n",
- "w = 1.5 #weight of the conductor(kg/m)\n",
- "h1 = 30 #height of 1st tower(m)\n",
- "h2 = 90 #height of 2nd tower(m)\n",
- "\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "h = h2-h1 #difference in levels(m)\n",
- "x1,x2 = symbols('x1 x2')\n",
- "x2 = l-x1\n",
- "S1 = w*x1**2/(2*T) #m\n",
- "S2 = w*x2**2/(2*T) #m\n",
- "x11 = solve(S2-S1-h,x1)[0]\n",
- "S1 = w*x11**2/(2*T) #m\n",
- "#Let the mid-point P be at a distance x from the lowest point O\n",
- "x = l/2-x11\n",
- "Smid = w*x**2/(2*T) #m\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The min. clearance of the conductor and water is \",round(h1-S1),\"m\"\n",
- "print \"The clearance mid-way b/w the supports is\",round(Smid+h1-S1,2),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The min. clearance of the conductor and water is 23.0 m\n",
- "The clearance mid-way b/w the supports is 30.7 m\n"
- ]
- }
- ],
- "prompt_number": 62
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.24, Page Number: 194"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "l = 600 #distance b/w the two towers(m)\n",
- "f = 5 #safety factor\n",
- "U = 8000 #kg/cm**2\n",
- "a = 2.2 #area of cross-section(cm**2)\n",
- "w = 1.925 #weight of the conductor(kg/m)\n",
- "h = 15 #difference in towers levels(m)\n",
- "wi = 1 #ice weight(kg)\n",
- "\n",
- "#Calculation:\n",
- "T = U*a/f #tension in the conductor(kg)\n",
- "wt = wi+w #total weight of conductor(kg)\n",
- "x1,x2 = symbols('x1 x2')\n",
- "x2 = l-x1\n",
- "S1 = wt*x1**2/(2*T) #m\n",
- "S2 = wt*x2**2/(2*T) #m\n",
- "x11 = solve(S2-S1-h,x1)[0]\n",
- "x22 = l-x11\n",
- "S22 = wt*x22**2/(2*T) #m\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The sag from the taller of the two supports is\",round(S22,2),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The sag from the taller of the two supports is 45.27 m\n"
- ]
- }
- ],
- "prompt_number": 63
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.25, Page Number: 195"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "#Variable declaration:\n",
- "l = 400 #distance b/w the two towers(m)\n",
- "T = 2000 #tension in the conductor(kg)\n",
- "w = 1 #weight of the conductor(kg/m)\n",
- "h1 = 40 #height of 1st tower(m)\n",
- "h2 = 90 #height of 2nd tower(m)\n",
- "\n",
- "#Calculation:\n",
- "h = h2-h1 #difference in levels(m)\n",
- "x1,x2 = symbols('x1 x2')\n",
- "x2 = l-x1\n",
- "S1 = w*x1**2/(2*T) #m\n",
- "S2 = w*x2**2/(2*T) #m\n",
- "x11 = solve(S2-S1-h,x1)[0]\n",
- "S1 = w*x11**2/(2*T) #m\n",
- "x_mid = 50+400/2 #Horizontal distance of mid-point P from lowest point O\n",
- "Sp = w*x_mid**2/(2*T) #SAg at P(m)\n",
- "S2 = w*(l-x11)**2/(2*T) #m\n",
- "hc = h2-S2+Sp #Clearance of mid-point P above water level(m)\n",
- "\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Clearance of mid-point P above water level is\",round(hc),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Clearance of mid-point P above water level is 55.0 m\n"
- ]
- }
- ],
- "prompt_number": 127
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.26, Page Number: 195"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from pylab import *\n",
- "from sympy import *\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "T = 1500 #tension in the conductor(kg)\n",
- "w = 1 #weight of the conductor(kg/m)\n",
- "DE = 300 #distance b/w tower's top(m)\n",
- "H = 22 #height of each tower(m)\n",
- "\n",
- "#Calculation:\n",
- "# Suppose, the conductors are supported between towers AD and BE over\n",
- "# a hillside having gradient of 1 : 20.\n",
- "# Let the lowest point on the conductor is O and\n",
- "# sin(theta) = 1/20.\n",
- "# since, the lowest conductor is fixed 2m below the top of each tower.\n",
- "theta = math.asin(1/20)\n",
- "BE = H-2 #Effective height of each tower(m)\n",
- "EC = DE*1/20\n",
- "x1,x2 = symbols('x1 x2')\n",
- "DC = (DE**2-EC**2)**0.5 #Horizontal distance b/w two towers(m)\n",
- "x2 = DC-x1\n",
- "S1 = w*x1**2/(2*T) #m\n",
- "S2 = w*x2**2/(2*T) #m\n",
- "x11 = solve(S2-S1-EC,x1)[0]\n",
- "S2 = w*(DC-x11)**2/(2*T) #m\n",
- "BC = BE+EC\n",
- "OG = BC-S2-x11*math.tan(theta)\n",
- "\n",
- "#Result:\n",
- "print \"Clearance of the lowest point O from the ground is\",round(OG,2),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Clearance of the lowest point O from the ground is 14.4 m\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 8.27, Page Number: 196"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "from sympy import *\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "l = 300 #distance b/w tower(m)\n",
- "S = 10 #span(m)\n",
- "h = 8 #clearance(m)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "#On level ground:\n",
- "r = 8*S/l**2 #ratio w/T\n",
- "\n",
- "\n",
- "#On sloping ground:\n",
- "#The conductors are supported between towers AD and BE \n",
- "#over a sloping ground having a gradient 1 in 15 as shown above.\n",
- "\n",
- "DE = 300\n",
- "sin_theta = 1/15\n",
- "\n",
- "h = DE*sin_theta #Vertical distance b/w the two towers(m)\n",
- "BE = S+h #height of tower(m)\n",
- "x1,x2,x = symbols('x1 x2 x')\n",
- "x2 = l-x1\n",
- "S1 = r*x1**2/2 #m\n",
- "S2 = r*x2**2/2 #m\n",
- "x11 = solve(S2-S1-h,x1)[0]\n",
- "S11 = r*x11**2/(2) #m\n",
- "x22 = l-x11\n",
- "S22 = r*x22**2/(2) #m\n",
- "tan_theta = 1/15\n",
- "GF = x11*tan_theta\n",
- "BC = h-S22-GF\n",
- "#Since O is the origin, the equation of slope of ground is given by :\n",
- "y = x/15-10.5\n",
- "#C = Equation of conductor curve \u2212 y\n",
- "C = r*x**2/2-y\n",
- "C1 = diff(C,x)\n",
- "xm = solve(C1,x)[0]\n",
- "#putting values of xm in above equations,\n",
- "ym = xm/15-10.5\n",
- "Cm = C = r*xm**2/2-ym\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Required minimum clearance is\",round(Cm),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Required minimum clearance is 8.0 m\n"
- ]
- }
- ],
- "prompt_number": 129
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/chapter9_1.ipynb b/Principles_of_Power_System/chapter9_1.ipynb deleted file mode 100644 index 925aa356..00000000 --- a/Principles_of_Power_System/chapter9_1.ipynb +++ /dev/null @@ -1,740 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:1c5f89ed0470787a153a235132b85821455bc93d217ca226b9eba94372c90683"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 9: Electrical Design of Overhead\n",
- "Lines"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.1, Page Number: 214"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "d = 200 #Spacing of conductors(cm)\n",
- "r = 1.2/2 #Radius of conductor(cm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "L = 10**-7*(1+4*math.log(d/r))*10**3 #Loop inductance per m length of the line(H)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \" The loop inductance per km of the line is\",round(L*1000,3),\"mH\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " The loop inductance per km of the line is 2.424 mH\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.2, Page Number: 214"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "d = 300 #Spacing of conductors(cm)\n",
- "r = 1 #Radius of conductor(cm)\n",
- "u1 = 1 #relative permeability of copper\n",
- "u2 = 100 #relative permeability of steel\n",
- "\n",
- "#Calculation:\n",
- "#(i) With copper conductors,\n",
- "Lc = 10**-7*(u1+4*math.log(d/r))*10**3 #Loop inductance/km\n",
- "\n",
- "#(ii) With steel conductors,\n",
- "Ls = 10**-7*(u2+4*math.log(d/r))*10**3 ##Loop inductance/km\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The loop inductance per km length of the line are:\"\n",
- "print \"(i) for copper, Lc\",round(Lc*1000,2),\"mH and\"\n",
- "print \"(ii) for steel line, Ls =\",round(Ls*1000,2),\"mH\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The loop inductance per km length of the line are:\n",
- "(i) for copper, Lc 2.38 mH and\n",
- "(ii) for steel line, Ls = 12.28 mH\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.3, Page Number: 214"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "d = 200 #cm\n",
- "r = 0.62 #conductor radius(cm)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "L = 10**-7*(0.5+2*math.log(d/r))*10**3 #Inductance/phase/km\n",
- "\n",
- "#Result:\n",
- "print \"The inductance per km of a 3-ph transmission line is\",round(L*10**3,1),\"mH\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The inductance per km of a 3-ph transmission line is 1.2 mH\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.4, Page Number: 214"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "D12 = 2 #m\n",
- "D23 = 2.5 #m\n",
- "D13 = 4.5 #m\n",
- "r = 0.62 #m\n",
- "\n",
- "#Calculation:\n",
- "Deq = (D12*D23*D13)**(1/3)*100 #Equivalent equilateral spacing(cm)\n",
- "L = 10**-7*(0.5+2*math.log(Deq/r))*10**3\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The inductance per km of the line is\",round(L*1000,3),\"mH\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The inductance per km of the line is 1.274 mH\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.5, Page Number: 214"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r = 1.25 #cm\n",
- "D12 = 2 #m\n",
- "D23 = 2 #m\n",
- "D13 = 4 #m\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "Deq = (D12*D23*D13)**(1/3)*100 #Equivalent equilateral spacing(m)\n",
- "L = 10**-7*(0.5+2*math.log(Deq/r))*10**3\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The inductance per km of the line is\",round(L*1000,2),\"mH\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The inductance per km of the line is 1.11 mH\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.6, Page Number: 214"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r = 0.5 #radius of conductor(m)\n",
- "Dab = 25 #cm\n",
- "Daa1 = 100 #cm\n",
- "Dbb1 = 100 #cm\n",
- "Dab1 = 103 #cm\n",
- "Da1b = 103 #cm\n",
- "Da1b1 = 25 #cm\n",
- "\n",
- "#Calculation:\n",
- "GMR = 0.7788*r #G.M.R. of conductor(cm)\n",
- "Ds = (GMR*Daa1)**(1/2) #Self G.M.D. of aa1 combination(cm)\n",
- "Dm = (Dab*Dab1*Da1b*Da1b1)**(1/4) #Mutual G.M.D. between a and b(cm)\n",
- "L1 = 2*10**-7*math.log(Dm/Ds) #Loop inductance per conductor per m(H)\n",
- "L = 2*L1*1000\n",
- "\n",
- "#Result:\n",
- "print \"The inductance per km of the line is\",round(L*1000,2),\"mH\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The inductance per km of the line is 0.84 mH\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.7, Page Number: 216"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "\n",
- "#Variable declaration:\n",
- "r = 1.3 #conuctor radius(cm)\n",
- "Dab = 3 #m\n",
- "Dab1 = 6.7 #m\n",
- "Da1b = 6.7 #m\n",
- "Da1b1 = 3 #m\n",
- "Daa1 = 8.48 #m\n",
- "Da1a = 8.48 #m\n",
- "Dbb1 = 6 #m\n",
- "Db1b = 6 #m\n",
- "Dca = 6 #m\n",
- "Dc1a = 6 #m\n",
- "Dca1 = 6 #m\n",
- "Dc1a1 = 6 #m\n",
- "\n",
- "#Calculation:\n",
- "GMR = 1.3*0.7788/100 #m\n",
- "Daa = GMR\n",
- "Da1a1 = GMR\n",
- "Dbb = GMR\n",
- "Db1b1 = GMR\n",
- "Ds1 = (Daa*Daa1*Da1a1*Da1a)**(1/4) #m\n",
- "Ds2 = (Dbb*Dbb1*Db1b1*Db1b)**(1/4) #m\n",
- "Ds = (Ds1*Ds2*Ds1)**(1/3) #m\n",
- "DAB = (Dab*Dab1*Da1b*Da1b1)**(1/4) #m\n",
- "DBC = DAB\n",
- "DCA = (Dca*Dc1a*Dca1*Dc1a1)**(1/4) #m\n",
- "Dm = (DAB*DBC*DCA)**(1/3) #Equivalent mutual G.M.D(m)\n",
- "\n",
- "L1 = 2*10**-7*math.log(Dm/Ds) #Loop inductance per conductor per m(H)\n",
- "L = L1*1000\n",
- "\n",
- "#Result:\n",
- "print \"The inductance per km of the line is\",round(L*1000,2),\"mH\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The inductance per km of the line is 0.58 mH\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.8, Page Number: 217"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "r = 0.75 #conductor radius(cm)\n",
- "Db1b = 5.5 #m\n",
- "Dca = 6 #m\n",
- "Dca1 = 4 #m\n",
- "Dc1a = 4 #m\n",
- "Dc1a1 = 6 #m\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "GMR = 0.7788*r #m\n",
- "Dab = (3**2+0.75**2)**0.5 #m\n",
- "Dab1 = (3**2+4.75**2)**0.5 #m\n",
- "Daa1 = (6**2+4**2)**0.5 #m\n",
- "Daa = GMR/100 #m\n",
- "Da1a1 = Daa #m\n",
- "Da1a = Daa1 #m\n",
- "Dbb = GMR/100 #m\n",
- "Dbb1 = 5.5 #m\n",
- "Db1b1 = Dbb #m\n",
- "\n",
- "Ds1 = (Daa*Daa1*Da1a1*Da1a)**(1/4) #m\n",
- "Ds2 = (Dbb*Dbb1*Db1b1*Db1b)**(1/4) #m\n",
- "Ds3 = Ds1\n",
- "Ds = (Ds1*Ds2*Ds3)**(1/3) #Equivalent self G.M.D. of one phase(m)\n",
- "DAB = (Dab*Dab1*Da1b*Da1b1)**(1/4) #m\n",
- "DCA = (Dca*Dca1*Dc1a*Dc1a1)**(1/4) #m\n",
- "DBC = DAB #m\n",
- "Dm = (DAB*DBC*DCA)**(1/3) #Equivalent mutual G.M.D.(m)\n",
- "\n",
- "\n",
- "L1 = 2*10**-7*math.log(Dm/Ds) #Loop inductance per conductor per m(H)\n",
- "L = L1*1000\n",
- "\n",
- "#Result:\n",
- "print \"The inductance per km of the line is\",round(L*1000,3),\"mH\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The inductance per km of the line is 0.627 mH\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.9, Page Number: 218"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "r = 5.3/100 #conductor radius(m)\n",
- "\n",
- "#Calculation:\n",
- "GMR = 0.7788*r #m\n",
- "DAA = GMR #m\n",
- "DAA1 = 24 #m\n",
- "DA1A1 = DAA #m\n",
- "DA1A = 24 #m\n",
- "\n",
- "DBB = GMR #m\n",
- "DBB1 = 24 #m\n",
- "DB1B1 = DBB #m\n",
- "DB1B = 24 #m\n",
- "Ds1 = (DAA*DAA1*DA1A1*DA1A)**(1/4) #m\n",
- "Ds2 = (DBB*DBB1*DB1B1*DB1B)**(1/4) #m\n",
- "#Similarly:\n",
- "Ds3 = 0.995 #m\n",
- "Ds = (Ds1*Ds2*Ds3)**(1/3) #Equivalent self-G.M.D. of one phase(m)\n",
- "#DAB = (DAB \u00d7 DAB\u2032 \u00d7 DA\u2032\u0392 \u00d7 DA\u2032B\u2032)**1/4\n",
- "DAB = (8*32*16*8)**(1/4) #m\n",
- "DBC = DAB #m\n",
- "#DCA = (DCA \u00d7 DCA\u2032 \u00d7 DC\u2032A \u00d7DC\u2032A\u2032)1/4 #m\n",
- "DCA = (16*8*40*16)**(1/4) #m\n",
- "\n",
- "Dm = (DAB*DBC*DCA)**(1/3) #m\n",
- "\n",
- "L = 2*10**-7*math.log(Dm/Ds) #Loop inductance per conductor per m(H)\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"The inductance per m of the line is\",round(L*10**7,2),\"* 10**-7 H/m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The inductance per m of the line is 5.36 * 10**-7 H/m\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.10, Page Number: 219"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "r = 1 #consuctor radius(cm)\n",
- "\n",
- "#Calculation:\n",
- "#Mutual G.M.D., Dm = (Dab*Dab'*Da'b*Da'b')**(1/4)\n",
- "Dm = (120*140*100*120)**(1/4) #m\n",
- "\n",
- "#Self G.M.D., Ds = (Daa*Daa'*Da'a'*Da'a)**(1/4)\n",
- "#Daa = Da'a' = 0.7788 cm; Daa' = Da'a = 20 cm\n",
- "Ds = (0.7788*20*0.7788*20)**(1/4) #cm\n",
- "L = 4*10**-4*math.log(Dm/Ds) #H/km\n",
- "\n",
- "#Result:\n",
- "print \"The total inductance of the line per km is\",round(L*1000,2),\"mH/km\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The total inductance of the line per km is 1.36 mH/km\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.11, Page Number: 224"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r = 1 #conductor radius(cm)\n",
- "d = 300 #conductor spacing(cm)\n",
- "e = 8.854*10**-12 #permitivity of free space(F/m)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "C = math.pi*e/math.log(d/r) #F/m\n",
- "\n",
- "#Result:\n",
- "print \"Capacitance of the line per km is\",round(C*10**11,4),\"* 10**-2 uF/km\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacitance of the line per km is 0.4877 * 10**-2 uF/km\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.12, Page Number: 225"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r = 0.625 #conductor radius(cm)\n",
- "d = 200 #conductor spacing(cm)\n",
- "e = 8.854*10**-12 #permitivity of free space(F/m)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "C = 2*math.pi*e/math.log(d/r) #F/m\n",
- "\n",
- "#Result:\n",
- "print \"Capacitance of the line per km is\",round(C*10**9,4),\" uF/km\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacitance of the line per km is 0.0096 uF/km\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.13, Page Number: 225"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "d1 = 2 #m\n",
- "d2 = 2.5 #m\n",
- "d3 = 4.5 #m\n",
- "r = 0.625 #conductor raius(cm)\n",
- "l = 100 #line length(km)\n",
- "Vl = 66000 #line voltage(V)\n",
- "f = 50 #frequency of current(Hz)\n",
- "e = 8.854*10**-12 #permitivity of free space(F/m)\n",
- "\n",
- "#Calculation:\n",
- "d = (d1*d2*d3)**(1/3)*100 #cm\n",
- "\n",
- "#(i)Line to neutral capacitance,\n",
- "C1 = 2*math.pi*e/math.log(d/r)*10**9 #uF/km\n",
- "C11 = C1*100 #uF\n",
- "\n",
- "#(ii)Charging current per phase,\n",
- "Ic = Vl*2*math.pi*f*C11*10**-6/(3**0.5) #A\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Capacitance per phase is\",round(C11,2),\"uF\"\n",
- "print \"Charging current per phase is\",round(Ic,1),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacitance per phase is 0.91 uF\n",
- "Charging current per phase is 10.9 A\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.14, Page Number: 225"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable declaration:\n",
- "r = 1 #conductor radius(cm)\n",
- "d = 250 #equilateral conductor spacing(cm)\n",
- "e = 8.854*10**-12 #permitivity of free space(F/m)\n",
- "\n",
- "\n",
- "#Calculation:\n",
- "C = 2*math.pi*e/math.log(d/r)*10**9 #uF/km\n",
- "C1 = C*100 #F\n",
- "\n",
- "#Result:\n",
- "print \"Capacitance of the line per km is\",round(C1,4),\"uF/phase\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Capacitance of the line per km is 1.0075 uF/phase\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 9.15, Page Number: 226"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variable Declaration:\n",
- "d1 = 4 #m\n",
- "d2 = 4 #m\n",
- "d3 = 8 #m\n",
- "r = 1 #conductor raius(cm)\n",
- "l = 100 #line length(km)\n",
- "Vl = 132000 #line voltage(V)\n",
- "f = 50 #frequency of current(Hz)\n",
- "e = 8.854*10**-12 #permitivity of free space(F/m)\n",
- "\n",
- "#Calculation:\n",
- "Deq = (d1*d2*d3)**(1/3)*100 #cm\n",
- "C = 2*math.pi*e/math.log(Deq/r)*10**9 #uF/km\n",
- "C1 = C*100 #uF\n",
- "Ic = Vl*2*math.pi*f*C1*10**-6/(3**0.5) #A\n",
- "\n",
- "\n",
- "#Result:\n",
- "print \"Charging current per phase is\",round(Ic,2),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Charging current per phase is 21.41 A\n"
- ]
- }
- ],
- "prompt_number": 1
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file diff --git a/Principles_of_Power_System/screenshots/daily_1.png b/Principles_of_Power_System/screenshots/daily_1.png Binary files differindex 2f68e17a..2f68e17a 100644..100755 --- a/Principles_of_Power_System/screenshots/daily_1.png +++ b/Principles_of_Power_System/screenshots/daily_1.png diff --git a/Principles_of_Power_System/screenshots/dcdistribution_1.png b/Principles_of_Power_System/screenshots/dcdistribution_1.png Binary files differindex 1354fe4b..1354fe4b 100644..100755 --- a/Principles_of_Power_System/screenshots/dcdistribution_1.png +++ b/Principles_of_Power_System/screenshots/dcdistribution_1.png diff --git a/Principles_of_Power_System/screenshots/unsymmetrical_1.png b/Principles_of_Power_System/screenshots/unsymmetrical_1.png Binary files differindex 5bc246e5..5bc246e5 100644..100755 --- a/Principles_of_Power_System/screenshots/unsymmetrical_1.png +++ b/Principles_of_Power_System/screenshots/unsymmetrical_1.png diff --git a/Problems_In_Hydraulics/README.txt b/Problems_In_Hydraulics/README.txt new file mode 100755 index 00000000..058b166c --- /dev/null +++ b/Problems_In_Hydraulics/README.txt @@ -0,0 +1,10 @@ +Contributed By: Ankit Barot +Course: btech +College/Institute/Organization: Anupam-Mistubishi Heavy Industries Ltd., India +Department/Designation: Graduate Engineer Trainee +Book Title: Problems In Hydraulics +Author: R. S. Paradise +Publisher: Blcakie & Son Ltd, London +Year of publication: 1953 +Isbn: 978-1577664550 +Edition: 3
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch1.ipynb b/Problems_In_Hydraulics/ch1.ipynb new file mode 100755 index 00000000..8ed87e00 --- /dev/null +++ b/Problems_In_Hydraulics/ch1.ipynb @@ -0,0 +1,466 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:82344ff688f3e86a09716345a8eb43cec4a8aadc2157f526516e21d9f1e84d30" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Hydrostatics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2 Page No : 5" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#initialisation of variables\n", + "w= 62.4 #lb/ft**3\n", + "A= 18. #ft**2\n", + "x= 6. # height ft\n", + "kg= 6.\n", + "y= 2. #ft hinges\n", + "y1= 5. #ft\n", + "\n", + "#CALCULATIONS\n", + "F= w*A*x\n", + "F1= F/2\n", + "Ft= (F*y-F1*(y1/2))/y1\n", + "Fb= F1-Ft\n", + "\n", + "#RESULTS\n", + "print 'Force exerted on the bolt = %.f lb'%(F1)\n", + "print ' Force exerted on the hinge = %.f lb'%(Ft)\n", + "print ' Force exerted on the bolt = %.f lb'%(Fb)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Force exerted on the bolt = 3370 lb\n", + " Force exerted on the hinge = 1011 lb\n", + " Force exerted on the bolt = 2359 lb\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3 Page No : 6" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#initialisation of variables\n", + "h1= 11.54 \t#ft\n", + "h2= 16.33 \t#ft\n", + "w= 62.4 \t#lb/ft**3\n", + "x1= 7.69 \t#ft\n", + "x2= 14.09 \t#ft\n", + "x3= 18.23 \t#ft\n", + "\n", + "#CALCULATIONS\n", + "Ft= round(w*h1**2/2)\n", + "\n", + "#RESULTS\n", + "print 'h1 = %.2f ft'%(h1)\n", + "print ' h2 = %.2f ft'%(h2)\n", + "print ' h1+ = %.2f ft'%(x1)\n", + "print ' h2+ = %.2f ft'%(x2)\n", + "print ' h3+ = %.2f ft'%(x3)\n", + "print ' Thrust force = %.f lb/ft run'%(round(Ft,-1))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "h1 = 11.54 ft\n", + " h2 = 16.33 ft\n", + " h1+ = 7.69 ft\n", + " h2+ = 14.09 ft\n", + " h3+ = 18.23 ft\n", + " Thrust force = 4160 lb/ft run\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.4 Page No : 8" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "spo= 0.9 # gravity\n", + "h= 3. \t#ft depth\n", + "d= 2. \t #ft depth of water\n", + "w= 62.4 \t#lb/ft**3\n", + "H= 0.71 \t#ft\n", + "\n", + "#CALCULATIONS\n", + "do= spo*w\n", + "de= w*d\n", + "bc= do*h\n", + "Pt= (bc*(h/2)+bc*d+de*(d/2))*(h+d)\n", + "y= (bc*(h/2)+bc*d+de*(d/2)*(d/3))*(h+d)/Pt+H\n", + "\n", + "#RESULTS\n", + "print \"Total pressure = %d lb\"%(Pt)\n", + "print ' position of centre of pressure above the base = %.2f ft position of centre of pressure above the axis '%(y)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total pressure = 3572 lb\n", + " position of centre of pressure above the base = 1.65 ft position of centre of pressure above the axis \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.5 Page No : 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#initialisation of variables\n", + "a= 30. \t#degrees\n", + "b= 30. \t#degrees\n", + "h= 20. \t#ft width of lock\n", + "h1= 10. \t#ft water level\n", + "h2= 15. \t#ft water level\n", + "h3= 16. \t#ft high\n", + "w= 62.4 \t#lb/ft**3\n", + "h4= 10./3 \t#ft\n", + "\n", + "#CALCULATIONS\n", + "Rt= (1./h3)*((w*(h*h2**2*(h2/3)/(2*math.sqrt(3))))-(w*(h*h1**2*h4/(2*math.sqrt(3)))))\n", + "R= ((w*(h*h2**2/(2*math.sqrt(3))))-(w*(h*h1**2/(2*math.sqrt(3)))))\n", + "Rb= R-Rt\n", + "\n", + "#RESULTS\n", + "print 'Force at the hinge = %.f lb '%(Rt)\n", + "print ' Force at the hinge = %.f lb '%(Rb)\n", + "\n", + "# Note : Round off error in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Force at the hinge = 17826 lb \n", + " Force at the hinge = 27208 lb \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.6 Page No : 10" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "\n", + "#initialisation of variables\n", + "x= 32. \t #ft\n", + "h= 60. \t#ft depth\n", + "w= 62.4 \t#lb/ft**3\n", + "AE= 20. \t#ft\n", + "\n", + "#CALCULATIONS\n", + "Vabc= 2*x*h/3\n", + "vc= Vabc*w\n", + "Tab= w*h**2/2\n", + "Rt= math.sqrt(vc**2+Tab**2)/2240\n", + "A= math.degrees(math.atan(vc/Tab))\n", + "AD= x-AE+AE*(1/(math.tan(math.radians(A))))\n", + "\n", + "\n", + "#RESULTS\n", + "print \"resulmath.tant thrust = %.1f tons\"%(Rt)\n", + "print \" Angle = %.2f degrees\"%(A)\n", + "print ' AD = %.1f ft '%(AD)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "resulmath.tant thrust = 61.5 tons\n", + " Angle = 35.42 degrees\n", + " AD = 40.1 ft \n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.7 Page No : 12" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "wdc= 3*math.sqrt(3) \t#ft\n", + "wdo= math.sqrt(3)\n", + "ac= 30. \t#degrees\n", + "ao= 60. \t#degrees\n", + "hob= 3. \t#ft\n", + "haf= 2.6 \t#ft\n", + "hfc= 3. \t#ft\n", + "w= 62.4 \t#lb/ft**3\n", + "V= 5.63 \t#ft**3\n", + "h= 4.3 \t#ft\n", + "y= 3.6 \t #ft\n", + "\n", + "#CALCULATIONS\n", + "W1= int(wdc*hfc*w/2)\n", + "Hbc= round(w*hob*(hob/2))\n", + "W2= int(V*w)\n", + "W3= int(w*haf*h)\n", + "Vt= W1+W2\n", + "Vht= Hbc+W3\n", + "Rt= int(math.sqrt(Vt**2+Vht**2))\n", + "A= math.degrees(math.atan(Vht/Vt))\n", + "x= (W1*(wdo-(hob/2))+Hbc*y)/Rt\n", + "OP= x/math.sin(math.radians(A))\n", + "AP= hob+OP\n", + "\n", + "#RESULTS\n", + "print \"Resultant thrust = %d lb\"%(Rt)\n", + "print \" Angle = %.2f degrees \"%(A)\n", + "print ' Distance from A till horizontal thrust = %.3f ft '%(AP)\n", + "\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resultant thrust = 1287 lb\n", + " Angle = 49.44 degrees \n", + " Distance from A till horizontal thrust = 4.150 ft \n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.8 Page No : 14" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "r= 96. # T air\n", + "T= 10.5 \t#C\n", + "K1= 288. \t#C temperature gound level\n", + "K2= 0.0015 \t#C**-1 temperature gradient\n", + "h= 3000. \t#ft height\n", + "P1= 14.69\n", + "\n", + "#CALCULATIONS\n", + "P2= P1*10**(((1/(r*K2))*math.log10((K1-K2*h)/K1)))\n", + "w= P2*144/(r*(273+T))\n", + "\n", + "#RESULTS\n", + "print 'Density = %.4f lb/ft**3 '%(w)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Density = 0.0697 lb/ft**3 \n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.9 Page No : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Hb= 20. \t#in ratio\n", + "Ha= 1. \t#in ratio\n", + "a= 20. \t #degrees\n", + "\n", + "#CALCULATIONS\n", + "hb= Hb*math.sin(math.radians(a))\n", + "dh= hb+Ha\n", + "dP= dh/(12*2.309)\n", + "\n", + "#RESULTS\n", + "print 'Pressure difference between tapping points = %.3f lb/in**2 '%(dP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure difference between tapping points = 0.283 lb/in**2 \n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.10 Page No : 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "P= 180. \t#ln/in**2 pressure\n", + "r= 53. #T air\n", + "T= 60. \t#F temperature of air\n", + "w= 62.4 \t#lb/ft**3\n", + "h= 12. \t #in water level\n", + "\n", + "#CALCULATIONS\n", + "R= P*144/(r*(460+T))\n", + "dP= 12*(1-(R/w))\n", + "Pab= dP/(12*2.309)\n", + "\n", + "#RESULTS\n", + "print 'Difference in water level = %.2f in of water '%(dP)\n", + "print \" Pressure difference = %.3f lb/in**2\"%(Pab)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Difference in water level = 11.82 in of water \n", + " Pressure difference = 0.427 lb/in**2\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch10.ipynb b/Problems_In_Hydraulics/ch10.ipynb new file mode 100755 index 00000000..9cf18748 --- /dev/null +++ b/Problems_In_Hydraulics/ch10.ipynb @@ -0,0 +1,589 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:54b93ceee4137049e1ed8024ecd6ba8e7f6645f46f71063561c8d2f8b4589ff2" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 : Hydraulic Prime Movers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 Page No : 188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "v= 231. \t#ft/sec\n", + "g= 32.2 \t#ft/sec**2\n", + "vc= 0.97\n", + "r= 0.47\n", + "p= 85. \t#per cent\n", + "A= 170. \t#degrees\n", + "p1= 88. \t#per cent\n", + "l= 950. \t#ft\n", + "\n", + "#CALCULATIONS\n", + "H= v**2/(vc**2*2*g)\n", + "u= r*v\n", + "vr= v-u\n", + "vr1= p*vr/100\n", + "w1= u-vr1*math.cos(math.radians(180-A))\n", + "W= u*(v-w1)/g\n", + "he= W*100/H\n", + "W1= p1*W/100\n", + "oe= W1*100/l\n", + "\n", + "#RESULTS\n", + "print 'hydraulic efficiency = %.f percent'%(he)\n", + "print ' overall efficiency = %.1f percent'%(oe)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hydraulic efficiency = 86 percent\n", + " overall efficiency = 70.2 percent\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2 Page No : 189" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 1. \t#in\n", + "v= 95. \t#ft/sec\n", + "F= 173.2 \t#lb\n", + "A= 163. \t#degrees\n", + "H= 500. \t#ft\n", + "Cv= 0.97\n", + "d1= 1.33 \t#ft\n", + "r= 0.47\n", + "w= 62.4 \t#lb/ft**3\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "Q= w*math.pi*v/(144*4)\n", + "k= (F-v)/(v*math.cos(math.radians(180-A)))\n", + "v1= Cv*math.sqrt(2*g*H)\n", + "W= v1*w*d**2*math.pi/(4*144)\n", + "N= 60*r*v1/(math.pi*d1)\n", + "whp= (v1-v)*(1+k*math.cos(math.radians(180-A)))*v1*2/550\n", + "Ns= N*whp**0.5/H**1.25\n", + "\n", + "#RESULTS\n", + "print 'specific speed = %.2f r.p.m'%(Ns)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "specific speed = 4.75 r.p.m\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.4 Page No : 192" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "D= 2. \t#ft\n", + "f= 0.005\n", + "l= 10000. \t#ft\n", + "g= 32.2 \t#ft/sec**2\n", + "H= 1000. \t#ft\n", + "w= 62.4 \t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "d= (2*D**5/(f*l))**0.25\n", + "v= math.sqrt(8*g*H*D**5/(f*l*d**4+4*D**5))\n", + "HP= w*math.pi*d**2*v**3/(2*g*550*4)\n", + "Q= math.pi*d**2*(HP/67)/4\n", + "\n", + "#RESULTS\n", + "print 'Quantity flowing = %.f cusecs'%(Q)\n", + "\n", + "# rounding off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quantity flowing = 185 cusecs\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.5 Page No : 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "pl= 122.5 \t# ft\n", + "Hw= 1225 \t#ft\n", + "g= 32.2 \t#ft/sec**2\n", + "Cd= 0.98\n", + "Cd1= 0.45\n", + "N= 500. \t#r.p.m\n", + "P= 6800. \t#h.p\n", + "n= 0.86\n", + "w= 62.4 \t#lb/ft**2\n", + "l= 5450. \t#ft\n", + "f= 0.005\n", + "A= 18. \t#ft**2\n", + "\n", + "#CALCULATIONS\n", + "Ah= Hw-pl\n", + "js= Cd*math.sqrt(2*g*Ah)\n", + "bs= Cd1*js\n", + "D= bs*60*2/(N*2*math.pi)\n", + "a= P*2*g*550*144/(n*w*js**3*2)\n", + "vp= math.sqrt(pl*2*g/(4*f*l))\n", + "dp= (js*2*4*A/(math.pi*144*vp))**(2./3)\n", + "dp=2.495 \t#ft\n", + "\n", + "#RESULTS\n", + "print 'diameter of bucket circle D = %.1f ft'%(D)\n", + "print ' area of jet = %.f in**2'%(a)\n", + "print ' diameter of pipe = %.1f ft'%(dp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "diameter of bucket circle D = 4.5 ft\n", + " area of jet = 18 in**2\n", + " diameter of pipe = 2.5 ft\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.6 Page No : 194" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "u= 10.*math.pi \t#ft/sec\n", + "u1= 5.*math.pi \t#ft/sec\n", + "a= 20. \t#degrees\n", + "A= 300. \t#r.p.m\n", + "v= 10. \t#ft/sec\n", + "g= 32.2 \t#ft/sec**2\n", + "wi= 2. \t#ft\n", + "d= 6. \t#in\n", + "w1= 62.4 \t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "w= v/math.tan(math.radians(a))\n", + "a1= math.degrees(math.atan((v/(u-w))))\n", + "b= math.degrees(math.atan((v/u1)))\n", + "W= u*w/g\n", + "A1= math.pi*wi*d/12\n", + "Q= A1*v\n", + "WHP= W*Q*w1/550\n", + "\n", + "#RESULTS\n", + "print 'Blade angle at inlet is given by = %.2f degrees'%(a1)\n", + "print ' Blade angle at inlet is given by = %.2f degrees'%(b)\n", + "print ' Water horse power = %.1f h.p'%(WHP)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Blade angle at inlet is given by = 68.49 degrees\n", + " Blade angle at inlet is given by = 32.48 degrees\n", + " Water horse power = 95.5 h.p\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.7 Page No : 196" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "H= 100. \t#ft\n", + "a= 25. \t#degrees\n", + "a1= 20. \t#degrees\n", + "r1= 9./8\n", + "r2= 0.2\n", + "u= 6.63 \t#ft/sec\n", + "w= 62.4 \t#lb/ft**3\n", + "h1= 34. \t#ft\n", + "h2= 100. \t#ft\n", + "r= 0.1\n", + "\n", + "#CALCULATIONS\n", + "f= math.sqrt(H*g/((r1*1/math.tan(math.radians(a))*1/math.tan(math.radians(a1)))+r1*0.5+(r1*0.5**2*0.2/(math.sin(math.radians(a)))**2)+0.1/(math.sin(math.radians(a1+10)))**2))\n", + "W= u*f**2/g\n", + "q= a*H*550/(10*W*w)\n", + "q1= q/w\n", + "A= q/f\n", + "dh= h1+h2-((1+r)*f**2/((math.sin(math.radians(a1)))**2*2*g))\n", + "\n", + "#RESULTS\n", + "print 'f = %.1f ft/sec'%(f)\n", + "print ' Work Done = %.1f ft-lb/lb'%(W)\n", + "print ' Quantity flow = %.1f cusecs'%(q)\n", + "print ' Area form guides = %.3f ft**2'%(A)\n", + "print ' Pressure at entry of level = %.1f ft of water'%(dh)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "f = 20.2 ft/sec\n", + " Work Done = 83.9 ft-lb/lb\n", + " Quantity flow = 26.3 cusecs\n", + " Area form guides = 1.302 ft**2\n", + " Pressure at entry of level = 74.5 ft of water\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.8 Page No : 199" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "d= 8. \t#in\n", + "w= 2. \t#in\n", + "di= 12. \t#in\n", + "wi= 3. \t#in\n", + "a= 24. \t#degrees\n", + "p= 88. \t#per cent\n", + "a1= 85. \t#degrees\n", + "a2= 30. \t#degrees\n", + "p1= 94. \t#per cent\n", + "h= 180. \t#ft\n", + "d1= 18. \t#in\n", + "Cd= 0.92\n", + "g=32.2\n", + "n1= 111. \t#rpm\n", + "\n", + "#calculations\n", + "r1= 1./math.tan(math.radians(a))\n", + "r2= (1./math.tan(math.radians(a1)))+r1\n", + "r3= 2*r2/3\n", + "r4= (1/math.tan(math.radians(a2)))-r3\n", + "a3= math.tan(math.radians(1/r4))\n", + "r5= math.sin(math.radians(a3))\n", + "f= math.sqrt(g*h*(p/100.)/(r1*r2+r3*r4+(r5**2/2)))\n", + "A= r2*f/(d/12)\n", + "N= (A*60/(2*math.pi))-n1\n", + "W= (r1*r2+r3*r4)*f**2/g\n", + "Q= math.pi*(d1/12)*(w/12)*Cd*f*62.08\n", + "whp= W*Q/550\n", + "bhp= p1*whp/100\n", + "\n", + "#RESULTS\n", + "print 'Speed = %.f rpm'%(N)\n", + "print ' output horsepower = %.f hp'%(bhp)\n", + "\n", + "# slightly change in r1,r2,r3 and that leads to some error in answer. Please check manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed = 905 rpm\n", + " output horsepower = 369 hp\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.9 Page No : 201" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "N= 428.6 \t#r.p.m\n", + "D= 5. \t#ft\n", + "w= 62.4 \t#lb/ft**3\n", + "hp= 16800. \t#hp\n", + "Qw= 435. \t#cuses\n", + "g= 32.2 \t#ft/sec**2\n", + "v= 32. \t#ft/sec\n", + "v1= 24. \t#f/sec\n", + "H= 200. \t#ft\n", + "lh1= 0.32 \t#ft lb/lb\n", + "\n", + "#CALCULATIONS\n", + "u= math.pi*D*N/60\n", + "W= hp*550/(Qw*w)\n", + "w= W*g/u\n", + "a= math.radians(math.tan(v/w))\n", + "va= math.sqrt(w**2+v**2)\n", + "b= math.radians(math.tan(v/(u-w)))\n", + "B= 180-b\n", + "vew= va**2/(2*g)\n", + "ve1w= v1**2/(2*g)\n", + "LH= H+vew-ve1w-W+lh1\n", + "\n", + "#RESULTS\n", + "print ' Absolute velocity at entry to runner = %.1f ft/sec'%(va)\n", + "print ' Loss of head in runner = %.2f ft lb/lb'%(LH)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Absolute velocity at entry to runner = 102.8 ft/sec\n", + " Loss of head in runner = 15.05 ft lb/lb\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.10 Page No : 203" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "\n", + "#initialisation of variables\n", + "A1= 25. \t#degrees\n", + "A2= 80. \t#degrees\n", + "H1= 100. \t#ft\n", + "H2= 13. \t#ft\n", + "g= 32.2 \t#ft/sec**2\n", + "v= 8. \t#ft/sec\n", + "d= 3.5 \t#in\n", + "de= 15.4 \t#in\n", + "b= 1.5 \t#in\n", + "w= 62.4 \t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "W= H1-H2-(v**2/(2*g))\n", + "f= math.sqrt(W*g/(1/math.tan(math.radians(A1))*(1/math.tan(math.radians(A1))-1/math.tan(math.radians(A2)))))\n", + "u= f*(1/math.tan(math.radians(A1))-1/math.tan(math.radians(A2)))\n", + "V= d*u/7.7\n", + "r= math.degrees(math.atan(f/V))\n", + "N= 60*u*12/(math.pi*de)\n", + "Q= math.pi*de*f*b/144\n", + "HP= Q*w*W/550\n", + "Ns= N*math.sqrt(HP)/H1**1.25\n", + "di= math.sqrt(Q*4*144/(math.pi*f))\n", + "\n", + "#RESULTS\n", + "print 'angle = %.f degrees'%(r)\n", + "print \" Angular speed = %.1f rpm\"%(Ns)\n", + "print ' inlet diameter to draft tube = %.2f in'%(di)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "angle = 48 degrees\n", + " Angular speed = 26.6 rpm\n", + " inlet diameter to draft tube = 9.61 in\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.12 Page No : 207" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "H= 82.1 \t#ft\n", + "h= 90. \t#ft\n", + "k= 0.00646\n", + "k1= 0.00454\n", + "vd= 11. \t#ft/sec\n", + "P= 0.53 \t#hp\n", + "\n", + "#CALCULATIONS\n", + "Q= math.sqrt((1/k))*math.sqrt(h-H)\n", + "Qu= Q/math.sqrt(H)\n", + "Q1= math.sqrt(vd/k1)\n", + "hf= Q1**2*k\n", + "Qu1= Q1/math.sqrt(h-hf)\n", + "Pu= P*(h-hf)**1.5\n", + "\n", + "#RESULTS\n", + "print 'Qu = %.2f cuses'%(Qu)\n", + "print ' Q = %.1f cuses'%(Q1)\n", + "print ' power Developed = %.f hp'%(Pu)\n", + "\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Qu = 3.86 cuses\n", + " Q = 49.2 cuses\n", + " power Developed = 340 hp\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch11.ipynb b/Problems_In_Hydraulics/ch11.ipynb new file mode 100755 index 00000000..3b3ec8a7 --- /dev/null +++ b/Problems_In_Hydraulics/ch11.ipynb @@ -0,0 +1,745 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f1e32f78d016d65eaf62d619ce157e62f2d402e55bfc70a9a046c3e8d919d007" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 : Pumping Machinery" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1 Page No : 223" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#initialisation of variables\n", + "\n", + "import math \n", + "h= 75. \t#ft\n", + "e= 0.75\n", + "k= 0.01\n", + "Q= 3000. \t#gal/min\n", + "k1= 1.2\n", + "N= 1500.\n", + "g= 32.2 \t#ft/sec**2\n", + "D= 0.836 \t#ft\n", + "\n", + "#CALCULATIONS\n", + "W= h/e\n", + "v1= math.sqrt((W-h)/k)\n", + "Q1= Q/374.06\n", + "f1= Q1/(k1*D**2)\n", + "u1= math.pi*D*N/60\n", + "w1= W*g/u1\n", + "B= math.degrees(math.atan((f1/(u1-w1))))\n", + "\n", + "#RESULTS\n", + "print 'Diameter of impeller = %.3f ft '%(D)\n", + "print ' Blade angle at outlet edge of impeller = %.f degrees '%(B)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter of impeller = 0.836 ft \n", + " Blade angle at outlet edge of impeller = 30 degrees \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3 Page No : 226" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "V= 150. \t#ft**3/sec\n", + "A1= 750. \t#r.p.m\n", + "di= 21. \t#in\n", + "do= 30. \t#in\n", + "v= 50. \t#ft/sec\n", + "A= 70. \t#degrees\n", + "w= 4.\t#in\n", + "p= 30. \t#per cent\n", + "p1= 25. \t#per cent\n", + "sv= 12.8 \t#ft**3/lb\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "u= A1*2*math.pi*di/(24*60)\n", + "u1= A1*2*math.pi*do/(24*60)\n", + "f1= V/(math.pi*(do/12)*(1./3))\n", + "w1= u1-f1*1/math.tan(math.radians((A)))\n", + "v1= math.sqrt(f1**2+w1**2)\n", + "P= (u1**2+v**2-(f1**2/(math.sin(math.radians(A)))**2))/(2*g)\n", + "h= 30*v1**2/(100*2*g)\n", + "Nh= v1**2/(20*2*g)\n", + "Prt= P+Nh\n", + "W= u1*w1/g\n", + "e= Prt*100/W\n", + "Power= Prt*V/(sv*550)\n", + "\n", + "#RESULTS\n", + "print 'Total pressure rise = %.1f ft of air'%(Prt)\n", + "print ' manometric efficiency = %.1f percent'%(e)\n", + "print ' Power = %.2f hp '%(Power)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total pressure rise = 137.9 ft of air\n", + " manometric efficiency = 58.5 percent\n", + " Power = 2.94 hp \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4 Page No : 228" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "u1= 90. \t#ft/sec\n", + "w1= 70. \t#ft\n", + "e= 0.8\n", + "h1= 10. \t#ft\n", + "h2= 16. \t#ft\n", + "h3= 5. \t#ft\n", + "k= 2./5\n", + "f1= 20. \t#ft/sec\n", + "f= 18. \t#ft/sec\n", + "a= 45. \t #degrees\n", + "x1= 164.4 \t#ft\n", + "\n", + "#CALCULATIONS\n", + "Hm= u1*w1/g\n", + "Hm1= e*Hm\n", + "lh= Hm-Hm1-h1-h2-h3\n", + "vg= k*math.sqrt(f1**2+w1**2)\n", + "pr= ((f**2+u1**2-f1**2/(math.sin(math.radians(a)))**2)/(2*g))-h2\n", + "pr1= x1-pr\n", + "ge= pr1*g*2*100/(vg/k)**2\n", + "\n", + "#RESULTS\n", + "print 'manometer Head = %.1f ft '%(Hm1)\n", + "print ' outlet velocity from guides = %.1f ft/sec '%(vg)\n", + "print ' Pressure rise through impeller only = %.1f ft '%(pr)\n", + "print ' Guide balde efficiency = %.f per cent '%(ge)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "manometer Head = 156.5 ft \n", + " outlet velocity from guides = 29.1 ft/sec \n", + " Pressure rise through impeller only = 102.4 ft \n", + " Guide balde efficiency = 75 per cent \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6 Page No : 231" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "D1= 7.5 \t#in\n", + "Q1= 850. \t#gal/min\n", + "p1= 62.4 \t#lb/ft**3\n", + "N1= 1800.\n", + "D2= 15. \t#in\n", + "Q2= 12000. \t#gal/min\n", + "p2= 64. \t#lb/ft**3\n", + "N1= 1800. \t#r.p.m \n", + "H1= 14. \t#lb/ft**2\n", + "\n", + "#CALCULATIONS\n", + "N2= Q2*N1*(D1)**3/(Q1*D2**3)\n", + "P1= p1*H1/144\n", + "P2= P1*N2**2*D2**2*p2/(N1**2*p1*D1**2)\n", + "\n", + "#RESULTS\n", + "print 'N2 = %.f r.p.m '%(N2+4)\n", + "print ' P2 = %.f lb/in**2 '%(P2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "N2 = 3180 r.p.m \n", + " P2 = 78 lb/in**2 \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.8 Page No : 234" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "r= 5.\n", + "\n", + "#CALCULATIONS\n", + "sr= r**2\n", + "sr1= r**2/r\n", + "\n", + "#RESULTS\n", + "print 'Corresponding ratio = %.f '%(sr)\n", + "print ' Corresponding ratio = %.f '%(sr1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Corresponding ratio = 25 \n", + " Corresponding ratio = 5 \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.9 Page No : 236" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "e= 0.88\n", + "w= 1.25 \t#in\n", + "d= 10. \t#in\n", + "q= 630. \t#gal/min\n", + "a= 40. \t#degrees\n", + "g= 32.2 \t#ft/sec**2\n", + "e1= 0.83\n", + "\n", + "#CALCULATIONS\n", + "Q= q/(6.24*60)\n", + "f1= Q/(e*math.pi*(d/12)*(w/12))\n", + "u1= 1000*(w*4/12)*2*math.pi/60\n", + "w1= u1-f1*1/math.tan(math.radians(a))\n", + "W= u1*w1/g\n", + "lr= (f1**2+u1**2-f1**2/(math.sin(math.radians(a)))**2)/(2*g)\n", + "mh= e1*W\n", + "p= mh-lr\n", + "v1= math.sqrt(f1**2+w1**2)\n", + "ke= v1**2/(2*g)\n", + "pke= p*100/ke\n", + "me= 100*lr/W\n", + "\n", + "#RESULTS\n", + "print 'Velocity of flow = %.f ft/sec'%(f1)\n", + "print ' Work done = %.1f ft-lb/lb'%(W)\n", + "print ' manometric efficiency = %.1f ft'%(mh)\n", + "print ' Pressure recovered = %.1f ft head'%(p)\n", + "print ' Kinetic energy discharge = %.f ft-lb/lb'%(ke)\n", + "print ' Percentage of kinetic energy recovered = %.1f per cent'%(pke)\n", + "print ' manometric efficiency = %d percent'%(me)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Velocity of flow = 7 ft/sec\n", + " Work done = 47.8 ft-lb/lb\n", + " manometric efficiency = 39.7 ft\n", + " Pressure recovered = 11.2 ft head\n", + " Kinetic energy discharge = 20 ft-lb/lb\n", + " Percentage of kinetic energy recovered = 55.7 per cent\n", + " manometric efficiency = 59 percent\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.10 Page No : 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "W1= 7640. \t#gal/min\n", + "W2= 11400. \t#gal/min\n", + "Hm= 63. \t#ft\n", + "Hm1= 80. \t#ft\n", + "ep1= 72. \t#per cent\n", + "ep2= 76. \t#per cent\n", + "\n", + "#CALCULATIONS\n", + "whp1= W1*Hm/(60*550)\n", + "whp2= W2*Hm1/(60*550)\n", + "bhp1= whp1*100/ep1\n", + "bhp2= whp2*100/ep2\n", + "w1= W2/10\n", + "\n", + "#RESULTS\n", + "print 'For both pumps discharge = %.f gal/min against an 80-ft head'%(W2)\n", + "print ' delivery from one pump = %.1f h.p '%(bhp1)\n", + "print ' delivery from two pumps = %.1f h.p '%(bhp2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For both pumps discharge = 11400 gal/min against an 80-ft head\n", + " delivery from one pump = 20.3 h.p \n", + " delivery from two pumps = 36.4 h.p \n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.11 Page No : 241" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "h= 94. \t#ft\n", + "w= 62.4 \t#lb/ft**3\n", + "e= 0.58\n", + "p= 73.5 \t#per cent\n", + "\n", + "#CALCULATIONS\n", + "WHP= h*e*w/550\n", + "BHP= WHP/(p/100)\n", + "\n", + "#RESULTS\n", + "print 'W.H.P= %.2f h.p'%(WHP)\n", + "print ' Brake horse power= %.1f'%(BHP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "W.H.P= 6.19 h.p\n", + " Brake horse power= 8.4\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.12 Page No : 243" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "sl= 12. \t#ft\n", + "l= 20. \t#ft\n", + "d= 4. \t#in\n", + "dp= 6. \t#in\n", + "lst= 18. \t#in\n", + "k= 0.025\n", + "H= 32. \t#ft\n", + "g= 32.2 \t#ft/sec**2\n", + "pf= 6. \t#ft\n", + "a= 33.83 \n", + "a1= 9.53\n", + "\n", + "#CALCULATIONS\n", + "A= math.sqrt((H-sl-d)*g/a)*a1\n", + "Q= 2*math.pi*(dp/12)**2*lst/(12*4*60)\n", + "v= Q/(math.pi*(d/12)**2/4)\n", + "kh= v**2/(2*g)\n", + "fh= k*l*v**2*12/(2*g*d)\n", + "N= math.sqrt((H-sl-pf)/(kh+fh))\n", + "\n", + "#RESULTS\n", + "print 'premissible speed = %.1f r.p.m'%(A)\n", + "print ' maximum premissible speed = %.1f r.p.m'%(N)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "premissible speed = 37.2 r.p.m\n", + " maximum premissible speed = 168.8 r.p.m\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.13 Page No : 245" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "b= 6. \t#in\n", + "s= 12. \t #in\n", + "d= 4. \t #in\n", + "a1= 30. \t#degrees\n", + "a2= 90. \t#degrees\n", + "a3= 120. \t#degrees\n", + "N= 120. \t#r.p.m\n", + "n= 4.\n", + "#calculations\n", + "A= 2*math.pi*N/60\n", + "V= math.pi*(b/12)**2*n/4\n", + "v= (b/12)**2*A*(b/12)/(d/12)**2\n", + "Q1= v*math.pi*(d/12)**2*math.sin(math.radians(a1))/4\n", + "Q2= v*math.pi*(d/12)**2*math.sin(math.radians(a2))/4\n", + "Q3= v*math.pi*(d/12)**2*math.sin(math.radians(a3))/4\n", + "Q4= V-Q1\n", + "Q5= Q2-V\n", + "Q6= Q3-V\n", + "a4= math.degrees(math.asin(V/(v*math.pi*(d/12)**2)))+a1\n", + "A= 180-a4\n", + "\n", + "#RESULTS\n", + "print 'rate of flow at a1 = %.3f cuses'%(Q4)\n", + "print ' rate of flow at a2 = %.3f cuses'%(Q5)\n", + "print ' rate of flow at a3 = %.3f cuses'%(Q6)\n", + "print ' crak angle = %.1f degrees'%(a4)\n", + "print ' crak angle = %.1f degrees'%(A)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "rate of flow at a1 = 0.169 cuses\n", + " rate of flow at a2 = 0.448 cuses\n", + " rate of flow at a3 = 0.283 cuses\n", + " crak angle = 39.2 degrees\n", + " crak angle = 140.8 degrees\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.14 Page No : 247" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "n= 2. \t#strokes/sec\n", + "dp= 6. \t#in\n", + "ds= 18. \t#in\n", + "ds1=4. \t#in\n", + "l= 20. \t#ft\n", + "l1= 20. \t#ft\n", + "f= 0.008\n", + "la= 5. \t#ft\n", + "A= 60. \t#r.p.m\n", + "f= 0.008\n", + "w= 62.4 \t#lb/ft**3\n", + "g=32.2\n", + "\n", + "#CALCULATIONS\n", + "V= math.pi*(ds/12)*n*(dp/12)**2/4\n", + "vmp= 2*math.pi*A*(ds/24)/60\n", + "vmp1= vmp*(dp**2/ds1**2)\n", + "hfmax= 4*f*(l-la)*vmp1**2/(2*g*ds1/12)\n", + "H1= round(2*hfmax/3,1)\n", + "H2= H1*13\n", + "Wls= (H1+H2)*w*math.pi/16*1.5*2\n", + "mv= V/(math.pi*(ds1/12)**2/4)\n", + "lh= round(4*f*(l-la)*mv**2/(2*g*(ds1/12)),2)\n", + "lhf= 12*lh\n", + "Wls1= (lh+13.21)*w*math.pi*1.5/16 *2 \n", + "WS= Wls-Wls1\n", + "\n", + "#RESULTS\n", + "print 'Work lost per second= %.f ft lb/sec'%(Wls)\n", + "print ' Work saved per second = %.f ft-lb/sec'%(WS)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work lost per second= 875 ft lb/sec\n", + " Work saved per second = 352 ft-lb/sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.15 Page No : 248" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 7.5 \t#in\n", + "s= 15. \t#in\n", + "l= 36. \t#ft\n", + "h1= 34. \t#ft\n", + "h2= 12. \t#ft\n", + "L= 10. \t #ft\n", + "g= 32.2 \t#ft/sec**2\n", + "f= 0.008\n", + "l1= 20. \t#ft\n", + "d1= 4. \t#in\n", + "h3= 110. \t#ft\n", + "w= 62.4 \t#lb/ft**3\n", + "l2= 180. \t#ft\n", + "\n", + "#CALCULATIONS\n", + "Q= (math.pi/4)*(d)**2*(s/12)*2*(l/60)/144\n", + "v= Q/((math.pi/4)*(d1/12)**2)\n", + "a= (d/4)**2*(d/12)*(l*2*math.pi/60)**2\n", + "H= h1-h2-(L*a/g)-(v**2*0.5/g)-(4*f*l1*v**2/(2*g*(d1/12)))\n", + "H1= h1+h3+(L*a/g)+(v**2*0.5/g)+(4*f*l2*v**2/(2*g*(d1/12)))\n", + "dh= (H1-H)*w/144\n", + "NP= dh*(math.pi/4)*d**2\n", + "\n", + "#RESULTS\n", + "print 'Head at piston = %.2f ft of water absolute'%(H)\n", + "print ' Head at piston = %.2f ft of water absolute'%(H1)\n", + "print ' Difference on head of piston = %.f lb/in**2'%(dh)\n", + "print ' Net load on piston = %.f lb'%(NP)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Head at piston = 11.04 ft of water absolute\n", + " Head at piston = 161.59 ft of water absolute\n", + " Difference on head of piston = 65 lb/in**2\n", + " Net load on piston = 2882 lb\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.16 Page No : 250" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "from numpy import *\n", + "from numpy.linalg import *\n", + "\n", + "#initialisation of variables\n", + "f= 0.009\n", + "dc= 3.5 \t#in\n", + "ds= 6. \t#in\n", + "r= 0.25\n", + "sl= 8. \t#ft\n", + "d= 2.5 \t#in\n", + "l= 14. \t#ft\n", + "el= 8. \t#ft\n", + "ed= 22.5 \t#in\n", + "ph= 4. \t#ft\n", + "g= 32.2 \t#ft/sec**2\n", + "f= 0.009\n", + "\n", + "#CALCULATIONS\n", + "BC= el+l\n", + "v= math.sqrt(BC*g/(l*(d/2)*(r)*(dc/d)**2))*9.55\n", + "vec=roots([2,1/r,-1])\n", + "H1= 77\n", + "MV= math.sqrt(BC*g/(l*(d/2)*(r)*(dc/d)**2))*r*(math.sin(math.radians(H1))+(math.sin(math.radians(2*H1))/8))\n", + "mvp= MV*dc**2/d**2\n", + "hf= 4*f*(sl+l)*mvp**2/(2*g*(d/12))\n", + "\n", + "#RESULTS\n", + "print 'pump speed = %.1f r.p.m'%(v)\n", + "print ' Friction head = %.3f ft'%(hf)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pump speed = 86.8 r.p.m\n", + " Friction head = 1.240 ft\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch12.ipynb b/Problems_In_Hydraulics/ch12.ipynb new file mode 100755 index 00000000..6c180ea8 --- /dev/null +++ b/Problems_In_Hydraulics/ch12.ipynb @@ -0,0 +1,294 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:5f1e1e7eb1f2538f17f15df30e5829cbbc6f3ee52bddff3d767ce84c4a9e05f8" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12 : Dimensional and Model Analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1 Page No : 260" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 0.0625 \t#in\n", + "sg= 0.91\n", + "vs= 1.62\n", + "ss= 7.85\n", + "g= 981. \t#cm/sec**2\n", + "\n", + "#CALCULATIONS\n", + "v= 4*(d*2.54/2)**2*(ss-sg)*g/(3*6*30.45*vs)\n", + "\n", + "#RESULTS\n", + "print 'steady speed attained = %.4f ft/sec '%(v)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "steady speed attained = 0.1932 ft/sec \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.3 Page No : 263" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "vs= 16. \t#ft/sec\n", + "lm= 1. \t#ft\n", + "l= 16. \t#ft\n", + "R= 9.6 \t#lb\n", + "ds= 64. \t#lb/ft**3\n", + "dm= 62.4 \t#/lb/ft**3\n", + "A= 40. \t#ft**2\n", + "\n", + "#CALCULATIONS\n", + "vm= vs*math.sqrt(lm/l)\n", + "rs= 0.0095*vm**1.9*A\n", + "rw= R-rs\n", + "Rw= rw*ds*(l/lm)**3/dm\n", + "Rs= 0.009*vs**1.85*A*l**2\n", + "R1= Rw+Rs\n", + "\n", + "#RESULTS\n", + "print 'speed = %.f b ft/sec'%(vm)\n", + "print ' Total resistance = %.f lb '%(round(R1,-2))\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "speed = 4 b ft/sec\n", + " Total resistance = 33700 lb \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.4 Page No : 264" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "H2= 0.75 \t#ft\n", + "v1= 1. \t#ft/sec\n", + "v2= 6. \t#ft/sec\n", + "k= 1.433\n", + "\n", + "#CALCULATIONS\n", + "H1= H2*(v1/v2)**(2./3)\n", + "Q1= k*H1**2.47\n", + "Q2= Q1*(H2/H1)**2.5\n", + "\n", + "#RESULTS\n", + "print 'Flow = %.3f cuses '%(Q2 )\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Flow = 0.730 cuses \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.5 Page No : 265" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "nm= 360.\n", + "d= 1.5 \t#in\n", + "n= 100. \n", + "dp= 12. \t#in\n", + "vm= 4.8 \t#ft/sec\n", + "Tm= 52. \t#sec\n", + "T= 16. \t#lb-ft\n", + "t= 133. \t#lb ft\n", + "\n", + "#CALCULATIONS\n", + "vp= n*dp*vm/(nm*d)\n", + "Tp= round(Tm*dp**2*vp**2/(d**2*vm**2),-2)\n", + "N= Tm*vm*6080*100/(T*2*math.pi*nm*60)\n", + "W= Tp*65000\n", + "T1= W/(.7*2*math.pi*n*60)\n", + "\n", + "\n", + "#RESULTS\n", + "print 'Speed of advance = %.2f knots '%(vp)\n", + "print ' Thrust = %.f lb '%(Tp)\n", + "print ' Efficiency = %.f per cent '%(N)\n", + "print ' Torque = %.f lb ft '%(round(T1,-2))\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of advance = 10.67 knots \n", + " Thrust = 16400 lb \n", + " Efficiency = 70 per cent \n", + " Torque = 40400 lb ft \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.6 Page No : 267" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "w= 62.4 \t#lb/ft**3\n", + "d= 4 \t#in\n", + "D= 0.0765 \t#lb/ft**3\n", + "Da= 8 \t#in\n", + "vw= 1./13\n", + "nw= 20\n", + "va= 13 \t#ft/sec\n", + "\n", + "#CALCULATIONS\n", + "na= nw*va*d**2/Da**2\n", + "\n", + "#RESULTS\n", + "print 'power = %.f r.p.m '%(na)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "power = 65 r.p.m \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.7 Page No : 269" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "dtp= 120. \t#in\n", + "dpd= 48. \t#in\n", + "vim= 1.25 \t#ft/sec\n", + "vip= 5. \t#ft/sec\n", + "lp = 600. \t#ft\n", + "lm= 40. \t#ft\n", + "\n", + "#CALCULATIONS\n", + "Rm= (dtp/dpd)**2/((lp/lm)*(vim/vip)**2)\n", + "d= math.sqrt(4*Rm)\n", + "\n", + "#RESULTS\n", + "print 'Diameter = %.2f in '%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter = 5.16 in \n" + ] + } + ], + "prompt_number": 13 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch13.ipynb b/Problems_In_Hydraulics/ch13.ipynb new file mode 100755 index 00000000..30017a36 --- /dev/null +++ b/Problems_In_Hydraulics/ch13.ipynb @@ -0,0 +1,624 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:da0a57e05023d78d40f48e24ac486e01915e80a89fcf828d645acb89b5297ac2" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13 : Miscellaneous Problems" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1 Page No : 282" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "W= 5000 \t#lb\n", + "vr= 6\n", + "e= 0.95\n", + "ep = 0.75\n", + "d= 9 \t#in\n", + "D= 45 \t#ft\n", + "t= 2 \t#min\n", + "v= 4.5 \t#ft/sec\n", + "\n", + "#CALCULATIONS\n", + "L= W*vr/(e*ep)\n", + "Pr= L/(math.pi*d**2/4)\n", + "s= D/vr\n", + "V= s*math.pi*ep**2/(4*t*60)\n", + "T= D/v\n", + "V1= s*math.pi*ep**2/4\n", + "V2= V*T\n", + "V3= V1-V2\n", + "\n", + "#RESULTS\n", + "print 'Pressure on ram = %.f ln/in**2 '%(Pr)\n", + "print ' Pump duty = %.4f cusec'%(V)\n", + "print ' Minimum capacity if accumulator = %.3f ft**3 '%(round(V3))\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure on ram = 662 ln/in**2 \n", + " Pump duty = 0.0258 cusec\n", + " Minimum capacity if accumulator = 3.000 ft**3 \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2 Page No : 283" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "P1= 1100. \t#lb/in**2\n", + "P2= 85. \t#lb/in**2\n", + "f= 0.01\n", + "g= 32.2 \t#ft/sec**2\n", + "l= 1600. \t#ft\n", + "r= 1./8\n", + "W= 2500. \t#lb\n", + "d= 6. \t#in\n", + "\n", + "#CALCULATIONS\n", + "L= W*d\n", + "P= L*2.31/(math.pi*(d/2)**2)\n", + "s1= P1*2540/1100\n", + "s2= P2*196/85\n", + "vp= math.sqrt((s1-s2-P)/(4*f*l/(2*g*r)))\n", + "V= vp/16\n", + "Vl= V*d\n", + "Vp= math.sqrt((s1/3)/(4*f*l/(2*g*r)))\n", + "vl= Vp*d/16\n", + "Hr= s1-(s1/3)-s2\n", + "Lr= Hr*math.pi*(d/2)**2/(2.31*d)\n", + "\n", + "#RESULTS\n", + "print \"In case 1 velocity of load = %.2f ft/sec\"%(Vl)\n", + "print \" In case 2 velocity of load = %.2f ft/sec\"%(vl)\n", + "print ' Load to be lifted = %d lb '%(Lr)\n", + "\n", + "# note : roundin off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "In case 1 velocity of load = 4.45 ft/sec\n", + " In case 2 velocity of load = 3.87 ft/sec\n", + " Load to be lifted = 3054 lb \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.3 Page No : 284" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "bhp= 1500 \t#h.p\n", + "e= 0.86\n", + "h1= 300 \t#ft\n", + "h2= 15 \t#ft\n", + "w= 62.4 \t#lb/ft**3\n", + "t= 30 \t#days\n", + "t1= 10 \t#hr\n", + "t2= 3 \t#months\n", + "f= 0.005\n", + "l= 1000 \t#ft\n", + "\n", + "#CALCULATIONS\n", + "WHP= bhp/e\n", + "Ha= h1-h2\n", + "W= WHP*550\n", + "Q= W/(Ha*w)\n", + "Qt= Q*36009*t1*t*t2\n", + "Qp= Qt/(3600*t*45)\n", + "d= (f*l*(Q/2)**2/(t1*h2))**(1./5)\n", + "\n", + "#RESULTS\n", + "print \"Minimum size of basin required = %.1e cusecs\"%Qt\n", + "print \"Pump Discharge : %.f cusecs\"%(Qp/10)\n", + "print 'Diameter = %.2f ft '%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum size of basin required = 1.7e+09 cusecs\n", + "Pump Discharge : 36 cusecs\n", + "Diameter = 1.89 ft \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.4 Page No : 285" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "l= 140 \t#ft\n", + "P= 70 \t#percent\n", + "V= 3*10**8 \t#ft**3\n", + "w= 62.4 \t#lb/ft**3\n", + "SBD= 4.9*10**8 \t#ft**3\n", + "Q= 162 \t#cuses\n", + "s= 12.2*10**6 \t#ft**3/day\n", + "\n", + "#CALCULATIONS\n", + "O= Q*w*l*(P/1000.)/550.\n", + "\n", + "#RESULTS\n", + "print 'Size of reservoir= %.2e ft**3'%(SBD)\n", + "print ' output = %.f h.p '%(O)\n", + "print ' output = %d h.p '%(Q)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Size of reservoir= 4.90e+08 ft**3\n", + " output = 180 h.p \n", + " output = 162 h.p \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.5 Page No : 287" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Q= 140 \t#cuses\n", + "w= 62.4 \t#lb/ft**3\n", + "l= 140 \t#ft\n", + "P= 70 \t#percent\n", + "k= 1.6\n", + "v= 3*10**8\n", + "\n", + "#CALCULATIONS\n", + "rv= k*v\n", + "HP= Q*l*w*(P/1000.)/550.\n", + "\n", + "#RESULTS\n", + "print 'Required size of reservoir = %.1e ft**3 '%(rv)\n", + "print ' horsepower = %.f h.p '%(HP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required size of reservoir = 4.8e+08 ft**3 \n", + " horsepower = 156 h.p \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.6 Page No : 288" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "P= 10. \t#lb/in**2\n", + "r1= 0.5 \t#ft\n", + "r= 0.25 \t#ft\n", + "f= 42.3 \t#ft/sec\n", + "b= 1./40\n", + "Tt= 1400. \t#lb\n", + "\n", + "#CALCULATIONS\n", + "Q= 2*math.pi*r*b*f\n", + "p1= 34+P\n", + "Fu= p1*math.pi*(r-(r/4))*144/2.3\n", + "Fr= Fu-Tt\n", + "\n", + "#RESULTS\n", + "print 'Quantity = %.2f cusecs '%(Q)\n", + "print ' Resultant force on the plate = %.f lb '%(round(Fr,-1))\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quantity = 1.66 cusecs \n", + " Resultant force on the plate = 220 lb \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.7 Page No : 289" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "r= 0.5 \t#ft\n", + "N= 300\n", + "w= 62.4 \t#lb/ft**3\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "A= N*2*math.pi/60\n", + "Ft= math.pi*A**2*r**4*w/(4*g)\n", + "\n", + "#RESULTS\n", + "print 'total force = %.1f lb '%(Ft)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total force = 93.9 lb \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.8 Page No : 292" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 4. \t#in\n", + "h= 12. \t#in\n", + "h1= 9. \t#in\n", + "g= 32. \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "H= 2*(1-(h1/h))\n", + "A= math.sqrt((H*2*g/((d/24)**2)))\n", + "A1= math.sqrt((H*2*g*2/((d/24)**2)))\n", + "\n", + "#RESULTS\n", + "print 'speed when the axial is zero = %.f radn/sec '%(A)\n", + "print ' speed when the axial is zero = %.f radn/sec '%(A1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "speed when the axial is zero = 34 radn/sec \n", + " speed when the axial is zero = 48 radn/sec \n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.10 Page No : 295" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "P= 14.7 \t#lb/in**2\n", + "T= 15. \t#C\n", + "v= 350. \t#ft/sec\n", + "R= 0.714\n", + "\n", + "#CALCULATIONS\n", + "P1= P*144\n", + "r= 3091*(273+T)\n", + "d1= P1/r\n", + "r1= r+(v**2/7)\n", + "P2= (r1*d1/(P1**R))**(1/(1-R))/144\n", + "dP= P2-P\n", + "T2= r1/3091\n", + "dT= T2-(273+T)\n", + "\n", + "#RESULTS\n", + "print 'rise in pressure = %.f lb/in**2 '%(dP)\n", + "print ' rise in temperature = %.1f C '%(dT)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "rise in pressure = 1 lb/in**2 \n", + " rise in temperature = 5.7 C \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.11 Page No : 297" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "T= 27. \t#C\n", + "P = 33. \t#lb/in**2\n", + "p1= 14.7 \t#lb/in**2\n", + "w= 250. \t#lb\n", + "g= 32.2 \t#ft/sec**2\n", + "Cd= 0.99\n", + "r= 1.4\n", + "\n", + "#CALCULATIONS\n", + "w1= P*144/(96*(273+T))\n", + "d= p1*144/(96*(273+T))\n", + "W= d*w/60\n", + "d= math.sqrt(W*4/(Cd*math.pi*math.sqrt(2*g*P*144*(r/(r-1))*w1*(0.528**(2/1.4)-0.528**(2.4/1.4)))))*12\n", + "\n", + "#RESULTS\n", + "print 'Diameter = %.3f in '%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter = 0.722 in \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.12 Page No : 299" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "sp= 13.6\n", + "hm= 800. \t#mm\n", + "d= 3. \t#in\n", + "r= 1.4\n", + "R= 1385. \t#ft-lb/lb/C\n", + "w= 62.4 \t#lb/ft**3\n", + "T= 15. \t#C\n", + "hm1= 765. \t#mm\n", + "r1= 9.\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "p1= hm*sp*w/304.8\n", + "r2= (273+T)*R\n", + "w1= p1/r2\n", + "k= hm/hm1\n", + "v1= math.sqrt((2*g*r*r2*(1-k**0.286))/((1-r)*(r1**2*k**1.43-1)))\n", + "W= v1*w1*3600*(math.pi/64)\n", + "\n", + "#RESULTS\n", + "print 'Weight flowing = %.f lb/hr '%(W)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Weight flowing = 115 lb/hr \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.13 Page No : 301" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "p= 160. \t#lb/in**2\n", + "d= 1./3 \t#ft\n", + "T= 15. \t#C\n", + "R= 96. \n", + "V= 120. \t#ft**3\n", + "f= 0.004\n", + "a= 60*math.pi\n", + "l= 10560. \t#ft\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "p1= p*144\n", + "w1= p*144/(R*(273+T))\n", + "v1= V*36/a\n", + "p2= math.sqrt(p1**2-((2*4*f*p1*w1*v1**2*l)/(2*g*d)))/144\n", + "v2= p*v1/p2\n", + "\n", + "#RESULTS\n", + "print ' pressure = %.1f lb/in**2 '%(p2)\n", + "print ' velocity = %.1f ft/sec '%(v2)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " pressure = 134.0 lb/in**2 \n", + " velocity = 27.4 ft/sec \n" + ] + } + ], + "prompt_number": 12 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch2.ipynb b/Problems_In_Hydraulics/ch2.ipynb new file mode 100755 index 00000000..d68673ef --- /dev/null +++ b/Problems_In_Hydraulics/ch2.ipynb @@ -0,0 +1,222 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:2c442a1cbc28b933d555165b6cb09fa7f45de31e28c837593e3048f115cafdbb" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : Equilibrium of Floating Bodies" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1 Page No : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#initialisation of variables\n", + "d= 40. \t#lb/ft**2 density of wood\n", + "w= 4 \t#ft wide\n", + "h= 6 \t#ft deep\n", + "l= 12 \t#ft long \n", + "\n", + "#CALCULATIONS\n", + "W= w*h*d*l\n", + "V= W/64\n", + "D= V/(w*l)\n", + "\n", + "#RESULTS\n", + "print 'Volume of water print laced = %.f ft**3'%(V)\n", + "print ' Depth of immersion = %.2f ft'%(D)\n", + "print ' Centre of buoyancy = %.2f ft from base'%(D)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Volume of water print laced = 180 ft**3\n", + " Depth of immersion = 3.75 ft\n", + " Centre of buoyancy = 3.75 ft from base\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3 Page No : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from sympy import Symbol,solve\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 4. \t#ft diameter\n", + "h= 7. \t#ft high\n", + "W= 2500. \t#lb weighing \n", + "OG= 3.5\n", + "OB= 1.55 \t#ft\n", + "\n", + "#CALCULATIONS\n", + "V= W/d**3\n", + "D= V/(math.pi*(d/2)**2)\n", + "I= math.pi*d**4/64\n", + "BM= I/V\n", + "BG= OG-OB\n", + "T = Symbol(\"T\")\n", + "ans = solve( (2500 + T)**2 -(512*math.pi *(8750 - 804)) - 1)\n", + "T = ans[1]\n", + "\n", + "#RESULTS\n", + "print 'Minimum tension in chain = %d lb'%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum tension in chain = 1075 lb\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4 Page No : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "W1= 1000. \t#lb weighing\n", + "W2= 100. \t#lb load\n", + "h= 4. \t#ft height\n", + "d= 5. \t#ft diameter\n", + "\n", + "#CALCULATIONS\n", + "V= (W1+W2)/h**3\n", + "D= V*h/(d**2*math.pi)\n", + "I= d**4*math.pi/h**3\n", + "BM= I/V\n", + "x= (BM+(D/2)-(W1*(h/2)/(W1+W2)))/(W2/(W1+W2))-0.02\n", + "C= x-h\n", + "\n", + "#RESULTS\n", + "print 'centre of gravity = %.2f ft'%(x)\n", + "print ' Hence the gravity of the weight must not be more than above the top of buoy = %.2f ft'%(C)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "centre of gravity = 4.43 ft\n", + " Hence the gravity of the weight must not be more than above the top of buoy = 0.43 ft\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5 Page No : 32" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "b= 12. \t#ft breadth\n", + "h1= 3. \t#ft draught\n", + "h2= 1.5 \t#ft\n", + "h3= 5+(2./3) \t#ft\n", + "\n", + "#CALCULATIONS\n", + "I= b**3/12\n", + "V= b*h1\n", + "bm= I/V\n", + "BG= bm+(h1*2/(3*b))\n", + "O= math.degrees(math.tan(math.sqrt((h3*2-h1-bm*2)/(bm*2+bm))))\n", + "\n", + "\n", + "#RESULTS\n", + "print ' Volume of body immersed = %.f ft**3'%(V)\n", + "print ' BM = %.f ft'%(bm)\n", + "print ' BG = %.2f ft'%(BG)\n", + "print ' angle of heel = %.2f degrees'%(O)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Volume of body immersed = 36 ft**3\n", + " BM = 4 ft\n", + " BG = 4.17 ft\n", + " angle of heel = 9.64 degrees\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch3.ipynb b/Problems_In_Hydraulics/ch3.ipynb new file mode 100755 index 00000000..a3c142e2 --- /dev/null +++ b/Problems_In_Hydraulics/ch3.ipynb @@ -0,0 +1,251 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b5106ea5cae253fe059288e745550627fa4df81e4cd0d1b81237c843ab3f804d" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Hydrodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 Page No : 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "# points\n", + "hob= 34. \t#ft\n", + "hoc= 5. \t#ft\n", + "hoa= 50. \t#ft\n", + "\n", + "hod= 80. \t#ft height\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "# sectional areas\n", + "A= 2.1 \t#in**2\n", + "A1= 4.8 \t#in**2\n", + "A2= 9.6 \t#in**2\n", + "\n", + "#CALCULATIONS\n", + "v= math.sqrt(2*g*(hod-hoc))\n", + "Q= v*A/144\n", + "va= v*A/A1\n", + "vb= v*A/A2\n", + "Va= va**2/(2*g)\n", + "Vb= vb**2/(2*g)\n", + "r= hob+hod-hoa-(va**2/(2*g))\n", + "r1=hob+hod-hob-(vb**2/(2*g))\n", + "\n", + "#RESULTS\n", + "print 'Discharge = %.2f cuses'%(Q) \n", + "print ' Velocity head at A = %.2f ft-lb/lb'%(Va)\n", + "print ' Velocity head at B = %.2f ft-lb/lb'%(Vb)\n", + "print ' Pressure head at A = %.2f ft-lb/lb'%(r) \n", + "print ' Pressure head at B = %.2f ft-lb/lb'%(r1) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 1.01 cuses\n", + " Velocity head at A = 14.36 ft-lb/lb\n", + " Velocity head at B = 3.59 ft-lb/lb\n", + " Pressure head at A = 49.64 ft-lb/lb\n", + " Pressure head at B = 76.41 ft-lb/lb\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 Page No : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "w= 62.4 \t#lb/ft**3\n", + "P= 1.7 \t#lb/in**2 pressure\n", + "d1= 6. \t #in diameters\n", + "d2= 3. \t #in diameters\n", + "hab= 8. \t#ft\n", + "Q= 0.75 \t#cuses\n", + "sm= 13.6 # gravity\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "dP= P*144/w\n", + "va= Q*(d1/d2)**4/math.pi\n", + "k= -(((d1/d2)**4-1)-((-dP+hab)*2*g/va**2))\n", + "h= (-dP+hab)*12/(sm-1)\n", + "\n", + "#RESULTS\n", + "print 'k = %.f '%(k)\n", + "print 'height difference = %.2f in'%(h) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "k = 3 \n", + "height difference = 3.88 in\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3 Page No : 42" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "h= 20. \t #ft pressure head\n", + "Q= 4.81 \t#cuses \n", + "C= 1.\n", + "g= 32.2 \t#ft/sec**2\n", + "d= 10. \t#indiameter\n", + "\n", + "#CALCULATIONS\n", + "d= ((Q*4*144/(d**2*math.pi))**2*100**2/((Q*4*144/(d**2*math.pi))**2+2*g*h))**0.25\n", + "\n", + "#RESULTS\n", + "print 'Smallest Diameter = %.1f in'%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Smallest Diameter = 4.9 in\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4 Page No : 43" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 1./3 \t#ft\n", + "g= 32.2 \t#ft/sec**2\n", + "d1= 4. \t #in\n", + "d2= 1.6 \t#in diameter\n", + "\n", + "# guage readings\n", + "h1= 5.7 \t#ft\n", + "h2= -1.9 \t#ft\n", + "\n", + "Q= 0.3 \t#cuses\n", + "H1= 34. \t#ft height of water\n", + "H2= 19. \t#ft\n", + "H3= 7. \t #ft\n", + "H4= 9.2 \t#ft\n", + "h3= 2.9 \t#ft\n", + "h4= 3.9 \t#ft\n", + "Et= 54. \t#ft-lb/lb\n", + "\n", + "#CALCULATIONS\n", + "v1= math.sqrt(2*g*(h1-h2)/((d1/d2)**4-1))\n", + "Q1= math.pi*v1*d**2/4\n", + "k= Q/Q1\n", + "P= (H1+H2)*H3/H4\n", + "P1= P-h3\n", + "r= P+h1-h2-h4\n", + "V= v1**2/(2*g)\n", + "E= r+V\n", + "dE= Et-E\n", + "\n", + "#RESULTS\n", + "print 'Coefficienct of venturi meter = %.4f '%(k)\n", + "print ' Pressure of venturi throat = %.2f ft of water'%(P1)\n", + "print ' Loss in energy = %.1f ft-lb/lb'%(dE)\n", + "\n", + "# Note : The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficienct of venturi meter = 0.9587 \n", + " Pressure of venturi throat = 37.43 ft of water\n", + " Loss in energy = 9.8 ft-lb/lb\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch4.ipynb b/Problems_In_Hydraulics/ch4.ipynb new file mode 100755 index 00000000..aefd97a7 --- /dev/null +++ b/Problems_In_Hydraulics/ch4.ipynb @@ -0,0 +1,291 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f02a7c0105dc5d8192eae252809dedbf748fa59e0b9b78e4af3b1079610b7a69" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : Orifices and Notches" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 Page No : 51" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Cd= 0.98 # velocity\n", + "g= 32.2 \t#ft/sec**2\n", + "H= 2. \t#ft\n", + "\n", + "#CALCULATIONS\n", + "v= math.sqrt(2*g*H)\n", + "t= H/v\n", + "h= 0.5*g*t**2\n", + "\n", + "#RESULTS\n", + "print 'Vertical distance fallen in this ttime = %.3f ft'%(h) \n", + "\n", + "#Note : The answer given in textbook is wrong.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Vertical distance fallen in this ttime = 0.500 ft\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 Page No : 51" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "r= 53.4\n", + "T= 60. \t #F pressure of air\n", + "h= 29.7 \t#in of mercury\n", + "sm= 13.6\n", + "w= 62.4 \t#lb/ft**3\n", + "d= 1.5 \t#in diameter\n", + "Qin= 2. \t#cuses air\n", + "g=32.2 \t #ft/s**2\n", + "\n", + "#CALCULATIONS\n", + "W= h*sm*w/(r*(460+T)*12)\n", + "dP= 0.75*w/(12*W)\n", + "Q= math.sqrt(2*g*dP)*math.pi*d**2/(4*144)\n", + "W= Q*W*60\n", + "Cd= Qin/W\n", + "\n", + "#RESULTS\n", + "print 'coefficient of discharge = %.2f '%(Cd) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "coefficient of discharge = 0.62 \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 Page No : 52" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "H1= 34. \t#ft height\n", + "H2= 8. \t #ft head\n", + "H3= 7. \t#ft pressure head\n", + "g= 32.2 \t#ft/sec**2\n", + "d= 1.5 \t #in\n", + "\n", + "#CALCULATIONS\n", + "v2= math.sqrt(2*g*(H1+H2-H3))\n", + "Q= v2*math.pi*d**2/(4*144)\n", + "v3= (2*v2+math.sqrt(4*v2**2-4*6*(v2**2-H2*2*5*g)))/12\n", + "dr= math.sqrt(v2/v3)\n", + "\n", + "#RESULTS\n", + "print 'ratio of diameteres = %.1f '%(dr) \n", + "print \" Maximum discharge = %.3f cusec\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "ratio of diameteres = 1.6 \n", + " Maximum discharge = 0.583 cusec\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 Page No : 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Q1= 8./15 \t#cuses\n", + "Q2= 2./15 \t#cuses\n", + "\n", + "#CALCULATIONS\n", + "A= math.degrees(math.atan(Q2/Q1))\n", + "\n", + "#RESULTS\n", + "print 'Angle of inclination = %.2f degrees'%(A) \n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Angle of inclination = 14.04 degrees\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 Page No : 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "r= g**2/((math.sqrt(2))**2*g**2)\n", + "\n", + "#RESULTS\n", + "print 'coefficient of contraction = %.1f '%(r) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "coefficient of contraction = 0.5 \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 Page No : 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "B= 3. \t #ft long\n", + "H= 2. \t#ft depth of water\n", + "H1= 3.75 \t#ft \n", + "w= 4. \t#ft wide\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "Q= 3.33*(B-(H1/5))*H**1.5\n", + "v= Q/(H*w)\n", + "kh= v**2/(2*g)\n", + "Q1= 3.33*(B-(H1/5)-kh)*(((H1/5)+kh)**1.5-kh**1.5)\n", + "\n", + "#RESULTS\n", + "print 'Discharge = %.2f cuses'%(Q1) \n", + "\n", + "\n", + "# NOte : ANSWER IN THE TEXTBOOK IS WRONG\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 5.42 cuses\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch5.ipynb b/Problems_In_Hydraulics/ch5.ipynb new file mode 100755 index 00000000..696c90f4 --- /dev/null +++ b/Problems_In_Hydraulics/ch5.ipynb @@ -0,0 +1,422 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:99b4244f7dba40fbe6b1f9647ffae37a043c932f7cb3e888c2ad7aac3ff9563e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : Flow in Channels" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 Page No : 67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "h= 2.5 \t#ft depth of water\n", + "a= 45. \t#degrees side slope\n", + "x= 5. \t#ft\n", + "Q= 45. \t#cuses\n", + "v= 2.6 \t#ft/sec velocity\n", + "w= 6.92 \t#ft \n", + "C= 120.\n", + "\n", + "#CALCULATIONS\n", + "b= (Q/(v*h))-h\n", + "p= b+2*(h+math.sqrt(2))\n", + "A= h*w\n", + "m= A/p\n", + "i= (v/(C*math.sqrt(m)))**2\n", + "\n", + "#RESULTS\n", + "print 'Width = %.2f ft'%(b) \n", + "print ' Slope = %.6f '%(i) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Width = 4.42 ft\n", + " Slope = 0.000332 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 Page No : 69" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "a= 60. \t#degrees sides inclined\n", + "i= 1./1600\n", + "Q= 8.*10**6 \t#gal/hr discharge\n", + "M= 110.\n", + "w= 6.24 \t#lb/ft**3\n", + "\n", + "#CALCULATIOS\n", + "d= ((Q*2**(2./3)*math.sqrt(1./i))/(w*3600*math.sqrt(3)*M))**(3./8)\n", + "b=6.93 \t#ft\n", + "\n", + "#RESULTS\n", + "print 'Diameter = %.f ft'%(d) \n", + "print ' breadth = %.2f ft'%(b)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter = 6 ft\n", + " breadth = 6.93 ft\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 Page No : 71" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/swc**2\n", + "Q= 40. \t#cuses rate\n", + "w= 5.5 \t#ft\n", + "h= 9. \t#in depth\n", + "d= 0.75 \t#ft\n", + "V= 3. \t#ft/sec\n", + "\n", + "#CALCULATIONS\n", + "D= ((Q*2)**2/(g*(w*2)**2))**(1./3)\n", + "v= Q*d/w\n", + "D1= math.sqrt((2*v**2*d/g)+h/64)-(d/2)\n", + "dD= D1-d\n", + "El= -dD+((v**2*(1-(V/v)**2))/(2*g))\n", + "Els= Q*El*62.4/550\n", + "\n", + "#RESULTS\n", + "print 'Critical depth = %.2f ft'%(D)\n", + "print ' Rise in level = %.f ft'%(D1)\n", + "print ' Horse-power lost = %.3f hp'%(Els) \n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Critical depth = 1.18 ft\n", + " Rise in level = 1 ft\n", + " Horse-power lost = 0.961 hp\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.6 Page No : 77" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "b= 3.5 \t#ft\n", + "H= 2.5 \t#ft\n", + "w= 3. \t#ft depth\n", + "h= 6. \t#ft wide\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "Q= 3.09*b*H**1.5\n", + "v= Q/(w*h)\n", + "H1= H+(v**2/(2*g))\n", + "Q1= 3.09*b*H1**1.5\n", + "hc= (Q1**2/(b**2*g))**(1./3)\n", + "h2= 0.5*(math.sqrt(hc**2+8*hc**2)-hc)\n", + "dh= h2+b-w\n", + "\n", + "#RESULTS\n", + "print \"Flow rate = %.1f cusecs\"%(Q)\n", + "print \" Flow rate = %d cusecs\"%(Q1)\n", + "print ' maximum depth of water downstream = %.3f ft'%(dh) \n", + "print ' Shooting flow depth at hump = %.3f ft'%(h2) \n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Flow rate = 42.8 cusecs\n", + " Flow rate = 45 cusecs\n", + " maximum depth of water downstream = 2.226 ft\n", + " Shooting flow depth at hump = 1.726 ft\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.7 Page No : 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "m= 60./26\n", + "i= 1./2000\n", + "h1= 3. \t#ft depth\n", + "h2= 5. \t#ft depth\n", + "m1= 10./3\n", + "C= 90. # constant\n", + "l= 500. \t#ft depth\n", + "H= 20. \t#ft broad\n", + "H1= 29.62 \t#ft\n", + "g= 32.2 \t#ft/s**2\n", + "\n", + "#CALCULATIONS\n", + "v= 90*math.sqrt(m*i)\n", + "v1= v*h1/h2\n", + "dh= (i-(v1**2/(C**2*m1)))*l/(1-v1**2/(g*h2))\n", + "h3= h2-dh\n", + "V= h1*v/h3\n", + "\n", + "#RESULTS\n", + "print 'Height of water 1000 ft upstream = %.3f ft'%(h3) \n", + "print ' Height of water upstream = %.3f ft'%(h3) \n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Height of water 1000 ft upstream = 4.808 ft\n", + " Height of water upstream = 4.808 ft\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.8 Page No : 80" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "v= 5. \t #ft/sec\n", + "m= 60./26\n", + "i= 1./2000\n", + "h= 5.5 \t#ft\n", + "m1= 110./31\n", + "d= 3. \t #ft\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "C= v/(math.sqrt(m*i))\n", + "v1= v*d/h\n", + "r= (i-(v1**2/(C**2*m1)))/(1-(v1**2/(g*h)))\n", + "x= 1/r\n", + "\n", + "#RESULTS\n", + "print 'Distance upstream = %.f ft'%(round(x,-1)) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Distance upstream = 2380 ft\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.9 Page No : 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "from numpy import *\n", + "from numpy.linalg import *\n", + "\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "Q= 12 \t#cuses\n", + "\n", + "#CALCULATIONS\n", + "hc= (Q/(3*math.sqrt(g)))**(2./3)\n", + "vec=roots([1,6,12,8,0,-8.95,-8.95])\n", + "H=vec[2]\n", + "\n", + "#RESULTS\n", + "print 'Critical depth = %.2f ft'%(hc) \n", + "print ' Critical depth = %.2f ft'%(H) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Critical depth = 0.79 ft\n", + " Critical depth = 0.89 ft\n" + ] + }, + { + "output_type": "stream", + "stream": "stderr", + "text": [ + "-c:17: ComplexWarning: Casting complex values to real discards the imaginary part\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.11 Page No : 85" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Cd= 0.64 # coefficient\n", + "g= 32.2 \t#ft/sec**2\n", + "A= 12.5 \t#ft**2\n", + "H= 24.8 \t#ft\n", + "Q= 3200. \t#cuses\n", + "b= 150. \t#ft wide\n", + "A1= 5.*10**6 # avg surface area\n", + "h= 9. \t#ft\n", + "h1= 6. \t #in\n", + "\n", + "#CALCULATIONS\n", + "N= Q/(Cd*A*math.sqrt(2*g*H))\n", + "H1= (Q/(3.2*b))**(2./3)\n", + "ES= (H1-(h1/12))*A1*h\n", + "\n", + "#RESULTS\n", + "print 'number of siphons = %.f '%(N) \n", + "print ' Extra Storage = %.2e ft**3'%(ES) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "number of siphons = 10 \n", + " Extra Storage = 1.37e+08 ft**3\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch6.ipynb b/Problems_In_Hydraulics/ch6.ipynb new file mode 100755 index 00000000..5608cc77 --- /dev/null +++ b/Problems_In_Hydraulics/ch6.ipynb @@ -0,0 +1,757 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:cfc2d9c55b511981c268535b9b836c28d1aec92123c8d6e11efaae493bc2b6d5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 : Flow in Pipes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 Page No : 95" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "l= 5000. #ft long\n", + "l1= 2000. #ft\n", + "d= 12. #in diameter\n", + "f= 0.005 # coefficient\n", + "d1= 24 #in diameter\n", + "f1= 0.0045 \n", + "l2= 3000. #ft\n", + "Q= 1800. #gal/min flow\n", + "w= 6.24 #lb/ft**3\n", + "g=32.2 #ft/s**2\n", + "\n", + "#CALCULATIONS\n", + "F= Q/(60*w)\n", + "v1= F*4/(math.pi*(d/12)**2)\n", + "v2= v1/(d1/d)**2\n", + "H= (f*l1*F**2/(10*(d/12)**5))+(f1*l2*F**2/(10*(d1/12)**5))+(v1**2/(4*g))+((v1-v2)**2/(2*g))+(v2**2/(2*g))\n", + "\n", + "#RESULTS\n", + "print 'Available Head = %.2f ft'%(H)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Available Head = 24.74 ft\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 Page No : 96" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "f= 0.01\n", + "h= 42. \t#ft\n", + "l= 3200. \t#ft length\n", + "d= 14. \t#in diameter\n", + "h1= 8. \t#ft\n", + "l1= 1800. \t#ft point\n", + "w= 6.24 \t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "v= math.sqrt(2*g*h/(1+0.5+(4*f*l/(d/12.))))\n", + "h2= h-h1-(v**2/(2*g))-h1-(0.5*v**2/(2*g))-(4*f*l1*v**2/(2*g*(d/12)))\n", + "Q= math.pi*(d/12)**2*v*w*60/4\n", + "\n", + "#RESULTS\n", + "print 'Height of siphon above A = %.2f ft'%(h2)\n", + "print ' Total Discharge = %.f gal/min'%(Q)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Height of siphon above A = 2.13 ft\n", + " Total Discharge = 1974 gal/min\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 Page No : 97" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "H= 950. \t#lb/in**2\n", + "l= 5. \t#miles distance\n", + "d= 4. \t#in\n", + "f= 0.0075 # friction\n", + "p= 92. \t#per cent\n", + "hp= 200. \t#h.p power\n", + "g= 32.2 \t#ft/sec62\n", + "w= 62.4 \t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "H1= H*2.3\n", + "H2= H1*100/p\n", + "Hf= H2-H1\n", + "v= math.sqrt(2*g*(d/12)*Hf/(4*f*l*5280))\n", + "n= hp/(w*v*(H1/550)*math.pi*(d/12)**2/4)\n", + "\n", + "#RESULTS\n", + "print 'number of pipes required = %.2f'%(n)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "number of pipes required = 4.07\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 Page No : 98" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "l= 1.5 \t #miles length\n", + "d= 18. \t #in diameter\n", + "Q= 12.4 \t#/cusecs\n", + "h= 130. \t#ft\n", + "r= 169.\n", + "r1= 338.\n", + "w= 62.4 \t#lb/ft**3\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "f= h*10*l**5/(l*5280*Q**2)\n", + "R= math.sqrt(1.5*r1-r)\n", + "d= math.sqrt(l**2/R*144)\n", + "v= math.sqrt(h*g*2/(r/R**2+1))\n", + "HP= w*0.25*math.pi*(d/12)**2*v**3/(550*2*g)\n", + "\n", + "#RESULTS\n", + "print 'f = %.3f '%(f)\n", + "print ' Diameter of jet d = %.2f in'%(d)\n", + "print ' Water h.p = %.1f h.p'%(HP)\n", + "\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "f = 0.008 \n", + " Diameter of jet d = 4.20 in\n", + " Water h.p = 70.6 h.p\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 Page No : 100" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "l= 5000. \t#ft long\n", + "d= 24. \t #in diameter\n", + "Q= 18. \t#cuses\n", + "t= 10. \t #sec \n", + "P= 275000. \t#lb/in**2\n", + "g= 32.2 \t#ft/sec**2\n", + "w=62.4\n", + "\n", + "#CALCULATIONS\n", + "v= Q/(math.pi*(d/24)**2)\n", + "C= v/(t**2/2)\n", + "Pr= ((l*C*t/g)+(v**2/(2*g)))/2.3\n", + "Pr1= v*12*math.sqrt(w*P/(386.4*1728))\n", + "\n", + "#RESULTS\n", + "print 'Pressure Rise = %.1f lb/in**2'%(Pr)\n", + "print ' Pressure Rise = %d lb/in**2'%(Pr1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure Rise = 77.6 lb/in**2\n", + " Pressure Rise = 348 lb/in**2\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 Page No : 102" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "v= 4. \t#ft/sec velocity\n", + "K= 300000. \t#lb/in**2 water\n", + "d= 6. \t#in\n", + "t= 0.25 \t#in\n", + "E= 30*10**6 \t#lb/in**2\n", + "w= 62.4 \t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "P= math.sqrt((w*v**2/g)/((d/(E*144*t))+(1/(K*144))))/144\n", + "Sm= P*d/(2*t)\n", + "\n", + "#RESULTS\n", + "print 'Hoop stress = %.f lb/in**2'%(Sm)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Hoop stress = 2739 lb/in**2\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7 Page No : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "l1= 19. \t#ft\n", + "l2= 1. \t#ft\n", + "r1= 0.298\n", + "r2= 0.238\n", + "r3= 0.359\n", + "r4= 0.242\n", + "r5= 0.121\n", + "d= 6 \t #in diameter\n", + "\n", + "#CALCULATIONS\n", + "m= -(-r4-math.sqrt(r4**2-4*(3*r1-r5)*(-(d/2)*r2-r3)))/(2*(3*r1-r5))\n", + "v2= math.sqrt((l1+l2)/(r1*m**2-r2))\n", + "v3= m*v2\n", + "Q2= math.pi*v2/d**2\n", + "Q3= math.pi*v3/d**2\n", + "Q= Q2+Q3\n", + "\n", + "#RESULTS\n", + "print 'Q2 = %.3f cusec'%(Q2)\n", + "print ' Q3 = %.2f cusec'%(Q3)\n", + "print ' Total Quantity = %.3f cusecs'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Q2 = 0.711 cusec\n", + " Q3 = 0.96 cusec\n", + " Total Quantity = 1.668 cusecs\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.8 Page No : 106" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "h= 80. \t#ft levels\n", + "f= 0.008 # friction coefficient\n", + "l= 3000. \t#ft long\n", + "r1= 6.07\n", + "r2= 377.5\n", + "r3= 4733. \n", + "r4= 0.0466\n", + "r5= 3220.\n", + "r6= 51.5\n", + "\n", + "#CALCULATIONS\n", + "Q= math.sqrt(h*10/(f*l))\n", + "Q1= math.sqrt(r2+math.sqrt(r2**2-4*r1*r3)/(2*r1))/3\n", + "Q2= Q1-r4*math.sqrt(r5-r6*Q1**2)\n", + "\n", + "#RESULTS\n", + "print 'rate discharge when valve B is closed= %.2f cusecs'%(Q)\n", + "print ' Flow in reservoir= %.2f cusecs'%(Q2)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "rate discharge when valve B is closed= 5.77 cusecs\n", + " Flow in reservoir= 5.13 cusecs\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.9 Page No : 108" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Q= 450. \t#gal/min\n", + "w= 6.24 \t#lb/ft**3\n", + "f= 0.005\n", + "l1= 1000. \t#ft from reservoir A\n", + "l2= 2000. \t#ft from reservoir D\n", + "r1= 1.6\n", + "r2= 4.4\n", + "r3= 0.8\n", + "r4 = 12.85\n", + "h1= 59.1 \t#ft\n", + "h2= 40.19 \t#ft\n", + "v= 1.2 \t #ft/sec\n", + "f= 0.0056\n", + "l= 10 \t #ft below reservoir A\n", + "\n", + "#CALCULATIONS\n", + "Q1= Q/(w*60)\n", + "Q2= (r1+math.sqrt(r1**2+4*r2))/2\n", + "Q3= Q2-Q1\n", + "Q4= (-r3+math.sqrt(r3**2+4*r4))/2\n", + "Q5= Q4+Q1\n", + "d= (f*5500*v**2/(l*(h1-h2)))**0.2*12\n", + "\n", + "#RESULTS\n", + "print 'flow in to reservoir B= %.2f cusecs'%(Q3)\n", + "print ' flow in to reservoir D= %.1f cusecs'%(Q5)\n", + "print ' diameter of MN= %.f in'%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "flow in to reservoir B= 1.84 cusecs\n", + " flow in to reservoir D= 4.4 cusecs\n", + " diameter of MN= 9 in\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.10 Page No : 110" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 2.5 \t#ft\n", + "a= 45. \t#degrees\n", + "Q= 69. \t#cuses\n", + "l= 30. \t#ft\n", + "w= 62.4 \t#lb/ft**3\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "Ps= 0.25*math.pi*d**2*w*l/2240\n", + "Rs= Ps*math.sqrt((1-math.cos(math.radians(a)))*2)\n", + "W= Q*w/2240\n", + "v= Q*4/(math.pi*d**2)\n", + "Rd= W*v*math.sqrt(2*(1-math.cos(math.radians(a))))/g\n", + "Rt= Rs+Rd\n", + "\n", + "#RESULTS\n", + "print 'total resultant thrust = %.3f tons'%(Rt)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total resulmath.tant thrust = 3.782 tons\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.11 Page No : 112" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "r1= 1./3\n", + "r2= 7./12\n", + "l= 5000. \t#ft\n", + "l1= 10000. \t#ft\n", + "d= 27. \t#in\n", + "d1= 18. \t#in\n", + "Q= 10. \t#cuses\n", + "f= 0.006\n", + "\n", + "#CALCULATIONS\n", + "Q2= Q/(math.sqrt(r2/r1)+1)\n", + "Q1= Q-Q2\n", + "H= (f*l*Q**2/(10*(d/12)**5))+(f*l1*Q1**2/(3*10**(d1/12)**5))\n", + "\n", + "#RESULTS\n", + "print 'total difference in head = %.2f ft'%(H)\n", + "\n", + "\n", + "#ANSWER GIVEN IN THE TEXTBOOK IS WRONG\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total difference in head = 5.20 ft\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.12 Page No : 115" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "V= 4. \t #ft/sec\n", + "L= 1225. \t#ft\n", + "l= 1200. \t#ft\n", + "H= 50. \t#ft\n", + "d= 1./3 \t#ft\n", + "f= 0.008\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "a= 2*g*H\n", + "b= (4*f*L/d)+1.5\n", + "c= math.sqrt(a/b)\n", + "d= math.sqrt(a*b)\n", + "T= math.log(math.sqrt((c+V)/(c-V)))*l*2/d\n", + "\n", + "#RESULTS\n", + "print 'time interval for elapse = %.2f sec'%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time interval for elapse = 3.95 sec\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.14 Page No : 119" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "L= 8000. \t#ft\n", + "d= 5. \t#ft\n", + "g= 32.2 \t#ft/sec**2\n", + "d= 5. \t #ft\n", + "l= 250. \t#ft\n", + "b= 100.\n", + "\n", + "#CALCULATIONS\n", + "A= math.pi*0.25*d**2*l-0.5*d**2*b\n", + "V= A*g/L\n", + "\n", + "#RESULTS\n", + "print 'Velocity = %.2f ft/sec'%(V)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Velocity = 14.73 ft/sec\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.15 Page No : 121" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "B= 3. \t#ft\n", + "Cd= 0.6\n", + "g= 32.2 \t#ft/sec**2\n", + "d1= 6. \t #in\n", + "d2= 4. \t#in\n", + "\n", + "#CALCULATIONS\n", + "Q2= 0.428 \t#cuses\n", + "r= math.sqrt((((d1/12)**5)/((d2/12)**5)))\n", + "Q1= r*Q2\n", + "Q= Q1+Q2\n", + "\n", + "#RESULTS\n", + "print 'Total inflow = %.3f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total inflow = 1.607 cuses\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.17 Page No : 124" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "f= 0.007\n", + "l= 30. \t#miles\n", + "Q1= 5.*10**6 \t#gal/day\n", + "w= 6.24 \t #lb/ft**3\n", + "H= 500. \t #ft\n", + "Q2= 7*10**6 \t#gal/day\n", + "\n", + "#CALCULATIONS\n", + "Qi= Q1/(w*24*3600)\n", + "d= (f*l*5280*Qi**2/(10*H))**0.2\n", + "Qe = Q2*Qi/Q1\n", + "x= (30-(H*10*d**5/(f*Qe**2*5280)))*(4./3)\n", + "\n", + "#RESULTS\n", + "print 'diameter of pipes = %.1f ft'%d\n", + "print 'length of new pipe required = %.1f miles'%(x)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "diameter of pipes = 1.8 ft\n", + "length of new pipe required = 19.6 miles\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch7.ipynb b/Problems_In_Hydraulics/ch7.ipynb new file mode 100755 index 00000000..b5eb3280 --- /dev/null +++ b/Problems_In_Hydraulics/ch7.ipynb @@ -0,0 +1,453 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8fbfdaa034f011c9304b20c16adbf915d0a8f58f4b89051b6e8db7227dd1440f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 : Flow Under Varying Head" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 Page No : 139" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from scipy.integrate import quad\n", + "\n", + "#initialisation of variables\n", + "g= 32.2 \t#ft/sec**2\n", + "d= 6. \t#ft\n", + "di= 2. \t #in\n", + "h= 9. \t #ft\n", + "Cd= 0.6\n", + "\n", + "#CALCULATIONS\n", + "def fun(H):\n", + " return H**-0.5*(d/2)**2*math.pi/(Cd*math.pi*math.sqrt(2*g)/144)\n", + "\n", + "\n", + "vec2=quad(fun,0,h)\n", + "T= vec2[0]\n", + "\n", + "#RESULTS\n", + "print 'Time to emptify = %.f sec'%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time to emptify = 1615 sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 Page No : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from scipy.integrate import quad\n", + "\n", + "#initialisation of variables\n", + "d1= 4. \t#ft\n", + "d2= 2. \t #in\n", + "l= 300. \t#ft\n", + "P= 5. \t #lb/in**2\n", + "h1= 3. \t #ft\n", + "h2= 6. \t #ft\n", + "f= 0.01\n", + "\n", + "#CALCULATIONS\n", + "X= P*2.31*10*(d2/12)**5/(f*l)\n", + "A= math.pi*d1**2/4\n", + "\n", + "def fun(h):\n", + " return A*math.sqrt((P*2.31*10*(d2/12)**5/(f*l))-(10*(d2/12)**5*h/(f*l)))/(10*(d2/12)**5/(f*l))/7\n", + "\n", + "vec2=quad(fun,h1,h2)\n", + "T= vec2[0]\n", + "\n", + "#RESULTS\n", + "print 'time for the channel to fall = %.2f sec'%(T)\n", + "\n", + "# rounding error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time for the channel to fall = 689.35 sec\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 Page No : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from scipy.integrate import quad\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 10. \t#in\n", + "l= 15. \t#ft\n", + "di= 3. \t#in\n", + "Cd= 0.62 \n", + "g=32.2\n", + "\n", + "#CALCULATIONS\n", + "def fun(H):\n", + " return -l*2*math.sqrt((d/2)**2-((d/2)-H)**2)/(Cd*(math.pi*(di/12)**2/4)*H**0.5*math.sqrt(2*g))\n", + "\n", + "vec2=quad(fun,0,d/2)\n", + "T= vec2[0]\n", + "secs = -T%60\n", + "mins = -T/60\n", + "#RESULTS\n", + "print 'time for the channel to fall = %d mins and %d seconds'%(mins,secs)\n", + "\n", + "# rounding error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time for the channel to fall = 27 mins and 54 seconds\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 Page No : 142" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from scipy.integrate import quad\n", + "\n", + "#initialisation of variables\n", + "h= 4. \t#ft\n", + "w= 6. \t#ft\n", + "l= 100. \t#yd\n", + "a= 60. \t#degrees\n", + "h1= 3. \t#ft\n", + "h2= 2. \t#ft\n", + "Cd= 0.6\n", + "g=32.2 \t#ft/s**2\n", + "\n", + "#CALCULATIONS\n", + "A= l*3*w\n", + "def fun(H):\n", + " return -A*H**-2.5/(Cd*(8./15)*(math.tan(math.radians(a/2)))*math.sqrt(2*g))\n", + "\n", + "vec2=quad(fun,h1,(h1-h2))\n", + "T= vec2[0]\n", + "\n", + "#RESULTS\n", + "print 'time for the channel to fall = %.f sec'%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time for the channel to fall = 654 sec\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5 Page No : 143" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "A= 1./16 \t#mile**2\n", + "d= 2. \t#ft\n", + "h= 18. \t#ft\n", + "h1= 5. \t#ft\n", + "f= 0.006\n", + "l= 200. \t#ft\n", + "h2= 10. \t#ft\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "X= math.sqrt(1./((1.5+(4*f*l/d))/(2*g)))\n", + "def fun(H):\n", + " return A*5280**2*H**-0.5/(math.pi*d**2*X/4)\n", + "\n", + "vec2=quad(fun,h-h1,h)\n", + "T= vec2[0]\n", + "hours = T/3600\n", + "mins = T%3600/60\n", + "\n", + "#RESULTS\n", + "print 'time for the channel to fall = %d hours and %d mins sec'%(hours,round(mins,-1))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time for the channel to fall = 48 hours and 20 mins sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 Page No : 144" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "l= 8. \t#ft\n", + "b= 6. \t#ft\n", + "h= 10. \t#ft\n", + "r= 3.\n", + "Cd= 0.6\n", + "A1= 36. \t#ft**2\n", + "A2= 12. \t#ft**2\n", + "l1= 6. \t#ft\n", + "h1= 1. \t#ft\n", + "d= 2. \t#in\n", + "g=32.2 \t#ft/s**2\n", + "\n", + "#CALCULATIONS\n", + "def fun(H):\n", + " return H**-0.5/(Cd*(math.pi*(d/12)**2/4)*math.sqrt(2*g)*((1/A1)+(1/A2)))\n", + "\n", + "vec2=quad(fun,0,(b-h1))\n", + "T= vec2[0]\n", + "\n", + "#RESULTS\n", + "print 'time for the levels to become equal = %.f sec'%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time for the levels to become equal = 383 sec\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7 Page No : 145" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "h1= 3. \t#ft\n", + "h2= 4. \t#ft diameter\n", + "r= 0.95 \t#m**-1\n", + "k= 27.65 \t#sec\n", + "Cd= 0.95\n", + "\n", + "#CALCULATIONS\n", + "T= k*(math.log(r*math.sqrt(h2)-1)+(r*math.sqrt(h2)-1))-k*(math.log(r*math.sqrt(h1)-1)+(r*math.sqrt(h1)-1))\n", + "h= ((h2-h1)/Cd)**2\n", + "\n", + "#RESULTS\n", + "print 'Time = %.2f sec'%(T)\n", + "print ' Increase in water level = %.2f ft'%(h)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time = 16.23 sec\n", + " Increase in water level = 1.11 ft\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 Page No : 146" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "t= 75. \t#sec\n", + "h= 10.5 \t#in constant\n", + "h1= 13.5 \t#in\n", + "\n", + "#CALCULATIONS\n", + "r= t*math.pi*math.sqrt(2*h**2)/math.log((math.sqrt(2*h1**2)+h1)/(math.sqrt(2*h**2)-h))\n", + "t= -r*((1/h1)-(1/h))\n", + "\n", + "#RESULTS\n", + "print 'A/K = %.f '%(r)\n", + "print ' Time taken = %.1f sec'%(t)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "A/K = 1737 \n", + " Time taken = 36.8 sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.9 Page No : 148" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "g= 9.8 \t#m/sec**2\n", + "h1= 10. \t#in\n", + "h2= 12. \t#in\n", + "r1= 1.32\n", + "r2= 1.56\n", + "r3= 1.97\n", + "r4= 4.10\n", + "r5= 2.64\n", + "\n", + "#CALCULATIONS\n", + "Q= math.sqrt(32.2)*(h2/18)**1.5\n", + "T= 10**5*(r1+2*r3+r4+4*(r3+r5))/(6*h2*60*60)\n", + "\n", + "#RESULTS\n", + "print 'Actual discharge = %.2f CBH**1.5 cuses'%(Q)\n", + "print ' Time = %.1f hr'%(T)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Actual discharge = 3.09 BH**1.5 cuses\n", + " Time = 10.7 hr\n" + ] + } + ], + "prompt_number": 20 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch8.ipynb b/Problems_In_Hydraulics/ch8.ipynb new file mode 100755 index 00000000..9a5c856c --- /dev/null +++ b/Problems_In_Hydraulics/ch8.ipynb @@ -0,0 +1,296 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:35125badba4aaa9b528697efd91fa6b7acc4c2f1f63bb28106c08928483bd0b9" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 :Viscosity and Viscous Flow" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1 Page No : 157" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "v= 10.01 \t#poise velocity\n", + "g= 32.2 \t#ft/sec**2\n", + "d= 30.48 \t#cm\n", + "w= 453.6 \t#gm\n", + "\n", + "#CALCULATIONS\n", + "M= round(v*d/w,3)\n", + "F= M/g\n", + "\n", + "#RESULTS\n", + "print 'Pound in unit of mass = %.3f lb/ft sec absolute units'%(M)\n", + "print ' Pound in unit of force = %.4f slugs/ft sec'%(F)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pound in unit of mass = 0.673 lb/ft sec absolute units\n", + " Pound in unit of force = 0.0209 slugs/ft sec\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2 Page No : 157" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "W= 20. \t#tons/hr oil\n", + "l= 1000. \t#ft long\n", + "w= 57. \t#lb/ft**3 weighs\n", + "kv= 0.0205 \t#ft**2/sec kinematic viscisity\n", + "d= 6. \t#in diameter\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "Q= W*2240/(3600*w)\n", + "A= math.pi*(d/12)**2/4\n", + "v= Q/A\n", + "R= v*(d/12)/kv\n", + "n= w*kv/g\n", + "P= 32*v*n*l/((d/12)**2*w)\n", + "HP= P*2240*W/(3600*500)\n", + "\n", + "#RESULTS\n", + "print 'Reynolds number = %.1f '%(R)\n", + "print ' H.P required = %.2f hp'%(HP)\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Reynolds number = 27.1 \n", + " H.P required = 2.26 hp\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4 Page No : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "n= 0.0067 \t#poise\n", + "l= 10. \t#ft length\n", + "w= 62. \t#lb/ft**3 density\n", + "d= 1. \t#in\n", + "Q= 2. \t#ft**2/sec\n", + "sm= 13.57\n", + "k1= 0.003\n", + "k2= 0.0725\n", + "r= 0.3\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "n1= n*30.48/453.6\n", + "v= Q*4/(60*math.pi*(d/12)**2)\n", + "RN= v*(d/12)*w/n1\n", + "f= k1+(k2/RN**r)\n", + "hf= 4*f*l*v**2/(2*g*(d/12))\n", + "hl= hf*12/sm\n", + "\n", + "#RESULTS\n", + "print 'Head lost in inches of mercury = %.2f in'%(hl)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Head lost in inches of mercury = 1.37 in\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5 Page No : 160" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "n= 0.91 \t#poise\n", + "g= 32.2 \t#ft/sec\n", + "N= 300. \t#r.p.m\n", + "t= 0.01 \t#in\n", + "r1= 0.25 \t#ft\n", + "r2= 1./6 \t#ft\n", + "\n", + "#CALCULATIONS\n", + "n1= n*30.48/(454*g)\n", + "A= N*2*math.pi/60\n", + "t1= t/12\n", + "hp= math.pi*A**2*n1*(r1**4-r2**4)/(t1*1100)\n", + "\n", + "#RESULTS\n", + "print 'Horse Power lost = %.4f '%(hp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horse Power lost = 0.0201 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.6 Page No : 162" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "vw= 0.3 \t#ft/sec\n", + "dw= 1. \t#in\n", + "da= 12. \t#in\n", + "ww= 62.3 \t#lb/ft**3\n", + "wa= 0.075 \t#lb/ft**3\n", + "nw= 0.01 \t#poise\n", + "na= 0.00018 \t#poise\n", + "\n", + "#CALCULATIONS\n", + "va= vw*dw*ww*na/(nw*da*wa)\n", + "\n", + "#RESULTS\n", + "print 'critical velocity of air = %.3f ft/sec'%(va)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "critical velocity of air = 0.374 ft/sec\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7 Page No : 162" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "dm= 0.75 \t#in\n", + "dt= 0.25 \t#in\n", + "dP= 10.4 \t#lb/in**2\n", + "rd= 0.84\n", + "w= 62.4 \t#lb/ft**3\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "v1= math.sqrt(dP*144*g/(rd*w*((dm/dt)**4-1)))\n", + "Q= math.pi*dm**2*v1*60*w/(4*144*10)\n", + "\n", + "#RESULTS\n", + "print 'Discharge rate = %.1f gal.min'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge rate = 3.9 gal.min\n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/ch9.ipynb b/Problems_In_Hydraulics/ch9.ipynb new file mode 100755 index 00000000..8afae5a1 --- /dev/null +++ b/Problems_In_Hydraulics/ch9.ipynb @@ -0,0 +1,323 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:62ceb66cf48441d19499a6332c57808da0a2f8834a586c75e2d7d1a835c045df" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Impact of Jets" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 Page No : 171" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 2. \t #in\n", + "V= 210. \t#ft/sec\n", + "V1= 50. \t#ft/sec\n", + "g= 32.2 \t#ft/sec**2\n", + "w= 62.4 \t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "M= math.pi*V*w/(4*36*g)\n", + "F= M*V\n", + "dV= V-V1\n", + "M1= math.pi*dV*w/(4*36*g)\n", + "F1= M1*dV\n", + "W= F1*V1\n", + "F2= M*dV\n", + "W1= F2*V1\n", + "\n", + "#RESULTS\n", + "print 'Force on plate = %.f lb'%(F+1)\n", + "print ' Force on plate = %.f lb'%(F1)\n", + "print ' Work done/sec = %.f ft-lb/sec'%(W)\n", + "print ' Force on plate = %.f lb'%(F2)\n", + "print ' Work done/sec = %.f ft-lb/sec'%(round(W1,-3))\n", + "\n", + "#The answer is a bit different due to rounding off error in textbook\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Force on plate = 1865 lb\n", + " Force on plate = 1082 lb\n", + " Work done/sec = 54116 ft-lb/sec\n", + " Force on plate = 1421 lb\n", + " Work done/sec = 71000 ft-lb/sec\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2 Page No : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "v1= 15. \t#ft/sec\n", + "v2= 40. \t#ft/sec\n", + "a= 30. \t#degrees\n", + "b= 150. \t#degrees\n", + "v= 15.27 \t#ft/sec\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "a1= a-math.degrees(math.sin(v1*math.sin(math.radians(b))/v2))\n", + "w= math.cos(math.radians(a1))*v2\n", + "vr= v2*math.sin(math.radians(a1))/math.sin(math.radians(a))\n", + "v1= math.sqrt(v1**2+vr**2-2*v1*vr*math.cos(math.radians(a)))\n", + "r= 180-math.sin(math.radians(a))*vr/v\n", + "w1= v*math.cos(math.radians(r))\n", + "W= v1*(w-w1)/g\n", + "\n", + "#RESULTS\n", + "print 'a = %.2f degrees'%(a1)\n", + "print ' w = %.2f ft/sec'%(w)\n", + "print ' vr = %.2f ft/sec'%(vr)\n", + "print ' v1 = %.2f ft/sec'%(v1)\n", + "print ' w = %.2f ft/sec'%(w)\n", + "print ' Work done per pound = %.2f ft-lb/lb'%(W)\n", + "\n", + "# Note : Answers are different because of rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "a = 19.32 degrees\n", + " w = 37.75 ft/sec\n", + " vr = 26.47 ft/sec\n", + " v1 = 15.42 ft/sec\n", + " w = 37.75 ft/sec\n", + " Work done per pound = 25.39 ft-lb/lb\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 Page No : 173" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "d= 0.5 \t#in\n", + "a= 165. \t#degrees\n", + "W= 7.35 \t#lb\n", + "W1= 500. \t#lb\n", + "t= 148. \t#sec\n", + "g= 32.2 \t#ft/sec**2\n", + "w= 62.3 \t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "Q= W1/(t*w)\n", + "v= Q*16*144/math.pi\n", + "dv= v*(1-math.cos(math.radians(a)))\n", + "F= dv*W1/(t*g)\n", + "r= W/F\n", + "k= (1-(W*t*g/(W1*v)))/math.cos(math.radians(a))\n", + "\n", + "#RESULTS\n", + "print 'k = %.3f '%(k)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "k = 0.788 \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4 Page No : 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "t= 0.25 \t#in\n", + "a= 30. \t#degrees\n", + "w= 480. \t#lb/ft**3\n", + "h= 2. \t#in\n", + "d= 0.5 \t#in\n", + "l= 6. \t#in\n", + "w1= 62.4 \t#lb/ft**3\n", + "g= 32.2 \t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "W= t*l**2*w/1728\n", + "M= w1*math.pi*d**2*math.cos(math.radians(a))/(g*4*144)\n", + "v= math.sqrt(W*(l/2)*math.sin(math.radians(a))/(M*2*(1./math.cos(math.radians(a)))))\n", + "\n", + "#RESULTS\n", + "print 'Velocity of jet = %.1f ft/sec'%(v)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Velocity of jet = 26.6 ft/sec\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.5 Page No : 176" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "V= 90. \t#ft/sec\n", + "a= 30. \t#degrees\n", + "u= 45. \t#ft/sec\n", + "\n", + "#CALCULATIONS\n", + "w= V*math.cos(math.radians(a))\n", + "f= math.sqrt(V**2-w**2)\n", + "tanb= (math.atan(math.radians(f/(w-u))))\n", + "b = math.degrees(math.tan(tanb))\n", + "b = math.degrees(math.atan(b))\n", + "V1= math.sqrt(f**2+(u-f*1./math.tan(math.radians(b)))**2)\n", + "\n", + "#RESULTS\n", + "print \"B = %.2f degrees\"%b\n", + "print 'absolute velocity of water at the exit = %.1f ft/sec'%(V1)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "B = 53.79 degrees\n", + "absolute velocity of water at the exit = 46.6 ft/sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.6 Page No : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "#initialisation of variables\n", + "u= 734. \t#ft/sec\n", + "v= 2000. \t#ft/sec\n", + "g= 32.2 \t#ft/sec**2\n", + "da= 0.019 \t#kg/m**3\n", + "\n", + "#CALCULATIONS\n", + "W= g*v/(v-u)\n", + "A= W/(u*da)\n", + "\n", + "#RESULTS\n", + "print 'Weight of the air = %.1f lb/sec'%(W)\n", + "print ' Area of inlet = %.2f ft**2'%(A)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Weight of the air = 50.9 lb/sec\n", + " Area of inlet = 3.65 ft**2\n" + ] + } + ], + "prompt_number": 23 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Problems_In_Hydraulics/screenshots/1Hydrostatics.png b/Problems_In_Hydraulics/screenshots/1Hydrostatics.png Binary files differnew file mode 100755 index 00000000..816d8250 --- /dev/null +++ b/Problems_In_Hydraulics/screenshots/1Hydrostatics.png diff --git a/Problems_In_Hydraulics/screenshots/4OrificesAndNotches.png b/Problems_In_Hydraulics/screenshots/4OrificesAndNotches.png Binary files differnew file mode 100755 index 00000000..4c71e1c3 --- /dev/null +++ b/Problems_In_Hydraulics/screenshots/4OrificesAndNotches.png diff --git a/Problems_In_Hydraulics/screenshots/7FlowUnderVaryingHead.png b/Problems_In_Hydraulics/screenshots/7FlowUnderVaryingHead.png Binary files differnew file mode 100755 index 00000000..23e7a483 --- /dev/null +++ b/Problems_In_Hydraulics/screenshots/7FlowUnderVaryingHead.png diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter10.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter10.ipynb new file mode 100755 index 00000000..68503d70 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter10.ipynb @@ -0,0 +1,2940 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 10: Functions<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.1, Page number: 320<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#user defined function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 1\n",
+ "y = 2\n",
+ "\n",
+ "#Function definition\n",
+ "def add(a,b):\n",
+ " return a+b\n",
+ "\n",
+ "#Function call\n",
+ "z = add(x,y)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"z = %d\"%(z))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "z = 3"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.2, Page number: 321<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call user-defined function at different places.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definitions\n",
+ "def y():\n",
+ " sys.stdout.write(\" Y\")\n",
+ " return\n",
+ "\n",
+ "def a():\n",
+ " sys.stdout.write(\" A\")\n",
+ " y()\n",
+ " return\n",
+ "\n",
+ "def b():\n",
+ " sys.stdout.write(\" B\")\n",
+ " a()\n",
+ " return\n",
+ "\n",
+ "def c():\n",
+ " a()\n",
+ " b()\n",
+ " sys.stdout.write(\" C\")\n",
+ " return\n",
+ "\n",
+ "def d():\n",
+ " sys.stdout.write(\" D\")\n",
+ " c()\n",
+ " b()\n",
+ " a()\n",
+ " return\n",
+ "\n",
+ "#Function calls\n",
+ "y()\n",
+ "a()\n",
+ "b()\n",
+ "c()\n",
+ "d()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Y A Y B A Y A Y B A Y C D A Y B A Y C B A Y A Y"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.3, Page number: 323<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Using similar variable names in different functions.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def fun():\n",
+ " b = 20\n",
+ " c = 10\n",
+ " sys.stdout.write(\"\\nIn fun() B = %d C = %d\"%(b,c))\n",
+ " return\n",
+ "\n",
+ "#Variable Initialization\n",
+ "b = 10\n",
+ "c = 5\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nIn main() B = %d C = %d\"%(b,c))\n",
+ "fun()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "In main() B = 10 C = 5\n",
+ "In fun() B = 20 C = 10"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.4, Page number: 323<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Global variables on different functions.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Global Variable Initialization\n",
+ "b = 10\n",
+ "c = 5\n",
+ "\n",
+ "def fun():\n",
+ " global b \n",
+ " b += 1\n",
+ " global c \n",
+ " c -= 1\n",
+ " sys.stdout.write(\"\\nIn fun() B = %d C = %d\"%(b,c))\n",
+ " return\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nIn main() B = %d C = %d\"%(b,c))\n",
+ "fun()\n",
+ "b += 1\n",
+ "c -= 1\n",
+ "sys.stdout.write(\"\\nAgain In main() B = %d C = %d\"%(b,c))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "In main() B = 10 C = 5\n",
+ "In fun() B = 11 C = 4\n",
+ "Again In main() B = 12 C = 3"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.5, Page number: 325<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Using return statement in different ways\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def pass1(a):\n",
+ " if a == 0:\n",
+ " return;\n",
+ " else:\n",
+ " return a*a*a\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter value of x : \"))\n",
+ "\n",
+ "#Function call & Result\n",
+ "if x != 1 or x > 0:\n",
+ " y = pass1(x)\n",
+ "\n",
+ "#There is no switch statement in python, so if..else statement\n",
+ "if y == 1:\n",
+ " sys.stdout.write(\"The value returned is %d\"%(y))\n",
+ "else:\n",
+ " sys.stdout.write(\"The Cube of %d is : %d\"%(x,y))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of x : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Cube of 5 is : 125"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.6, Page number: 327<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display message using user defined function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def message():\n",
+ " sys.stdout.write(\"Have a nice day\")\n",
+ "\n",
+ "#function call\n",
+ "message()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Have a nice day"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.7, Page number: 328<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display Alphabets 'A','B' and 'C' using functions\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Functions definitions\n",
+ "def a():\n",
+ " sys.stdout.write(\"\\nA\")\n",
+ " \n",
+ "def b():\n",
+ " sys.stdout.write(\" B\")\n",
+ " \n",
+ "def c():\n",
+ " sys.stdout.write(\" C\")\n",
+ " \n",
+ "#Function call\n",
+ "a()\n",
+ "b()\n",
+ "c()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "A B C"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.8, Page number: 329<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Send value to user defined function and display results\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def dat(x,y,z):\n",
+ " sys.stdout.write(\"Date = %d/%d/%d\"%(x,y,z))\n",
+ " \n",
+ "#Variable Initialization\n",
+ "d = int(raw_input(\"Enter date dd/mm/yy\"))\n",
+ "m = int(raw_input(\"Enter date dd/mm/yy\"))\n",
+ "y = int(raw_input(\"Enter date dd/mm/yy\"))\n",
+ "\n",
+ "#function call & Result\n",
+ "dat(d,m,y)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter date dd/mm/yy12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter date dd/mm/yy12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter date dd/mm/yy2001\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Date = 12/12/2001"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.9, Page number: 330<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Square of number using user defined function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#function definition\n",
+ "def sqr(k):\n",
+ " sys.stdout.write(\"\\n%d\"%(k*k))\n",
+ " \n",
+ "#Variable Initialization\n",
+ "j = 0\n",
+ "\n",
+ "#Function call & Result\n",
+ "for j in range(1,5):\n",
+ " sqr(j)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "1\n",
+ "4\n",
+ "9\n",
+ "16"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.10, Page number: 330<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Pass the value to main() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no main function in python\n",
+ "sys.stdout.write(\"\\nNumber of command line arguments J = %d\"%(len(sys.argv)))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Number of command line arguments J = 6"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.11, Page number: 331<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Pass and return values to user defined function. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definitions\n",
+ "def dat(x,y,z):\n",
+ " sys.stdout.write(\"\\nToday = %d/%d/%d\"%(x,y,z))\n",
+ " x += 1\n",
+ " return x\n",
+ "\n",
+ "#Variable Initialization\n",
+ "d = int(raw_input(\"Enter Date dd/mm/yy : \"))\n",
+ "m = int(raw_input(\"Enter Date dd/mm/yy : \"))\n",
+ "y = int(raw_input(\"Enter Date dd/mm/yy : \"))\n",
+ "\n",
+ "#Function call\n",
+ "t = dat(d,m,y)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nTomorrow = %d/%d/%d\"%(t,m,y))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Date dd/mm/yy : 12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Date dd/mm/yy : 12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Date dd/mm/yy : 2001\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Today = 12/12/2001\n",
+ "Tomorrow = 13/12/2001"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.12, Page number: 332<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Send and recieve values to user defined function \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def sum1(x,y,z):\n",
+ " return x+y+z\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = int(raw_input(\"Enter Three Numbers : \"))\n",
+ "b = int(raw_input(\"Enter Three Numbers : \"))\n",
+ "c = int(raw_input(\"Enter Three Numbers : \"))\n",
+ "\n",
+ "#Function call\n",
+ "s = sum1(a,b,c)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Sum = %d\"%(s))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum = 16"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.13, Page number: 333<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Recieve values from user defined function without passing any \n",
+ "#value through main().\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def sum1():\n",
+ " x = int(raw_input(\"Enter Three Numbers : \"))\n",
+ " y = int(raw_input(\"Enter Three Numbers : \"))\n",
+ " z = int(raw_input(\"Enter Three Numbers : \"))\n",
+ " return x+y+z\n",
+ "\n",
+ "#Function call\n",
+ "s = sum1()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Sum = %d\"%(s))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum = 12"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.14, Page number: 333<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Return value in the form of address.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def sum1():\n",
+ " x = int(raw_input(\"Enter Three Values : \"))\n",
+ " y = int(raw_input(\"Enter Three Values : \"))\n",
+ " z = int(raw_input(\"Enter Three Values : \"))\n",
+ " k = x + y + z\n",
+ " return k\n",
+ "\n",
+ "#There is no pointer concept in python\n",
+ "\n",
+ "#Function call\n",
+ "s = sum1()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Sum = %d\"%(s))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Values : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Values : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Values : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum = 12"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.15, Page number: 334<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call by value\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def change(a,b):\n",
+ " k = a\n",
+ " a = b\n",
+ " b = k\n",
+ " sys.stdout.write(\"\\nIn Change() X = %d Y = %d\"%(a,b))\n",
+ " \n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter Values of X & Y : \"))\n",
+ "y = int(raw_input(\"Enter Values of X & Y : \"))\n",
+ "\n",
+ "#Function call\n",
+ "change(x,y)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nIn main() X = %d Y = %d\"%(x,y))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values of X & Y : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values of X & Y : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "In Change() X = 4 Y = 5\n",
+ "In main() X = 5 Y = 4"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.16, Page number: 335<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call by reference \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def change(a,b):\n",
+ " k = a\n",
+ " a = b\n",
+ " b = k\n",
+ " sys.stdout.write(\"\\nIn Change() X = %d Y = %d\"%(a,b))\n",
+ " \n",
+ "#There is no pointer concept in python\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter Values of X & Y : \"))\n",
+ "y = int(raw_input(\"Enter Values of X & Y : \"))\n",
+ "\n",
+ "#Function call\n",
+ "change(x,y)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nIn main() X = %d Y = %d\"%(y,x))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values of X & Y : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values of X & Y : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "In Change() X = 4 Y = 5\n",
+ "In main() X = 4 Y = 5"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.17, Page number: 336<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Return by reference\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def change(a,b):\n",
+ " c = a + b\n",
+ " d = a - b\n",
+ " return c,d\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter Values of X & Y : \"))\n",
+ "y = int(raw_input(\"Enter Values of X & Y : \"))\n",
+ "\n",
+ "#Function call\n",
+ "add,sub = change(x,y)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nAddition : %d\"%(add))\n",
+ "sys.stdout.write(\"\\nSubtraction : %d\"%(sub))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values of X & Y : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values of X & Y : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Addition : 9\n",
+ "Subtraction : 1"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.18, Page number: 337<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call by value and reference\n",
+ "\n",
+ "k = 0\n",
+ "m = 0\n",
+ "\n",
+ "#Function Definition\n",
+ "def other(k,m):\n",
+ " sys.stdout.write(\"\\nAddress of k & m in other() : %u %u\"%(id(k),id(m)))\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nAddress of k & m in main() : %u %u\"%(id(k),id(m)))\n",
+ "\n",
+ "#Function call\n",
+ "other(k,m)\n",
+ "\n",
+ "#there is no pointer concept in python and it uses value tagged method in data storage\n",
+ "#instead of addressing the memory location, values of same variables are tagged together"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address of k & m in main() : 30922996 30922996\n",
+ "Address of k & m in other() : 30922996 30922996"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.19, Page number: 338<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#User defined function as an argument to another function.\n",
+ "\n",
+ "#Variable Initialization\n",
+ "y = 2\n",
+ "\n",
+ "#Function Definitions\n",
+ "def double(m):\n",
+ " return m*2\n",
+ "\n",
+ "def square(k):\n",
+ " return k*k\n",
+ "\n",
+ "#Function call\n",
+ "x = double(square(y))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"x = %d\"%(x))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 8"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.20, Page number: 338<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Two functions as arguments for another functions\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definitions\n",
+ "def x(a,b):\n",
+ " return abs(a-b)\n",
+ "\n",
+ "def y():\n",
+ " y = int(raw_input(\"Enter First Number : \"))\n",
+ " return y\n",
+ "\n",
+ "def z():\n",
+ " z = int(raw_input(\"Enter Second Number : \"))\n",
+ " return z\n",
+ "\n",
+ "#Function call\n",
+ "d = x(y(),z())\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nz() - y() = %d\"%(d))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter First Number : 25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Second Number : 50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "z() - y() = 25"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.21, Page number: 339<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Return only absolute value like abs() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def uabs(y):\n",
+ " if y < 0:\n",
+ " return y * -1\n",
+ " else:\n",
+ " return y\n",
+ " \n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter a Negative Value : \"))\n",
+ "\n",
+ "#Function call\n",
+ "x = uabs(x)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nX = %d\"%(x))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Negative Value : -5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "X = 5"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.22, Page number: 340<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Square and cube of an entered number. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definitions\n",
+ "def input1(): #Since input() is a built in function in python, input1() is used\n",
+ " k = int(raw_input(\"Number : \"))\n",
+ " return k\n",
+ "\n",
+ "def sqr(m):\n",
+ " sys.stdout.write(\"\\nSquare : %d\"%(m*m))\n",
+ " return m\n",
+ "\n",
+ "def cube(m):\n",
+ " return m*m*m\n",
+ "\n",
+ "#Function call and Result\n",
+ "sys.stdout.write(\"\\nCube : %d\"%(cube(sqr(input1()))))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number : 2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Square : 4\n",
+ "Cube : 8"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.23, Page number: 341<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Assign return value of a function to variable.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def input1():\n",
+ " k = int(raw_input(\"Enter Value of x = \"))\n",
+ " return k\n",
+ "\n",
+ "#Function call\n",
+ "x = input1()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nx = %d\"%(x))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of x = 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "x = 5"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.24, Page number: 342<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Addition and subtraction of numbers with return value of function.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def input1():\n",
+ " k = int(raw_input(\"Enter Value of x = \"))\n",
+ " return k\n",
+ "\n",
+ "def sqr(m):\n",
+ " return pow(m,2)\n",
+ "\n",
+ "#Function call\n",
+ "x = sqr(1 - input1() + 1)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nSquare = %d\"%(x))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of x = 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Square = 9"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.25, Page number: 343<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Multiplication and division of numbers with return value of function.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def input1():\n",
+ " k = int(raw_input(\"Enter Value of x = \"))\n",
+ " return k\n",
+ "\n",
+ "def sqr(m):\n",
+ " return pow(m,2)\n",
+ "\n",
+ "#Function call\n",
+ "x = sqr(5 * input1()/2)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nSquare = %d\"%(x))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of x = 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Square = 144"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.26, Page number: 344<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# ++ operator with return value of function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def input1():\n",
+ " k = int(raw_input(\"Enter Value of x = \"))\n",
+ " return k\n",
+ "\n",
+ "def sqr(m):\n",
+ " return pow(m,2)\n",
+ "\n",
+ "#Function call\n",
+ "#There is no ++ operator in python. so += operator is used\n",
+ "y = input1()\n",
+ "y += 1\n",
+ "x = sqr(y)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nSquare = %d\"%(x))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of x = 7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Square = 64"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.27, Page number: 345<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use mod(%) with function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def j():\n",
+ " x = int(raw_input(\"Enter a Number : \"))\n",
+ " return x\n",
+ " \n",
+ "#Function call & Result\n",
+ "if j() %2 == 0:\n",
+ " sys.stdout.write(\"\\nNumber is Even.\")\n",
+ "else:\n",
+ " sys.stdout.write(\"\\nNumber is Odd.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Number is Odd."
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.28, Page number: 346<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Conditional operator(?) with function.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definitions\n",
+ "def sqr(x):\n",
+ " sys.stdout.write(\"Square \")\n",
+ " return pow(x,2)\n",
+ "\n",
+ "def cube(x):\n",
+ " sys.stdout.write(\"Cube \")\n",
+ " return pow(x,3)\n",
+ "\n",
+ "def y():\n",
+ " return 10\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Function call\n",
+ "z = sqr(x) if x > y() else cube(x)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\" = %d\"%(z))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cube = 125"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.29, Page number: 346<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#compare two return values of functions\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definitions\n",
+ "def a():\n",
+ " x = int(raw_input(\"Enter a Number a() : \"))\n",
+ " return x\n",
+ "\n",
+ "def b():\n",
+ " x = int(raw_input(\"Enter a Number b() : \"))\n",
+ " return x\n",
+ "\n",
+ "#Function call and Result\n",
+ "if a() == b():\n",
+ " sys.stdout.write(\"\\nValue of a() & b() are equal\")\n",
+ "else:\n",
+ " sys.stdout.write(\"\\nValue of a() & b() are unique\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number a() : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number b() : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Value of a() & b() are equal"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.30, Page number: 347<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Evaluate the equation s = sqr(a() + b()) using function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definitions\n",
+ "def a():\n",
+ " a = int(raw_input(\"Enter value of a : \"))\n",
+ " return a\n",
+ "\n",
+ "def b():\n",
+ " b = int(raw_input(\"Enter value of b : \"))\n",
+ " return b\n",
+ "\n",
+ "def sqr(x):\n",
+ " return x*x\n",
+ "\n",
+ "#Function call\n",
+ "s = sqr(a() + b())\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nSquare of Sum = %d\"%(s))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of a : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of b : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Square of Sum = 64"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.31, Page number: 348<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Evaluate the equation y = x^1+x^2..x^n using function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def b(m):\n",
+ " m += 1\n",
+ " #sys.stdout.write(\"%d\"%(m))\n",
+ " return m\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Values of 'x' and 'n' : \"))\n",
+ "n = int(raw_input(\"Values of 'x' and 'n' : \"))\n",
+ "y = 0\n",
+ "z = 1\n",
+ "m = 0\n",
+ "\n",
+ "while(z <= n):\n",
+ " m = b(m)\n",
+ " y = y + pow(x,m)\n",
+ " sys.stdout.write(\"%d + \"%(y))\n",
+ " z += 1\n",
+ " \n",
+ "if z >= n:\n",
+ " sys.stdout.write(\"\\nValue of y = %d\"%(y))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Values of 'x' and 'n' : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Values of 'x' and 'n' : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3 + 12 + 39 + \n",
+ "Value of y = 39"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.32, Page number: 350<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call user defined function through if statement\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def a():\n",
+ " a = int(raw_input(\"Enter value of a :\"))\n",
+ " return a\n",
+ "\n",
+ "#Function call and Result\n",
+ "if a()%2 == 0:\n",
+ " sys.stdout.write(\"\\nThe number is even.\")\n",
+ "else:\n",
+ " sys.stdout.write(\"\\nThe number is odd.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of a :5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The number is odd."
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.33, Page number: 351<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call user defined function through switch() statement\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def a():\n",
+ " c = raw_input(\"Enter Your Choice Square(s), Cube(c), Double(d) : \")\n",
+ " c = c.lower()\n",
+ " return c\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 5\n",
+ "\n",
+ "#There is no switch() statement in python.\n",
+ "c = a()\n",
+ "if c == 's':\n",
+ " sys.stdout.write(\"\\nSquare of %d is %d\"%(x,pow(x,2)))\n",
+ "else:\n",
+ " if c == 'c':\n",
+ " sys.stdout.write(\"\\nCube of %d is %d\"%(x,pow(x,3)))\n",
+ " else:\n",
+ " if c == 'd':\n",
+ " sys.stdout.write(\"\\nDouble of %d is %d\"%(x,x*2))\n",
+ " else:\n",
+ " sys.stdout.write(\"\\nUnexpected Choice printed as it is : %d\"%(x))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Choice Square(s), Cube(c), Double(d) : D\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Double of 5 is 10"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.34, Page number: 353<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call function through the for loop\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def plus(k):\n",
+ " if k == 10:\n",
+ " return 0\n",
+ " else:\n",
+ " return k\n",
+ " \n",
+ "#Variable Initialization\n",
+ "m = 1\n",
+ "\n",
+ "#Function call & Result\n",
+ "#in python, for loop iterates through a range of number. so while loop is used instead.\n",
+ "while plus(m) != 0:\n",
+ " sys.stdout.write(\"%3d\"%(m))\n",
+ " m += 1\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1 2 3 4 5 6 7 8 9"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.35, Page number: 354<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call user defined function through while() loop\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def y():\n",
+ " x = int(raw_input(\"Enter a Number : \"))\n",
+ " return x\n",
+ "\n",
+ "#Function call & Result\n",
+ "while y() != 0:\n",
+ " sys.stdout.write(\"Value enter is non-zero\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value enter is non-zero\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.36, Page number: 355<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call user defined function through do while() loop\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def y():\n",
+ " x = int(raw_input(\"Enter a Number : \"))\n",
+ " return x\n",
+ "\n",
+ "#Function call and Result\n",
+ "#There is no do-while loop in python\n",
+ "\n",
+ "while y() != 0:\n",
+ " sys.stdout.write(\"\\nValue entered is non-zero\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Value entered is non-zero\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.37, Page number: 356<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Initialize an array using functions.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def c(m):\n",
+ " n = int(raw_input(\"Enter Number d[%d]\"%(m+1)))\n",
+ " return n\n",
+ "\n",
+ "#Variable Initialization\n",
+ "d = [c(i) for i in range(0,5)]\n",
+ "\n",
+ "sys.stdout.write(\"\\nArray d[] elements are : \")\n",
+ "for k in range(0,5):\n",
+ " sys.stdout.write(\"%2d\"%d[k])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number d[1]4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number d[2]5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number d[3]6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number d[4]7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number d[5]8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Array d[] elements are : 4 5 6 7 8"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.38, Page number: 357<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Pass array element to the function using call by value method.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def show(m,u):\n",
+ " sys.stdout.write(\"\\nnum[%d] = %d\"%(m+1,u))\n",
+ " \n",
+ "#Variable initialization\n",
+ "num = [12,13,14,15,16,17,18]\n",
+ "\n",
+ "#Function call & Result\n",
+ "for k in range(0,7):\n",
+ " show(k,num[k])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "num[1] = 12\n",
+ "num[2] = 13\n",
+ "num[3] = 14\n",
+ "num[4] = 15\n",
+ "num[5] = 16\n",
+ "num[6] = 17\n",
+ "num[7] = 18"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.39, Page number: 358<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Pass array element to the function using call by reference\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def show(u):\n",
+ " m = 0\n",
+ " sys.stdout.write(\"\\nnum[7] = {\")\n",
+ " while m != 7:\n",
+ " #There is no pointer concept in python\n",
+ " sys.stdout.write(\"%2d,\"%(u[m]))\n",
+ " m += 1\n",
+ " sys.stdout.write(\"\\b}\")\n",
+ " \n",
+ "#Variable Initialization\n",
+ "num = [12,13,14,15,16,17,18]\n",
+ "\n",
+ "#Function call\n",
+ "show(num)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "num[7] = {12,13,14,15,16,17,18,\b}"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.40, Page number: 359<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Array elements in reverse order.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def show(u):\n",
+ " m = 6\n",
+ " while m != -1:\n",
+ " sys.stdout.write(\"\\nnum[%d] = %d\"%(m,u[m]))\n",
+ " m -= 1\n",
+ " \n",
+ "#Variable Initialization\n",
+ "num = [12,13,14,15,16,17,18]\n",
+ "\n",
+ "#Function call\n",
+ "#There is no pointer concept in python\n",
+ "show(num)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "num[6] = 18\n",
+ "num[5] = 17\n",
+ "num[4] = 16\n",
+ "num[3] = 15\n",
+ "num[2] = 14\n",
+ "num[1] = 13\n",
+ "num[0] = 12"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.41, Page number: 360<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy array elements using user defined function.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def cpy(p,m):\n",
+ " j = 0\n",
+ " while j != 5:\n",
+ " m[j] = p[j]\n",
+ " j += 1\n",
+ " \n",
+ "#Variable Initialization\n",
+ "a1 = [1,2,3,4,5]\n",
+ "a2 = [0 for i in range(0,5)]\n",
+ "\n",
+ "#Function call\n",
+ "cpy(a1,a2)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Source Target\")\n",
+ "for h in range(0,5):\n",
+ " sys.stdout.write(\"\\n%5d\\t%d\"%(a1[h],a2[h]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Source Target\n",
+ " 1\t1\n",
+ " 2\t2\n",
+ " 3\t3\n",
+ " 4\t4\n",
+ " 5\t5"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.42, Page number: 361<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read array of other function in main()\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def arry(k):\n",
+ " b = [1,2,3,4,5]\n",
+ " return b[k]\n",
+ "\n",
+ "#main() function\n",
+ "for k in range(0,5):\n",
+ " sys.stdout.write(\"\\t%d\"%(arry(k)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t1\t2\t3\t4\t5"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.43, Page number: 361<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Interchange array elements of two arrays using function.\n",
+ "\n",
+ "import sys\n",
+ "global a\n",
+ "global b\n",
+ "\n",
+ "#Function Definitions\n",
+ "def read():\n",
+ " x = int(raw_input(\"\"))\n",
+ " return x\n",
+ "\n",
+ "def change(a,b):\n",
+ "#Since there is no pointer concept in python, exchange is done in the function using global variables.\n",
+ " for x in range(0,5):\n",
+ " a[x] = a[x] + b[x]\n",
+ " b[x] = a[x] - b[x]\n",
+ " a[x] = a[x] - b[x]\n",
+ " \n",
+ "#Variable Initialization\n",
+ "a = [0 for i in range(0,5)]\n",
+ "b = [0 for i in range(0,5)]\n",
+ "\n",
+ "for x in range(0,10):\n",
+ " if x < 5:\n",
+ " a[x] = read()\n",
+ " else:\n",
+ " b[x-5] = read()\n",
+ "\n",
+ "#Swapping and Result\n",
+ "sys.stdout.write(\"\\nArray A & B \")\n",
+ "\n",
+ "for x in range(0,5):\n",
+ " sys.stdout.write(\"\\n%7d%8d\"%(a[x],b[x]))\n",
+ " \n",
+ "#There is no pointer concept in python.\n",
+ "change(a,b)\n",
+ " \n",
+ "sys.stdout.write(\"\\nNow A & B\")\n",
+ "for x in range(0,5):\n",
+ " sys.stdout.write(\"\\n%7d%8d\"%(a[x],b[x]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Array A & B \n",
+ " 1 6\n",
+ " 2 7\n",
+ " 3 8\n",
+ " 4 9\n",
+ " 5 0\n",
+ "Now A & B\n",
+ " 6 1\n",
+ " 7 2\n",
+ " 8 3\n",
+ " 9 4\n",
+ " 0 5"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.44, Page number: 363<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read array elements declared in different functions using global\n",
+ "#pointer declaration\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def call(j):\n",
+ " m = 0\n",
+ " u = [5,1,6,0,6]\n",
+ " q = u\n",
+ " while m != j:\n",
+ " sys.stdout.write(\"%3d\"%(u[m]))\n",
+ " m += 1\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " \n",
+ "#Variable Initialization\n",
+ "m = 0\n",
+ "k = [3,8,5,2,5]\n",
+ "q = k\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "while m != 5:\n",
+ " sys.stdout.write(\"%3d\"%(q[m]))\n",
+ " m += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\n\")\n",
+ "call(5)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 3 8 5 2 5\n",
+ " 5 1 6 0 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.45, Page number: 364<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sum of 1 to 5 numbers using recursion\n",
+ "\n",
+ "import sys\n",
+ "global s\n",
+ "\n",
+ "s = 0\n",
+ "#Function definition\n",
+ "def main(x,s):\n",
+ " s = s + x\n",
+ " sys.stdout.write(\"\\nx = %d s = %d\"%(x,s))\n",
+ " if x == 5:\n",
+ " return\n",
+ " x += 1\n",
+ " main(x,s)\n",
+ " \n",
+ "main(1,s)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "x = 1 s = 1\n",
+ "x = 2 s = 3\n",
+ "x = 3 s = 6\n",
+ "x = 4 s = 10\n",
+ "x = 5 s = 15"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.46, Page number: 365<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate triangular number of a given number with recursion function method\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def tri_num(m):\n",
+ " f = 0\n",
+ " if m == 0:\n",
+ " return f\n",
+ " else:\n",
+ " f = f + m + tri_num(m-1)\n",
+ " return f\n",
+ "\n",
+ "#Variable Initialization\n",
+ "n = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Function call\n",
+ "t = tri_num(n)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nTriangular number of %d is %d\"%(n,t))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Triangular number of 5 is 15"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.47, Page number: 366<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the given string using recursion\n",
+ "\n",
+ "import sys\n",
+ "import os\n",
+ "global x\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 0\n",
+ "str1 = \"Have a Good Day\"\n",
+ "\n",
+ "#Function Definition\n",
+ "def main(x):\n",
+ " if x == len(str1): #There is no null terminating character in python string\n",
+ " return\n",
+ " else:\n",
+ " if str1[x] == 'H':\n",
+ " os.system('cls')\n",
+ " sys.stdout.write(\"%c\"%(str1[x]))\n",
+ " else:\n",
+ " sys.stdout.write(\"%c\"%(str1[x]))\n",
+ " x += 1\n",
+ " main(x)\n",
+ " \n",
+ "#Function call\n",
+ "main(x)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Have a Good Day"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.48, Page number: 367<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the given string 10 times using recursion\n",
+ "\n",
+ "import sys\n",
+ "import os\n",
+ "\n",
+ "#Function definition\n",
+ "def main(x):\n",
+ " sys.stdout.write(\"\\n%.2d] %s\"%(x,str1))\n",
+ " x += 1\n",
+ " if x == 11:\n",
+ " return\n",
+ " else:\n",
+ " if x == 1:\n",
+ " os.system('cls')\n",
+ " main(x)\n",
+ " else:\n",
+ " main(x)\n",
+ " \n",
+ " \n",
+ "#Variable Initialization\n",
+ "x = 0\n",
+ "str1 = \"Have a Good Day\"\n",
+ "\n",
+ "#Function call\n",
+ "main(x)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "00] Have a Good Day\n",
+ "01] Have a Good Day"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "02] Have a Good Day\n",
+ "03] Have a Good Day\n",
+ "04] Have a Good Day\n",
+ "05] Have a Good Day\n",
+ "06] Have a Good Day\n",
+ "07] Have a Good Day\n",
+ "08] Have a Good Day\n",
+ "09] Have a Good Day\n",
+ "10] Have a Good Day"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.49, Page number: 368<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Factorial using recursive function.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function Definition\n",
+ "def fact(m):\n",
+ " f = 1\n",
+ " if m == 1:\n",
+ " return 1\n",
+ " else:\n",
+ " f = m * fact(m-1)\n",
+ " return f\n",
+ " \n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Function call\n",
+ "f = fact (x)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nFactorial of %d is %d\"%(x,f))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Factorial of 5 is 120"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.50, Page number: 369<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display address of user defined function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def show():\n",
+ " sys.stdout.write(\"\\nAddress of function show() is : \")\n",
+ " \n",
+ "#Function call\n",
+ "show()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"%u\"%(id(show)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address of function show() is : 95041520"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.51, Page number: 369<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call function using pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def show():\n",
+ " sys.stdout.write(\"\\nAddress of function show() is : \")\n",
+ " \n",
+ "#There is no pointer concept in python\n",
+ "p = id(show)\n",
+ "show()\n",
+ "sys.stdout.write(\"%u\"%(id(show)))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address of function show() is : 95041200"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.52, Page number: 370<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the address of library function.\n",
+ "\n",
+ "import sys\n",
+ "import os\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nAddress of printf() is %u\"%(id(sys.stdout.write)))\n",
+ "sys.stdout.write(\"\\nAddress of scanf() is %u\"%(id(sys.stdout.read)))\n",
+ "sys.stdout.write(\"\\nAddress of clrscr() is %u\"%(id(os.system('cls'))))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address of printf() is 60743848\n",
+ "Address of scanf() is 60743848\n",
+ "Address of clrscr() is 4774132"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.53, Page number: 371<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Call main() using pointer to main() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initilization\n",
+ "x = 0\n",
+ "\n",
+ "#Function definition\n",
+ "def main(x):\n",
+ " p = id(main)\n",
+ " x += 1\n",
+ " sys.stdout.write(\"\\nCall %d Address of main() %u\"%(x,id(main)))\n",
+ " if x == 3:\n",
+ " return\n",
+ " main(x)\n",
+ " \n",
+ "#function call\n",
+ "main(x)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Call 1 Address of main() 95040880\n",
+ "Call 2 Address of main() 95040880\n",
+ "Call 3 Address of main() 95040880"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter11.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter11.ipynb new file mode 100755 index 00000000..c8fac375 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter11.ipynb @@ -0,0 +1,446 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 11: Storage Class<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.1, Page number: 376<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Working of auto variable\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Functio definitions\n",
+ "def call1():\n",
+ " v = 20\n",
+ " sys.stdout.write(\"\\nV = %d\"%(v))\n",
+ " \n",
+ "def call2():\n",
+ " v = 30\n",
+ " call1()\n",
+ " sys.stdout.write(\"\\nV = %d\"%(v))\n",
+ " \n",
+ "#Variable Initialization\n",
+ "v = 10\n",
+ "\n",
+ "#Function call\n",
+ "call2()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nV = %d\"%(v))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "V = 20\n",
+ "V = 30\n",
+ "V = 10"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.2, Page number: 376<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Working of auto variables in different blocks\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 10\n",
+ "\n",
+ "sys.stdout.write(\"\\nX = %d\"%(x))\n",
+ "\n",
+ "x = 20\n",
+ "sys.stdout.write(\"\\nX = %d\"%(x))\n",
+ "\n",
+ "x = 10\n",
+ "sys.stdout.write(\"\\nX = %d\"%(x))\n",
+ "\n",
+ "#In python, block of statements are indicated using intendation.\n",
+ "#block of statements can be written for conditional,loop or function statements"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "X = 10\n",
+ "X = 20\n",
+ "X = 10"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.3, Page number: 377<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use same variable in different blocks with different data types\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization & Result\n",
+ "x = 10\n",
+ "sys.stdout.write(\"\\nX = %d\"%(x))\n",
+ "\n",
+ "x = 2.22\n",
+ "sys.stdout.write(\"\\nX = %g\"%(x))\n",
+ "\n",
+ "x = \"Auto Storage Class\"\n",
+ "sys.stdout.write(\"\\nX = %s\"%(x))\n",
+ "\n",
+ "x = 10\n",
+ "sys.stdout.write(\"\\nX = %d\"%(x))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "X = 10\n",
+ "X = 2.22\n",
+ "X = Auto Storage Class\n",
+ "X = 10"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.4, Page number: 378<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Working of external variables\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definitions\n",
+ "def call1():\n",
+ " sys.stdout.write(\"\\nIn Call1() V = %d\"%(v))\n",
+ " \n",
+ "def call2():\n",
+ " sys.stdout.write(\"\\nIn call2() V = %d\"%(v))\n",
+ " \n",
+ "#Variable Initialization\n",
+ "global v\n",
+ "v = 10\n",
+ "\n",
+ "call1()\n",
+ "call2()\n",
+ "sys.stdout.write(\"\\nIn main() V = %d\"%(v))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "In Call1() V = 10\n",
+ "In call2() V = 10\n",
+ "In main() V = 10"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.5, Page number: 379<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Working of auto and global variables with same name\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definitions\n",
+ "def call1():\n",
+ " v = 20\n",
+ " sys.stdout.write(\"\\nIn Call1() V = %d\"%(v))\n",
+ " \n",
+ "def call2():\n",
+ " sys.stdout.write(\"\\nIn call2() V = %d\"%(v))\n",
+ " \n",
+ "#Variable Initialization\n",
+ "global v\n",
+ "v = 10\n",
+ "\n",
+ "#Function call\n",
+ "call1()\n",
+ "call2()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nIn main() V = %d\"%(v))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "In Call1() V = 20\n",
+ "In call2() V = 10\n",
+ "In main() V = 10"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.6, Page number: 380<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Declare external variables using extern keyword\n",
+ "\n",
+ "#Variable Initialization\n",
+ "global m\n",
+ "m = 10\n",
+ "\n",
+ "#There is no extern keyword in python, global is used instead\n",
+ "sys.stdout.write(\"\\nM = %d\"%(m))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "M = 10"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.7, Page number: 380<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of static variable\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def print1(m):\n",
+ " sys.stdout.write(\"\\nm = %d\"%(m))\n",
+ " if m == 3:\n",
+ " return\n",
+ " \n",
+ "m = 0\n",
+ "\n",
+ "for i in range(0,3):\n",
+ " m += 1\n",
+ " print1(m)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "m = 1\n",
+ "m = 2\n",
+ "m = 3"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.8, Page number: 381<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Difference between variables of auto and static class\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "y = 0\n",
+ "sys.stdout.write(\"\\nx = %d & y = %d\"%(x,y))\n",
+ "\n",
+ "#Since x display the junk value which stored already, it differs in different systems"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "x = 10 & y = 0"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.9, Page number: 382<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Register class variable\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no register keyword in python\n",
+ "m = 1\n",
+ "\n",
+ "#Result\n",
+ "for m in range(1,5+1):\n",
+ " sys.stdout.write(\"\\t%d\"%(m))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t1\t2\t3\t4\t5"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.10, Page number: 382<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Register class variable\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no register class variable in python\n",
+ "m = 1\n",
+ "\n",
+ "for m in range(1,6):\n",
+ " sys.stdout.write(\"\\t%d\"%(m))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t1\t2\t3\t4\t5"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter12.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter12.ipynb new file mode 100755 index 00000000..e1acaa2c --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter12.ipynb @@ -0,0 +1,849 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 12: Preprocessor Directives<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.1, Page number: 386<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Area of circle\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Defining the macro\n",
+ "#There is no macro definitions/preprocessors in python\n",
+ "PI = 3.14\n",
+ "\n",
+ "#Variable Initialization\n",
+ "r = float(raw_input(\"Enter radius of circle in cms.\"))\n",
+ "\n",
+ "#Calculation\n",
+ "area = PI * r * r\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Area of a Circle = %.2f cm2\"%(area))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter radius of circle in cms.7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of a Circle = 153.86 cm2"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.2, Page number: 387<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Identifers for 'c' statements and variables\n",
+ "\n",
+ "import sys\n",
+ "import os\n",
+ "\n",
+ "#Macro definitions\n",
+ "#in python, function definitions are used instead of macros\n",
+ "def N():\n",
+ " return 10\n",
+ "\n",
+ "def cls():\n",
+ " os.system('cls')\n",
+ " \n",
+ "def wait():\n",
+ " t = raw_input(\"\")\n",
+ " \n",
+ "def display(s):\n",
+ " sys.stdout.write(s)\n",
+ "\n",
+ "for k in range(1,N()+1):\n",
+ " display(\"%d\\t\"%(k))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.3, Page number: 387<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Macros for logical operators\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Macro definitions\n",
+ "#in python, function definitions are used as macros\n",
+ "\n",
+ "#There is no preprocessors in python\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = int(raw_input(\"Enter Three Numbers : \"))\n",
+ "b = int(raw_input(\"Enter Three Numbers : \"))\n",
+ "c = int(raw_input(\"Enter Three Numbers : \"))\n",
+ "\n",
+ "if a > b and a > c:\n",
+ " sys.stdout.write(\"%d is the larger number\"%(a))\n",
+ "else:\n",
+ " if b > a and b > c:\n",
+ " sys.stdout.write(\"%d is the larger number\"%(b))\n",
+ " else:\n",
+ " if c > a and c > b:\n",
+ " sys.stdout.write(\"%d is the larger number\"%(c))\n",
+ " else:\n",
+ " if a == b and b == c:\n",
+ " sys.stdout.write(\"\\nNumbers are same.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7 is the larger number"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.4, Page number: 388<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Identifier for displaying double and triple of a number.\n",
+ "\n",
+ "#Macro definitions\n",
+ "#Function definitions are used as macros in python\n",
+ "\n",
+ "def DOUBLE(a):\n",
+ " return a*2\n",
+ "\n",
+ "def TRIPLE(a):\n",
+ " return a*3\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nSINGLE\\tDOUBLE\\tTRIPLE\")\n",
+ "\n",
+ "for a in range(1,5+1):\n",
+ " sys.stdout.write(\"\\n%d\\t%d\\t%d\"%(a,DOUBLE(a),TRIPLE(a)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "SINGLE\tDOUBLE\tTRIPLE\n",
+ "1\t2\t3\n",
+ "2\t4\t6\n",
+ "3\t6\t9\n",
+ "4\t8\t12\n",
+ "5\t10\t15"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.5, Page number: 389<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Undefine a macro\n",
+ "\n",
+ "#There is no preprocessor directives in python\n",
+ "\n",
+ "def wait():\n",
+ " return (raw_input(\"\"))\n",
+ "\n",
+ "#Result\n",
+ "for k in range(1,5+1):\n",
+ " sys.stdout.write(\"%d\\t\"%(k))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\t2\t3\t4\t5\t"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.6, Page number: 389<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Stringizing operation\n",
+ "\n",
+ "#Macro definition\n",
+ "#in python, function definition can be used as macro\n",
+ "\n",
+ "def say(m):\n",
+ " sys.stdout.write(m)\n",
+ " \n",
+ "#Function call\n",
+ "say(\"Hello\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.7, Page number: 390<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Stringizing operation and macro arguments\n",
+ "\n",
+ "#There is no macro in python, function definitions can be used as macros\n",
+ "\n",
+ "def DOUBLE(x):\n",
+ " sys.stdout.write(\"Double of m = %d\\n\"%(x*2))\n",
+ " \n",
+ "def TRIPLE(x):\n",
+ " sys.stdout.write(\"Triple of m = %d\\n\"%(x*3))\n",
+ " \n",
+ "#Variable Initialization\n",
+ "m = int(raw_input(\"Enter a number : \"))\n",
+ "\n",
+ "#Function call & Result\n",
+ "DOUBLE(m)\n",
+ "TRIPLE(m)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Double of m = 10\n",
+ "Triple of m = 15\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.8, Page number: 390<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Larger of two numbers using macro with arguments.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Macro definition //function definition itself is used as macro\n",
+ "def MAX(x,y):\n",
+ " if x > y:\n",
+ " c = x\n",
+ " else:\n",
+ " c = y\n",
+ " return c\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 5\n",
+ "y = 8\n",
+ "\n",
+ "#Function call\n",
+ "c = MAX(x,y)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nLarger of two numbers = %d\"%(c))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Larger of two numbers = 8"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.9, Page number: 391<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Function defined in \"udf.c\" file.\n",
+ "\n",
+ "import sys\n",
+ "#since ipython notebook does not support this function, function is used\n",
+ "#in python, the udf.c file can be written and saved in udf.py and import command\n",
+ "#can be used to include that file in this program\n",
+ "\n",
+ "def display():\n",
+ " sys.stdout.write(\"\\nFunction Called\")\n",
+ " \n",
+ "#Function call\n",
+ "display()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Function Called"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.10, Page number: 392<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Conditional compilation \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no preprocessor directives in python\n",
+ "\n",
+ "LINE = 1\n",
+ "\n",
+ "if LINE:\n",
+ " sys.stdout.write(\"This is line number one\")\n",
+ "else:\n",
+ " sys.stdout.write(\"This is line number two\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is line number one"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.11, Page number: 393<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Conditional compilation \n",
+ "import sys\n",
+ "\n",
+ "#There is no preprocessor directives in python\n",
+ "def E():\n",
+ " return 1\n",
+ "\n",
+ "#Function call\n",
+ "if E():\n",
+ " a = 2\n",
+ " b = 3\n",
+ " sys.stdout.write(\"A = %d & B = %d\"%(a,b))\n",
+ "else:\n",
+ " c = 2\n",
+ " d = 3\n",
+ " sys.stdout.write(\"C = %d & D = %d\"%(c,d))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 2 & B = 3"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.12, Page number: 394<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Conditional compilation directives \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no preprocessor directives in python\n",
+ "T = 8\n",
+ "\n",
+ "#Result\n",
+ "if T == 0:\n",
+ " sys.stdout.write(\"\\nMacro is not defined.\")\n",
+ "else:\n",
+ " sys.stdout.write(\"\\nMacro is defined\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Macro is defined"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.13, Page number: 394<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#User defined error message \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no preprocessor directives in python\n",
+ "B = 1\n",
+ "A = 0\n",
+ "\n",
+ "#Result\n",
+ "if A == 0:\n",
+ " sys.stdout.write(\"MACRO A IS NOT DEFINED.\")\n",
+ "else:\n",
+ " sys.stdout.write(\"Macro found.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACRO A IS NOT DEFINED."
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.14, Page number: 397<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Set off certain errors \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no preprocessor directives in python\n",
+ "x = 2\n",
+ "y = 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\ny = %d\"%(y))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "y = 1"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.15, Page number: 398<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Predefined macros \n",
+ "\n",
+ "import sys\n",
+ "import datetime\n",
+ "\n",
+ "#Variable Initialization\n",
+ "FILE = 'PRE_MA~1.C'\n",
+ "LINE = 10\n",
+ "STDC = 1\n",
+ "\n",
+ "#Date/time can be set using datetime.date(2001,5,12)\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nDATE : %s\"%('Dec 05 2001')) \n",
+ "sys.stdout.write(\"\\nTIME : %s\"%(datetime.time(21,7,39)))\n",
+ "sys.stdout.write(\"\\nFILE NAME : %s\"%(FILE))\n",
+ "sys.stdout.write(\"\\nLINE NO : %d\"%(LINE))\n",
+ "sys.stdout.write(\"\\n_STDC_ : %x\"%(STDC))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "DATE : Dec 05 2001\n",
+ "TIME : 21:07:39\n",
+ "FILE NAME : PRE_MA~1.C\n",
+ "LINE NO : 10\n",
+ "_STDC_ : 1"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.16, Page number: 399<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the name of memory model that is currently in use.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no formal memory model and preprocessor directives in python\n",
+ "\n",
+ "TINY = 0\n",
+ "SMALL = 0\n",
+ "MEDIUM = 0\n",
+ "COMPACT = 0\n",
+ "LARGE = 1\n",
+ "HUGE = 0\n",
+ "\n",
+ "#Result\n",
+ "if TINY:\n",
+ " sys.stdout.write(\"\\nTINY %d\"%(TINY))\n",
+ "else:\n",
+ " if SMALL:\n",
+ " sys.stdout.write(\"\\nSMALL %d\"%(SMALL))\n",
+ " else:\n",
+ " if MEDIUM:\n",
+ " sys.stdout.write(\"\\nMEDIUM %d\"%(MEDIUM))\n",
+ " else:\n",
+ " if COMPACT:\n",
+ " sys.stdout.write(\"\\nCOMPACT %d\"%(COMPACT))\n",
+ " else:\n",
+ " if LARGE:\n",
+ " sys.stdout.write(\"\\nLARGE %d\"%(LARGE))\n",
+ " else:\n",
+ " sys.stdout.write(\"\\nHUGE %d\"%(HUGE))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "LARGE 1"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.17, Page number: 400<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Macro expansions\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no preprocessor directives in python\n",
+ "ch = raw_input(\"Input a Text : \")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Text Input : %s\"%(ch))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input a Text : Programming\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text Input : Programming"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.18, Page number: 401<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Predefined macros.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "d = raw_input(\"Enter any character : \")\n",
+ "\n",
+ "#Result\n",
+ "f = d.isalpha()\n",
+ "\n",
+ "if f != 0:\n",
+ " sys.stdout.write(\"\\n%c is a letter in\"%(d))\n",
+ " f = d.isupper()\n",
+ " if f != 0:\n",
+ " sys.stdout.write(\" Capital case\")\n",
+ " else:\n",
+ " sys.stdout.write(\" Small case\")\n",
+ "else:\n",
+ " f = d.isdigit()\n",
+ " if f != 0:\n",
+ " sys.stdout.write(\"\\n%c is a digit\"%(d))\n",
+ " else:\n",
+ " f = d.ispunct()\n",
+ " if f != 0:\n",
+ " sys.stdout.write(\"\\n%c is a punctuation symbol\"%(d))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any character : C\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "C is a letter in Capital case"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter13.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter13.ipynb new file mode 100755 index 00000000..f9222003 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter13.ipynb @@ -0,0 +1,2367 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 13: Structure and Union<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.1, Page number: 409<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display size of structure elements\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class is used instead of structure in python\n",
+ "class book1:\n",
+ " book = ''\n",
+ " pages = 0\n",
+ " price = 0.00\n",
+ "\n",
+ "#Python variables uses value tagged methods for storing the values\n",
+ "\n",
+ "#Class variable declaration\n",
+ "bk1 = book1()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nSize of Structure Elements\")\n",
+ "sys.stdout.write(\"\\nBook : %d\"%(sys.getsizeof(bk1.book)))\n",
+ "sys.stdout.write(\"\\nPages : %d\"%(sys.getsizeof(bk1.pages)))\n",
+ "sys.stdout.write(\"\\nPrice : %d\"%(sys.getsizeof(bk1.price)))\n",
+ "sys.stdout.write(\"\\nTotal Bytes : %d\"%(sys.getsizeof(bk1)))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Size of Structure Elements\n",
+ "Book : 21\n",
+ "Pages : 12\n",
+ "Price : 16\n",
+ "Total Bytes : 36"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.2, Page number: 410<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Define a structure and initialize its member variables\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class book1:\n",
+ " book = ''\n",
+ " pages = 0\n",
+ " price = 0.0\n",
+ " \n",
+ "#Class variable declaration and Initialization\n",
+ "bk1 = book1()\n",
+ "bk1.book = \"C++\"\n",
+ "bk1.pages = 300\n",
+ "bk1.price = 285\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nBook Name : %s\"%(bk1.book))\n",
+ "sys.stdout.write(\"\\nNo. of Pages : %d\"%(bk1.pages))\n",
+ "sys.stdout.write(\"\\nBook Price : %d\"%(bk1.price))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Book Name : C++\n",
+ "No. of Pages : 300\n",
+ "Book Price : 285"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.3, Page number: 411<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy structure elements from one object to another object\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class disk:\n",
+ " co = ''\n",
+ " type1 = 0.0\n",
+ " price = 0\n",
+ " \n",
+ "#Class variable declaration\n",
+ "d1 = disk()\n",
+ "d2 = disk()\n",
+ "d3 = disk()\n",
+ "\n",
+ "#Class variable initialization\n",
+ "d1.co = \"SONY\"\n",
+ "d1.type1 = 1.44\n",
+ "d1.price = 20\n",
+ "\n",
+ "#Copying\n",
+ "d2.co = d1.co\n",
+ "d2.type1 = d1.type1\n",
+ "d2.price = d1.price\n",
+ "\n",
+ "d3 = d2\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\n%s %g %d\"%(d1.co,d1.type1,d1.price))\n",
+ "sys.stdout.write(\"\\n%s %g %d\"%(d2.co,d2.type1,d2.price))\n",
+ "sys.stdout.write(\"\\n%s %g %d\"%(d3.co,d3.type1,d3.price))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "SONY 1.44 20\n",
+ "SONY 1.44 20\n",
+ "SONY 1.44 20"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.4, Page number: 412<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read values and assign them to structure variables\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class book1:\n",
+ " book = ''\n",
+ " pages = 0\n",
+ " price = 0.0\n",
+ " \n",
+ "#Class variable declaration\n",
+ "bk1 = book1()\n",
+ "\n",
+ "#Variable initialization\n",
+ "bk1.book = raw_input(\"Enter Book name,pages,price : \")\n",
+ "bk1.pages = int(raw_input(\"Enter Book name,pages,price : \"))\n",
+ "bk1.price = float(raw_input(\"Enter Book name, pages,price : \"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nBook Name : %s\"%(bk1.book))\n",
+ "sys.stdout.write(\"\\nNo. of Pages : %d\"%(bk1.pages))\n",
+ "sys.stdout.write(\"\\nBook Price : %d\"%(bk1.price))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Book name,pages,price : C\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Book name,pages,price : 500\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Book name, pages,price : 450\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Book Name : C\n",
+ "No. of Pages : 500\n",
+ "Book Price : 450"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.5, Page number: 414<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read and display car details\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class time:\n",
+ " second = 0\n",
+ " minute = 0\n",
+ " hour = 0\n",
+ " \n",
+ "class t:\n",
+ " carno = 0\n",
+ " st = time()\n",
+ " rt = time()\n",
+ " \n",
+ "#Class variable declaration\n",
+ "r1 = t()\n",
+ "\n",
+ "#Variable Initialization\n",
+ "r1.carno = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n",
+ "r1.st.hour = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n",
+ "r1.st.minute = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n",
+ "r1.st.second = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n",
+ "r1.rt.hour = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n",
+ "r1.rt.minute = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n",
+ "r1.rt.second = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nCar No. \\tStarting Time \\tReaching Time\\n\")\n",
+ "sys.stdout.write(\"%d\\t\"%(r1.carno))\n",
+ "sys.stdout.write(\"\\t%d:%d:%d\\t\\t\"%(r1.st.hour,r1.st.minute,r1.st.second))\n",
+ "sys.stdout.write(\"%d:%d:%d\"%(r1.rt.hour,r1.rt.minute,r1.rt.second))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No., Starting Time, Reaching Time :125\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No., Starting Time, Reaching Time :2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No., Starting Time, Reaching Time :50\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No., Starting Time, Reaching Time :30\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No., Starting Time, Reaching Time :3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No., Starting Time, Reaching Time :50\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No., Starting Time, Reaching Time :25\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Car No. \tStarting Time \tReaching Time\n",
+ "125\t\t2:50:30\t\t3:50:25"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.6, Page number: 415<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read and display the details of a person\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class name:\n",
+ " first = ''\n",
+ " second = ''\n",
+ " last = ''\n",
+ " \n",
+ "class b_date:\n",
+ " day = 0\n",
+ " month = 0\n",
+ " year = 0\n",
+ " \n",
+ "class data:\n",
+ " nm = name()\n",
+ " bt = b_date()\n",
+ " \n",
+ "#Class variable declaration\n",
+ "r1 = data()\n",
+ "\n",
+ "#Variable Initialization\n",
+ "r1.nm.first = raw_input(\"Enter Name (First/Second/Last)\")\n",
+ "r1.nm.second = raw_input(\"Enter Name (First/Second/Last)\")\n",
+ "r1.nm.last = raw_input(\"Enter Name (First/Second/Last)\")\n",
+ "r1.bt.day = int(raw_input(\"Enter Birth Date Day/Month/Year\"))\n",
+ "r1.bt.month = int(raw_input(\"Enter Birth Date Day/Month/Year\"))\n",
+ "r1.bt.year = int(raw_input(\"Enter Birth Date Day/Month/Year\"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Name : %s %s %s\\n\"%(r1.nm.first,r1.nm.second,r1.nm.last))\n",
+ "sys.stdout.write(\"Birth Date : %d.%d.%d\"%(r1.bt.day,r1.bt.month,r1.bt.year))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name (First/Second/Last)Ram\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name (First/Second/Last)Sham\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name (First/Second/Last)Pande\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Birth Date Day/Month/Year12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Birth Date Day/Month/Year12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Birth Date Day/Month/Year1980\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name : Ram Sham Pande\n",
+ "Birth Date : 12.12.1980"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.7, Page number: 416<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Create array of structure objects\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class time:\n",
+ " second = 0\n",
+ " minute = 0\n",
+ " hour = 0\n",
+ " \n",
+ "class t:\n",
+ " carno = 0\n",
+ " st = time()\n",
+ " rt = time()\n",
+ " \n",
+ "#Class variable declaration\n",
+ "r1 = [t() for i in range(0,3)]\n",
+ "\n",
+ "#Variable Initialization\n",
+ "for k in range(0,3):\n",
+ " r1[k].carno = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n",
+ " r1[k].st.hour = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n",
+ " r1[k].st.minute = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n",
+ " r1[k].st.second = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n",
+ " r1[k].rt.hour = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n",
+ " r1[k].rt.minute = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n",
+ " r1[k].rt.second = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nCar No.\\t\\tStarting Time\\tReaching Time\")\n",
+ "for k in range(0,3):\n",
+ " sys.stdout.write(\"\\n%d\\t\"%(r1[k].carno))\n",
+ " sys.stdout.write(\"\\t%d:%d:%d\\t\"%(r1[k].st.hour,r1[k].st.minute,r1[k].st.second))\n",
+ " sys.stdout.write(\"\\t%d:%d:%d\\t\"%(r1[k].rt.hour,r1[k].rt.minute,r1[k].rt.second))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)120\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)58\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)121\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)40\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)40\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)122\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)30\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)52\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)40\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Car No.\t\tStarting Time\tReaching Time\n",
+ "120\t\t4:30:52\t\t5:40:10\t\n",
+ "121\t\t4:30:52\t\t5:40:10\t\n",
+ "122\t\t4:30:52\t\t5:40:10\t"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.8, Page number: 417<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read and display student details\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class stud:\n",
+ " name = ''\n",
+ " rollno = 0\n",
+ " grade = ''\n",
+ " \n",
+ "#Class variable declaration\n",
+ "st = [stud() for i in range(0,3)]\n",
+ "\n",
+ "#Variable Initialization\n",
+ "k = 0 \n",
+ "while k < 3:\n",
+ " st[k].name = raw_input(\"Name :\")\n",
+ " st[k].rollno = int(raw_input(\"Roll No. :\"))\n",
+ " st[k].grade = raw_input(\"Grade : \")\n",
+ " k += 1\n",
+ " \n",
+ "#Result\n",
+ "k = 0\n",
+ "sys.stdout.write(\"\\nName \\tRollno \\tGrade\\n\")\n",
+ "while k < 3:\n",
+ " sys.stdout.write(\"\\n%s\\t%d\\t%s\"%(st[k].name,st[k].rollno,st[k].grade))\n",
+ " k += 1\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name :Suresh\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Roll No. :125\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Grade : A\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name :Mahesh\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Roll No. :126\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Grade : B\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name :Rajesh\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Roll No. :127\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Grade : A\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Name \tRollno \tGrade\n",
+ "\n",
+ "Suresh\t125\tA\n",
+ "Mahesh\t126\tB\n",
+ "Rajesh\t127\tA"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.9, Page number: 419<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Pointer to structure \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class book:\n",
+ " name = ''\n",
+ " author = ''\n",
+ " pages = 0\n",
+ " \n",
+ "#Class variable declaration\n",
+ "b1 = book()\n",
+ "\n",
+ "#Variable Initialization\n",
+ "b1.name = \"JAVA COMPLETE REFERENCE\"\n",
+ "b1.author = \"P.NAUGHTON\"\n",
+ "b1.pages = 886\n",
+ "\n",
+ "#There is no pointer concept in python\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\n%s by %s of %d pages\"%(b1.name,b1.author,b1.pages))\n",
+ "sys.stdout.write(\"\\n%s by %s of %d pages\"%(b1.name,b1.author,b1.pages))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "JAVA COMPLETE REFERENCE by P.NAUGHTON of 886 pages\n",
+ "JAVA COMPLETE REFERENCE by P.NAUGHTON of 886 pages"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.10, Page number: 420<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Pointer as members of structure \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class boy:\n",
+ " name = ''\n",
+ " age = 0\n",
+ " height = 0.0\n",
+ " \n",
+ "#Class variable declaration\n",
+ "sp = boy()\n",
+ "\n",
+ "#Variable Initialization\n",
+ "sp.name = \"Mahesh\"\n",
+ "sp.age = 20\n",
+ "sp.height = 5.40\n",
+ "\n",
+ "#There is no pointer concept in python\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nName = %s\"%(sp.name))\n",
+ "sys.stdout.write(\"\\nAge = %s\"%(sp.age))\n",
+ "sys.stdout.write(\"\\nHeight = %s\"%(sp.height))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Name = Mahesh\n",
+ "Age = 20\n",
+ "Height = 5.4"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.11, Page number: 421<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Pointer as members of structure \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class boy:\n",
+ " name = ''\n",
+ " age = 0\n",
+ " height = 0.0\n",
+ " \n",
+ "#Class variable declaration\n",
+ "b = boy()\n",
+ "\n",
+ "#Variable Initialization\n",
+ "nm = \"Somesh\"\n",
+ "ag = 20\n",
+ "ht = 5.40\n",
+ "\n",
+ "#There is no pointer concept in python\n",
+ "b.name = nm\n",
+ "b.age = ag\n",
+ "b.height = ht\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nName : %s\"%(b.name))\n",
+ "sys.stdout.write(\"\\nAge = %d\"%(b.age))\n",
+ "sys.stdout.write(\"\\nHeight = %.2g\"%(b.height))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Name : Somesh\n",
+ "Age = 20\n",
+ "Height = 5.4"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.12, Page number: 422<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the contents of the structure using ordinary pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class num:\n",
+ " a = 0\n",
+ " b = 0\n",
+ " c = 0\n",
+ "\n",
+ "#Class variable declaration\n",
+ "d = num()\n",
+ "\n",
+ "#Variable Initialization\n",
+ "d.a = 2\n",
+ "d.b = 3\n",
+ "d.c = 4\n",
+ "\n",
+ "#There is no pointer concept in python\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\na = %d\"%(d.a))\n",
+ "sys.stdout.write(\"\\nb = %d\"%(d.b))\n",
+ "sys.stdout.write(\"\\nc = %d\"%(d.c))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "a = 2\n",
+ "b = 3\n",
+ "c = 4"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.13, Page number: 423<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Passing address of structure variable\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class book:\n",
+ " name = ''\n",
+ " author = ''\n",
+ " pages = 0\n",
+ " \n",
+ "#Class variable declaration and initialization\n",
+ "b1 = book()\n",
+ "b1.name = \"JAVA COMPLETE REFERENCE\"\n",
+ "b1.author = \"P.NAUGHTON\"\n",
+ "b1.pages = 886\n",
+ "\n",
+ "#Function definition\n",
+ "def show(b1):\n",
+ " sys.stdout.write(\"\\n%s by %s of %d pages\"%(b1.name,b1.author,b1.pages))\n",
+ "\n",
+ "#Function call\n",
+ "show(b1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "JAVA COMPLETE REFERENCE by P.NAUGHTON of 886 pages"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.14, Page number: 424<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Passing structure elements to function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class boy:\n",
+ " name = ''\n",
+ " age = 0\n",
+ " wt = 0\n",
+ " \n",
+ "#Class variable declaration and initialization\n",
+ "b1 = boy()\n",
+ "b1.name = \"Amit\"\n",
+ "b1.age = 20\n",
+ "b1.wt = 25\n",
+ "\n",
+ "#Function definition\n",
+ "def print1(s,t,n):\n",
+ " sys.stdout.write(\"\\n%s %d %d\"%(s,t,n))\n",
+ " \n",
+ "#Function call\n",
+ "print1(b1.name,b1.age,b1.wt)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Amit 20 25"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.15, Page number: 425<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Pass entire structure to user defined function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class boy:\n",
+ " name = ''\n",
+ " age = 0\n",
+ " wt = 0\n",
+ " \n",
+ "#Class variable declaration and initialization\n",
+ "b1 = boy()\n",
+ "b1.name = \"Amit\"\n",
+ "b1.age = 20\n",
+ "b1.wt = 25\n",
+ "\n",
+ "#Function definition\n",
+ "def print1(b):\n",
+ " sys.stdout.write(\"\\n%s %d %d\"%(b.name,b.age,b1.wt))\n",
+ " \n",
+ "#Function call\n",
+ "print1(b1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Amit 20 25"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.16, Page number: 426<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#User defined data type \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no preprocessor directive in python\n",
+ "H = 60\n",
+ "\n",
+ "#There is no typedef function in python and no separate variable declaration is needed\n",
+ "hrs = int(raw_input(\"Enter Hours :\"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nMinutes = %d\"%(hrs*H))\n",
+ "sys.stdout.write(\"\\nSeconds = %d\"%(hrs*H*H))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Hours :2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Minutes = 120\n",
+ "Seconds = 7200"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.17, Page number: 426<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#String data type\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no typedef function in python\n",
+ "a = \" Hello \"\n",
+ "b = raw_input(\"Enter Your Name : \")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"%s %s\"%(a,b))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Name : KAMAL\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Hello KAMAL"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.18, Page number: 427<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Create user defined data type from structure\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "#There is no typedef function in python\n",
+ "class struct:\n",
+ " name = ''\n",
+ " sex = ''\n",
+ " acno = 0\n",
+ " \n",
+ "#class variable declaration and initialization\n",
+ "employee = struct()\n",
+ "employee.name = \"Sanjay\"\n",
+ "employee.sex = \"M\"\n",
+ "employee.acno = 125\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nName\\tSex\\tA/c No.\\n\")\n",
+ "sys.stdout.write(\"%s\\t\"%(employee.name))\n",
+ "sys.stdout.write(\"%s\\t\"%(employee.sex))\n",
+ "sys.stdout.write(\"%s\\n\"%(employee.acno))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Name\tSex\tA/c No.\n",
+ "Sanjay\tM\t125\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.19, Page number: 427<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Create user defined data type from structure\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class struct:\n",
+ " name = ''\n",
+ " sex = ''\n",
+ " acno = 0\n",
+ " \n",
+ "#class Variable declaration and initialization\n",
+ "employee = [struct() for i in range(0,2)]\n",
+ "\n",
+ "for k in range(0,2):\n",
+ " employee[k].name = raw_input(\"Name of the Employee :\")\n",
+ " employee[k].sex = raw_input(\"Sex\")\n",
+ " employee[k].acno = raw_input(\"A/c No.\")\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nName\\tSex\\tA/c No.\\n\")\n",
+ "for k in range(0,2):\n",
+ " sys.stdout.write(\"%s\\t\"%(employee[k].name))\n",
+ " sys.stdout.write(\"%s\\t\"%(employee[k].sex))\n",
+ " sys.stdout.write(\"%s\\n\"%(employee[k].acno))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name of the Employee :AJAY\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SexM\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A/c No.122\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name of the Employee :ANITA\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SexF\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A/c No.124\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Name\tSex\tA/c No.\n",
+ "AJAY\tM\t122\n",
+ "ANITA\tF\t124\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.20, Page number: 429<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Structure containing the details of the employees\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no typedef function in python\n",
+ "\n",
+ "#Class definition\n",
+ "class struct:\n",
+ " first = ''\n",
+ " middle = ''\n",
+ " last = ''\n",
+ " city = ''\n",
+ " pincode = 0\n",
+ " \n",
+ "#Class variable declaration and initialization\n",
+ "person = [struct() for i in range(0,2)]\n",
+ "\n",
+ "for j in range(0,2):\n",
+ " person[j].first = raw_input(\"First Name :\")\n",
+ " person[j].middle = raw_input(\"Middle Name : \")\n",
+ " person[j].last = raw_input(\"Last Name : \")\n",
+ " person[j].city = raw_input(\"City & Pincode\")\n",
+ " person[j].pincode = int(raw_input(\"City & Pincode\"))\n",
+ " \n",
+ "#Result\n",
+ "for j in range(0,2):\n",
+ " sys.stdout.write(\"\\nRecord No : %d\"%(j+1))\n",
+ " sys.stdout.write(\"\\nFirst Name : %s\"%(person[j].first))\n",
+ " sys.stdout.write(\"\\nMiddle Name : %s\"%(person[j].middle))\n",
+ " sys.stdout.write(\"\\nLast Name : %s\"%(person[j].last))\n",
+ " sys.stdout.write(\"\\nCity & Pincode : %s - %d\\n\"%(person[j].city,person[j].pincode))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "First Name :Jay\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Middle Name : Mohan\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Last Name : Deshmukh\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "City & PincodeNanded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "City & Pincode431602\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "First Name :Vijay\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Middle Name : Kamal\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Last Name : Nandedkar\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "City & PincodeNanded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "City & Pincode431602\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Record No : 1\n",
+ "First Name : Jay\n",
+ "Middle Name : Mohan\n",
+ "Last Name : Deshmukh\n",
+ "City & Pincode : Nanded - 431602\n",
+ "\n",
+ "Record No : 2\n",
+ "First Name : Vijay\n",
+ "Middle Name : Kamal\n",
+ "Last Name : Nandedkar\n",
+ "City & Pincode : Nanded - 431602\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.21, Page number: 431<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Information of vehicles\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "PETROL = 1\n",
+ "DISEL = 2\n",
+ "TWO_WH = 3\n",
+ "FOUR_WH = 4\n",
+ "OLD = 5\n",
+ "NEW = 6\n",
+ "\n",
+ "#Class declaration\n",
+ "class vehicle:\n",
+ " type1 = 3\n",
+ " fuel = 2\n",
+ " model = 3\n",
+ " \n",
+ "#Class variable declaration and initialization\n",
+ "v = vehicle()\n",
+ "v.type1 = FOUR_WH\n",
+ "v.fuel = DISEL\n",
+ "v.model = OLD\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nType of Vehicle : %d\"%(v.type1))\n",
+ "sys.stdout.write(\"\\nFuel : %d\"%(v.fuel))\n",
+ "sys.stdout.write(\"\\nModel : %d\"%(v.model))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Type of Vehicle : 4\n",
+ "Fuel : 2\n",
+ "Model : 5"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.22, Page number: 432<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the examination result of the student \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "#There is no preprocessor directives in python\n",
+ "PASS = 1\n",
+ "FAIL = 0\n",
+ "A = 0\n",
+ "B = 1\n",
+ "C = 2\n",
+ "\n",
+ "#Class declaration\n",
+ "class student:\n",
+ " name = ''\n",
+ " result = 1\n",
+ " grade = 2\n",
+ " \n",
+ "#Class variable declaration and initialization\n",
+ "v = student()\n",
+ "\n",
+ "v.name = \"Sachin\"\n",
+ "v.result = PASS\n",
+ "v.grade = C\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nName : %s\"%(v.name))\n",
+ "sys.stdout.write(\"\\nResult : %d\"%(v.result))\n",
+ "sys.stdout.write(\"\\nGrade : %d\"%(v.grade))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Name : Sachin\n",
+ "Result : 1\n",
+ "Grade : 2"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.23, Page number: 433<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Enumerated data type for 12 months\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no enumerated data type in python and an alternate is to use class\n",
+ "#Class declaration\n",
+ "class month:\n",
+ " Jan = 0\n",
+ " Feb = 1\n",
+ " Mar = 2\n",
+ " Apr = 3\n",
+ " May = 4\n",
+ " June = 5\n",
+ " July = 6\n",
+ " Aug = 7\n",
+ " Sep = 8\n",
+ " Oct = 9\n",
+ " Nov = 10\n",
+ " Dec = 11\n",
+ " \n",
+ "#Class variable declaration\n",
+ "c = month()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nJan = %d\"%(c.Jan))\n",
+ "sys.stdout.write(\"\\nFeb = %d\"%(c.Feb))\n",
+ "sys.stdout.write(\"\\nJune = %d\"%(c.June))\n",
+ "sys.stdout.write(\"\\nDec = %d\"%(c.Dec))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Jan = 0\n",
+ "Feb = 1\n",
+ "June = 5\n",
+ "Dec = 11"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.24, Page number: 434<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Enumerated data type \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no enumerated data type in python and an alternate is to use class\n",
+ "#Class declaration\n",
+ "class month:\n",
+ " Jan = 1\n",
+ " Feb = 2\n",
+ " Mar = 3\n",
+ " Apr = 4\n",
+ " May = 5\n",
+ " June = 6\n",
+ " July = 7\n",
+ " Aug = 8\n",
+ " Sep = 9\n",
+ " Oct = 10\n",
+ " Nov = 11\n",
+ " Dec = 12\n",
+ " \n",
+ "#Class variable declaration\n",
+ "c = month()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nJan = %d\"%(c.Jan))\n",
+ "sys.stdout.write(\"\\nFeb = %d\"%(c.Feb))\n",
+ "sys.stdout.write(\"\\nJune = %d\"%(c.June))\n",
+ "sys.stdout.write(\"\\nDec = %d\"%(c.Dec))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Jan = 1\n",
+ "Feb = 2\n",
+ "June = 6\n",
+ "Dec = 12"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.25, Page number: 434<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display name of month using enumerated data type\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no enumerated data type in python and an alternate is to use class\n",
+ "#Class declaration\n",
+ "class month:\n",
+ " Jan = 1\n",
+ " Feb = 2\n",
+ " Mar = 3\n",
+ " Apr = 4\n",
+ " May = 5\n",
+ " June = 6\n",
+ " July = 7\n",
+ " Aug = 8\n",
+ " Sep = 9\n",
+ " Oct = 10\n",
+ " Nov = 11\n",
+ " Dec = 12\n",
+ " \n",
+ "#Class variable declaration\n",
+ "c = month()\n",
+ "\n",
+ "#Result\n",
+ "for f in range(c.Jan,c.Dec+1):\n",
+ " #There is no switch case statement in python\n",
+ " if f == c.Jan:\n",
+ " sys.stdout.write(\"\\nJanuary\")\n",
+ " else:\n",
+ " if f == c.Feb:\n",
+ " sys.stdout.write(\"\\nFebruary\")\n",
+ " else:\n",
+ " if f == c.Mar:\n",
+ " sys.stdout.write(\"\\nMarch\")\n",
+ " else:\n",
+ " if f == c.Apr:\n",
+ " sys.stdout.write(\"\\nApril\")\n",
+ " else:\n",
+ " if f == c.May:\n",
+ " sys.stdout.write(\"\\nMay\")\n",
+ " else:\n",
+ " if f == c.June:\n",
+ " sys.stdout.write(\"\\nJune\")\n",
+ " else:\n",
+ " if f == c.July:\n",
+ " sys.stdout.write(\"\\nJuly\")\n",
+ " else:\n",
+ " if f == c.Aug:\n",
+ " sys.stdout.write(\"\\nAugust\")\n",
+ " else:\n",
+ " if f == c.Sep:\n",
+ " sys.stdout.write(\"\\nSeptember\")\n",
+ " else:\n",
+ " if f == c.Oct:\n",
+ " sys.stdout.write(\"\\nOctober\")\n",
+ " else:\n",
+ " if f == c.Nov:\n",
+ " sys.stdout.write(\"\\nNovember\")\n",
+ " else:\n",
+ " sys.stdout.write(\"\\nDecember\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "January\n",
+ "February\n",
+ "March\n",
+ "April\n",
+ "May\n",
+ "June\n",
+ "July\n",
+ "August\n",
+ "September\n",
+ "October\n",
+ "November\n",
+ "December"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.26, Page number: 436<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Enumerated data type\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no enumerated data type in python. class is used instead\n",
+ "class capital:\n",
+ " Mumbai = 0\n",
+ " Hyderabad = 1\n",
+ " Bangalore = 2\n",
+ "\n",
+ "class state:\n",
+ " name = ''\n",
+ " c = capital()\n",
+ " \n",
+ "#Class variable declaration\n",
+ "s = state()\n",
+ "c1 = capital()\n",
+ "\n",
+ "#Class variable initialization\n",
+ "s.name = \"Andhra Pradesh\"\n",
+ "s.c = s.c.Hyderabad\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nState : %s\"%(s.name))\n",
+ "sys.stdout.write(\"\\nCapital : %d\"%(s.c))\n",
+ "\n",
+ "if s.c == c1.Hyderabad:\n",
+ " sys.stdout.write(\"\\nHyderabad is Capital of %s\"%(s.name))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "State : Andhra Pradesh\n",
+ "Capital : 1\n",
+ "Hyderabad is Capital of Andhra Pradesh"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.27, Page number: 437<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Identify the type of entered character using enumerated data type.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration instead of enumerated data type\n",
+ "class ctype:\n",
+ " Letter = 0\n",
+ " Digit = 1\n",
+ " Other = 2\n",
+ " \n",
+ "#Variable Initialization\n",
+ "ch = raw_input(\"Enter any character\")\n",
+ "c = ctype()\n",
+ "f = ch.isalpha()\n",
+ "\n",
+ "#Result\n",
+ "if f != 0:\n",
+ " sys.stdout.write(\"\\n%c is %d type of symbol\"%(ch,c.Letter))\n",
+ "else:\n",
+ " f = ch.isdigit()\n",
+ " if f != 0:\n",
+ " sys.stdout.write(\"\\n%c is %d type of symbol\"%(ch,c.Digit))\n",
+ " else:\n",
+ " sys.stdout.write(\"\\n%c is %d type of symbol\"%(ch,c.Other))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any character=\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "= is 2 type of symbol"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.28, Page number: 438<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Size of union and number of bytes reserved for it\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no union/structure in python. class is used instead\n",
+ "#Class declaration\n",
+ "class result:\n",
+ " marks = 0\n",
+ " grade = ''\n",
+ " \n",
+ "class res:\n",
+ " name = ''\n",
+ " age = 0\n",
+ " perf = result()\n",
+ " \n",
+ "#Class variable declaration\n",
+ "data = res()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Size of Union : %d\\n\"%(sys.getsizeof(data.perf)))\n",
+ "sys.stdout.write(\"Size of Structure : %d\\n\"%(sys.getsizeof(data)))\n",
+ "\n",
+ "#in python, value tagged method is used for data storage and can represent large numbers"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Size of Union : 36\n",
+ "Size of Structure : 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.29, Page number: 440<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Memory size of the computer\n",
+ "\n",
+ "import psutil\n",
+ "\n",
+ "psutil.phymem_usage()\n",
+ "\n",
+ "#Displays current status of the memory\n",
+ "#different systems will have different memory status"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "pyout",
+ "prompt_number": 4,
+ "text": [
+ "usage(total=1600512000L, used=1496383488L, free=104128512L, percent=93.5)"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.30, Page number: 440<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the system time at specified cursor position\n",
+ "\n",
+ "import sys\n",
+ "import datetime\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"%s\"%(datetime.datetime.now()))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2013-09-20 11:04:15.649000"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.31, Page number: 441<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Change the cursor in different sizes\n",
+ "\n",
+ "import turtle\n",
+ "#Ipython supports graphics through turtle module\n",
+ "\n",
+ "from Tkinter import *\n",
+ "import Tkinter\n",
+ "\n",
+ "top = Tkinter.Tk()\n",
+ "\n",
+ "B1 = Tkinter.Button(top, text =\"circle\", relief=RAISED,\\\n",
+ " cursor=\"circle\")\n",
+ "B2 = Tkinter.Button(top, text =\"plus\", relief=RAISED,\\\n",
+ " cursor=\"plus\")\n",
+ "B1.pack()\n",
+ "B2.pack()\n",
+ "#top.mainloop()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.32, Page number: 441<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Create a directory using dos interrupt\n",
+ "\n",
+ "import os\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "dir1 = raw_input(\"Enter Directory Name : \")\n",
+ "\n",
+ "#Result\n",
+ "if not os.path.exists(dir1):\n",
+ " os.makedirs(dir1)\n",
+ " sys.stdout.write(\"Directory %s created\"%(dir1))\n",
+ "else:\n",
+ " sys.stdout.write(\"Directory %s not created\"%(dir1))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Directory XYZ created"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.33, Page number: 442<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the given character on the screen\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "dl = 67\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"%c\"%(chr(dl)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.34, Page number: 442<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the attributes of a file using DOS interrupt\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "import os\n",
+ "\n",
+ "print os.stat(\"IO.SYS\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "nt.stat_result(st_mode=33206, st_ino=0L, st_dev=0, st_nlink=0, st_uid=0, st_gid=0, st_size=0L, st_atime=1383454467L, st_mtime=1383454467L, st_ctime=1383454467L)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.35, Page number: 444<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Delete a file using dos interrupt\n",
+ "\n",
+ "import os\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "file1 = raw_input(\"Enter a file name : \")\n",
+ "\n",
+ "try:\n",
+ " os.remove(file1)\n",
+ " sys.stdout.write(\"File successfully deleted\")\n",
+ "except:\n",
+ " sys.stdout.write(\"File could not be deleted\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "File successfully deleted"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.36, Page number: 445<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Structuret within union\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#there is no union/structure in python. class is used instead\n",
+ "#Class declaration\n",
+ "class x:\n",
+ " f = 0.0\n",
+ " p = ['' for i in range(0,2)]\n",
+ " \n",
+ "class z:\n",
+ " set1 = x()\n",
+ " \n",
+ "#Class variable declaration and initialization\n",
+ "st = z()\n",
+ "\n",
+ "st.set1.f = 5.5\n",
+ "st.set1.p[0] = 65\n",
+ "st.set1.p[1] = 66\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\n%g\"%(st.set1.f))\n",
+ "sys.stdout.write(\"\\n%c\"%(st.set1.p[0]))\n",
+ "sys.stdout.write(\"\\n%c\"%(st.set1.p[1]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "5.5\n",
+ "A\n",
+ "B"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter14.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter14.ipynb new file mode 100755 index 00000000..409585bd --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter14.ipynb @@ -0,0 +1,2311 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 14: Files<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.1, Page number: 454<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Write data to text file and read it\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','a')\n",
+ "\n",
+ "#Write data to file if successfully created the file\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Cannot open file\")\n",
+ "else:\n",
+ " sys.stdout.write(\"Write data & to stop press '.'\")\n",
+ " c = ''\n",
+ " while c != '.':\n",
+ " c = raw_input(\"Write data & to stop press '.'\")\n",
+ " fp.write(c)\n",
+ " fp.close()\n",
+ "\n",
+ " #Read and display the contents of file\n",
+ " sys.stdout.write(\"\\nContents read : \")\n",
+ " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n",
+ " f = fp.readlines()\n",
+ " for f1 in f:\n",
+ " print f1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Write data & to stop press '.'"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Write data & to stop press '.'ABCDEFGHIJK\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Write data & to stop press '.'.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Contents read : ABCDEFGHIJK.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.2, Page number: 455<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the contents of the file before and after appending.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file for read data\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n",
+ "\n",
+ "#Read and display the contents of file\n",
+ "sys.stdout.write(\"\\nContents of file before appending :\\n\")\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n",
+ "f = fp.readlines()\n",
+ "for f1 in f:\n",
+ " print f1\n",
+ "\n",
+ "#Open file for appending\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','a')\n",
+ "\n",
+ "if f == 0:\n",
+ " sys.stdout.write(\"File can not appended\")\n",
+ "else:\n",
+ " c = ''\n",
+ " #fp.write('\\n')\n",
+ " while c != '.':\n",
+ " c = raw_input(\"Enter string to append\")\n",
+ " fp.write(c)\n",
+ " \n",
+ " fp.close()\n",
+ " \n",
+ " #Read and display the contents of file\n",
+ " sys.stdout.write(\"\\nContents of file After appending\\n\")\n",
+ " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n",
+ " f = fp.readlines()\n",
+ " for f1 in f:\n",
+ " print f1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Contents of file before appending :\n",
+ "String is terminated with '\\0'.\n",
+ "\n",
+ "Contents of file After appending\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "String is terminated with '\\0'.This character is called as NULL character.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.3, Page number: 457<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Writing and reading of a file.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','w+')\n",
+ "\n",
+ "#Write data to file if successfully created the file\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Cannot open file\")\n",
+ "else:\n",
+ " sys.stdout.write(\"Write data & to stop press '.'\")\n",
+ " c = ''\n",
+ " while c != '.':\n",
+ " c = raw_input(\"Write data & to stop press '.'\")\n",
+ " fp.write(c)\n",
+ " fp.close()\n",
+ "\n",
+ " #Read and display the contents of file\n",
+ " sys.stdout.write(\"\\nContents read : \")\n",
+ " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n",
+ " f = fp.readlines()\n",
+ " for f1 in f:\n",
+ " print f1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Write data & to stop press '.'\n",
+ "Contents read : "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ABCDEFGHIJK.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.4, Page number: 458<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Open a file in append mode and add new records in it.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','a+')\n",
+ "\n",
+ "#Write data to file if successfully created the file\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Cannot open file\")\n",
+ "else:\n",
+ " sys.stdout.write(\"Write data & to stop press '.'\")\n",
+ " c = ''\n",
+ " while c != '.':\n",
+ " c = raw_input(\"Write data & to stop press '.'\")\n",
+ " fp.write(c)\n",
+ " fp.close()\n",
+ "\n",
+ " #Read and display the contents of file\n",
+ " sys.stdout.write(\"\\nContents read : \")\n",
+ " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','a+')\n",
+ " f = fp.readlines()\n",
+ " for f1 in f:\n",
+ " print f1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Write data & to stop press '.'\n",
+ "Contents read : "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is append and read mode.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.5, Page number: 459<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Open a file in read/write mode in it\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r+')\n",
+ "\n",
+ "#Write data to file if successfully created the file\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Cannot open file\")\n",
+ "else:\n",
+ " #Read and display the contents of file\n",
+ " sys.stdout.write(\"\\nContents read : \")\n",
+ " f = fp.readlines()\n",
+ " for f1 in f:\n",
+ " print f1\n",
+ " \n",
+ " sys.stdout.write(\"Write data & to stop press '.'\")\n",
+ " c = ''\n",
+ " while c != '.':\n",
+ " c = raw_input(\"Write data & to stop press '.'\")\n",
+ " fp.write(c)\n",
+ " fp.close()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Contents read : Help me.\n",
+ "Write data & to stop press '.'"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.6, Page number: 460<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Open a file for read/write operation in binary mode\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','wb')\n",
+ "\n",
+ "#Write data to file if successfully created the file\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Cannot open file\")\n",
+ "else:\n",
+ " sys.stdout.write(\"Write data & to stop press '.'\")\n",
+ " c = ''\n",
+ " while c != '.':\n",
+ " c = raw_input(\"Write data & to stop press '.'\")\n",
+ " fp.write(c)\n",
+ " fp.close()\n",
+ "\n",
+ " #Read and display the contents of file\n",
+ " sys.stdout.write(\"\\nContents read : \")\n",
+ " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','rb')\n",
+ " f = fp.readlines()\n",
+ " for f1 in f:\n",
+ " print f1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Write data & to stop press '.'\n",
+ "Contents read : "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ABCDEFGHIJK.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.7, Page number: 462<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Open a text file and write some text \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','w')\n",
+ "\n",
+ "#Read the string\n",
+ "text = raw_input(\"Enter Text Here : \")\n",
+ "\n",
+ "#Write to the file\n",
+ "#fp.write() is the equivalent function for fprintf() in python\n",
+ "fp.write(\"%s\"%(text))\n",
+ "\n",
+ "#To see the result, open the data.txt file"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.8, Page number: 463<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Enter data into the text file and read the same. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','w')\n",
+ "\n",
+ "#Read the data\n",
+ "text = raw_input(\"Name & Age\")\n",
+ "age = int(raw_input(\"Name & Age\"))\n",
+ "\n",
+ "#Write to file\n",
+ "fp.write(\"%s %d\"%(text,age))\n",
+ "\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n",
+ "#Result\n",
+ "sys.stdout.write(\"Name\\tAge\\n\")\n",
+ "text = fp.read()\n",
+ "age = fp.read()\n",
+ "sys.stdout.write(\"%s\\t%s\\n\"%(text,age))\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name\tAge\n",
+ "AMIT 12\t\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.9, Page number: 463<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the contents of the file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "f = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\list.txt','r')\n",
+ "\n",
+ "if f == 0:\n",
+ " sys.stdout.write(\"Cannot open file\")\n",
+ "else:\n",
+ " for c in f:\n",
+ " sys.stdout.write(\"%s\"%(c))\n",
+ " #Python gives iterative statements there is no getc() fucntion"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "aman\n",
+ "akash\n",
+ "amit\n",
+ "ajay\n",
+ "ankit"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.10, Page number: 464<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Write some text into the file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\words.doc','w')\n",
+ "\n",
+ "#Write data to file\n",
+ "c = ''\n",
+ "while c != '*':\n",
+ " c = raw_input(\"Enter Few Words '*' to Exit\")\n",
+ " fp.write(c)\n",
+ "\n",
+ "fp.close()\n",
+ " #There is no putc() function in python\n",
+ " #Open the file to see the result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.11, Page number: 465<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count\n",
+ "\n",
+ "# Total number of statements\n",
+ "# Total number of included files\n",
+ "# Total number of blocks and brackets\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fs = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\PRG2.C','r')\n",
+ "\n",
+ "#variable initialization\n",
+ "i = 0\n",
+ "c = 0\n",
+ "sb = 0\n",
+ "b = 0\n",
+ "\n",
+ "if fs == 0:\n",
+ " sys.stdout.write(\"File opening error\")\n",
+ "else:\n",
+ " for line in fs:\n",
+ " k = 0\n",
+ " while k < len(line):\n",
+ " if line[k] == ';':\n",
+ " c += 1\n",
+ " else:\n",
+ " if line[k] == '{':\n",
+ " sb += 1\n",
+ " else:\n",
+ " if line[k] == '(':\n",
+ " b += 1\n",
+ " else:\n",
+ " if line[k] == '#':\n",
+ " i += 1\n",
+ " k += 1\n",
+ " \n",
+ " #Result\n",
+ " sys.stdout.write(\"\\nSummary of 'C' Program\\n\")\n",
+ " sys.stdout.write(\"===========================\")\n",
+ " sys.stdout.write(\"\\nTotal Statments : %d\"%(c+i))\n",
+ " sys.stdout.write(\"\\nInclude Statements : %d\"%(i))\n",
+ " sys.stdout.write(\"\\nTotal Blocks {} : %d\"%(sb))\n",
+ " sys.stdout.write(\"\\nTotal Brackets () : %d\"%(b))\n",
+ " sys.stdout.write(\"\\n============================\")\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Summary of 'C' Program\n",
+ "===========================\n",
+ "Total Statments : 8\n",
+ "Include Statements : 2\n",
+ "Total Blocks {} : 2\n",
+ "Total Brackets () : 9\n",
+ "============================"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.12, Page number: 466<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Write text to a file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\lines.txt','w')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"\")\n",
+ "else:\n",
+ " #Write data to file\n",
+ " c = ''\n",
+ " while c != '*':\n",
+ " c = raw_input(\"\")\n",
+ " fp.write(c)\n",
+ " fp.close()\n",
+ " #There is no fputc() function in python\n",
+ " #Open the file to see the result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.13, Page number: 467<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read text from the given file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "\n",
+ "file1 = raw_input(\"Enter File Name : \")\n",
+ "fp = open(file1,'r')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"File not found\\n\")\n",
+ "else:\n",
+ " for text in fp:\n",
+ " print text\n",
+ " #File pointer itself is iterable in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "#include <stdio.h>\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.14, Page number: 468<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Write a string into a file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "\n",
+ "file1 = raw_input(\"Enter the name of file : \")\n",
+ "fp = open(file1,'w')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"File can not opened\\n\")\n",
+ "else:\n",
+ " text = raw_input(\"Enter Text Here : \")\n",
+ " fp.write(text)\n",
+ " \n",
+ " #Write() function is used to write character or string into the file in python\n",
+ " # there is no fputc() function in python\n",
+ "#open the file to see the result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.15, Page number: 469<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Write integers in a file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('num.txt','w')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"File does not exist\\n\")\n",
+ "else:\n",
+ " v = ' '\n",
+ " while v != '0':\n",
+ " fp.write(v)\n",
+ " v = raw_input(\"Enter Numbers\")\n",
+ " \n",
+ " #open the file to see the result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.16, Page number: 470<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read integers from the file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('num.txt','r')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"File does not exist\\n\")\n",
+ "else:\n",
+ " for v in fp:\n",
+ " print v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 2 3 4 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.17, Page number: 471<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Write a block of structure elements to the given file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class student:\n",
+ " name = ''\n",
+ " age = 0\n",
+ " \n",
+ "#Class variable declaration\n",
+ "stud = [student() for i in range(0,5)]\n",
+ "\n",
+ "#Open file\n",
+ "file1 = raw_input(\"Enter the file name : \")\n",
+ "fp = open(file1,'w')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"File does not exist\\n\")\n",
+ "else:\n",
+ " n = int(raw_input(\"How Many Records : \"))\n",
+ " for i in range(0,n):\n",
+ " stud[i].name = raw_input(\"Name : \")\n",
+ " stud[i].age = int(raw_input(\"Age : \"))\n",
+ " \n",
+ " j = 0\n",
+ " while j < n:\n",
+ " fp.write(\"%s %d\\n\"%(stud[j].name,stud[j].age))\n",
+ " j += 1\n",
+ " \n",
+ " fp.close()\n",
+ " \n",
+ " #open the file to see the result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.18, Page number: 472<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Write and read the information about the player \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class record:\n",
+ " player = ''\n",
+ " age = 0\n",
+ " runs = 0\n",
+ " \n",
+ "#Class variable declaration\n",
+ "emp = record()\n",
+ "\n",
+ "#Open file\n",
+ "fp = open('record.dat','w')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Can not open the file\\n\")\n",
+ "else:\n",
+ " emp.player = raw_input(\"Enter Player Name\")\n",
+ " emp.age = int(raw_input(\"Enter Age\"))\n",
+ " emp.runs = int(raw_input(\"Enter runs scored\"))\n",
+ " fp.write(\"%s %d %d\"%(emp.player,emp.age,emp.runs))\n",
+ " fp.close()\n",
+ " \n",
+ " fp = open('record.dat','r')\n",
+ " if fp == 0:\n",
+ " sys.stdout.write(\"Error in opening file\")\n",
+ " else:\n",
+ " sys.stdout.write(\"\\nRecord Entered is\\n\")\n",
+ " emp.player,emp.age,emp.runs = fp.read().split(' ')\n",
+ " sys.stdout.write(\"\\n%s %s %s\"%(emp.player,emp.age,emp.runs))\n",
+ " fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Player NameSachin\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Age25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter runs scored10000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Record Entered is\n",
+ "\n",
+ "Sachin 25 10000"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.19, Page number: 473<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Write a block of structure elements to the given file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "next1 = 'Y'\n",
+ "\n",
+ "#Class declaration\n",
+ "class bike:\n",
+ " name = ''\n",
+ " avg = 0\n",
+ " cost = 0.0\n",
+ " \n",
+ "#Class variable declaration\n",
+ "e = bike()\n",
+ "\n",
+ "#open file\n",
+ "fp = open('bk.txt','wb')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Cannot open file\")\n",
+ "else:\n",
+ " while next1 == 'Y':\n",
+ " e.name = raw_input(\"Model Name\")\n",
+ " e.avg = int(raw_input(\"Average\"))\n",
+ " e.cost = float(raw_input(\"Price\"))\n",
+ " fp.write(\"%s %d %f\\n\"%(e.name,e.avg,e.cost))\n",
+ " \n",
+ " next1 = raw_input(\"Add Another (Y/N):\")\n",
+ " fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Model NameHONDA\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average80\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Price45000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add Another (Y/N):Y\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Model NameSUZUKI\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average65\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Price43000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add Another (Y/N):Y\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Model NameYAMAHA\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average55\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Price48000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add Another (Y/N):N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.20, Page number: 474<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the information about the bike \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class bike:\n",
+ " name = ''\n",
+ " avg = 0\n",
+ " cost = 0.0\n",
+ " \n",
+ "#Class variable declaration\n",
+ "e = bike()\n",
+ "\n",
+ "#open file\n",
+ "fp = open('bk.txt','rb')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Cannot open file\")\n",
+ "else:\n",
+ " lines = fp.readlines()\n",
+ " for line in lines:\n",
+ " e.name,e.avg,e.cost = line.split(' ')\n",
+ " e.avg = int(e.avg)\n",
+ " e.cost = float(e.cost)\n",
+ " sys.stdout.write(\"\\n%s %d %.2f\"%(e.name,e.avg,e.cost))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "HONDA 80 45000.00\n",
+ "SUZUKI 65 43000.00\n",
+ "YAMAHA 55 48000.00"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.21, Page number: 476<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the text after skipping n characters from beginning of the file\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open(\"text.txt\",\"r\")\n",
+ "\n",
+ "sys.stdout.write(\"\\nContents of file\\n\")\n",
+ "ch = fp.read()\n",
+ "sys.stdout.write(\"%s\"%(ch))\n",
+ "\n",
+ "#Read n\n",
+ "n = int(raw_input(\"How many characters including spaces would you like to skip?\"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nInformation after %d bytes\\n\"%(n))\n",
+ "\n",
+ "ch = ch[n:]\n",
+ "sys.stdout.write(\"%s\"%(ch))\n",
+ "\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Contents of file\n",
+ "THE C PROGRAMMING LANGUAGE INVENTED BY DENNIS RITCHIE"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many characters including spaces would you like to skip?18\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Information after 18 bytes\n",
+ "LANGUAGE INVENTED BY DENNIS RITCHIE"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.22, Page number: 477<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read last few characters of the file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open(\"text.txt\",\"r\")\n",
+ "\n",
+ "sys.stdout.write(\"\\nContents of file\\n\")\n",
+ "ch = fp.read()\n",
+ "sys.stdout.write(\"%s\"%(ch))\n",
+ "\n",
+ "#Read n\n",
+ "n = int(raw_input(\"How many characters including spaces would you like to skip?\"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nInformation after %d bytes\\n\"%(n))\n",
+ "\n",
+ "print ch[-n:]\n",
+ "\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Contents of file\n",
+ "HELLO WORLD"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many characters including spaces would you like to skip?5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Information after 5 bytes\n",
+ "WORLD\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.23, Page number: 477<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display 'c' program files in current directory. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "l = 0\n",
+ "c = 0\n",
+ "\n",
+ "#Open file\n",
+ "file1 = raw_input(\"Enter the file name : \")\n",
+ "fp = open(file1,'r')\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nContents of 'c' program file in capital case\")\n",
+ "sys.stdout.write(\"\\n============================================\\n\")\n",
+ "\n",
+ "ch = fp.readlines()\n",
+ "\n",
+ "for line in ch:\n",
+ " i = 0\n",
+ " #print line.upper()\n",
+ " while i < len(line):\n",
+ " if line[i] =='\\n':\n",
+ " l += 1\n",
+ " else:\n",
+ " c += 1\n",
+ " sys.stdout.write(\"%c\"%(line[i].upper()))\n",
+ " i += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\nTotal Characters : %d\"%(c))\n",
+ "sys.stdout.write(\"\\nTotal Lines : %d\"%(l))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Contents of 'c' program file in capital case\n",
+ "============================================\n",
+ "MAIN()\n",
+ "{\n",
+ "PRINTF(\" HELLO WORLD\");\n",
+ "}\n",
+ "\n",
+ "Total Characters : 31\n",
+ "Total Lines : 4"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.24, Page number: 479<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detect the end of file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open(\"text.txt\",\"r\")\n",
+ "\n",
+ "#there is no feof() function in python\n",
+ "c = fp.tell()\n",
+ "sys.stdout.write(\"File pointer at the beginning of the file : %d\\n\"%(c))\n",
+ "\n",
+ "c = fp.read()\n",
+ "sys.stdout.write(\"%s\"%(c))\n",
+ "\n",
+ "c = fp.tell()\n",
+ "sys.stdout.write(\"\\nFile pointer at the end of file : %d\"%(c))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "File pointer at the beginning of the file : 0\n",
+ "TECHNOCRATS LEAD THE WORLD \n",
+ "File pointer at the end of file : 32"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.25, Page number: 480<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detect an error while read/write operation of a file is in use.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "next1 = 'Y'\n",
+ "\n",
+ "#open file\n",
+ "fp = open('marks.dat','r')\n",
+ "\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Can not open file\")\n",
+ "else:\n",
+ " while next1 == 'Y':\n",
+ " name = raw_input(\"Enter Name, Marks, Percentage\")\n",
+ " marks = int(raw_input(\"Enter Name, Marks, Percentage\"))\n",
+ " \n",
+ " p = marks/7\n",
+ " try:\n",
+ " fp.write(\"%s %d %f\"%(name,marks,p))\n",
+ " except:\n",
+ " sys.stdout.write(\"\\nUnable to write data?\")\n",
+ " sys.stdout.write(\"\\nFile opening mode is incorrect.\")\n",
+ " fp.close()\n",
+ " \n",
+ " next1 = raw_input(\"Continue Y/N:\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name, Marks, PercentageKAMAL\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name, Marks, Percentage540\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Unable to write data?\n",
+ "File opening mode is incorrect."
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Continue Y/N:N\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.26, Page number: 481<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Catch the error that is occurred while file operation\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "f = open(\"io8.c\",\"w\")\n",
+ "\n",
+ "if f == 0:\n",
+ " sys.stdout.write(\"\\nCannot open file\")\n",
+ "else:\n",
+ " #Exception handling\n",
+ " try:\n",
+ " c = fp.readlines()\n",
+ " sys.stdout.write(\"%s\"%(c))\n",
+ " except:\n",
+ " sys.stdout.write(\"\\nCan't read file.\")\n",
+ "#There is no ferror() function python."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Can't read file."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.27, Page number: 482<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detect and print the error message\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "file1 = \"lines.txt\"\n",
+ "\n",
+ "#Open file\n",
+ "fr = open(file1,\"w\")\n",
+ "\n",
+ "sys.stdout.write(\"%s : \"%(file1))\n",
+ "#Exception handling\n",
+ "try:\n",
+ " c = fp.readlines()\n",
+ "except:\n",
+ " sys.stdout.write(\"Permission Denied\")\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "lines.txt : Permission Denied"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.28, Page number: 482<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the current position of the file pointer \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Open file\n",
+ "fp = open(\"text.txt\",\"r\")\n",
+ "\n",
+ "#Set the pointer\n",
+ "fp.seek(21)\n",
+ "\n",
+ "#Result\n",
+ "while True:\n",
+ " c = fp.read(1)\n",
+ " if not c:\n",
+ " break\n",
+ " sys.stdout.write(\"%c\\t%d\\n\"%(c,fp.tell()))\n",
+ "#There is no endof file in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W\t22\n",
+ "O\t23\n",
+ "R\t24\n",
+ "L\t25\n",
+ "D\t26\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.29, Page number: 483<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detect beginning of file\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#open file\n",
+ "fp = open(\"text.txt\",\"r\")\n",
+ "\n",
+ "fp.seek(12)\n",
+ "sys.stdout.write(\"Pointer is at %d\\n\"%(fp.tell()))\n",
+ "sys.stdout.write(\"Before rewind() : \")\n",
+ "\n",
+ "#Result\n",
+ "while True:\n",
+ " c = fp.read(1)\n",
+ " if not c:\n",
+ " break\n",
+ " sys.stdout.write(\"%c\"%(c))\n",
+ " \n",
+ "sys.stdout.write(\"\\nAfter rewind() : \")\n",
+ "fp.seek(0)\n",
+ "#There is no rewind function in python\n",
+ "\n",
+ "while True:\n",
+ " c = fp.read(1)\n",
+ " if not c:\n",
+ " break\n",
+ " sys.stdout.write(\"%c\"%(c))\n",
+ " \n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pointer is at 12\n",
+ "Before rewind() : LEAD THE WORLD\n",
+ "After rewind() : TECHNOCRATS LEAD THE WORLD"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.30, Page number: 484<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Delete the given file \n",
+ "\n",
+ "import sys\n",
+ "import os\n",
+ "\n",
+ "#Read file name\n",
+ "file1 = raw_input(\"Enter The File Name : \")\n",
+ "\n",
+ "#There is no remove or unlink file function in python.\n",
+ "#A file can be deleted using remove function in the os module.\n",
+ "\n",
+ "try:\n",
+ " os.remove(file1)\n",
+ " sys.stdout.write(\"\\nFile (%s) has been deleted!\"%(file1))\n",
+ "except:\n",
+ " sys.stdout.write(\"\\nFile does not exist\")\n",
+ "\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "File (TEXT.TXT) has been deleted!"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.31, Page number: 485<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Change the name of the file\n",
+ "\n",
+ "import os\n",
+ "import sys\n",
+ "\n",
+ "old = raw_input(\"Old File Name : \")\n",
+ "\n",
+ "new = raw_input(\"New File Name : \")\n",
+ "\n",
+ "os.rename(old, new)\n",
+ "\n",
+ "#Check the directory to see the result\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.32, Page number: 486<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy the contents of one file to another file\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "fs = open(\"a.txt\",\"r\")\n",
+ "ft = open(\"b.txt\",\"w\")\n",
+ "c = 0\n",
+ "\n",
+ "if fs == 0:\n",
+ " sys.stdout.write(\"\\nSource file opening error.\")\n",
+ "else:\n",
+ " if ft == 0:\n",
+ " sys.stdout.write(\"\\nTarget file opening error.\")\n",
+ " else:\n",
+ " while True:\n",
+ " ch = fs.read(1)\n",
+ " if not ch:\n",
+ " break\n",
+ " ft.write(\"%c\"%(ch))\n",
+ " c += 1\n",
+ " sys.stdout.write(\"\\n%d Bytes copied from 'a.txt' to 'b.txt'.\"%(c))\n",
+ " c = 0\n",
+ " #there is no fcloseall() function in python\n",
+ " fs.close()\n",
+ " c += 1\n",
+ " ft.close()\n",
+ " c += 1\n",
+ " sys.stdout.write(\"\\n%d files closed.\"%(c))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "45 Bytes copied from 'a.txt' to 'b.txt'.\n",
+ "2 files closed."
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.33, Page number: 487<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the contents of three files and find the largest file\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "y = 0\n",
+ "k = 0\n",
+ "t = 0\n",
+ "name = [\"1.txt\",\"2.txt\",\"3.txt\"]\n",
+ "f = [0 for i in range(0,3)]\n",
+ "x = [0 for i in range(0,3)]\n",
+ "\n",
+ "#Open all the files\n",
+ "for l in range(0,3):\n",
+ " fp = open(name[l],\"r\")\n",
+ " f[l] = fp\n",
+ " if fp == 0:\n",
+ " sys.stdout.write(\"\\n%s file not found.\"%(name[l]))\n",
+ " break\n",
+ " \n",
+ "#Read contents of all files\n",
+ "for l in range(0,3):\n",
+ " while True:\n",
+ " c1 = f[l].read(1)\n",
+ " if not c1:\n",
+ " break\n",
+ " x[l] = y\n",
+ " y += 1\n",
+ " y = 0\n",
+ "\n",
+ "#close the files\n",
+ "for l in range(0,3):\n",
+ " f[l].close()\n",
+ "\n",
+ "#Print size of all files\n",
+ "for l in range(0,2+1):\n",
+ " sys.stdout.write(\"File : %s Bytes : %d\\n\"%(name[l],x[l]))\n",
+ " t = t + x[l]\n",
+ " \n",
+ "#Find largest\n",
+ "for l in range(t,1,-1):\n",
+ " for k in range(0,3):\n",
+ " if l == x[k]:\n",
+ " sys.stdout.write(\"\\n%s are the largest file.\"%(name[k]))\n",
+ " break\n",
+ " if l == x[k]:\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "File : 1.txt Bytes : 16\n",
+ "File : 2.txt Bytes : 20\n",
+ "File : 3.txt Bytes : 25\n",
+ "\n",
+ "3.txt are the largest file."
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.34, Page number: 488<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy 100 characters from a file to an array\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "SIZE = 100\n",
+ "s = 0\n",
+ "x = 0\n",
+ "ch = ['0' for i in range(0,100)]\n",
+ "\n",
+ "#Open the files\n",
+ "f = open(\"poem.txt\",\"r\")\n",
+ "f2 = open(\"alpha.txt\",\"w\")\n",
+ "\n",
+ "if f ==0 or f2 == 0:\n",
+ " sys.stdout.write(\"?\")\n",
+ "else:\n",
+ " while True:\n",
+ " c = f.read(1)\n",
+ " x += 1\n",
+ " if not c:\n",
+ " break\n",
+ " else:\n",
+ " if x == 99:\n",
+ " break\n",
+ " else:\n",
+ " ch[s] = c\n",
+ " s += 1\n",
+ "\n",
+ "for s in range(0,100):\n",
+ " f2.write(\"%c\"%(ch[s]))\n",
+ "\n",
+ "sys.stdout.write(\"Process Completed : Error 0\")\n",
+ "f.close()\n",
+ "f2.close()\n",
+ "\n",
+ "#There is no perror() function in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Process Completed : Error 0"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.35, Page number: 491<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Low level disk I/O operations.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "\n",
+ "#Variable Initialization\n",
+ "file1 = raw_input(\"Enter a file name : \")\n",
+ "\n",
+ "#Open file\n",
+ "s = open(file1,\"w\")\n",
+ "\n",
+ "#Result\n",
+ "if s == -1:\n",
+ " sys.stdout.write(\"File does not exits\")\n",
+ "else:\n",
+ " buff = raw_input(\"Enter text below:\")\n",
+ " s.write(\"%s\"%(buff))\n",
+ " s.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a file name : TEXT\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter text below:PROGRAMMING IN C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.36, Page number: 492<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read text from a specified file \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "file1 = raw_input(\"Enter a file name \")\n",
+ "\n",
+ "#open file\n",
+ "s = open(file1,\"r\")\n",
+ "\n",
+ "#Result\n",
+ "if s == -1:\n",
+ " sys.stdout.write(\"File does not exists\")\n",
+ "else:\n",
+ " while True:\n",
+ " ch = s.read(1)\n",
+ " if not ch:\n",
+ " break\n",
+ " sys.stdout.write(\"%c\"%(ch))\n",
+ " \n",
+ "s.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a file name TEXT\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "PROGRAMMING IN C"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.37, Page number: 493<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Set a buffer size \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nThis book teaches C\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "This book teaches C"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.38, Page number: 494<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display number of arguments and their names\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nTotal number of arguments are %d\\n\"%(len(sys.argv)))\n",
+ "\n",
+ "print str(sys.argv)\n",
+ "\n",
+ "#Command line arguments can be given in python by the command\n",
+ "\n",
+ "# python pgmname.py arg1 arg2 arg3\n",
+ "\n",
+ "#This is not possible in ipython notebook"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.39, Page number: 495<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read any file from command prompt\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#open file\n",
+ "fp = open(sys.argv[1],\"r\")\n",
+ "\n",
+ "#Result\n",
+ "if fp == 0:\n",
+ " sys.stdout.write(\"Can not open file\")\n",
+ "else:\n",
+ " while True:\n",
+ " ch = fp.read(1)\n",
+ " if not ch:\n",
+ " break\n",
+ " sys.stdout.write(\"%c\"%(ch))\n",
+ " \n",
+ "fp.close()\n",
+ "\n",
+ "#This program can be run in python as\n",
+ "\n",
+ "# python pgmname.py filename"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.40, Page number: 495<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Command line argument to perform the task of DEL command\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Check number of arguments\n",
+ "if len(sys.argv) < 2:\n",
+ " sys.stdout.write(\"Insufficient Arguments\")\n",
+ "else:\n",
+ " fp = open(sys.argv[1],\"r\")\n",
+ " if fp == 0:\n",
+ " sys.stdout.write(\"File Not Found\")\n",
+ " fp.close()\n",
+ " os.remove(sys.argv[1])\n",
+ " sys.stdout.write(\"File has been deleted\")\n",
+ " \n",
+ "#This program can be deleted using\n",
+ "# python pgmname.py filename\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.41, Page number: 496<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Command line argument to perform the task of REN command\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Check number of arguments\n",
+ "if len(sys.srgv) < 3:\n",
+ " sys.stdout.write(\"Insufficient Arguments\")\n",
+ "else:\n",
+ " fp = open(sys.argv[1],\"r\")\n",
+ " if fp == 0:\n",
+ " sys.stdout.write(\"File Not Found\")\n",
+ " else:\n",
+ " sp = open(sys.argv[2],\"r\")\n",
+ " if sp == 0:\n",
+ " fp.close()\n",
+ " sp.close()\n",
+ " #Rename file\n",
+ " os.rename(sys.argv[1],sys.argv[2])\n",
+ " else:\n",
+ " sys.stdout.write(\"Duplicate file name or file is in use\")\n",
+ " \n",
+ "#This program can be executed as\n",
+ "\n",
+ "# python pgmname.py oldfilename newfilename\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.42, Page number: 497<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Environment variable and display the various settings.\n",
+ "\n",
+ "import sys\n",
+ "import os\n",
+ "\n",
+ "#Result\n",
+ "print os.environ\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "{'TMP': 'C:\\\\Users\\\\Aathira\\\\AppData\\\\Local\\\\Temp', 'COMPUTERNAME': 'AATHIRA-PC', 'GUROBI_HOME': 'B:\\\\gurobi510\\\\win32', 'USERDOMAIN': 'Aathira-PC', 'PSMODULEPATH': 'C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\Modules\\\\', 'COMMONPROGRAMFILES': 'C:\\\\Program Files (x86)\\\\Common Files', 'PROCESSOR_IDENTIFIER': 'Intel64 Family 6 Model 15 Stepping 13, GenuineIntel', 'PROGRAMFILES': 'C:\\\\Program Files (x86)', 'PROCESSOR_REVISION': '0f0d', 'SYSTEMROOT': 'C:\\\\Windows', 'PATH': 'C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core;B:\\\\gurobi510\\\\win32\\\\bin;C:\\\\Windows\\\\system32;C:\\\\Windows;C:\\\\Windows\\\\System32\\\\Wbem;C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\;C:\\\\Program Files (x86)\\\\Common Files\\\\Adobe\\\\AGL;C:\\\\Program Files\\\\MATLAB\\\\R2009a\\\\bin;C:\\\\Program Files\\\\MATLAB\\\\R2009a\\\\bin\\\\win64;c:\\\\python27\\\\scripts;C:\\\\Program Files (x86)\\\\MiKTeX 2.9\\\\miktex\\\\bin\\\\;C:\\\\Anaconda;C:\\\\Anaconda\\\\Scripts;C:\\\\Program Files (x86)\\\\ffmpeg', 'CLICOLOR': '1', 'PROGRAMFILES(X86)': 'C:\\\\Program Files (x86)', 'COMSPEC': 'C:\\\\Windows\\\\system32\\\\cmd.exe', 'TK_LIBRARY': 'C:\\\\Anaconda\\\\tcl\\\\tk8.5', 'TERM': 'xterm-color', 'TEMP': 'C:\\\\Users\\\\Aathira\\\\AppData\\\\Local\\\\Temp', 'COMMONPROGRAMFILES(X86)': 'C:\\\\Program Files (x86)\\\\Common Files', 'PROCESSOR_ARCHITECTURE': 'x86', 'TIX_LIBRARY': 'C:\\\\Anaconda\\\\tcl\\\\tix8.4.3', 'ALLUSERSPROFILE': 'C:\\\\ProgramData', 'LOCALAPPDATA': 'C:\\\\Users\\\\Aathira\\\\AppData\\\\Local', 'HOMEPATH': '\\\\Users\\\\Aathira', 'PROGRAMW6432': 'C:\\\\Program Files', 'USERNAME': 'Aathira', 'LOGONSERVER': '\\\\\\\\AATHIRA-PC', 'SESSIONNAME': 'Console', 'PROGRAMDATA': 'C:\\\\ProgramData', 'TCL_LIBRARY': 'C:\\\\Anaconda\\\\tcl\\\\tcl8.5', 'GIT_PAGER': 'cat', 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC', 'FP_NO_HOST_CHECK': 'NO', 'WINDIR': 'C:\\\\Windows', 'APPDATA': 'C:\\\\Users\\\\Aathira\\\\AppData\\\\Roaming', 'HOMEDRIVE': 'C:', 'PAGER': 'cat', 'SYSTEMDRIVE': 'C:', 'NUMBER_OF_PROCESSORS': '2', 'PROCESSOR_LEVEL': '6', 'PROCESSOR_ARCHITEW6432': 'AMD64', 'COMMONPROGRAMW6432': 'C:\\\\Program Files\\\\Common Files', 'OS': 'Windows_NT', 'PUBLIC': 'C:\\\\Users\\\\Public', 'USERPROFILE': 'C:\\\\Users\\\\Aathira'}\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.43, Page number: 498<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read character from keyboard \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "c = '0'\n",
+ "\n",
+ "#Result\n",
+ "while c != ' ':\n",
+ " c = raw_input(\"\")\n",
+ " sys.stdout.write(\"%c \"%(c))\n",
+ " \n",
+ "#Give space at the end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 2 "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3 4 "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5 6 "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7 8 "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9 "
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.44, Page number: 499<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display A to Z characters\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "for a in range(65,91):\n",
+ " sys.stdout.write(\"%c\\t\"%(chr(a)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A\tB\tC\tD\tE\tF\tG\tH\tI\tJ\tK\tL\tM\tN\tO\tP\tQ\tR\tS\tT\tU\tV\tW\tX\tY\tZ\t"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter15.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter15.ipynb new file mode 100755 index 00000000..0c5ac02f --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter15.ipynb @@ -0,0 +1,754 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 15: Additional in 'C'<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.1, Page number: 505<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Allocate memory to pointer variable. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "j = 0\n",
+ "k = int(raw_input(\"How many number : \"))\n",
+ "p = [0 for i in range(0,k)]\n",
+ "\n",
+ "#in python, all variables are allocated using dynamic memory allocation technique and no\n",
+ "#malloc function and pointer concept is available in python.\n",
+ "\n",
+ "#Read the numbers\n",
+ "while j != k:\n",
+ " p[j] = int(raw_input(\"Number %d = \"%(j+1)))\n",
+ " j += 1\n",
+ " \n",
+ "j = 0\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"The numbers are : \")\n",
+ "while j != k:\n",
+ " sys.stdout.write(\"%d\\t\"%(p[j]))\n",
+ " j += 1\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many number : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number 1 = 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number 2 = 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number 3 = 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number 4 = 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The numbers are : 1\t2\t3\t4\t"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.2, Page number: 506<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Memory allocation to pointer variable. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "j = 0\n",
+ "k = int(raw_input(\"How many Number : \"))\n",
+ "p = [0 for i in range(0,k)]\n",
+ "\n",
+ "#in python, all variables are allocated using dynamic memory allocation technique and no\n",
+ "#calloc function and pointer concept is available in python.\n",
+ "\n",
+ "#Read the numbers\n",
+ "while j != k:\n",
+ " p[j] = int(raw_input(\"Number %d = \"%(j+1)))\n",
+ " j += 1\n",
+ " \n",
+ "j = 0\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"The numbers are : \")\n",
+ "while j != k:\n",
+ " sys.stdout.write(\"%d\\t\"%(p[j]))\n",
+ " j += 1\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many Number : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number 1 = 45\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number 2 = 58\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number 3 = 98\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The numbers are : 45\t58\t98\t"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.3, Page number: 507<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reallocate memory \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "str1 = \"India\"\n",
+ "\n",
+ "#in python, value tagged method is used for data storage instead of memory tagging.\n",
+ "#no realloc function is in python\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"str = %s\"%(str1))\n",
+ "str1 = \"Hindustan\"\n",
+ "sys.stdout.write(\"\\nNow str = %s\"%(str1))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "str = India\n",
+ "Now str = Hindustan"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.4, Page number: 508<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display unused memory \n",
+ "\n",
+ "import psutil\n",
+ "\n",
+ "psutil.phymem_usage()\n",
+ "\n",
+ "#There is no coreleft() function in python. phymem_usage function in the module psutil gives the \n",
+ "#status and usage of physical memory in python."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 6,
+ "text": [
+ "usage(total=3165270016L, used=987840512L, free=2177429504L, percent=31.2)"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.5, Page number: 510<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Linked list\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialziation\n",
+ "ch = 'y'\n",
+ "p = 0\n",
+ "q = []\n",
+ "\n",
+ "#Function Definitions\n",
+ "def gen_rate(m):\n",
+ " q.append(m)\n",
+ " \n",
+ "def show():\n",
+ " print q\n",
+ " \n",
+ "def addatstart(m):\n",
+ " q.insert(0,m)\n",
+ " \n",
+ "def append(m,po):\n",
+ " q.insert(po,m)\n",
+ "\n",
+ "def erase(d):\n",
+ " q.remove(d)\n",
+ " \n",
+ "def count():\n",
+ " print len(q)\n",
+ " \n",
+ "def descending():\n",
+ " q.sort(reverse=True)\n",
+ " \n",
+ "#Get choice\n",
+ "while ch == 'y':\n",
+ " n = int(raw_input(\"1. Generate\\n2. Add at starting\\n3. Append\\n4. Delete\\n5. Show\\n6.Count\\n7.Descending\\nEnter your choice: \"));\n",
+ " #There is no switch statement in python\n",
+ " if n == 1:\n",
+ " i = int(raw_input(\"How many node you want : \"))\n",
+ " for j in range(0,i):\n",
+ " m = int(raw_input(\"Enter the element : \"))\n",
+ " gen_rate(m)\n",
+ " show()\n",
+ " else:\n",
+ " if n == 2:\n",
+ " m = int(raw_input(\"Enter the element : \"))\n",
+ " addatstart(m)\n",
+ " show()\n",
+ " else:\n",
+ " if n == 3:\n",
+ " m = int(raw_input(\"Enter the element and position \"))\n",
+ " po = int(raw_input(\"Enter the element and position\"))\n",
+ " append(m,po)\n",
+ " show()\n",
+ " else:\n",
+ " if n == 4:\n",
+ " d = int(raw_input(\"Enter the number for deletion : \"))\n",
+ " erase(d)\n",
+ " show()\n",
+ " else:\n",
+ " if n == 5:\n",
+ " show()\n",
+ " else:\n",
+ " if n == 6:\n",
+ " count()\n",
+ " else:\n",
+ " if n == 7:\n",
+ " descending()\n",
+ " show()\n",
+ " else:\n",
+ " sys.stdout.write(\"Enter value between 1 to 7\")\n",
+ " \n",
+ " ch = raw_input(\"Do u wnat to continue (y/n)\")\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1. Generate\n",
+ "2. Add at starting\n",
+ "3. Append\n",
+ "4. Delete\n",
+ "5. Show\n",
+ "6.Count\n",
+ "7.Descending\n",
+ "Enter your choice: 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many node you want : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the element : 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the element : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the element : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the element : 7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[1, 5, 4, 7]\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Do u wnat to continue (y/n)n\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.6, Page number: 518<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Draw circle, line and arc using graphics function\n",
+ "\n",
+ "%pylab inline\n",
+ "import pylab\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "#Tkinter package is used for graphics\n",
+ "#Give proportionate sizes to draw\n",
+ "#draw circle\n",
+ "circle2=plt.Circle((.5,.5),.2,color='b')\n",
+ "fig = plt.gcf()\n",
+ "fig.gca().add_artist(circle2)\n",
+ "\n",
+ "\n",
+ "#draw line\n",
+ "figure()\n",
+ "pylab.plot([210,110],[150,150])\n",
+ "\n",
+ "#Draw ellipse\n",
+ "figure()\n",
+ "from matplotlib.patches import Ellipse\n",
+ "e = Ellipse(xy=(35, -50), width=10, height=5, linewidth=2.0, color='g')\n",
+ "fig = plt.gcf()\n",
+ "fig.gca().add_artist(e)\n",
+ "e.set_clip_box(ax.bbox)\n",
+ "e.set_alpha(0.7)\n",
+ "pylab.xlim([20, 50])\n",
+ "pylab.ylim([-65, -35])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['pylab', 'e']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 61,
+ "text": [
+ "(-65, -35)"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEACAYAAABI5zaHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGXlJREFUeJzt3X9w1HV+x/HXQjaQREB+2BzsZg5I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apRqamo0e/ZslyuPv1j6\n4qGHHtLKlStVXl6u3t5ePfXUU5o0aZLLlSfGihUr9Oabb6q9vV0FBQVas2aNuru7JQ0/N7mICQAs\nxG32AMBChDsAWIhwBwALEe4AYCHCHQAsRLgDgIUIdwCwEOEOABb6P0Anxcrjn3WCAAAAAElFTkSu\nQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x707a9f0>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEACAYAAABS29YJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAF0tJREFUeJzt3XtsU+f9x/GPM8JWljCCBiaKU2JugzR28AK0MKXzr8CA\nomzrZdVcAVUcpIr+tZoxtj+gttZCCIuqNtO2TKIwiXX8g4BpgghP4ACquCdKRqVBWaIkkKVLQ6YR\nKNfn90dVizQ3nDi0yfN+SZYOz3l8zvfblk9OnuNTO4wxRgCAUS3lyy4AADD8CHsAsABhDwAWIOwB\nwAKEPQBYgLAHAAv0G/bBYFBOp1Mejyc+Fg6H5XK55PP55PP5dOjQIUnSp59+qkAgIK/Xq9zcXJWW\nlg5v5QCAh9Zv2BcXF6uqqqrbmMPhUCgUUk1NjWpqarRixQpJ0p49eyRJdXV1OnfunCorK9XU1DRM\nZQMAEtFv2BcWFiojI6PHeG/PYWVmZqqrq0v37t1TV1eXxo4dq/HjxyevUgDAoA1qzb6iokL5+fkq\nKSlRZ2enJGnZsmUaP368MjMzlZOTow0bNmjChAlJLRYAMDgJh/26devU0NCg2tpaZWZmav369ZKk\n3bt36+bNm2ptbVVDQ4N+85vfqKGhIekFAwASNybRN0yePDm+vXbtWhUVFUmSPvjgAz333HP62te+\npkmTJul73/uezp49K7fb3eMYM2bM0OXLl4dQNgDYZfr06froo48G/f6Er+xbW1vj2/v27Yt/Umf2\n7Nk6cuSIJKmrq0snT57UnDlzej3G5cuXZYwZla833njjS6+B/uiP/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v88footEIvEx0889/ZHW3927d3Xt\n2jWdPHlS27dv10svvdTn3JHWmySVlJTo3XffVVNTk95++20Fg8E+546U/q5fv64XXnhB77zzjtLT\n07vtGw35cv36db344ot65513lJaWFh8far48krB3Op3697//LUlqbW3V5MmTJUlZWVlqbm6Oz2tp\naYn/mjnS7Nq1SwcPHtSf//zn+Nho6O/y5ctqbGxUfn6+3G63WlpaVFBQoLa2tlHRn8vl0vPPPy9J\nmj9/vlJSUtTe3j4qepM+u0H73HPPSZJefPHF+K/5I7W/O3fu6IUXXtDq1av14x//WNLoypfP+1u1\nalW8PylJ+TIcNxoefOLWmM9u0JaWlhpjjNm6dWuPGwy3bt0y//rXv8y0adPM/fv3h6OkpPpif4cO\nHTK5ubnmP//5T7d5o6W/B/V2g3Yk9ffF3v7whz+YzZs3G2OM+ec//2mys7ONMSOzN2N69ufz+Uws\nFjPGGPP3v//dzJs3zxgzMvu7f/++Wb16tfnZz37WbXy05Etf/SUrX5Ie9j/96U9NZmamSU1NNS6X\ny7z33nvmk08+MYsXLzYzZ840S5cuNdeuXYvPf+utt8z06dPNd77znfinBr7Kvtjfjh07zIwZM8zj\njz9u5s6da+bOnWvWrVsXnz9S+xs7dmz839+D3G53POyNGVn99dbb7du3zapVq0xeXp757ne/a44e\nPRqfP5J6M6b3v3tnzpwxCxYsMPn5+eapp54y58+fj88faf0dP37cOBwOk5+fH/+7dujQoVGTL731\nd/DgwaTlCw9VAYAF+FpCALAAYQ8AFiDsAcAChD0AWICwBwALEPYAYAHCHgAsQNgDgAX+Hze/zGOH\nVK27AAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7349d10>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEACAYAAAC9Gb03AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG+xJREFUeJzt3X1QU2e+B/DvyQtJgCDvCskq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HoiIsn9P/ox1+CwlWHmAAAAAElFTkSu\nQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x78994d0>"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.7, Page number: 519<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Draw boxes and fill with different designs.\n",
+ "\n",
+ "%pylab\n",
+ "#Tkinter package is used for graphics\n",
+ "from matplotlib.patches import Rectangle\n",
+ "from matplotlib.collections import PatchCollection\n",
+ "\n",
+ "e = Rectangle(xy=(35, -50), width=10, height=5, linewidth=2.0, color='b')\n",
+ "fig = plt.gcf()\n",
+ "fig.gca().add_artist(e)\n",
+ "e.set_clip_box(ax.bbox)\n",
+ "e.set_alpha(0.7)\n",
+ "pylab.xlim([20, 50])\n",
+ "pylab.ylim([-65, -35])\n",
+ "\n",
+ "#There are no different automatic fill styles. user should create the styles."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEACAYAAAC9Gb03AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAErZJREFUeJzt3X9MVff9x/HXuXKbaEoEV3UtN6kILooinNYpf5jsOLlL\nk4WW0YXEpq6J9p/6V0uXOrOIkBRxbizpyDRka5raf+qyxMKW2kBWb2i3uFsQ6w+SggW6C3LNmDZR\nt4Xpzv5ovN8yfqT33At8fe/5SE5y77ncez6ffPTZc4/3Usf3fV8AALNCiz0AAMD8IvQAYByhBwDj\nCD0AGEfoAcA4Qg8AxgUO/cGDB1VWVqby8nLt3LlTiURCkjQyMqKlS5fKdV25rqt9+/ZlbbAAgPQ5\nQT9Hf/PmTeXm5kqSWltb9fHHH+vXv/61RkZGVFVVpYsXL2Z1oACAYAKf0d+LvCTdunVLDz30UFYG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5zU6Oqru7m6dOXNmyuP3+9r99/xisZiZtfv973+v\nVatWyXXdWc9w7+f1m21+VtZPkv74xz+qr69Pp0+f1i9/+Ut98MEHUx7/Kuu3YKH/17/+paefflq7\nd+9WdXW1pC/+S3Tvm7fj4+NatWrVQg0n6+7N79lnn03Nb9WqValFeP755xWPxxd5lJlZvny5vvvd\n76q3t9fU2t1zb349PT1m1u5Pf/qTOjo6VFhYqF27dun999/X7t27zazfTPP7wQ9+YGb9JOnhhx+W\n9MXvE/ve976neDye9votSOh939fevXtVUlKiF198MbX/ySef1JtvvilJevPNN1OBvN/MNr/x8fHU\n7VOnTqm0tHQxhpeRiYmJ1Nvef/zjH+rq6pLrumbWbrb5fflXf9yvaydJhw8fViKR0PDwsN5++219\n+9vf1ltvvWVm/Waa34kTJ0z83ZO++KDAzZs3JUm3b99WZ2enSktL01+/tL9LG8AHH3zgO47jl5WV\n+eXl5X55ebl/+vRp/29/+5u/c+dOf926dX40GvVv3LixEMPJupnm9+677/q7d+/2S0tL/c2bN/tP\nPfWUn0wmF3uoabtw4YLvuq5fVlbml5aW+kePHvV93zezdrPNz8La/bdYLOZXVVX5vm9n/b7szJkz\nqfk9++yzJtZvaGjILysr88vKyvyNGzf6hw8f9n0//fXjC1MAYBz/K0EAMI7QA4BxhB4AjCP0AGAc\noQcA4wg9ABhH6AHAOEIPAMb9B4rEH5DkLOd4AAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7373590>"
+ ]
+ }
+ ],
+ "prompt_number": 72
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.8, Page number: 520<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display text in different size, font, vertically and horizontally \n",
+ "\n",
+ "%pylab\n",
+ "\n",
+ "from pylab import *\n",
+ "\n",
+ "#Tkinter package is used for graphics\n",
+ "# set limits so that it no longer looks on screen to be 45 degrees\n",
+ "xlim([-5,5])\n",
+ "\n",
+ "# Locations to plot text\n",
+ "l1 = array((1,1))\n",
+ "l2 = array((5,5))\n",
+ "\n",
+ "# Rotate angle\n",
+ "angle = 90\n",
+ "trans_angle = gca().transData.transform_angles(array((45,)),\n",
+ " l2.reshape((1,2)))[0]\n",
+ "\n",
+ "# Plot text\n",
+ "th2 = text(l2[0],l2[1],'Hello(Horizontal Text with fontsize 25)\\n\\n',fontsize=25,\n",
+ " rotation=0)\n",
+ "th2 = text(l2[0],l2[1],'Hello(Horizontal Text with fontsize 16)',fontsize=16,\n",
+ " rotation=0)\n",
+ "th1 = text(l1[0],l1[1],'Hello(Vertical Text)',fontsize=16,\n",
+ " rotation=angle)\n",
+ "show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Using matplotlib backend: module://IPython.kernel.zmq.pylab.backend_inline\n",
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['power', 'draw_if_interactive', 'random', 'fft', 'angle', 'linalg', 'info']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAA5AAAATCCAYAAADLrQlWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XeUFFXC/vGnezIwMMOQBASGLIIoAgKSg+ASX0AQV5II\nKuqCArqGV4FFF8EAiLrKLkFAMawSDSgZBFxAlrQknSGpIBJkkORwf3/w63q7Ot6BIa3fzzl9znTV\nrVu3blWHZ6r6lscYYwQAAAAAQBTey90AAAAAAMDVgQAJAAAAALBCgAQAAAAAWCFAAgAAAACsECAB\nAAAAAFYIkAAAAAAAKwRIAMAF83q9rseUKVNc8ydPnhxU5mLbsmWLY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pUqVilgmVPuvlG3KyspyPS9RooQ6dOhwmVpz/i5Wf9rs36tF/vz5ddddd+n2229XhQoVdOTI\nEc2cOVOvvPKKzpw545T77rvvNHnyZN1///0R63vxxRfDntmUpCJFioScnpycrDZt2ujDDz+UdO7y\n2kWLFkX8re/v+5e4AADHzp07NWTIENWqVUtpaWmKi4tT4cKFVb9+fT333HM6fPjwJWnH4cOHNXr0\naDVv3lzFihVTQkKCkpOTVbFiRfXo0UPz58+PuPzf//531/OuXbtezOaGtWTJEvXp00fXXXedChQo\noPj4eBUtWlSNGzfWc889p4MHD4ZdNtSgRL/88oueeuopValSRXny5HENHhFtkI/A+dEeS5YsCWqT\nMUZz5szRXXfdpfLlyys5OVkJCQkqXry4WrZsqbFjx+rYsWMhtyczMzPkOo4ePaqnn35aVapUUVJS\nklJSUtS8eXN9/vnnYfsk8PeEw4YNCztAU3Z2tqZPn65BgwapWbNmqlSpkgoXLqy4uDglJyerXLly\n6tixo6ZOner6wpabSpQooVKlSrkepUuXDjqbFBsbG1SuVKlSKl68uKTg4ykhIUElSpRQmzZtNGnS\nJP32229B6/773//u6pfY2NigM1ynT59W9erVXeWaNm0qY4zKlCkjr9cb9LvrKVOmnPdAJoH7q1mz\nZkFlSpUq5czPkydP0L7p3r27q45+/fo58yINsuIbzKtp06au+owxSk9Pdy0T7QyMdO6fAx07dlTR\nokWVkJCg8uXLa/DgwTp69KhVX/jzvUb9rySQzv1eM1q7vvnmGz344IOqXr26UlNTnffuOnXq6Mkn\nn4y4b3z72PcYNmyYzp49qzfffFP16tVTgQIFlDdvXtWoUUOvvvpqUDBs3LixvF6v6/JV6dzxGul9\n5ddff9W4cePUokULlShRQomJiUpMTFTJkiV18803q3fv3nr99de1Y8cOV73RBtEJNT/SI9x+vpif\nh/ny5dOzzz6rffv26fXXX1fbtm1VuXJl1alTRyNHjtQLL7wQtMzixYuj1puWlhbyPcT3iHQG8847\n73Q9nzBhQuSVGQDAVaNRo0bG4/E4D6/XG7ZsZmamq6zH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\nv/76a9C966I9GjRo4Krj66+/Drplx3vvvWeMMeann34yxYoVc817+OGHg9oxfvz4iOts3LjxefVB\n165dQ9bna58xxixdujRkmfr164es02Z/hbpFSqTXgM0tKnLrOLG9jYcxwbediPZe8/zzzwfVYXNb\nHJs2zZ07N+L6y5Qp45Tt1KmTdbvj4+Nd966M1s+hbrli+35hTO58HkYT6rMk2sO//4w5d4/bnCwf\nGxtrPv7447BtCryv6F133RVxGzgDCQBXMZMLZwJfffVVPf3009a/sytRooS83gv7+AjV7nbt2un9\n99+3GhSjWbNm+vzzz0OOfNi3b1/XZayhRlW9WOLj4zV37ly1bds2atm8efNqypQpuTIiXm7z77/U\n1FQtWLAgaEj4UAoXLqzZs2df1EtyH3rooYijMvq3feLEiUpOTg5ZLjY2Vn/7299cZ6xt5MZrzrbe\npKQkffbZZ2rfvr1VHR6PR9dee63z/NixY+rWrZvrMuo777xTXbp0kXRuFMfAy8LHjx8fNNR/9+7d\nww4u5Vvv+Qh3Car/mcXatWuHvOTU9vLVUP3q8Xj0xBNPRFzufLcp0npzu55p06YFXdEQSlxcnEaO\nHBl1my+kTa1atVKNGjXCLuPfn7Z9Gxsbq3HjxoUdYTZcW3IisC2X4/PQRmA7Y2JilCdPHqtlCxYs\nqBkzZriuOAgUeIVKqNs1+SNAAsBVxBNwX0KbD+LAZULNHz58uHbs2KEnn3xS9erVU5EiRRQfH6+k\npCRde+21at68uZ566iktWbLEdZmL7XoC2xuuLR07dtR3332nF154QU2aNFHRokUVHx+vfPnyqXz5\n8rr77rv16aef6osvvgg7hHmFChVcXy5Xr14d9nciNv0TahsilU9JSdGsWbO0cOFC9e7dW5UqVVL+\n/PkVFxenwoULq2HDhvrLX/6ijIwM3X333RfcrlBti1ZftEegkiVLavny5Zo5c6buvPNOpaenK2/e\nvIqPj1exYsXUokULvfLKK/r2228jXrpqcyxGK1O6dGmtWrVKd911l0qUKKH4+Piwy9SsWVPr1q1T\nz549Vbx4cae9HTt21LJly9SnT5+o7bI9dnP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lypXq1q2bpk+ffrmbAwA6c+aMypcvrz179ujJJ5+M+ptPAARIAMAlsmrVKtWrV0+xsbHa\nunWr9W8DAeBimThxou69914VLVpUO3fudEaxBRAeARIAAAAAYIXfQAIAAAAArBAgAQAAAABWCJAA\nAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAA\nAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAA\nrBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFgh\nQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAE\nAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAA\nAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAA\nYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAK\nARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIk\nAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAA\nAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAA\nACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABW\nCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAg\nAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIA\nAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAA\nAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACw\nQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUA\nCQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIA\nAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAA\nAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACA\nFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsE\nSAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAA\nAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAA\nAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAA\nrBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFgh\nQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAE\nAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAA\nAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAA\nYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAK\nARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIk\nAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAA\nAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAA\nACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABW\nCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAg\nAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIA\nAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAA\nAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACw\nQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUA\nCQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIA\nAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAA\nAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACA\nFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsE\nSAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAA\nAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAArBAgAQAA\nAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFghQAIAAAAA\nrBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAEAAAAAFgh\nQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAAAACwQoAE\nAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAAYIUACQAA\nAACwQoAEAAAAAFghQAIAAAAArBAgAQAAAABWCJAAAAAAACsESAAAAACAFQIkAAAAAMAKARIAAAAA\nYIUACQAAAACwQoAEAAAA8P/Yu/cgver6juOfZ3O/SLgnyiUkUiiNXGJoKwq4toNVLgrDRa3EWJCa\ncBEGREp1KNG0A5V2qI46VQyYUrENxtRQEcaWQImkViUhVq3BxAQZIGQwlEsW4ubpHzQLayD5xjH7\nHNjX658s5znJftmZ/c2+93fOeaBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIB\nCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACg\nREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEA\nACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhI\nACrWxdwAACAASURBVAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACU\nCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAA\nACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJ\nAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBE\nQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAA\nKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgA\nAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUC\nEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABA\niYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIA\nAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQ\nAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABK\nBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAA\ngBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAE\nAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAi\nIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAA\nlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQA\nAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIB\nCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACg\nREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEA\nACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhI\nAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAl\nAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAA\nQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREAC\nAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgR\nkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAA\nSgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIA\nAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImA\nBAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQ\nIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAA\nAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQk\nAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIAS\nAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAA\noERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiAB\nAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQI\nSAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAA\nJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkA\nAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERA\nAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAo\nEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAA\nAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQIS\nAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJ\ngAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoEJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAA\nUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACAEgEJAABAiYAEAACgREACAABQIiABAAAoEZAA\nAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJQISAAAAEoE\nJAAAACUCEgAAgBIBCQAAQImABAAAoERAAgAAUCIgAQAAKBGQAAAAlAhIAAAASgQkAAAAJQISAACA\nEgEJAABAiYAEAACgREACAABQIiABAAAoEZAAAACUCEgAAABKBCQAAAAlAhIAAIASAQkAAECJgAQA\nAKBE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Wykgd9S2gvOII47I8uXLd8anhVeMF34PvdT305aH\n7DA4HH744X27zwAAnfJrB2RPT0+GDBmSYcOG9e0yPvDAA3nDG96QBx98MEledPdx+fLl293RHAhX\nXnllrrzyyk6P0Qi+Fs/r9Ndi4cKFWbhwYZJk3rx5SZIZM2b0fc+0Wq3sueeeecMb3pBTTz11p87S\n6a9FkzTha+GXBQBAE2w3IP/1X/81P/jBD5I8dy/WF7/4xRx77LE5+OCDM2XKlKxYsSLvfve782d/\n9me5+uqr8/DDD+drX/tajjnmmO2+ETrQ38knn5yTTz45yfMBef3113dyJAAA6LPdp7Bec801ufzy\ny9NqtXLfffflT//0T/Ptb387yfO/EZ8wYUJuuummbNiwIZdeemmmTZuWG264YacODq90GzZsyObN\nm1/y9VWrVg3gNAAAUAjIO+64I5s3b05vb2/fnzNmzMjmzZtz33339Z13yimn5P77709PT08WL17c\n+N3H7u7uTo/QGL4Wz2vS1+KII47I0qVLX/S1L33pS5k6depO/fxN+lp0mq8FAMBzWu0BviGx1Wo1\n4h5IaLqurq4MHTo0f/EXf5GPfvSjSZ57m4+ZM2fmn/7pn9JqtdLb29vhKRko1k4AoAkEJDTU+PHj\n8+ijjyZJjj322HzoQx/KxRdfnLVr1yZJDj30UE80HkSsnQBAEwhIaKhHH300s2bNyoIFC/od7+rq\nyiWXXJJPfOITGT58eIemY6BZOwGAJhCQ0HDveMc7csstt/T990c/+tF84hOf6OBEdIK1EwBogu0+\nRAfojLVr1+a4447rF49J8ld/9Vf54Ac/mKeffrpDkwEAMFjZgYSGGjduXJ544okkyYknnpiLL744\n559/fn74wx8mSSZPnpz777+/kyMygKydAEAT2IGEhnriiScycuTIfPrTn87Xv/71dHd357vf/W5m\nzZqVJFm9enWHJwQAYLCxAwkNdeihh+YrX/lKpkyZstVrixYtytlnn51169Z1YDI6wdoJADSBgISG\neuaZZzJixIiXfP2hhx7Kq1/96gGciE6ydgIATTC00wMAL25LPN577725/fbb89hjj+Xqq6/OmjVr\n0mq1xCMAAAPODiQ02AUXXJDPfOYzSZ773unt7c3RRx+de+65J3Pnzs2MGTM6PCEDxdoJADSBh+hA\nQ11//fV98fhCs2bNSrvdzqJFizowFQAAg5mAhIb63Oc+lyQ544wz+h1/85vfnCRZvnz5gM8EAMDg\n5hJWaKgxY8akp6cn69aty1577dV3CeumTZsyYsSIjB49Ok8++WSnx2SAWDsBgCawAwkNtSUWRo4c\n2e/4mjVrkjwXFAAAMJAEJDTUa1/72rTb7cybN6/v2EMPPZQLLrggSXLggQd2ajQAAAYpAQkN9a53\nvStJct555yV5bkdy3333zW233ZYkOf300zs2GwAAg5N7IKFBZs+enVarlSuuuCI9PT3p7u7Od77z\nna3OO/LII3PXXXdtdXkrr1zWTgCgCQQkNEhXV1ffw3KS5Omnn86nPvWpLFq0KOvWrcv48eNz4okn\n5sILL8yoUaM6PC0DydoJADSBgIQG+dWAhC2snQBAE7gHEgAAgJKhnR4A6K/dbuess84qnTt37tyd\nPA0AADzPJazQIF1d9YsCXOo6uFg7AYAmcAkrvEyJCQAABppLWKFhWq1W5s6du91AbLVaAzQRAAA8\nxyWs0CCewspLsXYCAE3gElYAAABKBCQ0jF0mAACayj2Q0CD//u//7t5GAAAayz2QAC8D1k4AoAlc\nwgoAAECJgAQAAKBEQAIAAFAiIAEAACgRkAAAAJRs9208lixZklmzZuUnP/lJpkyZkuuuuy5Tp07t\nd0673c7FF1+cr3zlK9mwYUMOOOCAzJ49O2ecccZOGxxeif7kT/5kh97GY+7cuTtxGgAA6G+bb+PR\n09OTAw44IGPGjMmll16aOXPmZMSIEVm5cmW6up7fvLz11ltzwgknZNq0aXn/+9+fyy+/PL/85S/z\nxBNPZMiQIf0/oUfRw0t64ffV9rRarfT29u7EaWgSaycA0ATb/Gn11ltvzbp163Luuedm5syZOfvs\ns7N69eosXry433m77rprkuS1r31t/vAP/zC77LJLdtlllx36YRjYMWICAICBts1LWFevXp0k2Wef\nffr9ueX4FkcddVSuuOKKfPzjH88///M/Z+TIkbnlllt26FI8IFm1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3\nfzs4IQPJ2gkANIFLWKGhnn322STJI4880u/4unXrkiS//OUvB3wmAAAGNwEJDbX//vun3W7n0ksv\nzcaNG5MkGzduzGWXXZYk2W+//To5HgAAg5CAhIY64YQTkiQLFizIhAkTcuihh2bChAm5+eabkyTH\nH398J8cDAGAQcg8kNNTDDz+cI444ou+S1RcaP358li1blvHjx3dgMjrB2gkANIEdSGioCRMm5O67\n787b3va2DBkyJEkydOjQvP3tb8/dd98tHgEAGHB2IOFlYOPGjXnsscey++67Z9SoUZ0ehw6wdgIA\nTSAgAV4GrJ0AQBMM7fQAwPMmTZqUVquVVatW9X38Ytrtdt95AAAwUOxAQoN0dXWl1Wqlt7c3XV3b\nvkV5y3kMDtZOAKAJ7EBCg+y///59u47777//Ns99qd1JAADYWexAArwMWDsBgCbwNh7QUF/60pcy\nb968F31t7dq1Wbt27QBPBADAYGcHEhrqhfdD7shrvDJZOwGAJrADCS8zohEAgE7xEB1okOXLl2f5\n8uV9O03tdnury1hXrFiRJBkxYsSAzwcAwOAmIKFBFi5cmNmzZ/c79v73v/9Fz508efIATAQAAM9z\nCSs0SPUet+HDh+eKK67YydMAAEB/HqIDDbJs2bIsW7YsSXLWWWclSa6//vq+75lWq5U999wzU6dO\nzWte85qOzcnAs3YCAE0gIKGhuru702q1cscdd3R6FBrA2gkANIFLWKGBNm7cmLVr12bNmjX58Y9/\n3OlxAAAgiR1IaKxx48blySefzMaNGzN8+PBOj0OHWTsBgCawAwkNddxxx6XdbvfdEwkAAJ1mBxIa\n6u67784pp5yScePGZc6cOZk6dWpGjRrV75z999+/Q9Mx0KydAEATCEhoqK6u/hcItFqtvo/b7XZa\nrVZ6e3sHeiw6xNoJADTB0E4PANT8ajyICQAABpqAhIZ63/vet83XX7gjCQAAA2G7l7AuWbIks2bN\nyk9+8pNMmTIl1113XaZOnbrVeQ888EDOP//8fOtb38qwYcNy4okn5sYbb9z6E7oMC2CHWTsBgCbY\n5lNYe3p6cuqpp+app57Ktddem0ceeSSnnXZaNm/e3O+8drudU045Jf/2b/+Wyy67LJ/85Cez9957\n79TBYTBZt25dfvSjH3V6DAAABrltBuStt96adevW5dxzz83MmTNz9tlnZ/Xq1Vm8eHG/8+644458\n//vfz8UXX5zLLrss55xzTv72b/92Z84Ng8Ldd9+dww8/PBMmTMjrXve6JMm73/3u/MEf/EGWLl3a\n4ekAABhsthmQq1evTpLss88+/f7ccnyLH/7wh0mSm2++OaNHj84uu+yST3/607/xYWEwWbFiRd76\n1rdmxYoV/Y7/zu/8ThYvXpyvfOUrHZoMAIDBaoceovNS998888wzSZLhw4dn4cKF+djHPpaLLroo\nb3vb2/Jbv/VbW51/5ZVX9n3c3d2d7u7uHRkDBoWPf/zj6enpyV577ZVHH3207/g73/nOXHnllbnz\nzjs7OB072+LFi7e62gMAoNO2GZCTJ09O8twDcpLkwQcf7Dve09OTIUOGZNiwYX3nnXDCCTnppJPy\n7W9/OytWrMjPfvaz7QYk8OLuvPPOtFqt3HbbbXn961/fd/zggw9Okvz85z/v1GgMgF/95drs2bM7\nNwwAwP/b5lNYn3nmmUycODGjR4/OpZdemjlz5mTkyJFZuXJlhg4dmilTpmTFihXZuHFjJk2alHHj\nxuUjH/lIrr766jzyyCP56U9/mj333LP/J/QkQSgZPnx4ent709PTkxEjRqTVaqW3tzcbNmzI7rvv\nnuHDh6enp6fTYzJArJ0AQBNs8x7IESNGZP78+Rk7dmwuuuiiTJgwIfPnz09X13N/bcv70I0aNSo3\n33xzRowYkfPPPz9jx47NggULtopHoG6vvfZKkvz3f/93v+Nf+tKXkiTjx48f8JkAABjctvs+kL/x\nT+i36FAyffr0/OM//mMOOOCA/OxnP0uSHHfccfnWt76Vdrud973vfbnhhhs6OiMDx9oJADSBgISG\n+tGPfpRp06a96GWqI0eOzPe+970ccsghHZiMTrB2AgBNsM1LWIHOOeSQQ3L77bf3PTRni4MOOijf\n/OY3xSMAAAPODiQ0SHd3d6ZPn57TTz89u+yyS9/xlStXZt26dRk/fnwOPPDADk5Ip1g7AYAmEJDQ\nIFseUDVy5MiceOKJOfPMM3P88cdn6NAdestWXoGsnQBAEwhIaJAtAflCe+yxR84444yceeaZOeqo\nozowFU1g7QQAmkBAQoN861vfyk033ZQFCxbk8ccf7/daq9XKpEmTcuaZZ+bMM890KesgY+0EAJpA\nQEIDPfvss7n11ltz0003ZdGiRdm4cWO/11utVn73d383S5cu7dCEDDRrJwDQBAISGu6pp57Kv/zL\nv+Smm27K7bffnk2bNiV57nupt7e3w9MxUKydAEATeDIHNNyYMWNy8sknp9VqZcOGDVmyZEmnRwIA\nYJASkNBQmzZtym233ZYvf/nL+frXv56NGzf224GyGwUAwEATkNAg7XY7d955Z7785S/nq1/9an7x\ni19sdc6kSZPy3ve+N9OnT+/AhAAADGYCEhpkv/32y0MPPbTV7uLuu++e008/PdOnT88b3/jGDk0H\nAMBg5yE60CAvfB/IESNG5IQTTsj06dNz/PHHZ9iwYR2cjE6zdgIATWAHEhrmmGOOyfTp03P66adn\n3LhxnR4HAAD6CEhokNWrV2fixImdHgMAAF5U1/ZPAQbKr/O+jqtWrdoJkwAAwNYEJDTIwQcfnDPP\nPDN33XXXds+988478973vje//du/PQCTAQCAh+hAo2x5iE6r1cqrX/3qvOlNb8phhx2WPffcM0ny\n6KOP5r777suSJUvy8MMP930vbd68uWMzMzCsnQBAEwhIaJClS5fmkksuyT333FM6/6ijjsrf/M3f\n5A1veMNOnoxOs3YCAE0gIKGBlixZks9//vO5/fbb88gjj/R7bfz48XnrW9+aD3zgAznmmGM67JKU\ndAAAD19JREFUNCEDzdoJADSBgISGe+CBB/Lwww8neS4e999//w5PRCdYOwGAJhCQAC8D1k4AoAm8\nDyQ03D333JNvfOMbefTRR7P33nvnhBNOyO///u93eiwAAAYhO5DQYDNnzsznP//5fsdarVY++MEP\n5rOf/WyHpqITrJ0AQBMISGioG264IWedddZLvn799ddnxowZAzgRnWTtBACaoKvTAwAvbsvO48SJ\nE3PttddmwYIFufbaazNx4sR+rwMAwECxAwkN9apXvSpPP/10li1blkM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e3Zs8dwYnPy/YCCJL148ULHjx9XaWmprl69ajpOzvX1\n9enNmzc6efKkpqamJEmxWEyfPn0ynAwAAMCsAtMB1lM4HFYymfxpPJFIKB6Py+v1rhjft2+f5ufn\ncxUvp35VC7vdrmQyKY/Hozt37igYDMrj8RhIaE5ZWZkkKRqNStLyNW+Z8XwzNjam2tpaFRUV6f79\n+3l5ivfU1JQ+fvwol8u1PHbr1i3ZbDZdv37dYDIAAACz8nIbjx8/fuju3buyWCxKp9Nqb2/X9+/f\n1d/fr7q6OtPxcu7EiRO6ffu2jh07psbGRqXTaVVXV8vpdJqOlhNzc3NyOBwqKiqSz+eT3++XzWbT\ny5cv8+7GKdFoVFVVVfry5Yv8fr8cDock5d1BhfHxcY2Pj0uSnj17posXL+ro0aPy+/06ePCg4XQA\nAADm5GUD+VelpaX6/Pmzvn37ZjqKEaWlpXr79u3yqZsWi0V9fX06deqU4WS5Ew6H5fV6NTExoYqK\nCgWDQVVWVpqOlXOhUEi1tbXLB1ekpe/D4uKi4WTmjIyMqKamRp2dnbpy5YrpOAAAAEbRQAIAAAAA\n1uSPvokOAAAAAOD3oYEEAAAAAKwJDSQAAAAAYE1oIAEAAAAAa0IDCQAAAABYExpIAAAAAMCa0EAC\nAAAAANbkf1M+pbyPupgkAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x792e430>"
+ ]
+ }
+ ],
+ "prompt_number": 95
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.9, Page number: 521<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display status of mouse button pressed \n",
+ "\n",
+ "from Tkinter import *\n",
+ "from tkFileDialog import askopenfilename\n",
+ "import Image, ImageTk\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " root = Tk()\n",
+ "\n",
+ " #setting up a tkinter canvas with scrollbars\n",
+ " frame = Frame(root, bd=2, relief=SUNKEN)\n",
+ " frame.grid_rowconfigure(0, weight=1)\n",
+ " frame.grid_columnconfigure(0, weight=1)\n",
+ " xscroll = Scrollbar(frame, orient=HORIZONTAL)\n",
+ " xscroll.grid(row=1, column=0, sticky=E+W)\n",
+ " yscroll = Scrollbar(frame)\n",
+ " yscroll.grid(row=0, column=1, sticky=N+S)\n",
+ " canvas = Canvas(frame, bd=0, xscrollcommand=xscroll.set, yscrollcommand=yscroll.set)\n",
+ " canvas.grid(row=0, column=0, sticky=N+S+E+W)\n",
+ " xscroll.config(command=canvas.xview)\n",
+ " yscroll.config(command=canvas.yview)\n",
+ " frame.pack(fill=BOTH,expand=1)\n",
+ "\n",
+ " \n",
+ "\n",
+ " #function to be called when mouse is clicked\n",
+ " def printcoords(event):\n",
+ " #outputting x and y coords to console\n",
+ " print \"Mouse Button pressed\"\n",
+ " print (event.x,event.y)\n",
+ " #mouseclick event\n",
+ " canvas.bind(\"<Button 1>\",printcoords)\n",
+ "\n",
+ " root.mainloop()\n",
+ " \n",
+ "import win32api, win32con\n",
+ "\n",
+ "print \"Current cursor position at \" \n",
+ "print win32api.GetCursorPos()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mouse Button pressed\n",
+ "(207, 115)\n",
+ "Current cursor position at "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(502, 188)\n"
+ ]
+ }
+ ],
+ "prompt_number": 108
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.10, Page number: 523<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Change mouse cursor.\n",
+ "\n",
+ "#Placing the cursor on top of the circle button will change the pointer to circle\n",
+ "# and plus button to plus symbol\n",
+ "\n",
+ "from Tkinter import *\n",
+ "import Tkinter\n",
+ "\n",
+ "top = Tkinter.Tk()\n",
+ "\n",
+ "B1 = Tkinter.Button(top, text =\"circle\", relief=RAISED,\\\n",
+ " cursor=\"circle\")\n",
+ "B2 = Tkinter.Button(top, text =\"plus\", relief=RAISED,\\\n",
+ " cursor=\"plus\")\n",
+ "B1.pack()\n",
+ "B2.pack()\n",
+ "top.mainloop()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 110
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter16.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter16.ipynb new file mode 100755 index 00000000..cafb9828 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter16.ipynb @@ -0,0 +1,2160 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 16: Marching Towards C++<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.1, Page number: 537<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read and display a string\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Initialize variable\n",
+ "name = raw_input(\"Enter Your Name : \")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Your name is %s\"%(name))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Name : Amit\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your name is Amit"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.2, Page number: 540<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the value of a variable using reference variable\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "qty = 10\n",
+ "qt = qty\n",
+ "#in python, value tagging method is used for storage. so there is no reference concept\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"qty\\tqt\\n\")\n",
+ "sys.stdout.write(\"%d\\t%d\\n\"%(qty,qt))\n",
+ "qt = qt + 1\n",
+ "qty = qty + 1\n",
+ "sys.stdout.write(\"%d\\t%d\\n\"%(qty,qt))\n",
+ "qty = qty - 1\n",
+ "qt = qt - 1\n",
+ "sys.stdout.write(\"%d\\t%d\\n\"%(qty,qt))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "qty\tqt\n",
+ "10\t10\n",
+ "11\t11\n",
+ "10\t10\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.3, Page number: 541<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to use scope access operator.\n",
+ "#Display the variaous values of the same variable declared at different scope levels.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 10\n",
+ "\n",
+ "def main():\n",
+ " a = 20\n",
+ " sys.stdout.write(\"::a = %d\"%(a))\n",
+ " return\n",
+ "\n",
+ "#There is no scope operator. Intendation is used to define scope/block of statements\n",
+ "main()\n",
+ "sys.stdout.write(\" a = %d\"%(a))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "::a = 20 a = 10"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.4, Page number: 542<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to read tow integers through the keyboard.\n",
+ "#Declare the variables in C++ style.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Read Variables\n",
+ "num = int(raw_input(\"Enter Two numbers : \"))\n",
+ "num1 = int(raw_input(\"Enter Two numbers : \"))\n",
+ "#No variable declaration is needed in python\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Entered Numbers are : %d %d\"%(num,num1))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Two numbers : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Two numbers : 9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entered Numbers are : 8 9"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.5, Page number: 543<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Length of a string\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#There is no variable declaration is needed in python\n",
+ "#Read string\n",
+ "name = raw_input(\"Enter Your Name : \")\n",
+ "\n",
+ "#Calculation\n",
+ "len1 = len(name)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"The length of the string is : %d\"%(len1))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Name : Santosh\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of the string is : 7"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.6, Page number: 544<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sum of numbers using function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def sum1(x,y):\n",
+ " return x+y\n",
+ "#Forward function definition is not possible in python.\n",
+ "#Otherwise wrap the function within the main() function\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 20\n",
+ "b = 2.5\n",
+ "\n",
+ "#Function call\n",
+ "sys.stdout.write(\"Sum = %f\"%(sum1(a,b)))\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum = 22.500000"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.7, Page number: 545<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Function with default arguments.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition\n",
+ "def sum1(j,k=10,l=15,m=20):\n",
+ " return j+k+l+m\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 2\n",
+ "b = 3\n",
+ "c = 4\n",
+ "d = 5\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Sum = %d\"%(sum1(a,b,c,d)))\n",
+ "sys.stdout.write(\"\\nSum = %d\"%(sum1(a,b,c)))\n",
+ "sys.stdout.write(\"\\nSum = %d\"%(sum1(a,b)))\n",
+ "sys.stdout.write(\"\\nSum = %d\"%(sum1(a)))\n",
+ "sys.stdout.write(\"\\nSum = %d\"%(sum1(b,c,d)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum = 14\n",
+ "Sum = 29\n",
+ "Sum = 40\n",
+ "Sum = 47\n",
+ "Sum = 32"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.8, Page number: 547<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Square of integer and float number using function overloading\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Function definition/ There is no seperate function definition is needed.\n",
+ "def sqr(s):\n",
+ " return s*s\n",
+ "\n",
+ "#Variable iNitialization\n",
+ "a = 15\n",
+ "b = 2.5\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Square = %d\"%(sqr(a)))\n",
+ "sys.stdout.write(\"\\nSquare = %f\"%(sqr(b)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square = 225\n",
+ "Square = 6.250000"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.9, Page number: 549<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display private and public member variables of the class.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class num:\n",
+ " def readdata(self,j,k):\n",
+ " self.x = j\n",
+ " self.y = k\n",
+ " \n",
+ " def display(self):\n",
+ " sys.stdout.write(\"x = %d y = %f\"%(self.x,self.y))\n",
+ "\n",
+ "#Object declaration\n",
+ "j = num()\n",
+ "\n",
+ "#Result\n",
+ "j.z = 'C'\n",
+ "j.readdata(10,10.5)\n",
+ "j.display()\n",
+ "sys.stdout.write(\" z = %c\"%(j.z))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 10 y = 10.500000 z = C"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.10, Page number: 550<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Private and public data member of a class.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class player:\n",
+ " def __init__(self,name=None,height=0,weight=0):\n",
+ " self.name = name\n",
+ " self.height = height\n",
+ " self.weight = weight\n",
+ " \n",
+ "#Object declaration\n",
+ "a = player()\n",
+ "\n",
+ "#Variable Initialization\n",
+ "#There is no need/concept for private variables in python.\n",
+ "a.name = \"Sanjay\"\n",
+ "a.height = 5.5\n",
+ "a.weight = 38\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Height : %d\"%(a.height))\n",
+ "sys.stdout.write(\"\\nWeight : %d\"%(a.weight))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height : 5\n",
+ "Weight : 38"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.11, Page number: 551<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Class with member variables and functions. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class player:\n",
+ " def __init__(self,name=None,height=0,weight=0):\n",
+ " self.name = name\n",
+ " self.height = height\n",
+ " self.weight = weight\n",
+ " \n",
+ " def setdata(self):\n",
+ " self.name = raw_input(\"Enter Name Age Height Weight\")\n",
+ " self.age = int(raw_input(\"Enter Name Age Height Weight\"))\n",
+ " self.height = float(raw_input(\"Enter Name Age Height Weight\"))\n",
+ " self.weight = int(raw_input(\"Enter Name Age Height Weight\"))\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"\\nName : %s\"%(self.name))\n",
+ " sys.stdout.write(\"\\nAge : %d\"%(self.age))\n",
+ " sys.stdout.write(\"\\nHeight : %f\"%(self.height))\n",
+ " sys.stdout.write(\"\\nWeight : %d\"%(self.weight))\n",
+ " \n",
+ "#Object declaration\n",
+ "a = player()\n",
+ "\n",
+ "#Function call\n",
+ "a.setdata()\n",
+ "a.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name Age Height WeightSanjay\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name Age Height Weight24\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name Age Height Weight5.5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name Age Height Weight54\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Name : Sanjay\n",
+ "Age : 24\n",
+ "Height : 5.500000\n",
+ "Weight : 54"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.12, Page number: 552<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Class with member variables and functions.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class player:\n",
+ " def __init__(self,name=None,height=0,weight=0):\n",
+ " self.name = name\n",
+ " self.height = height\n",
+ " self.weight = weight\n",
+ " \n",
+ " def setdata(self):\n",
+ " self.name = raw_input(\"Enter Name Age Height Weight\")\n",
+ " self.age = int(raw_input(\"Enter Name Age Height Weight\"))\n",
+ " self.height = float(raw_input(\"Enter Name Age Height Weight\"))\n",
+ " self.weight = int(raw_input(\"Enter Name Age Height Weight\"))\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"\\nName : %s\"%(self.name))\n",
+ " sys.stdout.write(\"\\nAge : %d\"%(self.age))\n",
+ " sys.stdout.write(\"\\nHeight : %f\"%(self.height))\n",
+ " sys.stdout.write(\"\\nWeight : %d\"%(self.weight))\n",
+ "#In python, member functions should be defined inside the class instance\n",
+ "\n",
+ "#Object declaration\n",
+ "a = player()\n",
+ "\n",
+ "#Function call\n",
+ "a.setdata()\n",
+ "a.show() "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name Age Height WeightAjay\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name Age Height Weight24\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name Age Height Weight5.2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Name Age Height Weight45\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Name : Ajay\n",
+ "Age : 24\n",
+ "Height : 5.200000\n",
+ "Weight : 45"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.13, Page number: 554<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Static data member. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class sumnum:\n",
+ " def __init__(self,num = 0):\n",
+ " self.num = num\n",
+ " \n",
+ " def input1(self,c):\n",
+ " self.num = int(raw_input(\"Enter Number : \"))\n",
+ " c = c + self.num\n",
+ " return c\n",
+ " \n",
+ " def sum1(self,c):\n",
+ " sys.stdout.write(\"The sum of entered numbers is %d\"%(c))\n",
+ " \n",
+ "#Object declaration\n",
+ "a = sumnum()\n",
+ "b = sumnum()\n",
+ "c1 = sumnum()\n",
+ "c = 0\n",
+ "\n",
+ "#Function call\n",
+ "#There is no static variable in python\n",
+ "c = a.input1(c)\n",
+ "c = b.input1(c)\n",
+ "c = c1.input1(c)\n",
+ "\n",
+ "a.sum1(c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sum of entered numbers is 14"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.14, Page number: 555<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Static member functions \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class bita:\n",
+ " def __initi__(self):\n",
+ " self.c = 0\n",
+ " \n",
+ " @staticmethod \n",
+ " def count(c):\n",
+ " c = c + 1\n",
+ " return c\n",
+ " \n",
+ " @staticmethod\n",
+ " def display(k,c):\n",
+ " k = k + 1\n",
+ " sys.stdout.write(\"\\nCall Number : %d\"%(k))\n",
+ " sys.stdout.write(\"\\nValue of c : %d\"%(c))\n",
+ " return k\n",
+ " \n",
+ "#Object declaration\n",
+ "b = bita()\n",
+ "c1 = bita()\n",
+ "\n",
+ "c = 0\n",
+ "k = 0\n",
+ "\n",
+ "#Function call\n",
+ "k = bita.display(k,c)\n",
+ "c = bita.count(c)\n",
+ "c = b.count(c)\n",
+ "c = c1.count(c)\n",
+ "k = bita.display(k,c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Call Number : 1\n",
+ "Value of c : 0\n",
+ "Call Number : 2\n",
+ "Value of c : 3"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.15, Page number: 557<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Array of objects to maintain records of bank \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class bank:\n",
+ " def __init__(self):\n",
+ " self.city = None\n",
+ " self.bank = None\n",
+ " self.branches = 0\n",
+ " self.no_ac = 0\n",
+ " \n",
+ " def input1(self):\n",
+ " self.city = raw_input(\"City Name : \")\n",
+ " self.bank = raw_input(\"Bank Name : \")\n",
+ " self.branches = int(raw_input(\"Total Branches : \"))\n",
+ " self.no_ac = int(raw_input(\"Number of A/c : \"))\n",
+ " \n",
+ " def console(self):\n",
+ " sys.stdout.write(\"\\n\\nCity Name : %s\"%(self.city))\n",
+ " sys.stdout.write(\"\\nBank Name : %s\"%(self.bank))\n",
+ " sys.stdout.write(\"\\nTotal Branches : %d\"%(self.branches))\n",
+ " sys.stdout.write(\"\\nNumber of A/c : %d\"%(self.no_ac))\n",
+ " \n",
+ "#Object declaration\n",
+ "ms = [bank() for i in range(0,2)]\n",
+ "\n",
+ "#Processing\n",
+ "for k in range(0,2):\n",
+ " ms[k].input1()\n",
+ " \n",
+ "for k in range(0,2):\n",
+ " ms[k].console()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "City Name : Nanded\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bank Name : SNSB\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Branches : 10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of A/c : 7500\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "City Name : Latur\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bank Name : SNSB\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Branches : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of A/c : 5400\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "City Name : Nanded\n",
+ "Bank Name : SNSB\n",
+ "Total Branches : 10\n",
+ "Number of A/c : 7500\n",
+ "\n",
+ "City Name : Latur\n",
+ "Bank Name : SNSB\n",
+ "Total Branches : 8\n",
+ "Number of A/c : 5400"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.16, Page number: 559<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Accessing private data using non member function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class ac:\n",
+ " def __init__(self):\n",
+ " self.name = None\n",
+ " self.acno = 0\n",
+ " self.bal = 0\n",
+ " \n",
+ " def read(self):\n",
+ " self.name = raw_input(\"Name : \")\n",
+ " self.acno = int(raw_input(\"A/c No :\"))\n",
+ " self.bal = int(raw_input(\"Balance : \"))\n",
+ " \n",
+ "#Non member function\n",
+ "def showbal(a):\n",
+ " sys.stdout.write(\"\\nBalance of A/c no. %d is Rs. %d\"%(a.acno,a.bal))\n",
+ " \n",
+ "#object declaration\n",
+ "k = ac()\n",
+ "\n",
+ "#Function call\n",
+ "k.read()\n",
+ "showbal(k)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name : Manoj\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A/c No :474\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Balance : 40000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Balance of A/c no. 474 is Rs. 40000"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.17, Page number: 561<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Friend function in two classes. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class first:\n",
+ " def __init__(self):\n",
+ " self.f = 0\n",
+ " \n",
+ " def getvalue(self):\n",
+ " self.f = int(raw_input(\"Enter a number : \"))\n",
+ " \n",
+ "class second:\n",
+ " def __init__(self):\n",
+ " self.s = 0\n",
+ " \n",
+ " def getvalue(self):\n",
+ " self.s = int(raw_input(\"Enter a number : \"))\n",
+ " \n",
+ " \n",
+ "#Non member function\n",
+ "def sum1(d,t):\n",
+ " sys.stdout.write(\"\\nSum of two numbers : %d\"%(t.f+d.s))\n",
+ " \n",
+ "#Object declaration\n",
+ "a = first()\n",
+ "b = second()\n",
+ "\n",
+ "#Function call\n",
+ "a.getvalue()\n",
+ "b.getvalue()\n",
+ "sum1(b,a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Sum of two numbers : 15"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.18, Page number: 562<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#String Replacement\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class fandr:\n",
+ " def __init__(self):\n",
+ " self.str1 = None\n",
+ " self.f = ''\n",
+ " self.r = ''\n",
+ " \n",
+ " def accept(self):\n",
+ " #Since string object does not support item assignment, initialize the string as character array\n",
+ " self.str1 = ['P','r','o','g','r','a','_','e','r']\n",
+ " self.f = raw_input(\"Find what (char) \")\n",
+ " self.r = raw_input(\"Replace with (char) \")\n",
+ " \n",
+ " def display(self,d):\n",
+ " sys.stdout.write(\"%c\"%(self.str1[d]))\n",
+ " \n",
+ " def len1(self):\n",
+ " self.l = len(self.str1)\n",
+ " return self.l\n",
+ " \n",
+ " def find(self,i):\n",
+ " if self.str1[i] == self.f:\n",
+ " self.replace(i)\n",
+ " \n",
+ " def replace(self,k):\n",
+ " self.str1[k] = self.r\n",
+ " \n",
+ "#Object declaration\n",
+ "b = fandr()\n",
+ "\n",
+ "#function call\n",
+ "b.accept()\n",
+ "l = b.len1()\n",
+ "sys.stdout.write(\"\\nReplaced text : \")\n",
+ "\n",
+ "for i in range(0,l):\n",
+ " b.find(i)\n",
+ " b.display(i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Find what (char) _\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Replace with (char) m\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Replaced text : Programer"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.19, Page number: 564<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Largest out of ten numbers.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class num:\n",
+ " def __init__(self):\n",
+ " self.number = [0 for i in range(0,10)]\n",
+ " \n",
+ " def input1(self,i):\n",
+ " self.number[i] = int(raw_input(\"Enter Number (%d) : \"%(i+1)))\n",
+ " return self.number[i]\n",
+ " \n",
+ " def large(self,s,m):\n",
+ " if self.number[s] == m:\n",
+ " sys.stdout.write(\"\\nLargest number : %d\"%(self.number[s]))\n",
+ " return 0\n",
+ " else:\n",
+ " return 1\n",
+ " \n",
+ "#Object declaration\n",
+ "b = num()\n",
+ "\n",
+ "sum1 = 0\n",
+ "c = 1\n",
+ "\n",
+ "#Sum\n",
+ "for i in range(0,10):\n",
+ " sum1 = sum1 + b.input1(i)\n",
+ " \n",
+ "#largest\n",
+ "for k in range(sum1,0,-1):\n",
+ " for i in range(0,10):\n",
+ " if c == 1:\n",
+ " c = b.large(i,k)\n",
+ " else:\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (1) : 125\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (2) : 654\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (3) : 246\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (4) : 945\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (5) : 258\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (6) : 159\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (7) : 845\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (8) : 940\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (9) : 944\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number (10) : 485\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Largest number : 945"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.20, Page number: 567<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Constructor to initialize the class member variables \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class num:\n",
+ " #Constructor\n",
+ " def __init__(self):\n",
+ " sys.stdout.write(\"\\nConstructor called\")\n",
+ " self.x = 5\n",
+ " self.a = 0\n",
+ " self.b = 1\n",
+ " self.c = 2\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"\\nx = %d a = %d b = %d c = %d\"%(self.x,self.a,self.b,self.c))\n",
+ " \n",
+ "#Object declaration\n",
+ "x = num()\n",
+ "\n",
+ "#Function call\n",
+ "x.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Constructor called\n",
+ "x = 5 a = 0 b = 1 c = 2"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.21, Page number: 569<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Constructor with arguments \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class num:\n",
+ " #Constructor\n",
+ " def __init__(self,m,j,k):\n",
+ " self.a = m\n",
+ " self.b = j\n",
+ " self.c = k\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"\\na = %d b = %d c = %d\"%(self.a,self.b,self.c))\n",
+ " \n",
+ " \n",
+ "#Object declaration\n",
+ "x = num(4,5,7)\n",
+ "y = num(1,2,8)\n",
+ "\n",
+ "#Function call\n",
+ "x.show()\n",
+ "y.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "a = 4 b = 5 c = 7\n",
+ "a = 1 b = 2 c = 8"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.22, Page number: 571<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Constructor overloading\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class num:\n",
+ " def __init__(self,m = None,j = None,k = None):\n",
+ " if m and j and k is not None:\n",
+ " sys.stdout.write(\"Constructor with three arguments\")\n",
+ " self.a = m\n",
+ " self.b = j\n",
+ " self.c = k\n",
+ " \n",
+ " else:\n",
+ " if m and j is not None:\n",
+ " sys.stdout.write(\"Constructor with two arguments\")\n",
+ " self.a = m\n",
+ " self.b = j\n",
+ " self.c = ''\n",
+ " else:\n",
+ " if m == j == k == None:\n",
+ " sys.stdout.write(\"Constructor without arguments\")\n",
+ " self.a = 0\n",
+ " self.b = 0\n",
+ " self.c = ''\n",
+ " \n",
+ " \n",
+ " def show(self): \n",
+ " sys.stdout.write(\"\\na = %d b = %f c = \"%(self.a,self.b))\n",
+ " print self.c\n",
+ " \n",
+ " \n",
+ "#Object declaration\n",
+ "\n",
+ "x = num(4,5.5,'A')\n",
+ "x.show()\n",
+ "\n",
+ "y = num(1,2.2)\n",
+ "y.show()\n",
+ "\n",
+ "z = num()\n",
+ "z.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Constructor with three arguments\n",
+ "a = 4 b = 5.500000 c = A\n",
+ "Constructor with two arguments\n",
+ "a = 1 b = 2.200000 c = \n",
+ "Constructor without arguments\n",
+ "a = 0 b = 0.000000 c = \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.23, Page number: 573<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Default arguments in constructor. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class power:\n",
+ " def __init__(self,n = 9,p = 3):\n",
+ " self.num = n\n",
+ " self.power = p\n",
+ " self.ans = pow(n,p)\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"\\n%d raise to %d is %d\"%(self.num,self.power,self.ans))\n",
+ " \n",
+ " \n",
+ "#Object declaration\n",
+ "p1 = power()\n",
+ "p2 = power(5)\n",
+ "\n",
+ "#Result\n",
+ "p1.show()\n",
+ "p2.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "9 raise to 3 is 729\n",
+ "5 raise to 3 is 125"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.24, Page number: 575<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Object with reference to constructor. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class num:\n",
+ " #There is no overloading concept in python\n",
+ " def __init__(self,k=None,j=None):\n",
+ " if k is not None:\n",
+ " self.n = k\n",
+ " return\n",
+ " else:\n",
+ " if j is not None:\n",
+ " self.n = j.n\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"%d\"%(self.n))\n",
+ " \n",
+ "#Object creation\n",
+ "J = num(50)\n",
+ "K = num(J.n)\n",
+ "L = num()\n",
+ "L = J\n",
+ "M = num()\n",
+ "M = J\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nObject J Value of n : \")\n",
+ "J.show()\n",
+ "sys.stdout.write(\"\\nObject K Value of n : \")\n",
+ "K.show()\n",
+ "sys.stdout.write(\"\\nObject L Value of n : \")\n",
+ "L.show()\n",
+ "sys.stdout.write(\"\\nObject M Value of n : \")\n",
+ "M.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Object J Value of n : 50\n",
+ "Object K Value of n : 50\n",
+ "Object L Value of n : 50\n",
+ "Object M Value of n : 50"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.25, Page number: 576<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Destructors\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "c = 0\n",
+ "\n",
+ "#Class definition\n",
+ "class num:\n",
+ " def __init__(self,c):\n",
+ " c = c + 1\n",
+ " sys.stdout.write(\"\\nObject Created : Object(%d)\"%(c))\n",
+ " \n",
+ " \n",
+ " def __exit__(self, type, value, traceback,c):\n",
+ " self.package_obj.cleanup()\n",
+ " sys.stdout.write(\"\\nObject Released : Object(%d)\"%(c))\n",
+ " c = c - 1\n",
+ " \n",
+ " \n",
+ "#Object creation\n",
+ "sys.stdout.write(\"\\nIn main()\\n\")\n",
+ "a = num(c)\n",
+ "b = num(c)\n",
+ "\n",
+ "sys.stdout.write(\"\\nIn Block A()\\n\")\n",
+ "c = num(c)\n",
+ "\n",
+ "sys.stdout.write(\"\\n\\nAgain in main()\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "In main()\n",
+ "\n",
+ "Object Created : Object(1)\n",
+ "Object Created : Object(1)\n",
+ "In Block A()\n",
+ "\n",
+ "Object Created : Object(1)\n",
+ "\n",
+ "Again in main()\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.26, Page number: 579<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Overload unary ++ operator\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class num:\n",
+ " def input1(self):\n",
+ " self.a = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " self.b = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " self.c = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " self.d = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"\\nA = %d B = %d C = %d D = %d\"%(self.a,self.b,self.c,self.d))\n",
+ " \n",
+ " def operatorplusplus(self):\n",
+ " self.a = self.a + 1\n",
+ " self.b = self.b + 1\n",
+ " self.c = self.c + 1\n",
+ " self.d = self.d + 1\n",
+ " \n",
+ "#Object creation\n",
+ "X = num()\n",
+ "\n",
+ "X.input1()\n",
+ "sys.stdout.write(\"\\nBefore Overloading X : \")\n",
+ "X.show()\n",
+ "\n",
+ "#There is no operator overloading in python\n",
+ "X.operatorplusplus()\n",
+ "sys.stdout.write(\"\\nAfter Overloading X : \")\n",
+ "X.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Before Overloading X : \n",
+ "A = 4 B = 5 C = 8 D = 9\n",
+ "After Overloading X : \n",
+ "A = 5 B = 6 C = 9 D = 10"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.27, Page number: 581<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Overload + binary operator\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class num:\n",
+ " def input1(self):\n",
+ " self.a = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " self.b = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " self.c = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " self.d = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"A = %d B = %d C = %d D = %d\"%(self.a,self.b,self.c,self.d))\n",
+ " \n",
+ " def operatorplus(self,t):\n",
+ " tmp = num()\n",
+ " tmp.a = self.a + t.a\n",
+ " tmp.b = self.b + t.b\n",
+ " tmp.c = self.c + t.c\n",
+ " tmp.d = self.d + t.d\n",
+ " return tmp\n",
+ " \n",
+ "#Object creation\n",
+ "X = num()\n",
+ "Y = num()\n",
+ "Z = num()\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nObject X \")\n",
+ "X.input1()\n",
+ "sys.stdout.write(\"\\nObject Y \")\n",
+ "Y.input1()\n",
+ "\n",
+ "Z = X.operatorplus(Y)\n",
+ "\n",
+ "sys.stdout.write(\"\\nX : \")\n",
+ "X.show()\n",
+ "sys.stdout.write(\"\\nY : \")\n",
+ "Y.show()\n",
+ "sys.stdout.write(\"\\nZ : \")\n",
+ "Z.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Object X "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Object Y "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "X : A = 1 B = 4 C = 2 D = 1\n",
+ "Y : A = 2 B = 5 C = 4 D = 2\n",
+ "Z : A = 3 B = 9 C = 6 D = 3"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.28, Page number: 583<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Multiplication using an integer and object. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class definition\n",
+ "class num:\n",
+ " def input1(self):\n",
+ " self.a = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " self.b = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " self.c = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " self.d = int(raw_input(\"Enter Values for a,b,c and d : \"))\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"A = %d B = %d C = %d D = %d\"%(self.a,self.b,self.c,self.d))\n",
+ " \n",
+ "def operatormul(a,t):\n",
+ " tmp = num()\n",
+ " tmp.a = a * t.a\n",
+ " tmp.b = a * t.b\n",
+ " tmp.c = a * t.c\n",
+ " tmp.d = a * t.d\n",
+ " return tmp\n",
+ "\n",
+ "#Result\n",
+ "X = num()\n",
+ "Z = num()\n",
+ "\n",
+ "sys.stdout.write(\"\\nObject X \")\n",
+ "X.input1()\n",
+ "\n",
+ "Z = operatormul(3,X)\n",
+ "sys.stdout.write(\"\\nX : \")\n",
+ "X.show()\n",
+ "sys.stdout.write(\"\\nZ : \")\n",
+ "Z.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Object X "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a,b,c and d : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "X : A = 1 B = 2 C = 2 D = 3\n",
+ "Z : A = 3 B = 6 C = 6 D = 9"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.29, Page number: 585<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Inheritance\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Class declaration\n",
+ "class one:\n",
+ " def __init__(self):\n",
+ " self.a = 0\n",
+ " self.b = 0\n",
+ " \n",
+ "class two(one):\n",
+ " def __init__(self):\n",
+ " one.__init__(self)\n",
+ " self.c = 0\n",
+ " self.d = 0\n",
+ " \n",
+ " def input1(self):\n",
+ " self.a = int(raw_input(\"Enter values for a,b,c,d : \"))\n",
+ " self.b = int(raw_input(\"Enter values for a,b,c,d : \"))\n",
+ " self.c = int(raw_input(\"Enter values for a,b,c,d : \"))\n",
+ " self.d = int(raw_input(\"Enter values for a,b,c,d : \"))\n",
+ " \n",
+ " def display(self):\n",
+ " sys.stdout.write(\"\\na = %d b = %d c = %d d = %d\"%(self.a,self.b,self.c,self.d))\n",
+ " \n",
+ "#Object declaration\n",
+ "a = two()\n",
+ "\n",
+ "#Result\n",
+ "a.input1()\n",
+ "a.display()\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter values for a,b,c,d : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter values for a,b,c,d : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter values for a,b,c,d : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter values for a,b,c,d : 7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "a = 2 b = 5 c = 4 d = 7"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.30, Page number: 586<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Member function using pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#class declaration\n",
+ "class super1:\n",
+ " def display(self):\n",
+ " sys.stdout.write(\"\\nIn function display() class super\")\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"\\nIn function show() class super\")\n",
+ " \n",
+ "class sub(super1):\n",
+ " def display(self):\n",
+ " sys.stdout.write(\"\\nIn function display() class sub\")\n",
+ " \n",
+ " def show(self):\n",
+ " sys.stdout.write(\"\\nIn function show() class sub\")\n",
+ " \n",
+ "#Object declaration\n",
+ "S = super1()\n",
+ "A = sub()\n",
+ "\n",
+ "#There is no pointer concept in python\n",
+ "S.display()\n",
+ "S.show()\n",
+ "\n",
+ "sys.stdout.write(\"\\n\\nNow Pointer point points to derived class sub\\n\")\n",
+ "A.display()\n",
+ "A.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "In function display() class super\n",
+ "In function show() class super\n",
+ "\n",
+ "Now Pointer point points to derived class sub\n",
+ "\n",
+ "In function display() class sub\n",
+ "In function show() class sub"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter3.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter3.ipynb new file mode 100755 index 00000000..880e4fac --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter3.ipynb @@ -0,0 +1,1060 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 3: Operators and Expressions<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.1, Page number: 22<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to demonstrate the use of Comma operator\n",
+ "\n",
+ "#Result\n",
+ "print \"Addition = \",2+3,\" \\nSubtraction = \",5-4"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Addition = 5 \n",
+ "Subtraction = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.2, Page number: 23<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to demonstrate the use of Conditional operator with two values\n",
+ "\n",
+ "#Result\n",
+ "#in python if..else statement can be written similar to conditional operator\n",
+ "#prints Result = 4 if 2 == 3, otherwise Result = 5\n",
+ "\n",
+ "print \"Result = \",4 if 2==3 else 5"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Result = 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.3, Page number: 23<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to use Conditional operator with two statements\n",
+ "\n",
+ "#Result\n",
+ "#in python if..else statement can be written similar to conditional operator\n",
+ "#prints True if 3>2, otherwise prints False\n",
+ "\n",
+ "print \"True\" if 3>2 else \"False\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "True\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.4, Page number: 25<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to use increment operator as prefix\n",
+ "\n",
+ "#Variable declaration\n",
+ "x = 10\n",
+ "y = 20\n",
+ "\n",
+ "#Calculation\n",
+ "#there is no ++/-- operator in python\n",
+ "\n",
+ "z = x * y\n",
+ "y += 1\n",
+ "a = x * y\n",
+ "\n",
+ "#Result\n",
+ "print z,\" \",a"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "200 210\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.5, Page number: 25<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to use increment operator as prefix\n",
+ "\n",
+ "#Variable declaration\n",
+ "x = 10\n",
+ "y = 20\n",
+ "\n",
+ "#Calculation\n",
+ "#there is no ++/-- operator in python\n",
+ "\n",
+ "y += 1\n",
+ "z = x * y\n",
+ "a = x * y\n",
+ "\n",
+ "#Result\n",
+ "print z,\" \",a"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "210 210\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.6, Page number: 26<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to find the size and address of integer and float variables\n",
+ "\n",
+ "#import python module\n",
+ "#sys python module is required for getsizeof() function.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "#No specific float type variable declaration is available in python. If we\n",
+ "#assign a floating point value to a variable,\n",
+ "#it will be treated as floating point variable\n",
+ "x = 2\n",
+ "y = 2.0\n",
+ "\n",
+ "#Result\n",
+ "#In python, integer variable uses 12 bytes and float variable uses 16 bytes of\n",
+ "#memory to store the variables\n",
+ "#sys.getsizeof() function returns the size of variable in bytes which is similar\n",
+ "#to sizeof() operator\n",
+ "#id() function returns the address of variables which is similar to '&' operator\n",
+ "\n",
+ "print \"Size (x) = \",sys.getsizeof(x)\n",
+ "print \"Size (y) = \",sys.getsizeof(y)\n",
+ "print \"Address of x = \",id(x),\"and y = \",id(y)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Size (x) = 12\n",
+ "Size (y) = 16\n",
+ "Address of x = 5626076 and y = 54761072\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.7, Page number: 27<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to use various relational operators and display their return values\n",
+ "\n",
+ "#Result\n",
+ "#int() function is used to convert the boolean return value of the relational\n",
+ "#expression to integer/binary\n",
+ "\n",
+ "print \"Condition : Return Values\"\n",
+ "print \"10 != 10 : \",int(10 != 10)\n",
+ "print \"10 == 10 : \",int(10 == 10)\n",
+ "print \"10 >= 10 : \",int(10 >= 10)\n",
+ "print \"10 <= 100 : \",int(10 <= 100)\n",
+ "print \"10 != 9 : \",int(10 != 9)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Condition : Return Values\n",
+ "10 != 10 : 0\n",
+ "10 == 10 : 1\n",
+ "10 >= 10 : 1\n",
+ "10 <= 100 : 1\n",
+ "10 != 9 : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.8, Page number: 28<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program uses conditional operator to determine the value of 'b'depending the inputted value of 'a'\n",
+ "\n",
+ "#Reads Input value for a\n",
+ "\n",
+ "a = raw_input(\"Enter Any Integer either above 5 or below 5 :-\")\n",
+ "a = int(a)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Calculation\n",
+ "#Assigns b = 3 if a > 5, otherwise b = 4\n",
+ "b = 3 if a > 5 else 4\n",
+ "\n",
+ "#Result\n",
+ "print \"Calculated Value of b is :- \",b"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Any Integer either above 5 or below 5 :-6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Calculated Value of b is :- 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.9, Page number: 28<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to determine the value of 'b' using conditional operator\n",
+ "\n",
+ "#Input\n",
+ "\n",
+ "a = raw_input(\"Enter Any Integer either above 5 or below 5 :-\")\n",
+ "a = int(a)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Calculation\n",
+ "#Assigns b = 3 if a == 5, otherwise b = 4\n",
+ "b = 3 if a == 5 else 4\n",
+ "\n",
+ "#Result\n",
+ "print \"Calculated Value of b is :- \",b"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Any Integer either above 5 or below 5 :-3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Calculated Value of b is :- 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.10, Page number: 29<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read three variables x, y and z and Using conditional statements, evaluate\n",
+ "#values of variables a, b and c.\n",
+ "#Perform the sum with two sets of variables. Check whether the sums are equal or not\n",
+ "#and print appropriate messages.\n",
+ "\n",
+ "\n",
+ "#Reads three Input values for x,y and z\n",
+ "\n",
+ "x = raw_input(\"Enter Value of x \")\n",
+ "x = int(x)\n",
+ "\n",
+ "y = raw_input(\"Enter Value of y \")\n",
+ "y = int(y)\n",
+ "\n",
+ "z = raw_input(\"Enter Value of z \")\n",
+ "z = int(z)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Calculation\n",
+ "#Assigns a = 3 if x >= 5, otherwise a = 4\n",
+ "a = 3 if x >= 5 else 4\n",
+ "\n",
+ "#Result\n",
+ "print \"Calculated Value of a is :- \",a\n",
+ "\n",
+ "#Calculation\n",
+ "#Assigns b = 10 if y <= 8, otherwise b = 9\n",
+ "b = 10 if y <= 8 else 9\n",
+ "\n",
+ "#Result\n",
+ "print \"Calculated Value of b is :- \",b\n",
+ "\n",
+ "#Calculation\n",
+ "#Assigns c = 20 if z == 10, otherwise c = 30\n",
+ "c = 20 if z == 10 else 30\n",
+ "\n",
+ "#Result\n",
+ "print \"Calculated Value of c is :- \",c\n",
+ "\n",
+ "#Calculation\n",
+ "m = x + y + z\n",
+ "n = a + b + c\n",
+ "\n",
+ "#Result\n",
+ "print \"Addition of x,y,z is \",m,\"(m)\"\n",
+ "print \"Addition of a,b,c is \",n,\"(n)\"\n",
+ "print \"m & n NOT EQUAL\" if m != n else \"m & n ARE EQUAL\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of x 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of y 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of z 7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Calculated Value of a is :- 3\n",
+ "Calculated Value of b is :- 10\n",
+ "Calculated Value of c is :- 30\n",
+ "Addition of x,y,z is 14 (m)\n",
+ "Addition of a,b,c is 43 (n)\n",
+ "m & n NOT EQUAL\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.11, Page number: 30<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of logical operators\n",
+ "\n",
+ "#Result\n",
+ "#In python, not equal to can be represented using both != and <>.\n",
+ "\n",
+ "print \"Condition : Return Values\"\n",
+ "print \"5 > 3 && 5 < 10 : \",int(5 > 3 & 5 < 10)\n",
+ "print \"8 > 5 || 8 < 2 : \",int(8 > 5 | 8 < 2)\n",
+ "print \"!(8 == 8) : \",int(8 != 8)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Condition : Return Values\n",
+ "5 > 3 && 5 < 10 : 1\n",
+ "8 > 5 || 8 < 2 : 0\n",
+ "!(8 == 8) : 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.12, Page number: 30<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print logic 1 if input character is capital otherwise 0\n",
+ "\n",
+ "#Import\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#raw_input() function is used to read a character from the keyboard in Python 2.7\n",
+ "#ord() function converts the character into its corresponding ASCII integer\n",
+ "\n",
+ "\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "x = raw_input(\"Enter a Character : \")\n",
+ "x = ord(x)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Condition\n",
+ "y = 1 if (x >= 65) and (x <= 90) else 0\n",
+ "\n",
+ "#Result\n",
+ "print \"Y : \",y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Character : A\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.13, Page number: 31<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display logic 0 if one reads a character through keyboard otherwise logic 1.\n",
+ "#ASCII values for 0 to 9 are 48 to 57 respectively\n",
+ "\n",
+ "#Variable initialization\n",
+ "#raw_input() function is used to read a character from the keyboard in Python 2.7\n",
+ "#ord() function converts the character into its corresponding ASCII integer\n",
+ "\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "x = raw_input(\"Enter The Character or Integer : \")\n",
+ "x = ord(x)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Condition\n",
+ "y = 1 if (x >= 48) and (x <= 57) else 0\n",
+ "\n",
+ "#Result\n",
+ "print \"Value of Y = \",y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter The Character or Integer : A\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Y = 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.14, Page number: 32<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display 1 if inputted number is between 1-100 otherwise 0.\n",
+ "#Use the logical AND operator\n",
+ "\n",
+ "#Variable initialization\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "x = raw_input(\"Enter numbers : \")\n",
+ "x = int(x)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Condition\n",
+ "z = 1 if (x >= 1) and (x <= 100) else 0\n",
+ "\n",
+ "#Result\n",
+ "print \"Z = \",z"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter numbers : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Z = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.15, Page number: 32<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display 1 if inputted number is either 1 or 100 otherwise 0.\n",
+ "#Use the logical OR operator\n",
+ "\n",
+ "#Variable initialization\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "x = raw_input(\"Enter numbers : \")\n",
+ "x = int(x)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Condition\n",
+ "z = 1 if (x == 1) or (x == 100) else 0\n",
+ "\n",
+ "#Result\n",
+ "print \"Z = \",z"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter numbers : 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Z = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.16, Page number: 33<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display 1 if inputted number is except 100 otherwise 0.\n",
+ "#Use the logical NOT operator\n",
+ "\n",
+ "#Variable initialization\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "x = raw_input(\"Enter number : \")\n",
+ "x = int(x)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Condition\n",
+ "z = 1 if (x != 100) else 0\n",
+ "\n",
+ "#Result\n",
+ "print \"Z : \",z"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number : 100\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Z : 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.17, Page number: 33<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Shift inputted data by two bits right\n",
+ "\n",
+ "#Variable initialization\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "x = raw_input(\"Read The Integer from keyboard (x) :- \")\n",
+ "x = int(x)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#bitwise shifting\n",
+ "x >>= 2\n",
+ "y = x\n",
+ "\n",
+ "#Result\n",
+ "print \"The Right shifted data is = \",y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Read The Integer from keyboard (x) :- 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Right shifted data is = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.18, Page number: 34<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Shift inputted data by two bits to the left\n",
+ "\n",
+ "#Variable initialization\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "x = raw_input(\"Read The Integer from keyboard (x) :- \")\n",
+ "x = int(x)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#bitwise shifting\n",
+ "x <<= 3\n",
+ "y = x\n",
+ "\n",
+ "#Result\n",
+ "print \"The Left shifted data is = \",y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Read The Integer from keyboard (x) :- 2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Left shifted data is = 16\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.19, Page number: 35<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use bitwise AND operator between the two integers and display the results\n",
+ "\n",
+ "#Variable initialization\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "a = raw_input(\"Read The Integers from keyboard (a & b) :- \")\n",
+ "a = int(a)\n",
+ "\n",
+ "b = raw_input(\"Read The Integers from keyboard (a & b) :- \")\n",
+ "b = int(b)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#bitwise operation\n",
+ "c = a & b\n",
+ "\n",
+ "#Result\n",
+ "print \"The Answer after ANDing is (C) = \",c"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Read The Integers from keyboard (a & b) :- 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Read The Integers from keyboard (a & b) :- 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Answer after ANDing is (C) = 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.20, Page number: 37<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#operate OR operation on two integers and display the result\n",
+ "\n",
+ "#Variable initialization\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "a = raw_input(\"Read The Integers from keyboard (a & b) :- \")\n",
+ "a = int(a)\n",
+ "\n",
+ "b = raw_input(\"Read The Integers from keyboard (a & b) :- \")\n",
+ "b = int(b)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#bitwise operation\n",
+ "c = a | b\n",
+ "\n",
+ "#Result\n",
+ "print \"The Oring operation betwen a & b in c = \",c"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Read The Integers from keyboard (a & b) :- 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Read The Integers from keyboard (a & b) :- 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Oring operation betwen a & b in c = 12\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.21, Page number: 38<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exclusive OR operation between the two integers and display the result\n",
+ "\n",
+ "#Variable initialization\n",
+ "#Reads Input value for x\n",
+ "\n",
+ "a = raw_input(\"Read The Integers from keyboard (a & b) :- \")\n",
+ "a = int(a)\n",
+ "\n",
+ "b = raw_input(\"Read The Integers from keyboard (a & b) :- \")\n",
+ "b = int(b)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#bitwise operation\n",
+ "c = a ^ b\n",
+ "\n",
+ "#Result\n",
+ "print \"The data after Exclusive OR operation is in c = \",c"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Read The Integers from keyboard (a & b) :- 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Read The Integers from keyboard (a & b) :- 2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The data after Exclusive OR operation is in c = 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter4.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter4.ipynb new file mode 100755 index 00000000..758457a3 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter4.ipynb @@ -0,0 +1,972 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 4: Input & Output in C<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.1, Page number: 47<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#show the effect of mismatch of data types\n",
+ "\n",
+ "#Reads Input value for a\n",
+ "\n",
+ "a = raw_input(\"Enter value of 'A' : \")\n",
+ "a = int(a)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "print \"A = \",a\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of 'A' : 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.2, Page number: 47<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#show the effect of mismatch of data types\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#Reads Input value for a\n",
+ "\n",
+ "a = raw_input(\"Enter value of 'A' : \")\n",
+ "a = int(a)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#there is no char datatype of 1 byte size in python.\n",
+ "#python has string variable only.\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "sys.stdout.write(\"A = %d\"%(a%256))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of 'A' : 256\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 0"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.3, Page number: 49<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#show the effect of various escape sequences\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = 1\n",
+ "b = a + 1\n",
+ "c = b + 1\n",
+ "d = c + 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write ('\\tA = %d\\nB = %d \\'C = %d\\''%(a,b,c))\n",
+ "sys.stdout.write ('\\n**D = %d**'%(d))\n",
+ "sys.stdout.write ('\\nA = %d B = %d'%(a,b))\n",
+ "sys.stdout.write ('\\r******')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\tA = 1\n",
+ "B = 2 'C = 3'\n",
+ "**D = 4**\n",
+ "A = 1 B = 2******"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.4, Page number: 50<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print the third power of 2 using pow() function.\n",
+ "#assume the floating point numbers\n",
+ "\n",
+ "#Variable initialization\n",
+ "x = 2.0\n",
+ "y = 3.0\n",
+ "\n",
+ "#Result\n",
+ "print '%lf raised to %lf is %lf\\n' %(x,y,pow(x,y))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2.000000 raised to 3.000000 is 8.000000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.5, Page number: 50<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print the third power of 10 using pow() function.\n",
+ "#assume the floating point numbers\n",
+ "\n",
+ "#Variable initialization\n",
+ "p = 3\n",
+ "\n",
+ "#Result\n",
+ "#There is no pow10() function in Python.\n",
+ "print 'Ten raised to %lf is %lf\\n' %(p,pow(10,p))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ten raised to 3.000000 is 1000.000000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.6, Page number: 51<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#detect an error while inputting a data. Use return value of scanf() statement.\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python,the map(int,a.split()) function splits the input characters\n",
+ "#and converts it into integers and returns a value if all the values are integers\n",
+ "#otherwise an exception will be generated and initializes v as 0.\n",
+ "#using exception handling, this result can be achieved.\n",
+ "\n",
+ "\n",
+ "#Exception handling\n",
+ "try:\n",
+ " a = raw_input(\"Enter value of 'A','B' & 'C' : \")\n",
+ " v = map(int,a.split())\n",
+ "except:\n",
+ " v = 0\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "print '\\nError In Inputting.' if v < 3 else '\\nValues Successfully read.'\n",
+ "\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of 'A','B' & 'C' : 1 2 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Values Successfully read.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.7, Page number: 51<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find length of the string using print() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python, print()or write() function would not return the number of characters\n",
+ "#written to the output buffer. so len() function is used to find the length.\n",
+ "\n",
+ "nm = raw_input(\"Enter String : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "l = len(nm)\n",
+ "\n",
+ "#Result\n",
+ "print '\\nLength = ',l\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String : HELLO\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Length = 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.8, Page number: 52<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Perform addition of two numbers\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = raw_input(\"ENTER TWO VALUES \")\n",
+ "b = raw_input(\"ENTER TWO VALUES \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "c = int(a) + int(b)\n",
+ "\n",
+ "#Result\n",
+ "print '\\nSUM IS = ',c\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ENTER TWO VALUES 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ENTER TWO VALUES 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "SUM IS = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.9, Page number: 52<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the square of the given number\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = raw_input(\"ENTER ANY NUMBER \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "c = int(a) * int(a)\n",
+ "\n",
+ "#Result\n",
+ "print '\\nSQUARE OF GIVEN NUMBER = ',c\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ENTER ANY NUMBER 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "SQUARE OF GIVEN NUMBER = 25\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.10, Page number: 53<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate average of three real numbers.\n",
+ "\n",
+ "#Variable initialization\n",
+ "\n",
+ "a = raw_input(\"ENTER THREE FLOAT NUMBERS : \")\n",
+ "b = raw_input(\"ENTER THREE FLOAT NUMBERS : \")\n",
+ "c = raw_input(\"ENTER THREE FLOAT NUMBERS : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "d = float(a) + float(b) + float(c)\n",
+ "\n",
+ "#Result\n",
+ "print '\\nAverage of Given Numbers : ',d/3\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ENTER THREE FLOAT NUMBERS : 2.5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ENTER THREE FLOAT NUMBERS : 3.5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ENTER THREE FLOAT NUMBERS : 4.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Average of Given Numbers : 3.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.11, Page number: 53<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print message with inputted name\n",
+ "\n",
+ "#Variable initialization\n",
+ "yourname = raw_input(\"Enter Your Name : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "print \"\\nWel Come %s to 'C' Programming Course\"%(yourname)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Name : Ajay\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Wel Come Ajay to 'C' Programming Course\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.12, Page number: 54<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input a single character and display it\n",
+ "\n",
+ "#Variable initialization\n",
+ "ch = raw_input(\"Enter any character : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "print \"\\nYour Entered Character is : %c\"%(ch)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any character : C\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Your Entered Character is : C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.13, Page number: 54<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Swap the values of two variables without using third variable.\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = 7\n",
+ "b = 4\n",
+ "\n",
+ "print \"\\n A = %d B = %d\"%(a,b)\n",
+ "\n",
+ "#Swapping\n",
+ "a = a + b\n",
+ "b = a - b\n",
+ "a = a - b\n",
+ "\n",
+ "#Result\n",
+ "print \"Now A = %d B = %d\"%(a,b)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " A = 7 B = 4\n",
+ "Now A = 4 B = 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.14, Page number: 55<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Accept characters through keyboard using getchar() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python, string is an object. It has no nul-termination character.\n",
+ "#raw_input() reads the string constant from the stdin and the write() function\n",
+ "#prints it to the stdout based on the attribute length.\n",
+ "\n",
+ "ch = raw_input(\" \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(ch)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " COMPILER\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "COMPILER"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.15, Page number: 56<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the characters using putchar() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python, string is an object. It has no nul-termination character.\n",
+ "#raw_input() reads the string constant from the stdin.\n",
+ "\n",
+ "ch = raw_input(\"Enter Text Here : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "#using for loop, the string can be displayed character by character.\n",
+ "\n",
+ "sys.stdout.write(\"The Entered Text : \")\n",
+ "for c in ch:\n",
+ " sys.stdout.write(c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text Here : Characters\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Entered Text : Characters"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.16, Page number: 56<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Show the effect of getche() and getch() functions\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python, there is no equivalent function for getche() and getch() functions.\n",
+ "#raw_input() function reads the characters and terminates by pressing the\n",
+ "#enter key\n",
+ "\n",
+ "ch = raw_input(\"Enter any two alphabetics \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "#Result\n",
+ "sys.stdout.write(ch)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any two alphabetics A \n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A "
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.17, Page number: 57<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read and display the character using getch() and putch() functions\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python, there is no equivalent function for getch() function.\n",
+ "#raw_input() function reads the characters and terminates by pressing the\n",
+ "#enter key\n",
+ "\n",
+ "ch = raw_input(\"Press any key to continue \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"You Pressed : %s\"%(ch))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Press any key to continue 9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You Pressed : 9"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.18, Page number: 57<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Accept string through the keyboard using gets() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python, raw_input() function reads the string and terminates by pressing the\n",
+ "#enter key and write() function displays the string.\n",
+ "\n",
+ "ch = raw_input(\"Enter the String : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Entered String : %s\"%(ch))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the String : USE OF GETS()\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entered String : USE OF GETS()"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.19, Page number: 58<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the accepted character using puts() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python, raw_input() function reads the string and terminates by pressing the\n",
+ "#enter key and print() function displays the string.\n",
+ "\n",
+ "ch = raw_input(\"Enter the String : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "print\"Entered String : \"\n",
+ "print ch\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the String : puts is in use.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entered String : \n",
+ "puts is in use.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.20, Page number: 58<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#read string using cgets() and display it using cputs()\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python, raw_input() function reads the string and terminates by pressing the\n",
+ "#enter key and print() function displays the string.\n",
+ "#in python, string is an object.\n",
+ "\n",
+ "t = raw_input(\"Enter Text Here : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "print \"Your Entered Text : %s\"%(t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text Here : How are you?\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your Entered Text : How are you?\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter5.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter5.ipynb new file mode 100755 index 00000000..dac1632e --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter5.ipynb @@ -0,0 +1,2624 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 5.1: Decision Statements<h1>\n",
+ " "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.1, Page number: 64<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the entered number is less than 10? if yes, display the same\n",
+ "\n",
+ "#Variable initialization\n",
+ "v = raw_input(\"Enter the number : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "v = int(v)\n",
+ "\n",
+ "#Result\n",
+ "if v < 10 :\n",
+ " print '\\nNumber entered is less than 10'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number : 9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Number entered is less than 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.2, Page number: 65<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check equivalence of two numbers. Use if statement.\n",
+ "\n",
+ "#Variable initialization\n",
+ "\n",
+ "m = raw_input(\"Enter two numbers : \")\n",
+ "n = raw_input(\"Enter two numbers : \")\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "m = int(m)\n",
+ "n = int(n)\n",
+ "\n",
+ "#Result\n",
+ "if m - n == 0 :\n",
+ " print '\\nTwo numbers are equal'\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter two numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter two numbers : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Two numbers are equal\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.3, Page number: 66<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the candidate's age is greater than 17 or not. If yes, display\n",
+ "#message \"Eligible for Voting\"\n",
+ "\n",
+ "#Variable initialization\n",
+ "age = raw_input(\"Enter age : \")\n",
+ "age = int(age)\n",
+ "\n",
+ "#In python, raw_input() is used to read values\n",
+ "\n",
+ "#Result\n",
+ "if age > 17 :\n",
+ " print '\\nEligible for Voting.'\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter age : 20\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Eligible for Voting.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.4, Page number: 66<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use curly brace in the if block. Enter only the three numbers and calculate\n",
+ "#their sum and multiplication\n",
+ "\n",
+ "#Variable initialization\n",
+ "#in python,the map(int,raw_input().split()) function splits the input characters\n",
+ "#and converts it into integers and returns a value if all the values are integers\n",
+ "#otherwise an exception will be generated and initializes v as 0.\n",
+ "#using exception handling, this result can be achieved.\n",
+ "\n",
+ "#Exception handling\n",
+ "try:\n",
+ " #use space to separate the input characters\n",
+ " v = raw_input(\"Enter Three Numbers : \")\n",
+ " a,b,c = map(int,v.split())\n",
+ " x = 3\n",
+ "except:\n",
+ " x = 0\n",
+ "\n",
+ "#Result\n",
+ "#in python, block of statements are identified using indentation\n",
+ " \n",
+ "if x == 3:\n",
+ " print \"Addition : %d\"%(a+b+c)\n",
+ " print \"Multiplication : %d\"%(a*b*c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 1 2 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Addition : 7\n",
+ "Multiplication : 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.5, Page number: 68<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the values of a,b,c through the keyboard. Add them and after addition\n",
+ "#check if it is in the range of 100 & 200 or not. Print separate message for each.\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = raw_input(\"Enter Three Numbers a b c : \")\n",
+ "b = raw_input(\"Enter Three Numbers a b c : \")\n",
+ "c = raw_input(\"Enter Three Numbers a b c : \")\n",
+ "\n",
+ "a = int(a)\n",
+ "b = int(b)\n",
+ "c = int(c)\n",
+ "\n",
+ "print 'a = %d b = %d c = %d'%(a,b,c)\n",
+ "#Calculation\n",
+ "d = a + b + c\n",
+ "\n",
+ "#Condition evaluation and Result\n",
+ "if d <= 200 and d >= 100 :\n",
+ " print \"Sum is %d which is in between 100 & 200\"%(d)\n",
+ "else:\n",
+ " print \"\\nSum is %d which is out of range\"%(d)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers a b c : 50\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers a b c : 52\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers a b c : 54\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a = 50 b = 52 c = 54\n",
+ "Sum is 156 which is in between 100 & 200\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.6, Page number: 68<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the roots of a quadratic equation by using if else condition\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = raw_input(\"Enter Values for a, b, c : \")\n",
+ "b = raw_input(\"Enter Values for a, b, c : \")\n",
+ "c = raw_input(\"Enter Values for a, b, c : \")\n",
+ "\n",
+ "a = int(a)\n",
+ "b = int(b)\n",
+ "c = int(c)\n",
+ "\n",
+ "#Condition evaluation and Result\n",
+ "if b * b > 4 * a * c :\n",
+ " x1 = b + sqrt(b*b - 4*a*c)/2*a\n",
+ " x2 = b - sqrt(b*b - 4*a*c)/2*a\n",
+ " print \"\\nx1 = %f x2 = %f\"%(x1,x2)\n",
+ "else:\n",
+ " print \"\\nRoots are Imaginary\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a, b, c : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a, b, c : 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Values for a, b, c : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Roots are Imaginary\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.7, Page number: 69<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the square of those numbers only whose least significant digit is 5.\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "s = raw_input(\"Enter a Number : \")\n",
+ "s = int(s)\n",
+ "\n",
+ "d = s % 10;\n",
+ "\n",
+ "#Condition evaluation and Result\n",
+ "#There is no increment/decrement operator in python.\n",
+ "if d==5 :\n",
+ " s = s/10\n",
+ " s += 1\n",
+ " print \"\\nSquare = %d%d\"%(s*(s-1),d*d)\n",
+ "else:\n",
+ " print \"\\nInvalid Number\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 25\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Square = 625\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.8, Page number: 70<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the salary of medical representative based on the sales. Bonus and\n",
+ "#incentive to be offered to him will be based on total sales. If the sale\n",
+ "#exceeds Rs.100000/- follow the particulars of table (1) otherwise (2)\n",
+ "\n",
+ "# 1. TABLE 2. TABLE\n",
+ "# Basic = Rs. 3000 Basic = Rs. 3000\n",
+ "# HRA = 20% of basic HRA = 20% of basic\n",
+ "# DA = 110% of basic DA = 110% of basic\n",
+ "# Conveyance = Rs. 500 Conveyance = Rs. 500\n",
+ "# Incentive = 10% of sales Incentive = 5% of sales\n",
+ "# Bonus = Rs. 500 Bonus = Rs. 200\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "sale = raw_input(\"Enter Total Sales in Rs. : \")\n",
+ "sale = int(sale)\n",
+ "\n",
+ "#Condition evaluation\n",
+ "if sale >= 100000 :\n",
+ " bs = 3000\n",
+ " hra = 20 * bs/100\n",
+ " da = 110 * bs/100\n",
+ " cv = 500\n",
+ " incentive = sale * 10/100\n",
+ " bonus = 500\n",
+ "else:\n",
+ " bs = 3000\n",
+ " hra = 20 * bs/100\n",
+ " da = 110 * bs/100\n",
+ " cv = 500\n",
+ " incentive = sale * 5/100\n",
+ " bonus = 200\n",
+ "\n",
+ "#Result\n",
+ "ts = bs + hra + da + cv + incentive + bonus\n",
+ "print \"\\nTotal Sales : %.2f\"%(sale)\n",
+ "print \"\\nBasic Salary : %.2f\"%(bs)\n",
+ "print \"\\nHra : %.2f\"%(hra)\n",
+ "print \"\\nDa : %.2f\"%(da)\n",
+ "print \"\\nConveyance : %.2f\"%(cv)\n",
+ "print \"\\nIncentive : %.2f\"%(incentive)\n",
+ "print \"\\nBonus : %.2f\"%(bonus)\n",
+ "print \"\\nGross Salary : %.2f\"%(ts)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Total Sales in Rs. : 100000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Total Sales : 100000.00\n",
+ "\n",
+ "Basic Salary : 3000.00\n",
+ "\n",
+ "Hra : 600.00\n",
+ "\n",
+ "Da : 3300.00\n",
+ "\n",
+ "Conveyance : 500.00\n",
+ "\n",
+ "Incentive : 10000.00\n",
+ "\n",
+ "Bonus : 500.00\n",
+ "\n",
+ "Gross Salary : 17900.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.9, Page number: 72<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate energy bill using the starting and ending meter reading.\n",
+ "#The charges are as follows:\n",
+ "\n",
+ "# No. of Units consumed Rates in (Rs.)\n",
+ "# 200 - 500 3.50\n",
+ "# 100 - 200 2.50\n",
+ "# Less than 100 1.50\n",
+ "\n",
+ "#Variable initialization\n",
+ "initial = raw_input(\"Initial & Final Readings : \")\n",
+ "final = raw_input(\"Initial & Final Readings : \")\n",
+ "\n",
+ "consumed = int(final) - int(initial)\n",
+ "\n",
+ "#Condition evaluation\n",
+ "if consumed >= 200 and consumed <= 500 :\n",
+ " total = consumed * 3.50\n",
+ "else:\n",
+ " if consumed >= 100 and consumed <= 199:\n",
+ " total = consumed * 2.50\n",
+ " else :\n",
+ " if consumed < 100 :\n",
+ " total = consumed * 1.50\n",
+ "\n",
+ "#Result\n",
+ "print \"Total bill for %d unit is %f\"%(consumed,total)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial & Final Readings : 1200\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial & Final Readings : 1500\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total bill for 300 unit is 1050.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.10, Page number: 73<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate energy bill by reading the starting and ending meter reading.\n",
+ "#If the consumed electricity energy is greater than or equal to 200 units\n",
+ "#the rate should be 2.50/unit otherwise 1.50/unit.\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "initial = raw_input(\"Initial & Final Readings : \")\n",
+ "final = raw_input(\"Initial & Final Readings : \")\n",
+ "\n",
+ "consumed = int(final) - int(initial)\n",
+ "\n",
+ "#Condition evaluation\n",
+ "if consumed >= 200 :\n",
+ " total = consumed * 2.50\n",
+ "else:\n",
+ " total = consumed * 1.50\n",
+ "\n",
+ "#Result\n",
+ "print \"Total bill for %d unit is %f\"%(consumed,total)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total bill for 100 unit is 150.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.11, Page number: 73<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sort six numbers and find the largest one by using ladder of if else\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = int(raw_input(\"Enter 1st number : \"))\n",
+ "b = int(raw_input(\"Enter 2nd number : \"))\n",
+ "c = int(raw_input(\"Enter 3rd number : \"))\n",
+ "d = int(raw_input(\"Enter 4th number : \"))\n",
+ "e = int(raw_input(\"Enter 5th number : \"))\n",
+ "f = int(raw_input(\"Enter 6th number : \"))\n",
+ "\n",
+ "#Condition evaluation and Result\n",
+ "if a > b and a > c and a > d and a > e and a > f :\n",
+ " print \"Highest of six Number is : %d\"%(a)\n",
+ "else:\n",
+ " if b > a and b > c and b > d and b > e and b > f :\n",
+ " print \"Highest of six Number is : %d\"%(b)\n",
+ " else:\n",
+ " if c > a and c > b and c > d and c > e and c > f :\n",
+ " print \"Highest of six Number is : %d\"%(c)\n",
+ " else:\n",
+ " if d > a and d > b and d > c and d > e and d > f :\n",
+ " print \"Highest of six Number is : %d\"%(d)\n",
+ " else:\n",
+ " if e > a and e > b and e > c and e > d and e > f :\n",
+ " print \"Highest of six Number is : %d\"%(e)\n",
+ " else:\n",
+ " print \"Highest of six Number is : %d\"%(f)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter 1st number : 52\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter 2nd number : 74\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter 3rd number : 90\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter 4th number : 45\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter 5th number : 10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter 6th number : 22\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Highest of six Number is : 90\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.12, Page number: 74<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find largest number out of three numbers. Read the numbers through the keyboard\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "x = int(raw_input(\"\\nEnter Three Numbers x,y,z : \"))\n",
+ "y = int(raw_input(\"\\nEnter Three Numbers x,y,z : \"))\n",
+ "z = int(raw_input(\"\\nEnter Three Numbers x,y,z : \"))\n",
+ "\n",
+ "print \"\\nLargest out of Three Numbers is : \"\n",
+ "\n",
+ "#Condition evaluation and Result\n",
+ "if x > y :\n",
+ " if x > z:\n",
+ " print \"x = %d\\n\"%(x)\n",
+ " else:\n",
+ " print \"z = %d\\n\"%(z)\n",
+ "else:\n",
+ " if z > y:\n",
+ " print \"z = %d\\n\"%(z)\n",
+ " else:\n",
+ " print \"y = %d\\n\"%(y)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Three Numbers x,y,z : 10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Three Numbers x,y,z : 20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Three Numbers x,y,z : 30\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Largest out of Three Numbers is : \n",
+ "z = 30\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.13, Page number: 75<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the smallest out of the three numbers.\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = int(raw_input(\"\\nEnter Three Numbers : \"))\n",
+ "b = int(raw_input(\"\\nEnter Three Numbers : \"))\n",
+ "c = int(raw_input(\"\\nEnter Three Numbers : \"))\n",
+ " \n",
+ "#Condition evaluation and Result\n",
+ "if a < b :\n",
+ " if a < c:\n",
+ " smallest = a\n",
+ " else:\n",
+ " smallest = c\n",
+ "else:\n",
+ " if b < c:\n",
+ " smallest = b\n",
+ " else:\n",
+ " smallest = c\n",
+ "\n",
+ "#Result\n",
+ "print \"The smallest of %d %d %d is %d\\n\"%(a,b,c,smallest)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Three Numbers : 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Three Numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Three Numbers : 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The smallest of 1 5 8 is 1\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.14, Page number: 76<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate gross salary for the conditions given below\n",
+ "\n",
+ "# BASIC SALARY(Rs.) DA(Rs.) HRA(Rs.) CONVEYANCE(Rs.)\n",
+ "# >= 5000 110% of basic 20% of basic 500\n",
+ "# bs>=3000 & bs<5000 100% of basic 15% of basic 400\n",
+ "# bs<3000 90% of basic 10% of basic 300\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "bs = int(raw_input(\"\\nEnter Basic Salary : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "if bs >= 5000 :\n",
+ " hra = 20 * bs/100\n",
+ " da = 110 * bs/100\n",
+ " cv = 500\n",
+ "else:\n",
+ " if bs >= 3000 and bs < 5000 :\n",
+ " hra = 15 * bs/100\n",
+ " da = 100 * bs/100\n",
+ " cv = 400\n",
+ " else:\n",
+ " if bs < 3000:\n",
+ " hra = 10 * bs/100\n",
+ " da = 90 * bs/100\n",
+ " cv = 300\n",
+ "\n",
+ "#Calculation\n",
+ "ts = bs + hra + da + cv\n",
+ "\n",
+ "#Result\n",
+ "print \"Basic Salary : %5.0f\"%(bs)\n",
+ "print \"Hra : %5.0f\"%(hra)\n",
+ "print \"Da : %5.0f\"%(da)\n",
+ "print \"Conveyance : %5.0f\"%(cv)\n",
+ "print \"Gross Salary : %5.0f\"%(ts)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Basic Salary : 5400\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Basic Salary : 5400\n",
+ "Hra : 1080\n",
+ "Da : 5940\n",
+ "Conveyance : 500\n",
+ "Gross Salary : 12920\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.15, Page number: 77<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the total interest based on the following.\n",
+ "\n",
+ "#Principle Amount(Rs.) Rate of Interest(Rs.)\n",
+ "# >= 10000 20%\n",
+ "# >= 8000 & <= 9999 18%\n",
+ "# < 8000 16%\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "princ = int(raw_input(\"\\nEnter Loan & No. of years :- \"))\n",
+ "nyrs = int(raw_input(\"\\nEnter Loan & No. of years :- \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "if princ >= 10000 :\n",
+ " rate = 20\n",
+ "else:\n",
+ " if princ >= 8000 and princ <= 9999 :\n",
+ " rate = 18\n",
+ " else:\n",
+ " if princ < 8000:\n",
+ " rate = 16\n",
+ "\n",
+ "#Calculation\n",
+ "interest = princ * nyrs * rate/100\n",
+ "\n",
+ "#Result\n",
+ "print \"Loan : %6.2f\"%(princ)\n",
+ "print \"Years : %6.2f\"%(nyrs)\n",
+ "print \"Rate : %6.2f\"%(rate)\n",
+ "print \"Interest : %6.2f\"%(interest)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Loan & No. of years :- 5500\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Loan & No. of years :- 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loan : 5500.00\n",
+ "Years : 3.00\n",
+ "Rate : 16.00\n",
+ "Interest : 2640.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.16, Page number: 78<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the average of six subjects and display the results as follows.\n",
+ "\n",
+ "# AVERAGE RESULT\n",
+ "# >34 & <50 Third Division\n",
+ "# >49 & <60 Second Division\n",
+ "# >60 & <75 First Division\n",
+ "# >75 & <100 Distinction\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "a = int(raw_input(\"\\nEnter Marks\\nP C B M E H\\n\"))\n",
+ "b = int(raw_input(\"\\nEnter Marks\\nP C B M E H\\n\"))\n",
+ "c = int(raw_input(\"\\nEnter Marks\\nP C B M E H\\n\"))\n",
+ "d = int(raw_input(\"\\nEnter Marks\\nP C B M E H\\n\"))\n",
+ "e = int(raw_input(\"\\nEnter Marks\\nP C B M E H\\n\"))\n",
+ "f = int(raw_input(\"\\nEnter Marks\\nP C B M E H\\n\"))\n",
+ "\n",
+ "#Calculation\n",
+ "#here sum1 is used instead of sum because sum is a function in python.\n",
+ "sum1 = a + b + c + d + e + f\n",
+ "avg = sum1/6\n",
+ "\n",
+ "print \"Total : %d \\nAverage : %.2f\"%(sum1,avg)\n",
+ "\n",
+ "#Condition evaluation and Result\n",
+ "if a < 35 or b < 35 or c < 35 or d < 35 or e < 35 :\n",
+ " print \"Result : Fail\"\n",
+ " exit\n",
+ "if avg >= 34 and avg < 50 :\n",
+ " print \"Result : Third Division \"\n",
+ "else:\n",
+ " if avg >= 49 and avg < 60:\n",
+ " print \"Result : Second Division\"\n",
+ " else:\n",
+ " if avg >= 60 and avg > 75:\n",
+ " print \"Result : First Division\"\n",
+ " else:\n",
+ " if avg >= 75 and avg <= 100:\n",
+ " print \"Result : Distinction\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Marks\n",
+ "P C B M E H\n",
+ "75\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Marks\n",
+ "P C B M E H\n",
+ "75\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Marks\n",
+ "P C B M E H\n",
+ "75\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Marks\n",
+ "P C B M E H\n",
+ "75\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Marks\n",
+ "P C B M E H\n",
+ "75\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Marks\n",
+ "P C B M E H\n",
+ "75\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total : 450 \n",
+ "Average : 75.00\n",
+ "Result : Distinction\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.17, Page number: 80<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detect the entered number as to whether it is even or odd. Use goto statement.\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "x = int(raw_input(\"\\nEnter a Number : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#There is no goto/label statement in python\n",
+ "\n",
+ "if x%2 == 0:\n",
+ " print \"\\n%d is Even Number.\"%(x)\n",
+ "else:\n",
+ " print \"\\n%d is Odd Number.\"%(x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter a Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "5 is Odd Number.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.18, Page number: 81<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate telephone bill. Transfer controls at different places according\n",
+ "#to number of calls and calculate the total charges. Follow rates as per\n",
+ "#given in the table.\n",
+ "\n",
+ "# Telephone call Rate in Rs.\n",
+ "# < 100 No charges\n",
+ "# > 99 & < 200 1\n",
+ "# > 199 & < 300 2\n",
+ "# > 299 3\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "nc = int(raw_input(\"\\nEnter Number of Calls : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#There is no goto/label statement in python\n",
+ "\n",
+ "if nc < 100:\n",
+ " print \"\\nNo charges\"\n",
+ "else:\n",
+ " if nc > 99 and nc < 200:\n",
+ " print \"\\nTotal Charges : %d Rs.\"%(nc*1)\n",
+ " else:\n",
+ " if nc > 199 and nc < 300:\n",
+ " print \"\\nTotal Charges : %d Rs.\"%(nc*2)\n",
+ " else:\n",
+ " print \"\\nTotal Charges : %d Rs.\"%(nc*3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Number of Calls : 500\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Total Charges : 1500 Rs.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.19, Page number: 82<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the entered year is a leap year or not. Use goto statement.\n",
+ "\n",
+ "#Variable initialization\n",
+ "leap = int(raw_input(\"\\nEnter Year : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#There is no goto/label statement in python\n",
+ "\n",
+ "if leap%4 == 0:\n",
+ " print \"\\n%d is a leap year.\"%(leap)\n",
+ "else:\n",
+ " print \"%d is not a leap year.\"%(leap)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Year : 2000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "2000 is a leap year.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.20, Page number: 84<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print lines by selecting the choice.\n",
+ "\n",
+ "print \"\\n[1] ............\"\n",
+ "print \"\\n[2] ____________\"\n",
+ "print \"\\n[3] ************\"\n",
+ "print \"\\n[4] ============\"\n",
+ "print \"\\n[5] EXIT\"\n",
+ "\n",
+ "#Variable initialization\n",
+ "ch = int(raw_input(\"\\nENTER YOUR CHOICE : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch case statement in python, an alternative is to use\n",
+ "#dictionary and functions\n",
+ "\n",
+ "def dot():\n",
+ " print \"\\n......................................................\"\n",
+ "\n",
+ "def line():\n",
+ " print \"\\n______________________________________________________\"\n",
+ "\n",
+ "def star():\n",
+ " print \"\\n******************************************************\"\n",
+ "\n",
+ "def equal():\n",
+ " print \"\\n======================================================\"\n",
+ "\n",
+ "def ex():\n",
+ " exit\n",
+ " \n",
+ "options = {1 : dot,\n",
+ " 2 : line,\n",
+ " 3 : star,\n",
+ " 4 : equal,\n",
+ " 5 : ex\n",
+ "}\n",
+ "\n",
+ "options[ch]()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "[1] ............\n",
+ "\n",
+ "[2] ____________\n",
+ "\n",
+ "[3] ************\n",
+ "\n",
+ "[4] ============\n",
+ "\n",
+ "[5] EXIT\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "ENTER YOUR CHOICE : 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "......................................................\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.21, Page number: 85<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Provide multiple functions such as 1. addition 2.Subtraction 3. Multiplication\n",
+ "#4.Division 5.Remainder calculation 6.Larger out of two by using switch statement\n",
+ "\n",
+ "print \"\\n=============================\"\n",
+ "print \"\\n\\t\\tMENU\"\n",
+ "print \"\\n=============================\"\n",
+ "print \"\\n\\t[1] ADDITION\"\n",
+ "print \"\\n\\t[2] SUBTRACTION\"\n",
+ "print \"\\n\\t[3] MULTIPLICATION\"\n",
+ "print \"\\n\\t[4] DIVISION\"\n",
+ "print \"\\n\\t[5] REMAINDER\"\n",
+ "print \"\\n\\t[6] LARGER OUT OF TWO\"\n",
+ "print \"\\n\\t[0] EXIT\"\n",
+ "print \"\\n=============================\"\n",
+ "\n",
+ "#Variable initialization\n",
+ "ch = int(raw_input(\"\\nENTER YOUR CHOICE : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch case statement in python, an alternative is to use\n",
+ "#dictionary and functions\n",
+ "\n",
+ "if ch <= 6 and ch > 0:\n",
+ " a = int(raw_input(\"Enter Two Numbers : \"))\n",
+ " b = int(raw_input(\"Enter Two Numbers : \"))\n",
+ " \n",
+ "def add():\n",
+ " c = a + b\n",
+ " print \"\\nAddition : %d\"%(c)\n",
+ "\n",
+ "def sub():\n",
+ " c = a - b\n",
+ " print \"\\nSubtraction : %d\"%(c)\n",
+ "\n",
+ "def mul():\n",
+ " c = a * b\n",
+ " print \"\\nMultiplication : %d\"%(c)\n",
+ "\n",
+ "def div():\n",
+ " c = a/b\n",
+ " print \"\\nDivision : %d\"%(c)\n",
+ "\n",
+ "def rem():\n",
+ " c = a % b\n",
+ " print \"\\nRemainder : %d\"%(c)\n",
+ "\n",
+ "def larger():\n",
+ " if a > b:\n",
+ " print \"\\n%d (a) is larger than %d (b)\"%(a,b)\n",
+ " else:\n",
+ " if b > a:\n",
+ " print \"\\n%d (b) is larger than %d (a)\"%(b,a)\n",
+ " else:\n",
+ " print \"\\n%d (a) & %d (b) are same\"%(a,b)\n",
+ "\n",
+ "def ex():\n",
+ " print \"\\nTerminated by choice\"\n",
+ " exit\n",
+ "\n",
+ "def default():\n",
+ " print \"\\nInvalid Choice\"\n",
+ "\n",
+ "options = { 1 : add,\n",
+ " 2 : sub,\n",
+ " 3 : mul,\n",
+ " 4 : div,\n",
+ " 5 : rem,\n",
+ " 6 : larger,\n",
+ " 7 : ex,\n",
+ " 0 : default,\n",
+ " 8 : default,\n",
+ " 9 : default\n",
+ "}\n",
+ "\n",
+ "options[ch]()\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "=============================\n",
+ "\n",
+ "\t\tMENU\n",
+ "\n",
+ "=============================\n",
+ "\n",
+ "\t[1] ADDITION\n",
+ "\n",
+ "\t[2] SUBTRACTION\n",
+ "\n",
+ "\t[3] MULTIPLICATION\n",
+ "\n",
+ "\t[4] DIVISION\n",
+ "\n",
+ "\t[5] REMAINDER\n",
+ "\n",
+ "\t[6] LARGER OUT OF TWO\n",
+ "\n",
+ "\t[0] EXIT\n",
+ "\n",
+ "=============================\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "ENTER YOUR CHOICE : 6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Two Numbers : 9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Two Numbers : 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "9 (a) is larger than 8 (b)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.22, Page number: 87<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert years into Minutes, Hours, Days, Months and Seconds using switch()\n",
+ "#statement\n",
+ "\n",
+ "\n",
+ "print \"[1] MINUTES\"\n",
+ "print \"[2] HOURS\"\n",
+ "print \"[3] DAYS\"\n",
+ "print \"[4] MONTHS\"\n",
+ "print \"[5] SECONDS\"\n",
+ "print \"[0] EXIT\"\n",
+ "\n",
+ "#Variable initialization\n",
+ "ch = int(raw_input(\"\\nEnter Your Choice : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch case statement in python, an alternative is to use\n",
+ "#dictionary and functions\n",
+ "\n",
+ "if ch > 0 and ch < 6:\n",
+ " yrs = int(raw_input(\"Enter Years : \"))\n",
+ "\n",
+ "#Calculation\n",
+ "#since min is a keyword in python, min1 is used instead.\n",
+ "mon = yrs * 12\n",
+ "ds = mon * 30\n",
+ "hrs = ds * 24\n",
+ "min1 = hrs * 60\n",
+ "se = min1 * 60\n",
+ "\n",
+ "def minute():\n",
+ " print \"\\nMinutes : %ld\"%(min1)\n",
+ "\n",
+ "def hours():\n",
+ " print \"\\nHours : %ld\"%(hrs)\n",
+ "\n",
+ "def days():\n",
+ " print \"\\nDays : %ld\"%(ds)\n",
+ "\n",
+ "def months():\n",
+ " print \"\\nMonths : %ld\"%(mon)\n",
+ "\n",
+ "def seconds():\n",
+ " print \"\\nSeconds : %ld\"%(se)\n",
+ "\n",
+ "def ex():\n",
+ " print \"\\nTerminated by choice\"\n",
+ " exit\n",
+ "\n",
+ "def default():\n",
+ " print \"\\nInvalid Choice\"\n",
+ "\n",
+ "options = { 1 : minute,\n",
+ " 2 : hours,\n",
+ " 3 : days,\n",
+ " 4 : months,\n",
+ " 5 : seconds,\n",
+ " 6 : ex,\n",
+ " 0 : default,\n",
+ " 8 : default,\n",
+ " 9 : default\n",
+ "}\n",
+ "\n",
+ "options[ch]()\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[1] MINUTES\n",
+ "[2] HOURS\n",
+ "[3] DAYS\n",
+ "[4] MONTHS\n",
+ "[5] SECONDS\n",
+ "[0] EXIT\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Your Choice : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Years : 2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Months : 24\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.23, Page number: 89<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the names of the days of a week.\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "day = int(raw_input(\"\\nEnter a number between 1 to 7 : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch case statement in python, an alternative is to use\n",
+ "#dictionary and functions\n",
+ "\n",
+ "def first():\n",
+ " print \"\\n1st day of week is Sunday\"\n",
+ "\n",
+ "def second():\n",
+ " print \"\\n2nd day of week is Monday\"\n",
+ "\n",
+ "def third():\n",
+ " print \"\\n3rd day of week is Tuesday\"\n",
+ "\n",
+ "def fourth():\n",
+ " print \"\\n4th day of week is Wednesday\"\n",
+ "\n",
+ "def fifth():\n",
+ " print \"\\n5th day of week is Thursday\"\n",
+ "\n",
+ "def sixth():\n",
+ " print \"\\n6th day of week is Friday\"\n",
+ "\n",
+ "def seventh():\n",
+ " print \"\\n7th day of week is Saturday\"\n",
+ "\n",
+ "def default():\n",
+ " print \"\\nInvalid day\"\n",
+ "\n",
+ "options = { 1 : first,\n",
+ " 2 : second,\n",
+ " 3 : third,\n",
+ " 4 : fourth,\n",
+ " 5 : fifth,\n",
+ " 6 : sixth,\n",
+ " 7 : seventh,\n",
+ " 0 : default,\n",
+ " 8 : default,\n",
+ " 9 : default\n",
+ "}\n",
+ "for i in range(1,day+1):\n",
+ " options[i]()\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter a number between 1 to 7 : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "1st day of week is Sunday\n",
+ "\n",
+ "2nd day of week is Monday\n",
+ "\n",
+ "3rd day of week is Tuesday\n",
+ "\n",
+ "4th day of week is Wednesday\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.24, Page number: 90<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Perform following operations\n",
+ "\n",
+ "#1. Display any numbers or stars on the screen by using for loop\n",
+ "#2. Display the menu containing the following\n",
+ "#a) Whole screen b)Half screen c)Top 3 lines d)Bottom 3 lines\n",
+ "\n",
+ "import os\n",
+ "import sys\n",
+ "import turtle\n",
+ "\n",
+ "\n",
+ "#Print numbers in the whole screen\n",
+ "for i in range(1,700):\n",
+ " sys.stdout.write(\"%d\"%i)\n",
+ "\n",
+ "print \"\\nCLEAR MENU\"\n",
+ "print \"\\t1] Whole Screen\\t2] Half Screen\\t3]Top 3 lines\\t4] Bottom 3 lines\\t5] Exit\"\n",
+ "\n",
+ "#Variable initialization\n",
+ "c = int(raw_input(\"Enter Your Choice : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch case statement in python, an alternative is to use\n",
+ "#dictionary and functions\n",
+ "\n",
+ "def one():\n",
+ " os.system('cls')\n",
+ "\n",
+ "def two():\n",
+ " for i in range(0,190):\n",
+ " turtle.goto(i,1)\n",
+ " sys.stdout.write(\"\\t\")\n",
+ " \n",
+ "def three():\n",
+ " for i in range(1,100):\n",
+ " turtle.goto(i,1)\n",
+ " sys.stdout.write(\"\\t\")\n",
+ "\n",
+ "def four():\n",
+ " for i in range(1,120):\n",
+ " turtle.goto(i,21)\n",
+ " sys.stdout.write(\"\\t\")\n",
+ "\n",
+ "def five():\n",
+ " exit\n",
+ "\n",
+ "\n",
+ "options = { 1 : one,\n",
+ " 2 : two,\n",
+ " 3 : three,\n",
+ " 4 : four,\n",
+ " 5 : five\n",
+ "}\n",
+ "options[c]()\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699\n",
+ "CLEAR MENU\n",
+ "\t1] Whole Screen\t2] Half Screen\t3]Top 3 lines\t4] Bottom 3 lines\t5] Exit\n",
+ "\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t\t"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\t"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.25, Page number: 91<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the files of current directory\n",
+ "\n",
+ "import os\n",
+ "\n",
+ "print \"\\nFILE LISTING MENU\"\n",
+ "print \"1] .EXE\"\n",
+ "print \"2] .BAT\"\n",
+ "print \"3] .OBJ\"\n",
+ "print \"4] .BAK\"\n",
+ "#Variable initialization\n",
+ "c = int(raw_input(\"Enter Your Choice -: \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch case statement in python, an alternative is to use\n",
+ "#dictionary and functions\n",
+ "\n",
+ "def one():\n",
+ " os.system('dir *.exe')\n",
+ "\n",
+ "def two():\n",
+ " os.system('dir *.c')\n",
+ "\n",
+ "def three():\n",
+ " os.system('dir *.obj')\n",
+ "\n",
+ "def four():\n",
+ " os.system('dir *.bak')\n",
+ "\n",
+ "options = { 1 : one,\n",
+ " 2 : two,\n",
+ " 3 : three,\n",
+ " 4 : four\n",
+ "}\n",
+ "options[c]()\n",
+ "\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "FILE LISTING MENU\n",
+ "1] .EXE\n",
+ "2] .BAT\n",
+ "3] .OBJ\n",
+ "4] .BAK\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.26, Page number: 92<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display number of days in calendar format of an entered month of year 2001.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "m = int(raw_input(\"Enter Month No. of Year 2001 : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch case statement in python, an alternative is to use\n",
+ "#else-if ladder.\n",
+ "\n",
+ "print \"\\nMonth - %d - 2001\"%(m)\n",
+ "print \"\\n\\tSUN\\tMON\\tTUE\\tWED\\tTHU\\tFRI\\tSAT\"\n",
+ "\n",
+ "#Find a day any month of 2001\n",
+ "\n",
+ "if m == 1:\n",
+ " a = 2\n",
+ " j = 31\n",
+ "else:\n",
+ " if m == 2:\n",
+ " a = 5\n",
+ " j = 28\n",
+ " else:\n",
+ " if m == 3:\n",
+ " a = 5\n",
+ " j = 31\n",
+ " else:\n",
+ " if m == 4:\n",
+ " a = 1\n",
+ " j = 30\n",
+ " else:\n",
+ " if m == 5:\n",
+ " a = 3\n",
+ " j = 31\n",
+ " else:\n",
+ " if m == 6:\n",
+ " a = 6\n",
+ " j = 30\n",
+ " else:\n",
+ " if m == 7:\n",
+ " a = 1\n",
+ " j = 31\n",
+ " else:\n",
+ " if m == 8:\n",
+ " a = 4\n",
+ " j = 31\n",
+ " else:\n",
+ " if m == 9:\n",
+ " a = 7\n",
+ " j = 30\n",
+ " else:\n",
+ " if m == 10:\n",
+ " a = 2\n",
+ " j = 31\n",
+ " else:\n",
+ " if m == 11:\n",
+ " a = 5\n",
+ " j = 30\n",
+ " else:\n",
+ " if m == 12:\n",
+ " a = 7\n",
+ " j = 31\n",
+ " else:\n",
+ " print \"Invalid Month\"\n",
+ " exit\n",
+ "\n",
+ "#Starting day is to be adjusted under the respective day\n",
+ "#sys.stdout.write() function performs the same task as printf() function\n",
+ " \n",
+ "i = 1\n",
+ "if a == 1:\n",
+ " sys.stdout.write(\"\\t%d\"%(i))\n",
+ "else:\n",
+ " if a == 2:\n",
+ " sys.stdout.write(\"\\t\\t%d\"%(i))\n",
+ " else:\n",
+ " if a == 3:\n",
+ " sys.stdout.write(\"\\t\\t\\t%d\"%(i))\n",
+ " else:\n",
+ " if a == 4:\n",
+ " sys.stdout.write(\"\\t\\t\\t\\t%d\"%(i))\n",
+ " else:\n",
+ " if a == 5:\n",
+ " sys.stdout.write(\"\\t\\t\\t\\t\\t%d\"%(i))\n",
+ " else:\n",
+ " if a == 6:\n",
+ " sys.stdout.write(\"\\t\\t\\t\\t\\t\\t%d\"%(i))\n",
+ " else:\n",
+ " if a == 7:\n",
+ " sys.stdout.write(\"\\t\\t\\t\\t\\t\\t\\t%d\"%(i))\n",
+ "\n",
+ "\n",
+ "h = 8 - a #The starting day is subtracted from 8\n",
+ "for i in range(2,h+1): #to display the first row\n",
+ " sys.stdout.write(\"\\t%d\"%(i))\n",
+ "sys.stdout.write(\"\\n\")\n",
+ "b = 1\n",
+ "for i in range(h+1,j+1): #to continue with second row onwards\n",
+ " if b == 8:\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " b = 1\n",
+ " sys.stdout.write(\"\\t%d\"%(i))\n",
+ " b += 1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Month - 1 - 2001\n",
+ "\n",
+ "\tSUN\tMON\tTUE\tWED\tTHU\tFRI\tSAT\n",
+ "\t\t1\t2\t3\t4\t5\t6\n",
+ "\t7\t8\t9\t10\t11\t12\t13\n",
+ "\t14\t15\t16\t17\t18\t19\t20\n",
+ "\t21\t22\t23\t24\t25\t26\t27\n",
+ "\t28\t29\t30\t31"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.27, Page number: 95<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert decimal to hexadecimal number.\n",
+ "\n",
+ "import sys\n",
+ "import turtle\n",
+ "\n",
+ "#Variable initialization\n",
+ "x = int(raw_input(\"Enter a number : \"))\n",
+ "y = 30\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch case statement in python, an alternative is to use\n",
+ "#else-if ladder.\n",
+ "\n",
+ "print \"\\nConversion of Decimal to Hexadecimal Number\"\n",
+ "\n",
+ "#for loop without condition is not supported in python. so while loop is used.\n",
+ "\n",
+ "c = 1\n",
+ "z = [0 for i in range(0,15)]\n",
+ "\n",
+ "while x != 0:\n",
+ " z[c] = x % 16\n",
+ " c = c + 1\n",
+ " x = x/16\n",
+ "\n",
+ "\n",
+ "for i in range(c-1,0,-1):\n",
+ " if z[i] == 10:\n",
+ " sys.stdout.write(\"A\")\n",
+ " else:\n",
+ " if z[i] == 11:\n",
+ " sys.stdout.write(\"B\")\n",
+ " else:\n",
+ " if z[i] == 12:\n",
+ " sys.stdout.write(\"C\")\n",
+ " else:\n",
+ " if z[i] == 13:\n",
+ " sys.stdout.write(\"D\")\n",
+ " else:\n",
+ " if z[i] == 14:\n",
+ " sys.stdout.write(\"E\")\n",
+ " else:\n",
+ " if z[i] == 15:\n",
+ " sys.stdout.write(\"F\")\n",
+ " else:\n",
+ " sys.stdout.write(\"%d\"%(z[i]))\n",
+ " \n",
+ " \n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 31\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Conversion of Decimal to Hexadecimal Number\n",
+ "1F"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.28, Page number: 97<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detect whether the entered number is even or odd. use nested switch-case\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "x = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch case statement in python, an alternative is to use\n",
+ "#else-if ladder.\n",
+ "\n",
+ "if x == 0:\n",
+ " print \"Number is Even\"\n",
+ "else:\n",
+ " if x == 1:\n",
+ " print \"Number is odd\"\n",
+ " else:\n",
+ " y = x % 2\n",
+ " if y == 0:\n",
+ " print \"Number is Even\"\n",
+ " else:\n",
+ " print \"Number is odd\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number is odd\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.29, Page number: 98<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count number of 1s, 0s, blank spaces and others using nested\n",
+ "#switch() statement in a given stream\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "txt = raw_input(\"Enter Numbers : \")\n",
+ "\n",
+ "#Processing\n",
+ "x = 0\n",
+ "s = 0\n",
+ "a = 0\n",
+ "z = 0\n",
+ "o = 0\n",
+ "\n",
+ "while x < len(txt):\n",
+ " if txt[x] == ' ':\n",
+ " s = s + 1\n",
+ " else:\n",
+ " if txt[x] == '1':\n",
+ " a = a + 1\n",
+ " else:\n",
+ " if txt[x] == '0':\n",
+ " z = z + 1\n",
+ " else:\n",
+ " o = o + 1\n",
+ " x = x + 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nTotal Spaces : %d\"%(s))\n",
+ "sys.stdout.write(\"\\nTotal 1s : %d\"%(a))\n",
+ "sys.stdout.write(\"\\nTotal 0s : %d\"%(z))\n",
+ "sys.stdout.write(\"\\nOthers : %d\"%(o))\n",
+ "sys.stdout.write(\"\\nString Length : %d\"%(s+a+z+o))\n",
+ " \n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers : 1110022 222\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Total Spaces : 1\n",
+ "Total 1s : 3\n",
+ "Total 0s : 2\n",
+ "Others : 5\n",
+ "String Length : 11"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.30, Page number: 99<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert integer to character using if condition\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "x = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#ord() function converts the character ASCII to integer\n",
+ "\n",
+ "if x == ord('A'):\n",
+ " print \"%c\"%(x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 65\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.31, Page number: 100<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use nested if..else statements in switch() statement. Also show the effect\n",
+ "#of conversion of integer to character\n",
+ "\n",
+ "\n",
+ "#Variable initialization\n",
+ "i = int(raw_input(\"Enter any ASCII Number : \"))\n",
+ "\n",
+ "#Condition evaluation\n",
+ "#there is no switch..case statement in python. alternative is to use\n",
+ "#if..else and else..if ladder\n",
+ "\n",
+ "if i == ord('A'):\n",
+ " print \"Capital A\"\n",
+ "else:\n",
+ " if i == ord('B'):\n",
+ " print \"Capital B\"\n",
+ " else:\n",
+ " if i == ord('C'):\n",
+ " print \"Capital C\"\n",
+ " else:\n",
+ " if i > 47 and i < 58:\n",
+ " print \"Digit : [%c]\"%(i)\n",
+ " else:\n",
+ " if i >= 58 and i <= 64:\n",
+ " print \"Symbol : [%c]\"%(i)\n",
+ " else:\n",
+ " if i > 64 and i < 91:\n",
+ " print \"Capital : [%c]\"%(i)\n",
+ " else:\n",
+ " if i > 96 and i < 123:\n",
+ " print \"Small : [%c]\"%(i)\n",
+ " else:\n",
+ " print \"Invalid Choice\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any ASCII Number : 65\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capital A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter6.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter6.ipynb new file mode 100755 index 00000000..d9815e79 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter6.ipynb @@ -0,0 +1,42312 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 6: Loop Control Statements<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.1, Page number: 107<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the first five numbers starting from one together with thier squares\n",
+ "\n",
+ "#Result\n",
+ "#Since range() function starts with 0; to print upto 5, use 5+1 or 6\n",
+ "#range() function creates range or numbers from 1 to 6\n",
+ "\n",
+ "for i in range(1,5+1):\n",
+ " print(\"Number : %d it's Square : %d\"%(i,i*i))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number : 1 it's Square : 1\n",
+ "Number : 2 it's Square : 4\n",
+ "Number : 3 it's Square : 9\n",
+ "Number : 4 it's Square : 16\n",
+ "Number : 5 it's Square : 25\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.2, Page number: 108<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display numbers from 1 to 15 using for loop. Use i++\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "#There is no increment operator (++) in python\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "for i in range(1,15+1):\n",
+ " sys.stdout.write(\"%5d\"%(i))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.3, Page number: 108<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display numbers from 1 to 15 using for loop. Use i = i + 1\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "for i in range(1,15+1):\n",
+ " sys.stdout.write(\"%5d\"%(i))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.4, Page number: 109<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display numbers from 1 to 16. Use incrementation operation in the body of\n",
+ "#the loop for more than once\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "c = 0\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers and the third argument in the range function\n",
+ "#indicates the interval between the numbers.\n",
+ "\n",
+ "for i in range(0,15+1,2):\n",
+ " i += 1\n",
+ " sys.stdout.write(\"%5d\"%(i))\n",
+ " i = i + 1\n",
+ " sys.stdout.write(\"%5d\"%(i))\n",
+ " c += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\n\\nThe Body of the loop is executed for %d times\"%(c))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16\n",
+ "\n",
+ "The Body of the loop is executed for 8 times"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.5, Page number: 109<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display even numbers from 0 to 14 by declaring the initial counter value before\n",
+ "#the loop statement\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "c = 0\n",
+ "i = 0\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers and the third argument in the range function\n",
+ "#indicates the interval between the numbers.\n",
+ "\n",
+ "#counter variable initialization before the for loop will not affect much.\n",
+ "\n",
+ "for i in range(0,15+1,2):\n",
+ " sys.stdout.write(\"%5d\"%(i))\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 0 2 4 6 8 10 12 14"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.6, Page number: 110<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display numbers in ascending and descending orders.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "i = 0\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers and the third argument in the range function\n",
+ "#indicates the interval between the numbers.\n",
+ "\n",
+ "#counter variable initialization before the for loop will not affect much.\n",
+ "\n",
+ "sys.stdout.write(\"Numbers in Ascending Order : \")\n",
+ "for i in range(1,10+1):\n",
+ " sys.stdout.write(\"%3d\"%(i))\n",
+ " \n",
+ "sys.stdout.write(\"\\nNumbers in Descending Order : \")\n",
+ "for i in range(10,0,-1):\n",
+ " sys.stdout.write(\"%3d\"%(i))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Numbers in Ascending Order : 1 2 3 4 5 6 7 8 9 10\n",
+ "Numbers in Descending Order : 10 9 8 7 6 5 4 3 2 1"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.7, Page number: 110<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display numbers upto 10 using infinite for loop. Use goto statement to\n",
+ "#exit from the loop\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "i = 0\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers and the third argument in the range function\n",
+ "#indicates the interval between the numbers.\n",
+ "\n",
+ "#counter variable initialization before the for loop will not affect much.\n",
+ "\n",
+ "for i in range(0,15):\n",
+ " sys.stdout.write(\"%3d\"%(i))\n",
+ " i += 1\n",
+ " if i == 11:\n",
+ " break\n",
+ "\n",
+ "#there is no infinite for loop and goto statement in python.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 0 1 2 3 4 5 6 7 8 9 10"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.8, Page number: 111<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count numbers between 1 to 100 not divisible by 2, 3, and 5\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "c = 0\n",
+ "\n",
+ "sys.stdout.write(\"\\nNumbers from 1 to 100 not divisible by 2,3&5\\n\\n\")\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers \n",
+ "\n",
+ "for x in range(0,100+1):\n",
+ " if x%2 != 0 and x%3 != 0 and x%5 != 0:\n",
+ " sys.stdout.write(\"%d\\t\"%(x))\n",
+ " c += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\nTotal Numbers : %d\"%(c))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Numbers from 1 to 100 not divisible by 2,3&5\n",
+ "\n",
+ "1\t7\t11\t13\t17\t19\t23\t29\t31\t37\t41\t43\t47\t49\t53\t59\t61\t67\t71\t73\t77\t79\t83\t89\t91\t97\t\n",
+ "Total Numbers : 26"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.9, Page number: 112<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the numbers in increasing and decreasing order using infinite\n",
+ "#for loop\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = int(raw_input(\"Enter a number : \"))\n",
+ "a = b = n\n",
+ "\n",
+ "sys.stdout.write(\"(++) (--)\\n\")\n",
+ "sys.stdout.write(\"===================\")\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "#There is no infinite for loop in python. so separate iteration variable i is used\n",
+ "\n",
+ "for i in range(0,100):\n",
+ " sys.stdout.write(\"\\n%d\\t%d\"%(a,b))\n",
+ " if b == 0:\n",
+ " break\n",
+ " a += 1\n",
+ " b -= 1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(++) (--)\n",
+ "===================\n",
+ "5\t5\n",
+ "6\t4\n",
+ "7\t3\n",
+ "8\t2\n",
+ "9\t1\n",
+ "10\t0"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.10, Page number: 113<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Create an infinite loop. Check each value of the for loop. if the value is\n",
+ "#even, display it otherwise continue with interations. Print even numbers from\n",
+ "#1 to 21. Use break statement to terminate the program.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 1\n",
+ "\n",
+ "sys.stdout.write(\"\\n\\t\\tTable of Even numbers from 1 to 20\")\n",
+ "sys.stdout.write(\"\\n\\t\\t==================================\\n\")\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "#There is no infinite for loop in python. so separate iteration variable i is used\n",
+ "\n",
+ "for i in range(1,100):\n",
+ " if i == 20:\n",
+ " break\n",
+ " else:\n",
+ " if i%2 == 0:\n",
+ " sys.stdout.write(\"%d\\t\"%(i))\n",
+ " continue\n",
+ " else:\n",
+ " continue"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\t\tTable of Even numbers from 1 to 20\n",
+ "\t\t==================================\n",
+ "2\t4\t6\t8\t10\t12\t14\t16\t18\t"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.11, Page number: 113<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the sum of first five numbers and their squares. Display their results\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "#since sum is a function in python, sum1 is used instead of variable sum.\n",
+ "\n",
+ "sum1 = 0\n",
+ "sqsum = 0\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "for i in range(1,5+1):\n",
+ " sum1 += i\n",
+ " sqsum += i*i\n",
+ " sys.stdout.write(\"\\nNumber : %5d it's Square : %8d\"%(i,i*i))\n",
+ "\n",
+ "sys.stdout.write(\"\\n=================================================\")\n",
+ "sys.stdout.write(\"\\nThe Sum %6d Sum of Squares %9d\"%(sum1,sqsum))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Number : 1 it's Square : 1\n",
+ "Number : 2 it's Square : 4\n",
+ "Number : 3 it's Square : 9\n",
+ "Number : 4 it's Square : 16\n",
+ "Number : 5 it's Square : 25\n",
+ "=================================================\n",
+ "The Sum 15 Sum of Squares 55"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.12, Page number: 114<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display numbers from 1 to 9 and their square roots.\n",
+ "\n",
+ "import math\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "for i in range(1,9+1):\n",
+ " a = math.sqrt(i)\n",
+ " sys.stdout.write(\"\\n\\t%d %.2f\"%(i,a))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\t1 1.00\n",
+ "\t2 1.41\n",
+ "\t3 1.73\n",
+ "\t4 2.00\n",
+ "\t5 2.24\n",
+ "\t6 2.45\n",
+ "\t7 2.65\n",
+ "\t8 2.83\n",
+ "\t9 3.00"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.13, Page number: 115<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the number in between 7 and 100 which is exactly divisible by\n",
+ "#4 and if divided by 5 and 6 remainders obtained should be 4.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "for x in range(7,100+1):\n",
+ " if x%4 == 0 and x%5 == 4 and x%6 == 4:\n",
+ " sys.stdout.write(\"\\nMinimum Number : %d\"%(x))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Minimum Number : 64"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.14, Page number: 115<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Evaluate the series given\n",
+ "# x = 1/1 + 1/4 + 1/9 ... 1/n2\n",
+ "# y = 1/1 + 1/8 + 1/27 ... 1/n3\n",
+ "\n",
+ "#Variable declaration\n",
+ "x = 0.0\n",
+ "y = 0.0\n",
+ "n = int(raw_input(\"Enter Value of n : \"))\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "for i in range(1,n+1):\n",
+ " x = x + (1.0/pow(i,2))\n",
+ " y = y + (1.0/pow(i,3))\n",
+ "\n",
+ "print(\"Value of x = %f\"%(x))\n",
+ "print(\"\\nValue of y = %f\"%(y))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of n : 2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of x = 1.250000\n",
+ "\n",
+ "Value of y = 1.125000\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.15, Page number: 116<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Generate Triangular number\n",
+ "#Note: Triangular number is nothing but summation of 1 to given number.\n",
+ "#For example, when entered number is 5 it's triangular number would be\n",
+ "#(1+2+3+4+5) = 15.\n",
+ "\n",
+ "\n",
+ "#Variable declaration\n",
+ "tri_num = 0\n",
+ "n = int(raw_input(\"What Triangular number do you want : \"))\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "for j in range(1,n+1):\n",
+ " tri_num = tri_num + j\n",
+ "\n",
+ "print(\"Triangular number of %d is %d\\n\"%(n,tri_num))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "What Triangular number do you want : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Triangular number of 5 is 15\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.16, Page number: 117<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find sum of the following series\n",
+ "# 1 + 2 + 3 + ... n\n",
+ "# 1^2 + 2^2 + 2^3 + ... n^2\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration\n",
+ "#since sum is a function name in python, sum1 is used instead of sum.\n",
+ "\n",
+ "sum1 = 0\n",
+ "ssum = 0\n",
+ "j = int(raw_input(\"Enter Number : \"))\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "sys.stdout.write(\"Numbers : \")\n",
+ "for i in range(1,j+1):\n",
+ " sys.stdout.write(\"%5d\"%(i))\n",
+ "\n",
+ "sys.stdout.write(\"\\nSquares : \")\n",
+ "for i in range(1,j+1):\n",
+ " sys.stdout.write(\"%5d\"%(i*i))\n",
+ " sum1 = sum1 + i\n",
+ " ssum = ssum + i*i\n",
+ "sys.stdout.write(\"\\nSum of Numbers from 1 to %d : %d\"%(j,sum1))\n",
+ "sys.stdout.write(\"\\nSum of Squares of 1 to %d Numbers : %d\"%(j,ssum))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Numbers : 1 2 3 4 5\n",
+ "Squares : 1 4 9 16 25\n",
+ "Sum of Numbers from 1 to 5 : 15\n",
+ "Sum of Squares of 1 to 5 Numbers : 55"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.17, Page number: 118<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the perfect squares from 1 to 500.\n",
+ "\n",
+ "import sys\n",
+ "import math\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers\n",
+ "\n",
+ "sys.stdout.write(\"\\n\\n\")\n",
+ "sys.stdout.write(\"Perfect square from 1 to 500 \\n\")\n",
+ "count = 0\n",
+ "\n",
+ "for i in range(1,500+1):\n",
+ " c = math.sqrt(i)\n",
+ " x = math.floor(c) #For rounding up floor() is used\n",
+ " if c == x:\n",
+ " sys.stdout.write(\"\\t%5d\"%(i))\n",
+ " count += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\n\\nTotal Perfect Squares = %d\"%(count))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "Perfect square from 1 to 500 \n",
+ "\t 1\t 4\t 9\t 16\t 25\t 36\t 49\t 64\t 81\t 100\t 121\t 144\t 169\t 196\t 225\t 256\t 289\t 324\t 361\t 400\t 441\t 484\n",
+ "\n",
+ "Total Perfect Squares = 22"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.18, Page number: 119<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detect the largest number out of five numbers.\n",
+ "\n",
+ "import sys\n",
+ "import math\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers.\n",
+ "#since sum is a built in function in python, sum1 is used instead of sum.\n",
+ "\n",
+ "a = int(raw_input(\"Enter five numbers : \"))\n",
+ "b = int(raw_input(\"Enter five numbers : \"))\n",
+ "c = int(raw_input(\"Enter five numbers : \"))\n",
+ "d = int(raw_input(\"Enter five numbers : \"))\n",
+ "e = int(raw_input(\"Enter five numbers : \"))\n",
+ "\n",
+ "sum1 = a + b + c + d + e\n",
+ "\n",
+ "for i in range(sum1,1,-1):\n",
+ " if i == a or i == b or i == c or i == d or i == e:\n",
+ " sys.stdout.write(\"The Largest Number : %d\"%(i))\n",
+ " break\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Largest Number : 7"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.19, Page number: 119<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detect the smallesst number out of five numbers.\n",
+ "\n",
+ "import sys\n",
+ "import math\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers.\n",
+ "#since sum is a built in function in python, sum1 is used instead of sum.\n",
+ "\n",
+ "a = int(raw_input(\"Enter five numbers : \"))\n",
+ "b = int(raw_input(\"Enter five numbers : \"))\n",
+ "c = int(raw_input(\"Enter five numbers : \"))\n",
+ "d = int(raw_input(\"Enter five numbers : \"))\n",
+ "e = int(raw_input(\"Enter five numbers : \"))\n",
+ "\n",
+ "sum1 = a + b + c + d + e\n",
+ "\n",
+ "for i in range(1,sum1):\n",
+ " if i == a or i == b or i == c or i == d or i == e:\n",
+ " sys.stdout.write(\"The Smallest Number : %d\"%(i))\n",
+ " break\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Smallest Number : 2"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.20, Page number: 120<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read five numbers and print in ascending order\n",
+ "\n",
+ "import sys\n",
+ "import math\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers.\n",
+ "#since sum is a built in function in python, sum1 is used instead of sum.\n",
+ "\n",
+ "#use commas to separate the input values\n",
+ "a = int(raw_input(\"Enter five numbers : \"))\n",
+ "b = int(raw_input(\"Enter five numbers : \"))\n",
+ "c = int(raw_input(\"Enter five numbers : \"))\n",
+ "d = int(raw_input(\"Enter five numbers : \"))\n",
+ "e = int(raw_input(\"Enter five numbers : \"))\n",
+ "\n",
+ "sys.stdout.write(\"Numbers in ascending order : \")\n",
+ "sum1 = a + b + c + d + e\n",
+ "\n",
+ "for i in range(1,sum1):\n",
+ " if i == a or i == b or i == c or i == d or i == e:\n",
+ " sys.stdout.write(\"%3d\"%(i))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter five numbers : 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Numbers in ascending order : 1 4 5 7 8"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.21, Page number: 121<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Perform multiplication of two integers by using negative sign\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "#the range() function creates range of numbers and for loop automatically\n",
+ "#iterate through the numbers.\n",
+ "\n",
+ "a = int(raw_input(\"Enter two numbers : \"))\n",
+ "b = int(raw_input(\"Enter two numbers : \"))\n",
+ "\n",
+ "d = 0\n",
+ "for c in range(1,b+1):\n",
+ " d = d - (-a)\n",
+ "\n",
+ "sys.stdout.write(\"Multiplication of %d * %d : %d\"%(a,b,d))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter two numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter two numbers : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Multiplication of 5 * 5 : 25"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.22, Page number: 121<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Perform multiplication of two integers by using repetitive addition\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "#in python, infinite for loop is not possible.\n",
+ "\n",
+ "a = int(raw_input(\"Enter two numbers : \"))\n",
+ "b = int(raw_input(\"Enter two numbers : \"))\n",
+ "\n",
+ "d = 0\n",
+ "c = 1\n",
+ "while True:\n",
+ " d = d + a\n",
+ " if c == b:\n",
+ " break\n",
+ " c += 1\n",
+ "\n",
+ "sys.stdout.write(\"Multiplication of %d * %d : %d\"%(a,b,d))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter two numbers : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter two numbers : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Multiplication of 8 * 4 : 32"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.23, Page number: 122<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the marks for five subjects and calculate sum & average of marks.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "#use spaces to separate the input values\n",
+ "#since sum is a built-in function in python, sum1 is used as the variable name\n",
+ "\n",
+ "sys.stdout.write(\"Enter The Marks of Five Subjects \")\n",
+ "sum1 = 0\n",
+ "\n",
+ "for i in range(1,5+1):\n",
+ " sys.stdout.write(\"[%d] Student : \"%(i))\n",
+ " #Exception handling\n",
+ " try:\n",
+ " #use space to separate the input characters\n",
+ " v = raw_input(\"\")\n",
+ " a,b,c,d,e = map(int,v.split())\n",
+ " x = 5\n",
+ " except:\n",
+ " x = 0\n",
+ "\n",
+ " if(x == 5):\n",
+ " sum1 = a + b + c + d + e\n",
+ " avg = sum1/5\n",
+ " sys.stdout.write(\"\\nTotal Marks of Student [%d] %d\"%(i,sum1))\n",
+ " sys.stdout.write(\"\\nAverage Marks of Student [%d] %f\"%(i,avg))\n",
+ " else:\n",
+ " sys.stdout.write(\"Type Mismatch\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter The Marks of Five Subjects [1] Student : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "58 52 52 56 78\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Total Marks of Student [1] 296\n",
+ "Average Marks of Student [1] 59.000000[2] Student : "
+ ]
+ }
+ ],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.24, Page number: 123<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Enter a character and display its position in alphabetic order.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "c = 1\n",
+ "\n",
+ "ch = raw_input(\"Enter a character :\")\n",
+ "ch = ch.upper()\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "#ord() function converts the character ASCII value to integer\n",
+ "for i in range(65,90+1):\n",
+ " if ord(ch) == i:\n",
+ " sys.stdout.write(\"'%c' is %d [st/nd/rd/th] Character in Alphabetic\"%(i,c))\n",
+ " c += 1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a character :U\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "'U' is 21 [st/nd/rd/th] Character in Alphabetic"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.25, Page number: 124<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of -m^x.\n",
+ "#'m' is a mantissa and 'x' is an exponent\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "number = int(raw_input(\"Enter Number : \"))\n",
+ "power = int(raw_input(\"Enter Power : \"))\n",
+ "\n",
+ "ans = 1\n",
+ "\n",
+ "#Calculation\n",
+ "for i in range(1,power+1):\n",
+ " ans *= number\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"The Power of %d raised to %d is %ld\"%(number,power,ans))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Power : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Power of 5 raised to 3 is 125"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.26, Page number: 124<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Subtraction of two loop variables using nested for loops.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Calculation & Result\n",
+ "for a in range(3,0,-1):\n",
+ " for b in range(1,2+1):\n",
+ " sub = a - b\n",
+ " sys.stdout.write(\"a = %d b = %d a - b = %d\\n\"%(a,b,sub))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a = 3 b = 1 a - b = 2\n",
+ "a = 3 b = 2 a - b = 1\n",
+ "a = 2 b = 1 a - b = 1\n",
+ "a = 2 b = 2 a - b = 0\n",
+ "a = 1 b = 1 a - b = 0\n",
+ "a = 1 b = 2 a - b = -1\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.27, Page number: 125<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Illustrate an example based on nested for loops\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Calculation & Result\n",
+ "for i in range(1,3+1): #outer loop\n",
+ " for j in range(1,2+1): #inner loop\n",
+ " sys.stdout.write(\"\\ni * j : %d\"%(i*j))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "i * j : 1\n",
+ "i * j : 2\n",
+ "i * j : 2\n",
+ "i * j : 4\n",
+ "i * j : 3\n",
+ "i * j : 6"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.28, Page number: 126<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print values and messages when any loop ends using nested for loops.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Calculation & Result\n",
+ "for a in range(1,2+1): #outer loop\n",
+ " for b in range(1,2+1): #middle loop\n",
+ " for c in range(1,2+1): #inner loop\n",
+ " sys.stdout.write(\"\\na = %d + b = %d + c = %d : %d\"%(a,b,c,a+b+c))\n",
+ " sys.stdout.write(\"\\nInner Loop Over.\")\n",
+ " sys.stdout.write(\"\\nMiddle Loop Over.\")\n",
+ "sys.stdout.write(\"\\nOuter Loop Over.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "a = 1 + b = 1 + c = 1 : 3\n",
+ "a = 1 + b = 1 + c = 2 : 4\n",
+ "Inner Loop Over.\n",
+ "a = 1 + b = 2 + c = 1 : 4\n",
+ "a = 1 + b = 2 + c = 2 : 5\n",
+ "Inner Loop Over.\n",
+ "Middle Loop Over.\n",
+ "a = 2 + b = 1 + c = 1 : 4\n",
+ "a = 2 + b = 1 + c = 2 : 5\n",
+ "Inner Loop Over.\n",
+ "a = 2 + b = 2 + c = 1 : 5\n",
+ "a = 2 + b = 2 + c = 2 : 6\n",
+ "Inner Loop Over.\n",
+ "Middle Loop Over.\n",
+ "Outer Loop Over."
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.29, Page number: 127<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display perfect cubes up to given number.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "k = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "for i in range(1,k+1):\n",
+ " for j in range(1,i+1): \n",
+ " if i == pow(j,3):\n",
+ " sys.stdout.write(\"\\nNumber : %d & it's Cube : %d\"%(j,i))\n",
+ " \n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 100\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Number : 1 & it's Cube : 1\n",
+ "Number : 2 & it's Cube : 8\n",
+ "Number : 3 & it's Cube : 27\n",
+ "Number : 4 & it's Cube : 64"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.30, Page number: 128<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display numbers 1 to 100 using ASCII values from 48 to 57. Use nested loops.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "j = 0\n",
+ "k = -9\n",
+ "\n",
+ "sys.stdout.write(\"\\tTable of 1 to 100 Numbers Using ASCII Values\\n\")\n",
+ "sys.stdout.write(\"\\t===== == = == === ======= ===== ===== ======\\n\")\n",
+ "\n",
+ "#Calculation & Result\n",
+ "for i in range(48,57+1):\n",
+ " for j in range(48,57+1): \n",
+ " sys.stdout.write(\"\\t%c%c\"%(i,j))\n",
+ " #if k != 1:\n",
+ " # sys.stdout.write(\"%c\"%(i+1))\n",
+ " #if k == 0:\n",
+ " # sys.stdout.write(\"\\b\\b%d\"%(k+1))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " k += 1\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\tTable of 1 to 100 Numbers Using ASCII Values\n",
+ "\t===== == = == === ======= ===== ===== ======\n",
+ "\t00\t01\t02\t03\t04\t05\t06\t07\t08\t09\n",
+ "\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\n",
+ "\t20\t21\t22\t23\t24\t25\t26\t27\t28\t29\n",
+ "\t30\t31\t32\t33\t34\t35\t36\t37\t38\t39\n",
+ "\t40\t41\t42\t43\t44\t45\t46\t47\t48\t49\n",
+ "\t50\t51\t52\t53\t54\t55\t56\t57\t58\t59\n",
+ "\t60\t61\t62\t63\t64\t65\t66\t67\t68\t69\n",
+ "\t70\t71\t72\t73\t74\t75\t76\t77\t78\t79\n",
+ "\t80\t81\t82\t83\t84\t85\t86\t87\t88\t89\n",
+ "\t90\t91\t92\t93\t94\t95\t96\t97\t98\t99\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.31, Page number: 129<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count number of votes secured by 'A' & 'B'. Assume three voters are\n",
+ "#voting them. Also count the invalid votes.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization & Calculation\n",
+ "a = 0\n",
+ "b = 0\n",
+ "o = 0\n",
+ "sys.stdout.write(\"Press A or B\\n\")\n",
+ "for i in range(1,3+1):\n",
+ " sys.stdout.write(\"\\nVoter no. %d\"%(i))\n",
+ " sys.stdout.write(\" Enter Vote : \")\n",
+ " v = raw_input(\"\")\n",
+ " v = v.upper()\n",
+ " if v == 'A':\n",
+ " a += 1\n",
+ " else:\n",
+ " if v == 'B':\n",
+ " b += 1\n",
+ " else:\n",
+ " o += 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nStatus of vote(s)\\n\")\n",
+ "sys.stdout.write(\"\\nA secures %d vote(s).\"%(a))\n",
+ "sys.stdout.write(\"\\nB secures %d vote(s).\"%(b))\n",
+ "sys.stdout.write(\"\\nInvalid vote(s) %d.\"%(o))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Press A or B\n",
+ "\n",
+ "Voter no. 1 Enter Vote : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Voter no. 2 Enter Vote : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Voter no. 3 Enter Vote : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Status of vote(s)\n",
+ "\n",
+ "A secures 1 vote(s).\n",
+ "B secures 1 vote(s).\n",
+ "Invalid vote(s) 1."
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.32, Page number: 130<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Simulate a digital clock\n",
+ "\n",
+ "import sys\n",
+ "import os\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"hh mm ss\\n\")\n",
+ "for h in range(1,12):\n",
+ " for m in range(1,59):\n",
+ " for s in range(1,59):\n",
+ " sys.stdout.write(\"\\r%d %d %d\"%(h,m,s))\n",
+ " \n",
+ "#Displays the last value"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hh mm ss\n",
+ "\r",
+ "1 1 1\r",
+ "1 1 2\r",
+ "1 1 3\r",
+ "1 1 4\r",
+ "1 1 5\r",
+ "1 1 6\r",
+ "1 1 7\r",
+ "1 1 8\r",
+ "1 1 9\r",
+ "1 1 10\r",
+ "1 1 11\r",
+ "1 1 12\r",
+ "1 1 13\r",
+ "1 1 14\r",
+ "1 1 15\r",
+ "1 1 16\r",
+ "1 1 17\r",
+ "1 1 18\r",
+ "1 1 19\r",
+ "1 1 20\r",
+ "1 1 21\r",
+ "1 1 22\r",
+ "1 1 23\r",
+ "1 1 24\r",
+ "1 1 25\r",
+ "1 1 26\r",
+ "1 1 27\r",
+ "1 1 28\r",
+ "1 1 29\r",
+ "1 1 30\r",
+ "1 1 31\r",
+ "1 1 32\r",
+ "1 1 33\r",
+ "1 1 34\r",
+ "1 1 35\r",
+ "1 1 36\r",
+ "1 1 37\r",
+ "1 1 38\r",
+ "1 1 39\r",
+ "1 1 40\r",
+ "1 1 41\r",
+ "1 1 42\r",
+ "1 1 43\r",
+ "1 1 44\r",
+ "1 1 45\r",
+ "1 1 46\r",
+ "1 1 47\r",
+ "1 1 48\r",
+ "1 1 49\r",
+ "1 1 50\r",
+ "1 1 51\r",
+ "1 1 52\r",
+ "1 1 53\r",
+ "1 1 54\r",
+ "1 1 55\r",
+ "1 1 56\r",
+ "1 1 57\r",
+ "1 1 58\r",
+ "1 2 1\r",
+ "1 2 2\r",
+ "1 2 3\r",
+ "1 2 4\r",
+ "1 2 5\r",
+ "1 2 6\r",
+ "1 2 7\r",
+ "1 2 8\r",
+ "1 2 9\r",
+ "1 2 10\r",
+ "1 2 11\r",
+ "1 2 12\r",
+ "1 2 13\r",
+ "1 2 14\r",
+ "1 2 15\r",
+ "1 2 16\r",
+ "1 2 17\r",
+ "1 2 18\r",
+ "1 2 19\r",
+ "1 2 20\r",
+ "1 2 21\r",
+ "1 2 22\r",
+ "1 2 23\r",
+ "1 2 24\r",
+ "1 2 25\r",
+ "1 2 26\r",
+ "1 2 27\r",
+ "1 2 28\r",
+ "1 2 29\r",
+ "1 2 30\r",
+ "1 2 31\r",
+ "1 2 32\r",
+ "1 2 33\r",
+ "1 2 34\r",
+ "1 2 35\r",
+ "1 2 36\r",
+ "1 2 37\r",
+ "1 2 38\r",
+ "1 2 39\r",
+ "1 2 40\r",
+ "1 2 41\r",
+ "1 2 42\r",
+ "1 2 43\r",
+ "1 2 44\r",
+ "1 2 45\r",
+ "1 2 46\r",
+ "1 2 47\r",
+ "1 2 48\r",
+ "1 2 49\r",
+ "1 2 50\r",
+ "1 2 51\r",
+ "1 2 52\r",
+ "1 2 53\r",
+ "1 2 54\r",
+ "1 2 55\r",
+ "1 2 56\r",
+ "1 2 57\r",
+ "1 2 58\r",
+ "1 3 1\r",
+ "1 3 2\r",
+ "1 3 3\r",
+ "1 3 4\r",
+ "1 3 5\r",
+ "1 3 6\r",
+ "1 3 7\r",
+ "1 3 8\r",
+ "1 3 9\r",
+ "1 3 10\r",
+ "1 3 11\r",
+ "1 3 12\r",
+ "1 3 13\r",
+ "1 3 14\r",
+ "1 3 15\r",
+ "1 3 16\r",
+ "1 3 17\r",
+ "1 3 18\r",
+ "1 3 19\r",
+ "1 3 20\r",
+ "1 3 21\r",
+ "1 3 22\r",
+ "1 3 23\r",
+ "1 3 24\r",
+ "1 3 25\r",
+ "1 3 26\r",
+ "1 3 27\r",
+ "1 3 28\r",
+ "1 3 29\r",
+ "1 3 30\r",
+ "1 3 31\r",
+ "1 3 32\r",
+ "1 3 33\r",
+ "1 3 34\r",
+ "1 3 35\r",
+ "1 3 36\r",
+ "1 3 37\r",
+ "1 3 38\r",
+ "1 3 39\r",
+ "1 3 40\r",
+ "1 3 41\r",
+ "1 3 42\r",
+ "1 3 43\r",
+ "1 3 44\r",
+ "1 3 45\r",
+ "1 3 46\r",
+ "1 3 47\r",
+ "1 3 48\r",
+ "1 3 49\r",
+ "1 3 50\r",
+ "1 3 51\r",
+ "1 3 52\r",
+ "1 3 53\r",
+ "1 3 54\r",
+ "1 3 55\r",
+ "1 3 56\r",
+ "1 3 57\r",
+ "1 3 58\r",
+ "1 4 1\r",
+ "1 4 2\r",
+ "1 4 3\r",
+ "1 4 4\r",
+ "1 4 5\r",
+ "1 4 6\r",
+ "1 4 7\r",
+ "1 4 8\r",
+ "1 4 9\r",
+ "1 4 10\r",
+ "1 4 11\r",
+ "1 4 12\r",
+ "1 4 13\r",
+ "1 4 14\r",
+ "1 4 15\r",
+ "1 4 16\r",
+ "1 4 17\r",
+ "1 4 18\r",
+ "1 4 19\r",
+ "1 4 20\r",
+ "1 4 21\r",
+ "1 4 22\r",
+ "1 4 23\r",
+ "1 4 24\r",
+ "1 4 25\r",
+ "1 4 26\r",
+ "1 4 27\r",
+ "1 4 28\r",
+ "1 4 29\r",
+ "1 4 30\r",
+ "1 4 31\r",
+ "1 4 32\r",
+ "1 4 33\r",
+ "1 4 34\r",
+ "1 4 35\r",
+ "1 4 36\r",
+ "1 4 37\r",
+ "1 4 38\r",
+ "1 4 39\r",
+ "1 4 40\r",
+ "1 4 41\r",
+ "1 4 42\r",
+ "1 4 43\r",
+ "1 4 44\r",
+ "1 4 45\r",
+ "1 4 46\r",
+ "1 4 47\r",
+ "1 4 48\r",
+ "1 4 49\r",
+ "1 4 50\r",
+ "1 4 51\r",
+ "1 4 52\r",
+ "1 4 53\r",
+ "1 4 54\r",
+ "1 4 55\r",
+ "1 4 56\r",
+ "1 4 57\r",
+ "1 4 58\r",
+ "1 5 1\r",
+ "1 5 2\r",
+ "1 5 3\r",
+ "1 5 4\r",
+ "1 5 5\r",
+ "1 5 6\r",
+ "1 5 7\r",
+ "1 5 8\r",
+ "1 5 9\r",
+ "1 5 10\r",
+ "1 5 11\r",
+ "1 5 12\r",
+ "1 5 13\r",
+ "1 5 14\r",
+ "1 5 15\r",
+ "1 5 16\r",
+ "1 5 17\r",
+ "1 5 18\r",
+ "1 5 19\r",
+ "1 5 20\r",
+ "1 5 21\r",
+ "1 5 22\r",
+ "1 5 23\r",
+ "1 5 24\r",
+ "1 5 25\r",
+ "1 5 26\r",
+ "1 5 27\r",
+ "1 5 28\r",
+ "1 5 29\r",
+ "1 5 30\r",
+ "1 5 31\r",
+ "1 5 32\r",
+ "1 5 33\r",
+ "1 5 34\r",
+ "1 5 35\r",
+ "1 5 36\r",
+ "1 5 37\r",
+ "1 5 38\r",
+ "1 5 39\r",
+ "1 5 40\r",
+ "1 5 41\r",
+ "1 5 42\r",
+ "1 5 43\r",
+ "1 5 44\r",
+ "1 5 45\r",
+ "1 5 46\r",
+ "1 5 47\r",
+ "1 5 48\r",
+ "1 5 49\r",
+ "1 5 50\r",
+ "1 5 51\r",
+ "1 5 52\r",
+ "1 5 53\r",
+ "1 5 54\r",
+ "1 5 55\r",
+ "1 5 56\r",
+ "1 5 57\r",
+ "1 5 58\r",
+ "1 6 1\r",
+ "1 6 2\r",
+ "1 6 3\r",
+ "1 6 4\r",
+ "1 6 5\r",
+ "1 6 6\r",
+ "1 6 7\r",
+ "1 6 8\r",
+ "1 6 9\r",
+ "1 6 10\r",
+ "1 6 11\r",
+ "1 6 12\r",
+ "1 6 13\r",
+ "1 6 14\r",
+ "1 6 15\r",
+ "1 6 16\r",
+ "1 6 17\r",
+ "1 6 18\r",
+ "1 6 19\r",
+ "1 6 20\r",
+ "1 6 21\r",
+ "1 6 22\r",
+ "1 6 23\r",
+ "1 6 24\r",
+ "1 6 25\r",
+ "1 6 26\r",
+ "1 6 27\r",
+ "1 6 28\r",
+ "1 6 29\r",
+ "1 6 30\r",
+ "1 6 31\r",
+ "1 6 32\r",
+ "1 6 33\r",
+ "1 6 34\r",
+ "1 6 35\r",
+ "1 6 36\r",
+ "1 6 37\r",
+ "1 6 38\r",
+ "1 6 39\r",
+ "1 6 40\r",
+ "1 6 41\r",
+ "1 6 42\r",
+ "1 6 43\r",
+ "1 6 44\r",
+ "1 6 45\r",
+ "1 6 46\r",
+ "1 6 47\r",
+ "1 6 48\r",
+ "1 6 49\r",
+ "1 6 50\r",
+ "1 6 51\r",
+ "1 6 52\r",
+ "1 6 53\r",
+ "1 6 54\r",
+ "1 6 55\r",
+ "1 6 56\r",
+ "1 6 57\r",
+ "1 6 58\r",
+ "1 7 1\r",
+ "1 7 2\r",
+ "1 7 3\r",
+ "1 7 4\r",
+ "1 7 5\r",
+ "1 7 6\r",
+ "1 7 7\r",
+ "1 7 8\r",
+ "1 7 9\r",
+ "1 7 10\r",
+ "1 7 11\r",
+ "1 7 12\r",
+ "1 7 13\r",
+ "1 7 14\r",
+ "1 7 15\r",
+ "1 7 16\r",
+ "1 7 17\r",
+ "1 7 18\r",
+ "1 7 19\r",
+ "1 7 20\r",
+ "1 7 21\r",
+ "1 7 22\r",
+ "1 7 23\r",
+ "1 7 24\r",
+ "1 7 25\r",
+ "1 7 26\r",
+ "1 7 27\r",
+ "1 7 28\r",
+ "1 7 29\r",
+ "1 7 30\r",
+ "1 7 31\r",
+ "1 7 32\r",
+ "1 7 33\r",
+ "1 7 34\r",
+ "1 7 35\r",
+ "1 7 36\r",
+ "1 7 37\r",
+ "1 7 38\r",
+ "1 7 39\r",
+ "1 7 40\r",
+ "1 7 41\r",
+ "1 7 42\r",
+ "1 7 43\r",
+ "1 7 44\r",
+ "1 7 45\r",
+ "1 7 46\r",
+ "1 7 47\r",
+ "1 7 48\r",
+ "1 7 49\r",
+ "1 7 50\r",
+ "1 7 51\r",
+ "1 7 52\r",
+ "1 7 53\r",
+ "1 7 54\r",
+ "1 7 55\r",
+ "1 7 56\r",
+ "1 7 57\r",
+ "1 7 58\r",
+ "1 8 1\r",
+ "1 8 2\r",
+ "1 8 3\r",
+ "1 8 4\r",
+ "1 8 5\r",
+ "1 8 6\r",
+ "1 8 7\r",
+ "1 8 8\r",
+ "1 8 9\r",
+ "1 8 10\r",
+ "1 8 11\r",
+ "1 8 12\r",
+ "1 8 13\r",
+ "1 8 14\r",
+ "1 8 15\r",
+ "1 8 16\r",
+ "1 8 17\r",
+ "1 8 18\r",
+ "1 8 19\r",
+ "1 8 20\r",
+ "1 8 21\r",
+ "1 8 22\r",
+ "1 8 23\r",
+ "1 8 24\r",
+ "1 8 25\r",
+ "1 8 26\r",
+ "1 8 27\r",
+ "1 8 28\r",
+ "1 8 29\r",
+ "1 8 30\r",
+ "1 8 31\r",
+ "1 8 32\r",
+ "1 8 33\r",
+ "1 8 34\r",
+ "1 8 35\r",
+ "1 8 36\r",
+ "1 8 37\r",
+ "1 8 38\r",
+ "1 8 39\r",
+ "1 8 40\r",
+ "1 8 41\r",
+ "1 8 42\r",
+ "1 8 43\r",
+ "1 8 44\r",
+ "1 8 45\r",
+ "1 8 46\r",
+ "1 8 47\r",
+ "1 8 48\r",
+ "1 8 49\r",
+ "1 8 50\r",
+ "1 8 51\r",
+ "1 8 52\r",
+ "1 8 53\r",
+ "1 8 54\r",
+ "1 8 55\r",
+ "1 8 56\r",
+ "1 8 57\r",
+ "1 8 58\r",
+ "1 9 1\r",
+ "1 9 2\r",
+ "1 9 3\r",
+ "1 9 4\r",
+ "1 9 5\r",
+ "1 9 6\r",
+ "1 9 7\r",
+ "1 9 8\r",
+ "1 9 9\r",
+ "1 9 10\r",
+ "1 9 11\r",
+ "1 9 12\r",
+ "1 9 13\r",
+ "1 9 14\r",
+ "1 9 15\r",
+ "1 9 16\r",
+ "1 9 17\r",
+ "1 9 18\r",
+ "1 9 19\r",
+ "1 9 20\r",
+ "1 9 21\r",
+ "1 9 22\r",
+ "1 9 23\r",
+ "1 9 24\r",
+ "1 9 25\r",
+ "1 9 26\r",
+ "1 9 27\r",
+ "1 9 28\r",
+ "1 9 29\r",
+ "1 9 30\r",
+ "1 9 31\r",
+ "1 9 32\r",
+ "1 9 33\r",
+ "1 9 34\r",
+ "1 9 35\r",
+ "1 9 36\r",
+ "1 9 37\r",
+ "1 9 38\r",
+ "1 9 39\r",
+ "1 9 40\r",
+ "1 9 41\r",
+ "1 9 42\r",
+ "1 9 43\r",
+ "1 9 44\r",
+ "1 9 45\r",
+ "1 9 46\r",
+ "1 9 47\r",
+ "1 9 48\r",
+ "1 9 49\r",
+ "1 9 50\r",
+ "1 9 51\r",
+ "1 9 52\r",
+ "1 9 53\r",
+ "1 9 54\r",
+ "1 9 55\r",
+ "1 9 56\r",
+ "1 9 57\r",
+ "1 9 58\r",
+ "1 10 1\r",
+ "1 10 2\r",
+ "1 10 3\r",
+ "1 10 4\r",
+ "1 10 5\r",
+ "1 10 6\r",
+ "1 10 7\r",
+ "1 10 8\r",
+ "1 10 9\r",
+ "1 10 10\r",
+ "1 10 11\r",
+ "1 10 12\r",
+ "1 10 13\r",
+ "1 10 14\r",
+ "1 10 15\r",
+ "1 10 16\r",
+ "1 10 17\r",
+ "1 10 18\r",
+ "1 10 19\r",
+ "1 10 20\r",
+ "1 10 21\r",
+ "1 10 22\r",
+ "1 10 23\r",
+ "1 10 24\r",
+ "1 10 25\r",
+ "1 10 26\r",
+ "1 10 27\r",
+ "1 10 28\r",
+ "1 10 29\r",
+ "1 10 30\r",
+ "1 10 31\r",
+ "1 10 32\r",
+ "1 10 33\r",
+ "1 10 34\r",
+ "1 10 35\r",
+ "1 10 36\r",
+ "1 10 37\r",
+ "1 10 38\r",
+ "1 10 39\r",
+ "1 10 40\r",
+ "1 10 41\r",
+ "1 10 42\r",
+ "1 10 43\r",
+ "1 10 44\r",
+ "1 10 45\r",
+ "1 10 46\r",
+ "1 10 47\r",
+ "1 10 48\r",
+ "1 10 49\r",
+ "1 10 50\r",
+ "1 10 51\r",
+ "1 10 52\r",
+ "1 10 53\r",
+ "1 10 54\r",
+ "1 10 55\r",
+ "1 10 56\r",
+ "1 10 57\r",
+ "1 10 58\r",
+ "1 11 1\r",
+ "1 11 2\r",
+ "1 11 3\r",
+ "1 11 4\r",
+ "1 11 5\r",
+ "1 11 6\r",
+ "1 11 7\r",
+ "1 11 8\r",
+ "1 11 9\r",
+ "1 11 10\r",
+ "1 11 11\r",
+ "1 11 12\r",
+ "1 11 13\r",
+ "1 11 14\r",
+ "1 11 15\r",
+ "1 11 16\r",
+ "1 11 17\r",
+ "1 11 18\r",
+ "1 11 19\r",
+ "1 11 20\r",
+ "1 11 21\r",
+ "1 11 22\r",
+ "1 11 23\r",
+ "1 11 24\r",
+ "1 11 25\r",
+ "1 11 26\r",
+ "1 11 27\r",
+ "1 11 28\r",
+ "1 11 29\r",
+ "1 11 30\r",
+ "1 11 31\r",
+ "1 11 32\r",
+ "1 11 33\r",
+ "1 11 34\r",
+ "1 11 35\r",
+ "1 11 36\r",
+ "1 11 37\r",
+ "1 11 38\r",
+ "1 11 39\r",
+ "1 11 40\r",
+ "1 11 41\r",
+ "1 11 42\r",
+ "1 11 43\r",
+ "1 11 44\r",
+ "1 11 45\r",
+ "1 11 46\r",
+ "1 11 47\r",
+ "1 11 48\r",
+ "1 11 49\r",
+ "1 11 50\r",
+ "1 11 51\r",
+ "1 11 52\r",
+ "1 11 53\r",
+ "1 11 54\r",
+ "1 11 55\r",
+ "1 11 56\r",
+ "1 11 57\r",
+ "1 11 58\r",
+ "1 12 1\r",
+ "1 12 2\r",
+ "1 12 3\r",
+ "1 12 4\r",
+ "1 12 5\r",
+ "1 12 6\r",
+ "1 12 7\r",
+ "1 12 8\r",
+ "1 12 9\r",
+ "1 12 10\r",
+ "1 12 11\r",
+ "1 12 12\r",
+ "1 12 13\r",
+ "1 12 14\r",
+ "1 12 15\r",
+ "1 12 16\r",
+ "1 12 17\r",
+ "1 12 18\r",
+ "1 12 19\r",
+ "1 12 20\r",
+ "1 12 21\r",
+ "1 12 22\r",
+ "1 12 23\r",
+ "1 12 24\r",
+ "1 12 25\r",
+ "1 12 26\r",
+ "1 12 27\r",
+ "1 12 28\r",
+ "1 12 29\r",
+ "1 12 30\r",
+ "1 12 31\r",
+ "1 12 32\r",
+ "1 12 33\r",
+ "1 12 34\r",
+ "1 12 35\r",
+ "1 12 36\r",
+ "1 12 37\r",
+ "1 12 38\r",
+ "1 12 39\r",
+ "1 12 40\r",
+ "1 12 41\r",
+ "1 12 42\r",
+ "1 12 43\r",
+ "1 12 44\r",
+ "1 12 45\r",
+ "1 12 46\r",
+ "1 12 47\r",
+ "1 12 48\r",
+ "1 12 49\r",
+ "1 12 50\r",
+ "1 12 51\r",
+ "1 12 52\r",
+ "1 12 53\r",
+ "1 12 54\r",
+ "1 12 55\r",
+ "1 12 56\r",
+ "1 12 57\r",
+ "1 12 58\r",
+ "1 13 1\r",
+ "1 13 2\r",
+ "1 13 3\r",
+ "1 13 4\r",
+ "1 13 5\r",
+ "1 13 6\r",
+ "1 13 7\r",
+ "1 13 8\r",
+ "1 13 9\r",
+ "1 13 10\r",
+ "1 13 11\r",
+ "1 13 12\r",
+ "1 13 13\r",
+ "1 13 14\r",
+ "1 13 15\r",
+ "1 13 16\r",
+ "1 13 17\r",
+ "1 13 18\r",
+ "1 13 19\r",
+ "1 13 20\r",
+ "1 13 21\r",
+ "1 13 22\r",
+ "1 13 23\r",
+ "1 13 24\r",
+ "1 13 25\r",
+ "1 13 26\r",
+ "1 13 27\r",
+ "1 13 28\r",
+ "1 13 29\r",
+ "1 13 30\r",
+ "1 13 31\r",
+ "1 13 32\r",
+ "1 13 33\r",
+ "1 13 34\r",
+ "1 13 35\r",
+ "1 13 36\r",
+ "1 13 37\r",
+ "1 13 38\r",
+ "1 13 39\r",
+ "1 13 40\r",
+ "1 13 41\r",
+ "1 13 42\r",
+ "1 13 43\r",
+ "1 13 44\r",
+ "1 13 45\r",
+ "1 13 46\r",
+ "1 13 47\r",
+ "1 13 48\r",
+ "1 13 49\r",
+ "1 13 50\r",
+ "1 13 51\r",
+ "1 13 52\r",
+ "1 13 53\r",
+ "1 13 54\r",
+ "1 13 55\r",
+ "1 13 56\r",
+ "1 13 57\r",
+ "1 13 58\r",
+ "1 14 1\r",
+ "1 14 2\r",
+ "1 14 3\r",
+ "1 14 4\r",
+ "1 14 5\r",
+ "1 14 6\r",
+ "1 14 7\r",
+ "1 14 8\r",
+ "1 14 9\r",
+ "1 14 10\r",
+ "1 14 11\r",
+ "1 14 12\r",
+ "1 14 13\r",
+ "1 14 14\r",
+ "1 14 15\r",
+ "1 14 16\r",
+ "1 14 17\r",
+ "1 14 18\r",
+ "1 14 19\r",
+ "1 14 20\r",
+ "1 14 21\r",
+ "1 14 22\r",
+ "1 14 23\r",
+ "1 14 24\r",
+ "1 14 25\r",
+ "1 14 26\r",
+ "1 14 27\r",
+ "1 14 28\r",
+ "1 14 29\r",
+ "1 14 30\r",
+ "1 14 31\r",
+ "1 14 32\r",
+ "1 14 33\r",
+ "1 14 34\r",
+ "1 14 35\r",
+ "1 14 36\r",
+ "1 14 37\r",
+ "1 14 38\r",
+ "1 14 39\r",
+ "1 14 40\r",
+ "1 14 41\r",
+ "1 14 42\r",
+ "1 14 43\r",
+ "1 14 44\r",
+ "1 14 45\r",
+ "1 14 46\r",
+ "1 14 47\r",
+ "1 14 48\r",
+ "1 14 49\r",
+ "1 14 50\r",
+ "1 14 51\r",
+ "1 14 52\r",
+ "1 14 53\r",
+ "1 14 54\r",
+ "1 14 55\r",
+ "1 14 56\r",
+ "1 14 57\r",
+ "1 14 58\r",
+ "1 15 1\r",
+ "1 15 2\r",
+ "1 15 3\r",
+ "1 15 4\r",
+ "1 15 5\r",
+ "1 15 6\r",
+ "1 15 7\r",
+ "1 15 8\r",
+ "1 15 9\r",
+ "1 15 10\r",
+ "1 15 11\r",
+ "1 15 12\r",
+ "1 15 13\r",
+ "1 15 14\r",
+ "1 15 15\r",
+ "1 15 16\r",
+ "1 15 17\r",
+ "1 15 18\r",
+ "1 15 19\r",
+ "1 15 20\r",
+ "1 15 21\r",
+ "1 15 22\r",
+ "1 15 23\r",
+ "1 15 24\r",
+ "1 15 25\r",
+ "1 15 26\r",
+ "1 15 27\r",
+ "1 15 28\r",
+ "1 15 29\r",
+ "1 15 30\r",
+ "1 15 31\r",
+ "1 15 32\r",
+ "1 15 33\r",
+ "1 15 34\r",
+ "1 15 35\r",
+ "1 15 36\r",
+ "1 15 37\r",
+ "1 15 38\r",
+ "1 15 39\r",
+ "1 15 40\r",
+ "1 15 41\r",
+ "1 15 42\r",
+ "1 15 43\r",
+ "1 15 44\r",
+ "1 15 45\r",
+ "1 15 46\r",
+ "1 15 47\r",
+ "1 15 48\r",
+ "1 15 49\r",
+ "1 15 50\r",
+ "1 15 51\r",
+ "1 15 52\r",
+ "1 15 53\r",
+ "1 15 54\r",
+ "1 15 55\r",
+ "1 15 56\r",
+ "1 15 57\r",
+ "1 15 58\r",
+ "1 16 1\r",
+ "1 16 2\r",
+ "1 16 3\r",
+ "1 16 4\r",
+ "1 16 5\r",
+ "1 16 6\r",
+ "1 16 7\r",
+ "1 16 8\r",
+ "1 16 9\r",
+ "1 16 10\r",
+ "1 16 11\r",
+ "1 16 12\r",
+ "1 16 13\r",
+ "1 16 14\r",
+ "1 16 15\r",
+ "1 16 16\r",
+ "1 16 17\r",
+ "1 16 18\r",
+ "1 16 19\r",
+ "1 16 20\r",
+ "1 16 21\r",
+ "1 16 22\r",
+ "1 16 23\r",
+ "1 16 24\r",
+ "1 16 25\r",
+ "1 16 26\r",
+ "1 16 27\r",
+ "1 16 28\r",
+ "1 16 29\r",
+ "1 16 30\r",
+ "1 16 31\r",
+ "1 16 32\r",
+ "1 16 33\r",
+ "1 16 34\r",
+ "1 16 35\r",
+ "1 16 36\r",
+ "1 16 37\r",
+ "1 16 38\r",
+ "1 16 39\r",
+ "1 16 40\r",
+ "1 16 41\r",
+ "1 16 42\r",
+ "1 16 43\r",
+ "1 16 44\r",
+ "1 16 45\r",
+ "1 16 46\r",
+ "1 16 47\r",
+ "1 16 48\r",
+ "1 16 49\r",
+ "1 16 50\r",
+ "1 16 51\r",
+ "1 16 52\r",
+ "1 16 53\r",
+ "1 16 54\r",
+ "1 16 55\r",
+ "1 16 56\r",
+ "1 16 57\r",
+ "1 16 58\r",
+ "1 17 1\r",
+ "1 17 2\r",
+ "1 17 3\r",
+ "1 17 4\r",
+ "1 17 5\r",
+ "1 17 6\r",
+ "1 17 7\r",
+ "1 17 8\r",
+ "1 17 9\r",
+ "1 17 10\r",
+ "1 17 11\r",
+ "1 17 12\r",
+ "1 17 13\r",
+ "1 17 14\r",
+ "1 17 15\r",
+ "1 17 16\r",
+ "1 17 17\r",
+ "1 17 18\r",
+ "1 17 19\r",
+ "1 17 20\r",
+ "1 17 21\r",
+ "1 17 22\r",
+ "1 17 23\r",
+ "1 17 24\r",
+ "1 17 25\r",
+ "1 17 26\r",
+ "1 17 27\r",
+ "1 17 28\r",
+ "1 17 29\r",
+ "1 17 30\r",
+ "1 17 31\r",
+ "1 17 32\r",
+ "1 17 33\r",
+ "1 17 34\r",
+ "1 17 35\r",
+ "1 17 36\r",
+ "1 17 37\r",
+ "1 17 38\r",
+ "1 17 39\r",
+ "1 17 40\r",
+ "1 17 41\r",
+ "1 17 42\r",
+ "1 17 43\r",
+ "1 17 44\r",
+ "1 17 45\r",
+ "1 17 46\r",
+ "1 17 47\r",
+ "1 17 48\r",
+ "1 17 49\r",
+ "1 17 50\r",
+ "1 17 51\r",
+ "1 17 52\r",
+ "1 17 53\r",
+ "1 17 54\r",
+ "1 17 55\r",
+ "1 17 56\r",
+ "1 17 57\r",
+ "1 17 58\r",
+ "1 18 1\r",
+ "1 18 2\r",
+ "1 18 3\r",
+ "1 18 4\r",
+ "1 18 5\r",
+ "1 18 6\r",
+ "1 18 7\r",
+ "1 18 8\r",
+ "1 18 9\r",
+ "1 18 10\r",
+ "1 18 11\r",
+ "1 18 12\r",
+ "1 18 13\r",
+ "1 18 14\r",
+ "1 18 15\r",
+ "1 18 16\r",
+ "1 18 17\r",
+ "1 18 18\r",
+ "1 18 19\r",
+ "1 18 20\r",
+ "1 18 21\r",
+ "1 18 22\r",
+ "1 18 23\r",
+ "1 18 24\r",
+ "1 18 25\r",
+ "1 18 26\r",
+ "1 18 27\r",
+ "1 18 28\r",
+ "1 18 29\r",
+ "1 18 30\r",
+ "1 18 31\r",
+ "1 18 32\r",
+ "1 18 33\r",
+ "1 18 34\r",
+ "1 18 35\r",
+ "1 18 36\r",
+ "1 18 37\r",
+ "1 18 38\r",
+ "1 18 39\r",
+ "1 18 40\r",
+ "1 18 41\r",
+ "1 18 42\r",
+ "1 18 43\r",
+ "1 18 44\r",
+ "1 18 45\r",
+ "1 18 46\r",
+ "1 18 47\r",
+ "1 18 48\r",
+ "1 18 49\r",
+ "1 18 50\r",
+ "1 18 51\r",
+ "1 18 52\r",
+ "1 18 53\r",
+ "1 18 54\r",
+ "1 18 55\r",
+ "1 18 56\r",
+ "1 18 57\r",
+ "1 18 58\r",
+ "1 19 1\r",
+ "1 19 2\r",
+ "1 19 3\r",
+ "1 19 4\r",
+ "1 19 5\r",
+ "1 19 6\r",
+ "1 19 7\r",
+ "1 19 8\r",
+ "1 19 9\r",
+ "1 19 10\r",
+ "1 19 11\r",
+ "1 19 12\r",
+ "1 19 13\r",
+ "1 19 14\r",
+ "1 19 15\r",
+ "1 19 16\r",
+ "1 19 17\r",
+ "1 19 18\r",
+ "1 19 19\r",
+ "1 19 20\r",
+ "1 19 21\r",
+ "1 19 22\r",
+ "1 19 23\r",
+ "1 19 24\r",
+ "1 19 25\r",
+ "1 19 26\r",
+ "1 19 27\r",
+ "1 19 28\r",
+ "1 19 29\r",
+ "1 19 30\r",
+ "1 19 31\r",
+ "1 19 32\r",
+ "1 19 33\r",
+ "1 19 34\r",
+ "1 19 35\r",
+ "1 19 36\r",
+ "1 19 37\r",
+ "1 19 38\r",
+ "1 19 39\r",
+ "1 19 40\r",
+ "1 19 41\r",
+ "1 19 42\r",
+ "1 19 43\r",
+ "1 19 44\r",
+ "1 19 45\r",
+ "1 19 46\r",
+ "1 19 47\r",
+ "1 19 48\r",
+ "1 19 49\r",
+ "1 19 50\r",
+ "1 19 51\r",
+ "1 19 52\r",
+ "1 19 53\r",
+ "1 19 54\r",
+ "1 19 55\r",
+ "1 19 56\r",
+ "1 19 57\r",
+ "1 19 58\r",
+ "1 20 1\r",
+ "1 20 2\r",
+ "1 20 3\r",
+ "1 20 4\r",
+ "1 20 5\r",
+ "1 20 6\r",
+ "1 20 7\r",
+ "1 20 8\r",
+ "1 20 9\r",
+ "1 20 10\r",
+ "1 20 11\r",
+ "1 20 12\r",
+ "1 20 13\r",
+ "1 20 14\r",
+ "1 20 15\r",
+ "1 20 16\r",
+ "1 20 17\r",
+ "1 20 18\r",
+ "1 20 19\r",
+ "1 20 20\r",
+ "1 20 21\r",
+ "1 20 22\r",
+ "1 20 23\r",
+ "1 20 24\r",
+ "1 20 25\r",
+ "1 20 26\r",
+ "1 20 27\r",
+ "1 20 28\r",
+ "1 20 29\r",
+ "1 20 30\r",
+ "1 20 31\r",
+ "1 20 32\r",
+ "1 20 33\r",
+ "1 20 34\r",
+ "1 20 35\r",
+ "1 20 36\r",
+ "1 20 37\r",
+ "1 20 38\r",
+ "1 20 39\r",
+ "1 20 40\r",
+ "1 20 41\r",
+ "1 20 42\r",
+ "1 20 43\r",
+ "1 20 44\r",
+ "1 20 45\r",
+ "1 20 46\r",
+ "1 20 47\r",
+ "1 20 48\r",
+ "1 20 49\r",
+ "1 20 50\r",
+ "1 20 51\r",
+ "1 20 52\r",
+ "1 20 53\r",
+ "1 20 54\r",
+ "1 20 55\r",
+ "1 20 56\r",
+ "1 20 57\r",
+ "1 20 58\r",
+ "1 21 1\r",
+ "1 21 2\r",
+ "1 21 3\r",
+ "1 21 4\r",
+ "1 21 5\r",
+ "1 21 6\r",
+ "1 21 7\r",
+ "1 21 8\r",
+ "1 21 9\r",
+ "1 21 10\r",
+ "1 21 11\r",
+ "1 21 12\r",
+ "1 21 13\r",
+ "1 21 14\r",
+ "1 21 15\r",
+ "1 21 16\r",
+ "1 21 17\r",
+ "1 21 18\r",
+ "1 21 19\r",
+ "1 21 20\r",
+ "1 21 21\r",
+ "1 21 22\r",
+ "1 21 23\r",
+ "1 21 24\r",
+ "1 21 25\r",
+ "1 21 26\r",
+ "1 21 27\r",
+ "1 21 28\r",
+ "1 21 29\r",
+ "1 21 30\r",
+ "1 21 31\r",
+ "1 21 32\r",
+ "1 21 33\r",
+ "1 21 34\r",
+ "1 21 35\r",
+ "1 21 36\r",
+ "1 21 37\r",
+ "1 21 38\r",
+ "1 21 39\r",
+ "1 21 40\r",
+ "1 21 41\r",
+ "1 21 42\r",
+ "1 21 43\r",
+ "1 21 44\r",
+ "1 21 45\r",
+ "1 21 46\r",
+ "1 21 47\r",
+ "1 21 48\r",
+ "1 21 49\r",
+ "1 21 50\r",
+ "1 21 51\r",
+ "1 21 52\r",
+ "1 21 53\r",
+ "1 21 54\r",
+ "1 21 55\r",
+ "1 21 56\r",
+ "1 21 57\r",
+ "1 21 58\r",
+ "1 22 1\r",
+ "1 22 2\r",
+ "1 22 3\r",
+ "1 22 4\r",
+ "1 22 5\r",
+ "1 22 6\r",
+ "1 22 7\r",
+ "1 22 8\r",
+ "1 22 9\r",
+ "1 22 10\r",
+ "1 22 11\r",
+ "1 22 12\r",
+ "1 22 13\r",
+ "1 22 14\r",
+ "1 22 15\r",
+ "1 22 16\r",
+ "1 22 17\r",
+ "1 22 18\r",
+ "1 22 19\r",
+ "1 22 20\r",
+ "1 22 21\r",
+ "1 22 22\r",
+ "1 22 23\r",
+ "1 22 24\r",
+ "1 22 25\r",
+ "1 22 26\r",
+ "1 22 27\r",
+ "1 22 28\r",
+ "1 22 29\r",
+ "1 22 30\r",
+ "1 22 31\r",
+ "1 22 32\r",
+ "1 22 33\r",
+ "1 22 34\r",
+ "1 22 35\r",
+ "1 22 36\r",
+ "1 22 37\r",
+ "1 22 38\r",
+ "1 22 39\r",
+ "1 22 40\r",
+ "1 22 41\r",
+ "1 22 42\r",
+ "1 22 43\r",
+ "1 22 44\r",
+ "1 22 45\r",
+ "1 22 46\r",
+ "1 22 47\r",
+ "1 22 48\r",
+ "1 22 49\r",
+ "1 22 50\r",
+ "1 22 51\r",
+ "1 22 52\r",
+ "1 22 53\r",
+ "1 22 54\r",
+ "1 22 55\r",
+ "1 22 56\r",
+ "1 22 57\r",
+ "1 22 58\r",
+ "1 23 1\r",
+ "1 23 2\r",
+ "1 23 3\r",
+ "1 23 4\r",
+ "1 23 5\r",
+ "1 23 6\r",
+ "1 23 7\r",
+ "1 23 8\r",
+ "1 23 9\r",
+ "1 23 10\r",
+ "1 23 11\r",
+ "1 23 12\r",
+ "1 23 13\r",
+ "1 23 14\r",
+ "1 23 15\r",
+ "1 23 16\r",
+ "1 23 17\r",
+ "1 23 18\r",
+ "1 23 19\r",
+ "1 23 20\r",
+ "1 23 21\r",
+ "1 23 22\r",
+ "1 23 23\r",
+ "1 23 24\r",
+ "1 23 25\r",
+ "1 23 26\r",
+ "1 23 27\r",
+ "1 23 28\r",
+ "1 23 29\r",
+ "1 23 30\r",
+ "1 23 31\r",
+ "1 23 32\r",
+ "1 23 33\r",
+ "1 23 34\r",
+ "1 23 35\r",
+ "1 23 36\r",
+ "1 23 37\r",
+ "1 23 38\r",
+ "1 23 39\r",
+ "1 23 40\r",
+ "1 23 41\r",
+ "1 23 42\r",
+ "1 23 43\r",
+ "1 23 44\r",
+ "1 23 45\r",
+ "1 23 46\r",
+ "1 23 47\r",
+ "1 23 48\r",
+ "1 23 49\r",
+ "1 23 50\r",
+ "1 23 51\r",
+ "1 23 52\r",
+ "1 23 53\r",
+ "1 23 54\r",
+ "1 23 55\r",
+ "1 23 56\r",
+ "1 23 57\r",
+ "1 23 58\r",
+ "1 24 1\r",
+ "1 24 2\r",
+ "1 24 3\r",
+ "1 24 4\r",
+ "1 24 5\r",
+ "1 24 6\r",
+ "1 24 7\r",
+ "1 24 8\r",
+ "1 24 9\r",
+ "1 24 10\r",
+ "1 24 11\r",
+ "1 24 12\r",
+ "1 24 13\r",
+ "1 24 14\r",
+ "1 24 15\r",
+ "1 24 16\r",
+ "1 24 17\r",
+ "1 24 18\r",
+ "1 24 19\r",
+ "1 24 20\r",
+ "1 24 21\r",
+ "1 24 22\r",
+ "1 24 23\r",
+ "1 24 24\r",
+ "1 24 25\r",
+ "1 24 26\r",
+ "1 24 27\r",
+ "1 24 28\r",
+ "1 24 29\r",
+ "1 24 30\r",
+ "1 24 31\r",
+ "1 24 32\r",
+ "1 24 33\r",
+ "1 24 34\r",
+ "1 24 35\r",
+ "1 24 36\r",
+ "1 24 37\r",
+ "1 24 38\r",
+ "1 24 39\r",
+ "1 24 40\r",
+ "1 24 41\r",
+ "1 24 42\r",
+ "1 24 43\r",
+ "1 24 44\r",
+ "1 24 45\r",
+ "1 24 46\r",
+ "1 24 47\r",
+ "1 24 48\r",
+ "1 24 49\r",
+ "1 24 50\r",
+ "1 24 51\r",
+ "1 24 52\r",
+ "1 24 53\r",
+ "1 24 54\r",
+ "1 24 55\r",
+ "1 24 56\r",
+ "1 24 57\r",
+ "1 24 58\r",
+ "1 25 1\r",
+ "1 25 2\r",
+ "1 25 3\r",
+ "1 25 4\r",
+ "1 25 5\r",
+ "1 25 6\r",
+ "1 25 7\r",
+ "1 25 8\r",
+ "1 25 9\r",
+ "1 25 10\r",
+ "1 25 11\r",
+ "1 25 12\r",
+ "1 25 13\r",
+ "1 25 14\r",
+ "1 25 15\r",
+ "1 25 16\r",
+ "1 25 17\r",
+ "1 25 18\r",
+ "1 25 19\r",
+ "1 25 20\r",
+ "1 25 21\r",
+ "1 25 22\r",
+ "1 25 23\r",
+ "1 25 24\r",
+ "1 25 25\r",
+ "1 25 26\r",
+ "1 25 27\r",
+ "1 25 28\r",
+ "1 25 29\r",
+ "1 25 30\r",
+ "1 25 31\r",
+ "1 25 32\r",
+ "1 25 33\r",
+ "1 25 34\r",
+ "1 25 35\r",
+ "1 25 36\r",
+ "1 25 37\r",
+ "1 25 38\r",
+ "1 25 39\r",
+ "1 25 40\r",
+ "1 25 41\r",
+ "1 25 42\r",
+ "1 25 43\r",
+ "1 25 44\r",
+ "1 25 45\r",
+ "1 25 46\r",
+ "1 25 47\r",
+ "1 25 48\r",
+ "1 25 49\r",
+ "1 25 50\r",
+ "1 25 51\r",
+ "1 25 52\r",
+ "1 25 53\r",
+ "1 25 54\r",
+ "1 25 55\r",
+ "1 25 56\r",
+ "1 25 57\r",
+ "1 25 58\r",
+ "1 26 1\r",
+ "1 26 2\r",
+ "1 26 3\r",
+ "1 26 4\r",
+ "1 26 5\r",
+ "1 26 6\r",
+ "1 26 7\r",
+ "1 26 8\r",
+ "1 26 9\r",
+ "1 26 10\r",
+ "1 26 11\r",
+ "1 26 12\r",
+ "1 26 13\r",
+ "1 26 14\r",
+ "1 26 15\r",
+ "1 26 16\r",
+ "1 26 17\r",
+ "1 26 18\r",
+ "1 26 19\r",
+ "1 26 20\r",
+ "1 26 21\r",
+ "1 26 22\r",
+ "1 26 23\r",
+ "1 26 24\r",
+ "1 26 25\r",
+ "1 26 26\r",
+ "1 26 27\r",
+ "1 26 28\r",
+ "1 26 29\r",
+ "1 26 30\r",
+ "1 26 31\r",
+ "1 26 32\r",
+ "1 26 33\r",
+ "1 26 34\r",
+ "1 26 35\r",
+ "1 26 36\r",
+ "1 26 37\r",
+ "1 26 38\r",
+ "1 26 39\r",
+ "1 26 40\r",
+ "1 26 41\r",
+ "1 26 42\r",
+ "1 26 43\r",
+ "1 26 44\r",
+ "1 26 45\r",
+ "1 26 46\r",
+ "1 26 47\r",
+ "1 26 48\r",
+ "1 26 49\r",
+ "1 26 50\r",
+ "1 26 51\r",
+ "1 26 52\r",
+ "1 26 53\r",
+ "1 26 54\r",
+ "1 26 55\r",
+ "1 26 56\r",
+ "1 26 57\r",
+ "1 26 58\r",
+ "1 27 1\r",
+ "1 27 2\r",
+ "1 27 3\r",
+ "1 27 4\r",
+ "1 27 5\r",
+ "1 27 6\r",
+ "1 27 7\r",
+ "1 27 8\r",
+ "1 27 9\r",
+ "1 27 10\r",
+ "1 27 11\r",
+ "1 27 12\r",
+ "1 27 13\r",
+ "1 27 14\r",
+ "1 27 15\r",
+ "1 27 16\r",
+ "1 27 17\r",
+ "1 27 18\r",
+ "1 27 19\r",
+ "1 27 20\r",
+ "1 27 21\r",
+ "1 27 22\r",
+ "1 27 23\r",
+ "1 27 24\r",
+ "1 27 25\r",
+ "1 27 26\r",
+ "1 27 27\r",
+ "1 27 28\r",
+ "1 27 29\r",
+ "1 27 30\r",
+ "1 27 31\r",
+ "1 27 32\r",
+ "1 27 33\r",
+ "1 27 34\r",
+ "1 27 35\r",
+ "1 27 36\r",
+ "1 27 37\r",
+ "1 27 38\r",
+ "1 27 39\r",
+ "1 27 40\r",
+ "1 27 41\r",
+ "1 27 42\r",
+ "1 27 43\r",
+ "1 27 44\r",
+ "1 27 45\r",
+ "1 27 46\r",
+ "1 27 47\r",
+ "1 27 48\r",
+ "1 27 49\r",
+ "1 27 50\r",
+ "1 27 51\r",
+ "1 27 52\r",
+ "1 27 53\r",
+ "1 27 54\r",
+ "1 27 55\r",
+ "1 27 56\r",
+ "1 27 57\r",
+ "1 27 58\r",
+ "1 28 1\r",
+ "1 28 2\r",
+ "1 28 3\r",
+ "1 28 4\r",
+ "1 28 5\r",
+ "1 28 6\r",
+ "1 28 7\r",
+ "1 28 8\r",
+ "1 28 9\r",
+ "1 28 10\r",
+ "1 28 11\r",
+ "1 28 12\r",
+ "1 28 13\r",
+ "1 28 14\r",
+ "1 28 15\r",
+ "1 28 16\r",
+ "1 28 17\r",
+ "1 28 18\r",
+ "1 28 19\r",
+ "1 28 20\r",
+ "1 28 21\r",
+ "1 28 22\r",
+ "1 28 23\r",
+ "1 28 24\r",
+ "1 28 25\r",
+ "1 28 26\r",
+ "1 28 27\r",
+ "1 28 28\r",
+ "1 28 29\r",
+ "1 28 30\r",
+ "1 28 31\r",
+ "1 28 32\r",
+ "1 28 33\r",
+ "1 28 34\r",
+ "1 28 35\r",
+ "1 28 36\r",
+ "1 28 37\r",
+ "1 28 38\r",
+ "1 28 39\r",
+ "1 28 40\r",
+ "1 28 41\r",
+ "1 28 42\r",
+ "1 28 43\r",
+ "1 28 44\r",
+ "1 28 45\r",
+ "1 28 46\r",
+ "1 28 47\r",
+ "1 28 48\r",
+ "1 28 49\r",
+ "1 28 50\r",
+ "1 28 51\r",
+ "1 28 52\r",
+ "1 28 53\r",
+ "1 28 54\r",
+ "1 28 55\r",
+ "1 28 56\r",
+ "1 28 57\r",
+ "1 28 58\r",
+ "1 29 1\r",
+ "1 29 2\r",
+ "1 29 3\r",
+ "1 29 4\r",
+ "1 29 5\r",
+ "1 29 6\r",
+ "1 29 7\r",
+ "1 29 8\r",
+ "1 29 9\r",
+ "1 29 10\r",
+ "1 29 11\r",
+ "1 29 12\r",
+ "1 29 13\r",
+ "1 29 14\r",
+ "1 29 15\r",
+ "1 29 16\r",
+ "1 29 17\r",
+ "1 29 18\r",
+ "1 29 19\r",
+ "1 29 20\r",
+ "1 29 21\r",
+ "1 29 22\r",
+ "1 29 23\r",
+ "1 29 24\r",
+ "1 29 25\r",
+ "1 29 26\r",
+ "1 29 27\r",
+ "1 29 28\r",
+ "1 29 29\r",
+ "1 29 30\r",
+ "1 29 31\r",
+ "1 29 32\r",
+ "1 29 33\r",
+ "1 29 34\r",
+ "1 29 35\r",
+ "1 29 36\r",
+ "1 29 37\r",
+ "1 29 38\r",
+ "1 29 39\r",
+ "1 29 40\r",
+ "1 29 41\r",
+ "1 29 42\r",
+ "1 29 43\r",
+ "1 29 44\r",
+ "1 29 45\r",
+ "1 29 46\r",
+ "1 29 47\r",
+ "1 29 48\r",
+ "1 29 49\r",
+ "1 29 50\r",
+ "1 29 51\r",
+ "1 29 52\r",
+ "1 29 53\r",
+ "1 29 54\r",
+ "1 29 55\r",
+ "1 29 56\r",
+ "1 29 57\r",
+ "1 29 58\r",
+ "1 30 1\r",
+ "1 30 2\r",
+ "1 30 3\r",
+ "1 30 4\r",
+ "1 30 5\r",
+ "1 30 6\r",
+ "1 30 7\r",
+ "1 30 8\r",
+ "1 30 9\r",
+ "1 30 10\r",
+ "1 30 11\r",
+ "1 30 12\r",
+ "1 30 13\r",
+ "1 30 14\r",
+ "1 30 15\r",
+ "1 30 16\r",
+ "1 30 17\r",
+ "1 30 18\r",
+ "1 30 19\r",
+ "1 30 20\r",
+ "1 30 21\r",
+ "1 30 22\r",
+ "1 30 23\r",
+ "1 30 24\r",
+ "1 30 25\r",
+ "1 30 26\r",
+ "1 30 27\r",
+ "1 30 28\r",
+ "1 30 29\r",
+ "1 30 30\r",
+ "1 30 31\r",
+ "1 30 32\r",
+ "1 30 33\r",
+ "1 30 34\r",
+ "1 30 35\r",
+ "1 30 36\r",
+ "1 30 37\r",
+ "1 30 38\r",
+ "1 30 39\r",
+ "1 30 40\r",
+ "1 30 41\r",
+ "1 30 42\r",
+ "1 30 43\r",
+ "1 30 44\r",
+ "1 30 45\r",
+ "1 30 46\r",
+ "1 30 47\r",
+ "1 30 48\r",
+ "1 30 49\r",
+ "1 30 50\r",
+ "1 30 51\r",
+ "1 30 52\r",
+ "1 30 53\r",
+ "1 30 54\r",
+ "1 30 55\r",
+ "1 30 56\r",
+ "1 30 57\r",
+ "1 30 58\r",
+ "1 31 1\r",
+ "1 31 2\r",
+ "1 31 3\r",
+ "1 31 4\r",
+ "1 31 5\r",
+ "1 31 6\r",
+ "1 31 7\r",
+ "1 31 8\r",
+ "1 31 9\r",
+ "1 31 10\r",
+ "1 31 11\r",
+ "1 31 12\r",
+ "1 31 13\r",
+ "1 31 14\r",
+ "1 31 15\r",
+ "1 31 16\r",
+ "1 31 17\r",
+ "1 31 18\r",
+ "1 31 19\r",
+ "1 31 20\r",
+ "1 31 21\r",
+ "1 31 22\r",
+ "1 31 23\r",
+ "1 31 24\r",
+ "1 31 25\r",
+ "1 31 26\r",
+ "1 31 27\r",
+ "1 31 28\r",
+ "1 31 29\r",
+ "1 31 30\r",
+ "1 31 31\r",
+ "1 31 32\r",
+ "1 31 33\r",
+ "1 31 34\r",
+ "1 31 35\r",
+ "1 31 36\r",
+ "1 31 37\r",
+ "1 31 38\r",
+ "1 31 39\r",
+ "1 31 40\r",
+ "1 31 41\r",
+ "1 31 42\r",
+ "1 31 43\r",
+ "1 31 44\r",
+ "1 31 45\r",
+ "1 31 46\r",
+ "1 31 47\r",
+ "1 31 48\r",
+ "1 31 49\r",
+ "1 31 50\r",
+ "1 31 51\r",
+ "1 31 52\r",
+ "1 31 53\r",
+ "1 31 54\r",
+ "1 31 55\r",
+ "1 31 56\r",
+ "1 31 57\r",
+ "1 31 58\r",
+ "1 32 1\r",
+ "1 32 2\r",
+ "1 32 3\r",
+ "1 32 4\r",
+ "1 32 5\r",
+ "1 32 6\r",
+ "1 32 7\r",
+ "1 32 8\r",
+ "1 32 9\r",
+ "1 32 10\r",
+ "1 32 11\r",
+ "1 32 12\r",
+ "1 32 13\r",
+ "1 32 14\r",
+ "1 32 15\r",
+ "1 32 16\r",
+ "1 32 17\r",
+ "1 32 18\r",
+ "1 32 19\r",
+ "1 32 20\r",
+ "1 32 21\r",
+ "1 32 22\r",
+ "1 32 23\r",
+ "1 32 24\r",
+ "1 32 25\r",
+ "1 32 26\r",
+ "1 32 27\r",
+ "1 32 28\r",
+ "1 32 29\r",
+ "1 32 30\r",
+ "1 32 31\r",
+ "1 32 32\r",
+ "1 32 33\r",
+ "1 32 34\r",
+ "1 32 35\r",
+ "1 32 36\r",
+ "1 32 37\r",
+ "1 32 38\r",
+ "1 32 39\r",
+ "1 32 40\r",
+ "1 32 41\r",
+ "1 32 42\r",
+ "1 32 43\r",
+ "1 32 44\r",
+ "1 32 45\r",
+ "1 32 46\r",
+ "1 32 47\r",
+ "1 32 48\r",
+ "1 32 49\r",
+ "1 32 50\r",
+ "1 32 51\r",
+ "1 32 52\r",
+ "1 32 53\r",
+ "1 32 54\r",
+ "1 32 55\r",
+ "1 32 56\r",
+ "1 32 57\r",
+ "1 32 58\r",
+ "1 33 1\r",
+ "1 33 2\r",
+ "1 33 3\r",
+ "1 33 4\r",
+ "1 33 5\r",
+ "1 33 6\r",
+ "1 33 7\r",
+ "1 33 8\r",
+ "1 33 9\r",
+ "1 33 10\r",
+ "1 33 11\r",
+ "1 33 12\r",
+ "1 33 13\r",
+ "1 33 14\r",
+ "1 33 15\r",
+ "1 33 16\r",
+ "1 33 17\r",
+ "1 33 18\r",
+ "1 33 19\r",
+ "1 33 20\r",
+ "1 33 21\r",
+ "1 33 22\r",
+ "1 33 23\r",
+ "1 33 24\r",
+ "1 33 25\r",
+ "1 33 26\r",
+ "1 33 27\r",
+ "1 33 28\r",
+ "1 33 29\r",
+ "1 33 30\r",
+ "1 33 31\r",
+ "1 33 32\r",
+ "1 33 33\r",
+ "1 33 34\r",
+ "1 33 35\r",
+ "1 33 36\r",
+ "1 33 37\r",
+ "1 33 38\r",
+ "1 33 39\r",
+ "1 33 40\r",
+ "1 33 41\r",
+ "1 33 42\r",
+ "1 33 43\r",
+ "1 33 44\r",
+ "1 33 45\r",
+ "1 33 46\r",
+ "1 33 47\r",
+ "1 33 48\r",
+ "1 33 49\r",
+ "1 33 50\r",
+ "1 33 51\r",
+ "1 33 52\r",
+ "1 33 53\r",
+ "1 33 54\r",
+ "1 33 55\r",
+ "1 33 56\r",
+ "1 33 57\r",
+ "1 33 58\r",
+ "1 34 1\r",
+ "1 34 2\r",
+ "1 34 3\r",
+ "1 34 4\r",
+ "1 34 5\r",
+ "1 34 6\r",
+ "1 34 7\r",
+ "1 34 8\r",
+ "1 34 9\r",
+ "1 34 10\r",
+ "1 34 11\r",
+ "1 34 12\r",
+ "1 34 13\r",
+ "1 34 14\r",
+ "1 34 15\r",
+ "1 34 16\r",
+ "1 34 17\r",
+ "1 34 18\r",
+ "1 34 19\r",
+ "1 34 20\r",
+ "1 34 21\r",
+ "1 34 22\r",
+ "1 34 23\r",
+ "1 34 24\r",
+ "1 34 25\r",
+ "1 34 26\r",
+ "1 34 27\r",
+ "1 34 28\r",
+ "1 34 29\r",
+ "1 34 30\r",
+ "1 34 31\r",
+ "1 34 32\r",
+ "1 34 33\r",
+ "1 34 34\r",
+ "1 34 35\r",
+ "1 34 36\r",
+ "1 34 37\r",
+ "1 34 38\r",
+ "1 34 39\r",
+ "1 34 40\r",
+ "1 34 41\r",
+ "1 34 42\r",
+ "1 34 43\r",
+ "1 34 44\r",
+ "1 34 45\r",
+ "1 34 46\r",
+ "1 34 47\r",
+ "1 34 48\r",
+ "1 34 49\r",
+ "1 34 50\r",
+ "1 34 51\r",
+ "1 34 52\r",
+ "1 34 53\r",
+ "1 34 54\r",
+ "1 34 55\r",
+ "1 34 56\r",
+ "1 34 57\r",
+ "1 34 58\r",
+ "1 35 1\r",
+ "1 35 2\r",
+ "1 35 3\r",
+ "1 35 4\r",
+ "1 35 5\r",
+ "1 35 6\r",
+ "1 35 7\r",
+ "1 35 8\r",
+ "1 35 9\r",
+ "1 35 10\r",
+ "1 35 11\r",
+ "1 35 12\r",
+ "1 35 13\r",
+ "1 35 14\r",
+ "1 35 15\r",
+ "1 35 16\r",
+ "1 35 17\r",
+ "1 35 18\r",
+ "1 35 19\r",
+ "1 35 20\r",
+ "1 35 21\r",
+ "1 35 22\r",
+ "1 35 23\r",
+ "1 35 24\r",
+ "1 35 25\r",
+ "1 35 26\r",
+ "1 35 27\r",
+ "1 35 28\r",
+ "1 35 29\r",
+ "1 35 30\r",
+ "1 35 31\r",
+ "1 35 32\r",
+ "1 35 33\r",
+ "1 35 34\r",
+ "1 35 35\r",
+ "1 35 36\r",
+ "1 35 37\r",
+ "1 35 38\r",
+ "1 35 39\r",
+ "1 35 40\r",
+ "1 35 41\r",
+ "1 35 42\r",
+ "1 35 43\r",
+ "1 35 44\r",
+ "1 35 45\r",
+ "1 35 46\r",
+ "1 35 47\r",
+ "1 35 48\r",
+ "1 35 49\r",
+ "1 35 50\r",
+ "1 35 51\r",
+ "1 35 52\r",
+ "1 35 53\r",
+ "1 35 54\r",
+ "1 35 55\r",
+ "1 35 56\r",
+ "1 35 57\r",
+ "1 35 58\r",
+ "1 36 1\r",
+ "1 36 2\r",
+ "1 36 3\r",
+ "1 36 4\r",
+ "1 36 5\r",
+ "1 36 6\r",
+ "1 36 7\r",
+ "1 36 8\r",
+ "1 36 9\r",
+ "1 36 10\r",
+ "1 36 11\r",
+ "1 36 12\r",
+ "1 36 13\r",
+ "1 36 14\r",
+ "1 36 15\r",
+ "1 36 16\r",
+ "1 36 17\r",
+ "1 36 18\r",
+ "1 36 19\r",
+ "1 36 20\r",
+ "1 36 21\r",
+ "1 36 22\r",
+ "1 36 23\r",
+ "1 36 24\r",
+ "1 36 25\r",
+ "1 36 26\r",
+ "1 36 27\r",
+ "1 36 28\r",
+ "1 36 29\r",
+ "1 36 30\r",
+ "1 36 31\r",
+ "1 36 32\r",
+ "1 36 33\r",
+ "1 36 34\r",
+ "1 36 35\r",
+ "1 36 36\r",
+ "1 36 37\r",
+ "1 36 38\r",
+ "1 36 39\r",
+ "1 36 40\r",
+ "1 36 41\r",
+ "1 36 42\r",
+ "1 36 43\r",
+ "1 36 44\r",
+ "1 36 45\r",
+ "1 36 46\r",
+ "1 36 47\r",
+ "1 36 48\r",
+ "1 36 49\r",
+ "1 36 50\r",
+ "1 36 51\r",
+ "1 36 52\r",
+ "1 36 53\r",
+ "1 36 54\r",
+ "1 36 55\r",
+ "1 36 56\r",
+ "1 36 57\r",
+ "1 36 58\r",
+ "1 37 1\r",
+ "1 37 2\r",
+ "1 37 3\r",
+ "1 37 4\r",
+ "1 37 5\r",
+ "1 37 6\r",
+ "1 37 7\r",
+ "1 37 8\r",
+ "1 37 9\r",
+ "1 37 10\r",
+ "1 37 11\r",
+ "1 37 12\r",
+ "1 37 13\r",
+ "1 37 14\r",
+ "1 37 15\r",
+ "1 37 16\r",
+ "1 37 17\r",
+ "1 37 18\r",
+ "1 37 19\r",
+ "1 37 20\r",
+ "1 37 21\r",
+ "1 37 22\r",
+ "1 37 23\r",
+ "1 37 24\r",
+ "1 37 25\r",
+ "1 37 26\r",
+ "1 37 27\r",
+ "1 37 28\r",
+ "1 37 29\r",
+ "1 37 30\r",
+ "1 37 31\r",
+ "1 37 32\r",
+ "1 37 33\r",
+ "1 37 34\r",
+ "1 37 35\r",
+ "1 37 36\r",
+ "1 37 37\r",
+ "1 37 38\r",
+ "1 37 39\r",
+ "1 37 40\r",
+ "1 37 41\r",
+ "1 37 42\r",
+ "1 37 43\r",
+ "1 37 44\r",
+ "1 37 45\r",
+ "1 37 46\r",
+ "1 37 47\r",
+ "1 37 48\r",
+ "1 37 49\r",
+ "1 37 50\r",
+ "1 37 51\r",
+ "1 37 52\r",
+ "1 37 53\r",
+ "1 37 54\r",
+ "1 37 55\r",
+ "1 37 56\r",
+ "1 37 57\r",
+ "1 37 58\r",
+ "1 38 1\r",
+ "1 38 2\r",
+ "1 38 3\r",
+ "1 38 4\r",
+ "1 38 5\r",
+ "1 38 6\r",
+ "1 38 7\r",
+ "1 38 8\r",
+ "1 38 9\r",
+ "1 38 10\r",
+ "1 38 11\r",
+ "1 38 12\r",
+ "1 38 13\r",
+ "1 38 14\r",
+ "1 38 15\r",
+ "1 38 16\r",
+ "1 38 17\r",
+ "1 38 18\r",
+ "1 38 19\r",
+ "1 38 20\r",
+ "1 38 21\r",
+ "1 38 22\r",
+ "1 38 23\r",
+ "1 38 24\r",
+ "1 38 25\r",
+ "1 38 26\r",
+ "1 38 27\r",
+ "1 38 28\r",
+ "1 38 29\r",
+ "1 38 30\r",
+ "1 38 31\r",
+ "1 38 32\r",
+ "1 38 33\r",
+ "1 38 34\r",
+ "1 38 35\r",
+ "1 38 36\r",
+ "1 38 37\r",
+ "1 38 38\r",
+ "1 38 39\r",
+ "1 38 40\r",
+ "1 38 41\r",
+ "1 38 42\r",
+ "1 38 43\r",
+ "1 38 44\r",
+ "1 38 45\r",
+ "1 38 46\r",
+ "1 38 47\r",
+ "1 38 48\r",
+ "1 38 49\r",
+ "1 38 50\r",
+ "1 38 51\r",
+ "1 38 52\r",
+ "1 38 53\r",
+ "1 38 54\r",
+ "1 38 55\r",
+ "1 38 56\r",
+ "1 38 57\r",
+ "1 38 58\r",
+ "1 39 1\r",
+ "1 39 2\r",
+ "1 39 3\r",
+ "1 39 4\r",
+ "1 39 5\r",
+ "1 39 6\r",
+ "1 39 7\r",
+ "1 39 8\r",
+ "1 39 9\r",
+ "1 39 10\r",
+ "1 39 11\r",
+ "1 39 12\r",
+ "1 39 13\r",
+ "1 39 14\r",
+ "1 39 15\r",
+ "1 39 16\r",
+ "1 39 17\r",
+ "1 39 18\r",
+ "1 39 19\r",
+ "1 39 20\r",
+ "1 39 21\r",
+ "1 39 22\r",
+ "1 39 23\r",
+ "1 39 24\r",
+ "1 39 25\r",
+ "1 39 26\r",
+ "1 39 27\r",
+ "1 39 28\r",
+ "1 39 29\r",
+ "1 39 30\r",
+ "1 39 31\r",
+ "1 39 32\r",
+ "1 39 33\r",
+ "1 39 34\r",
+ "1 39 35\r",
+ "1 39 36\r",
+ "1 39 37\r",
+ "1 39 38\r",
+ "1 39 39\r",
+ "1 39 40\r",
+ "1 39 41\r",
+ "1 39 42\r",
+ "1 39 43\r",
+ "1 39 44\r",
+ "1 39 45\r",
+ "1 39 46\r",
+ "1 39 47\r",
+ "1 39 48\r",
+ "1 39 49\r",
+ "1 39 50\r",
+ "1 39 51\r",
+ "1 39 52\r",
+ "1 39 53\r",
+ "1 39 54\r",
+ "1 39 55\r",
+ "1 39 56\r",
+ "1 39 57\r",
+ "1 39 58\r",
+ "1 40 1\r",
+ "1 40 2\r",
+ "1 40 3\r",
+ "1 40 4\r",
+ "1 40 5\r",
+ "1 40 6\r",
+ "1 40 7\r",
+ "1 40 8\r",
+ "1 40 9\r",
+ "1 40 10\r",
+ "1 40 11\r",
+ "1 40 12\r",
+ "1 40 13\r",
+ "1 40 14\r",
+ "1 40 15\r",
+ "1 40 16\r",
+ "1 40 17\r",
+ "1 40 18\r",
+ "1 40 19\r",
+ "1 40 20\r",
+ "1 40 21\r",
+ "1 40 22\r",
+ "1 40 23\r",
+ "1 40 24\r",
+ "1 40 25\r",
+ "1 40 26\r",
+ "1 40 27\r",
+ "1 40 28\r",
+ "1 40 29\r",
+ "1 40 30\r",
+ "1 40 31\r",
+ "1 40 32\r",
+ "1 40 33\r",
+ "1 40 34\r",
+ "1 40 35\r",
+ "1 40 36\r",
+ "1 40 37\r",
+ "1 40 38\r",
+ "1 40 39\r",
+ "1 40 40\r",
+ "1 40 41\r",
+ "1 40 42\r",
+ "1 40 43\r",
+ "1 40 44\r",
+ "1 40 45\r",
+ "1 40 46\r",
+ "1 40 47\r",
+ "1 40 48\r",
+ "1 40 49\r",
+ "1 40 50\r",
+ "1 40 51\r",
+ "1 40 52\r",
+ "1 40 53\r",
+ "1 40 54\r",
+ "1 40 55\r",
+ "1 40 56\r",
+ "1 40 57\r",
+ "1 40 58\r",
+ "1 41 1\r",
+ "1 41 2\r",
+ "1 41 3\r",
+ "1 41 4\r",
+ "1 41 5\r",
+ "1 41 6\r",
+ "1 41 7\r",
+ "1 41 8\r",
+ "1 41 9\r",
+ "1 41 10\r",
+ "1 41 11\r",
+ "1 41 12\r",
+ "1 41 13\r",
+ "1 41 14\r",
+ "1 41 15\r",
+ "1 41 16\r",
+ "1 41 17\r",
+ "1 41 18\r",
+ "1 41 19\r",
+ "1 41 20\r",
+ "1 41 21\r",
+ "1 41 22\r",
+ "1 41 23\r",
+ "1 41 24\r",
+ "1 41 25\r",
+ "1 41 26\r",
+ "1 41 27\r",
+ "1 41 28\r",
+ "1 41 29\r",
+ "1 41 30\r",
+ "1 41 31\r",
+ "1 41 32\r",
+ "1 41 33\r",
+ "1 41 34\r",
+ "1 41 35\r",
+ "1 41 36\r",
+ "1 41 37\r",
+ "1 41 38\r",
+ "1 41 39\r",
+ "1 41 40\r",
+ "1 41 41\r",
+ "1 41 42\r",
+ "1 41 43\r",
+ "1 41 44\r",
+ "1 41 45\r",
+ "1 41 46\r",
+ "1 41 47\r",
+ "1 41 48\r",
+ "1 41 49\r",
+ "1 41 50\r",
+ "1 41 51\r",
+ "1 41 52\r",
+ "1 41 53\r",
+ "1 41 54\r",
+ "1 41 55\r",
+ "1 41 56\r",
+ "1 41 57\r",
+ "1 41 58\r",
+ "1 42 1\r",
+ "1 42 2\r",
+ "1 42 3\r",
+ "1 42 4\r",
+ "1 42 5\r",
+ "1 42 6\r",
+ "1 42 7\r",
+ "1 42 8\r",
+ "1 42 9\r",
+ "1 42 10\r",
+ "1 42 11\r",
+ "1 42 12\r",
+ "1 42 13\r",
+ "1 42 14\r",
+ "1 42 15\r",
+ "1 42 16\r",
+ "1 42 17\r",
+ "1 42 18\r",
+ "1 42 19\r",
+ "1 42 20\r",
+ "1 42 21\r",
+ "1 42 22\r",
+ "1 42 23\r",
+ "1 42 24\r",
+ "1 42 25\r",
+ "1 42 26\r",
+ "1 42 27\r",
+ "1 42 28\r",
+ "1 42 29\r",
+ "1 42 30\r",
+ "1 42 31\r",
+ "1 42 32\r",
+ "1 42 33\r",
+ "1 42 34\r",
+ "1 42 35\r",
+ "1 42 36\r",
+ "1 42 37\r",
+ "1 42 38\r",
+ "1 42 39\r",
+ "1 42 40\r",
+ "1 42 41\r",
+ "1 42 42\r",
+ "1 42 43\r",
+ "1 42 44\r",
+ "1 42 45\r",
+ "1 42 46\r",
+ "1 42 47\r",
+ "1 42 48\r",
+ "1 42 49\r",
+ "1 42 50\r",
+ "1 42 51\r",
+ "1 42 52\r",
+ "1 42 53\r",
+ "1 42 54\r",
+ "1 42 55\r",
+ "1 42 56\r",
+ "1 42 57\r",
+ "1 42 58\r",
+ "1 43 1\r",
+ "1 43 2\r",
+ "1 43 3\r",
+ "1 43 4\r",
+ "1 43 5\r",
+ "1 43 6\r",
+ "1 43 7\r",
+ "1 43 8\r",
+ "1 43 9\r",
+ "1 43 10\r",
+ "1 43 11\r",
+ "1 43 12\r",
+ "1 43 13\r",
+ "1 43 14\r",
+ "1 43 15\r",
+ "1 43 16\r",
+ "1 43 17\r",
+ "1 43 18\r",
+ "1 43 19\r",
+ "1 43 20\r",
+ "1 43 21\r",
+ "1 43 22\r",
+ "1 43 23\r",
+ "1 43 24\r",
+ "1 43 25\r",
+ "1 43 26\r",
+ "1 43 27\r",
+ "1 43 28\r",
+ "1 43 29\r",
+ "1 43 30\r",
+ "1 43 31\r",
+ "1 43 32\r",
+ "1 43 33\r",
+ "1 43 34\r",
+ "1 43 35\r",
+ "1 43 36\r",
+ "1 43 37\r",
+ "1 43 38\r",
+ "1 43 39\r",
+ "1 43 40\r",
+ "1 43 41\r",
+ "1 43 42\r",
+ "1 43 43\r",
+ "1 43 44\r",
+ "1 43 45\r",
+ "1 43 46\r",
+ "1 43 47\r",
+ "1 43 48\r",
+ "1 43 49\r",
+ "1 43 50\r",
+ "1 43 51\r",
+ "1 43 52\r",
+ "1 43 53\r",
+ "1 43 54\r",
+ "1 43 55\r",
+ "1 43 56\r",
+ "1 43 57\r",
+ "1 43 58\r",
+ "1 44 1\r",
+ "1 44 2\r",
+ "1 44 3\r",
+ "1 44 4\r",
+ "1 44 5\r",
+ "1 44 6\r",
+ "1 44 7\r",
+ "1 44 8\r",
+ "1 44 9\r",
+ "1 44 10\r",
+ "1 44 11\r",
+ "1 44 12\r",
+ "1 44 13\r",
+ "1 44 14\r",
+ "1 44 15\r",
+ "1 44 16\r",
+ "1 44 17\r",
+ "1 44 18\r",
+ "1 44 19\r",
+ "1 44 20\r",
+ "1 44 21\r",
+ "1 44 22\r",
+ "1 44 23\r",
+ "1 44 24\r",
+ "1 44 25\r",
+ "1 44 26\r",
+ "1 44 27\r",
+ "1 44 28\r",
+ "1 44 29\r",
+ "1 44 30\r",
+ "1 44 31\r",
+ "1 44 32\r",
+ "1 44 33\r",
+ "1 44 34\r",
+ "1 44 35\r",
+ "1 44 36\r",
+ "1 44 37\r",
+ "1 44 38\r",
+ "1 44 39\r",
+ "1 44 40\r",
+ "1 44 41\r",
+ "1 44 42\r",
+ "1 44 43\r",
+ "1 44 44\r",
+ "1 44 45\r",
+ "1 44 46\r",
+ "1 44 47\r",
+ "1 44 48\r",
+ "1 44 49\r",
+ "1 44 50\r",
+ "1 44 51\r",
+ "1 44 52\r",
+ "1 44 53\r",
+ "1 44 54\r",
+ "1 44 55\r",
+ "1 44 56\r",
+ "1 44 57\r",
+ "1 44 58\r",
+ "1 45 1\r",
+ "1 45 2\r",
+ "1 45 3\r",
+ "1 45 4\r",
+ "1 45 5\r",
+ "1 45 6\r",
+ "1 45 7\r",
+ "1 45 8\r",
+ "1 45 9\r",
+ "1 45 10\r",
+ "1 45 11\r",
+ "1 45 12\r",
+ "1 45 13\r",
+ "1 45 14\r",
+ "1 45 15\r",
+ "1 45 16\r",
+ "1 45 17\r",
+ "1 45 18\r",
+ "1 45 19\r",
+ "1 45 20\r",
+ "1 45 21\r",
+ "1 45 22\r",
+ "1 45 23\r",
+ "1 45 24\r",
+ "1 45 25\r",
+ "1 45 26\r",
+ "1 45 27\r",
+ "1 45 28\r",
+ "1 45 29\r",
+ "1 45 30\r",
+ "1 45 31\r",
+ "1 45 32\r",
+ "1 45 33\r",
+ "1 45 34\r",
+ "1 45 35\r",
+ "1 45 36\r",
+ "1 45 37\r",
+ "1 45 38\r",
+ "1 45 39\r",
+ "1 45 40\r",
+ "1 45 41\r",
+ "1 45 42\r",
+ "1 45 43\r",
+ "1 45 44\r",
+ "1 45 45\r",
+ "1 45 46\r",
+ "1 45 47\r",
+ "1 45 48\r",
+ "1 45 49\r",
+ "1 45 50\r",
+ "1 45 51\r",
+ "1 45 52\r",
+ "1 45 53\r",
+ "1 45 54\r",
+ "1 45 55\r",
+ "1 45 56\r",
+ "1 45 57\r",
+ "1 45 58\r",
+ "1 46 1\r",
+ "1 46 2\r",
+ "1 46 3\r",
+ "1 46 4\r",
+ "1 46 5\r",
+ "1 46 6\r",
+ "1 46 7\r",
+ "1 46 8\r",
+ "1 46 9\r",
+ "1 46 10\r",
+ "1 46 11\r",
+ "1 46 12\r",
+ "1 46 13\r",
+ "1 46 14\r",
+ "1 46 15\r",
+ "1 46 16\r",
+ "1 46 17\r",
+ "1 46 18\r",
+ "1 46 19\r",
+ "1 46 20\r",
+ "1 46 21\r",
+ "1 46 22\r",
+ "1 46 23\r",
+ "1 46 24\r",
+ "1 46 25\r",
+ "1 46 26\r",
+ "1 46 27\r",
+ "1 46 28\r",
+ "1 46 29\r",
+ "1 46 30\r",
+ "1 46 31\r",
+ "1 46 32\r",
+ "1 46 33\r",
+ "1 46 34\r",
+ "1 46 35\r",
+ "1 46 36\r",
+ "1 46 37\r",
+ "1 46 38\r",
+ "1 46 39\r",
+ "1 46 40\r",
+ "1 46 41\r",
+ "1 46 42\r",
+ "1 46 43\r",
+ "1 46 44\r",
+ "1 46 45\r",
+ "1 46 46\r",
+ "1 46 47\r",
+ "1 46 48\r",
+ "1 46 49\r",
+ "1 46 50\r",
+ "1 46 51\r",
+ "1 46 52\r",
+ "1 46 53\r",
+ "1 46 54\r",
+ "1 46 55\r",
+ "1 46 56\r",
+ "1 46 57\r",
+ "1 46 58\r",
+ "1 47 1\r",
+ "1 47 2\r",
+ "1 47 3\r",
+ "1 47 4\r",
+ "1 47 5\r",
+ "1 47 6\r",
+ "1 47 7\r",
+ "1 47 8\r",
+ "1 47 9\r",
+ "1 47 10\r",
+ "1 47 11\r",
+ "1 47 12\r",
+ "1 47 13\r",
+ "1 47 14\r",
+ "1 47 15\r",
+ "1 47 16\r",
+ "1 47 17\r",
+ "1 47 18\r",
+ "1 47 19\r",
+ "1 47 20\r",
+ "1 47 21\r",
+ "1 47 22\r",
+ "1 47 23\r",
+ "1 47 24\r",
+ "1 47 25\r",
+ "1 47 26\r",
+ "1 47 27\r",
+ "1 47 28\r",
+ "1 47 29\r",
+ "1 47 30\r",
+ "1 47 31\r",
+ "1 47 32\r",
+ "1 47 33\r",
+ "1 47 34\r",
+ "1 47 35\r",
+ "1 47 36\r",
+ "1 47 37\r",
+ "1 47 38\r",
+ "1 47 39\r",
+ "1 47 40\r",
+ "1 47 41\r",
+ "1 47 42\r",
+ "1 47 43\r",
+ "1 47 44\r",
+ "1 47 45\r",
+ "1 47 46\r",
+ "1 47 47\r",
+ "1 47 48\r",
+ "1 47 49\r",
+ "1 47 50\r",
+ "1 47 51\r",
+ "1 47 52\r",
+ "1 47 53\r",
+ "1 47 54\r",
+ "1 47 55\r",
+ "1 47 56\r",
+ "1 47 57\r",
+ "1 47 58\r",
+ "1 48 1\r",
+ "1 48 2"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "1 48 3\r",
+ "1 48 4\r",
+ "1 48 5\r",
+ "1 48 6\r",
+ "1 48 7\r",
+ "1 48 8\r",
+ "1 48 9\r",
+ "1 48 10\r",
+ "1 48 11\r",
+ "1 48 12\r",
+ "1 48 13\r",
+ "1 48 14\r",
+ "1 48 15\r",
+ "1 48 16\r",
+ "1 48 17\r",
+ "1 48 18\r",
+ "1 48 19\r",
+ "1 48 20\r",
+ "1 48 21\r",
+ "1 48 22\r",
+ "1 48 23\r",
+ "1 48 24\r",
+ "1 48 25\r",
+ "1 48 26\r",
+ "1 48 27\r",
+ "1 48 28\r",
+ "1 48 29\r",
+ "1 48 30\r",
+ "1 48 31\r",
+ "1 48 32\r",
+ "1 48 33\r",
+ "1 48 34\r",
+ "1 48 35\r",
+ "1 48 36\r",
+ "1 48 37\r",
+ "1 48 38\r",
+ "1 48 39\r",
+ "1 48 40\r",
+ "1 48 41\r",
+ "1 48 42\r",
+ "1 48 43\r",
+ "1 48 44\r",
+ "1 48 45\r",
+ "1 48 46\r",
+ "1 48 47\r",
+ "1 48 48\r",
+ "1 48 49\r",
+ "1 48 50\r",
+ "1 48 51\r",
+ "1 48 52\r",
+ "1 48 53\r",
+ "1 48 54\r",
+ "1 48 55\r",
+ "1 48 56\r",
+ "1 48 57\r",
+ "1 48 58\r",
+ "1 49 1\r",
+ "1 49 2\r",
+ "1 49 3\r",
+ "1 49 4\r",
+ "1 49 5\r",
+ "1 49 6\r",
+ "1 49 7\r",
+ "1 49 8\r",
+ "1 49 9\r",
+ "1 49 10\r",
+ "1 49 11\r",
+ "1 49 12\r",
+ "1 49 13\r",
+ "1 49 14\r",
+ "1 49 15\r",
+ "1 49 16\r",
+ "1 49 17\r",
+ "1 49 18\r",
+ "1 49 19\r",
+ "1 49 20\r",
+ "1 49 21\r",
+ "1 49 22\r",
+ "1 49 23\r",
+ "1 49 24\r",
+ "1 49 25\r",
+ "1 49 26\r",
+ "1 49 27\r",
+ "1 49 28\r",
+ "1 49 29\r",
+ "1 49 30\r",
+ "1 49 31\r",
+ "1 49 32\r",
+ "1 49 33\r",
+ "1 49 34\r",
+ "1 49 35\r",
+ "1 49 36\r",
+ "1 49 37\r",
+ "1 49 38\r",
+ "1 49 39\r",
+ "1 49 40\r",
+ "1 49 41\r",
+ "1 49 42\r",
+ "1 49 43\r",
+ "1 49 44\r",
+ "1 49 45\r",
+ "1 49 46\r",
+ "1 49 47\r",
+ "1 49 48\r",
+ "1 49 49\r",
+ "1 49 50\r",
+ "1 49 51\r",
+ "1 49 52\r",
+ "1 49 53\r",
+ "1 49 54\r",
+ "1 49 55\r",
+ "1 49 56\r",
+ "1 49 57\r",
+ "1 49 58\r",
+ "1 50 1\r",
+ "1 50 2\r",
+ "1 50 3\r",
+ "1 50 4\r",
+ "1 50 5\r",
+ "1 50 6\r",
+ "1 50 7\r",
+ "1 50 8\r",
+ "1 50 9\r",
+ "1 50 10\r",
+ "1 50 11\r",
+ "1 50 12\r",
+ "1 50 13\r",
+ "1 50 14\r",
+ "1 50 15\r",
+ "1 50 16\r",
+ "1 50 17\r",
+ "1 50 18\r",
+ "1 50 19\r",
+ "1 50 20\r",
+ "1 50 21\r",
+ "1 50 22\r",
+ "1 50 23\r",
+ "1 50 24\r",
+ "1 50 25\r",
+ "1 50 26\r",
+ "1 50 27\r",
+ "1 50 28\r",
+ "1 50 29\r",
+ "1 50 30\r",
+ "1 50 31\r",
+ "1 50 32\r",
+ "1 50 33\r",
+ "1 50 34\r",
+ "1 50 35\r",
+ "1 50 36\r",
+ "1 50 37\r",
+ "1 50 38\r",
+ "1 50 39\r",
+ "1 50 40\r",
+ "1 50 41\r",
+ "1 50 42\r",
+ "1 50 43\r",
+ "1 50 44\r",
+ "1 50 45\r",
+ "1 50 46\r",
+ "1 50 47\r",
+ "1 50 48\r",
+ "1 50 49\r",
+ "1 50 50\r",
+ "1 50 51\r",
+ "1 50 52\r",
+ "1 50 53\r",
+ "1 50 54\r",
+ "1 50 55\r",
+ "1 50 56\r",
+ "1 50 57\r",
+ "1 50 58\r",
+ "1 51 1\r",
+ "1 51 2\r",
+ "1 51 3\r",
+ "1 51 4\r",
+ "1 51 5\r",
+ "1 51 6\r",
+ "1 51 7\r",
+ "1 51 8\r",
+ "1 51 9\r",
+ "1 51 10\r",
+ "1 51 11\r",
+ "1 51 12\r",
+ "1 51 13\r",
+ "1 51 14\r",
+ "1 51 15\r",
+ "1 51 16\r",
+ "1 51 17\r",
+ "1 51 18\r",
+ "1 51 19\r",
+ "1 51 20\r",
+ "1 51 21\r",
+ "1 51 22\r",
+ "1 51 23\r",
+ "1 51 24\r",
+ "1 51 25\r",
+ "1 51 26\r",
+ "1 51 27\r",
+ "1 51 28\r",
+ "1 51 29\r",
+ "1 51 30\r",
+ "1 51 31\r",
+ "1 51 32\r",
+ "1 51 33\r",
+ "1 51 34\r",
+ "1 51 35\r",
+ "1 51 36\r",
+ "1 51 37\r",
+ "1 51 38\r",
+ "1 51 39\r",
+ "1 51 40\r",
+ "1 51 41\r",
+ "1 51 42\r",
+ "1 51 43\r",
+ "1 51 44\r",
+ "1 51 45\r",
+ "1 51 46\r",
+ "1 51 47\r",
+ "1 51 48\r",
+ "1 51 49\r",
+ "1 51 50\r",
+ "1 51 51\r",
+ "1 51 52\r",
+ "1 51 53\r",
+ "1 51 54\r",
+ "1 51 55\r",
+ "1 51 56\r",
+ "1 51 57\r",
+ "1 51 58\r",
+ "1 52 1\r",
+ "1 52 2\r",
+ "1 52 3\r",
+ "1 52 4\r",
+ "1 52 5\r",
+ "1 52 6\r",
+ "1 52 7\r",
+ "1 52 8\r",
+ "1 52 9\r",
+ "1 52 10\r",
+ "1 52 11\r",
+ "1 52 12\r",
+ "1 52 13\r",
+ "1 52 14\r",
+ "1 52 15\r",
+ "1 52 16\r",
+ "1 52 17\r",
+ "1 52 18\r",
+ "1 52 19\r",
+ "1 52 20\r",
+ "1 52 21\r",
+ "1 52 22\r",
+ "1 52 23\r",
+ "1 52 24\r",
+ "1 52 25\r",
+ "1 52 26\r",
+ "1 52 27\r",
+ "1 52 28\r",
+ "1 52 29\r",
+ "1 52 30\r",
+ "1 52 31\r",
+ "1 52 32\r",
+ "1 52 33\r",
+ "1 52 34\r",
+ "1 52 35\r",
+ "1 52 36\r",
+ "1 52 37\r",
+ "1 52 38\r",
+ "1 52 39\r",
+ "1 52 40\r",
+ "1 52 41\r",
+ "1 52 42\r",
+ "1 52 43\r",
+ "1 52 44\r",
+ "1 52 45\r",
+ "1 52 46\r",
+ "1 52 47\r",
+ "1 52 48\r",
+ "1 52 49\r",
+ "1 52 50\r",
+ "1 52 51\r",
+ "1 52 52\r",
+ "1 52 53\r",
+ "1 52 54\r",
+ "1 52 55\r",
+ "1 52 56\r",
+ "1 52 57\r",
+ "1 52 58\r",
+ "1 53 1\r",
+ "1 53 2\r",
+ "1 53 3\r",
+ "1 53 4\r",
+ "1 53 5\r",
+ "1 53 6\r",
+ "1 53 7\r",
+ "1 53 8\r",
+ "1 53 9\r",
+ "1 53 10\r",
+ "1 53 11\r",
+ "1 53 12\r",
+ "1 53 13\r",
+ "1 53 14\r",
+ "1 53 15\r",
+ "1 53 16\r",
+ "1 53 17\r",
+ "1 53 18\r",
+ "1 53 19\r",
+ "1 53 20\r",
+ "1 53 21\r",
+ "1 53 22\r",
+ "1 53 23\r",
+ "1 53 24\r",
+ "1 53 25\r",
+ "1 53 26\r",
+ "1 53 27\r",
+ "1 53 28\r",
+ "1 53 29\r",
+ "1 53 30\r",
+ "1 53 31\r",
+ "1 53 32\r",
+ "1 53 33\r",
+ "1 53 34\r",
+ "1 53 35\r",
+ "1 53 36\r",
+ "1 53 37\r",
+ "1 53 38\r",
+ "1 53 39\r",
+ "1 53 40\r",
+ "1 53 41\r",
+ "1 53 42\r",
+ "1 53 43\r",
+ "1 53 44\r",
+ "1 53 45\r",
+ "1 53 46\r",
+ "1 53 47\r",
+ "1 53 48\r",
+ "1 53 49\r",
+ "1 53 50\r",
+ "1 53 51\r",
+ "1 53 52\r",
+ "1 53 53\r",
+ "1 53 54\r",
+ "1 53 55\r",
+ "1 53 56\r",
+ "1 53 57\r",
+ "1 53 58\r",
+ "1 54 1\r",
+ "1 54 2\r",
+ "1 54 3\r",
+ "1 54 4\r",
+ "1 54 5\r",
+ "1 54 6\r",
+ "1 54 7\r",
+ "1 54 8\r",
+ "1 54 9\r",
+ "1 54 10\r",
+ "1 54 11\r",
+ "1 54 12\r",
+ "1 54 13\r",
+ "1 54 14\r",
+ "1 54 15\r",
+ "1 54 16\r",
+ "1 54 17\r",
+ "1 54 18\r",
+ "1 54 19\r",
+ "1 54 20\r",
+ "1 54 21\r",
+ "1 54 22\r",
+ "1 54 23\r",
+ "1 54 24\r",
+ "1 54 25\r",
+ "1 54 26\r",
+ "1 54 27\r",
+ "1 54 28\r",
+ "1 54 29\r",
+ "1 54 30\r",
+ "1 54 31\r",
+ "1 54 32\r",
+ "1 54 33\r",
+ "1 54 34\r",
+ "1 54 35\r",
+ "1 54 36\r",
+ "1 54 37\r",
+ "1 54 38\r",
+ "1 54 39\r",
+ "1 54 40\r",
+ "1 54 41\r",
+ "1 54 42\r",
+ "1 54 43\r",
+ "1 54 44\r",
+ "1 54 45\r",
+ "1 54 46\r",
+ "1 54 47\r",
+ "1 54 48\r",
+ "1 54 49\r",
+ "1 54 50\r",
+ "1 54 51\r",
+ "1 54 52\r",
+ "1 54 53\r",
+ "1 54 54\r",
+ "1 54 55\r",
+ "1 54 56\r",
+ "1 54 57\r",
+ "1 54 58\r",
+ "1 55 1\r",
+ "1 55 2\r",
+ "1 55 3\r",
+ "1 55 4\r",
+ "1 55 5\r",
+ "1 55 6\r",
+ "1 55 7\r",
+ "1 55 8\r",
+ "1 55 9\r",
+ "1 55 10\r",
+ "1 55 11\r",
+ "1 55 12\r",
+ "1 55 13\r",
+ "1 55 14\r",
+ "1 55 15\r",
+ "1 55 16\r",
+ "1 55 17\r",
+ "1 55 18\r",
+ "1 55 19\r",
+ "1 55 20\r",
+ "1 55 21\r",
+ "1 55 22\r",
+ "1 55 23\r",
+ "1 55 24\r",
+ "1 55 25\r",
+ "1 55 26\r",
+ "1 55 27\r",
+ "1 55 28\r",
+ "1 55 29\r",
+ "1 55 30\r",
+ "1 55 31\r",
+ "1 55 32\r",
+ "1 55 33\r",
+ "1 55 34\r",
+ "1 55 35\r",
+ "1 55 36\r",
+ "1 55 37\r",
+ "1 55 38\r",
+ "1 55 39\r",
+ "1 55 40\r",
+ "1 55 41\r",
+ "1 55 42\r",
+ "1 55 43\r",
+ "1 55 44\r",
+ "1 55 45\r",
+ "1 55 46\r",
+ "1 55 47\r",
+ "1 55 48\r",
+ "1 55 49\r",
+ "1 55 50\r",
+ "1 55 51\r",
+ "1 55 52\r",
+ "1 55 53\r",
+ "1 55 54\r",
+ "1 55 55\r",
+ "1 55 56\r",
+ "1 55 57\r",
+ "1 55 58\r",
+ "1 56 1\r",
+ "1 56 2\r",
+ "1 56 3\r",
+ "1 56 4\r",
+ "1 56 5\r",
+ "1 56 6\r",
+ "1 56 7\r",
+ "1 56 8\r",
+ "1 56 9\r",
+ "1 56 10\r",
+ "1 56 11\r",
+ "1 56 12\r",
+ "1 56 13\r",
+ "1 56 14\r",
+ "1 56 15\r",
+ "1 56 16\r",
+ "1 56 17\r",
+ "1 56 18\r",
+ "1 56 19\r",
+ "1 56 20\r",
+ "1 56 21\r",
+ "1 56 22\r",
+ "1 56 23\r",
+ "1 56 24\r",
+ "1 56 25\r",
+ "1 56 26\r",
+ "1 56 27\r",
+ "1 56 28\r",
+ "1 56 29\r",
+ "1 56 30\r",
+ "1 56 31\r",
+ "1 56 32\r",
+ "1 56 33\r",
+ "1 56 34\r",
+ "1 56 35\r",
+ "1 56 36\r",
+ "1 56 37\r",
+ "1 56 38\r",
+ "1 56 39\r",
+ "1 56 40\r",
+ "1 56 41\r",
+ "1 56 42\r",
+ "1 56 43\r",
+ "1 56 44\r",
+ "1 56 45\r",
+ "1 56 46\r",
+ "1 56 47\r",
+ "1 56 48\r",
+ "1 56 49\r",
+ "1 56 50\r",
+ "1 56 51\r",
+ "1 56 52\r",
+ "1 56 53\r",
+ "1 56 54\r",
+ "1 56 55\r",
+ "1 56 56\r",
+ "1 56 57\r",
+ "1 56 58\r",
+ "1 57 1\r",
+ "1 57 2\r",
+ "1 57 3\r",
+ "1 57 4\r",
+ "1 57 5\r",
+ "1 57 6\r",
+ "1 57 7\r",
+ "1 57 8\r",
+ "1 57 9\r",
+ "1 57 10\r",
+ "1 57 11\r",
+ "1 57 12\r",
+ "1 57 13\r",
+ "1 57 14\r",
+ "1 57 15\r",
+ "1 57 16\r",
+ "1 57 17\r",
+ "1 57 18\r",
+ "1 57 19\r",
+ "1 57 20\r",
+ "1 57 21\r",
+ "1 57 22\r",
+ "1 57 23\r",
+ "1 57 24\r",
+ "1 57 25\r",
+ "1 57 26\r",
+ "1 57 27\r",
+ "1 57 28\r",
+ "1 57 29\r",
+ "1 57 30\r",
+ "1 57 31\r",
+ "1 57 32\r",
+ "1 57 33\r",
+ "1 57 34\r",
+ "1 57 35\r",
+ "1 57 36\r",
+ "1 57 37\r",
+ "1 57 38\r",
+ "1 57 39\r",
+ "1 57 40\r",
+ "1 57 41\r",
+ "1 57 42\r",
+ "1 57 43\r",
+ "1 57 44\r",
+ "1 57 45\r",
+ "1 57 46\r",
+ "1 57 47\r",
+ "1 57 48\r",
+ "1 57 49\r",
+ "1 57 50\r",
+ "1 57 51\r",
+ "1 57 52\r",
+ "1 57 53\r",
+ "1 57 54\r",
+ "1 57 55\r",
+ "1 57 56\r",
+ "1 57 57\r",
+ "1 57 58\r",
+ "1 58 1\r",
+ "1 58 2\r",
+ "1 58 3\r",
+ "1 58 4\r",
+ "1 58 5\r",
+ "1 58 6\r",
+ "1 58 7\r",
+ "1 58 8\r",
+ "1 58 9\r",
+ "1 58 10\r",
+ "1 58 11\r",
+ "1 58 12\r",
+ "1 58 13\r",
+ "1 58 14\r",
+ "1 58 15\r",
+ "1 58 16\r",
+ "1 58 17\r",
+ "1 58 18\r",
+ "1 58 19\r",
+ "1 58 20\r",
+ "1 58 21\r",
+ "1 58 22\r",
+ "1 58 23\r",
+ "1 58 24\r",
+ "1 58 25\r",
+ "1 58 26\r",
+ "1 58 27\r",
+ "1 58 28\r",
+ "1 58 29\r",
+ "1 58 30\r",
+ "1 58 31\r",
+ "1 58 32\r",
+ "1 58 33\r",
+ "1 58 34\r",
+ "1 58 35\r",
+ "1 58 36\r",
+ "1 58 37\r",
+ "1 58 38\r",
+ "1 58 39\r",
+ "1 58 40\r",
+ "1 58 41\r",
+ "1 58 42\r",
+ "1 58 43\r",
+ "1 58 44\r",
+ "1 58 45\r",
+ "1 58 46\r",
+ "1 58 47\r",
+ "1 58 48\r",
+ "1 58 49\r",
+ "1 58 50\r",
+ "1 58 51\r",
+ "1 58 52\r",
+ "1 58 53\r",
+ "1 58 54\r",
+ "1 58 55\r",
+ "1 58 56\r",
+ "1 58 57\r",
+ "1 58 58\r",
+ "2 1 1\r",
+ "2 1 2\r",
+ "2 1 3\r",
+ "2 1 4\r",
+ "2 1 5\r",
+ "2 1 6\r",
+ "2 1 7\r",
+ "2 1 8\r",
+ "2 1 9\r",
+ "2 1 10\r",
+ "2 1 11\r",
+ "2 1 12\r",
+ "2 1 13\r",
+ "2 1 14\r",
+ "2 1 15\r",
+ "2 1 16\r",
+ "2 1 17\r",
+ "2 1 18\r",
+ "2 1 19\r",
+ "2 1 20\r",
+ "2 1 21\r",
+ "2 1 22\r",
+ "2 1 23\r",
+ "2 1 24\r",
+ "2 1 25\r",
+ "2 1 26\r",
+ "2 1 27\r",
+ "2 1 28\r",
+ "2 1 29\r",
+ "2 1 30\r",
+ "2 1 31\r",
+ "2 1 32\r",
+ "2 1 33\r",
+ "2 1 34\r",
+ "2 1 35\r",
+ "2 1 36\r",
+ "2 1 37\r",
+ "2 1 38\r",
+ "2 1 39\r",
+ "2 1 40\r",
+ "2 1 41\r",
+ "2 1 42\r",
+ "2 1 43\r",
+ "2 1 44\r",
+ "2 1 45\r",
+ "2 1 46\r",
+ "2 1 47\r",
+ "2 1 48\r",
+ "2 1 49\r",
+ "2 1 50\r",
+ "2 1 51\r",
+ "2 1 52\r",
+ "2 1 53\r",
+ "2 1 54\r",
+ "2 1 55\r",
+ "2 1 56\r",
+ "2 1 57\r",
+ "2 1 58\r",
+ "2 2 1\r",
+ "2 2 2\r",
+ "2 2 3\r",
+ "2 2 4\r",
+ "2 2 5\r",
+ "2 2 6\r",
+ "2 2 7\r",
+ "2 2 8\r",
+ "2 2 9\r",
+ "2 2 10\r",
+ "2 2 11\r",
+ "2 2 12\r",
+ "2 2 13\r",
+ "2 2 14\r",
+ "2 2 15\r",
+ "2 2 16\r",
+ "2 2 17\r",
+ "2 2 18\r",
+ "2 2 19\r",
+ "2 2 20\r",
+ "2 2 21\r",
+ "2 2 22\r",
+ "2 2 23\r",
+ "2 2 24\r",
+ "2 2 25\r",
+ "2 2 26\r",
+ "2 2 27\r",
+ "2 2 28\r",
+ "2 2 29\r",
+ "2 2 30\r",
+ "2 2 31\r",
+ "2 2 32\r",
+ "2 2 33\r",
+ "2 2 34\r",
+ "2 2 35\r",
+ "2 2 36\r",
+ "2 2 37\r",
+ "2 2 38\r",
+ "2 2 39\r",
+ "2 2 40\r",
+ "2 2 41\r",
+ "2 2 42\r",
+ "2 2 43\r",
+ "2 2 44\r",
+ "2 2 45\r",
+ "2 2 46\r",
+ "2 2 47\r",
+ "2 2 48\r",
+ "2 2 49\r",
+ "2 2 50\r",
+ "2 2 51\r",
+ "2 2 52\r",
+ "2 2 53\r",
+ "2 2 54\r",
+ "2 2 55\r",
+ "2 2 56\r",
+ "2 2 57\r",
+ "2 2 58\r",
+ "2 3 1\r",
+ "2 3 2\r",
+ "2 3 3\r",
+ "2 3 4\r",
+ "2 3 5\r",
+ "2 3 6\r",
+ "2 3 7\r",
+ "2 3 8\r",
+ "2 3 9\r",
+ "2 3 10\r",
+ "2 3 11\r",
+ "2 3 12\r",
+ "2 3 13\r",
+ "2 3 14\r",
+ "2 3 15\r",
+ "2 3 16\r",
+ "2 3 17\r",
+ "2 3 18\r",
+ "2 3 19\r",
+ "2 3 20\r",
+ "2 3 21\r",
+ "2 3 22\r",
+ "2 3 23\r",
+ "2 3 24\r",
+ "2 3 25\r",
+ "2 3 26\r",
+ "2 3 27\r",
+ "2 3 28\r",
+ "2 3 29\r",
+ "2 3 30\r",
+ "2 3 31\r",
+ "2 3 32\r",
+ "2 3 33\r",
+ "2 3 34\r",
+ "2 3 35\r",
+ "2 3 36\r",
+ "2 3 37\r",
+ "2 3 38\r",
+ "2 3 39\r",
+ "2 3 40\r",
+ "2 3 41\r",
+ "2 3 42\r",
+ "2 3 43\r",
+ "2 3 44\r",
+ "2 3 45\r",
+ "2 3 46\r",
+ "2 3 47\r",
+ "2 3 48\r",
+ "2 3 49\r",
+ "2 3 50\r",
+ "2 3 51\r",
+ "2 3 52\r",
+ "2 3 53\r",
+ "2 3 54\r",
+ "2 3 55\r",
+ "2 3 56\r",
+ "2 3 57\r",
+ "2 3 58\r",
+ "2 4 1\r",
+ "2 4 2\r",
+ "2 4 3\r",
+ "2 4 4\r",
+ "2 4 5\r",
+ "2 4 6\r",
+ "2 4 7\r",
+ "2 4 8\r",
+ "2 4 9\r",
+ "2 4 10\r",
+ "2 4 11\r",
+ "2 4 12\r",
+ "2 4 13\r",
+ "2 4 14\r",
+ "2 4 15\r",
+ "2 4 16\r",
+ "2 4 17\r",
+ "2 4 18\r",
+ "2 4 19\r",
+ "2 4 20\r",
+ "2 4 21\r",
+ "2 4 22\r",
+ "2 4 23\r",
+ "2 4 24\r",
+ "2 4 25\r",
+ "2 4 26\r",
+ "2 4 27\r",
+ "2 4 28\r",
+ "2 4 29\r",
+ "2 4 30\r",
+ "2 4 31\r",
+ "2 4 32\r",
+ "2 4 33\r",
+ "2 4 34\r",
+ "2 4 35\r",
+ "2 4 36\r",
+ "2 4 37\r",
+ "2 4 38\r",
+ "2 4 39\r",
+ "2 4 40\r",
+ "2 4 41\r",
+ "2 4 42\r",
+ "2 4 43\r",
+ "2 4 44\r",
+ "2 4 45\r",
+ "2 4 46\r",
+ "2 4 47\r",
+ "2 4 48\r",
+ "2 4 49\r",
+ "2 4 50\r",
+ "2 4 51\r",
+ "2 4 52\r",
+ "2 4 53\r",
+ "2 4 54\r",
+ "2 4 55\r",
+ "2 4 56\r",
+ "2 4 57\r",
+ "2 4 58\r",
+ "2 5 1\r",
+ "2 5 2\r",
+ "2 5 3\r",
+ "2 5 4\r",
+ "2 5 5\r",
+ "2 5 6\r",
+ "2 5 7\r",
+ "2 5 8\r",
+ "2 5 9\r",
+ "2 5 10\r",
+ "2 5 11\r",
+ "2 5 12\r",
+ "2 5 13\r",
+ "2 5 14\r",
+ "2 5 15\r",
+ "2 5 16\r",
+ "2 5 17\r",
+ "2 5 18\r",
+ "2 5 19\r",
+ "2 5 20\r",
+ "2 5 21\r",
+ "2 5 22\r",
+ "2 5 23\r",
+ "2 5 24\r",
+ "2 5 25\r",
+ "2 5 26\r",
+ "2 5 27\r",
+ "2 5 28\r",
+ "2 5 29\r",
+ "2 5 30\r",
+ "2 5 31\r",
+ "2 5 32\r",
+ "2 5 33\r",
+ "2 5 34\r",
+ "2 5 35\r",
+ "2 5 36\r",
+ "2 5 37\r",
+ "2 5 38\r",
+ "2 5 39\r",
+ "2 5 40\r",
+ "2 5 41\r",
+ "2 5 42\r",
+ "2 5 43\r",
+ "2 5 44\r",
+ "2 5 45\r",
+ "2 5 46\r",
+ "2 5 47\r",
+ "2 5 48\r",
+ "2 5 49\r",
+ "2 5 50\r",
+ "2 5 51\r",
+ "2 5 52\r",
+ "2 5 53\r",
+ "2 5 54\r",
+ "2 5 55\r",
+ "2 5 56\r",
+ "2 5 57\r",
+ "2 5 58\r",
+ "2 6 1\r",
+ "2 6 2\r",
+ "2 6 3\r",
+ "2 6 4\r",
+ "2 6 5\r",
+ "2 6 6\r",
+ "2 6 7\r",
+ "2 6 8\r",
+ "2 6 9\r",
+ "2 6 10\r",
+ "2 6 11\r",
+ "2 6 12\r",
+ "2 6 13\r",
+ "2 6 14\r",
+ "2 6 15\r",
+ "2 6 16\r",
+ "2 6 17\r",
+ "2 6 18\r",
+ "2 6 19\r",
+ "2 6 20\r",
+ "2 6 21\r",
+ "2 6 22\r",
+ "2 6 23\r",
+ "2 6 24\r",
+ "2 6 25\r",
+ "2 6 26\r",
+ "2 6 27\r",
+ "2 6 28\r",
+ "2 6 29\r",
+ "2 6 30\r",
+ "2 6 31\r",
+ "2 6 32\r",
+ "2 6 33\r",
+ "2 6 34\r",
+ "2 6 35\r",
+ "2 6 36\r",
+ "2 6 37\r",
+ "2 6 38\r",
+ "2 6 39\r",
+ "2 6 40\r",
+ "2 6 41\r",
+ "2 6 42\r",
+ "2 6 43\r",
+ "2 6 44\r",
+ "2 6 45\r",
+ "2 6 46\r",
+ "2 6 47\r",
+ "2 6 48\r",
+ "2 6 49\r",
+ "2 6 50\r",
+ "2 6 51\r",
+ "2 6 52\r",
+ "2 6 53\r",
+ "2 6 54\r",
+ "2 6 55\r",
+ "2 6 56\r",
+ "2 6 57\r",
+ "2 6 58\r",
+ "2 7 1\r",
+ "2 7 2\r",
+ "2 7 3\r",
+ "2 7 4\r",
+ "2 7 5\r",
+ "2 7 6\r",
+ "2 7 7\r",
+ "2 7 8\r",
+ "2 7 9\r",
+ "2 7 10\r",
+ "2 7 11\r",
+ "2 7 12\r",
+ "2 7 13\r",
+ "2 7 14\r",
+ "2 7 15\r",
+ "2 7 16\r",
+ "2 7 17\r",
+ "2 7 18\r",
+ "2 7 19\r",
+ "2 7 20\r",
+ "2 7 21\r",
+ "2 7 22\r",
+ "2 7 23\r",
+ "2 7 24\r",
+ "2 7 25\r",
+ "2 7 26\r",
+ "2 7 27\r",
+ "2 7 28\r",
+ "2 7 29\r",
+ "2 7 30\r",
+ "2 7 31\r",
+ "2 7 32\r",
+ "2 7 33\r",
+ "2 7 34\r",
+ "2 7 35\r",
+ "2 7 36\r",
+ "2 7 37\r",
+ "2 7 38\r",
+ "2 7 39\r",
+ "2 7 40\r",
+ "2 7 41\r",
+ "2 7 42\r",
+ "2 7 43\r",
+ "2 7 44\r",
+ "2 7 45\r",
+ "2 7 46\r",
+ "2 7 47\r",
+ "2 7 48\r",
+ "2 7 49\r",
+ "2 7 50\r",
+ "2 7 51\r",
+ "2 7 52\r",
+ "2 7 53\r",
+ "2 7 54\r",
+ "2 7 55\r",
+ "2 7 56\r",
+ "2 7 57\r",
+ "2 7 58\r",
+ "2 8 1\r",
+ "2 8 2\r",
+ "2 8 3\r",
+ "2 8 4\r",
+ "2 8 5\r",
+ "2 8 6\r",
+ "2 8 7\r",
+ "2 8 8\r",
+ "2 8 9\r",
+ "2 8 10\r",
+ "2 8 11\r",
+ "2 8 12\r",
+ "2 8 13\r",
+ "2 8 14\r",
+ "2 8 15\r",
+ "2 8 16\r",
+ "2 8 17\r",
+ "2 8 18\r",
+ "2 8 19\r",
+ "2 8 20\r",
+ "2 8 21\r",
+ "2 8 22\r",
+ "2 8 23\r",
+ "2 8 24\r",
+ "2 8 25\r",
+ "2 8 26\r",
+ "2 8 27\r",
+ "2 8 28\r",
+ "2 8 29\r",
+ "2 8 30\r",
+ "2 8 31\r",
+ "2 8 32\r",
+ "2 8 33\r",
+ "2 8 34\r",
+ "2 8 35\r",
+ "2 8 36\r",
+ "2 8 37\r",
+ "2 8 38\r",
+ "2 8 39\r",
+ "2 8 40\r",
+ "2 8 41\r",
+ "2 8 42\r",
+ "2 8 43\r",
+ "2 8 44\r",
+ "2 8 45\r",
+ "2 8 46\r",
+ "2 8 47\r",
+ "2 8 48\r",
+ "2 8 49\r",
+ "2 8 50\r",
+ "2 8 51\r",
+ "2 8 52\r",
+ "2 8 53\r",
+ "2 8 54\r",
+ "2 8 55\r",
+ "2 8 56\r",
+ "2 8 57\r",
+ "2 8 58\r",
+ "2 9 1\r",
+ "2 9 2\r",
+ "2 9 3\r",
+ "2 9 4\r",
+ "2 9 5\r",
+ "2 9 6\r",
+ "2 9 7\r",
+ "2 9 8\r",
+ "2 9 9\r",
+ "2 9 10\r",
+ "2 9 11\r",
+ "2 9 12\r",
+ "2 9 13\r",
+ "2 9 14\r",
+ "2 9 15\r",
+ "2 9 16\r",
+ "2 9 17\r",
+ "2 9 18\r",
+ "2 9 19\r",
+ "2 9 20\r",
+ "2 9 21\r",
+ "2 9 22\r",
+ "2 9 23\r",
+ "2 9 24\r",
+ "2 9 25\r",
+ "2 9 26\r",
+ "2 9 27\r",
+ "2 9 28\r",
+ "2 9 29\r",
+ "2 9 30\r",
+ "2 9 31\r",
+ "2 9 32\r",
+ "2 9 33\r",
+ "2 9 34\r",
+ "2 9 35\r",
+ "2 9 36\r",
+ "2 9 37\r",
+ "2 9 38\r",
+ "2 9 39\r",
+ "2 9 40\r",
+ "2 9 41\r",
+ "2 9 42\r",
+ "2 9 43\r",
+ "2 9 44\r",
+ "2 9 45\r",
+ "2 9 46\r",
+ "2 9 47\r",
+ "2 9 48\r",
+ "2 9 49\r",
+ "2 9 50\r",
+ "2 9 51\r",
+ "2 9 52\r",
+ "2 9 53\r",
+ "2 9 54\r",
+ "2 9 55\r",
+ "2 9 56\r",
+ "2 9 57\r",
+ "2 9 58\r",
+ "2 10 1\r",
+ "2 10 2\r",
+ "2 10 3\r",
+ "2 10 4\r",
+ "2 10 5\r",
+ "2 10 6\r",
+ "2 10 7\r",
+ "2 10 8\r",
+ "2 10 9\r",
+ "2 10 10\r",
+ "2 10 11\r",
+ "2 10 12\r",
+ "2 10 13\r",
+ "2 10 14\r",
+ "2 10 15\r",
+ "2 10 16\r",
+ "2 10 17\r",
+ "2 10 18\r",
+ "2 10 19\r",
+ "2 10 20\r",
+ "2 10 21\r",
+ "2 10 22\r",
+ "2 10 23\r",
+ "2 10 24\r",
+ "2 10 25\r",
+ "2 10 26\r",
+ "2 10 27\r",
+ "2 10 28\r",
+ "2 10 29\r",
+ "2 10 30\r",
+ "2 10 31\r",
+ "2 10 32\r",
+ "2 10 33\r",
+ "2 10 34\r",
+ "2 10 35\r",
+ "2 10 36\r",
+ "2 10 37\r",
+ "2 10 38\r",
+ "2 10 39\r",
+ "2 10 40\r",
+ "2 10 41\r",
+ "2 10 42\r",
+ "2 10 43\r",
+ "2 10 44\r",
+ "2 10 45\r",
+ "2 10 46\r",
+ "2 10 47\r",
+ "2 10 48\r",
+ "2 10 49\r",
+ "2 10 50\r",
+ "2 10 51\r",
+ "2 10 52\r",
+ "2 10 53\r",
+ "2 10 54\r",
+ "2 10 55\r",
+ "2 10 56\r",
+ "2 10 57\r",
+ "2 10 58\r",
+ "2 11 1\r",
+ "2 11 2\r",
+ "2 11 3\r",
+ "2 11 4\r",
+ "2 11 5\r",
+ "2 11 6\r",
+ "2 11 7\r",
+ "2 11 8\r",
+ "2 11 9\r",
+ "2 11 10\r",
+ "2 11 11\r",
+ "2 11 12\r",
+ "2 11 13\r",
+ "2 11 14\r",
+ "2 11 15\r",
+ "2 11 16\r",
+ "2 11 17\r",
+ "2 11 18\r",
+ "2 11 19\r",
+ "2 11 20\r",
+ "2 11 21\r",
+ "2 11 22\r",
+ "2 11 23\r",
+ "2 11 24\r",
+ "2 11 25\r",
+ "2 11 26\r",
+ "2 11 27\r",
+ "2 11 28\r",
+ "2 11 29\r",
+ "2 11 30\r",
+ "2 11 31\r",
+ "2 11 32\r",
+ "2 11 33\r",
+ "2 11 34\r",
+ "2 11 35\r",
+ "2 11 36\r",
+ "2 11 37\r",
+ "2 11 38\r",
+ "2 11 39\r",
+ "2 11 40\r",
+ "2 11 41\r",
+ "2 11 42\r",
+ "2 11 43\r",
+ "2 11 44\r",
+ "2 11 45\r",
+ "2 11 46\r",
+ "2 11 47\r",
+ "2 11 48\r",
+ "2 11 49\r",
+ "2 11 50\r",
+ "2 11 51\r",
+ "2 11 52\r",
+ "2 11 53\r",
+ "2 11 54\r",
+ "2 11 55\r",
+ "2 11 56\r",
+ "2 11 57\r",
+ "2 11 58\r",
+ "2 12 1\r",
+ "2 12 2\r",
+ "2 12 3\r",
+ "2 12 4\r",
+ "2 12 5\r",
+ "2 12 6\r",
+ "2 12 7\r",
+ "2 12 8\r",
+ "2 12 9\r",
+ "2 12 10\r",
+ "2 12 11\r",
+ "2 12 12\r",
+ "2 12 13\r",
+ "2 12 14\r",
+ "2 12 15\r",
+ "2 12 16\r",
+ "2 12 17\r",
+ "2 12 18\r",
+ "2 12 19\r",
+ "2 12 20\r",
+ "2 12 21\r",
+ "2 12 22\r",
+ "2 12 23\r",
+ "2 12 24\r",
+ "2 12 25\r",
+ "2 12 26\r",
+ "2 12 27\r",
+ "2 12 28\r",
+ "2 12 29\r",
+ "2 12 30\r",
+ "2 12 31\r",
+ "2 12 32\r",
+ "2 12 33\r",
+ "2 12 34\r",
+ "2 12 35\r",
+ "2 12 36\r",
+ "2 12 37\r",
+ "2 12 38\r",
+ "2 12 39\r",
+ "2 12 40\r",
+ "2 12 41\r",
+ "2 12 42\r",
+ "2 12 43\r",
+ "2 12 44\r",
+ "2 12 45\r",
+ "2 12 46\r",
+ "2 12 47\r",
+ "2 12 48\r",
+ "2 12 49\r",
+ "2 12 50\r",
+ "2 12 51\r",
+ "2 12 52\r",
+ "2 12 53\r",
+ "2 12 54\r",
+ "2 12 55\r",
+ "2 12 56\r",
+ "2 12 57\r",
+ "2 12 58\r",
+ "2 13 1\r",
+ "2 13 2\r",
+ "2 13 3\r",
+ "2 13 4\r",
+ "2 13 5\r",
+ "2 13 6\r",
+ "2 13 7\r",
+ "2 13 8\r",
+ "2 13 9\r",
+ "2 13 10\r",
+ "2 13 11\r",
+ "2 13 12\r",
+ "2 13 13\r",
+ "2 13 14\r",
+ "2 13 15\r",
+ "2 13 16\r",
+ "2 13 17\r",
+ "2 13 18\r",
+ "2 13 19\r",
+ "2 13 20\r",
+ "2 13 21\r",
+ "2 13 22\r",
+ "2 13 23\r",
+ "2 13 24\r",
+ "2 13 25\r",
+ "2 13 26\r",
+ "2 13 27\r",
+ "2 13 28\r",
+ "2 13 29\r",
+ "2 13 30\r",
+ "2 13 31\r",
+ "2 13 32\r",
+ "2 13 33\r",
+ "2 13 34\r",
+ "2 13 35\r",
+ "2 13 36\r",
+ "2 13 37\r",
+ "2 13 38\r",
+ "2 13 39\r",
+ "2 13 40\r",
+ "2 13 41\r",
+ "2 13 42\r",
+ "2 13 43\r",
+ "2 13 44\r",
+ "2 13 45\r",
+ "2 13 46\r",
+ "2 13 47\r",
+ "2 13 48\r",
+ "2 13 49\r",
+ "2 13 50\r",
+ "2 13 51\r",
+ "2 13 52\r",
+ "2 13 53\r",
+ "2 13 54\r",
+ "2 13 55\r",
+ "2 13 56\r",
+ "2 13 57\r",
+ "2 13 58\r",
+ "2 14 1\r",
+ "2 14 2\r",
+ "2 14 3\r",
+ "2 14 4\r",
+ "2 14 5\r",
+ "2 14 6\r",
+ "2 14 7\r",
+ "2 14 8\r",
+ "2 14 9\r",
+ "2 14 10\r",
+ "2 14 11\r",
+ "2 14 12\r",
+ "2 14 13\r",
+ "2 14 14\r",
+ "2 14 15\r",
+ "2 14 16\r",
+ "2 14 17\r",
+ "2 14 18\r",
+ "2 14 19\r",
+ "2 14 20\r",
+ "2 14 21\r",
+ "2 14 22\r",
+ "2 14 23\r",
+ "2 14 24\r",
+ "2 14 25\r",
+ "2 14 26\r",
+ "2 14 27\r",
+ "2 14 28\r",
+ "2 14 29\r",
+ "2 14 30\r",
+ "2 14 31\r",
+ "2 14 32\r",
+ "2 14 33\r",
+ "2 14 34\r",
+ "2 14 35\r",
+ "2 14 36\r",
+ "2 14 37\r",
+ "2 14 38\r",
+ "2 14 39\r",
+ "2 14 40\r",
+ "2 14 41\r",
+ "2 14 42\r",
+ "2 14 43\r",
+ "2 14 44\r",
+ "2 14 45\r",
+ "2 14 46\r",
+ "2 14 47\r",
+ "2 14 48\r",
+ "2 14 49\r",
+ "2 14 50\r",
+ "2 14 51\r",
+ "2 14 52\r",
+ "2 14 53\r",
+ "2 14 54\r",
+ "2 14 55\r",
+ "2 14 56\r",
+ "2 14 57\r",
+ "2 14 58\r",
+ "2 15 1\r",
+ "2 15 2\r",
+ "2 15 3\r",
+ "2 15 4\r",
+ "2 15 5\r",
+ "2 15 6\r",
+ "2 15 7\r",
+ "2 15 8\r",
+ "2 15 9\r",
+ "2 15 10\r",
+ "2 15 11\r",
+ "2 15 12\r",
+ "2 15 13\r",
+ "2 15 14\r",
+ "2 15 15\r",
+ "2 15 16\r",
+ "2 15 17\r",
+ "2 15 18\r",
+ "2 15 19\r",
+ "2 15 20\r",
+ "2 15 21\r",
+ "2 15 22\r",
+ "2 15 23\r",
+ "2 15 24\r",
+ "2 15 25\r",
+ "2 15 26\r",
+ "2 15 27\r",
+ "2 15 28\r",
+ "2 15 29\r",
+ "2 15 30\r",
+ "2 15 31\r",
+ "2 15 32\r",
+ "2 15 33\r",
+ "2 15 34\r",
+ "2 15 35\r",
+ "2 15 36\r",
+ "2 15 37\r",
+ "2 15 38\r",
+ "2 15 39\r",
+ "2 15 40\r",
+ "2 15 41\r",
+ "2 15 42\r",
+ "2 15 43\r",
+ "2 15 44\r",
+ "2 15 45\r",
+ "2 15 46\r",
+ "2 15 47\r",
+ "2 15 48\r",
+ "2 15 49\r",
+ "2 15 50\r",
+ "2 15 51\r",
+ "2 15 52\r",
+ "2 15 53\r",
+ "2 15 54\r",
+ "2 15 55\r",
+ "2 15 56\r",
+ "2 15 57\r",
+ "2 15 58\r",
+ "2 16 1\r",
+ "2 16 2\r",
+ "2 16 3\r",
+ "2 16 4\r",
+ "2 16 5\r",
+ "2 16 6\r",
+ "2 16 7\r",
+ "2 16 8\r",
+ "2 16 9\r",
+ "2 16 10\r",
+ "2 16 11\r",
+ "2 16 12\r",
+ "2 16 13\r",
+ "2 16 14\r",
+ "2 16 15\r",
+ "2 16 16\r",
+ "2 16 17\r",
+ "2 16 18\r",
+ "2 16 19\r",
+ "2 16 20\r",
+ "2 16 21\r",
+ "2 16 22\r",
+ "2 16 23\r",
+ "2 16 24\r",
+ "2 16 25\r",
+ "2 16 26\r",
+ "2 16 27\r",
+ "2 16 28\r",
+ "2 16 29\r",
+ "2 16 30\r",
+ "2 16 31\r",
+ "2 16 32\r",
+ "2 16 33\r",
+ "2 16 34\r",
+ "2 16 35\r",
+ "2 16 36\r",
+ "2 16 37\r",
+ "2 16 38\r",
+ "2 16 39\r",
+ "2 16 40\r",
+ "2 16 41\r",
+ "2 16 42\r",
+ "2 16 43\r",
+ "2 16 44\r",
+ "2 16 45\r",
+ "2 16 46\r",
+ "2 16 47\r",
+ "2 16 48\r",
+ "2 16 49\r",
+ "2 16 50\r",
+ "2 16 51\r",
+ "2 16 52\r",
+ "2 16 53\r",
+ "2 16 54\r",
+ "2 16 55\r",
+ "2 16 56\r",
+ "2 16 57\r",
+ "2 16 58\r",
+ "2 17 1\r",
+ "2 17 2\r",
+ "2 17 3\r",
+ "2 17 4\r",
+ "2 17 5\r",
+ "2 17 6\r",
+ "2 17 7\r",
+ "2 17 8\r",
+ "2 17 9\r",
+ "2 17 10\r",
+ "2 17 11\r",
+ "2 17 12\r",
+ "2 17 13\r",
+ "2 17 14\r",
+ "2 17 15\r",
+ "2 17 16\r",
+ "2 17 17\r",
+ "2 17 18\r",
+ "2 17 19\r",
+ "2 17 20\r",
+ "2 17 21\r",
+ "2 17 22\r",
+ "2 17 23\r",
+ "2 17 24\r",
+ "2 17 25\r",
+ "2 17 26\r",
+ "2 17 27\r",
+ "2 17 28\r",
+ "2 17 29\r",
+ "2 17 30\r",
+ "2 17 31\r",
+ "2 17 32\r",
+ "2 17 33\r",
+ "2 17 34\r",
+ "2 17 35\r",
+ "2 17 36\r",
+ "2 17 37\r",
+ "2 17 38\r",
+ "2 17 39\r",
+ "2 17 40\r",
+ "2 17 41\r",
+ "2 17 42\r",
+ "2 17 43\r",
+ "2 17 44\r",
+ "2 17 45\r",
+ "2 17 46\r",
+ "2 17 47\r",
+ "2 17 48\r",
+ "2 17 49\r",
+ "2 17 50\r",
+ "2 17 51\r",
+ "2 17 52\r",
+ "2 17 53\r",
+ "2 17 54\r",
+ "2 17 55\r",
+ "2 17 56\r",
+ "2 17 57\r",
+ "2 17 58\r",
+ "2 18 1\r",
+ "2 18 2\r",
+ "2 18 3\r",
+ "2 18 4\r",
+ "2 18 5\r",
+ "2 18 6\r",
+ "2 18 7\r",
+ "2 18 8\r",
+ "2 18 9\r",
+ "2 18 10\r",
+ "2 18 11\r",
+ "2 18 12\r",
+ "2 18 13\r",
+ "2 18 14\r",
+ "2 18 15\r",
+ "2 18 16\r",
+ "2 18 17\r",
+ "2 18 18\r",
+ "2 18 19\r",
+ "2 18 20\r",
+ "2 18 21\r",
+ "2 18 22\r",
+ "2 18 23\r",
+ "2 18 24\r",
+ "2 18 25\r",
+ "2 18 26\r",
+ "2 18 27\r",
+ "2 18 28\r",
+ "2 18 29\r",
+ "2 18 30\r",
+ "2 18 31\r",
+ "2 18 32\r",
+ "2 18 33\r",
+ "2 18 34\r",
+ "2 18 35\r",
+ "2 18 36\r",
+ "2 18 37\r",
+ "2 18 38\r",
+ "2 18 39\r",
+ "2 18 40\r",
+ "2 18 41\r",
+ "2 18 42\r",
+ "2 18 43\r",
+ "2 18 44\r",
+ "2 18 45\r",
+ "2 18 46\r",
+ "2 18 47\r",
+ "2 18 48\r",
+ "2 18 49\r",
+ "2 18 50\r",
+ "2 18 51\r",
+ "2 18 52\r",
+ "2 18 53\r",
+ "2 18 54\r",
+ "2 18 55\r",
+ "2 18 56\r",
+ "2 18 57\r",
+ "2 18 58\r",
+ "2 19 1\r",
+ "2 19 2\r",
+ "2 19 3\r",
+ "2 19 4\r",
+ "2 19 5\r",
+ "2 19 6\r",
+ "2 19 7\r",
+ "2 19 8\r",
+ "2 19 9\r",
+ "2 19 10\r",
+ "2 19 11\r",
+ "2 19 12\r",
+ "2 19 13\r",
+ "2 19 14\r",
+ "2 19 15\r",
+ "2 19 16\r",
+ "2 19 17\r",
+ "2 19 18\r",
+ "2 19 19\r",
+ "2 19 20\r",
+ "2 19 21\r",
+ "2 19 22\r",
+ "2 19 23\r",
+ "2 19 24\r",
+ "2 19 25\r",
+ "2 19 26\r",
+ "2 19 27\r",
+ "2 19 28\r",
+ "2 19 29\r",
+ "2 19 30\r",
+ "2 19 31\r",
+ "2 19 32\r",
+ "2 19 33\r",
+ "2 19 34\r",
+ "2 19 35\r",
+ "2 19 36\r",
+ "2 19 37\r",
+ "2 19 38\r",
+ "2 19 39\r",
+ "2 19 40\r",
+ "2 19 41\r",
+ "2 19 42\r",
+ "2 19 43\r",
+ "2 19 44\r",
+ "2 19 45\r",
+ "2 19 46\r",
+ "2 19 47\r",
+ "2 19 48\r",
+ "2 19 49\r",
+ "2 19 50\r",
+ "2 19 51\r",
+ "2 19 52\r",
+ "2 19 53\r",
+ "2 19 54\r",
+ "2 19 55\r",
+ "2 19 56\r",
+ "2 19 57\r",
+ "2 19 58\r",
+ "2 20 1\r",
+ "2 20 2\r",
+ "2 20 3\r",
+ "2 20 4\r",
+ "2 20 5\r",
+ "2 20 6\r",
+ "2 20 7\r",
+ "2 20 8\r",
+ "2 20 9\r",
+ "2 20 10\r",
+ "2 20 11\r",
+ "2 20 12\r",
+ "2 20 13\r",
+ "2 20 14\r",
+ "2 20 15\r",
+ "2 20 16\r",
+ "2 20 17\r",
+ "2 20 18\r",
+ "2 20 19\r",
+ "2 20 20\r",
+ "2 20 21\r",
+ "2 20 22\r",
+ "2 20 23\r",
+ "2 20 24\r",
+ "2 20 25\r",
+ "2 20 26\r",
+ "2 20 27\r",
+ "2 20 28\r",
+ "2 20 29\r",
+ "2 20 30\r",
+ "2 20 31\r",
+ "2 20 32\r",
+ "2 20 33\r",
+ "2 20 34\r",
+ "2 20 35\r",
+ "2 20 36\r",
+ "2 20 37\r",
+ "2 20 38\r",
+ "2 20 39\r",
+ "2 20 40\r",
+ "2 20 41\r",
+ "2 20 42\r",
+ "2 20 43\r",
+ "2 20 44\r",
+ "2 20 45\r",
+ "2 20 46\r",
+ "2 20 47\r",
+ "2 20 48\r",
+ "2 20 49\r",
+ "2 20 50\r",
+ "2 20 51\r",
+ "2 20 52\r",
+ "2 20 53\r",
+ "2 20 54\r",
+ "2 20 55\r",
+ "2 20 56\r",
+ "2 20 57\r",
+ "2 20 58\r",
+ "2 21 1\r",
+ "2 21 2\r",
+ "2 21 3\r",
+ "2 21 4\r",
+ "2 21 5\r",
+ "2 21 6\r",
+ "2 21 7\r",
+ "2 21 8\r",
+ "2 21 9\r",
+ "2 21 10\r",
+ "2 21 11\r",
+ "2 21 12\r",
+ "2 21 13\r",
+ "2 21 14\r",
+ "2 21 15\r",
+ "2 21 16\r",
+ "2 21 17\r",
+ "2 21 18\r",
+ "2 21 19\r",
+ "2 21 20\r",
+ "2 21 21\r",
+ "2 21 22\r",
+ "2 21 23\r",
+ "2 21 24\r",
+ "2 21 25\r",
+ "2 21 26\r",
+ "2 21 27\r",
+ "2 21 28\r",
+ "2 21 29\r",
+ "2 21 30\r",
+ "2 21 31\r",
+ "2 21 32\r",
+ "2 21 33\r",
+ "2 21 34\r",
+ "2 21 35\r",
+ "2 21 36\r",
+ "2 21 37\r",
+ "2 21 38\r",
+ "2 21 39\r",
+ "2 21 40\r",
+ "2 21 41\r",
+ "2 21 42\r",
+ "2 21 43\r",
+ "2 21 44\r",
+ "2 21 45\r",
+ "2 21 46\r",
+ "2 21 47\r",
+ "2 21 48\r",
+ "2 21 49\r",
+ "2 21 50\r",
+ "2 21 51\r",
+ "2 21 52\r",
+ "2 21 53\r",
+ "2 21 54\r",
+ "2 21 55\r",
+ "2 21 56\r",
+ "2 21 57\r",
+ "2 21 58\r",
+ "2 22 1\r",
+ "2 22 2\r",
+ "2 22 3\r",
+ "2 22 4\r",
+ "2 22 5\r",
+ "2 22 6\r",
+ "2 22 7\r",
+ "2 22 8\r",
+ "2 22 9\r",
+ "2 22 10\r",
+ "2 22 11\r",
+ "2 22 12\r",
+ "2 22 13\r",
+ "2 22 14\r",
+ "2 22 15\r",
+ "2 22 16\r",
+ "2 22 17\r",
+ "2 22 18\r",
+ "2 22 19\r",
+ "2 22 20\r",
+ "2 22 21\r",
+ "2 22 22\r",
+ "2 22 23\r",
+ "2 22 24\r",
+ "2 22 25\r",
+ "2 22 26\r",
+ "2 22 27\r",
+ "2 22 28\r",
+ "2 22 29\r",
+ "2 22 30\r",
+ "2 22 31\r",
+ "2 22 32\r",
+ "2 22 33\r",
+ "2 22 34\r",
+ "2 22 35\r",
+ "2 22 36\r",
+ "2 22 37\r",
+ "2 22 38\r",
+ "2 22 39\r",
+ "2 22 40\r",
+ "2 22 41\r",
+ "2 22 42\r",
+ "2 22 43\r",
+ "2 22 44\r",
+ "2 22 45\r",
+ "2 22 46\r",
+ "2 22 47\r",
+ "2 22 48\r",
+ "2 22 49\r",
+ "2 22 50\r",
+ "2 22 51\r",
+ "2 22 52\r",
+ "2 22 53\r",
+ "2 22 54\r",
+ "2 22 55\r",
+ "2 22 56\r",
+ "2 22 57\r",
+ "2 22 58\r",
+ "2 23 1\r",
+ "2 23 2\r",
+ "2 23 3\r",
+ "2 23 4\r",
+ "2 23 5\r",
+ "2 23 6\r",
+ "2 23 7\r",
+ "2 23 8\r",
+ "2 23 9\r",
+ "2 23 10\r",
+ "2 23 11\r",
+ "2 23 12\r",
+ "2 23 13\r",
+ "2 23 14\r",
+ "2 23 15\r",
+ "2 23 16\r",
+ "2 23 17\r",
+ "2 23 18\r",
+ "2 23 19\r",
+ "2 23 20\r",
+ "2 23 21\r",
+ "2 23 22\r",
+ "2 23 23\r",
+ "2 23 24\r",
+ "2 23 25\r",
+ "2 23 26\r",
+ "2 23 27\r",
+ "2 23 28\r",
+ "2 23 29\r",
+ "2 23 30\r",
+ "2 23 31\r",
+ "2 23 32\r",
+ "2 23 33\r",
+ "2 23 34\r",
+ "2 23 35\r",
+ "2 23 36\r",
+ "2 23 37\r",
+ "2 23 38\r",
+ "2 23 39\r",
+ "2 23 40\r",
+ "2 23 41\r",
+ "2 23 42\r",
+ "2 23 43\r",
+ "2 23 44\r",
+ "2 23 45\r",
+ "2 23 46\r",
+ "2 23 47\r",
+ "2 23 48\r",
+ "2 23 49\r",
+ "2 23 50\r",
+ "2 23 51\r",
+ "2 23 52\r",
+ "2 23 53\r",
+ "2 23 54\r",
+ "2 23 55\r",
+ "2 23 56\r",
+ "2 23 57\r",
+ "2 23 58\r",
+ "2 24 1\r",
+ "2 24 2\r",
+ "2 24 3\r",
+ "2 24 4\r",
+ "2 24 5\r",
+ "2 24 6\r",
+ "2 24 7\r",
+ "2 24 8\r",
+ "2 24 9\r",
+ "2 24 10\r",
+ "2 24 11\r",
+ "2 24 12\r",
+ "2 24 13\r",
+ "2 24 14\r",
+ "2 24 15\r",
+ "2 24 16\r",
+ "2 24 17\r",
+ "2 24 18\r",
+ "2 24 19\r",
+ "2 24 20\r",
+ "2 24 21\r",
+ "2 24 22\r",
+ "2 24 23\r",
+ "2 24 24\r",
+ "2 24 25\r",
+ "2 24 26\r",
+ "2 24 27\r",
+ "2 24 28\r",
+ "2 24 29\r",
+ "2 24 30\r",
+ "2 24 31\r",
+ "2 24 32\r",
+ "2 24 33\r",
+ "2 24 34\r",
+ "2 24 35\r",
+ "2 24 36\r",
+ "2 24 37\r",
+ "2 24 38\r",
+ "2 24 39\r",
+ "2 24 40\r",
+ "2 24 41\r",
+ "2 24 42\r",
+ "2 24 43\r",
+ "2 24 44\r",
+ "2 24 45\r",
+ "2 24 46\r",
+ "2 24 47\r",
+ "2 24 48\r",
+ "2 24 49\r",
+ "2 24 50\r",
+ "2 24 51\r",
+ "2 24 52\r",
+ "2 24 53\r",
+ "2 24 54\r",
+ "2 24 55\r",
+ "2 24 56\r",
+ "2 24 57\r",
+ "2 24 58\r",
+ "2 25 1\r",
+ "2 25 2\r",
+ "2 25 3\r",
+ "2 25 4\r",
+ "2 25 5\r",
+ "2 25 6\r",
+ "2 25 7\r",
+ "2 25 8\r",
+ "2 25 9\r",
+ "2 25 10\r",
+ "2 25 11\r",
+ "2 25 12\r",
+ "2 25 13\r",
+ "2 25 14\r",
+ "2 25 15\r",
+ "2 25 16\r",
+ "2 25 17\r",
+ "2 25 18\r",
+ "2 25 19\r",
+ "2 25 20\r",
+ "2 25 21\r",
+ "2 25 22\r",
+ "2 25 23\r",
+ "2 25 24\r",
+ "2 25 25\r",
+ "2 25 26\r",
+ "2 25 27\r",
+ "2 25 28\r",
+ "2 25 29\r",
+ "2 25 30\r",
+ "2 25 31\r",
+ "2 25 32\r",
+ "2 25 33\r",
+ "2 25 34\r",
+ "2 25 35\r",
+ "2 25 36\r",
+ "2 25 37\r",
+ "2 25 38\r",
+ "2 25 39\r",
+ "2 25 40\r",
+ "2 25 41\r",
+ "2 25 42\r",
+ "2 25 43\r",
+ "2 25 44\r",
+ "2 25 45\r",
+ "2 25 46\r",
+ "2 25 47\r",
+ "2 25 48\r",
+ "2 25 49\r",
+ "2 25 50\r",
+ "2 25 51\r",
+ "2 25 52\r",
+ "2 25 53\r",
+ "2 25 54\r",
+ "2 25 55\r",
+ "2 25 56\r",
+ "2 25 57\r",
+ "2 25 58\r",
+ "2 26 1\r",
+ "2 26 2\r",
+ "2 26 3\r",
+ "2 26 4\r",
+ "2 26 5\r",
+ "2 26 6\r",
+ "2 26 7\r",
+ "2 26 8\r",
+ "2 26 9\r",
+ "2 26 10\r",
+ "2 26 11\r",
+ "2 26 12\r",
+ "2 26 13\r",
+ "2 26 14\r",
+ "2 26 15\r",
+ "2 26 16\r",
+ "2 26 17\r",
+ "2 26 18\r",
+ "2 26 19\r",
+ "2 26 20\r",
+ "2 26 21\r",
+ "2 26 22\r",
+ "2 26 23\r",
+ "2 26 24\r",
+ "2 26 25\r",
+ "2 26 26\r",
+ "2 26 27\r",
+ "2 26 28\r",
+ "2 26 29\r",
+ "2 26 30\r",
+ "2 26 31\r",
+ "2 26 32\r",
+ "2 26 33\r",
+ "2 26 34\r",
+ "2 26 35\r",
+ "2 26 36\r",
+ "2 26 37\r",
+ "2 26 38\r",
+ "2 26 39\r",
+ "2 26 40\r",
+ "2 26 41\r",
+ "2 26 42\r",
+ "2 26 43\r",
+ "2 26 44\r",
+ "2 26 45\r",
+ "2 26 46\r",
+ "2 26 47\r",
+ "2 26 48\r",
+ "2 26 49\r",
+ "2 26 50\r",
+ "2 26 51\r",
+ "2 26 52\r",
+ "2 26 53\r",
+ "2 26 54\r",
+ "2 26 55\r",
+ "2 26 56\r",
+ "2 26 57\r",
+ "2 26 58\r",
+ "2 27 1\r",
+ "2 27 2\r",
+ "2 27 3\r",
+ "2 27 4\r",
+ "2 27 5\r",
+ "2 27 6\r",
+ "2 27 7\r",
+ "2 27 8\r",
+ "2 27 9\r",
+ "2 27 10\r",
+ "2 27 11\r",
+ "2 27 12\r",
+ "2 27 13\r",
+ "2 27 14\r",
+ "2 27 15\r",
+ "2 27 16\r",
+ "2 27 17\r",
+ "2 27 18\r",
+ "2 27 19\r",
+ "2 27 20\r",
+ "2 27 21\r",
+ "2 27 22\r",
+ "2 27 23\r",
+ "2 27 24\r",
+ "2 27 25\r",
+ "2 27 26\r",
+ "2 27 27\r",
+ "2 27 28\r",
+ "2 27 29\r",
+ "2 27 30\r",
+ "2 27 31\r",
+ "2 27 32\r",
+ "2 27 33\r",
+ "2 27 34\r",
+ "2 27 35\r",
+ "2 27 36\r",
+ "2 27 37\r",
+ "2 27 38\r",
+ "2 27 39\r",
+ "2 27 40\r",
+ "2 27 41\r",
+ "2 27 42\r",
+ "2 27 43\r",
+ "2 27 44\r",
+ "2 27 45\r",
+ "2 27 46\r",
+ "2 27 47\r",
+ "2 27 48\r",
+ "2 27 49\r",
+ "2 27 50\r",
+ "2 27 51\r",
+ "2 27 52\r",
+ "2 27 53\r",
+ "2 27 54\r",
+ "2 27 55\r",
+ "2 27 56\r",
+ "2 27 57\r",
+ "2 27 58\r",
+ "2 28 1\r",
+ "2 28 2\r",
+ "2 28 3\r",
+ "2 28 4\r",
+ "2 28 5\r",
+ "2 28 6\r",
+ "2 28 7\r",
+ "2 28 8\r",
+ "2 28 9\r",
+ "2 28 10\r",
+ "2 28 11\r",
+ "2 28 12\r",
+ "2 28 13\r",
+ "2 28 14\r",
+ "2 28 15\r",
+ "2 28 16\r",
+ "2 28 17\r",
+ "2 28 18\r",
+ "2 28 19\r",
+ "2 28 20\r",
+ "2 28 21\r",
+ "2 28 22\r",
+ "2 28 23\r",
+ "2 28 24\r",
+ "2 28 25\r",
+ "2 28 26\r",
+ "2 28 27\r",
+ "2 28 28\r",
+ "2 28 29\r",
+ "2 28 30\r",
+ "2 28 31\r",
+ "2 28 32\r",
+ "2 28 33\r",
+ "2 28 34\r",
+ "2 28 35\r",
+ "2 28 36\r",
+ "2 28 37\r",
+ "2 28 38\r",
+ "2 28 39\r",
+ "2 28 40\r",
+ "2 28 41\r",
+ "2 28 42\r",
+ "2 28 43\r",
+ "2 28 44\r",
+ "2 28 45\r",
+ "2 28 46\r",
+ "2 28 47\r",
+ "2 28 48\r",
+ "2 28 49\r",
+ "2 28 50\r",
+ "2 28 51\r",
+ "2 28 52\r",
+ "2 28 53\r",
+ "2 28 54\r",
+ "2 28 55\r",
+ "2 28 56\r",
+ "2 28 57\r",
+ "2 28 58\r",
+ "2 29 1\r",
+ "2 29 2\r",
+ "2 29 3\r",
+ "2 29 4\r",
+ "2 29 5\r",
+ "2 29 6\r",
+ "2 29 7\r",
+ "2 29 8\r",
+ "2 29 9\r",
+ "2 29 10\r",
+ "2 29 11\r",
+ "2 29 12\r",
+ "2 29 13\r",
+ "2 29 14\r",
+ "2 29 15\r",
+ "2 29 16\r",
+ "2 29 17\r",
+ "2 29 18\r",
+ "2 29 19\r",
+ "2 29 20\r",
+ "2 29 21\r",
+ "2 29 22\r",
+ "2 29 23\r",
+ "2 29 24\r",
+ "2 29 25\r",
+ "2 29 26\r",
+ "2 29 27\r",
+ "2 29 28\r",
+ "2 29 29\r",
+ "2 29 30\r",
+ "2 29 31\r",
+ "2 29 32\r",
+ "2 29 33\r",
+ "2 29 34\r",
+ "2 29 35\r",
+ "2 29 36\r",
+ "2 29 37\r",
+ "2 29 38\r",
+ "2 29 39\r",
+ "2 29 40\r",
+ "2 29 41\r",
+ "2 29 42\r",
+ "2 29 43\r",
+ "2 29 44\r",
+ "2 29 45\r",
+ "2 29 46\r",
+ "2 29 47\r",
+ "2 29 48\r",
+ "2 29 49\r",
+ "2 29 50\r",
+ "2 29 51\r",
+ "2 29 52\r",
+ "2 29 53\r",
+ "2 29 54\r",
+ "2 29 55\r",
+ "2 29 56\r",
+ "2 29 57\r",
+ "2 29 58\r",
+ "2 30 1\r",
+ "2 30 2\r",
+ "2 30 3\r",
+ "2 30 4\r",
+ "2 30 5\r",
+ "2 30 6\r",
+ "2 30 7\r",
+ "2 30 8\r",
+ "2 30 9\r",
+ "2 30 10\r",
+ "2 30 11\r",
+ "2 30 12\r",
+ "2 30 13\r",
+ "2 30 14\r",
+ "2 30 15\r",
+ "2 30 16\r",
+ "2 30 17\r",
+ "2 30 18\r",
+ "2 30 19\r",
+ "2 30 20\r",
+ "2 30 21\r",
+ "2 30 22\r",
+ "2 30 23\r",
+ "2 30 24\r",
+ "2 30 25\r",
+ "2 30 26\r",
+ "2 30 27\r",
+ "2 30 28\r",
+ "2 30 29\r",
+ "2 30 30\r",
+ "2 30 31\r",
+ "2 30 32\r",
+ "2 30 33\r",
+ "2 30 34\r",
+ "2 30 35\r",
+ "2 30 36\r",
+ "2 30 37\r",
+ "2 30 38\r",
+ "2 30 39\r",
+ "2 30 40\r",
+ "2 30 41\r",
+ "2 30 42\r",
+ "2 30 43\r",
+ "2 30 44\r",
+ "2 30 45\r",
+ "2 30 46\r",
+ "2 30 47\r",
+ "2 30 48\r",
+ "2 30 49\r",
+ "2 30 50\r",
+ "2 30 51\r",
+ "2 30 52\r",
+ "2 30 53\r",
+ "2 30 54\r",
+ "2 30 55\r",
+ "2 30 56\r",
+ "2 30 57\r",
+ "2 30 58\r",
+ "2 31 1\r",
+ "2 31 2\r",
+ "2 31 3\r",
+ "2 31 4\r",
+ "2 31 5\r",
+ "2 31 6\r",
+ "2 31 7\r",
+ "2 31 8\r",
+ "2 31 9\r",
+ "2 31 10\r",
+ "2 31 11\r",
+ "2 31 12\r",
+ "2 31 13\r",
+ "2 31 14\r",
+ "2 31 15\r",
+ "2 31 16\r",
+ "2 31 17\r",
+ "2 31 18\r",
+ "2 31 19\r",
+ "2 31 20\r",
+ "2 31 21\r",
+ "2 31 22\r",
+ "2 31 23\r",
+ "2 31 24\r",
+ "2 31 25\r",
+ "2 31 26\r",
+ "2 31 27\r",
+ "2 31 28\r",
+ "2 31 29\r",
+ "2 31 30\r",
+ "2 31 31\r",
+ "2 31 32\r",
+ "2 31 33\r",
+ "2 31 34\r",
+ "2 31 35\r",
+ "2 31 36\r",
+ "2 31 37\r",
+ "2 31 38\r",
+ "2 31 39\r",
+ "2 31 40\r",
+ "2 31 41\r",
+ "2 31 42\r",
+ "2 31 43\r",
+ "2 31 44\r",
+ "2 31 45\r",
+ "2 31 46\r",
+ "2 31 47\r",
+ "2 31 48\r",
+ "2 31 49\r",
+ "2 31 50\r",
+ "2 31 51\r",
+ "2 31 52\r",
+ "2 31 53\r",
+ "2 31 54\r",
+ "2 31 55\r",
+ "2 31 56\r",
+ "2 31 57\r",
+ "2 31 58\r",
+ "2 32 1\r",
+ "2 32 2\r",
+ "2 32 3\r",
+ "2 32 4\r",
+ "2 32 5\r",
+ "2 32 6\r",
+ "2 32 7\r",
+ "2 32 8\r",
+ "2 32 9\r",
+ "2 32 10\r",
+ "2 32 11\r",
+ "2 32 12\r",
+ "2 32 13\r",
+ "2 32 14\r",
+ "2 32 15\r",
+ "2 32 16\r",
+ "2 32 17\r",
+ "2 32 18\r",
+ "2 32 19\r",
+ "2 32 20\r",
+ "2 32 21\r",
+ "2 32 22\r",
+ "2 32 23\r",
+ "2 32 24\r",
+ "2 32 25\r",
+ "2 32 26\r",
+ "2 32 27\r",
+ "2 32 28\r",
+ "2 32 29\r",
+ "2 32 30\r",
+ "2 32 31\r",
+ "2 32 32\r",
+ "2 32 33\r",
+ "2 32 34\r",
+ "2 32 35\r",
+ "2 32 36\r",
+ "2 32 37\r",
+ "2 32 38\r",
+ "2 32 39\r",
+ "2 32 40\r",
+ "2 32 41\r",
+ "2 32 42\r",
+ "2 32 43\r",
+ "2 32 44\r",
+ "2 32 45\r",
+ "2 32 46\r",
+ "2 32 47\r",
+ "2 32 48\r",
+ "2 32 49\r",
+ "2 32 50\r",
+ "2 32 51\r",
+ "2 32 52\r",
+ "2 32 53\r",
+ "2 32 54\r",
+ "2 32 55\r",
+ "2 32 56\r",
+ "2 32 57\r",
+ "2 32 58\r",
+ "2 33 1\r",
+ "2 33 2\r",
+ "2 33 3\r",
+ "2 33 4\r",
+ "2 33 5\r",
+ "2 33 6\r",
+ "2 33 7\r",
+ "2 33 8\r",
+ "2 33 9\r",
+ "2 33 10\r",
+ "2 33 11\r",
+ "2 33 12\r",
+ "2 33 13\r",
+ "2 33 14\r",
+ "2 33 15\r",
+ "2 33 16\r",
+ "2 33 17\r",
+ "2 33 18\r",
+ "2 33 19\r",
+ "2 33 20\r",
+ "2 33 21\r",
+ "2 33 22\r",
+ "2 33 23\r",
+ "2 33 24\r",
+ "2 33 25\r",
+ "2 33 26\r",
+ "2 33 27\r",
+ "2 33 28\r",
+ "2 33 29\r",
+ "2 33 30\r",
+ "2 33 31\r",
+ "2 33 32\r",
+ "2 33 33\r",
+ "2 33 34\r",
+ "2 33 35\r",
+ "2 33 36\r",
+ "2 33 37\r",
+ "2 33 38\r",
+ "2 33 39\r",
+ "2 33 40\r",
+ "2 33 41\r",
+ "2 33 42\r",
+ "2 33 43\r",
+ "2 33 44\r",
+ "2 33 45\r",
+ "2 33 46\r",
+ "2 33 47\r",
+ "2 33 48\r",
+ "2 33 49\r",
+ "2 33 50\r",
+ "2 33 51\r",
+ "2 33 52\r",
+ "2 33 53\r",
+ "2 33 54\r",
+ "2 33 55\r",
+ "2 33 56\r",
+ "2 33 57\r",
+ "2 33 58\r",
+ "2 34 1\r",
+ "2 34 2\r",
+ "2 34 3\r",
+ "2 34 4\r",
+ "2 34 5\r",
+ "2 34 6\r",
+ "2 34 7\r",
+ "2 34 8\r",
+ "2 34 9\r",
+ "2 34 10\r",
+ "2 34 11\r",
+ "2 34 12\r",
+ "2 34 13\r",
+ "2 34 14\r",
+ "2 34 15\r",
+ "2 34 16\r",
+ "2 34 17\r",
+ "2 34 18\r",
+ "2 34 19\r",
+ "2 34 20\r",
+ "2 34 21\r",
+ "2 34 22\r",
+ "2 34 23\r",
+ "2 34 24\r",
+ "2 34 25\r",
+ "2 34 26\r",
+ "2 34 27\r",
+ "2 34 28\r",
+ "2 34 29\r",
+ "2 34 30\r",
+ "2 34 31\r",
+ "2 34 32\r",
+ "2 34 33\r",
+ "2 34 34\r",
+ "2 34 35\r",
+ "2 34 36\r",
+ "2 34 37\r",
+ "2 34 38\r",
+ "2 34 39\r",
+ "2 34 40\r",
+ "2 34 41\r",
+ "2 34 42\r",
+ "2 34 43\r",
+ "2 34 44\r",
+ "2 34 45\r",
+ "2 34 46\r",
+ "2 34 47\r",
+ "2 34 48\r",
+ "2 34 49\r",
+ "2 34 50\r",
+ "2 34 51\r",
+ "2 34 52\r",
+ "2 34 53\r",
+ "2 34 54"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "2 34 55\r",
+ "2 34 56\r",
+ "2 34 57\r",
+ "2 34 58\r",
+ "2 35 1\r",
+ "2 35 2\r",
+ "2 35 3\r",
+ "2 35 4\r",
+ "2 35 5\r",
+ "2 35 6\r",
+ "2 35 7\r",
+ "2 35 8\r",
+ "2 35 9\r",
+ "2 35 10\r",
+ "2 35 11\r",
+ "2 35 12\r",
+ "2 35 13\r",
+ "2 35 14\r",
+ "2 35 15\r",
+ "2 35 16\r",
+ "2 35 17\r",
+ "2 35 18\r",
+ "2 35 19\r",
+ "2 35 20\r",
+ "2 35 21\r",
+ "2 35 22\r",
+ "2 35 23\r",
+ "2 35 24\r",
+ "2 35 25\r",
+ "2 35 26\r",
+ "2 35 27\r",
+ "2 35 28\r",
+ "2 35 29\r",
+ "2 35 30\r",
+ "2 35 31\r",
+ "2 35 32\r",
+ "2 35 33\r",
+ "2 35 34\r",
+ "2 35 35\r",
+ "2 35 36\r",
+ "2 35 37\r",
+ "2 35 38\r",
+ "2 35 39\r",
+ "2 35 40\r",
+ "2 35 41\r",
+ "2 35 42\r",
+ "2 35 43\r",
+ "2 35 44\r",
+ "2 35 45\r",
+ "2 35 46\r",
+ "2 35 47\r",
+ "2 35 48\r",
+ "2 35 49\r",
+ "2 35 50\r",
+ "2 35 51\r",
+ "2 35 52\r",
+ "2 35 53\r",
+ "2 35 54\r",
+ "2 35 55\r",
+ "2 35 56\r",
+ "2 35 57\r",
+ "2 35 58\r",
+ "2 36 1\r",
+ "2 36 2\r",
+ "2 36 3\r",
+ "2 36 4\r",
+ "2 36 5\r",
+ "2 36 6\r",
+ "2 36 7\r",
+ "2 36 8\r",
+ "2 36 9\r",
+ "2 36 10\r",
+ "2 36 11\r",
+ "2 36 12\r",
+ "2 36 13\r",
+ "2 36 14\r",
+ "2 36 15\r",
+ "2 36 16\r",
+ "2 36 17\r",
+ "2 36 18\r",
+ "2 36 19\r",
+ "2 36 20\r",
+ "2 36 21\r",
+ "2 36 22\r",
+ "2 36 23\r",
+ "2 36 24\r",
+ "2 36 25\r",
+ "2 36 26\r",
+ "2 36 27\r",
+ "2 36 28\r",
+ "2 36 29\r",
+ "2 36 30\r",
+ "2 36 31\r",
+ "2 36 32\r",
+ "2 36 33\r",
+ "2 36 34\r",
+ "2 36 35\r",
+ "2 36 36\r",
+ "2 36 37\r",
+ "2 36 38\r",
+ "2 36 39\r",
+ "2 36 40\r",
+ "2 36 41\r",
+ "2 36 42\r",
+ "2 36 43\r",
+ "2 36 44\r",
+ "2 36 45\r",
+ "2 36 46\r",
+ "2 36 47\r",
+ "2 36 48\r",
+ "2 36 49\r",
+ "2 36 50\r",
+ "2 36 51\r",
+ "2 36 52\r",
+ "2 36 53\r",
+ "2 36 54\r",
+ "2 36 55\r",
+ "2 36 56\r",
+ "2 36 57\r",
+ "2 36 58\r",
+ "2 37 1\r",
+ "2 37 2\r",
+ "2 37 3\r",
+ "2 37 4\r",
+ "2 37 5\r",
+ "2 37 6\r",
+ "2 37 7\r",
+ "2 37 8\r",
+ "2 37 9\r",
+ "2 37 10\r",
+ "2 37 11\r",
+ "2 37 12\r",
+ "2 37 13\r",
+ "2 37 14\r",
+ "2 37 15\r",
+ "2 37 16\r",
+ "2 37 17\r",
+ "2 37 18\r",
+ "2 37 19\r",
+ "2 37 20\r",
+ "2 37 21\r",
+ "2 37 22\r",
+ "2 37 23\r",
+ "2 37 24\r",
+ "2 37 25\r",
+ "2 37 26\r",
+ "2 37 27\r",
+ "2 37 28\r",
+ "2 37 29\r",
+ "2 37 30\r",
+ "2 37 31\r",
+ "2 37 32\r",
+ "2 37 33\r",
+ "2 37 34\r",
+ "2 37 35\r",
+ "2 37 36\r",
+ "2 37 37\r",
+ "2 37 38\r",
+ "2 37 39\r",
+ "2 37 40\r",
+ "2 37 41\r",
+ "2 37 42\r",
+ "2 37 43\r",
+ "2 37 44\r",
+ "2 37 45\r",
+ "2 37 46\r",
+ "2 37 47\r",
+ "2 37 48\r",
+ "2 37 49\r",
+ "2 37 50\r",
+ "2 37 51\r",
+ "2 37 52\r",
+ "2 37 53\r",
+ "2 37 54\r",
+ "2 37 55\r",
+ "2 37 56\r",
+ "2 37 57\r",
+ "2 37 58\r",
+ "2 38 1\r",
+ "2 38 2\r",
+ "2 38 3\r",
+ "2 38 4\r",
+ "2 38 5\r",
+ "2 38 6\r",
+ "2 38 7\r",
+ "2 38 8\r",
+ "2 38 9\r",
+ "2 38 10\r",
+ "2 38 11\r",
+ "2 38 12\r",
+ "2 38 13\r",
+ "2 38 14\r",
+ "2 38 15\r",
+ "2 38 16\r",
+ "2 38 17\r",
+ "2 38 18\r",
+ "2 38 19\r",
+ "2 38 20\r",
+ "2 38 21\r",
+ "2 38 22\r",
+ "2 38 23\r",
+ "2 38 24\r",
+ "2 38 25\r",
+ "2 38 26\r",
+ "2 38 27\r",
+ "2 38 28\r",
+ "2 38 29\r",
+ "2 38 30\r",
+ "2 38 31\r",
+ "2 38 32\r",
+ "2 38 33\r",
+ "2 38 34\r",
+ "2 38 35\r",
+ "2 38 36\r",
+ "2 38 37\r",
+ "2 38 38\r",
+ "2 38 39\r",
+ "2 38 40\r",
+ "2 38 41\r",
+ "2 38 42\r",
+ "2 38 43\r",
+ "2 38 44\r",
+ "2 38 45\r",
+ "2 38 46\r",
+ "2 38 47\r",
+ "2 38 48\r",
+ "2 38 49\r",
+ "2 38 50\r",
+ "2 38 51\r",
+ "2 38 52\r",
+ "2 38 53\r",
+ "2 38 54\r",
+ "2 38 55\r",
+ "2 38 56\r",
+ "2 38 57\r",
+ "2 38 58\r",
+ "2 39 1\r",
+ "2 39 2\r",
+ "2 39 3\r",
+ "2 39 4\r",
+ "2 39 5\r",
+ "2 39 6\r",
+ "2 39 7\r",
+ "2 39 8\r",
+ "2 39 9\r",
+ "2 39 10\r",
+ "2 39 11\r",
+ "2 39 12\r",
+ "2 39 13\r",
+ "2 39 14\r",
+ "2 39 15\r",
+ "2 39 16\r",
+ "2 39 17\r",
+ "2 39 18\r",
+ "2 39 19\r",
+ "2 39 20\r",
+ "2 39 21\r",
+ "2 39 22\r",
+ "2 39 23\r",
+ "2 39 24\r",
+ "2 39 25\r",
+ "2 39 26\r",
+ "2 39 27\r",
+ "2 39 28\r",
+ "2 39 29\r",
+ "2 39 30\r",
+ "2 39 31\r",
+ "2 39 32\r",
+ "2 39 33\r",
+ "2 39 34\r",
+ "2 39 35\r",
+ "2 39 36\r",
+ "2 39 37\r",
+ "2 39 38\r",
+ "2 39 39\r",
+ "2 39 40\r",
+ "2 39 41\r",
+ "2 39 42\r",
+ "2 39 43\r",
+ "2 39 44\r",
+ "2 39 45\r",
+ "2 39 46\r",
+ "2 39 47\r",
+ "2 39 48\r",
+ "2 39 49\r",
+ "2 39 50\r",
+ "2 39 51\r",
+ "2 39 52\r",
+ "2 39 53\r",
+ "2 39 54\r",
+ "2 39 55\r",
+ "2 39 56\r",
+ "2 39 57\r",
+ "2 39 58\r",
+ "2 40 1\r",
+ "2 40 2\r",
+ "2 40 3\r",
+ "2 40 4\r",
+ "2 40 5\r",
+ "2 40 6\r",
+ "2 40 7\r",
+ "2 40 8\r",
+ "2 40 9\r",
+ "2 40 10\r",
+ "2 40 11\r",
+ "2 40 12\r",
+ "2 40 13\r",
+ "2 40 14\r",
+ "2 40 15\r",
+ "2 40 16\r",
+ "2 40 17\r",
+ "2 40 18\r",
+ "2 40 19\r",
+ "2 40 20\r",
+ "2 40 21\r",
+ "2 40 22\r",
+ "2 40 23\r",
+ "2 40 24\r",
+ "2 40 25\r",
+ "2 40 26\r",
+ "2 40 27\r",
+ "2 40 28\r",
+ "2 40 29\r",
+ "2 40 30\r",
+ "2 40 31\r",
+ "2 40 32\r",
+ "2 40 33\r",
+ "2 40 34\r",
+ "2 40 35\r",
+ "2 40 36\r",
+ "2 40 37\r",
+ "2 40 38\r",
+ "2 40 39\r",
+ "2 40 40\r",
+ "2 40 41\r",
+ "2 40 42\r",
+ "2 40 43\r",
+ "2 40 44\r",
+ "2 40 45\r",
+ "2 40 46\r",
+ "2 40 47\r",
+ "2 40 48\r",
+ "2 40 49\r",
+ "2 40 50\r",
+ "2 40 51\r",
+ "2 40 52\r",
+ "2 40 53\r",
+ "2 40 54\r",
+ "2 40 55\r",
+ "2 40 56\r",
+ "2 40 57\r",
+ "2 40 58\r",
+ "2 41 1\r",
+ "2 41 2\r",
+ "2 41 3\r",
+ "2 41 4\r",
+ "2 41 5\r",
+ "2 41 6\r",
+ "2 41 7\r",
+ "2 41 8\r",
+ "2 41 9\r",
+ "2 41 10\r",
+ "2 41 11\r",
+ "2 41 12\r",
+ "2 41 13\r",
+ "2 41 14\r",
+ "2 41 15\r",
+ "2 41 16\r",
+ "2 41 17\r",
+ "2 41 18\r",
+ "2 41 19\r",
+ "2 41 20\r",
+ "2 41 21\r",
+ "2 41 22\r",
+ "2 41 23\r",
+ "2 41 24\r",
+ "2 41 25\r",
+ "2 41 26\r",
+ "2 41 27\r",
+ "2 41 28\r",
+ "2 41 29\r",
+ "2 41 30\r",
+ "2 41 31\r",
+ "2 41 32\r",
+ "2 41 33\r",
+ "2 41 34\r",
+ "2 41 35\r",
+ "2 41 36\r",
+ "2 41 37\r",
+ "2 41 38\r",
+ "2 41 39\r",
+ "2 41 40\r",
+ "2 41 41\r",
+ "2 41 42\r",
+ "2 41 43\r",
+ "2 41 44\r",
+ "2 41 45\r",
+ "2 41 46\r",
+ "2 41 47\r",
+ "2 41 48\r",
+ "2 41 49\r",
+ "2 41 50\r",
+ "2 41 51\r",
+ "2 41 52\r",
+ "2 41 53\r",
+ "2 41 54\r",
+ "2 41 55\r",
+ "2 41 56\r",
+ "2 41 57\r",
+ "2 41 58\r",
+ "2 42 1\r",
+ "2 42 2\r",
+ "2 42 3\r",
+ "2 42 4\r",
+ "2 42 5\r",
+ "2 42 6\r",
+ "2 42 7\r",
+ "2 42 8\r",
+ "2 42 9\r",
+ "2 42 10\r",
+ "2 42 11\r",
+ "2 42 12\r",
+ "2 42 13\r",
+ "2 42 14\r",
+ "2 42 15\r",
+ "2 42 16\r",
+ "2 42 17\r",
+ "2 42 18\r",
+ "2 42 19\r",
+ "2 42 20\r",
+ "2 42 21\r",
+ "2 42 22\r",
+ "2 42 23\r",
+ "2 42 24\r",
+ "2 42 25\r",
+ "2 42 26\r",
+ "2 42 27\r",
+ "2 42 28\r",
+ "2 42 29\r",
+ "2 42 30\r",
+ "2 42 31\r",
+ "2 42 32\r",
+ "2 42 33\r",
+ "2 42 34\r",
+ "2 42 35\r",
+ "2 42 36\r",
+ "2 42 37\r",
+ "2 42 38\r",
+ "2 42 39\r",
+ "2 42 40\r",
+ "2 42 41\r",
+ "2 42 42\r",
+ "2 42 43\r",
+ "2 42 44\r",
+ "2 42 45\r",
+ "2 42 46\r",
+ "2 42 47\r",
+ "2 42 48\r",
+ "2 42 49\r",
+ "2 42 50\r",
+ "2 42 51\r",
+ "2 42 52\r",
+ "2 42 53\r",
+ "2 42 54\r",
+ "2 42 55\r",
+ "2 42 56\r",
+ "2 42 57\r",
+ "2 42 58\r",
+ "2 43 1\r",
+ "2 43 2\r",
+ "2 43 3\r",
+ "2 43 4\r",
+ "2 43 5\r",
+ "2 43 6\r",
+ "2 43 7\r",
+ "2 43 8\r",
+ "2 43 9\r",
+ "2 43 10\r",
+ "2 43 11\r",
+ "2 43 12\r",
+ "2 43 13\r",
+ "2 43 14\r",
+ "2 43 15\r",
+ "2 43 16\r",
+ "2 43 17\r",
+ "2 43 18\r",
+ "2 43 19\r",
+ "2 43 20\r",
+ "2 43 21\r",
+ "2 43 22\r",
+ "2 43 23\r",
+ "2 43 24\r",
+ "2 43 25\r",
+ "2 43 26\r",
+ "2 43 27\r",
+ "2 43 28\r",
+ "2 43 29\r",
+ "2 43 30\r",
+ "2 43 31\r",
+ "2 43 32\r",
+ "2 43 33\r",
+ "2 43 34\r",
+ "2 43 35\r",
+ "2 43 36\r",
+ "2 43 37\r",
+ "2 43 38\r",
+ "2 43 39\r",
+ "2 43 40\r",
+ "2 43 41\r",
+ "2 43 42\r",
+ "2 43 43\r",
+ "2 43 44\r",
+ "2 43 45\r",
+ "2 43 46\r",
+ "2 43 47\r",
+ "2 43 48\r",
+ "2 43 49\r",
+ "2 43 50\r",
+ "2 43 51\r",
+ "2 43 52\r",
+ "2 43 53\r",
+ "2 43 54\r",
+ "2 43 55\r",
+ "2 43 56\r",
+ "2 43 57\r",
+ "2 43 58\r",
+ "2 44 1\r",
+ "2 44 2\r",
+ "2 44 3\r",
+ "2 44 4\r",
+ "2 44 5\r",
+ "2 44 6\r",
+ "2 44 7\r",
+ "2 44 8\r",
+ "2 44 9\r",
+ "2 44 10\r",
+ "2 44 11\r",
+ "2 44 12\r",
+ "2 44 13\r",
+ "2 44 14\r",
+ "2 44 15\r",
+ "2 44 16\r",
+ "2 44 17\r",
+ "2 44 18\r",
+ "2 44 19\r",
+ "2 44 20\r",
+ "2 44 21\r",
+ "2 44 22\r",
+ "2 44 23\r",
+ "2 44 24\r",
+ "2 44 25\r",
+ "2 44 26\r",
+ "2 44 27\r",
+ "2 44 28\r",
+ "2 44 29\r",
+ "2 44 30\r",
+ "2 44 31\r",
+ "2 44 32\r",
+ "2 44 33\r",
+ "2 44 34\r",
+ "2 44 35\r",
+ "2 44 36\r",
+ "2 44 37\r",
+ "2 44 38\r",
+ "2 44 39\r",
+ "2 44 40\r",
+ "2 44 41\r",
+ "2 44 42\r",
+ "2 44 43\r",
+ "2 44 44\r",
+ "2 44 45\r",
+ "2 44 46\r",
+ "2 44 47\r",
+ "2 44 48\r",
+ "2 44 49\r",
+ "2 44 50\r",
+ "2 44 51\r",
+ "2 44 52\r",
+ "2 44 53\r",
+ "2 44 54\r",
+ "2 44 55\r",
+ "2 44 56\r",
+ "2 44 57\r",
+ "2 44 58\r",
+ "2 45 1\r",
+ "2 45 2\r",
+ "2 45 3\r",
+ "2 45 4\r",
+ "2 45 5\r",
+ "2 45 6\r",
+ "2 45 7\r",
+ "2 45 8\r",
+ "2 45 9\r",
+ "2 45 10\r",
+ "2 45 11\r",
+ "2 45 12\r",
+ "2 45 13\r",
+ "2 45 14\r",
+ "2 45 15\r",
+ "2 45 16\r",
+ "2 45 17\r",
+ "2 45 18\r",
+ "2 45 19\r",
+ "2 45 20\r",
+ "2 45 21\r",
+ "2 45 22\r",
+ "2 45 23\r",
+ "2 45 24\r",
+ "2 45 25\r",
+ "2 45 26\r",
+ "2 45 27\r",
+ "2 45 28\r",
+ "2 45 29\r",
+ "2 45 30\r",
+ "2 45 31\r",
+ "2 45 32\r",
+ "2 45 33\r",
+ "2 45 34\r",
+ "2 45 35\r",
+ "2 45 36\r",
+ "2 45 37\r",
+ "2 45 38\r",
+ "2 45 39\r",
+ "2 45 40\r",
+ "2 45 41\r",
+ "2 45 42\r",
+ "2 45 43\r",
+ "2 45 44\r",
+ "2 45 45\r",
+ "2 45 46\r",
+ "2 45 47\r",
+ "2 45 48\r",
+ "2 45 49\r",
+ "2 45 50\r",
+ "2 45 51\r",
+ "2 45 52\r",
+ "2 45 53\r",
+ "2 45 54\r",
+ "2 45 55\r",
+ "2 45 56\r",
+ "2 45 57\r",
+ "2 45 58\r",
+ "2 46 1\r",
+ "2 46 2\r",
+ "2 46 3\r",
+ "2 46 4\r",
+ "2 46 5\r",
+ "2 46 6\r",
+ "2 46 7\r",
+ "2 46 8\r",
+ "2 46 9\r",
+ "2 46 10\r",
+ "2 46 11\r",
+ "2 46 12\r",
+ "2 46 13\r",
+ "2 46 14\r",
+ "2 46 15\r",
+ "2 46 16\r",
+ "2 46 17\r",
+ "2 46 18\r",
+ "2 46 19\r",
+ "2 46 20\r",
+ "2 46 21\r",
+ "2 46 22\r",
+ "2 46 23\r",
+ "2 46 24\r",
+ "2 46 25\r",
+ "2 46 26\r",
+ "2 46 27\r",
+ "2 46 28\r",
+ "2 46 29\r",
+ "2 46 30\r",
+ "2 46 31\r",
+ "2 46 32\r",
+ "2 46 33\r",
+ "2 46 34\r",
+ "2 46 35\r",
+ "2 46 36\r",
+ "2 46 37\r",
+ "2 46 38\r",
+ "2 46 39\r",
+ "2 46 40\r",
+ "2 46 41\r",
+ "2 46 42\r",
+ "2 46 43\r",
+ "2 46 44\r",
+ "2 46 45\r",
+ "2 46 46\r",
+ "2 46 47\r",
+ "2 46 48\r",
+ "2 46 49\r",
+ "2 46 50\r",
+ "2 46 51\r",
+ "2 46 52\r",
+ "2 46 53\r",
+ "2 46 54\r",
+ "2 46 55\r",
+ "2 46 56\r",
+ "2 46 57\r",
+ "2 46 58\r",
+ "2 47 1\r",
+ "2 47 2\r",
+ "2 47 3\r",
+ "2 47 4\r",
+ "2 47 5\r",
+ "2 47 6\r",
+ "2 47 7\r",
+ "2 47 8\r",
+ "2 47 9\r",
+ "2 47 10\r",
+ "2 47 11\r",
+ "2 47 12\r",
+ "2 47 13\r",
+ "2 47 14\r",
+ "2 47 15\r",
+ "2 47 16\r",
+ "2 47 17\r",
+ "2 47 18\r",
+ "2 47 19\r",
+ "2 47 20\r",
+ "2 47 21\r",
+ "2 47 22\r",
+ "2 47 23\r",
+ "2 47 24\r",
+ "2 47 25\r",
+ "2 47 26\r",
+ "2 47 27\r",
+ "2 47 28\r",
+ "2 47 29\r",
+ "2 47 30\r",
+ "2 47 31\r",
+ "2 47 32\r",
+ "2 47 33\r",
+ "2 47 34\r",
+ "2 47 35\r",
+ "2 47 36\r",
+ "2 47 37\r",
+ "2 47 38\r",
+ "2 47 39\r",
+ "2 47 40\r",
+ "2 47 41\r",
+ "2 47 42\r",
+ "2 47 43\r",
+ "2 47 44\r",
+ "2 47 45\r",
+ "2 47 46\r",
+ "2 47 47\r",
+ "2 47 48\r",
+ "2 47 49\r",
+ "2 47 50\r",
+ "2 47 51\r",
+ "2 47 52\r",
+ "2 47 53\r",
+ "2 47 54\r",
+ "2 47 55\r",
+ "2 47 56\r",
+ "2 47 57\r",
+ "2 47 58\r",
+ "2 48 1\r",
+ "2 48 2\r",
+ "2 48 3\r",
+ "2 48 4\r",
+ "2 48 5\r",
+ "2 48 6\r",
+ "2 48 7\r",
+ "2 48 8\r",
+ "2 48 9\r",
+ "2 48 10\r",
+ "2 48 11\r",
+ "2 48 12\r",
+ "2 48 13\r",
+ "2 48 14\r",
+ "2 48 15\r",
+ "2 48 16\r",
+ "2 48 17\r",
+ "2 48 18\r",
+ "2 48 19\r",
+ "2 48 20\r",
+ "2 48 21\r",
+ "2 48 22\r",
+ "2 48 23\r",
+ "2 48 24\r",
+ "2 48 25\r",
+ "2 48 26\r",
+ "2 48 27\r",
+ "2 48 28\r",
+ "2 48 29\r",
+ "2 48 30\r",
+ "2 48 31\r",
+ "2 48 32\r",
+ "2 48 33\r",
+ "2 48 34\r",
+ "2 48 35\r",
+ "2 48 36\r",
+ "2 48 37\r",
+ "2 48 38\r",
+ "2 48 39\r",
+ "2 48 40\r",
+ "2 48 41\r",
+ "2 48 42\r",
+ "2 48 43\r",
+ "2 48 44\r",
+ "2 48 45\r",
+ "2 48 46\r",
+ "2 48 47\r",
+ "2 48 48\r",
+ "2 48 49\r",
+ "2 48 50\r",
+ "2 48 51\r",
+ "2 48 52\r",
+ "2 48 53\r",
+ "2 48 54\r",
+ "2 48 55\r",
+ "2 48 56\r",
+ "2 48 57\r",
+ "2 48 58\r",
+ "2 49 1\r",
+ "2 49 2\r",
+ "2 49 3\r",
+ "2 49 4\r",
+ "2 49 5\r",
+ "2 49 6\r",
+ "2 49 7\r",
+ "2 49 8\r",
+ "2 49 9\r",
+ "2 49 10\r",
+ "2 49 11\r",
+ "2 49 12\r",
+ "2 49 13\r",
+ "2 49 14\r",
+ "2 49 15\r",
+ "2 49 16\r",
+ "2 49 17\r",
+ "2 49 18\r",
+ "2 49 19\r",
+ "2 49 20\r",
+ "2 49 21\r",
+ "2 49 22\r",
+ "2 49 23\r",
+ "2 49 24\r",
+ "2 49 25\r",
+ "2 49 26\r",
+ "2 49 27\r",
+ "2 49 28\r",
+ "2 49 29\r",
+ "2 49 30\r",
+ "2 49 31\r",
+ "2 49 32\r",
+ "2 49 33\r",
+ "2 49 34\r",
+ "2 49 35\r",
+ "2 49 36\r",
+ "2 49 37\r",
+ "2 49 38\r",
+ "2 49 39\r",
+ "2 49 40\r",
+ "2 49 41\r",
+ "2 49 42\r",
+ "2 49 43\r",
+ "2 49 44\r",
+ "2 49 45\r",
+ "2 49 46\r",
+ "2 49 47\r",
+ "2 49 48\r",
+ "2 49 49\r",
+ "2 49 50\r",
+ "2 49 51\r",
+ "2 49 52\r",
+ "2 49 53\r",
+ "2 49 54\r",
+ "2 49 55\r",
+ "2 49 56\r",
+ "2 49 57\r",
+ "2 49 58\r",
+ "2 50 1\r",
+ "2 50 2\r",
+ "2 50 3\r",
+ "2 50 4\r",
+ "2 50 5\r",
+ "2 50 6\r",
+ "2 50 7\r",
+ "2 50 8\r",
+ "2 50 9\r",
+ "2 50 10\r",
+ "2 50 11\r",
+ "2 50 12\r",
+ "2 50 13\r",
+ "2 50 14\r",
+ "2 50 15\r",
+ "2 50 16\r",
+ "2 50 17\r",
+ "2 50 18\r",
+ "2 50 19\r",
+ "2 50 20\r",
+ "2 50 21\r",
+ "2 50 22\r",
+ "2 50 23\r",
+ "2 50 24\r",
+ "2 50 25\r",
+ "2 50 26\r",
+ "2 50 27\r",
+ "2 50 28\r",
+ "2 50 29\r",
+ "2 50 30\r",
+ "2 50 31\r",
+ "2 50 32\r",
+ "2 50 33\r",
+ "2 50 34\r",
+ "2 50 35\r",
+ "2 50 36\r",
+ "2 50 37\r",
+ "2 50 38\r",
+ "2 50 39\r",
+ "2 50 40\r",
+ "2 50 41\r",
+ "2 50 42\r",
+ "2 50 43\r",
+ "2 50 44\r",
+ "2 50 45\r",
+ "2 50 46\r",
+ "2 50 47\r",
+ "2 50 48\r",
+ "2 50 49\r",
+ "2 50 50\r",
+ "2 50 51\r",
+ "2 50 52\r",
+ "2 50 53\r",
+ "2 50 54\r",
+ "2 50 55\r",
+ "2 50 56\r",
+ "2 50 57\r",
+ "2 50 58\r",
+ "2 51 1\r",
+ "2 51 2\r",
+ "2 51 3\r",
+ "2 51 4\r",
+ "2 51 5\r",
+ "2 51 6\r",
+ "2 51 7\r",
+ "2 51 8\r",
+ "2 51 9\r",
+ "2 51 10\r",
+ "2 51 11\r",
+ "2 51 12\r",
+ "2 51 13\r",
+ "2 51 14\r",
+ "2 51 15\r",
+ "2 51 16\r",
+ "2 51 17\r",
+ "2 51 18\r",
+ "2 51 19\r",
+ "2 51 20\r",
+ "2 51 21\r",
+ "2 51 22\r",
+ "2 51 23\r",
+ "2 51 24\r",
+ "2 51 25\r",
+ "2 51 26\r",
+ "2 51 27\r",
+ "2 51 28\r",
+ "2 51 29\r",
+ "2 51 30\r",
+ "2 51 31\r",
+ "2 51 32\r",
+ "2 51 33\r",
+ "2 51 34\r",
+ "2 51 35\r",
+ "2 51 36\r",
+ "2 51 37\r",
+ "2 51 38\r",
+ "2 51 39\r",
+ "2 51 40\r",
+ "2 51 41\r",
+ "2 51 42\r",
+ "2 51 43\r",
+ "2 51 44\r",
+ "2 51 45\r",
+ "2 51 46\r",
+ "2 51 47\r",
+ "2 51 48\r",
+ "2 51 49\r",
+ "2 51 50\r",
+ "2 51 51\r",
+ "2 51 52\r",
+ "2 51 53\r",
+ "2 51 54\r",
+ "2 51 55\r",
+ "2 51 56\r",
+ "2 51 57\r",
+ "2 51 58\r",
+ "2 52 1\r",
+ "2 52 2\r",
+ "2 52 3\r",
+ "2 52 4\r",
+ "2 52 5\r",
+ "2 52 6\r",
+ "2 52 7\r",
+ "2 52 8\r",
+ "2 52 9\r",
+ "2 52 10\r",
+ "2 52 11\r",
+ "2 52 12\r",
+ "2 52 13\r",
+ "2 52 14\r",
+ "2 52 15\r",
+ "2 52 16\r",
+ "2 52 17\r",
+ "2 52 18\r",
+ "2 52 19\r",
+ "2 52 20\r",
+ "2 52 21\r",
+ "2 52 22\r",
+ "2 52 23\r",
+ "2 52 24\r",
+ "2 52 25\r",
+ "2 52 26\r",
+ "2 52 27\r",
+ "2 52 28\r",
+ "2 52 29\r",
+ "2 52 30\r",
+ "2 52 31\r",
+ "2 52 32\r",
+ "2 52 33\r",
+ "2 52 34\r",
+ "2 52 35\r",
+ "2 52 36\r",
+ "2 52 37\r",
+ "2 52 38\r",
+ "2 52 39\r",
+ "2 52 40\r",
+ "2 52 41\r",
+ "2 52 42\r",
+ "2 52 43\r",
+ "2 52 44\r",
+ "2 52 45\r",
+ "2 52 46\r",
+ "2 52 47\r",
+ "2 52 48\r",
+ "2 52 49\r",
+ "2 52 50\r",
+ "2 52 51\r",
+ "2 52 52\r",
+ "2 52 53\r",
+ "2 52 54\r",
+ "2 52 55\r",
+ "2 52 56\r",
+ "2 52 57\r",
+ "2 52 58\r",
+ "2 53 1\r",
+ "2 53 2\r",
+ "2 53 3\r",
+ "2 53 4\r",
+ "2 53 5\r",
+ "2 53 6\r",
+ "2 53 7\r",
+ "2 53 8\r",
+ "2 53 9\r",
+ "2 53 10\r",
+ "2 53 11\r",
+ "2 53 12\r",
+ "2 53 13\r",
+ "2 53 14\r",
+ "2 53 15\r",
+ "2 53 16\r",
+ "2 53 17\r",
+ "2 53 18\r",
+ "2 53 19\r",
+ "2 53 20\r",
+ "2 53 21\r",
+ "2 53 22\r",
+ "2 53 23\r",
+ "2 53 24\r",
+ "2 53 25\r",
+ "2 53 26\r",
+ "2 53 27\r",
+ "2 53 28\r",
+ "2 53 29\r",
+ "2 53 30\r",
+ "2 53 31\r",
+ "2 53 32\r",
+ "2 53 33\r",
+ "2 53 34\r",
+ "2 53 35\r",
+ "2 53 36\r",
+ "2 53 37\r",
+ "2 53 38\r",
+ "2 53 39\r",
+ "2 53 40\r",
+ "2 53 41\r",
+ "2 53 42\r",
+ "2 53 43\r",
+ "2 53 44\r",
+ "2 53 45\r",
+ "2 53 46\r",
+ "2 53 47\r",
+ "2 53 48\r",
+ "2 53 49\r",
+ "2 53 50\r",
+ "2 53 51\r",
+ "2 53 52\r",
+ "2 53 53\r",
+ "2 53 54\r",
+ "2 53 55\r",
+ "2 53 56\r",
+ "2 53 57\r",
+ "2 53 58\r",
+ "2 54 1\r",
+ "2 54 2\r",
+ "2 54 3\r",
+ "2 54 4\r",
+ "2 54 5\r",
+ "2 54 6\r",
+ "2 54 7\r",
+ "2 54 8\r",
+ "2 54 9\r",
+ "2 54 10\r",
+ "2 54 11\r",
+ "2 54 12\r",
+ "2 54 13\r",
+ "2 54 14\r",
+ "2 54 15\r",
+ "2 54 16\r",
+ "2 54 17\r",
+ "2 54 18\r",
+ "2 54 19\r",
+ "2 54 20\r",
+ "2 54 21\r",
+ "2 54 22\r",
+ "2 54 23\r",
+ "2 54 24\r",
+ "2 54 25\r",
+ "2 54 26\r",
+ "2 54 27\r",
+ "2 54 28\r",
+ "2 54 29\r",
+ "2 54 30\r",
+ "2 54 31\r",
+ "2 54 32\r",
+ "2 54 33\r",
+ "2 54 34\r",
+ "2 54 35\r",
+ "2 54 36\r",
+ "2 54 37\r",
+ "2 54 38\r",
+ "2 54 39\r",
+ "2 54 40\r",
+ "2 54 41\r",
+ "2 54 42\r",
+ "2 54 43\r",
+ "2 54 44\r",
+ "2 54 45\r",
+ "2 54 46\r",
+ "2 54 47\r",
+ "2 54 48\r",
+ "2 54 49\r",
+ "2 54 50\r",
+ "2 54 51\r",
+ "2 54 52\r",
+ "2 54 53\r",
+ "2 54 54\r",
+ "2 54 55\r",
+ "2 54 56\r",
+ "2 54 57\r",
+ "2 54 58\r",
+ "2 55 1\r",
+ "2 55 2\r",
+ "2 55 3\r",
+ "2 55 4\r",
+ "2 55 5\r",
+ "2 55 6\r",
+ "2 55 7\r",
+ "2 55 8\r",
+ "2 55 9\r",
+ "2 55 10\r",
+ "2 55 11\r",
+ "2 55 12\r",
+ "2 55 13\r",
+ "2 55 14\r",
+ "2 55 15\r",
+ "2 55 16\r",
+ "2 55 17\r",
+ "2 55 18\r",
+ "2 55 19\r",
+ "2 55 20\r",
+ "2 55 21\r",
+ "2 55 22\r",
+ "2 55 23\r",
+ "2 55 24\r",
+ "2 55 25\r",
+ "2 55 26\r",
+ "2 55 27\r",
+ "2 55 28\r",
+ "2 55 29\r",
+ "2 55 30\r",
+ "2 55 31\r",
+ "2 55 32\r",
+ "2 55 33\r",
+ "2 55 34\r",
+ "2 55 35\r",
+ "2 55 36\r",
+ "2 55 37\r",
+ "2 55 38\r",
+ "2 55 39\r",
+ "2 55 40\r",
+ "2 55 41\r",
+ "2 55 42\r",
+ "2 55 43\r",
+ "2 55 44\r",
+ "2 55 45\r",
+ "2 55 46\r",
+ "2 55 47\r",
+ "2 55 48\r",
+ "2 55 49\r",
+ "2 55 50\r",
+ "2 55 51\r",
+ "2 55 52\r",
+ "2 55 53\r",
+ "2 55 54\r",
+ "2 55 55\r",
+ "2 55 56\r",
+ "2 55 57\r",
+ "2 55 58\r",
+ "2 56 1\r",
+ "2 56 2\r",
+ "2 56 3\r",
+ "2 56 4\r",
+ "2 56 5\r",
+ "2 56 6\r",
+ "2 56 7\r",
+ "2 56 8\r",
+ "2 56 9\r",
+ "2 56 10\r",
+ "2 56 11\r",
+ "2 56 12\r",
+ "2 56 13\r",
+ "2 56 14\r",
+ "2 56 15\r",
+ "2 56 16\r",
+ "2 56 17\r",
+ "2 56 18\r",
+ "2 56 19\r",
+ "2 56 20\r",
+ "2 56 21\r",
+ "2 56 22\r",
+ "2 56 23\r",
+ "2 56 24\r",
+ "2 56 25\r",
+ "2 56 26\r",
+ "2 56 27\r",
+ "2 56 28\r",
+ "2 56 29\r",
+ "2 56 30\r",
+ "2 56 31\r",
+ "2 56 32\r",
+ "2 56 33\r",
+ "2 56 34\r",
+ "2 56 35\r",
+ "2 56 36\r",
+ "2 56 37\r",
+ "2 56 38\r",
+ "2 56 39\r",
+ "2 56 40\r",
+ "2 56 41\r",
+ "2 56 42\r",
+ "2 56 43\r",
+ "2 56 44\r",
+ "2 56 45\r",
+ "2 56 46\r",
+ "2 56 47\r",
+ "2 56 48\r",
+ "2 56 49\r",
+ "2 56 50\r",
+ "2 56 51\r",
+ "2 56 52\r",
+ "2 56 53\r",
+ "2 56 54\r",
+ "2 56 55\r",
+ "2 56 56\r",
+ "2 56 57\r",
+ "2 56 58\r",
+ "2 57 1\r",
+ "2 57 2\r",
+ "2 57 3\r",
+ "2 57 4\r",
+ "2 57 5\r",
+ "2 57 6\r",
+ "2 57 7\r",
+ "2 57 8\r",
+ "2 57 9\r",
+ "2 57 10\r",
+ "2 57 11\r",
+ "2 57 12\r",
+ "2 57 13\r",
+ "2 57 14\r",
+ "2 57 15\r",
+ "2 57 16\r",
+ "2 57 17\r",
+ "2 57 18\r",
+ "2 57 19\r",
+ "2 57 20\r",
+ "2 57 21\r",
+ "2 57 22\r",
+ "2 57 23\r",
+ "2 57 24\r",
+ "2 57 25\r",
+ "2 57 26\r",
+ "2 57 27\r",
+ "2 57 28\r",
+ "2 57 29\r",
+ "2 57 30\r",
+ "2 57 31\r",
+ "2 57 32\r",
+ "2 57 33\r",
+ "2 57 34\r",
+ "2 57 35\r",
+ "2 57 36\r",
+ "2 57 37\r",
+ "2 57 38\r",
+ "2 57 39\r",
+ "2 57 40\r",
+ "2 57 41\r",
+ "2 57 42\r",
+ "2 57 43\r",
+ "2 57 44\r",
+ "2 57 45\r",
+ "2 57 46\r",
+ "2 57 47\r",
+ "2 57 48\r",
+ "2 57 49\r",
+ "2 57 50\r",
+ "2 57 51\r",
+ "2 57 52\r",
+ "2 57 53\r",
+ "2 57 54\r",
+ "2 57 55\r",
+ "2 57 56\r",
+ "2 57 57\r",
+ "2 57 58\r",
+ "2 58 1\r",
+ "2 58 2\r",
+ "2 58 3\r",
+ "2 58 4\r",
+ "2 58 5\r",
+ "2 58 6\r",
+ "2 58 7\r",
+ "2 58 8\r",
+ "2 58 9\r",
+ "2 58 10\r",
+ "2 58 11\r",
+ "2 58 12\r",
+ "2 58 13\r",
+ "2 58 14\r",
+ "2 58 15\r",
+ "2 58 16\r",
+ "2 58 17\r",
+ "2 58 18\r",
+ "2 58 19\r",
+ "2 58 20\r",
+ "2 58 21\r",
+ "2 58 22\r",
+ "2 58 23\r",
+ "2 58 24\r",
+ "2 58 25\r",
+ "2 58 26\r",
+ "2 58 27\r",
+ "2 58 28\r",
+ "2 58 29\r",
+ "2 58 30\r",
+ "2 58 31\r",
+ "2 58 32\r",
+ "2 58 33\r",
+ "2 58 34\r",
+ "2 58 35\r",
+ "2 58 36\r",
+ "2 58 37\r",
+ "2 58 38\r",
+ "2 58 39\r",
+ "2 58 40\r",
+ "2 58 41\r",
+ "2 58 42\r",
+ "2 58 43\r",
+ "2 58 44\r",
+ "2 58 45\r",
+ "2 58 46\r",
+ "2 58 47\r",
+ "2 58 48\r",
+ "2 58 49\r",
+ "2 58 50\r",
+ "2 58 51\r",
+ "2 58 52\r",
+ "2 58 53\r",
+ "2 58 54\r",
+ "2 58 55\r",
+ "2 58 56\r",
+ "2 58 57\r",
+ "2 58 58\r",
+ "3 1 1\r",
+ "3 1 2\r",
+ "3 1 3\r",
+ "3 1 4\r",
+ "3 1 5\r",
+ "3 1 6\r",
+ "3 1 7\r",
+ "3 1 8\r",
+ "3 1 9\r",
+ "3 1 10\r",
+ "3 1 11\r",
+ "3 1 12\r",
+ "3 1 13\r",
+ "3 1 14\r",
+ "3 1 15\r",
+ "3 1 16\r",
+ "3 1 17\r",
+ "3 1 18\r",
+ "3 1 19\r",
+ "3 1 20\r",
+ "3 1 21\r",
+ "3 1 22\r",
+ "3 1 23\r",
+ "3 1 24\r",
+ "3 1 25\r",
+ "3 1 26\r",
+ "3 1 27\r",
+ "3 1 28\r",
+ "3 1 29\r",
+ "3 1 30\r",
+ "3 1 31\r",
+ "3 1 32\r",
+ "3 1 33\r",
+ "3 1 34\r",
+ "3 1 35\r",
+ "3 1 36\r",
+ "3 1 37\r",
+ "3 1 38\r",
+ "3 1 39\r",
+ "3 1 40\r",
+ "3 1 41\r",
+ "3 1 42\r",
+ "3 1 43\r",
+ "3 1 44\r",
+ "3 1 45\r",
+ "3 1 46\r",
+ "3 1 47\r",
+ "3 1 48\r",
+ "3 1 49\r",
+ "3 1 50\r",
+ "3 1 51\r",
+ "3 1 52\r",
+ "3 1 53\r",
+ "3 1 54\r",
+ "3 1 55\r",
+ "3 1 56\r",
+ "3 1 57\r",
+ "3 1 58\r",
+ "3 2 1\r",
+ "3 2 2\r",
+ "3 2 3\r",
+ "3 2 4\r",
+ "3 2 5\r",
+ "3 2 6\r",
+ "3 2 7\r",
+ "3 2 8\r",
+ "3 2 9\r",
+ "3 2 10\r",
+ "3 2 11\r",
+ "3 2 12\r",
+ "3 2 13\r",
+ "3 2 14\r",
+ "3 2 15\r",
+ "3 2 16\r",
+ "3 2 17\r",
+ "3 2 18\r",
+ "3 2 19\r",
+ "3 2 20\r",
+ "3 2 21\r",
+ "3 2 22\r",
+ "3 2 23\r",
+ "3 2 24\r",
+ "3 2 25\r",
+ "3 2 26\r",
+ "3 2 27\r",
+ "3 2 28\r",
+ "3 2 29\r",
+ "3 2 30\r",
+ "3 2 31\r",
+ "3 2 32\r",
+ "3 2 33\r",
+ "3 2 34\r",
+ "3 2 35\r",
+ "3 2 36\r",
+ "3 2 37\r",
+ "3 2 38\r",
+ "3 2 39\r",
+ "3 2 40\r",
+ "3 2 41\r",
+ "3 2 42\r",
+ "3 2 43\r",
+ "3 2 44\r",
+ "3 2 45\r",
+ "3 2 46\r",
+ "3 2 47\r",
+ "3 2 48\r",
+ "3 2 49\r",
+ "3 2 50\r",
+ "3 2 51\r",
+ "3 2 52\r",
+ "3 2 53\r",
+ "3 2 54\r",
+ "3 2 55\r",
+ "3 2 56\r",
+ "3 2 57\r",
+ "3 2 58\r",
+ "3 3 1\r",
+ "3 3 2\r",
+ "3 3 3\r",
+ "3 3 4\r",
+ "3 3 5\r",
+ "3 3 6\r",
+ "3 3 7\r",
+ "3 3 8\r",
+ "3 3 9\r",
+ "3 3 10\r",
+ "3 3 11\r",
+ "3 3 12\r",
+ "3 3 13\r",
+ "3 3 14\r",
+ "3 3 15\r",
+ "3 3 16\r",
+ "3 3 17\r",
+ "3 3 18\r",
+ "3 3 19\r",
+ "3 3 20\r",
+ "3 3 21\r",
+ "3 3 22\r",
+ "3 3 23\r",
+ "3 3 24\r",
+ "3 3 25\r",
+ "3 3 26\r",
+ "3 3 27\r",
+ "3 3 28\r",
+ "3 3 29\r",
+ "3 3 30\r",
+ "3 3 31\r",
+ "3 3 32\r",
+ "3 3 33\r",
+ "3 3 34\r",
+ "3 3 35\r",
+ "3 3 36\r",
+ "3 3 37\r",
+ "3 3 38\r",
+ "3 3 39\r",
+ "3 3 40\r",
+ "3 3 41\r",
+ "3 3 42\r",
+ "3 3 43\r",
+ "3 3 44\r",
+ "3 3 45\r",
+ "3 3 46\r",
+ "3 3 47\r",
+ "3 3 48\r",
+ "3 3 49\r",
+ "3 3 50\r",
+ "3 3 51\r",
+ "3 3 52\r",
+ "3 3 53\r",
+ "3 3 54\r",
+ "3 3 55\r",
+ "3 3 56\r",
+ "3 3 57\r",
+ "3 3 58\r",
+ "3 4 1\r",
+ "3 4 2\r",
+ "3 4 3\r",
+ "3 4 4\r",
+ "3 4 5\r",
+ "3 4 6\r",
+ "3 4 7\r",
+ "3 4 8\r",
+ "3 4 9\r",
+ "3 4 10\r",
+ "3 4 11\r",
+ "3 4 12\r",
+ "3 4 13\r",
+ "3 4 14\r",
+ "3 4 15\r",
+ "3 4 16\r",
+ "3 4 17\r",
+ "3 4 18\r",
+ "3 4 19\r",
+ "3 4 20\r",
+ "3 4 21\r",
+ "3 4 22\r",
+ "3 4 23\r",
+ "3 4 24\r",
+ "3 4 25\r",
+ "3 4 26\r",
+ "3 4 27\r",
+ "3 4 28\r",
+ "3 4 29\r",
+ "3 4 30\r",
+ "3 4 31\r",
+ "3 4 32\r",
+ "3 4 33\r",
+ "3 4 34\r",
+ "3 4 35\r",
+ "3 4 36\r",
+ "3 4 37\r",
+ "3 4 38\r",
+ "3 4 39\r",
+ "3 4 40\r",
+ "3 4 41\r",
+ "3 4 42\r",
+ "3 4 43\r",
+ "3 4 44\r",
+ "3 4 45\r",
+ "3 4 46\r",
+ "3 4 47\r",
+ "3 4 48\r",
+ "3 4 49\r",
+ "3 4 50\r",
+ "3 4 51\r",
+ "3 4 52\r",
+ "3 4 53\r",
+ "3 4 54\r",
+ "3 4 55\r",
+ "3 4 56\r",
+ "3 4 57\r",
+ "3 4 58\r",
+ "3 5 1\r",
+ "3 5 2\r",
+ "3 5 3\r",
+ "3 5 4\r",
+ "3 5 5\r",
+ "3 5 6\r",
+ "3 5 7\r",
+ "3 5 8\r",
+ "3 5 9\r",
+ "3 5 10\r",
+ "3 5 11\r",
+ "3 5 12\r",
+ "3 5 13\r",
+ "3 5 14\r",
+ "3 5 15\r",
+ "3 5 16\r",
+ "3 5 17\r",
+ "3 5 18\r",
+ "3 5 19\r",
+ "3 5 20\r",
+ "3 5 21\r",
+ "3 5 22\r",
+ "3 5 23\r",
+ "3 5 24\r",
+ "3 5 25\r",
+ "3 5 26\r",
+ "3 5 27\r",
+ "3 5 28\r",
+ "3 5 29\r",
+ "3 5 30\r",
+ "3 5 31\r",
+ "3 5 32\r",
+ "3 5 33\r",
+ "3 5 34\r",
+ "3 5 35\r",
+ "3 5 36\r",
+ "3 5 37\r",
+ "3 5 38\r",
+ "3 5 39\r",
+ "3 5 40\r",
+ "3 5 41\r",
+ "3 5 42\r",
+ "3 5 43\r",
+ "3 5 44\r",
+ "3 5 45\r",
+ "3 5 46\r",
+ "3 5 47\r",
+ "3 5 48\r",
+ "3 5 49\r",
+ "3 5 50\r",
+ "3 5 51\r",
+ "3 5 52\r",
+ "3 5 53\r",
+ "3 5 54\r",
+ "3 5 55\r",
+ "3 5 56\r",
+ "3 5 57\r",
+ "3 5 58\r",
+ "3 6 1\r",
+ "3 6 2\r",
+ "3 6 3\r",
+ "3 6 4\r",
+ "3 6 5\r",
+ "3 6 6\r",
+ "3 6 7\r",
+ "3 6 8\r",
+ "3 6 9\r",
+ "3 6 10\r",
+ "3 6 11\r",
+ "3 6 12\r",
+ "3 6 13\r",
+ "3 6 14\r",
+ "3 6 15\r",
+ "3 6 16\r",
+ "3 6 17\r",
+ "3 6 18\r",
+ "3 6 19\r",
+ "3 6 20\r",
+ "3 6 21\r",
+ "3 6 22\r",
+ "3 6 23\r",
+ "3 6 24\r",
+ "3 6 25\r",
+ "3 6 26\r",
+ "3 6 27\r",
+ "3 6 28\r",
+ "3 6 29\r",
+ "3 6 30\r",
+ "3 6 31\r",
+ "3 6 32\r",
+ "3 6 33\r",
+ "3 6 34\r",
+ "3 6 35\r",
+ "3 6 36\r",
+ "3 6 37\r",
+ "3 6 38\r",
+ "3 6 39\r",
+ "3 6 40\r",
+ "3 6 41\r",
+ "3 6 42\r",
+ "3 6 43\r",
+ "3 6 44\r",
+ "3 6 45\r",
+ "3 6 46\r",
+ "3 6 47\r",
+ "3 6 48\r",
+ "3 6 49\r",
+ "3 6 50\r",
+ "3 6 51\r",
+ "3 6 52\r",
+ "3 6 53\r",
+ "3 6 54\r",
+ "3 6 55\r",
+ "3 6 56\r",
+ "3 6 57\r",
+ "3 6 58\r",
+ "3 7 1\r",
+ "3 7 2\r",
+ "3 7 3\r",
+ "3 7 4\r",
+ "3 7 5\r",
+ "3 7 6"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "3 7 7\r",
+ "3 7 8\r",
+ "3 7 9\r",
+ "3 7 10\r",
+ "3 7 11\r",
+ "3 7 12\r",
+ "3 7 13\r",
+ "3 7 14\r",
+ "3 7 15\r",
+ "3 7 16\r",
+ "3 7 17\r",
+ "3 7 18\r",
+ "3 7 19\r",
+ "3 7 20\r",
+ "3 7 21\r",
+ "3 7 22\r",
+ "3 7 23\r",
+ "3 7 24\r",
+ "3 7 25\r",
+ "3 7 26\r",
+ "3 7 27\r",
+ "3 7 28\r",
+ "3 7 29\r",
+ "3 7 30\r",
+ "3 7 31\r",
+ "3 7 32\r",
+ "3 7 33\r",
+ "3 7 34\r",
+ "3 7 35\r",
+ "3 7 36\r",
+ "3 7 37\r",
+ "3 7 38\r",
+ "3 7 39\r",
+ "3 7 40\r",
+ "3 7 41\r",
+ "3 7 42\r",
+ "3 7 43\r",
+ "3 7 44\r",
+ "3 7 45\r",
+ "3 7 46\r",
+ "3 7 47\r",
+ "3 7 48\r",
+ "3 7 49\r",
+ "3 7 50\r",
+ "3 7 51\r",
+ "3 7 52\r",
+ "3 7 53\r",
+ "3 7 54\r",
+ "3 7 55\r",
+ "3 7 56\r",
+ "3 7 57\r",
+ "3 7 58\r",
+ "3 8 1\r",
+ "3 8 2\r",
+ "3 8 3\r",
+ "3 8 4\r",
+ "3 8 5\r",
+ "3 8 6\r",
+ "3 8 7\r",
+ "3 8 8\r",
+ "3 8 9\r",
+ "3 8 10\r",
+ "3 8 11\r",
+ "3 8 12\r",
+ "3 8 13\r",
+ "3 8 14\r",
+ "3 8 15\r",
+ "3 8 16\r",
+ "3 8 17\r",
+ "3 8 18\r",
+ "3 8 19\r",
+ "3 8 20\r",
+ "3 8 21\r",
+ "3 8 22\r",
+ "3 8 23\r",
+ "3 8 24\r",
+ "3 8 25\r",
+ "3 8 26\r",
+ "3 8 27\r",
+ "3 8 28\r",
+ "3 8 29\r",
+ "3 8 30\r",
+ "3 8 31\r",
+ "3 8 32\r",
+ "3 8 33\r",
+ "3 8 34\r",
+ "3 8 35\r",
+ "3 8 36\r",
+ "3 8 37\r",
+ "3 8 38\r",
+ "3 8 39\r",
+ "3 8 40\r",
+ "3 8 41\r",
+ "3 8 42\r",
+ "3 8 43\r",
+ "3 8 44\r",
+ "3 8 45\r",
+ "3 8 46\r",
+ "3 8 47\r",
+ "3 8 48\r",
+ "3 8 49\r",
+ "3 8 50\r",
+ "3 8 51\r",
+ "3 8 52\r",
+ "3 8 53\r",
+ "3 8 54\r",
+ "3 8 55\r",
+ "3 8 56\r",
+ "3 8 57\r",
+ "3 8 58\r",
+ "3 9 1\r",
+ "3 9 2\r",
+ "3 9 3\r",
+ "3 9 4\r",
+ "3 9 5\r",
+ "3 9 6\r",
+ "3 9 7\r",
+ "3 9 8\r",
+ "3 9 9\r",
+ "3 9 10\r",
+ "3 9 11\r",
+ "3 9 12\r",
+ "3 9 13\r",
+ "3 9 14\r",
+ "3 9 15\r",
+ "3 9 16\r",
+ "3 9 17\r",
+ "3 9 18\r",
+ "3 9 19\r",
+ "3 9 20\r",
+ "3 9 21\r",
+ "3 9 22\r",
+ "3 9 23\r",
+ "3 9 24\r",
+ "3 9 25\r",
+ "3 9 26\r",
+ "3 9 27\r",
+ "3 9 28\r",
+ "3 9 29\r",
+ "3 9 30\r",
+ "3 9 31\r",
+ "3 9 32\r",
+ "3 9 33\r",
+ "3 9 34\r",
+ "3 9 35\r",
+ "3 9 36\r",
+ "3 9 37\r",
+ "3 9 38\r",
+ "3 9 39\r",
+ "3 9 40\r",
+ "3 9 41\r",
+ "3 9 42\r",
+ "3 9 43\r",
+ "3 9 44\r",
+ "3 9 45\r",
+ "3 9 46\r",
+ "3 9 47\r",
+ "3 9 48\r",
+ "3 9 49\r",
+ "3 9 50\r",
+ "3 9 51\r",
+ "3 9 52\r",
+ "3 9 53\r",
+ "3 9 54\r",
+ "3 9 55\r",
+ "3 9 56\r",
+ "3 9 57\r",
+ "3 9 58\r",
+ "3 10 1\r",
+ "3 10 2\r",
+ "3 10 3\r",
+ "3 10 4\r",
+ "3 10 5\r",
+ "3 10 6\r",
+ "3 10 7\r",
+ "3 10 8\r",
+ "3 10 9\r",
+ "3 10 10\r",
+ "3 10 11\r",
+ "3 10 12\r",
+ "3 10 13\r",
+ "3 10 14\r",
+ "3 10 15\r",
+ "3 10 16\r",
+ "3 10 17\r",
+ "3 10 18\r",
+ "3 10 19\r",
+ "3 10 20\r",
+ "3 10 21\r",
+ "3 10 22\r",
+ "3 10 23\r",
+ "3 10 24\r",
+ "3 10 25\r",
+ "3 10 26\r",
+ "3 10 27\r",
+ "3 10 28\r",
+ "3 10 29\r",
+ "3 10 30\r",
+ "3 10 31\r",
+ "3 10 32\r",
+ "3 10 33\r",
+ "3 10 34\r",
+ "3 10 35\r",
+ "3 10 36\r",
+ "3 10 37\r",
+ "3 10 38\r",
+ "3 10 39\r",
+ "3 10 40\r",
+ "3 10 41\r",
+ "3 10 42\r",
+ "3 10 43\r",
+ "3 10 44\r",
+ "3 10 45\r",
+ "3 10 46\r",
+ "3 10 47\r",
+ "3 10 48\r",
+ "3 10 49\r",
+ "3 10 50\r",
+ "3 10 51\r",
+ "3 10 52\r",
+ "3 10 53\r",
+ "3 10 54\r",
+ "3 10 55\r",
+ "3 10 56\r",
+ "3 10 57\r",
+ "3 10 58\r",
+ "3 11 1\r",
+ "3 11 2\r",
+ "3 11 3\r",
+ "3 11 4\r",
+ "3 11 5\r",
+ "3 11 6\r",
+ "3 11 7\r",
+ "3 11 8\r",
+ "3 11 9\r",
+ "3 11 10\r",
+ "3 11 11\r",
+ "3 11 12\r",
+ "3 11 13\r",
+ "3 11 14\r",
+ "3 11 15\r",
+ "3 11 16\r",
+ "3 11 17\r",
+ "3 11 18\r",
+ "3 11 19\r",
+ "3 11 20\r",
+ "3 11 21\r",
+ "3 11 22\r",
+ "3 11 23\r",
+ "3 11 24\r",
+ "3 11 25\r",
+ "3 11 26\r",
+ "3 11 27\r",
+ "3 11 28\r",
+ "3 11 29\r",
+ "3 11 30\r",
+ "3 11 31\r",
+ "3 11 32\r",
+ "3 11 33\r",
+ "3 11 34\r",
+ "3 11 35\r",
+ "3 11 36\r",
+ "3 11 37\r",
+ "3 11 38\r",
+ "3 11 39\r",
+ "3 11 40\r",
+ "3 11 41\r",
+ "3 11 42\r",
+ "3 11 43\r",
+ "3 11 44\r",
+ "3 11 45\r",
+ "3 11 46\r",
+ "3 11 47\r",
+ "3 11 48\r",
+ "3 11 49\r",
+ "3 11 50\r",
+ "3 11 51\r",
+ "3 11 52\r",
+ "3 11 53\r",
+ "3 11 54\r",
+ "3 11 55\r",
+ "3 11 56\r",
+ "3 11 57\r",
+ "3 11 58\r",
+ "3 12 1\r",
+ "3 12 2\r",
+ "3 12 3\r",
+ "3 12 4\r",
+ "3 12 5\r",
+ "3 12 6\r",
+ "3 12 7\r",
+ "3 12 8\r",
+ "3 12 9\r",
+ "3 12 10\r",
+ "3 12 11\r",
+ "3 12 12\r",
+ "3 12 13\r",
+ "3 12 14\r",
+ "3 12 15\r",
+ "3 12 16\r",
+ "3 12 17\r",
+ "3 12 18\r",
+ "3 12 19\r",
+ "3 12 20\r",
+ "3 12 21\r",
+ "3 12 22\r",
+ "3 12 23\r",
+ "3 12 24\r",
+ "3 12 25\r",
+ "3 12 26\r",
+ "3 12 27\r",
+ "3 12 28\r",
+ "3 12 29\r",
+ "3 12 30\r",
+ "3 12 31\r",
+ "3 12 32\r",
+ "3 12 33\r",
+ "3 12 34\r",
+ "3 12 35\r",
+ "3 12 36\r",
+ "3 12 37\r",
+ "3 12 38\r",
+ "3 12 39\r",
+ "3 12 40\r",
+ "3 12 41\r",
+ "3 12 42\r",
+ "3 12 43\r",
+ "3 12 44\r",
+ "3 12 45\r",
+ "3 12 46\r",
+ "3 12 47\r",
+ "3 12 48\r",
+ "3 12 49\r",
+ "3 12 50\r",
+ "3 12 51\r",
+ "3 12 52\r",
+ "3 12 53\r",
+ "3 12 54\r",
+ "3 12 55\r",
+ "3 12 56\r",
+ "3 12 57\r",
+ "3 12 58\r",
+ "3 13 1\r",
+ "3 13 2\r",
+ "3 13 3\r",
+ "3 13 4\r",
+ "3 13 5\r",
+ "3 13 6\r",
+ "3 13 7\r",
+ "3 13 8\r",
+ "3 13 9\r",
+ "3 13 10\r",
+ "3 13 11\r",
+ "3 13 12\r",
+ "3 13 13\r",
+ "3 13 14\r",
+ "3 13 15\r",
+ "3 13 16\r",
+ "3 13 17\r",
+ "3 13 18\r",
+ "3 13 19\r",
+ "3 13 20\r",
+ "3 13 21\r",
+ "3 13 22\r",
+ "3 13 23\r",
+ "3 13 24\r",
+ "3 13 25\r",
+ "3 13 26\r",
+ "3 13 27\r",
+ "3 13 28\r",
+ "3 13 29\r",
+ "3 13 30\r",
+ "3 13 31\r",
+ "3 13 32\r",
+ "3 13 33\r",
+ "3 13 34\r",
+ "3 13 35\r",
+ "3 13 36\r",
+ "3 13 37\r",
+ "3 13 38\r",
+ "3 13 39\r",
+ "3 13 40\r",
+ "3 13 41\r",
+ "3 13 42\r",
+ "3 13 43\r",
+ "3 13 44\r",
+ "3 13 45\r",
+ "3 13 46\r",
+ "3 13 47\r",
+ "3 13 48\r",
+ "3 13 49\r",
+ "3 13 50\r",
+ "3 13 51\r",
+ "3 13 52\r",
+ "3 13 53\r",
+ "3 13 54\r",
+ "3 13 55\r",
+ "3 13 56\r",
+ "3 13 57\r",
+ "3 13 58\r",
+ "3 14 1\r",
+ "3 14 2\r",
+ "3 14 3\r",
+ "3 14 4\r",
+ "3 14 5\r",
+ "3 14 6\r",
+ "3 14 7\r",
+ "3 14 8\r",
+ "3 14 9\r",
+ "3 14 10\r",
+ "3 14 11\r",
+ "3 14 12\r",
+ "3 14 13\r",
+ "3 14 14\r",
+ "3 14 15\r",
+ "3 14 16\r",
+ "3 14 17\r",
+ "3 14 18\r",
+ "3 14 19\r",
+ "3 14 20\r",
+ "3 14 21\r",
+ "3 14 22\r",
+ "3 14 23\r",
+ "3 14 24\r",
+ "3 14 25\r",
+ "3 14 26\r",
+ "3 14 27\r",
+ "3 14 28\r",
+ "3 14 29\r",
+ "3 14 30\r",
+ "3 14 31\r",
+ "3 14 32\r",
+ "3 14 33\r",
+ "3 14 34\r",
+ "3 14 35\r",
+ "3 14 36\r",
+ "3 14 37\r",
+ "3 14 38\r",
+ "3 14 39\r",
+ "3 14 40\r",
+ "3 14 41\r",
+ "3 14 42\r",
+ "3 14 43\r",
+ "3 14 44\r",
+ "3 14 45\r",
+ "3 14 46\r",
+ "3 14 47\r",
+ "3 14 48\r",
+ "3 14 49\r",
+ "3 14 50\r",
+ "3 14 51\r",
+ "3 14 52\r",
+ "3 14 53\r",
+ "3 14 54\r",
+ "3 14 55\r",
+ "3 14 56\r",
+ "3 14 57\r",
+ "3 14 58\r",
+ "3 15 1\r",
+ "3 15 2\r",
+ "3 15 3\r",
+ "3 15 4\r",
+ "3 15 5\r",
+ "3 15 6\r",
+ "3 15 7\r",
+ "3 15 8\r",
+ "3 15 9\r",
+ "3 15 10\r",
+ "3 15 11\r",
+ "3 15 12\r",
+ "3 15 13\r",
+ "3 15 14\r",
+ "3 15 15\r",
+ "3 15 16\r",
+ "3 15 17\r",
+ "3 15 18\r",
+ "3 15 19\r",
+ "3 15 20\r",
+ "3 15 21\r",
+ "3 15 22\r",
+ "3 15 23\r",
+ "3 15 24\r",
+ "3 15 25\r",
+ "3 15 26\r",
+ "3 15 27\r",
+ "3 15 28\r",
+ "3 15 29\r",
+ "3 15 30\r",
+ "3 15 31\r",
+ "3 15 32\r",
+ "3 15 33\r",
+ "3 15 34\r",
+ "3 15 35\r",
+ "3 15 36\r",
+ "3 15 37\r",
+ "3 15 38\r",
+ "3 15 39\r",
+ "3 15 40\r",
+ "3 15 41\r",
+ "3 15 42\r",
+ "3 15 43\r",
+ "3 15 44\r",
+ "3 15 45\r",
+ "3 15 46\r",
+ "3 15 47\r",
+ "3 15 48\r",
+ "3 15 49\r",
+ "3 15 50\r",
+ "3 15 51\r",
+ "3 15 52\r",
+ "3 15 53\r",
+ "3 15 54\r",
+ "3 15 55\r",
+ "3 15 56\r",
+ "3 15 57\r",
+ "3 15 58\r",
+ "3 16 1\r",
+ "3 16 2\r",
+ "3 16 3\r",
+ "3 16 4\r",
+ "3 16 5\r",
+ "3 16 6\r",
+ "3 16 7\r",
+ "3 16 8\r",
+ "3 16 9\r",
+ "3 16 10\r",
+ "3 16 11\r",
+ "3 16 12\r",
+ "3 16 13\r",
+ "3 16 14\r",
+ "3 16 15\r",
+ "3 16 16\r",
+ "3 16 17\r",
+ "3 16 18\r",
+ "3 16 19\r",
+ "3 16 20\r",
+ "3 16 21\r",
+ "3 16 22\r",
+ "3 16 23\r",
+ "3 16 24\r",
+ "3 16 25\r",
+ "3 16 26\r",
+ "3 16 27\r",
+ "3 16 28\r",
+ "3 16 29\r",
+ "3 16 30\r",
+ "3 16 31\r",
+ "3 16 32\r",
+ "3 16 33\r",
+ "3 16 34\r",
+ "3 16 35\r",
+ "3 16 36\r",
+ "3 16 37\r",
+ "3 16 38\r",
+ "3 16 39\r",
+ "3 16 40\r",
+ "3 16 41\r",
+ "3 16 42\r",
+ "3 16 43\r",
+ "3 16 44\r",
+ "3 16 45\r",
+ "3 16 46\r",
+ "3 16 47\r",
+ "3 16 48\r",
+ "3 16 49\r",
+ "3 16 50\r",
+ "3 16 51\r",
+ "3 16 52\r",
+ "3 16 53\r",
+ "3 16 54\r",
+ "3 16 55\r",
+ "3 16 56\r",
+ "3 16 57\r",
+ "3 16 58\r",
+ "3 17 1\r",
+ "3 17 2\r",
+ "3 17 3\r",
+ "3 17 4\r",
+ "3 17 5\r",
+ "3 17 6\r",
+ "3 17 7\r",
+ "3 17 8\r",
+ "3 17 9\r",
+ "3 17 10\r",
+ "3 17 11\r",
+ "3 17 12\r",
+ "3 17 13\r",
+ "3 17 14\r",
+ "3 17 15\r",
+ "3 17 16\r",
+ "3 17 17\r",
+ "3 17 18\r",
+ "3 17 19\r",
+ "3 17 20\r",
+ "3 17 21\r",
+ "3 17 22\r",
+ "3 17 23\r",
+ "3 17 24\r",
+ "3 17 25\r",
+ "3 17 26\r",
+ "3 17 27\r",
+ "3 17 28\r",
+ "3 17 29\r",
+ "3 17 30\r",
+ "3 17 31\r",
+ "3 17 32\r",
+ "3 17 33\r",
+ "3 17 34\r",
+ "3 17 35\r",
+ "3 17 36\r",
+ "3 17 37\r",
+ "3 17 38\r",
+ "3 17 39\r",
+ "3 17 40\r",
+ "3 17 41\r",
+ "3 17 42\r",
+ "3 17 43\r",
+ "3 17 44\r",
+ "3 17 45\r",
+ "3 17 46\r",
+ "3 17 47\r",
+ "3 17 48\r",
+ "3 17 49\r",
+ "3 17 50\r",
+ "3 17 51\r",
+ "3 17 52\r",
+ "3 17 53\r",
+ "3 17 54\r",
+ "3 17 55\r",
+ "3 17 56\r",
+ "3 17 57\r",
+ "3 17 58\r",
+ "3 18 1\r",
+ "3 18 2\r",
+ "3 18 3\r",
+ "3 18 4\r",
+ "3 18 5\r",
+ "3 18 6\r",
+ "3 18 7\r",
+ "3 18 8\r",
+ "3 18 9\r",
+ "3 18 10\r",
+ "3 18 11\r",
+ "3 18 12\r",
+ "3 18 13\r",
+ "3 18 14\r",
+ "3 18 15\r",
+ "3 18 16\r",
+ "3 18 17\r",
+ "3 18 18\r",
+ "3 18 19\r",
+ "3 18 20\r",
+ "3 18 21\r",
+ "3 18 22\r",
+ "3 18 23\r",
+ "3 18 24\r",
+ "3 18 25\r",
+ "3 18 26\r",
+ "3 18 27\r",
+ "3 18 28\r",
+ "3 18 29\r",
+ "3 18 30\r",
+ "3 18 31\r",
+ "3 18 32\r",
+ "3 18 33\r",
+ "3 18 34\r",
+ "3 18 35\r",
+ "3 18 36\r",
+ "3 18 37\r",
+ "3 18 38\r",
+ "3 18 39\r",
+ "3 18 40\r",
+ "3 18 41\r",
+ "3 18 42\r",
+ "3 18 43\r",
+ "3 18 44\r",
+ "3 18 45\r",
+ "3 18 46\r",
+ "3 18 47\r",
+ "3 18 48\r",
+ "3 18 49\r",
+ "3 18 50\r",
+ "3 18 51\r",
+ "3 18 52\r",
+ "3 18 53\r",
+ "3 18 54\r",
+ "3 18 55\r",
+ "3 18 56\r",
+ "3 18 57\r",
+ "3 18 58\r",
+ "3 19 1\r",
+ "3 19 2\r",
+ "3 19 3\r",
+ "3 19 4\r",
+ "3 19 5\r",
+ "3 19 6\r",
+ "3 19 7\r",
+ "3 19 8\r",
+ "3 19 9\r",
+ "3 19 10\r",
+ "3 19 11\r",
+ "3 19 12\r",
+ "3 19 13\r",
+ "3 19 14\r",
+ "3 19 15\r",
+ "3 19 16\r",
+ "3 19 17\r",
+ "3 19 18\r",
+ "3 19 19\r",
+ "3 19 20\r",
+ "3 19 21\r",
+ "3 19 22\r",
+ "3 19 23\r",
+ "3 19 24\r",
+ "3 19 25\r",
+ "3 19 26\r",
+ "3 19 27\r",
+ "3 19 28\r",
+ "3 19 29\r",
+ "3 19 30\r",
+ "3 19 31\r",
+ "3 19 32\r",
+ "3 19 33\r",
+ "3 19 34\r",
+ "3 19 35\r",
+ "3 19 36\r",
+ "3 19 37\r",
+ "3 19 38\r",
+ "3 19 39\r",
+ "3 19 40\r",
+ "3 19 41\r",
+ "3 19 42\r",
+ "3 19 43\r",
+ "3 19 44\r",
+ "3 19 45\r",
+ "3 19 46\r",
+ "3 19 47\r",
+ "3 19 48\r",
+ "3 19 49\r",
+ "3 19 50\r",
+ "3 19 51\r",
+ "3 19 52\r",
+ "3 19 53\r",
+ "3 19 54\r",
+ "3 19 55\r",
+ "3 19 56\r",
+ "3 19 57\r",
+ "3 19 58\r",
+ "3 20 1\r",
+ "3 20 2\r",
+ "3 20 3\r",
+ "3 20 4\r",
+ "3 20 5\r",
+ "3 20 6\r",
+ "3 20 7\r",
+ "3 20 8\r",
+ "3 20 9\r",
+ "3 20 10\r",
+ "3 20 11\r",
+ "3 20 12\r",
+ "3 20 13\r",
+ "3 20 14\r",
+ "3 20 15\r",
+ "3 20 16\r",
+ "3 20 17\r",
+ "3 20 18\r",
+ "3 20 19\r",
+ "3 20 20\r",
+ "3 20 21\r",
+ "3 20 22\r",
+ "3 20 23\r",
+ "3 20 24\r",
+ "3 20 25\r",
+ "3 20 26\r",
+ "3 20 27\r",
+ "3 20 28\r",
+ "3 20 29\r",
+ "3 20 30\r",
+ "3 20 31\r",
+ "3 20 32\r",
+ "3 20 33\r",
+ "3 20 34\r",
+ "3 20 35\r",
+ "3 20 36\r",
+ "3 20 37\r",
+ "3 20 38\r",
+ "3 20 39\r",
+ "3 20 40\r",
+ "3 20 41\r",
+ "3 20 42\r",
+ "3 20 43\r",
+ "3 20 44\r",
+ "3 20 45\r",
+ "3 20 46\r",
+ "3 20 47\r",
+ "3 20 48\r",
+ "3 20 49\r",
+ "3 20 50\r",
+ "3 20 51\r",
+ "3 20 52\r",
+ "3 20 53\r",
+ "3 20 54\r",
+ "3 20 55\r",
+ "3 20 56\r",
+ "3 20 57\r",
+ "3 20 58\r",
+ "3 21 1\r",
+ "3 21 2\r",
+ "3 21 3\r",
+ "3 21 4\r",
+ "3 21 5\r",
+ "3 21 6\r",
+ "3 21 7\r",
+ "3 21 8\r",
+ "3 21 9\r",
+ "3 21 10\r",
+ "3 21 11\r",
+ "3 21 12\r",
+ "3 21 13\r",
+ "3 21 14\r",
+ "3 21 15\r",
+ "3 21 16\r",
+ "3 21 17\r",
+ "3 21 18\r",
+ "3 21 19\r",
+ "3 21 20\r",
+ "3 21 21\r",
+ "3 21 22\r",
+ "3 21 23\r",
+ "3 21 24\r",
+ "3 21 25\r",
+ "3 21 26\r",
+ "3 21 27\r",
+ "3 21 28\r",
+ "3 21 29\r",
+ "3 21 30\r",
+ "3 21 31\r",
+ "3 21 32\r",
+ "3 21 33\r",
+ "3 21 34\r",
+ "3 21 35\r",
+ "3 21 36\r",
+ "3 21 37\r",
+ "3 21 38\r",
+ "3 21 39\r",
+ "3 21 40\r",
+ "3 21 41\r",
+ "3 21 42\r",
+ "3 21 43\r",
+ "3 21 44\r",
+ "3 21 45\r",
+ "3 21 46\r",
+ "3 21 47\r",
+ "3 21 48\r",
+ "3 21 49\r",
+ "3 21 50\r",
+ "3 21 51\r",
+ "3 21 52\r",
+ "3 21 53\r",
+ "3 21 54\r",
+ "3 21 55\r",
+ "3 21 56\r",
+ "3 21 57\r",
+ "3 21 58\r",
+ "3 22 1\r",
+ "3 22 2\r",
+ "3 22 3\r",
+ "3 22 4\r",
+ "3 22 5\r",
+ "3 22 6\r",
+ "3 22 7\r",
+ "3 22 8\r",
+ "3 22 9\r",
+ "3 22 10\r",
+ "3 22 11\r",
+ "3 22 12\r",
+ "3 22 13\r",
+ "3 22 14\r",
+ "3 22 15\r",
+ "3 22 16\r",
+ "3 22 17\r",
+ "3 22 18\r",
+ "3 22 19\r",
+ "3 22 20\r",
+ "3 22 21\r",
+ "3 22 22\r",
+ "3 22 23\r",
+ "3 22 24\r",
+ "3 22 25\r",
+ "3 22 26\r",
+ "3 22 27\r",
+ "3 22 28\r",
+ "3 22 29\r",
+ "3 22 30\r",
+ "3 22 31\r",
+ "3 22 32\r",
+ "3 22 33\r",
+ "3 22 34\r",
+ "3 22 35\r",
+ "3 22 36\r",
+ "3 22 37\r",
+ "3 22 38\r",
+ "3 22 39\r",
+ "3 22 40\r",
+ "3 22 41\r",
+ "3 22 42\r",
+ "3 22 43\r",
+ "3 22 44\r",
+ "3 22 45\r",
+ "3 22 46\r",
+ "3 22 47\r",
+ "3 22 48\r",
+ "3 22 49\r",
+ "3 22 50\r",
+ "3 22 51\r",
+ "3 22 52\r",
+ "3 22 53\r",
+ "3 22 54\r",
+ "3 22 55\r",
+ "3 22 56\r",
+ "3 22 57\r",
+ "3 22 58\r",
+ "3 23 1\r",
+ "3 23 2\r",
+ "3 23 3\r",
+ "3 23 4\r",
+ "3 23 5\r",
+ "3 23 6\r",
+ "3 23 7\r",
+ "3 23 8\r",
+ "3 23 9\r",
+ "3 23 10\r",
+ "3 23 11\r",
+ "3 23 12\r",
+ "3 23 13\r",
+ "3 23 14\r",
+ "3 23 15\r",
+ "3 23 16\r",
+ "3 23 17\r",
+ "3 23 18\r",
+ "3 23 19\r",
+ "3 23 20\r",
+ "3 23 21\r",
+ "3 23 22\r",
+ "3 23 23\r",
+ "3 23 24\r",
+ "3 23 25\r",
+ "3 23 26\r",
+ "3 23 27\r",
+ "3 23 28\r",
+ "3 23 29\r",
+ "3 23 30\r",
+ "3 23 31\r",
+ "3 23 32\r",
+ "3 23 33\r",
+ "3 23 34\r",
+ "3 23 35\r",
+ "3 23 36\r",
+ "3 23 37\r",
+ "3 23 38\r",
+ "3 23 39\r",
+ "3 23 40\r",
+ "3 23 41\r",
+ "3 23 42\r",
+ "3 23 43\r",
+ "3 23 44\r",
+ "3 23 45\r",
+ "3 23 46\r",
+ "3 23 47\r",
+ "3 23 48\r",
+ "3 23 49\r",
+ "3 23 50\r",
+ "3 23 51\r",
+ "3 23 52\r",
+ "3 23 53\r",
+ "3 23 54\r",
+ "3 23 55\r",
+ "3 23 56\r",
+ "3 23 57\r",
+ "3 23 58\r",
+ "3 24 1\r",
+ "3 24 2\r",
+ "3 24 3\r",
+ "3 24 4\r",
+ "3 24 5\r",
+ "3 24 6\r",
+ "3 24 7\r",
+ "3 24 8\r",
+ "3 24 9\r",
+ "3 24 10\r",
+ "3 24 11\r",
+ "3 24 12\r",
+ "3 24 13\r",
+ "3 24 14\r",
+ "3 24 15\r",
+ "3 24 16\r",
+ "3 24 17\r",
+ "3 24 18\r",
+ "3 24 19\r",
+ "3 24 20\r",
+ "3 24 21\r",
+ "3 24 22\r",
+ "3 24 23\r",
+ "3 24 24\r",
+ "3 24 25\r",
+ "3 24 26\r",
+ "3 24 27\r",
+ "3 24 28\r",
+ "3 24 29\r",
+ "3 24 30\r",
+ "3 24 31\r",
+ "3 24 32\r",
+ "3 24 33\r",
+ "3 24 34\r",
+ "3 24 35\r",
+ "3 24 36\r",
+ "3 24 37\r",
+ "3 24 38\r",
+ "3 24 39\r",
+ "3 24 40\r",
+ "3 24 41\r",
+ "3 24 42\r",
+ "3 24 43\r",
+ "3 24 44\r",
+ "3 24 45\r",
+ "3 24 46\r",
+ "3 24 47\r",
+ "3 24 48\r",
+ "3 24 49\r",
+ "3 24 50\r",
+ "3 24 51\r",
+ "3 24 52\r",
+ "3 24 53\r",
+ "3 24 54\r",
+ "3 24 55\r",
+ "3 24 56\r",
+ "3 24 57\r",
+ "3 24 58\r",
+ "3 25 1\r",
+ "3 25 2\r",
+ "3 25 3\r",
+ "3 25 4\r",
+ "3 25 5\r",
+ "3 25 6\r",
+ "3 25 7\r",
+ "3 25 8\r",
+ "3 25 9\r",
+ "3 25 10\r",
+ "3 25 11\r",
+ "3 25 12\r",
+ "3 25 13\r",
+ "3 25 14\r",
+ "3 25 15\r",
+ "3 25 16\r",
+ "3 25 17\r",
+ "3 25 18\r",
+ "3 25 19\r",
+ "3 25 20\r",
+ "3 25 21\r",
+ "3 25 22\r",
+ "3 25 23\r",
+ "3 25 24\r",
+ "3 25 25\r",
+ "3 25 26\r",
+ "3 25 27\r",
+ "3 25 28\r",
+ "3 25 29\r",
+ "3 25 30\r",
+ "3 25 31\r",
+ "3 25 32\r",
+ "3 25 33\r",
+ "3 25 34\r",
+ "3 25 35\r",
+ "3 25 36\r",
+ "3 25 37\r",
+ "3 25 38\r",
+ "3 25 39\r",
+ "3 25 40\r",
+ "3 25 41\r",
+ "3 25 42\r",
+ "3 25 43\r",
+ "3 25 44\r",
+ "3 25 45\r",
+ "3 25 46\r",
+ "3 25 47\r",
+ "3 25 48\r",
+ "3 25 49\r",
+ "3 25 50\r",
+ "3 25 51\r",
+ "3 25 52\r",
+ "3 25 53\r",
+ "3 25 54\r",
+ "3 25 55\r",
+ "3 25 56\r",
+ "3 25 57\r",
+ "3 25 58\r",
+ "3 26 1\r",
+ "3 26 2\r",
+ "3 26 3\r",
+ "3 26 4\r",
+ "3 26 5\r",
+ "3 26 6\r",
+ "3 26 7\r",
+ "3 26 8\r",
+ "3 26 9\r",
+ "3 26 10\r",
+ "3 26 11\r",
+ "3 26 12\r",
+ "3 26 13\r",
+ "3 26 14\r",
+ "3 26 15\r",
+ "3 26 16\r",
+ "3 26 17\r",
+ "3 26 18\r",
+ "3 26 19\r",
+ "3 26 20\r",
+ "3 26 21\r",
+ "3 26 22\r",
+ "3 26 23\r",
+ "3 26 24\r",
+ "3 26 25\r",
+ "3 26 26\r",
+ "3 26 27\r",
+ "3 26 28\r",
+ "3 26 29\r",
+ "3 26 30\r",
+ "3 26 31\r",
+ "3 26 32\r",
+ "3 26 33\r",
+ "3 26 34\r",
+ "3 26 35\r",
+ "3 26 36\r",
+ "3 26 37\r",
+ "3 26 38\r",
+ "3 26 39\r",
+ "3 26 40\r",
+ "3 26 41\r",
+ "3 26 42\r",
+ "3 26 43\r",
+ "3 26 44\r",
+ "3 26 45\r",
+ "3 26 46\r",
+ "3 26 47\r",
+ "3 26 48\r",
+ "3 26 49\r",
+ "3 26 50\r",
+ "3 26 51\r",
+ "3 26 52\r",
+ "3 26 53\r",
+ "3 26 54\r",
+ "3 26 55\r",
+ "3 26 56\r",
+ "3 26 57\r",
+ "3 26 58\r",
+ "3 27 1\r",
+ "3 27 2\r",
+ "3 27 3\r",
+ "3 27 4\r",
+ "3 27 5\r",
+ "3 27 6\r",
+ "3 27 7\r",
+ "3 27 8\r",
+ "3 27 9\r",
+ "3 27 10\r",
+ "3 27 11\r",
+ "3 27 12\r",
+ "3 27 13\r",
+ "3 27 14\r",
+ "3 27 15\r",
+ "3 27 16\r",
+ "3 27 17\r",
+ "3 27 18\r",
+ "3 27 19\r",
+ "3 27 20\r",
+ "3 27 21\r",
+ "3 27 22\r",
+ "3 27 23\r",
+ "3 27 24\r",
+ "3 27 25\r",
+ "3 27 26\r",
+ "3 27 27\r",
+ "3 27 28\r",
+ "3 27 29\r",
+ "3 27 30\r",
+ "3 27 31\r",
+ "3 27 32\r",
+ "3 27 33\r",
+ "3 27 34\r",
+ "3 27 35\r",
+ "3 27 36\r",
+ "3 27 37\r",
+ "3 27 38\r",
+ "3 27 39\r",
+ "3 27 40\r",
+ "3 27 41\r",
+ "3 27 42\r",
+ "3 27 43\r",
+ "3 27 44\r",
+ "3 27 45\r",
+ "3 27 46\r",
+ "3 27 47\r",
+ "3 27 48\r",
+ "3 27 49\r",
+ "3 27 50\r",
+ "3 27 51\r",
+ "3 27 52\r",
+ "3 27 53\r",
+ "3 27 54\r",
+ "3 27 55\r",
+ "3 27 56\r",
+ "3 27 57\r",
+ "3 27 58\r",
+ "3 28 1\r",
+ "3 28 2\r",
+ "3 28 3\r",
+ "3 28 4\r",
+ "3 28 5\r",
+ "3 28 6\r",
+ "3 28 7\r",
+ "3 28 8\r",
+ "3 28 9\r",
+ "3 28 10\r",
+ "3 28 11\r",
+ "3 28 12\r",
+ "3 28 13\r",
+ "3 28 14\r",
+ "3 28 15\r",
+ "3 28 16\r",
+ "3 28 17\r",
+ "3 28 18\r",
+ "3 28 19\r",
+ "3 28 20\r",
+ "3 28 21\r",
+ "3 28 22\r",
+ "3 28 23\r",
+ "3 28 24\r",
+ "3 28 25\r",
+ "3 28 26\r",
+ "3 28 27\r",
+ "3 28 28\r",
+ "3 28 29\r",
+ "3 28 30\r",
+ "3 28 31\r",
+ "3 28 32\r",
+ "3 28 33\r",
+ "3 28 34\r",
+ "3 28 35\r",
+ "3 28 36\r",
+ "3 28 37\r",
+ "3 28 38\r",
+ "3 28 39\r",
+ "3 28 40\r",
+ "3 28 41\r",
+ "3 28 42\r",
+ "3 28 43\r",
+ "3 28 44\r",
+ "3 28 45\r",
+ "3 28 46\r",
+ "3 28 47\r",
+ "3 28 48\r",
+ "3 28 49\r",
+ "3 28 50\r",
+ "3 28 51\r",
+ "3 28 52\r",
+ "3 28 53\r",
+ "3 28 54\r",
+ "3 28 55\r",
+ "3 28 56\r",
+ "3 28 57\r",
+ "3 28 58\r",
+ "3 29 1\r",
+ "3 29 2\r",
+ "3 29 3\r",
+ "3 29 4\r",
+ "3 29 5\r",
+ "3 29 6\r",
+ "3 29 7\r",
+ "3 29 8\r",
+ "3 29 9\r",
+ "3 29 10\r",
+ "3 29 11\r",
+ "3 29 12\r",
+ "3 29 13\r",
+ "3 29 14\r",
+ "3 29 15\r",
+ "3 29 16\r",
+ "3 29 17\r",
+ "3 29 18\r",
+ "3 29 19\r",
+ "3 29 20\r",
+ "3 29 21\r",
+ "3 29 22\r",
+ "3 29 23\r",
+ "3 29 24\r",
+ "3 29 25\r",
+ "3 29 26\r",
+ "3 29 27\r",
+ "3 29 28\r",
+ "3 29 29\r",
+ "3 29 30\r",
+ "3 29 31\r",
+ "3 29 32\r",
+ "3 29 33\r",
+ "3 29 34\r",
+ "3 29 35\r",
+ "3 29 36\r",
+ "3 29 37\r",
+ "3 29 38\r",
+ "3 29 39\r",
+ "3 29 40\r",
+ "3 29 41\r",
+ "3 29 42\r",
+ "3 29 43\r",
+ "3 29 44\r",
+ "3 29 45\r",
+ "3 29 46\r",
+ "3 29 47\r",
+ "3 29 48\r",
+ "3 29 49\r",
+ "3 29 50\r",
+ "3 29 51\r",
+ "3 29 52\r",
+ "3 29 53\r",
+ "3 29 54\r",
+ "3 29 55\r",
+ "3 29 56\r",
+ "3 29 57\r",
+ "3 29 58\r",
+ "3 30 1\r",
+ "3 30 2\r",
+ "3 30 3\r",
+ "3 30 4\r",
+ "3 30 5\r",
+ "3 30 6\r",
+ "3 30 7\r",
+ "3 30 8\r",
+ "3 30 9\r",
+ "3 30 10\r",
+ "3 30 11\r",
+ "3 30 12\r",
+ "3 30 13\r",
+ "3 30 14\r",
+ "3 30 15\r",
+ "3 30 16\r",
+ "3 30 17\r",
+ "3 30 18\r",
+ "3 30 19\r",
+ "3 30 20\r",
+ "3 30 21\r",
+ "3 30 22\r",
+ "3 30 23\r",
+ "3 30 24\r",
+ "3 30 25\r",
+ "3 30 26\r",
+ "3 30 27\r",
+ "3 30 28\r",
+ "3 30 29\r",
+ "3 30 30\r",
+ "3 30 31\r",
+ "3 30 32\r",
+ "3 30 33\r",
+ "3 30 34\r",
+ "3 30 35\r",
+ "3 30 36\r",
+ "3 30 37\r",
+ "3 30 38\r",
+ "3 30 39\r",
+ "3 30 40\r",
+ "3 30 41\r",
+ "3 30 42\r",
+ "3 30 43\r",
+ "3 30 44\r",
+ "3 30 45\r",
+ "3 30 46\r",
+ "3 30 47\r",
+ "3 30 48\r",
+ "3 30 49\r",
+ "3 30 50\r",
+ "3 30 51\r",
+ "3 30 52\r",
+ "3 30 53\r",
+ "3 30 54\r",
+ "3 30 55\r",
+ "3 30 56\r",
+ "3 30 57\r",
+ "3 30 58\r",
+ "3 31 1\r",
+ "3 31 2\r",
+ "3 31 3\r",
+ "3 31 4\r",
+ "3 31 5\r",
+ "3 31 6\r",
+ "3 31 7\r",
+ "3 31 8\r",
+ "3 31 9\r",
+ "3 31 10\r",
+ "3 31 11\r",
+ "3 31 12\r",
+ "3 31 13\r",
+ "3 31 14\r",
+ "3 31 15\r",
+ "3 31 16\r",
+ "3 31 17\r",
+ "3 31 18\r",
+ "3 31 19\r",
+ "3 31 20\r",
+ "3 31 21\r",
+ "3 31 22\r",
+ "3 31 23\r",
+ "3 31 24\r",
+ "3 31 25\r",
+ "3 31 26\r",
+ "3 31 27\r",
+ "3 31 28\r",
+ "3 31 29\r",
+ "3 31 30\r",
+ "3 31 31\r",
+ "3 31 32\r",
+ "3 31 33\r",
+ "3 31 34\r",
+ "3 31 35\r",
+ "3 31 36\r",
+ "3 31 37\r",
+ "3 31 38\r",
+ "3 31 39\r",
+ "3 31 40\r",
+ "3 31 41\r",
+ "3 31 42\r",
+ "3 31 43\r",
+ "3 31 44\r",
+ "3 31 45\r",
+ "3 31 46\r",
+ "3 31 47\r",
+ "3 31 48\r",
+ "3 31 49\r",
+ "3 31 50\r",
+ "3 31 51\r",
+ "3 31 52\r",
+ "3 31 53\r",
+ "3 31 54\r",
+ "3 31 55\r",
+ "3 31 56\r",
+ "3 31 57\r",
+ "3 31 58\r",
+ "3 32 1\r",
+ "3 32 2\r",
+ "3 32 3\r",
+ "3 32 4\r",
+ "3 32 5\r",
+ "3 32 6\r",
+ "3 32 7\r",
+ "3 32 8\r",
+ "3 32 9\r",
+ "3 32 10\r",
+ "3 32 11\r",
+ "3 32 12\r",
+ "3 32 13\r",
+ "3 32 14\r",
+ "3 32 15\r",
+ "3 32 16\r",
+ "3 32 17\r",
+ "3 32 18\r",
+ "3 32 19\r",
+ "3 32 20\r",
+ "3 32 21\r",
+ "3 32 22\r",
+ "3 32 23\r",
+ "3 32 24\r",
+ "3 32 25\r",
+ "3 32 26\r",
+ "3 32 27\r",
+ "3 32 28\r",
+ "3 32 29\r",
+ "3 32 30\r",
+ "3 32 31\r",
+ "3 32 32\r",
+ "3 32 33\r",
+ "3 32 34\r",
+ "3 32 35\r",
+ "3 32 36\r",
+ "3 32 37\r",
+ "3 32 38\r",
+ "3 32 39\r",
+ "3 32 40\r",
+ "3 32 41\r",
+ "3 32 42\r",
+ "3 32 43\r",
+ "3 32 44\r",
+ "3 32 45\r",
+ "3 32 46\r",
+ "3 32 47\r",
+ "3 32 48\r",
+ "3 32 49\r",
+ "3 32 50\r",
+ "3 32 51\r",
+ "3 32 52\r",
+ "3 32 53\r",
+ "3 32 54\r",
+ "3 32 55\r",
+ "3 32 56\r",
+ "3 32 57\r",
+ "3 32 58\r",
+ "3 33 1\r",
+ "3 33 2\r",
+ "3 33 3\r",
+ "3 33 4\r",
+ "3 33 5\r",
+ "3 33 6\r",
+ "3 33 7\r",
+ "3 33 8\r",
+ "3 33 9\r",
+ "3 33 10\r",
+ "3 33 11\r",
+ "3 33 12\r",
+ "3 33 13\r",
+ "3 33 14\r",
+ "3 33 15\r",
+ "3 33 16\r",
+ "3 33 17\r",
+ "3 33 18\r",
+ "3 33 19\r",
+ "3 33 20\r",
+ "3 33 21\r",
+ "3 33 22\r",
+ "3 33 23\r",
+ "3 33 24\r",
+ "3 33 25\r",
+ "3 33 26\r",
+ "3 33 27\r",
+ "3 33 28\r",
+ "3 33 29\r",
+ "3 33 30\r",
+ "3 33 31\r",
+ "3 33 32\r",
+ "3 33 33\r",
+ "3 33 34\r",
+ "3 33 35\r",
+ "3 33 36\r",
+ "3 33 37\r",
+ "3 33 38\r",
+ "3 33 39\r",
+ "3 33 40\r",
+ "3 33 41\r",
+ "3 33 42\r",
+ "3 33 43\r",
+ "3 33 44\r",
+ "3 33 45\r",
+ "3 33 46\r",
+ "3 33 47\r",
+ "3 33 48\r",
+ "3 33 49\r",
+ "3 33 50\r",
+ "3 33 51\r",
+ "3 33 52\r",
+ "3 33 53\r",
+ "3 33 54\r",
+ "3 33 55\r",
+ "3 33 56\r",
+ "3 33 57\r",
+ "3 33 58\r",
+ "3 34 1\r",
+ "3 34 2\r",
+ "3 34 3\r",
+ "3 34 4\r",
+ "3 34 5\r",
+ "3 34 6\r",
+ "3 34 7\r",
+ "3 34 8\r",
+ "3 34 9\r",
+ "3 34 10\r",
+ "3 34 11\r",
+ "3 34 12\r",
+ "3 34 13\r",
+ "3 34 14\r",
+ "3 34 15\r",
+ "3 34 16\r",
+ "3 34 17\r",
+ "3 34 18\r",
+ "3 34 19\r",
+ "3 34 20\r",
+ "3 34 21\r",
+ "3 34 22\r",
+ "3 34 23\r",
+ "3 34 24\r",
+ "3 34 25\r",
+ "3 34 26\r",
+ "3 34 27\r",
+ "3 34 28\r",
+ "3 34 29\r",
+ "3 34 30\r",
+ "3 34 31\r",
+ "3 34 32\r",
+ "3 34 33\r",
+ "3 34 34\r",
+ "3 34 35\r",
+ "3 34 36\r",
+ "3 34 37\r",
+ "3 34 38\r",
+ "3 34 39\r",
+ "3 34 40\r",
+ "3 34 41\r",
+ "3 34 42\r",
+ "3 34 43\r",
+ "3 34 44\r",
+ "3 34 45\r",
+ "3 34 46\r",
+ "3 34 47\r",
+ "3 34 48\r",
+ "3 34 49\r",
+ "3 34 50\r",
+ "3 34 51\r",
+ "3 34 52\r",
+ "3 34 53\r",
+ "3 34 54\r",
+ "3 34 55\r",
+ "3 34 56\r",
+ "3 34 57\r",
+ "3 34 58\r",
+ "3 35 1\r",
+ "3 35 2\r",
+ "3 35 3\r",
+ "3 35 4\r",
+ "3 35 5\r",
+ "3 35 6\r",
+ "3 35 7\r",
+ "3 35 8\r",
+ "3 35 9\r",
+ "3 35 10\r",
+ "3 35 11\r",
+ "3 35 12\r",
+ "3 35 13\r",
+ "3 35 14\r",
+ "3 35 15\r",
+ "3 35 16\r",
+ "3 35 17\r",
+ "3 35 18\r",
+ "3 35 19\r",
+ "3 35 20\r",
+ "3 35 21\r",
+ "3 35 22\r",
+ "3 35 23\r",
+ "3 35 24\r",
+ "3 35 25\r",
+ "3 35 26\r",
+ "3 35 27\r",
+ "3 35 28\r",
+ "3 35 29\r",
+ "3 35 30\r",
+ "3 35 31\r",
+ "3 35 32\r",
+ "3 35 33\r",
+ "3 35 34\r",
+ "3 35 35\r",
+ "3 35 36\r",
+ "3 35 37\r",
+ "3 35 38\r",
+ "3 35 39\r",
+ "3 35 40\r",
+ "3 35 41\r",
+ "3 35 42\r",
+ "3 35 43\r",
+ "3 35 44\r",
+ "3 35 45\r",
+ "3 35 46\r",
+ "3 35 47\r",
+ "3 35 48\r",
+ "3 35 49\r",
+ "3 35 50\r",
+ "3 35 51\r",
+ "3 35 52\r",
+ "3 35 53\r",
+ "3 35 54\r",
+ "3 35 55\r",
+ "3 35 56\r",
+ "3 35 57\r",
+ "3 35 58\r",
+ "3 36 1\r",
+ "3 36 2\r",
+ "3 36 3\r",
+ "3 36 4\r",
+ "3 36 5\r",
+ "3 36 6\r",
+ "3 36 7\r",
+ "3 36 8\r",
+ "3 36 9\r",
+ "3 36 10\r",
+ "3 36 11\r",
+ "3 36 12\r",
+ "3 36 13\r",
+ "3 36 14\r",
+ "3 36 15\r",
+ "3 36 16\r",
+ "3 36 17\r",
+ "3 36 18\r",
+ "3 36 19\r",
+ "3 36 20\r",
+ "3 36 21\r",
+ "3 36 22\r",
+ "3 36 23\r",
+ "3 36 24\r",
+ "3 36 25\r",
+ "3 36 26\r",
+ "3 36 27\r",
+ "3 36 28\r",
+ "3 36 29\r",
+ "3 36 30\r",
+ "3 36 31\r",
+ "3 36 32\r",
+ "3 36 33\r",
+ "3 36 34\r",
+ "3 36 35\r",
+ "3 36 36\r",
+ "3 36 37\r",
+ "3 36 38\r",
+ "3 36 39\r",
+ "3 36 40\r",
+ "3 36 41\r",
+ "3 36 42\r",
+ "3 36 43\r",
+ "3 36 44\r",
+ "3 36 45\r",
+ "3 36 46\r",
+ "3 36 47\r",
+ "3 36 48\r",
+ "3 36 49\r",
+ "3 36 50\r",
+ "3 36 51\r",
+ "3 36 52\r",
+ "3 36 53\r",
+ "3 36 54\r",
+ "3 36 55\r",
+ "3 36 56\r",
+ "3 36 57\r",
+ "3 36 58\r",
+ "3 37 1\r",
+ "3 37 2\r",
+ "3 37 3\r",
+ "3 37 4\r",
+ "3 37 5\r",
+ "3 37 6\r",
+ "3 37 7\r",
+ "3 37 8\r",
+ "3 37 9\r",
+ "3 37 10\r",
+ "3 37 11\r",
+ "3 37 12\r",
+ "3 37 13\r",
+ "3 37 14\r",
+ "3 37 15\r",
+ "3 37 16\r",
+ "3 37 17\r",
+ "3 37 18\r",
+ "3 37 19\r",
+ "3 37 20\r",
+ "3 37 21\r",
+ "3 37 22\r",
+ "3 37 23\r",
+ "3 37 24\r",
+ "3 37 25\r",
+ "3 37 26\r",
+ "3 37 27\r",
+ "3 37 28\r",
+ "3 37 29\r",
+ "3 37 30\r",
+ "3 37 31\r",
+ "3 37 32\r",
+ "3 37 33\r",
+ "3 37 34\r",
+ "3 37 35\r",
+ "3 37 36\r",
+ "3 37 37\r",
+ "3 37 38\r",
+ "3 37 39\r",
+ "3 37 40\r",
+ "3 37 41\r",
+ "3 37 42\r",
+ "3 37 43\r",
+ "3 37 44\r",
+ "3 37 45\r",
+ "3 37 46\r",
+ "3 37 47\r",
+ "3 37 48\r",
+ "3 37 49\r",
+ "3 37 50\r",
+ "3 37 51\r",
+ "3 37 52\r",
+ "3 37 53\r",
+ "3 37 54\r",
+ "3 37 55\r",
+ "3 37 56\r",
+ "3 37 57\r",
+ "3 37 58\r",
+ "3 38 1\r",
+ "3 38 2\r",
+ "3 38 3\r",
+ "3 38 4\r",
+ "3 38 5\r",
+ "3 38 6\r",
+ "3 38 7\r",
+ "3 38 8\r",
+ "3 38 9\r",
+ "3 38 10\r",
+ "3 38 11\r",
+ "3 38 12\r",
+ "3 38 13\r",
+ "3 38 14\r",
+ "3 38 15\r",
+ "3 38 16\r",
+ "3 38 17\r",
+ "3 38 18\r",
+ "3 38 19\r",
+ "3 38 20\r",
+ "3 38 21\r",
+ "3 38 22\r",
+ "3 38 23\r",
+ "3 38 24\r",
+ "3 38 25\r",
+ "3 38 26\r",
+ "3 38 27\r",
+ "3 38 28\r",
+ "3 38 29\r",
+ "3 38 30\r",
+ "3 38 31\r",
+ "3 38 32\r",
+ "3 38 33\r",
+ "3 38 34\r",
+ "3 38 35\r",
+ "3 38 36\r",
+ "3 38 37\r",
+ "3 38 38\r",
+ "3 38 39\r",
+ "3 38 40\r",
+ "3 38 41\r",
+ "3 38 42\r",
+ "3 38 43\r",
+ "3 38 44\r",
+ "3 38 45\r",
+ "3 38 46\r",
+ "3 38 47\r",
+ "3 38 48\r",
+ "3 38 49\r",
+ "3 38 50\r",
+ "3 38 51\r",
+ "3 38 52\r",
+ "3 38 53\r",
+ "3 38 54\r",
+ "3 38 55\r",
+ "3 38 56\r",
+ "3 38 57\r",
+ "3 38 58\r",
+ "3 39 1\r",
+ "3 39 2\r",
+ "3 39 3\r",
+ "3 39 4\r",
+ "3 39 5\r",
+ "3 39 6\r",
+ "3 39 7\r",
+ "3 39 8\r",
+ "3 39 9\r",
+ "3 39 10\r",
+ "3 39 11\r",
+ "3 39 12\r",
+ "3 39 13\r",
+ "3 39 14\r",
+ "3 39 15\r",
+ "3 39 16\r",
+ "3 39 17\r",
+ "3 39 18\r",
+ "3 39 19\r",
+ "3 39 20\r",
+ "3 39 21\r",
+ "3 39 22\r",
+ "3 39 23\r",
+ "3 39 24\r",
+ "3 39 25\r",
+ "3 39 26\r",
+ "3 39 27\r",
+ "3 39 28\r",
+ "3 39 29\r",
+ "3 39 30\r",
+ "3 39 31\r",
+ "3 39 32\r",
+ "3 39 33\r",
+ "3 39 34\r",
+ "3 39 35\r",
+ "3 39 36\r",
+ "3 39 37\r",
+ "3 39 38\r",
+ "3 39 39\r",
+ "3 39 40\r",
+ "3 39 41\r",
+ "3 39 42\r",
+ "3 39 43\r",
+ "3 39 44\r",
+ "3 39 45\r",
+ "3 39 46\r",
+ "3 39 47\r",
+ "3 39 48\r",
+ "3 39 49\r",
+ "3 39 50\r",
+ "3 39 51\r",
+ "3 39 52\r",
+ "3 39 53\r",
+ "3 39 54\r",
+ "3 39 55\r",
+ "3 39 56\r",
+ "3 39 57\r",
+ "3 39 58\r",
+ "3 40 1\r",
+ "3 40 2\r",
+ "3 40 3\r",
+ "3 40 4\r",
+ "3 40 5\r",
+ "3 40 6\r",
+ "3 40 7\r",
+ "3 40 8\r",
+ "3 40 9\r",
+ "3 40 10\r",
+ "3 40 11\r",
+ "3 40 12\r",
+ "3 40 13\r",
+ "3 40 14\r",
+ "3 40 15\r",
+ "3 40 16\r",
+ "3 40 17\r",
+ "3 40 18\r",
+ "3 40 19\r",
+ "3 40 20\r",
+ "3 40 21\r",
+ "3 40 22\r",
+ "3 40 23\r",
+ "3 40 24\r",
+ "3 40 25\r",
+ "3 40 26\r",
+ "3 40 27\r",
+ "3 40 28\r",
+ "3 40 29\r",
+ "3 40 30\r",
+ "3 40 31\r",
+ "3 40 32\r",
+ "3 40 33\r",
+ "3 40 34\r",
+ "3 40 35\r",
+ "3 40 36\r",
+ "3 40 37\r",
+ "3 40 38\r",
+ "3 40 39\r",
+ "3 40 40\r",
+ "3 40 41\r",
+ "3 40 42\r",
+ "3 40 43\r",
+ "3 40 44\r",
+ "3 40 45\r",
+ "3 40 46\r",
+ "3 40 47\r",
+ "3 40 48\r",
+ "3 40 49\r",
+ "3 40 50\r",
+ "3 40 51\r",
+ "3 40 52\r",
+ "3 40 53\r",
+ "3 40 54\r",
+ "3 40 55\r",
+ "3 40 56\r",
+ "3 40 57\r",
+ "3 40 58\r",
+ "3 41 1\r",
+ "3 41 2\r",
+ "3 41 3\r",
+ "3 41 4\r",
+ "3 41 5\r",
+ "3 41 6\r",
+ "3 41 7\r",
+ "3 41 8\r",
+ "3 41 9\r",
+ "3 41 10\r",
+ "3 41 11\r",
+ "3 41 12\r",
+ "3 41 13\r",
+ "3 41 14\r",
+ "3 41 15\r",
+ "3 41 16\r",
+ "3 41 17\r",
+ "3 41 18\r",
+ "3 41 19\r",
+ "3 41 20\r",
+ "3 41 21\r",
+ "3 41 22\r",
+ "3 41 23\r",
+ "3 41 24\r",
+ "3 41 25\r",
+ "3 41 26\r",
+ "3 41 27\r",
+ "3 41 28\r",
+ "3 41 29\r",
+ "3 41 30\r",
+ "3 41 31\r",
+ "3 41 32\r",
+ "3 41 33\r",
+ "3 41 34\r",
+ "3 41 35\r",
+ "3 41 36\r",
+ "3 41 37\r",
+ "3 41 38\r",
+ "3 41 39\r",
+ "3 41 40\r",
+ "3 41 41\r",
+ "3 41 42\r",
+ "3 41 43\r",
+ "3 41 44\r",
+ "3 41 45\r",
+ "3 41 46\r",
+ "3 41 47\r",
+ "3 41 48\r",
+ "3 41 49\r",
+ "3 41 50\r",
+ "3 41 51\r",
+ "3 41 52\r",
+ "3 41 53\r",
+ "3 41 54\r",
+ "3 41 55\r",
+ "3 41 56\r",
+ "3 41 57\r",
+ "3 41 58\r",
+ "3 42 1\r",
+ "3 42 2\r",
+ "3 42 3\r",
+ "3 42 4\r",
+ "3 42 5\r",
+ "3 42 6\r",
+ "3 42 7\r",
+ "3 42 8\r",
+ "3 42 9\r",
+ "3 42 10\r",
+ "3 42 11\r",
+ "3 42 12\r",
+ "3 42 13\r",
+ "3 42 14\r",
+ "3 42 15\r",
+ "3 42 16\r",
+ "3 42 17\r",
+ "3 42 18\r",
+ "3 42 19\r",
+ "3 42 20\r",
+ "3 42 21\r",
+ "3 42 22\r",
+ "3 42 23\r",
+ "3 42 24\r",
+ "3 42 25\r",
+ "3 42 26\r",
+ "3 42 27\r",
+ "3 42 28\r",
+ "3 42 29\r",
+ "3 42 30\r",
+ "3 42 31\r",
+ "3 42 32\r",
+ "3 42 33\r",
+ "3 42 34\r",
+ "3 42 35\r",
+ "3 42 36\r",
+ "3 42 37\r",
+ "3 42 38\r",
+ "3 42 39\r",
+ "3 42 40\r",
+ "3 42 41\r",
+ "3 42 42\r",
+ "3 42 43\r",
+ "3 42 44\r",
+ "3 42 45\r",
+ "3 42 46\r",
+ "3 42 47\r",
+ "3 42 48\r",
+ "3 42 49\r",
+ "3 42 50\r",
+ "3 42 51\r",
+ "3 42 52\r",
+ "3 42 53\r",
+ "3 42 54\r",
+ "3 42 55\r",
+ "3 42 56\r",
+ "3 42 57\r",
+ "3 42 58\r",
+ "3 43 1\r",
+ "3 43 2\r",
+ "3 43 3\r",
+ "3 43 4\r",
+ "3 43 5\r",
+ "3 43 6\r",
+ "3 43 7\r",
+ "3 43 8\r",
+ "3 43 9\r",
+ "3 43 10\r",
+ "3 43 11\r",
+ "3 43 12\r",
+ "3 43 13\r",
+ "3 43 14\r",
+ "3 43 15\r",
+ "3 43 16\r",
+ "3 43 17\r",
+ "3 43 18\r",
+ "3 43 19\r",
+ "3 43 20\r",
+ "3 43 21\r",
+ "3 43 22\r",
+ "3 43 23\r",
+ "3 43 24\r",
+ "3 43 25\r",
+ "3 43 26\r",
+ "3 43 27\r",
+ "3 43 28\r",
+ "3 43 29\r",
+ "3 43 30\r",
+ "3 43 31\r",
+ "3 43 32\r",
+ "3 43 33\r",
+ "3 43 34\r",
+ "3 43 35\r",
+ "3 43 36\r",
+ "3 43 37\r",
+ "3 43 38\r",
+ "3 43 39\r",
+ "3 43 40\r",
+ "3 43 41\r",
+ "3 43 42\r",
+ "3 43 43\r",
+ "3 43 44\r",
+ "3 43 45\r",
+ "3 43 46\r",
+ "3 43 47\r",
+ "3 43 48\r",
+ "3 43 49\r",
+ "3 43 50\r",
+ "3 43 51\r",
+ "3 43 52\r",
+ "3 43 53\r",
+ "3 43 54\r",
+ "3 43 55\r",
+ "3 43 56\r",
+ "3 43 57\r",
+ "3 43 58\r",
+ "3 44 1\r",
+ "3 44 2\r",
+ "3 44 3\r",
+ "3 44 4\r",
+ "3 44 5\r",
+ "3 44 6\r",
+ "3 44 7\r",
+ "3 44 8\r",
+ "3 44 9\r",
+ "3 44 10\r",
+ "3 44 11\r",
+ "3 44 12\r",
+ "3 44 13\r",
+ "3 44 14\r",
+ "3 44 15\r",
+ "3 44 16\r",
+ "3 44 17\r",
+ "3 44 18\r",
+ "3 44 19\r",
+ "3 44 20\r",
+ "3 44 21\r",
+ "3 44 22\r",
+ "3 44 23\r",
+ "3 44 24\r",
+ "3 44 25\r",
+ "3 44 26\r",
+ "3 44 27\r",
+ "3 44 28\r",
+ "3 44 29\r",
+ "3 44 30\r",
+ "3 44 31\r",
+ "3 44 32\r",
+ "3 44 33\r",
+ "3 44 34\r",
+ "3 44 35\r",
+ "3 44 36\r",
+ "3 44 37\r",
+ "3 44 38\r",
+ "3 44 39\r",
+ "3 44 40\r",
+ "3 44 41\r",
+ "3 44 42\r",
+ "3 44 43\r",
+ "3 44 44\r",
+ "3 44 45\r",
+ "3 44 46\r",
+ "3 44 47\r",
+ "3 44 48\r",
+ "3 44 49\r",
+ "3 44 50\r",
+ "3 44 51\r",
+ "3 44 52\r",
+ "3 44 53\r",
+ "3 44 54\r",
+ "3 44 55\r",
+ "3 44 56\r",
+ "3 44 57\r",
+ "3 44 58\r",
+ "3 45 1\r",
+ "3 45 2\r",
+ "3 45 3\r",
+ "3 45 4\r",
+ "3 45 5\r",
+ "3 45 6\r",
+ "3 45 7\r",
+ "3 45 8\r",
+ "3 45 9\r",
+ "3 45 10\r",
+ "3 45 11\r",
+ "3 45 12\r",
+ "3 45 13\r",
+ "3 45 14\r",
+ "3 45 15\r",
+ "3 45 16\r",
+ "3 45 17\r",
+ "3 45 18\r",
+ "3 45 19\r",
+ "3 45 20\r",
+ "3 45 21\r",
+ "3 45 22\r",
+ "3 45 23\r",
+ "3 45 24\r",
+ "3 45 25\r",
+ "3 45 26\r",
+ "3 45 27\r",
+ "3 45 28\r",
+ "3 45 29\r",
+ "3 45 30\r",
+ "3 45 31\r",
+ "3 45 32\r",
+ "3 45 33\r",
+ "3 45 34\r",
+ "3 45 35\r",
+ "3 45 36\r",
+ "3 45 37\r",
+ "3 45 38\r",
+ "3 45 39\r",
+ "3 45 40\r",
+ "3 45 41\r",
+ "3 45 42\r",
+ "3 45 43\r",
+ "3 45 44\r",
+ "3 45 45\r",
+ "3 45 46\r",
+ "3 45 47\r",
+ "3 45 48\r",
+ "3 45 49\r",
+ "3 45 50\r",
+ "3 45 51\r",
+ "3 45 52\r",
+ "3 45 53\r",
+ "3 45 54\r",
+ "3 45 55\r",
+ "3 45 56\r",
+ "3 45 57\r",
+ "3 45 58\r",
+ "3 46 1\r",
+ "3 46 2\r",
+ "3 46 3\r",
+ "3 46 4\r",
+ "3 46 5\r",
+ "3 46 6\r",
+ "3 46 7\r",
+ "3 46 8\r",
+ "3 46 9\r",
+ "3 46 10\r",
+ "3 46 11\r",
+ "3 46 12\r",
+ "3 46 13\r",
+ "3 46 14\r",
+ "3 46 15\r",
+ "3 46 16\r",
+ "3 46 17\r",
+ "3 46 18\r",
+ "3 46 19\r",
+ "3 46 20\r",
+ "3 46 21\r",
+ "3 46 22\r",
+ "3 46 23\r",
+ "3 46 24\r",
+ "3 46 25\r",
+ "3 46 26\r",
+ "3 46 27\r",
+ "3 46 28\r",
+ "3 46 29\r",
+ "3 46 30\r",
+ "3 46 31\r",
+ "3 46 32\r",
+ "3 46 33\r",
+ "3 46 34\r",
+ "3 46 35\r",
+ "3 46 36\r",
+ "3 46 37\r",
+ "3 46 38\r",
+ "3 46 39\r",
+ "3 46 40\r",
+ "3 46 41\r",
+ "3 46 42\r",
+ "3 46 43\r",
+ "3 46 44\r",
+ "3 46 45\r",
+ "3 46 46\r",
+ "3 46 47\r",
+ "3 46 48\r",
+ "3 46 49\r",
+ "3 46 50\r",
+ "3 46 51\r",
+ "3 46 52\r",
+ "3 46 53\r",
+ "3 46 54\r",
+ "3 46 55\r",
+ "3 46 56\r",
+ "3 46 57\r",
+ "3 46 58\r",
+ "3 47 1\r",
+ "3 47 2\r",
+ "3 47 3\r",
+ "3 47 4\r",
+ "3 47 5\r",
+ "3 47 6\r",
+ "3 47 7\r",
+ "3 47 8\r",
+ "3 47 9\r",
+ "3 47 10\r",
+ "3 47 11\r",
+ "3 47 12\r",
+ "3 47 13\r",
+ "3 47 14\r",
+ "3 47 15\r",
+ "3 47 16\r",
+ "3 47 17\r",
+ "3 47 18\r",
+ "3 47 19\r",
+ "3 47 20\r",
+ "3 47 21\r",
+ "3 47 22\r",
+ "3 47 23\r",
+ "3 47 24\r",
+ "3 47 25\r",
+ "3 47 26\r",
+ "3 47 27\r",
+ "3 47 28\r",
+ "3 47 29\r",
+ "3 47 30\r",
+ "3 47 31\r",
+ "3 47 32\r",
+ "3 47 33\r",
+ "3 47 34\r",
+ "3 47 35\r",
+ "3 47 36\r",
+ "3 47 37\r",
+ "3 47 38\r",
+ "3 47 39\r",
+ "3 47 40\r",
+ "3 47 41\r",
+ "3 47 42\r",
+ "3 47 43\r",
+ "3 47 44\r",
+ "3 47 45\r",
+ "3 47 46\r",
+ "3 47 47\r",
+ "3 47 48\r",
+ "3 47 49\r",
+ "3 47 50\r",
+ "3 47 51\r",
+ "3 47 52\r",
+ "3 47 53\r",
+ "3 47 54\r",
+ "3 47 55\r",
+ "3 47 56\r",
+ "3 47 57\r",
+ "3 47 58\r",
+ "3 48 1\r",
+ "3 48 2\r",
+ "3 48 3\r",
+ "3 48 4\r",
+ "3 48 5\r",
+ "3 48 6\r",
+ "3 48 7\r",
+ "3 48 8\r",
+ "3 48 9\r",
+ "3 48 10\r",
+ "3 48 11\r",
+ "3 48 12\r",
+ "3 48 13\r",
+ "3 48 14\r",
+ "3 48 15\r",
+ "3 48 16\r",
+ "3 48 17\r",
+ "3 48 18\r",
+ "3 48 19\r",
+ "3 48 20\r",
+ "3 48 21\r",
+ "3 48 22\r",
+ "3 48 23\r",
+ "3 48 24\r",
+ "3 48 25\r",
+ "3 48 26\r",
+ "3 48 27\r",
+ "3 48 28\r",
+ "3 48 29\r",
+ "3 48 30\r",
+ "3 48 31\r",
+ "3 48 32\r",
+ "3 48 33\r",
+ "3 48 34\r",
+ "3 48 35\r",
+ "3 48 36\r",
+ "3 48 37\r",
+ "3 48 38\r",
+ "3 48 39\r",
+ "3 48 40\r",
+ "3 48 41\r",
+ "3 48 42\r",
+ "3 48 43\r",
+ "3 48 44\r",
+ "3 48 45\r",
+ "3 48 46\r",
+ "3 48 47\r",
+ "3 48 48\r",
+ "3 48 49\r",
+ "3 48 50\r",
+ "3 48 51\r",
+ "3 48 52\r",
+ "3 48 53\r",
+ "3 48 54\r",
+ "3 48 55\r",
+ "3 48 56\r",
+ "3 48 57\r",
+ "3 48 58\r",
+ "3 49 1\r",
+ "3 49 2\r",
+ "3 49 3\r",
+ "3 49 4\r",
+ "3 49 5\r",
+ "3 49 6\r",
+ "3 49 7\r",
+ "3 49 8\r",
+ "3 49 9\r",
+ "3 49 10\r",
+ "3 49 11\r",
+ "3 49 12\r",
+ "3 49 13\r",
+ "3 49 14\r",
+ "3 49 15\r",
+ "3 49 16\r",
+ "3 49 17\r",
+ "3 49 18\r",
+ "3 49 19\r",
+ "3 49 20\r",
+ "3 49 21\r",
+ "3 49 22\r",
+ "3 49 23\r",
+ "3 49 24\r",
+ "3 49 25\r",
+ "3 49 26\r",
+ "3 49 27\r",
+ "3 49 28\r",
+ "3 49 29\r",
+ "3 49 30\r",
+ "3 49 31\r",
+ "3 49 32\r",
+ "3 49 33\r",
+ "3 49 34\r",
+ "3 49 35\r",
+ "3 49 36\r",
+ "3 49 37\r",
+ "3 49 38\r",
+ "3 49 39\r",
+ "3 49 40\r",
+ "3 49 41\r",
+ "3 49 42\r",
+ "3 49 43\r",
+ "3 49 44\r",
+ "3 49 45\r",
+ "3 49 46\r",
+ "3 49 47\r",
+ "3 49 48\r",
+ "3 49 49\r",
+ "3 49 50\r",
+ "3 49 51\r",
+ "3 49 52\r",
+ "3 49 53\r",
+ "3 49 54\r",
+ "3 49 55\r",
+ "3 49 56\r",
+ "3 49 57\r",
+ "3 49 58\r",
+ "3 50 1\r",
+ "3 50 2\r",
+ "3 50 3\r",
+ "3 50 4\r",
+ "3 50 5\r",
+ "3 50 6\r",
+ "3 50 7\r",
+ "3 50 8\r",
+ "3 50 9\r",
+ "3 50 10\r",
+ "3 50 11\r",
+ "3 50 12\r",
+ "3 50 13\r",
+ "3 50 14\r",
+ "3 50 15\r",
+ "3 50 16\r",
+ "3 50 17\r",
+ "3 50 18\r",
+ "3 50 19\r",
+ "3 50 20\r",
+ "3 50 21\r",
+ "3 50 22\r",
+ "3 50 23\r",
+ "3 50 24\r",
+ "3 50 25\r",
+ "3 50 26\r",
+ "3 50 27\r",
+ "3 50 28\r",
+ "3 50 29\r",
+ "3 50 30\r",
+ "3 50 31\r",
+ "3 50 32\r",
+ "3 50 33\r",
+ "3 50 34\r",
+ "3 50 35\r",
+ "3 50 36\r",
+ "3 50 37\r",
+ "3 50 38\r",
+ "3 50 39\r",
+ "3 50 40\r",
+ "3 50 41\r",
+ "3 50 42\r",
+ "3 50 43"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "3 50 44\r",
+ "3 50 45\r",
+ "3 50 46\r",
+ "3 50 47\r",
+ "3 50 48\r",
+ "3 50 49\r",
+ "3 50 50\r",
+ "3 50 51\r",
+ "3 50 52\r",
+ "3 50 53\r",
+ "3 50 54\r",
+ "3 50 55\r",
+ "3 50 56\r",
+ "3 50 57\r",
+ "3 50 58\r",
+ "3 51 1\r",
+ "3 51 2\r",
+ "3 51 3\r",
+ "3 51 4\r",
+ "3 51 5\r",
+ "3 51 6\r",
+ "3 51 7\r",
+ "3 51 8\r",
+ "3 51 9\r",
+ "3 51 10\r",
+ "3 51 11\r",
+ "3 51 12\r",
+ "3 51 13\r",
+ "3 51 14\r",
+ "3 51 15\r",
+ "3 51 16\r",
+ "3 51 17\r",
+ "3 51 18\r",
+ "3 51 19\r",
+ "3 51 20\r",
+ "3 51 21\r",
+ "3 51 22\r",
+ "3 51 23\r",
+ "3 51 24\r",
+ "3 51 25\r",
+ "3 51 26\r",
+ "3 51 27\r",
+ "3 51 28\r",
+ "3 51 29\r",
+ "3 51 30\r",
+ "3 51 31\r",
+ "3 51 32\r",
+ "3 51 33\r",
+ "3 51 34\r",
+ "3 51 35\r",
+ "3 51 36\r",
+ "3 51 37\r",
+ "3 51 38\r",
+ "3 51 39\r",
+ "3 51 40\r",
+ "3 51 41\r",
+ "3 51 42\r",
+ "3 51 43\r",
+ "3 51 44\r",
+ "3 51 45\r",
+ "3 51 46\r",
+ "3 51 47\r",
+ "3 51 48\r",
+ "3 51 49\r",
+ "3 51 50\r",
+ "3 51 51\r",
+ "3 51 52\r",
+ "3 51 53\r",
+ "3 51 54\r",
+ "3 51 55\r",
+ "3 51 56\r",
+ "3 51 57\r",
+ "3 51 58\r",
+ "3 52 1\r",
+ "3 52 2\r",
+ "3 52 3\r",
+ "3 52 4\r",
+ "3 52 5\r",
+ "3 52 6\r",
+ "3 52 7\r",
+ "3 52 8\r",
+ "3 52 9\r",
+ "3 52 10\r",
+ "3 52 11\r",
+ "3 52 12\r",
+ "3 52 13\r",
+ "3 52 14\r",
+ "3 52 15\r",
+ "3 52 16\r",
+ "3 52 17\r",
+ "3 52 18\r",
+ "3 52 19\r",
+ "3 52 20\r",
+ "3 52 21\r",
+ "3 52 22\r",
+ "3 52 23\r",
+ "3 52 24\r",
+ "3 52 25\r",
+ "3 52 26\r",
+ "3 52 27\r",
+ "3 52 28\r",
+ "3 52 29\r",
+ "3 52 30\r",
+ "3 52 31\r",
+ "3 52 32\r",
+ "3 52 33\r",
+ "3 52 34\r",
+ "3 52 35\r",
+ "3 52 36\r",
+ "3 52 37\r",
+ "3 52 38\r",
+ "3 52 39\r",
+ "3 52 40\r",
+ "3 52 41\r",
+ "3 52 42\r",
+ "3 52 43\r",
+ "3 52 44\r",
+ "3 52 45\r",
+ "3 52 46\r",
+ "3 52 47\r",
+ "3 52 48\r",
+ "3 52 49\r",
+ "3 52 50\r",
+ "3 52 51\r",
+ "3 52 52\r",
+ "3 52 53\r",
+ "3 52 54\r",
+ "3 52 55\r",
+ "3 52 56\r",
+ "3 52 57\r",
+ "3 52 58\r",
+ "3 53 1\r",
+ "3 53 2\r",
+ "3 53 3\r",
+ "3 53 4\r",
+ "3 53 5\r",
+ "3 53 6\r",
+ "3 53 7\r",
+ "3 53 8\r",
+ "3 53 9\r",
+ "3 53 10\r",
+ "3 53 11\r",
+ "3 53 12\r",
+ "3 53 13\r",
+ "3 53 14\r",
+ "3 53 15\r",
+ "3 53 16\r",
+ "3 53 17\r",
+ "3 53 18\r",
+ "3 53 19\r",
+ "3 53 20\r",
+ "3 53 21\r",
+ "3 53 22\r",
+ "3 53 23\r",
+ "3 53 24\r",
+ "3 53 25\r",
+ "3 53 26\r",
+ "3 53 27\r",
+ "3 53 28\r",
+ "3 53 29\r",
+ "3 53 30\r",
+ "3 53 31\r",
+ "3 53 32\r",
+ "3 53 33\r",
+ "3 53 34\r",
+ "3 53 35\r",
+ "3 53 36\r",
+ "3 53 37\r",
+ "3 53 38\r",
+ "3 53 39\r",
+ "3 53 40\r",
+ "3 53 41\r",
+ "3 53 42\r",
+ "3 53 43\r",
+ "3 53 44\r",
+ "3 53 45\r",
+ "3 53 46\r",
+ "3 53 47\r",
+ "3 53 48\r",
+ "3 53 49\r",
+ "3 53 50\r",
+ "3 53 51\r",
+ "3 53 52\r",
+ "3 53 53\r",
+ "3 53 54\r",
+ "3 53 55\r",
+ "3 53 56\r",
+ "3 53 57\r",
+ "3 53 58\r",
+ "3 54 1\r",
+ "3 54 2\r",
+ "3 54 3\r",
+ "3 54 4\r",
+ "3 54 5\r",
+ "3 54 6\r",
+ "3 54 7\r",
+ "3 54 8\r",
+ "3 54 9\r",
+ "3 54 10\r",
+ "3 54 11\r",
+ "3 54 12\r",
+ "3 54 13\r",
+ "3 54 14\r",
+ "3 54 15\r",
+ "3 54 16\r",
+ "3 54 17\r",
+ "3 54 18\r",
+ "3 54 19\r",
+ "3 54 20\r",
+ "3 54 21\r",
+ "3 54 22\r",
+ "3 54 23\r",
+ "3 54 24\r",
+ "3 54 25\r",
+ "3 54 26\r",
+ "3 54 27\r",
+ "3 54 28\r",
+ "3 54 29\r",
+ "3 54 30\r",
+ "3 54 31\r",
+ "3 54 32\r",
+ "3 54 33\r",
+ "3 54 34\r",
+ "3 54 35\r",
+ "3 54 36\r",
+ "3 54 37\r",
+ "3 54 38\r",
+ "3 54 39\r",
+ "3 54 40\r",
+ "3 54 41\r",
+ "3 54 42\r",
+ "3 54 43\r",
+ "3 54 44\r",
+ "3 54 45\r",
+ "3 54 46\r",
+ "3 54 47\r",
+ "3 54 48\r",
+ "3 54 49\r",
+ "3 54 50\r",
+ "3 54 51\r",
+ "3 54 52\r",
+ "3 54 53\r",
+ "3 54 54\r",
+ "3 54 55\r",
+ "3 54 56\r",
+ "3 54 57\r",
+ "3 54 58\r",
+ "3 55 1\r",
+ "3 55 2\r",
+ "3 55 3\r",
+ "3 55 4\r",
+ "3 55 5\r",
+ "3 55 6\r",
+ "3 55 7\r",
+ "3 55 8\r",
+ "3 55 9\r",
+ "3 55 10\r",
+ "3 55 11\r",
+ "3 55 12\r",
+ "3 55 13\r",
+ "3 55 14\r",
+ "3 55 15\r",
+ "3 55 16\r",
+ "3 55 17\r",
+ "3 55 18\r",
+ "3 55 19\r",
+ "3 55 20\r",
+ "3 55 21\r",
+ "3 55 22\r",
+ "3 55 23\r",
+ "3 55 24\r",
+ "3 55 25\r",
+ "3 55 26\r",
+ "3 55 27\r",
+ "3 55 28\r",
+ "3 55 29\r",
+ "3 55 30\r",
+ "3 55 31\r",
+ "3 55 32\r",
+ "3 55 33\r",
+ "3 55 34\r",
+ "3 55 35\r",
+ "3 55 36\r",
+ "3 55 37\r",
+ "3 55 38\r",
+ "3 55 39\r",
+ "3 55 40\r",
+ "3 55 41\r",
+ "3 55 42\r",
+ "3 55 43\r",
+ "3 55 44\r",
+ "3 55 45\r",
+ "3 55 46\r",
+ "3 55 47\r",
+ "3 55 48\r",
+ "3 55 49\r",
+ "3 55 50\r",
+ "3 55 51\r",
+ "3 55 52\r",
+ "3 55 53\r",
+ "3 55 54\r",
+ "3 55 55\r",
+ "3 55 56\r",
+ "3 55 57\r",
+ "3 55 58\r",
+ "3 56 1\r",
+ "3 56 2\r",
+ "3 56 3\r",
+ "3 56 4\r",
+ "3 56 5\r",
+ "3 56 6\r",
+ "3 56 7\r",
+ "3 56 8\r",
+ "3 56 9\r",
+ "3 56 10\r",
+ "3 56 11\r",
+ "3 56 12\r",
+ "3 56 13\r",
+ "3 56 14\r",
+ "3 56 15\r",
+ "3 56 16\r",
+ "3 56 17\r",
+ "3 56 18\r",
+ "3 56 19\r",
+ "3 56 20\r",
+ "3 56 21\r",
+ "3 56 22\r",
+ "3 56 23\r",
+ "3 56 24\r",
+ "3 56 25\r",
+ "3 56 26\r",
+ "3 56 27\r",
+ "3 56 28\r",
+ "3 56 29\r",
+ "3 56 30\r",
+ "3 56 31\r",
+ "3 56 32\r",
+ "3 56 33\r",
+ "3 56 34\r",
+ "3 56 35\r",
+ "3 56 36\r",
+ "3 56 37\r",
+ "3 56 38\r",
+ "3 56 39\r",
+ "3 56 40\r",
+ "3 56 41\r",
+ "3 56 42\r",
+ "3 56 43\r",
+ "3 56 44\r",
+ "3 56 45\r",
+ "3 56 46\r",
+ "3 56 47\r",
+ "3 56 48\r",
+ "3 56 49\r",
+ "3 56 50\r",
+ "3 56 51\r",
+ "3 56 52\r",
+ "3 56 53\r",
+ "3 56 54\r",
+ "3 56 55\r",
+ "3 56 56\r",
+ "3 56 57\r",
+ "3 56 58\r",
+ "3 57 1\r",
+ "3 57 2\r",
+ "3 57 3\r",
+ "3 57 4\r",
+ "3 57 5\r",
+ "3 57 6\r",
+ "3 57 7\r",
+ "3 57 8\r",
+ "3 57 9\r",
+ "3 57 10\r",
+ "3 57 11\r",
+ "3 57 12\r",
+ "3 57 13\r",
+ "3 57 14\r",
+ "3 57 15\r",
+ "3 57 16\r",
+ "3 57 17\r",
+ "3 57 18\r",
+ "3 57 19\r",
+ "3 57 20\r",
+ "3 57 21\r",
+ "3 57 22\r",
+ "3 57 23\r",
+ "3 57 24\r",
+ "3 57 25\r",
+ "3 57 26\r",
+ "3 57 27\r",
+ "3 57 28\r",
+ "3 57 29\r",
+ "3 57 30\r",
+ "3 57 31\r",
+ "3 57 32\r",
+ "3 57 33\r",
+ "3 57 34\r",
+ "3 57 35\r",
+ "3 57 36\r",
+ "3 57 37\r",
+ "3 57 38\r",
+ "3 57 39\r",
+ "3 57 40\r",
+ "3 57 41\r",
+ "3 57 42\r",
+ "3 57 43\r",
+ "3 57 44\r",
+ "3 57 45\r",
+ "3 57 46\r",
+ "3 57 47\r",
+ "3 57 48\r",
+ "3 57 49\r",
+ "3 57 50\r",
+ "3 57 51\r",
+ "3 57 52\r",
+ "3 57 53\r",
+ "3 57 54\r",
+ "3 57 55\r",
+ "3 57 56\r",
+ "3 57 57\r",
+ "3 57 58\r",
+ "3 58 1\r",
+ "3 58 2\r",
+ "3 58 3\r",
+ "3 58 4\r",
+ "3 58 5\r",
+ "3 58 6\r",
+ "3 58 7\r",
+ "3 58 8\r",
+ "3 58 9\r",
+ "3 58 10\r",
+ "3 58 11\r",
+ "3 58 12\r",
+ "3 58 13\r",
+ "3 58 14\r",
+ "3 58 15\r",
+ "3 58 16\r",
+ "3 58 17\r",
+ "3 58 18\r",
+ "3 58 19\r",
+ "3 58 20\r",
+ "3 58 21\r",
+ "3 58 22\r",
+ "3 58 23\r",
+ "3 58 24\r",
+ "3 58 25\r",
+ "3 58 26\r",
+ "3 58 27\r",
+ "3 58 28\r",
+ "3 58 29\r",
+ "3 58 30\r",
+ "3 58 31\r",
+ "3 58 32\r",
+ "3 58 33\r",
+ "3 58 34\r",
+ "3 58 35\r",
+ "3 58 36\r",
+ "3 58 37\r",
+ "3 58 38\r",
+ "3 58 39\r",
+ "3 58 40\r",
+ "3 58 41\r",
+ "3 58 42\r",
+ "3 58 43\r",
+ "3 58 44\r",
+ "3 58 45\r",
+ "3 58 46\r",
+ "3 58 47\r",
+ "3 58 48\r",
+ "3 58 49\r",
+ "3 58 50\r",
+ "3 58 51\r",
+ "3 58 52\r",
+ "3 58 53\r",
+ "3 58 54\r",
+ "3 58 55\r",
+ "3 58 56\r",
+ "3 58 57\r",
+ "3 58 58\r",
+ "4 1 1\r",
+ "4 1 2\r",
+ "4 1 3\r",
+ "4 1 4\r",
+ "4 1 5\r",
+ "4 1 6\r",
+ "4 1 7\r",
+ "4 1 8\r",
+ "4 1 9\r",
+ "4 1 10\r",
+ "4 1 11\r",
+ "4 1 12\r",
+ "4 1 13\r",
+ "4 1 14\r",
+ "4 1 15\r",
+ "4 1 16\r",
+ "4 1 17\r",
+ "4 1 18\r",
+ "4 1 19\r",
+ "4 1 20\r",
+ "4 1 21\r",
+ "4 1 22\r",
+ "4 1 23\r",
+ "4 1 24\r",
+ "4 1 25\r",
+ "4 1 26\r",
+ "4 1 27\r",
+ "4 1 28\r",
+ "4 1 29\r",
+ "4 1 30\r",
+ "4 1 31\r",
+ "4 1 32\r",
+ "4 1 33\r",
+ "4 1 34\r",
+ "4 1 35\r",
+ "4 1 36\r",
+ "4 1 37\r",
+ "4 1 38\r",
+ "4 1 39\r",
+ "4 1 40\r",
+ "4 1 41\r",
+ "4 1 42\r",
+ "4 1 43\r",
+ "4 1 44\r",
+ "4 1 45\r",
+ "4 1 46\r",
+ "4 1 47\r",
+ "4 1 48\r",
+ "4 1 49\r",
+ "4 1 50\r",
+ "4 1 51\r",
+ "4 1 52\r",
+ "4 1 53\r",
+ "4 1 54\r",
+ "4 1 55\r",
+ "4 1 56\r",
+ "4 1 57\r",
+ "4 1 58\r",
+ "4 2 1\r",
+ "4 2 2\r",
+ "4 2 3\r",
+ "4 2 4\r",
+ "4 2 5\r",
+ "4 2 6\r",
+ "4 2 7\r",
+ "4 2 8\r",
+ "4 2 9\r",
+ "4 2 10\r",
+ "4 2 11\r",
+ "4 2 12\r",
+ "4 2 13\r",
+ "4 2 14\r",
+ "4 2 15\r",
+ "4 2 16\r",
+ "4 2 17\r",
+ "4 2 18\r",
+ "4 2 19\r",
+ "4 2 20\r",
+ "4 2 21\r",
+ "4 2 22\r",
+ "4 2 23\r",
+ "4 2 24\r",
+ "4 2 25\r",
+ "4 2 26\r",
+ "4 2 27\r",
+ "4 2 28\r",
+ "4 2 29\r",
+ "4 2 30\r",
+ "4 2 31\r",
+ "4 2 32\r",
+ "4 2 33\r",
+ "4 2 34\r",
+ "4 2 35\r",
+ "4 2 36\r",
+ "4 2 37\r",
+ "4 2 38\r",
+ "4 2 39\r",
+ "4 2 40\r",
+ "4 2 41\r",
+ "4 2 42\r",
+ "4 2 43\r",
+ "4 2 44\r",
+ "4 2 45\r",
+ "4 2 46\r",
+ "4 2 47\r",
+ "4 2 48\r",
+ "4 2 49\r",
+ "4 2 50\r",
+ "4 2 51\r",
+ "4 2 52\r",
+ "4 2 53\r",
+ "4 2 54\r",
+ "4 2 55\r",
+ "4 2 56\r",
+ "4 2 57\r",
+ "4 2 58\r",
+ "4 3 1\r",
+ "4 3 2\r",
+ "4 3 3\r",
+ "4 3 4\r",
+ "4 3 5\r",
+ "4 3 6\r",
+ "4 3 7\r",
+ "4 3 8\r",
+ "4 3 9\r",
+ "4 3 10\r",
+ "4 3 11\r",
+ "4 3 12\r",
+ "4 3 13\r",
+ "4 3 14\r",
+ "4 3 15\r",
+ "4 3 16\r",
+ "4 3 17\r",
+ "4 3 18\r",
+ "4 3 19\r",
+ "4 3 20\r",
+ "4 3 21\r",
+ "4 3 22\r",
+ "4 3 23\r",
+ "4 3 24\r",
+ "4 3 25\r",
+ "4 3 26\r",
+ "4 3 27\r",
+ "4 3 28\r",
+ "4 3 29\r",
+ "4 3 30\r",
+ "4 3 31\r",
+ "4 3 32\r",
+ "4 3 33\r",
+ "4 3 34\r",
+ "4 3 35\r",
+ "4 3 36\r",
+ "4 3 37\r",
+ "4 3 38\r",
+ "4 3 39\r",
+ "4 3 40\r",
+ "4 3 41\r",
+ "4 3 42\r",
+ "4 3 43\r",
+ "4 3 44\r",
+ "4 3 45\r",
+ "4 3 46\r",
+ "4 3 47\r",
+ "4 3 48\r",
+ "4 3 49\r",
+ "4 3 50\r",
+ "4 3 51\r",
+ "4 3 52\r",
+ "4 3 53\r",
+ "4 3 54\r",
+ "4 3 55\r",
+ "4 3 56\r",
+ "4 3 57\r",
+ "4 3 58\r",
+ "4 4 1\r",
+ "4 4 2\r",
+ "4 4 3\r",
+ "4 4 4\r",
+ "4 4 5\r",
+ "4 4 6\r",
+ "4 4 7\r",
+ "4 4 8\r",
+ "4 4 9\r",
+ "4 4 10\r",
+ "4 4 11\r",
+ "4 4 12\r",
+ "4 4 13\r",
+ "4 4 14\r",
+ "4 4 15\r",
+ "4 4 16\r",
+ "4 4 17\r",
+ "4 4 18\r",
+ "4 4 19\r",
+ "4 4 20\r",
+ "4 4 21\r",
+ "4 4 22\r",
+ "4 4 23\r",
+ "4 4 24\r",
+ "4 4 25\r",
+ "4 4 26\r",
+ "4 4 27\r",
+ "4 4 28\r",
+ "4 4 29\r",
+ "4 4 30\r",
+ "4 4 31\r",
+ "4 4 32\r",
+ "4 4 33\r",
+ "4 4 34\r",
+ "4 4 35\r",
+ "4 4 36\r",
+ "4 4 37\r",
+ "4 4 38\r",
+ "4 4 39\r",
+ "4 4 40\r",
+ "4 4 41\r",
+ "4 4 42\r",
+ "4 4 43\r",
+ "4 4 44\r",
+ "4 4 45\r",
+ "4 4 46\r",
+ "4 4 47\r",
+ "4 4 48\r",
+ "4 4 49\r",
+ "4 4 50\r",
+ "4 4 51\r",
+ "4 4 52\r",
+ "4 4 53\r",
+ "4 4 54\r",
+ "4 4 55\r",
+ "4 4 56\r",
+ "4 4 57\r",
+ "4 4 58\r",
+ "4 5 1\r",
+ "4 5 2\r",
+ "4 5 3\r",
+ "4 5 4\r",
+ "4 5 5\r",
+ "4 5 6\r",
+ "4 5 7\r",
+ "4 5 8\r",
+ "4 5 9\r",
+ "4 5 10\r",
+ "4 5 11\r",
+ "4 5 12\r",
+ "4 5 13\r",
+ "4 5 14\r",
+ "4 5 15\r",
+ "4 5 16\r",
+ "4 5 17\r",
+ "4 5 18\r",
+ "4 5 19\r",
+ "4 5 20\r",
+ "4 5 21\r",
+ "4 5 22\r",
+ "4 5 23\r",
+ "4 5 24\r",
+ "4 5 25\r",
+ "4 5 26\r",
+ "4 5 27\r",
+ "4 5 28\r",
+ "4 5 29\r",
+ "4 5 30\r",
+ "4 5 31\r",
+ "4 5 32\r",
+ "4 5 33\r",
+ "4 5 34\r",
+ "4 5 35\r",
+ "4 5 36\r",
+ "4 5 37\r",
+ "4 5 38\r",
+ "4 5 39\r",
+ "4 5 40\r",
+ "4 5 41\r",
+ "4 5 42\r",
+ "4 5 43\r",
+ "4 5 44\r",
+ "4 5 45\r",
+ "4 5 46\r",
+ "4 5 47\r",
+ "4 5 48\r",
+ "4 5 49\r",
+ "4 5 50\r",
+ "4 5 51\r",
+ "4 5 52\r",
+ "4 5 53\r",
+ "4 5 54\r",
+ "4 5 55\r",
+ "4 5 56\r",
+ "4 5 57\r",
+ "4 5 58\r",
+ "4 6 1\r",
+ "4 6 2\r",
+ "4 6 3\r",
+ "4 6 4\r",
+ "4 6 5\r",
+ "4 6 6\r",
+ "4 6 7\r",
+ "4 6 8\r",
+ "4 6 9\r",
+ "4 6 10\r",
+ "4 6 11\r",
+ "4 6 12\r",
+ "4 6 13\r",
+ "4 6 14\r",
+ "4 6 15\r",
+ "4 6 16\r",
+ "4 6 17\r",
+ "4 6 18\r",
+ "4 6 19\r",
+ "4 6 20\r",
+ "4 6 21\r",
+ "4 6 22\r",
+ "4 6 23\r",
+ "4 6 24\r",
+ "4 6 25\r",
+ "4 6 26\r",
+ "4 6 27\r",
+ "4 6 28\r",
+ "4 6 29\r",
+ "4 6 30\r",
+ "4 6 31\r",
+ "4 6 32\r",
+ "4 6 33\r",
+ "4 6 34\r",
+ "4 6 35\r",
+ "4 6 36\r",
+ "4 6 37\r",
+ "4 6 38\r",
+ "4 6 39\r",
+ "4 6 40\r",
+ "4 6 41\r",
+ "4 6 42\r",
+ "4 6 43\r",
+ "4 6 44\r",
+ "4 6 45\r",
+ "4 6 46\r",
+ "4 6 47\r",
+ "4 6 48\r",
+ "4 6 49\r",
+ "4 6 50\r",
+ "4 6 51\r",
+ "4 6 52\r",
+ "4 6 53\r",
+ "4 6 54\r",
+ "4 6 55\r",
+ "4 6 56\r",
+ "4 6 57\r",
+ "4 6 58\r",
+ "4 7 1\r",
+ "4 7 2\r",
+ "4 7 3\r",
+ "4 7 4\r",
+ "4 7 5\r",
+ "4 7 6\r",
+ "4 7 7\r",
+ "4 7 8\r",
+ "4 7 9\r",
+ "4 7 10\r",
+ "4 7 11\r",
+ "4 7 12\r",
+ "4 7 13\r",
+ "4 7 14\r",
+ "4 7 15\r",
+ "4 7 16\r",
+ "4 7 17\r",
+ "4 7 18\r",
+ "4 7 19\r",
+ "4 7 20\r",
+ "4 7 21\r",
+ "4 7 22\r",
+ "4 7 23\r",
+ "4 7 24\r",
+ "4 7 25\r",
+ "4 7 26\r",
+ "4 7 27\r",
+ "4 7 28\r",
+ "4 7 29\r",
+ "4 7 30\r",
+ "4 7 31\r",
+ "4 7 32\r",
+ "4 7 33\r",
+ "4 7 34\r",
+ "4 7 35\r",
+ "4 7 36\r",
+ "4 7 37\r",
+ "4 7 38\r",
+ "4 7 39\r",
+ "4 7 40\r",
+ "4 7 41\r",
+ "4 7 42\r",
+ "4 7 43\r",
+ "4 7 44\r",
+ "4 7 45\r",
+ "4 7 46\r",
+ "4 7 47\r",
+ "4 7 48\r",
+ "4 7 49\r",
+ "4 7 50\r",
+ "4 7 51\r",
+ "4 7 52\r",
+ "4 7 53\r",
+ "4 7 54\r",
+ "4 7 55\r",
+ "4 7 56\r",
+ "4 7 57\r",
+ "4 7 58\r",
+ "4 8 1\r",
+ "4 8 2\r",
+ "4 8 3\r",
+ "4 8 4\r",
+ "4 8 5\r",
+ "4 8 6\r",
+ "4 8 7\r",
+ "4 8 8\r",
+ "4 8 9\r",
+ "4 8 10\r",
+ "4 8 11\r",
+ "4 8 12\r",
+ "4 8 13\r",
+ "4 8 14\r",
+ "4 8 15\r",
+ "4 8 16\r",
+ "4 8 17\r",
+ "4 8 18\r",
+ "4 8 19\r",
+ "4 8 20\r",
+ "4 8 21\r",
+ "4 8 22\r",
+ "4 8 23\r",
+ "4 8 24\r",
+ "4 8 25\r",
+ "4 8 26\r",
+ "4 8 27\r",
+ "4 8 28\r",
+ "4 8 29\r",
+ "4 8 30\r",
+ "4 8 31\r",
+ "4 8 32\r",
+ "4 8 33\r",
+ "4 8 34\r",
+ "4 8 35\r",
+ "4 8 36\r",
+ "4 8 37\r",
+ "4 8 38\r",
+ "4 8 39\r",
+ "4 8 40\r",
+ "4 8 41\r",
+ "4 8 42\r",
+ "4 8 43\r",
+ "4 8 44\r",
+ "4 8 45\r",
+ "4 8 46\r",
+ "4 8 47\r",
+ "4 8 48\r",
+ "4 8 49\r",
+ "4 8 50\r",
+ "4 8 51\r",
+ "4 8 52\r",
+ "4 8 53\r",
+ "4 8 54\r",
+ "4 8 55\r",
+ "4 8 56\r",
+ "4 8 57\r",
+ "4 8 58\r",
+ "4 9 1\r",
+ "4 9 2\r",
+ "4 9 3\r",
+ "4 9 4\r",
+ "4 9 5\r",
+ "4 9 6\r",
+ "4 9 7\r",
+ "4 9 8\r",
+ "4 9 9\r",
+ "4 9 10\r",
+ "4 9 11\r",
+ "4 9 12\r",
+ "4 9 13\r",
+ "4 9 14\r",
+ "4 9 15\r",
+ "4 9 16\r",
+ "4 9 17\r",
+ "4 9 18\r",
+ "4 9 19\r",
+ "4 9 20\r",
+ "4 9 21\r",
+ "4 9 22\r",
+ "4 9 23\r",
+ "4 9 24\r",
+ "4 9 25\r",
+ "4 9 26\r",
+ "4 9 27\r",
+ "4 9 28\r",
+ "4 9 29\r",
+ "4 9 30\r",
+ "4 9 31\r",
+ "4 9 32\r",
+ "4 9 33\r",
+ "4 9 34\r",
+ "4 9 35\r",
+ "4 9 36\r",
+ "4 9 37\r",
+ "4 9 38\r",
+ "4 9 39\r",
+ "4 9 40\r",
+ "4 9 41\r",
+ "4 9 42\r",
+ "4 9 43\r",
+ "4 9 44\r",
+ "4 9 45\r",
+ "4 9 46\r",
+ "4 9 47\r",
+ "4 9 48\r",
+ "4 9 49\r",
+ "4 9 50\r",
+ "4 9 51\r",
+ "4 9 52\r",
+ "4 9 53\r",
+ "4 9 54\r",
+ "4 9 55\r",
+ "4 9 56\r",
+ "4 9 57\r",
+ "4 9 58\r",
+ "4 10 1\r",
+ "4 10 2\r",
+ "4 10 3\r",
+ "4 10 4\r",
+ "4 10 5\r",
+ "4 10 6\r",
+ "4 10 7\r",
+ "4 10 8\r",
+ "4 10 9\r",
+ "4 10 10\r",
+ "4 10 11\r",
+ "4 10 12\r",
+ "4 10 13\r",
+ "4 10 14\r",
+ "4 10 15\r",
+ "4 10 16\r",
+ "4 10 17\r",
+ "4 10 18\r",
+ "4 10 19\r",
+ "4 10 20\r",
+ "4 10 21\r",
+ "4 10 22\r",
+ "4 10 23\r",
+ "4 10 24\r",
+ "4 10 25\r",
+ "4 10 26\r",
+ "4 10 27\r",
+ "4 10 28\r",
+ "4 10 29\r",
+ "4 10 30\r",
+ "4 10 31\r",
+ "4 10 32\r",
+ "4 10 33\r",
+ "4 10 34\r",
+ "4 10 35\r",
+ "4 10 36\r",
+ "4 10 37\r",
+ "4 10 38\r",
+ "4 10 39\r",
+ "4 10 40\r",
+ "4 10 41\r",
+ "4 10 42\r",
+ "4 10 43\r",
+ "4 10 44\r",
+ "4 10 45\r",
+ "4 10 46\r",
+ "4 10 47\r",
+ "4 10 48\r",
+ "4 10 49\r",
+ "4 10 50\r",
+ "4 10 51\r",
+ "4 10 52\r",
+ "4 10 53\r",
+ "4 10 54\r",
+ "4 10 55\r",
+ "4 10 56\r",
+ "4 10 57\r",
+ "4 10 58\r",
+ "4 11 1\r",
+ "4 11 2\r",
+ "4 11 3\r",
+ "4 11 4\r",
+ "4 11 5\r",
+ "4 11 6\r",
+ "4 11 7\r",
+ "4 11 8\r",
+ "4 11 9\r",
+ "4 11 10\r",
+ "4 11 11\r",
+ "4 11 12\r",
+ "4 11 13\r",
+ "4 11 14\r",
+ "4 11 15\r",
+ "4 11 16\r",
+ "4 11 17\r",
+ "4 11 18\r",
+ "4 11 19\r",
+ "4 11 20\r",
+ "4 11 21\r",
+ "4 11 22\r",
+ "4 11 23\r",
+ "4 11 24\r",
+ "4 11 25\r",
+ "4 11 26\r",
+ "4 11 27\r",
+ "4 11 28\r",
+ "4 11 29\r",
+ "4 11 30\r",
+ "4 11 31\r",
+ "4 11 32\r",
+ "4 11 33\r",
+ "4 11 34\r",
+ "4 11 35\r",
+ "4 11 36\r",
+ "4 11 37\r",
+ "4 11 38\r",
+ "4 11 39\r",
+ "4 11 40\r",
+ "4 11 41\r",
+ "4 11 42\r",
+ "4 11 43\r",
+ "4 11 44\r",
+ "4 11 45\r",
+ "4 11 46\r",
+ "4 11 47\r",
+ "4 11 48\r",
+ "4 11 49\r",
+ "4 11 50\r",
+ "4 11 51\r",
+ "4 11 52\r",
+ "4 11 53\r",
+ "4 11 54\r",
+ "4 11 55\r",
+ "4 11 56\r",
+ "4 11 57\r",
+ "4 11 58\r",
+ "4 12 1\r",
+ "4 12 2\r",
+ "4 12 3\r",
+ "4 12 4\r",
+ "4 12 5\r",
+ "4 12 6\r",
+ "4 12 7\r",
+ "4 12 8\r",
+ "4 12 9\r",
+ "4 12 10\r",
+ "4 12 11\r",
+ "4 12 12\r",
+ "4 12 13\r",
+ "4 12 14\r",
+ "4 12 15\r",
+ "4 12 16\r",
+ "4 12 17\r",
+ "4 12 18\r",
+ "4 12 19\r",
+ "4 12 20\r",
+ "4 12 21\r",
+ "4 12 22\r",
+ "4 12 23\r",
+ "4 12 24\r",
+ "4 12 25\r",
+ "4 12 26\r",
+ "4 12 27\r",
+ "4 12 28\r",
+ "4 12 29\r",
+ "4 12 30\r",
+ "4 12 31\r",
+ "4 12 32\r",
+ "4 12 33\r",
+ "4 12 34\r",
+ "4 12 35\r",
+ "4 12 36\r",
+ "4 12 37\r",
+ "4 12 38\r",
+ "4 12 39\r",
+ "4 12 40\r",
+ "4 12 41\r",
+ "4 12 42\r",
+ "4 12 43\r",
+ "4 12 44\r",
+ "4 12 45\r",
+ "4 12 46\r",
+ "4 12 47\r",
+ "4 12 48\r",
+ "4 12 49\r",
+ "4 12 50\r",
+ "4 12 51\r",
+ "4 12 52\r",
+ "4 12 53\r",
+ "4 12 54\r",
+ "4 12 55\r",
+ "4 12 56\r",
+ "4 12 57\r",
+ "4 12 58\r",
+ "4 13 1\r",
+ "4 13 2\r",
+ "4 13 3\r",
+ "4 13 4\r",
+ "4 13 5\r",
+ "4 13 6\r",
+ "4 13 7\r",
+ "4 13 8\r",
+ "4 13 9\r",
+ "4 13 10\r",
+ "4 13 11\r",
+ "4 13 12\r",
+ "4 13 13\r",
+ "4 13 14\r",
+ "4 13 15\r",
+ "4 13 16\r",
+ "4 13 17\r",
+ "4 13 18\r",
+ "4 13 19\r",
+ "4 13 20\r",
+ "4 13 21\r",
+ "4 13 22\r",
+ "4 13 23\r",
+ "4 13 24\r",
+ "4 13 25\r",
+ "4 13 26\r",
+ "4 13 27\r",
+ "4 13 28\r",
+ "4 13 29\r",
+ "4 13 30\r",
+ "4 13 31\r",
+ "4 13 32\r",
+ "4 13 33\r",
+ "4 13 34\r",
+ "4 13 35\r",
+ "4 13 36\r",
+ "4 13 37\r",
+ "4 13 38\r",
+ "4 13 39\r",
+ "4 13 40\r",
+ "4 13 41\r",
+ "4 13 42\r",
+ "4 13 43\r",
+ "4 13 44\r",
+ "4 13 45\r",
+ "4 13 46\r",
+ "4 13 47\r",
+ "4 13 48\r",
+ "4 13 49\r",
+ "4 13 50\r",
+ "4 13 51\r",
+ "4 13 52\r",
+ "4 13 53\r",
+ "4 13 54\r",
+ "4 13 55\r",
+ "4 13 56\r",
+ "4 13 57\r",
+ "4 13 58\r",
+ "4 14 1\r",
+ "4 14 2\r",
+ "4 14 3\r",
+ "4 14 4\r",
+ "4 14 5\r",
+ "4 14 6\r",
+ "4 14 7\r",
+ "4 14 8\r",
+ "4 14 9\r",
+ "4 14 10\r",
+ "4 14 11\r",
+ "4 14 12\r",
+ "4 14 13\r",
+ "4 14 14\r",
+ "4 14 15\r",
+ "4 14 16\r",
+ "4 14 17\r",
+ "4 14 18\r",
+ "4 14 19\r",
+ "4 14 20\r",
+ "4 14 21\r",
+ "4 14 22\r",
+ "4 14 23\r",
+ "4 14 24\r",
+ "4 14 25\r",
+ "4 14 26\r",
+ "4 14 27\r",
+ "4 14 28\r",
+ "4 14 29\r",
+ "4 14 30\r",
+ "4 14 31\r",
+ "4 14 32\r",
+ "4 14 33\r",
+ "4 14 34\r",
+ "4 14 35\r",
+ "4 14 36\r",
+ "4 14 37\r",
+ "4 14 38\r",
+ "4 14 39\r",
+ "4 14 40\r",
+ "4 14 41\r",
+ "4 14 42\r",
+ "4 14 43\r",
+ "4 14 44\r",
+ "4 14 45\r",
+ "4 14 46\r",
+ "4 14 47\r",
+ "4 14 48\r",
+ "4 14 49\r",
+ "4 14 50\r",
+ "4 14 51\r",
+ "4 14 52\r",
+ "4 14 53\r",
+ "4 14 54\r",
+ "4 14 55\r",
+ "4 14 56\r",
+ "4 14 57\r",
+ "4 14 58\r",
+ "4 15 1\r",
+ "4 15 2\r",
+ "4 15 3\r",
+ "4 15 4\r",
+ "4 15 5\r",
+ "4 15 6\r",
+ "4 15 7\r",
+ "4 15 8\r",
+ "4 15 9\r",
+ "4 15 10\r",
+ "4 15 11\r",
+ "4 15 12\r",
+ "4 15 13\r",
+ "4 15 14\r",
+ "4 15 15\r",
+ "4 15 16\r",
+ "4 15 17\r",
+ "4 15 18\r",
+ "4 15 19\r",
+ "4 15 20\r",
+ "4 15 21\r",
+ "4 15 22\r",
+ "4 15 23\r",
+ "4 15 24\r",
+ "4 15 25\r",
+ "4 15 26\r",
+ "4 15 27\r",
+ "4 15 28\r",
+ "4 15 29\r",
+ "4 15 30\r",
+ "4 15 31\r",
+ "4 15 32\r",
+ "4 15 33\r",
+ "4 15 34\r",
+ "4 15 35\r",
+ "4 15 36\r",
+ "4 15 37\r",
+ "4 15 38\r",
+ "4 15 39\r",
+ "4 15 40\r",
+ "4 15 41\r",
+ "4 15 42\r",
+ "4 15 43\r",
+ "4 15 44\r",
+ "4 15 45\r",
+ "4 15 46\r",
+ "4 15 47\r",
+ "4 15 48\r",
+ "4 15 49\r",
+ "4 15 50\r",
+ "4 15 51\r",
+ "4 15 52\r",
+ "4 15 53\r",
+ "4 15 54\r",
+ "4 15 55\r",
+ "4 15 56\r",
+ "4 15 57\r",
+ "4 15 58\r",
+ "4 16 1\r",
+ "4 16 2\r",
+ "4 16 3\r",
+ "4 16 4\r",
+ "4 16 5\r",
+ "4 16 6\r",
+ "4 16 7\r",
+ "4 16 8\r",
+ "4 16 9\r",
+ "4 16 10\r",
+ "4 16 11\r",
+ "4 16 12\r",
+ "4 16 13\r",
+ "4 16 14\r",
+ "4 16 15\r",
+ "4 16 16\r",
+ "4 16 17\r",
+ "4 16 18\r",
+ "4 16 19\r",
+ "4 16 20\r",
+ "4 16 21\r",
+ "4 16 22\r",
+ "4 16 23\r",
+ "4 16 24\r",
+ "4 16 25\r",
+ "4 16 26\r",
+ "4 16 27\r",
+ "4 16 28\r",
+ "4 16 29\r",
+ "4 16 30\r",
+ "4 16 31\r",
+ "4 16 32\r",
+ "4 16 33\r",
+ "4 16 34\r",
+ "4 16 35\r",
+ "4 16 36\r",
+ "4 16 37\r",
+ "4 16 38\r",
+ "4 16 39\r",
+ "4 16 40\r",
+ "4 16 41\r",
+ "4 16 42\r",
+ "4 16 43\r",
+ "4 16 44\r",
+ "4 16 45\r",
+ "4 16 46\r",
+ "4 16 47\r",
+ "4 16 48\r",
+ "4 16 49\r",
+ "4 16 50\r",
+ "4 16 51\r",
+ "4 16 52\r",
+ "4 16 53\r",
+ "4 16 54\r",
+ "4 16 55\r",
+ "4 16 56\r",
+ "4 16 57\r",
+ "4 16 58\r",
+ "4 17 1\r",
+ "4 17 2\r",
+ "4 17 3\r",
+ "4 17 4\r",
+ "4 17 5\r",
+ "4 17 6\r",
+ "4 17 7\r",
+ "4 17 8\r",
+ "4 17 9\r",
+ "4 17 10\r",
+ "4 17 11\r",
+ "4 17 12\r",
+ "4 17 13\r",
+ "4 17 14\r",
+ "4 17 15\r",
+ "4 17 16\r",
+ "4 17 17\r",
+ "4 17 18\r",
+ "4 17 19\r",
+ "4 17 20\r",
+ "4 17 21\r",
+ "4 17 22\r",
+ "4 17 23\r",
+ "4 17 24\r",
+ "4 17 25\r",
+ "4 17 26\r",
+ "4 17 27\r",
+ "4 17 28\r",
+ "4 17 29\r",
+ "4 17 30\r",
+ "4 17 31\r",
+ "4 17 32\r",
+ "4 17 33\r",
+ "4 17 34\r",
+ "4 17 35\r",
+ "4 17 36\r",
+ "4 17 37\r",
+ "4 17 38\r",
+ "4 17 39\r",
+ "4 17 40\r",
+ "4 17 41\r",
+ "4 17 42\r",
+ "4 17 43\r",
+ "4 17 44\r",
+ "4 17 45\r",
+ "4 17 46\r",
+ "4 17 47\r",
+ "4 17 48\r",
+ "4 17 49\r",
+ "4 17 50\r",
+ "4 17 51\r",
+ "4 17 52\r",
+ "4 17 53\r",
+ "4 17 54\r",
+ "4 17 55\r",
+ "4 17 56\r",
+ "4 17 57\r",
+ "4 17 58\r",
+ "4 18 1\r",
+ "4 18 2\r",
+ "4 18 3\r",
+ "4 18 4\r",
+ "4 18 5\r",
+ "4 18 6\r",
+ "4 18 7\r",
+ "4 18 8\r",
+ "4 18 9\r",
+ "4 18 10\r",
+ "4 18 11\r",
+ "4 18 12\r",
+ "4 18 13\r",
+ "4 18 14\r",
+ "4 18 15\r",
+ "4 18 16\r",
+ "4 18 17\r",
+ "4 18 18\r",
+ "4 18 19\r",
+ "4 18 20\r",
+ "4 18 21\r",
+ "4 18 22\r",
+ "4 18 23\r",
+ "4 18 24\r",
+ "4 18 25\r",
+ "4 18 26\r",
+ "4 18 27\r",
+ "4 18 28\r",
+ "4 18 29\r",
+ "4 18 30\r",
+ "4 18 31\r",
+ "4 18 32\r",
+ "4 18 33\r",
+ "4 18 34\r",
+ "4 18 35\r",
+ "4 18 36\r",
+ "4 18 37\r",
+ "4 18 38\r",
+ "4 18 39\r",
+ "4 18 40\r",
+ "4 18 41\r",
+ "4 18 42\r",
+ "4 18 43\r",
+ "4 18 44\r",
+ "4 18 45\r",
+ "4 18 46\r",
+ "4 18 47\r",
+ "4 18 48\r",
+ "4 18 49\r",
+ "4 18 50\r",
+ "4 18 51\r",
+ "4 18 52\r",
+ "4 18 53\r",
+ "4 18 54\r",
+ "4 18 55\r",
+ "4 18 56\r",
+ "4 18 57\r",
+ "4 18 58\r",
+ "4 19 1\r",
+ "4 19 2\r",
+ "4 19 3\r",
+ "4 19 4\r",
+ "4 19 5\r",
+ "4 19 6\r",
+ "4 19 7\r",
+ "4 19 8\r",
+ "4 19 9\r",
+ "4 19 10\r",
+ "4 19 11\r",
+ "4 19 12\r",
+ "4 19 13\r",
+ "4 19 14\r",
+ "4 19 15\r",
+ "4 19 16\r",
+ "4 19 17\r",
+ "4 19 18\r",
+ "4 19 19\r",
+ "4 19 20\r",
+ "4 19 21\r",
+ "4 19 22\r",
+ "4 19 23\r",
+ "4 19 24\r",
+ "4 19 25\r",
+ "4 19 26\r",
+ "4 19 27\r",
+ "4 19 28\r",
+ "4 19 29\r",
+ "4 19 30\r",
+ "4 19 31\r",
+ "4 19 32\r",
+ "4 19 33\r",
+ "4 19 34\r",
+ "4 19 35\r",
+ "4 19 36\r",
+ "4 19 37\r",
+ "4 19 38\r",
+ "4 19 39\r",
+ "4 19 40\r",
+ "4 19 41\r",
+ "4 19 42\r",
+ "4 19 43\r",
+ "4 19 44\r",
+ "4 19 45\r",
+ "4 19 46\r",
+ "4 19 47\r",
+ "4 19 48\r",
+ "4 19 49\r",
+ "4 19 50\r",
+ "4 19 51\r",
+ "4 19 52\r",
+ "4 19 53\r",
+ "4 19 54\r",
+ "4 19 55\r",
+ "4 19 56\r",
+ "4 19 57\r",
+ "4 19 58\r",
+ "4 20 1\r",
+ "4 20 2\r",
+ "4 20 3\r",
+ "4 20 4\r",
+ "4 20 5\r",
+ "4 20 6\r",
+ "4 20 7\r",
+ "4 20 8\r",
+ "4 20 9\r",
+ "4 20 10\r",
+ "4 20 11\r",
+ "4 20 12\r",
+ "4 20 13\r",
+ "4 20 14\r",
+ "4 20 15\r",
+ "4 20 16\r",
+ "4 20 17\r",
+ "4 20 18\r",
+ "4 20 19\r",
+ "4 20 20\r",
+ "4 20 21\r",
+ "4 20 22\r",
+ "4 20 23\r",
+ "4 20 24\r",
+ "4 20 25\r",
+ "4 20 26\r",
+ "4 20 27\r",
+ "4 20 28\r",
+ "4 20 29\r",
+ "4 20 30\r",
+ "4 20 31\r",
+ "4 20 32\r",
+ "4 20 33\r",
+ "4 20 34\r",
+ "4 20 35\r",
+ "4 20 36\r",
+ "4 20 37\r",
+ "4 20 38\r",
+ "4 20 39\r",
+ "4 20 40\r",
+ "4 20 41\r",
+ "4 20 42\r",
+ "4 20 43\r",
+ "4 20 44\r",
+ "4 20 45\r",
+ "4 20 46\r",
+ "4 20 47\r",
+ "4 20 48\r",
+ "4 20 49\r",
+ "4 20 50\r",
+ "4 20 51\r",
+ "4 20 52\r",
+ "4 20 53\r",
+ "4 20 54\r",
+ "4 20 55\r",
+ "4 20 56\r",
+ "4 20 57\r",
+ "4 20 58\r",
+ "4 21 1\r",
+ "4 21 2\r",
+ "4 21 3\r",
+ "4 21 4\r",
+ "4 21 5\r",
+ "4 21 6\r",
+ "4 21 7\r",
+ "4 21 8\r",
+ "4 21 9\r",
+ "4 21 10\r",
+ "4 21 11\r",
+ "4 21 12\r",
+ "4 21 13\r",
+ "4 21 14\r",
+ "4 21 15\r",
+ "4 21 16\r",
+ "4 21 17\r",
+ "4 21 18\r",
+ "4 21 19\r",
+ "4 21 20\r",
+ "4 21 21\r",
+ "4 21 22\r",
+ "4 21 23\r",
+ "4 21 24\r",
+ "4 21 25\r",
+ "4 21 26\r",
+ "4 21 27\r",
+ "4 21 28\r",
+ "4 21 29\r",
+ "4 21 30\r",
+ "4 21 31\r",
+ "4 21 32\r",
+ "4 21 33\r",
+ "4 21 34\r",
+ "4 21 35\r",
+ "4 21 36\r",
+ "4 21 37\r",
+ "4 21 38\r",
+ "4 21 39\r",
+ "4 21 40\r",
+ "4 21 41\r",
+ "4 21 42\r",
+ "4 21 43\r",
+ "4 21 44\r",
+ "4 21 45\r",
+ "4 21 46\r",
+ "4 21 47\r",
+ "4 21 48\r",
+ "4 21 49\r",
+ "4 21 50\r",
+ "4 21 51\r",
+ "4 21 52\r",
+ "4 21 53\r",
+ "4 21 54\r",
+ "4 21 55\r",
+ "4 21 56\r",
+ "4 21 57\r",
+ "4 21 58\r",
+ "4 22 1\r",
+ "4 22 2\r",
+ "4 22 3\r",
+ "4 22 4\r",
+ "4 22 5\r",
+ "4 22 6\r",
+ "4 22 7\r",
+ "4 22 8\r",
+ "4 22 9\r",
+ "4 22 10\r",
+ "4 22 11\r",
+ "4 22 12\r",
+ "4 22 13\r",
+ "4 22 14\r",
+ "4 22 15\r",
+ "4 22 16\r",
+ "4 22 17\r",
+ "4 22 18\r",
+ "4 22 19\r",
+ "4 22 20\r",
+ "4 22 21\r",
+ "4 22 22\r",
+ "4 22 23\r",
+ "4 22 24\r",
+ "4 22 25\r",
+ "4 22 26\r",
+ "4 22 27\r",
+ "4 22 28\r",
+ "4 22 29\r",
+ "4 22 30\r",
+ "4 22 31\r",
+ "4 22 32\r",
+ "4 22 33\r",
+ "4 22 34\r",
+ "4 22 35\r",
+ "4 22 36\r",
+ "4 22 37\r",
+ "4 22 38\r",
+ "4 22 39\r",
+ "4 22 40\r",
+ "4 22 41\r",
+ "4 22 42\r",
+ "4 22 43\r",
+ "4 22 44\r",
+ "4 22 45\r",
+ "4 22 46\r",
+ "4 22 47\r",
+ "4 22 48\r",
+ "4 22 49\r",
+ "4 22 50\r",
+ "4 22 51\r",
+ "4 22 52\r",
+ "4 22 53\r",
+ "4 22 54\r",
+ "4 22 55\r",
+ "4 22 56\r",
+ "4 22 57\r",
+ "4 22 58\r",
+ "4 23 1\r",
+ "4 23 2\r",
+ "4 23 3\r",
+ "4 23 4\r",
+ "4 23 5\r",
+ "4 23 6\r",
+ "4 23 7\r",
+ "4 23 8\r",
+ "4 23 9\r",
+ "4 23 10\r",
+ "4 23 11\r",
+ "4 23 12\r",
+ "4 23 13\r",
+ "4 23 14\r",
+ "4 23 15\r",
+ "4 23 16\r",
+ "4 23 17\r",
+ "4 23 18\r",
+ "4 23 19\r",
+ "4 23 20\r",
+ "4 23 21\r",
+ "4 23 22\r",
+ "4 23 23\r",
+ "4 23 24\r",
+ "4 23 25\r",
+ "4 23 26\r",
+ "4 23 27\r",
+ "4 23 28\r",
+ "4 23 29\r",
+ "4 23 30\r",
+ "4 23 31\r",
+ "4 23 32\r",
+ "4 23 33\r",
+ "4 23 34\r",
+ "4 23 35\r",
+ "4 23 36\r",
+ "4 23 37\r",
+ "4 23 38\r",
+ "4 23 39\r",
+ "4 23 40\r",
+ "4 23 41\r",
+ "4 23 42\r",
+ "4 23 43\r",
+ "4 23 44\r",
+ "4 23 45\r",
+ "4 23 46\r",
+ "4 23 47\r",
+ "4 23 48\r",
+ "4 23 49\r",
+ "4 23 50\r",
+ "4 23 51\r",
+ "4 23 52\r",
+ "4 23 53\r",
+ "4 23 54\r",
+ "4 23 55\r",
+ "4 23 56\r",
+ "4 23 57\r",
+ "4 23 58\r",
+ "4 24 1\r",
+ "4 24 2\r",
+ "4 24 3\r",
+ "4 24 4\r",
+ "4 24 5\r",
+ "4 24 6\r",
+ "4 24 7\r",
+ "4 24 8\r",
+ "4 24 9\r",
+ "4 24 10\r",
+ "4 24 11\r",
+ "4 24 12\r",
+ "4 24 13\r",
+ "4 24 14\r",
+ "4 24 15\r",
+ "4 24 16\r",
+ "4 24 17\r",
+ "4 24 18\r",
+ "4 24 19\r",
+ "4 24 20\r",
+ "4 24 21\r",
+ "4 24 22\r",
+ "4 24 23\r",
+ "4 24 24\r",
+ "4 24 25\r",
+ "4 24 26\r",
+ "4 24 27\r",
+ "4 24 28\r",
+ "4 24 29\r",
+ "4 24 30\r",
+ "4 24 31\r",
+ "4 24 32\r",
+ "4 24 33\r",
+ "4 24 34\r",
+ "4 24 35\r",
+ "4 24 36\r",
+ "4 24 37\r",
+ "4 24 38\r",
+ "4 24 39\r",
+ "4 24 40\r",
+ "4 24 41\r",
+ "4 24 42\r",
+ "4 24 43\r",
+ "4 24 44\r",
+ "4 24 45\r",
+ "4 24 46\r",
+ "4 24 47\r",
+ "4 24 48\r",
+ "4 24 49\r",
+ "4 24 50\r",
+ "4 24 51\r",
+ "4 24 52\r",
+ "4 24 53\r",
+ "4 24 54\r",
+ "4 24 55\r",
+ "4 24 56\r",
+ "4 24 57\r",
+ "4 24 58\r",
+ "4 25 1\r",
+ "4 25 2\r",
+ "4 25 3\r",
+ "4 25 4\r",
+ "4 25 5\r",
+ "4 25 6\r",
+ "4 25 7\r",
+ "4 25 8\r",
+ "4 25 9\r",
+ "4 25 10\r",
+ "4 25 11\r",
+ "4 25 12\r",
+ "4 25 13\r",
+ "4 25 14\r",
+ "4 25 15\r",
+ "4 25 16\r",
+ "4 25 17\r",
+ "4 25 18\r",
+ "4 25 19\r",
+ "4 25 20\r",
+ "4 25 21\r",
+ "4 25 22\r",
+ "4 25 23\r",
+ "4 25 24\r",
+ "4 25 25\r",
+ "4 25 26\r",
+ "4 25 27\r",
+ "4 25 28\r",
+ "4 25 29\r",
+ "4 25 30\r",
+ "4 25 31\r",
+ "4 25 32\r",
+ "4 25 33\r",
+ "4 25 34\r",
+ "4 25 35\r",
+ "4 25 36\r",
+ "4 25 37\r",
+ "4 25 38\r",
+ "4 25 39\r",
+ "4 25 40\r",
+ "4 25 41\r",
+ "4 25 42\r",
+ "4 25 43\r",
+ "4 25 44\r",
+ "4 25 45\r",
+ "4 25 46\r",
+ "4 25 47\r",
+ "4 25 48\r",
+ "4 25 49\r",
+ "4 25 50\r",
+ "4 25 51\r",
+ "4 25 52\r",
+ "4 25 53\r",
+ "4 25 54\r",
+ "4 25 55\r",
+ "4 25 56\r",
+ "4 25 57\r",
+ "4 25 58\r",
+ "4 26 1\r",
+ "4 26 2\r",
+ "4 26 3\r",
+ "4 26 4\r",
+ "4 26 5\r",
+ "4 26 6\r",
+ "4 26 7\r",
+ "4 26 8\r",
+ "4 26 9\r",
+ "4 26 10\r",
+ "4 26 11\r",
+ "4 26 12\r",
+ "4 26 13\r",
+ "4 26 14\r",
+ "4 26 15\r",
+ "4 26 16\r",
+ "4 26 17\r",
+ "4 26 18\r",
+ "4 26 19\r",
+ "4 26 20\r",
+ "4 26 21\r",
+ "4 26 22\r",
+ "4 26 23\r",
+ "4 26 24\r",
+ "4 26 25\r",
+ "4 26 26\r",
+ "4 26 27\r",
+ "4 26 28\r",
+ "4 26 29\r",
+ "4 26 30\r",
+ "4 26 31\r",
+ "4 26 32\r",
+ "4 26 33\r",
+ "4 26 34\r",
+ "4 26 35\r",
+ "4 26 36\r",
+ "4 26 37\r",
+ "4 26 38\r",
+ "4 26 39\r",
+ "4 26 40\r",
+ "4 26 41\r",
+ "4 26 42\r",
+ "4 26 43\r",
+ "4 26 44\r",
+ "4 26 45\r",
+ "4 26 46\r",
+ "4 26 47\r",
+ "4 26 48\r",
+ "4 26 49\r",
+ "4 26 50\r",
+ "4 26 51\r",
+ "4 26 52\r",
+ "4 26 53\r",
+ "4 26 54\r",
+ "4 26 55\r",
+ "4 26 56\r",
+ "4 26 57\r",
+ "4 26 58\r",
+ "4 27 1\r",
+ "4 27 2\r",
+ "4 27 3\r",
+ "4 27 4\r",
+ "4 27 5\r",
+ "4 27 6\r",
+ "4 27 7\r",
+ "4 27 8\r",
+ "4 27 9\r",
+ "4 27 10\r",
+ "4 27 11\r",
+ "4 27 12\r",
+ "4 27 13\r",
+ "4 27 14\r",
+ "4 27 15\r",
+ "4 27 16\r",
+ "4 27 17\r",
+ "4 27 18\r",
+ "4 27 19\r",
+ "4 27 20\r",
+ "4 27 21\r",
+ "4 27 22\r",
+ "4 27 23\r",
+ "4 27 24\r",
+ "4 27 25\r",
+ "4 27 26\r",
+ "4 27 27\r",
+ "4 27 28\r",
+ "4 27 29\r",
+ "4 27 30\r",
+ "4 27 31\r",
+ "4 27 32\r",
+ "4 27 33\r",
+ "4 27 34\r",
+ "4 27 35\r",
+ "4 27 36\r",
+ "4 27 37\r",
+ "4 27 38\r",
+ "4 27 39\r",
+ "4 27 40\r",
+ "4 27 41\r",
+ "4 27 42\r",
+ "4 27 43\r",
+ "4 27 44\r",
+ "4 27 45\r",
+ "4 27 46\r",
+ "4 27 47\r",
+ "4 27 48\r",
+ "4 27 49\r",
+ "4 27 50\r",
+ "4 27 51\r",
+ "4 27 52\r",
+ "4 27 53\r",
+ "4 27 54\r",
+ "4 27 55\r",
+ "4 27 56\r",
+ "4 27 57\r",
+ "4 27 58\r",
+ "4 28 1\r",
+ "4 28 2\r",
+ "4 28 3\r",
+ "4 28 4\r",
+ "4 28 5\r",
+ "4 28 6\r",
+ "4 28 7\r",
+ "4 28 8\r",
+ "4 28 9\r",
+ "4 28 10\r",
+ "4 28 11\r",
+ "4 28 12\r",
+ "4 28 13\r",
+ "4 28 14\r",
+ "4 28 15\r",
+ "4 28 16\r",
+ "4 28 17\r",
+ "4 28 18\r",
+ "4 28 19\r",
+ "4 28 20\r",
+ "4 28 21\r",
+ "4 28 22\r",
+ "4 28 23\r",
+ "4 28 24\r",
+ "4 28 25\r",
+ "4 28 26\r",
+ "4 28 27\r",
+ "4 28 28\r",
+ "4 28 29\r",
+ "4 28 30\r",
+ "4 28 31\r",
+ "4 28 32\r",
+ "4 28 33\r",
+ "4 28 34\r",
+ "4 28 35\r",
+ "4 28 36\r",
+ "4 28 37\r",
+ "4 28 38\r",
+ "4 28 39\r",
+ "4 28 40\r",
+ "4 28 41\r",
+ "4 28 42\r",
+ "4 28 43\r",
+ "4 28 44\r",
+ "4 28 45\r",
+ "4 28 46\r",
+ "4 28 47\r",
+ "4 28 48\r",
+ "4 28 49\r",
+ "4 28 50\r",
+ "4 28 51\r",
+ "4 28 52\r",
+ "4 28 53\r",
+ "4 28 54\r",
+ "4 28 55\r",
+ "4 28 56\r",
+ "4 28 57\r",
+ "4 28 58\r",
+ "4 29 1\r",
+ "4 29 2\r",
+ "4 29 3\r",
+ "4 29 4\r",
+ "4 29 5\r",
+ "4 29 6\r",
+ "4 29 7\r",
+ "4 29 8\r",
+ "4 29 9\r",
+ "4 29 10\r",
+ "4 29 11\r",
+ "4 29 12\r",
+ "4 29 13\r",
+ "4 29 14\r",
+ "4 29 15\r",
+ "4 29 16\r",
+ "4 29 17\r",
+ "4 29 18\r",
+ "4 29 19\r",
+ "4 29 20\r",
+ "4 29 21\r",
+ "4 29 22\r",
+ "4 29 23\r",
+ "4 29 24\r",
+ "4 29 25\r",
+ "4 29 26\r",
+ "4 29 27\r",
+ "4 29 28\r",
+ "4 29 29\r",
+ "4 29 30\r",
+ "4 29 31\r",
+ "4 29 32\r",
+ "4 29 33\r",
+ "4 29 34\r",
+ "4 29 35\r",
+ "4 29 36\r",
+ "4 29 37\r",
+ "4 29 38\r",
+ "4 29 39\r",
+ "4 29 40\r",
+ "4 29 41\r",
+ "4 29 42\r",
+ "4 29 43\r",
+ "4 29 44\r",
+ "4 29 45\r",
+ "4 29 46\r",
+ "4 29 47\r",
+ "4 29 48\r",
+ "4 29 49\r",
+ "4 29 50\r",
+ "4 29 51\r",
+ "4 29 52\r",
+ "4 29 53\r",
+ "4 29 54\r",
+ "4 29 55\r",
+ "4 29 56\r",
+ "4 29 57\r",
+ "4 29 58\r",
+ "4 30 1\r",
+ "4 30 2\r",
+ "4 30 3\r",
+ "4 30 4\r",
+ "4 30 5\r",
+ "4 30 6\r",
+ "4 30 7\r",
+ "4 30 8\r",
+ "4 30 9\r",
+ "4 30 10\r",
+ "4 30 11\r",
+ "4 30 12\r",
+ "4 30 13\r",
+ "4 30 14\r",
+ "4 30 15\r",
+ "4 30 16\r",
+ "4 30 17\r",
+ "4 30 18\r",
+ "4 30 19\r",
+ "4 30 20\r",
+ "4 30 21\r",
+ "4 30 22\r",
+ "4 30 23\r",
+ "4 30 24\r",
+ "4 30 25\r",
+ "4 30 26\r",
+ "4 30 27\r",
+ "4 30 28\r",
+ "4 30 29\r",
+ "4 30 30\r",
+ "4 30 31\r",
+ "4 30 32\r",
+ "4 30 33\r",
+ "4 30 34\r",
+ "4 30 35\r",
+ "4 30 36\r",
+ "4 30 37\r",
+ "4 30 38\r",
+ "4 30 39\r",
+ "4 30 40\r",
+ "4 30 41\r",
+ "4 30 42\r",
+ "4 30 43\r",
+ "4 30 44\r",
+ "4 30 45\r",
+ "4 30 46\r",
+ "4 30 47\r",
+ "4 30 48\r",
+ "4 30 49\r",
+ "4 30 50\r",
+ "4 30 51\r",
+ "4 30 52\r",
+ "4 30 53\r",
+ "4 30 54\r",
+ "4 30 55\r",
+ "4 30 56\r",
+ "4 30 57\r",
+ "4 30 58\r",
+ "4 31 1\r",
+ "4 31 2\r",
+ "4 31 3\r",
+ "4 31 4\r",
+ "4 31 5\r",
+ "4 31 6\r",
+ "4 31 7\r",
+ "4 31 8\r",
+ "4 31 9\r",
+ "4 31 10\r",
+ "4 31 11\r",
+ "4 31 12\r",
+ "4 31 13\r",
+ "4 31 14\r",
+ "4 31 15\r",
+ "4 31 16\r",
+ "4 31 17\r",
+ "4 31 18\r",
+ "4 31 19\r",
+ "4 31 20\r",
+ "4 31 21\r",
+ "4 31 22\r",
+ "4 31 23\r",
+ "4 31 24\r",
+ "4 31 25\r",
+ "4 31 26\r",
+ "4 31 27\r",
+ "4 31 28\r",
+ "4 31 29\r",
+ "4 31 30\r",
+ "4 31 31\r",
+ "4 31 32\r",
+ "4 31 33\r",
+ "4 31 34\r",
+ "4 31 35\r",
+ "4 31 36\r",
+ "4 31 37\r",
+ "4 31 38\r",
+ "4 31 39\r",
+ "4 31 40\r",
+ "4 31 41\r",
+ "4 31 42\r",
+ "4 31 43\r",
+ "4 31 44\r",
+ "4 31 45\r",
+ "4 31 46\r",
+ "4 31 47\r",
+ "4 31 48\r",
+ "4 31 49\r",
+ "4 31 50\r",
+ "4 31 51\r",
+ "4 31 52\r",
+ "4 31 53\r",
+ "4 31 54\r",
+ "4 31 55\r",
+ "4 31 56\r",
+ "4 31 57\r",
+ "4 31 58\r",
+ "4 32 1\r",
+ "4 32 2\r",
+ "4 32 3\r",
+ "4 32 4\r",
+ "4 32 5\r",
+ "4 32 6\r",
+ "4 32 7\r",
+ "4 32 8\r",
+ "4 32 9\r",
+ "4 32 10\r",
+ "4 32 11\r",
+ "4 32 12\r",
+ "4 32 13\r",
+ "4 32 14\r",
+ "4 32 15\r",
+ "4 32 16\r",
+ "4 32 17\r",
+ "4 32 18\r",
+ "4 32 19\r",
+ "4 32 20\r",
+ "4 32 21\r",
+ "4 32 22\r",
+ "4 32 23\r",
+ "4 32 24\r",
+ "4 32 25\r",
+ "4 32 26\r",
+ "4 32 27\r",
+ "4 32 28\r",
+ "4 32 29\r",
+ "4 32 30\r",
+ "4 32 31\r",
+ "4 32 32\r",
+ "4 32 33\r",
+ "4 32 34\r",
+ "4 32 35\r",
+ "4 32 36\r",
+ "4 32 37\r",
+ "4 32 38\r",
+ "4 32 39\r",
+ "4 32 40\r",
+ "4 32 41\r",
+ "4 32 42\r",
+ "4 32 43\r",
+ "4 32 44\r",
+ "4 32 45\r",
+ "4 32 46\r",
+ "4 32 47\r",
+ "4 32 48\r",
+ "4 32 49\r",
+ "4 32 50\r",
+ "4 32 51\r",
+ "4 32 52\r",
+ "4 32 53\r",
+ "4 32 54\r",
+ "4 32 55\r",
+ "4 32 56\r",
+ "4 32 57\r",
+ "4 32 58\r",
+ "4 33 1\r",
+ "4 33 2\r",
+ "4 33 3\r",
+ "4 33 4\r",
+ "4 33 5\r",
+ "4 33 6\r",
+ "4 33 7\r",
+ "4 33 8\r",
+ "4 33 9\r",
+ "4 33 10\r",
+ "4 33 11\r",
+ "4 33 12\r",
+ "4 33 13\r",
+ "4 33 14\r",
+ "4 33 15\r",
+ "4 33 16\r",
+ "4 33 17\r",
+ "4 33 18\r",
+ "4 33 19\r",
+ "4 33 20\r",
+ "4 33 21\r",
+ "4 33 22\r",
+ "4 33 23\r",
+ "4 33 24\r",
+ "4 33 25\r",
+ "4 33 26\r",
+ "4 33 27\r",
+ "4 33 28\r",
+ "4 33 29\r",
+ "4 33 30\r",
+ "4 33 31\r",
+ "4 33 32\r",
+ "4 33 33\r",
+ "4 33 34\r",
+ "4 33 35\r",
+ "4 33 36\r",
+ "4 33 37\r",
+ "4 33 38\r",
+ "4 33 39\r",
+ "4 33 40\r",
+ "4 33 41\r",
+ "4 33 42\r",
+ "4 33 43\r",
+ "4 33 44\r",
+ "4 33 45\r",
+ "4 33 46\r",
+ "4 33 47\r",
+ "4 33 48\r",
+ "4 33 49\r",
+ "4 33 50\r",
+ "4 33 51\r",
+ "4 33 52\r",
+ "4 33 53\r",
+ "4 33 54\r",
+ "4 33 55\r",
+ "4 33 56\r",
+ "4 33 57\r",
+ "4 33 58\r",
+ "4 34 1\r",
+ "4 34 2\r",
+ "4 34 3\r",
+ "4 34 4\r",
+ "4 34 5\r",
+ "4 34 6\r",
+ "4 34 7\r",
+ "4 34 8\r",
+ "4 34 9\r",
+ "4 34 10\r",
+ "4 34 11\r",
+ "4 34 12\r",
+ "4 34 13\r",
+ "4 34 14\r",
+ "4 34 15\r",
+ "4 34 16\r",
+ "4 34 17\r",
+ "4 34 18\r",
+ "4 34 19\r",
+ "4 34 20\r",
+ "4 34 21\r",
+ "4 34 22\r",
+ "4 34 23\r",
+ "4 34 24\r",
+ "4 34 25\r",
+ "4 34 26\r",
+ "4 34 27\r",
+ "4 34 28\r",
+ "4 34 29\r",
+ "4 34 30\r",
+ "4 34 31\r",
+ "4 34 32\r",
+ "4 34 33\r",
+ "4 34 34\r",
+ "4 34 35\r",
+ "4 34 36\r",
+ "4 34 37\r",
+ "4 34 38\r",
+ "4 34 39\r",
+ "4 34 40\r",
+ "4 34 41\r",
+ "4 34 42\r",
+ "4 34 43\r",
+ "4 34 44\r",
+ "4 34 45\r",
+ "4 34 46\r",
+ "4 34 47\r",
+ "4 34 48\r",
+ "4 34 49\r",
+ "4 34 50\r",
+ "4 34 51\r",
+ "4 34 52\r",
+ "4 34 53\r",
+ "4 34 54\r",
+ "4 34 55\r",
+ "4 34 56\r",
+ "4 34 57\r",
+ "4 34 58\r",
+ "4 35 1\r",
+ "4 35 2\r",
+ "4 35 3\r",
+ "4 35 4\r",
+ "4 35 5\r",
+ "4 35 6\r",
+ "4 35 7\r",
+ "4 35 8\r",
+ "4 35 9\r",
+ "4 35 10\r",
+ "4 35 11\r",
+ "4 35 12\r",
+ "4 35 13\r",
+ "4 35 14\r",
+ "4 35 15\r",
+ "4 35 16\r",
+ "4 35 17\r",
+ "4 35 18\r",
+ "4 35 19\r",
+ "4 35 20\r",
+ "4 35 21\r",
+ "4 35 22\r",
+ "4 35 23\r",
+ "4 35 24\r",
+ "4 35 25\r",
+ "4 35 26\r",
+ "4 35 27\r",
+ "4 35 28\r",
+ "4 35 29\r",
+ "4 35 30\r",
+ "4 35 31\r",
+ "4 35 32\r",
+ "4 35 33\r",
+ "4 35 34\r",
+ "4 35 35\r",
+ "4 35 36\r",
+ "4 35 37\r",
+ "4 35 38\r",
+ "4 35 39\r",
+ "4 35 40\r",
+ "4 35 41\r",
+ "4 35 42\r",
+ "4 35 43\r",
+ "4 35 44\r",
+ "4 35 45\r",
+ "4 35 46\r",
+ "4 35 47\r",
+ "4 35 48\r",
+ "4 35 49\r",
+ "4 35 50\r",
+ "4 35 51\r",
+ "4 35 52\r",
+ "4 35 53\r",
+ "4 35 54\r",
+ "4 35 55\r",
+ "4 35 56\r",
+ "4 35 57\r",
+ "4 35 58\r",
+ "4 36 1"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "4 36 2\r",
+ "4 36 3\r",
+ "4 36 4\r",
+ "4 36 5\r",
+ "4 36 6\r",
+ "4 36 7\r",
+ "4 36 8\r",
+ "4 36 9\r",
+ "4 36 10\r",
+ "4 36 11\r",
+ "4 36 12\r",
+ "4 36 13\r",
+ "4 36 14\r",
+ "4 36 15\r",
+ "4 36 16\r",
+ "4 36 17\r",
+ "4 36 18\r",
+ "4 36 19\r",
+ "4 36 20\r",
+ "4 36 21\r",
+ "4 36 22\r",
+ "4 36 23\r",
+ "4 36 24\r",
+ "4 36 25\r",
+ "4 36 26\r",
+ "4 36 27\r",
+ "4 36 28\r",
+ "4 36 29\r",
+ "4 36 30\r",
+ "4 36 31\r",
+ "4 36 32\r",
+ "4 36 33\r",
+ "4 36 34\r",
+ "4 36 35\r",
+ "4 36 36\r",
+ "4 36 37\r",
+ "4 36 38\r",
+ "4 36 39\r",
+ "4 36 40\r",
+ "4 36 41\r",
+ "4 36 42\r",
+ "4 36 43\r",
+ "4 36 44\r",
+ "4 36 45\r",
+ "4 36 46\r",
+ "4 36 47\r",
+ "4 36 48\r",
+ "4 36 49\r",
+ "4 36 50\r",
+ "4 36 51\r",
+ "4 36 52\r",
+ "4 36 53\r",
+ "4 36 54\r",
+ "4 36 55\r",
+ "4 36 56\r",
+ "4 36 57\r",
+ "4 36 58\r",
+ "4 37 1\r",
+ "4 37 2\r",
+ "4 37 3\r",
+ "4 37 4\r",
+ "4 37 5\r",
+ "4 37 6\r",
+ "4 37 7\r",
+ "4 37 8\r",
+ "4 37 9\r",
+ "4 37 10\r",
+ "4 37 11\r",
+ "4 37 12\r",
+ "4 37 13\r",
+ "4 37 14\r",
+ "4 37 15\r",
+ "4 37 16\r",
+ "4 37 17\r",
+ "4 37 18\r",
+ "4 37 19\r",
+ "4 37 20\r",
+ "4 37 21\r",
+ "4 37 22\r",
+ "4 37 23\r",
+ "4 37 24\r",
+ "4 37 25\r",
+ "4 37 26\r",
+ "4 37 27\r",
+ "4 37 28\r",
+ "4 37 29\r",
+ "4 37 30\r",
+ "4 37 31\r",
+ "4 37 32\r",
+ "4 37 33\r",
+ "4 37 34\r",
+ "4 37 35\r",
+ "4 37 36\r",
+ "4 37 37\r",
+ "4 37 38\r",
+ "4 37 39\r",
+ "4 37 40\r",
+ "4 37 41\r",
+ "4 37 42\r",
+ "4 37 43\r",
+ "4 37 44\r",
+ "4 37 45\r",
+ "4 37 46\r",
+ "4 37 47\r",
+ "4 37 48\r",
+ "4 37 49\r",
+ "4 37 50\r",
+ "4 37 51\r",
+ "4 37 52\r",
+ "4 37 53\r",
+ "4 37 54\r",
+ "4 37 55\r",
+ "4 37 56\r",
+ "4 37 57\r",
+ "4 37 58\r",
+ "4 38 1\r",
+ "4 38 2\r",
+ "4 38 3\r",
+ "4 38 4\r",
+ "4 38 5\r",
+ "4 38 6\r",
+ "4 38 7\r",
+ "4 38 8\r",
+ "4 38 9\r",
+ "4 38 10\r",
+ "4 38 11\r",
+ "4 38 12\r",
+ "4 38 13\r",
+ "4 38 14\r",
+ "4 38 15\r",
+ "4 38 16\r",
+ "4 38 17\r",
+ "4 38 18\r",
+ "4 38 19\r",
+ "4 38 20\r",
+ "4 38 21\r",
+ "4 38 22\r",
+ "4 38 23\r",
+ "4 38 24\r",
+ "4 38 25\r",
+ "4 38 26\r",
+ "4 38 27\r",
+ "4 38 28\r",
+ "4 38 29\r",
+ "4 38 30\r",
+ "4 38 31\r",
+ "4 38 32\r",
+ "4 38 33\r",
+ "4 38 34\r",
+ "4 38 35\r",
+ "4 38 36\r",
+ "4 38 37\r",
+ "4 38 38\r",
+ "4 38 39\r",
+ "4 38 40\r",
+ "4 38 41\r",
+ "4 38 42\r",
+ "4 38 43\r",
+ "4 38 44\r",
+ "4 38 45\r",
+ "4 38 46\r",
+ "4 38 47\r",
+ "4 38 48\r",
+ "4 38 49\r",
+ "4 38 50\r",
+ "4 38 51\r",
+ "4 38 52\r",
+ "4 38 53\r",
+ "4 38 54\r",
+ "4 38 55\r",
+ "4 38 56\r",
+ "4 38 57\r",
+ "4 38 58\r",
+ "4 39 1\r",
+ "4 39 2\r",
+ "4 39 3\r",
+ "4 39 4\r",
+ "4 39 5\r",
+ "4 39 6\r",
+ "4 39 7\r",
+ "4 39 8\r",
+ "4 39 9\r",
+ "4 39 10\r",
+ "4 39 11\r",
+ "4 39 12\r",
+ "4 39 13\r",
+ "4 39 14\r",
+ "4 39 15\r",
+ "4 39 16\r",
+ "4 39 17\r",
+ "4 39 18\r",
+ "4 39 19\r",
+ "4 39 20\r",
+ "4 39 21\r",
+ "4 39 22\r",
+ "4 39 23\r",
+ "4 39 24\r",
+ "4 39 25\r",
+ "4 39 26\r",
+ "4 39 27\r",
+ "4 39 28\r",
+ "4 39 29\r",
+ "4 39 30\r",
+ "4 39 31\r",
+ "4 39 32\r",
+ "4 39 33\r",
+ "4 39 34\r",
+ "4 39 35\r",
+ "4 39 36\r",
+ "4 39 37\r",
+ "4 39 38\r",
+ "4 39 39\r",
+ "4 39 40\r",
+ "4 39 41\r",
+ "4 39 42\r",
+ "4 39 43\r",
+ "4 39 44\r",
+ "4 39 45\r",
+ "4 39 46\r",
+ "4 39 47\r",
+ "4 39 48\r",
+ "4 39 49\r",
+ "4 39 50\r",
+ "4 39 51\r",
+ "4 39 52\r",
+ "4 39 53\r",
+ "4 39 54\r",
+ "4 39 55\r",
+ "4 39 56\r",
+ "4 39 57\r",
+ "4 39 58\r",
+ "4 40 1\r",
+ "4 40 2\r",
+ "4 40 3\r",
+ "4 40 4\r",
+ "4 40 5\r",
+ "4 40 6\r",
+ "4 40 7\r",
+ "4 40 8\r",
+ "4 40 9\r",
+ "4 40 10\r",
+ "4 40 11\r",
+ "4 40 12\r",
+ "4 40 13\r",
+ "4 40 14\r",
+ "4 40 15\r",
+ "4 40 16\r",
+ "4 40 17\r",
+ "4 40 18\r",
+ "4 40 19\r",
+ "4 40 20\r",
+ "4 40 21\r",
+ "4 40 22\r",
+ "4 40 23\r",
+ "4 40 24\r",
+ "4 40 25\r",
+ "4 40 26\r",
+ "4 40 27\r",
+ "4 40 28\r",
+ "4 40 29\r",
+ "4 40 30\r",
+ "4 40 31\r",
+ "4 40 32\r",
+ "4 40 33\r",
+ "4 40 34\r",
+ "4 40 35\r",
+ "4 40 36\r",
+ "4 40 37\r",
+ "4 40 38\r",
+ "4 40 39\r",
+ "4 40 40\r",
+ "4 40 41\r",
+ "4 40 42\r",
+ "4 40 43\r",
+ "4 40 44\r",
+ "4 40 45\r",
+ "4 40 46\r",
+ "4 40 47\r",
+ "4 40 48\r",
+ "4 40 49\r",
+ "4 40 50\r",
+ "4 40 51\r",
+ "4 40 52\r",
+ "4 40 53\r",
+ "4 40 54\r",
+ "4 40 55\r",
+ "4 40 56\r",
+ "4 40 57\r",
+ "4 40 58\r",
+ "4 41 1\r",
+ "4 41 2\r",
+ "4 41 3\r",
+ "4 41 4\r",
+ "4 41 5\r",
+ "4 41 6\r",
+ "4 41 7\r",
+ "4 41 8\r",
+ "4 41 9\r",
+ "4 41 10\r",
+ "4 41 11\r",
+ "4 41 12\r",
+ "4 41 13\r",
+ "4 41 14\r",
+ "4 41 15\r",
+ "4 41 16\r",
+ "4 41 17\r",
+ "4 41 18\r",
+ "4 41 19\r",
+ "4 41 20\r",
+ "4 41 21\r",
+ "4 41 22\r",
+ "4 41 23\r",
+ "4 41 24\r",
+ "4 41 25\r",
+ "4 41 26\r",
+ "4 41 27\r",
+ "4 41 28\r",
+ "4 41 29\r",
+ "4 41 30\r",
+ "4 41 31\r",
+ "4 41 32\r",
+ "4 41 33\r",
+ "4 41 34\r",
+ "4 41 35\r",
+ "4 41 36\r",
+ "4 41 37\r",
+ "4 41 38\r",
+ "4 41 39\r",
+ "4 41 40\r",
+ "4 41 41\r",
+ "4 41 42\r",
+ "4 41 43\r",
+ "4 41 44\r",
+ "4 41 45\r",
+ "4 41 46\r",
+ "4 41 47\r",
+ "4 41 48\r",
+ "4 41 49\r",
+ "4 41 50\r",
+ "4 41 51\r",
+ "4 41 52\r",
+ "4 41 53\r",
+ "4 41 54\r",
+ "4 41 55\r",
+ "4 41 56\r",
+ "4 41 57\r",
+ "4 41 58\r",
+ "4 42 1\r",
+ "4 42 2\r",
+ "4 42 3\r",
+ "4 42 4\r",
+ "4 42 5\r",
+ "4 42 6\r",
+ "4 42 7\r",
+ "4 42 8\r",
+ "4 42 9\r",
+ "4 42 10\r",
+ "4 42 11\r",
+ "4 42 12\r",
+ "4 42 13\r",
+ "4 42 14\r",
+ "4 42 15\r",
+ "4 42 16\r",
+ "4 42 17\r",
+ "4 42 18\r",
+ "4 42 19\r",
+ "4 42 20\r",
+ "4 42 21\r",
+ "4 42 22\r",
+ "4 42 23\r",
+ "4 42 24\r",
+ "4 42 25\r",
+ "4 42 26\r",
+ "4 42 27\r",
+ "4 42 28\r",
+ "4 42 29\r",
+ "4 42 30\r",
+ "4 42 31\r",
+ "4 42 32\r",
+ "4 42 33\r",
+ "4 42 34\r",
+ "4 42 35\r",
+ "4 42 36\r",
+ "4 42 37\r",
+ "4 42 38\r",
+ "4 42 39\r",
+ "4 42 40\r",
+ "4 42 41\r",
+ "4 42 42\r",
+ "4 42 43\r",
+ "4 42 44\r",
+ "4 42 45\r",
+ "4 42 46\r",
+ "4 42 47\r",
+ "4 42 48\r",
+ "4 42 49\r",
+ "4 42 50\r",
+ "4 42 51\r",
+ "4 42 52\r",
+ "4 42 53\r",
+ "4 42 54\r",
+ "4 42 55\r",
+ "4 42 56\r",
+ "4 42 57\r",
+ "4 42 58\r",
+ "4 43 1\r",
+ "4 43 2\r",
+ "4 43 3\r",
+ "4 43 4\r",
+ "4 43 5\r",
+ "4 43 6\r",
+ "4 43 7\r",
+ "4 43 8\r",
+ "4 43 9\r",
+ "4 43 10\r",
+ "4 43 11\r",
+ "4 43 12\r",
+ "4 43 13\r",
+ "4 43 14\r",
+ "4 43 15\r",
+ "4 43 16\r",
+ "4 43 17\r",
+ "4 43 18\r",
+ "4 43 19\r",
+ "4 43 20\r",
+ "4 43 21\r",
+ "4 43 22\r",
+ "4 43 23\r",
+ "4 43 24\r",
+ "4 43 25\r",
+ "4 43 26\r",
+ "4 43 27\r",
+ "4 43 28\r",
+ "4 43 29\r",
+ "4 43 30\r",
+ "4 43 31\r",
+ "4 43 32\r",
+ "4 43 33\r",
+ "4 43 34\r",
+ "4 43 35\r",
+ "4 43 36\r",
+ "4 43 37\r",
+ "4 43 38\r",
+ "4 43 39\r",
+ "4 43 40\r",
+ "4 43 41\r",
+ "4 43 42\r",
+ "4 43 43\r",
+ "4 43 44\r",
+ "4 43 45\r",
+ "4 43 46\r",
+ "4 43 47\r",
+ "4 43 48\r",
+ "4 43 49\r",
+ "4 43 50\r",
+ "4 43 51\r",
+ "4 43 52\r",
+ "4 43 53\r",
+ "4 43 54\r",
+ "4 43 55\r",
+ "4 43 56\r",
+ "4 43 57\r",
+ "4 43 58\r",
+ "4 44 1\r",
+ "4 44 2\r",
+ "4 44 3\r",
+ "4 44 4\r",
+ "4 44 5\r",
+ "4 44 6\r",
+ "4 44 7\r",
+ "4 44 8\r",
+ "4 44 9\r",
+ "4 44 10\r",
+ "4 44 11\r",
+ "4 44 12\r",
+ "4 44 13\r",
+ "4 44 14\r",
+ "4 44 15\r",
+ "4 44 16\r",
+ "4 44 17\r",
+ "4 44 18\r",
+ "4 44 19\r",
+ "4 44 20\r",
+ "4 44 21\r",
+ "4 44 22\r",
+ "4 44 23\r",
+ "4 44 24\r",
+ "4 44 25\r",
+ "4 44 26\r",
+ "4 44 27\r",
+ "4 44 28\r",
+ "4 44 29\r",
+ "4 44 30\r",
+ "4 44 31\r",
+ "4 44 32\r",
+ "4 44 33\r",
+ "4 44 34\r",
+ "4 44 35\r",
+ "4 44 36\r",
+ "4 44 37\r",
+ "4 44 38\r",
+ "4 44 39\r",
+ "4 44 40\r",
+ "4 44 41\r",
+ "4 44 42\r",
+ "4 44 43\r",
+ "4 44 44\r",
+ "4 44 45\r",
+ "4 44 46\r",
+ "4 44 47\r",
+ "4 44 48\r",
+ "4 44 49\r",
+ "4 44 50\r",
+ "4 44 51\r",
+ "4 44 52\r",
+ "4 44 53\r",
+ "4 44 54\r",
+ "4 44 55\r",
+ "4 44 56\r",
+ "4 44 57\r",
+ "4 44 58\r",
+ "4 45 1\r",
+ "4 45 2\r",
+ "4 45 3\r",
+ "4 45 4\r",
+ "4 45 5\r",
+ "4 45 6\r",
+ "4 45 7\r",
+ "4 45 8\r",
+ "4 45 9\r",
+ "4 45 10\r",
+ "4 45 11\r",
+ "4 45 12\r",
+ "4 45 13\r",
+ "4 45 14\r",
+ "4 45 15\r",
+ "4 45 16\r",
+ "4 45 17\r",
+ "4 45 18\r",
+ "4 45 19\r",
+ "4 45 20\r",
+ "4 45 21\r",
+ "4 45 22\r",
+ "4 45 23\r",
+ "4 45 24\r",
+ "4 45 25\r",
+ "4 45 26\r",
+ "4 45 27\r",
+ "4 45 28\r",
+ "4 45 29\r",
+ "4 45 30\r",
+ "4 45 31\r",
+ "4 45 32\r",
+ "4 45 33\r",
+ "4 45 34\r",
+ "4 45 35\r",
+ "4 45 36\r",
+ "4 45 37\r",
+ "4 45 38\r",
+ "4 45 39\r",
+ "4 45 40\r",
+ "4 45 41\r",
+ "4 45 42\r",
+ "4 45 43\r",
+ "4 45 44\r",
+ "4 45 45\r",
+ "4 45 46\r",
+ "4 45 47\r",
+ "4 45 48\r",
+ "4 45 49\r",
+ "4 45 50\r",
+ "4 45 51\r",
+ "4 45 52\r",
+ "4 45 53\r",
+ "4 45 54\r",
+ "4 45 55\r",
+ "4 45 56\r",
+ "4 45 57\r",
+ "4 45 58\r",
+ "4 46 1\r",
+ "4 46 2\r",
+ "4 46 3\r",
+ "4 46 4\r",
+ "4 46 5\r",
+ "4 46 6\r",
+ "4 46 7\r",
+ "4 46 8\r",
+ "4 46 9\r",
+ "4 46 10\r",
+ "4 46 11\r",
+ "4 46 12\r",
+ "4 46 13\r",
+ "4 46 14\r",
+ "4 46 15\r",
+ "4 46 16\r",
+ "4 46 17\r",
+ "4 46 18\r",
+ "4 46 19\r",
+ "4 46 20\r",
+ "4 46 21\r",
+ "4 46 22\r",
+ "4 46 23\r",
+ "4 46 24\r",
+ "4 46 25\r",
+ "4 46 26\r",
+ "4 46 27\r",
+ "4 46 28\r",
+ "4 46 29\r",
+ "4 46 30\r",
+ "4 46 31\r",
+ "4 46 32\r",
+ "4 46 33\r",
+ "4 46 34\r",
+ "4 46 35\r",
+ "4 46 36\r",
+ "4 46 37\r",
+ "4 46 38\r",
+ "4 46 39\r",
+ "4 46 40\r",
+ "4 46 41\r",
+ "4 46 42\r",
+ "4 46 43\r",
+ "4 46 44\r",
+ "4 46 45\r",
+ "4 46 46\r",
+ "4 46 47\r",
+ "4 46 48\r",
+ "4 46 49\r",
+ "4 46 50\r",
+ "4 46 51\r",
+ "4 46 52\r",
+ "4 46 53\r",
+ "4 46 54\r",
+ "4 46 55\r",
+ "4 46 56\r",
+ "4 46 57\r",
+ "4 46 58\r",
+ "4 47 1\r",
+ "4 47 2\r",
+ "4 47 3\r",
+ "4 47 4\r",
+ "4 47 5\r",
+ "4 47 6\r",
+ "4 47 7\r",
+ "4 47 8\r",
+ "4 47 9\r",
+ "4 47 10\r",
+ "4 47 11\r",
+ "4 47 12\r",
+ "4 47 13\r",
+ "4 47 14\r",
+ "4 47 15\r",
+ "4 47 16\r",
+ "4 47 17\r",
+ "4 47 18\r",
+ "4 47 19\r",
+ "4 47 20\r",
+ "4 47 21\r",
+ "4 47 22\r",
+ "4 47 23\r",
+ "4 47 24\r",
+ "4 47 25\r",
+ "4 47 26\r",
+ "4 47 27\r",
+ "4 47 28\r",
+ "4 47 29\r",
+ "4 47 30\r",
+ "4 47 31\r",
+ "4 47 32\r",
+ "4 47 33\r",
+ "4 47 34\r",
+ "4 47 35\r",
+ "4 47 36\r",
+ "4 47 37\r",
+ "4 47 38\r",
+ "4 47 39\r",
+ "4 47 40\r",
+ "4 47 41\r",
+ "4 47 42\r",
+ "4 47 43\r",
+ "4 47 44\r",
+ "4 47 45\r",
+ "4 47 46\r",
+ "4 47 47\r",
+ "4 47 48\r",
+ "4 47 49\r",
+ "4 47 50\r",
+ "4 47 51\r",
+ "4 47 52\r",
+ "4 47 53\r",
+ "4 47 54\r",
+ "4 47 55\r",
+ "4 47 56\r",
+ "4 47 57\r",
+ "4 47 58\r",
+ "4 48 1\r",
+ "4 48 2\r",
+ "4 48 3\r",
+ "4 48 4\r",
+ "4 48 5\r",
+ "4 48 6\r",
+ "4 48 7\r",
+ "4 48 8\r",
+ "4 48 9\r",
+ "4 48 10\r",
+ "4 48 11\r",
+ "4 48 12\r",
+ "4 48 13\r",
+ "4 48 14\r",
+ "4 48 15\r",
+ "4 48 16\r",
+ "4 48 17\r",
+ "4 48 18\r",
+ "4 48 19\r",
+ "4 48 20\r",
+ "4 48 21\r",
+ "4 48 22\r",
+ "4 48 23\r",
+ "4 48 24\r",
+ "4 48 25\r",
+ "4 48 26\r",
+ "4 48 27\r",
+ "4 48 28\r",
+ "4 48 29\r",
+ "4 48 30\r",
+ "4 48 31\r",
+ "4 48 32\r",
+ "4 48 33\r",
+ "4 48 34\r",
+ "4 48 35\r",
+ "4 48 36\r",
+ "4 48 37\r",
+ "4 48 38\r",
+ "4 48 39\r",
+ "4 48 40\r",
+ "4 48 41\r",
+ "4 48 42\r",
+ "4 48 43\r",
+ "4 48 44\r",
+ "4 48 45\r",
+ "4 48 46\r",
+ "4 48 47\r",
+ "4 48 48\r",
+ "4 48 49\r",
+ "4 48 50\r",
+ "4 48 51\r",
+ "4 48 52\r",
+ "4 48 53\r",
+ "4 48 54\r",
+ "4 48 55\r",
+ "4 48 56\r",
+ "4 48 57\r",
+ "4 48 58\r",
+ "4 49 1\r",
+ "4 49 2\r",
+ "4 49 3\r",
+ "4 49 4\r",
+ "4 49 5\r",
+ "4 49 6\r",
+ "4 49 7\r",
+ "4 49 8\r",
+ "4 49 9\r",
+ "4 49 10\r",
+ "4 49 11\r",
+ "4 49 12\r",
+ "4 49 13\r",
+ "4 49 14\r",
+ "4 49 15\r",
+ "4 49 16\r",
+ "4 49 17\r",
+ "4 49 18\r",
+ "4 49 19\r",
+ "4 49 20\r",
+ "4 49 21\r",
+ "4 49 22\r",
+ "4 49 23\r",
+ "4 49 24\r",
+ "4 49 25\r",
+ "4 49 26\r",
+ "4 49 27\r",
+ "4 49 28\r",
+ "4 49 29\r",
+ "4 49 30\r",
+ "4 49 31\r",
+ "4 49 32\r",
+ "4 49 33"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "4 49 34\r",
+ "4 49 35\r",
+ "4 49 36\r",
+ "4 49 37\r",
+ "4 49 38\r",
+ "4 49 39\r",
+ "4 49 40\r",
+ "4 49 41\r",
+ "4 49 42\r",
+ "4 49 43\r",
+ "4 49 44\r",
+ "4 49 45\r",
+ "4 49 46\r",
+ "4 49 47\r",
+ "4 49 48\r",
+ "4 49 49\r",
+ "4 49 50\r",
+ "4 49 51\r",
+ "4 49 52\r",
+ "4 49 53\r",
+ "4 49 54\r",
+ "4 49 55\r",
+ "4 49 56\r",
+ "4 49 57\r",
+ "4 49 58\r",
+ "4 50 1\r",
+ "4 50 2\r",
+ "4 50 3\r",
+ "4 50 4\r",
+ "4 50 5\r",
+ "4 50 6\r",
+ "4 50 7\r",
+ "4 50 8\r",
+ "4 50 9\r",
+ "4 50 10\r",
+ "4 50 11\r",
+ "4 50 12\r",
+ "4 50 13\r",
+ "4 50 14\r",
+ "4 50 15\r",
+ "4 50 16\r",
+ "4 50 17\r",
+ "4 50 18\r",
+ "4 50 19\r",
+ "4 50 20\r",
+ "4 50 21\r",
+ "4 50 22\r",
+ "4 50 23\r",
+ "4 50 24\r",
+ "4 50 25\r",
+ "4 50 26\r",
+ "4 50 27\r",
+ "4 50 28\r",
+ "4 50 29\r",
+ "4 50 30\r",
+ "4 50 31\r",
+ "4 50 32\r",
+ "4 50 33\r",
+ "4 50 34\r",
+ "4 50 35\r",
+ "4 50 36\r",
+ "4 50 37\r",
+ "4 50 38\r",
+ "4 50 39\r",
+ "4 50 40\r",
+ "4 50 41\r",
+ "4 50 42\r",
+ "4 50 43\r",
+ "4 50 44\r",
+ "4 50 45\r",
+ "4 50 46\r",
+ "4 50 47\r",
+ "4 50 48\r",
+ "4 50 49\r",
+ "4 50 50\r",
+ "4 50 51\r",
+ "4 50 52\r",
+ "4 50 53\r",
+ "4 50 54\r",
+ "4 50 55\r",
+ "4 50 56\r",
+ "4 50 57\r",
+ "4 50 58\r",
+ "4 51 1\r",
+ "4 51 2\r",
+ "4 51 3\r",
+ "4 51 4\r",
+ "4 51 5\r",
+ "4 51 6\r",
+ "4 51 7\r",
+ "4 51 8\r",
+ "4 51 9\r",
+ "4 51 10\r",
+ "4 51 11\r",
+ "4 51 12\r",
+ "4 51 13\r",
+ "4 51 14\r",
+ "4 51 15\r",
+ "4 51 16\r",
+ "4 51 17\r",
+ "4 51 18\r",
+ "4 51 19\r",
+ "4 51 20\r",
+ "4 51 21\r",
+ "4 51 22\r",
+ "4 51 23\r",
+ "4 51 24\r",
+ "4 51 25\r",
+ "4 51 26\r",
+ "4 51 27\r",
+ "4 51 28\r",
+ "4 51 29\r",
+ "4 51 30\r",
+ "4 51 31\r",
+ "4 51 32\r",
+ "4 51 33\r",
+ "4 51 34\r",
+ "4 51 35\r",
+ "4 51 36\r",
+ "4 51 37\r",
+ "4 51 38\r",
+ "4 51 39\r",
+ "4 51 40\r",
+ "4 51 41\r",
+ "4 51 42\r",
+ "4 51 43\r",
+ "4 51 44\r",
+ "4 51 45\r",
+ "4 51 46\r",
+ "4 51 47\r",
+ "4 51 48\r",
+ "4 51 49\r",
+ "4 51 50\r",
+ "4 51 51\r",
+ "4 51 52\r",
+ "4 51 53\r",
+ "4 51 54\r",
+ "4 51 55\r",
+ "4 51 56\r",
+ "4 51 57\r",
+ "4 51 58\r",
+ "4 52 1\r",
+ "4 52 2\r",
+ "4 52 3\r",
+ "4 52 4\r",
+ "4 52 5\r",
+ "4 52 6\r",
+ "4 52 7\r",
+ "4 52 8\r",
+ "4 52 9\r",
+ "4 52 10\r",
+ "4 52 11\r",
+ "4 52 12\r",
+ "4 52 13\r",
+ "4 52 14\r",
+ "4 52 15\r",
+ "4 52 16\r",
+ "4 52 17\r",
+ "4 52 18\r",
+ "4 52 19\r",
+ "4 52 20\r",
+ "4 52 21\r",
+ "4 52 22\r",
+ "4 52 23\r",
+ "4 52 24\r",
+ "4 52 25\r",
+ "4 52 26\r",
+ "4 52 27\r",
+ "4 52 28\r",
+ "4 52 29\r",
+ "4 52 30\r",
+ "4 52 31\r",
+ "4 52 32\r",
+ "4 52 33\r",
+ "4 52 34\r",
+ "4 52 35\r",
+ "4 52 36\r",
+ "4 52 37\r",
+ "4 52 38\r",
+ "4 52 39\r",
+ "4 52 40\r",
+ "4 52 41\r",
+ "4 52 42\r",
+ "4 52 43\r",
+ "4 52 44\r",
+ "4 52 45\r",
+ "4 52 46\r",
+ "4 52 47\r",
+ "4 52 48\r",
+ "4 52 49\r",
+ "4 52 50\r",
+ "4 52 51\r",
+ "4 52 52\r",
+ "4 52 53\r",
+ "4 52 54\r",
+ "4 52 55\r",
+ "4 52 56\r",
+ "4 52 57\r",
+ "4 52 58\r",
+ "4 53 1\r",
+ "4 53 2\r",
+ "4 53 3\r",
+ "4 53 4\r",
+ "4 53 5\r",
+ "4 53 6\r",
+ "4 53 7\r",
+ "4 53 8\r",
+ "4 53 9\r",
+ "4 53 10\r",
+ "4 53 11\r",
+ "4 53 12\r",
+ "4 53 13\r",
+ "4 53 14\r",
+ "4 53 15\r",
+ "4 53 16\r",
+ "4 53 17\r",
+ "4 53 18\r",
+ "4 53 19\r",
+ "4 53 20\r",
+ "4 53 21\r",
+ "4 53 22\r",
+ "4 53 23\r",
+ "4 53 24\r",
+ "4 53 25\r",
+ "4 53 26\r",
+ "4 53 27\r",
+ "4 53 28\r",
+ "4 53 29\r",
+ "4 53 30\r",
+ "4 53 31\r",
+ "4 53 32\r",
+ "4 53 33\r",
+ "4 53 34\r",
+ "4 53 35\r",
+ "4 53 36\r",
+ "4 53 37\r",
+ "4 53 38\r",
+ "4 53 39\r",
+ "4 53 40\r",
+ "4 53 41\r",
+ "4 53 42\r",
+ "4 53 43\r",
+ "4 53 44\r",
+ "4 53 45\r",
+ "4 53 46\r",
+ "4 53 47\r",
+ "4 53 48\r",
+ "4 53 49\r",
+ "4 53 50\r",
+ "4 53 51\r",
+ "4 53 52\r",
+ "4 53 53\r",
+ "4 53 54\r",
+ "4 53 55\r",
+ "4 53 56\r",
+ "4 53 57\r",
+ "4 53 58\r",
+ "4 54 1\r",
+ "4 54 2\r",
+ "4 54 3\r",
+ "4 54 4\r",
+ "4 54 5\r",
+ "4 54 6\r",
+ "4 54 7\r",
+ "4 54 8\r",
+ "4 54 9\r",
+ "4 54 10\r",
+ "4 54 11\r",
+ "4 54 12\r",
+ "4 54 13\r",
+ "4 54 14\r",
+ "4 54 15\r",
+ "4 54 16\r",
+ "4 54 17\r",
+ "4 54 18\r",
+ "4 54 19\r",
+ "4 54 20\r",
+ "4 54 21\r",
+ "4 54 22\r",
+ "4 54 23\r",
+ "4 54 24\r",
+ "4 54 25\r",
+ "4 54 26\r",
+ "4 54 27\r",
+ "4 54 28\r",
+ "4 54 29\r",
+ "4 54 30\r",
+ "4 54 31\r",
+ "4 54 32\r",
+ "4 54 33\r",
+ "4 54 34\r",
+ "4 54 35\r",
+ "4 54 36\r",
+ "4 54 37\r",
+ "4 54 38\r",
+ "4 54 39\r",
+ "4 54 40\r",
+ "4 54 41\r",
+ "4 54 42\r",
+ "4 54 43\r",
+ "4 54 44\r",
+ "4 54 45\r",
+ "4 54 46\r",
+ "4 54 47\r",
+ "4 54 48\r",
+ "4 54 49\r",
+ "4 54 50\r",
+ "4 54 51\r",
+ "4 54 52\r",
+ "4 54 53\r",
+ "4 54 54\r",
+ "4 54 55\r",
+ "4 54 56\r",
+ "4 54 57\r",
+ "4 54 58\r",
+ "4 55 1\r",
+ "4 55 2\r",
+ "4 55 3\r",
+ "4 55 4\r",
+ "4 55 5\r",
+ "4 55 6\r",
+ "4 55 7\r",
+ "4 55 8\r",
+ "4 55 9\r",
+ "4 55 10\r",
+ "4 55 11\r",
+ "4 55 12\r",
+ "4 55 13\r",
+ "4 55 14\r",
+ "4 55 15\r",
+ "4 55 16\r",
+ "4 55 17\r",
+ "4 55 18\r",
+ "4 55 19\r",
+ "4 55 20\r",
+ "4 55 21\r",
+ "4 55 22\r",
+ "4 55 23\r",
+ "4 55 24\r",
+ "4 55 25\r",
+ "4 55 26\r",
+ "4 55 27\r",
+ "4 55 28\r",
+ "4 55 29\r",
+ "4 55 30\r",
+ "4 55 31\r",
+ "4 55 32\r",
+ "4 55 33\r",
+ "4 55 34\r",
+ "4 55 35\r",
+ "4 55 36\r",
+ "4 55 37\r",
+ "4 55 38\r",
+ "4 55 39\r",
+ "4 55 40\r",
+ "4 55 41\r",
+ "4 55 42\r",
+ "4 55 43\r",
+ "4 55 44\r",
+ "4 55 45\r",
+ "4 55 46\r",
+ "4 55 47\r",
+ "4 55 48\r",
+ "4 55 49\r",
+ "4 55 50\r",
+ "4 55 51\r",
+ "4 55 52\r",
+ "4 55 53\r",
+ "4 55 54\r",
+ "4 55 55\r",
+ "4 55 56\r",
+ "4 55 57\r",
+ "4 55 58\r",
+ "4 56 1\r",
+ "4 56 2\r",
+ "4 56 3\r",
+ "4 56 4\r",
+ "4 56 5\r",
+ "4 56 6\r",
+ "4 56 7\r",
+ "4 56 8\r",
+ "4 56 9\r",
+ "4 56 10\r",
+ "4 56 11\r",
+ "4 56 12\r",
+ "4 56 13\r",
+ "4 56 14\r",
+ "4 56 15\r",
+ "4 56 16\r",
+ "4 56 17\r",
+ "4 56 18\r",
+ "4 56 19\r",
+ "4 56 20\r",
+ "4 56 21\r",
+ "4 56 22\r",
+ "4 56 23\r",
+ "4 56 24\r",
+ "4 56 25\r",
+ "4 56 26\r",
+ "4 56 27\r",
+ "4 56 28\r",
+ "4 56 29\r",
+ "4 56 30\r",
+ "4 56 31\r",
+ "4 56 32\r",
+ "4 56 33\r",
+ "4 56 34\r",
+ "4 56 35\r",
+ "4 56 36\r",
+ "4 56 37\r",
+ "4 56 38\r",
+ "4 56 39\r",
+ "4 56 40\r",
+ "4 56 41\r",
+ "4 56 42\r",
+ "4 56 43\r",
+ "4 56 44\r",
+ "4 56 45\r",
+ "4 56 46\r",
+ "4 56 47\r",
+ "4 56 48\r",
+ "4 56 49\r",
+ "4 56 50\r",
+ "4 56 51\r",
+ "4 56 52\r",
+ "4 56 53\r",
+ "4 56 54\r",
+ "4 56 55\r",
+ "4 56 56\r",
+ "4 56 57\r",
+ "4 56 58\r",
+ "4 57 1\r",
+ "4 57 2\r",
+ "4 57 3\r",
+ "4 57 4\r",
+ "4 57 5\r",
+ "4 57 6\r",
+ "4 57 7\r",
+ "4 57 8\r",
+ "4 57 9\r",
+ "4 57 10\r",
+ "4 57 11\r",
+ "4 57 12\r",
+ "4 57 13\r",
+ "4 57 14\r",
+ "4 57 15\r",
+ "4 57 16\r",
+ "4 57 17\r",
+ "4 57 18\r",
+ "4 57 19\r",
+ "4 57 20\r",
+ "4 57 21\r",
+ "4 57 22\r",
+ "4 57 23\r",
+ "4 57 24\r",
+ "4 57 25\r",
+ "4 57 26\r",
+ "4 57 27\r",
+ "4 57 28\r",
+ "4 57 29\r",
+ "4 57 30\r",
+ "4 57 31\r",
+ "4 57 32\r",
+ "4 57 33\r",
+ "4 57 34\r",
+ "4 57 35\r",
+ "4 57 36\r",
+ "4 57 37\r",
+ "4 57 38\r",
+ "4 57 39\r",
+ "4 57 40\r",
+ "4 57 41\r",
+ "4 57 42\r",
+ "4 57 43\r",
+ "4 57 44\r",
+ "4 57 45\r",
+ "4 57 46\r",
+ "4 57 47\r",
+ "4 57 48\r",
+ "4 57 49\r",
+ "4 57 50\r",
+ "4 57 51\r",
+ "4 57 52\r",
+ "4 57 53\r",
+ "4 57 54\r",
+ "4 57 55\r",
+ "4 57 56\r",
+ "4 57 57\r",
+ "4 57 58\r",
+ "4 58 1\r",
+ "4 58 2\r",
+ "4 58 3\r",
+ "4 58 4\r",
+ "4 58 5\r",
+ "4 58 6\r",
+ "4 58 7\r",
+ "4 58 8\r",
+ "4 58 9\r",
+ "4 58 10\r",
+ "4 58 11\r",
+ "4 58 12\r",
+ "4 58 13\r",
+ "4 58 14\r",
+ "4 58 15\r",
+ "4 58 16\r",
+ "4 58 17\r",
+ "4 58 18\r",
+ "4 58 19\r",
+ "4 58 20\r",
+ "4 58 21\r",
+ "4 58 22\r",
+ "4 58 23\r",
+ "4 58 24\r",
+ "4 58 25\r",
+ "4 58 26\r",
+ "4 58 27\r",
+ "4 58 28\r",
+ "4 58 29\r",
+ "4 58 30\r",
+ "4 58 31\r",
+ "4 58 32\r",
+ "4 58 33\r",
+ "4 58 34\r",
+ "4 58 35\r",
+ "4 58 36\r",
+ "4 58 37\r",
+ "4 58 38\r",
+ "4 58 39\r",
+ "4 58 40\r",
+ "4 58 41\r",
+ "4 58 42\r",
+ "4 58 43\r",
+ "4 58 44\r",
+ "4 58 45\r",
+ "4 58 46\r",
+ "4 58 47\r",
+ "4 58 48\r",
+ "4 58 49\r",
+ "4 58 50\r",
+ "4 58 51\r",
+ "4 58 52\r",
+ "4 58 53\r",
+ "4 58 54\r",
+ "4 58 55\r",
+ "4 58 56\r",
+ "4 58 57\r",
+ "4 58 58\r",
+ "5 1 1\r",
+ "5 1 2\r",
+ "5 1 3\r",
+ "5 1 4\r",
+ "5 1 5\r",
+ "5 1 6\r",
+ "5 1 7\r",
+ "5 1 8\r",
+ "5 1 9\r",
+ "5 1 10\r",
+ "5 1 11\r",
+ "5 1 12\r",
+ "5 1 13\r",
+ "5 1 14\r",
+ "5 1 15\r",
+ "5 1 16\r",
+ "5 1 17\r",
+ "5 1 18\r",
+ "5 1 19\r",
+ "5 1 20\r",
+ "5 1 21\r",
+ "5 1 22\r",
+ "5 1 23\r",
+ "5 1 24\r",
+ "5 1 25\r",
+ "5 1 26\r",
+ "5 1 27\r",
+ "5 1 28\r",
+ "5 1 29\r",
+ "5 1 30\r",
+ "5 1 31\r",
+ "5 1 32\r",
+ "5 1 33\r",
+ "5 1 34\r",
+ "5 1 35\r",
+ "5 1 36\r",
+ "5 1 37\r",
+ "5 1 38\r",
+ "5 1 39\r",
+ "5 1 40\r",
+ "5 1 41\r",
+ "5 1 42\r",
+ "5 1 43\r",
+ "5 1 44\r",
+ "5 1 45\r",
+ "5 1 46\r",
+ "5 1 47\r",
+ "5 1 48\r",
+ "5 1 49\r",
+ "5 1 50\r",
+ "5 1 51\r",
+ "5 1 52\r",
+ "5 1 53\r",
+ "5 1 54\r",
+ "5 1 55\r",
+ "5 1 56\r",
+ "5 1 57\r",
+ "5 1 58\r",
+ "5 2 1\r",
+ "5 2 2\r",
+ "5 2 3\r",
+ "5 2 4\r",
+ "5 2 5\r",
+ "5 2 6\r",
+ "5 2 7\r",
+ "5 2 8\r",
+ "5 2 9\r",
+ "5 2 10\r",
+ "5 2 11\r",
+ "5 2 12\r",
+ "5 2 13\r",
+ "5 2 14\r",
+ "5 2 15\r",
+ "5 2 16\r",
+ "5 2 17\r",
+ "5 2 18\r",
+ "5 2 19\r",
+ "5 2 20\r",
+ "5 2 21\r",
+ "5 2 22\r",
+ "5 2 23\r",
+ "5 2 24\r",
+ "5 2 25\r",
+ "5 2 26\r",
+ "5 2 27\r",
+ "5 2 28\r",
+ "5 2 29\r",
+ "5 2 30\r",
+ "5 2 31\r",
+ "5 2 32\r",
+ "5 2 33\r",
+ "5 2 34\r",
+ "5 2 35\r",
+ "5 2 36\r",
+ "5 2 37\r",
+ "5 2 38\r",
+ "5 2 39\r",
+ "5 2 40\r",
+ "5 2 41\r",
+ "5 2 42\r",
+ "5 2 43\r",
+ "5 2 44\r",
+ "5 2 45\r",
+ "5 2 46\r",
+ "5 2 47\r",
+ "5 2 48\r",
+ "5 2 49\r",
+ "5 2 50\r",
+ "5 2 51\r",
+ "5 2 52\r",
+ "5 2 53\r",
+ "5 2 54\r",
+ "5 2 55\r",
+ "5 2 56\r",
+ "5 2 57\r",
+ "5 2 58\r",
+ "5 3 1\r",
+ "5 3 2\r",
+ "5 3 3\r",
+ "5 3 4\r",
+ "5 3 5\r",
+ "5 3 6\r",
+ "5 3 7\r",
+ "5 3 8\r",
+ "5 3 9\r",
+ "5 3 10\r",
+ "5 3 11\r",
+ "5 3 12\r",
+ "5 3 13\r",
+ "5 3 14\r",
+ "5 3 15\r",
+ "5 3 16\r",
+ "5 3 17\r",
+ "5 3 18\r",
+ "5 3 19\r",
+ "5 3 20\r",
+ "5 3 21\r",
+ "5 3 22\r",
+ "5 3 23\r",
+ "5 3 24\r",
+ "5 3 25\r",
+ "5 3 26\r",
+ "5 3 27\r",
+ "5 3 28\r",
+ "5 3 29\r",
+ "5 3 30\r",
+ "5 3 31\r",
+ "5 3 32\r",
+ "5 3 33\r",
+ "5 3 34\r",
+ "5 3 35\r",
+ "5 3 36\r",
+ "5 3 37\r",
+ "5 3 38\r",
+ "5 3 39\r",
+ "5 3 40\r",
+ "5 3 41\r",
+ "5 3 42\r",
+ "5 3 43\r",
+ "5 3 44\r",
+ "5 3 45\r",
+ "5 3 46\r",
+ "5 3 47\r",
+ "5 3 48\r",
+ "5 3 49\r",
+ "5 3 50\r",
+ "5 3 51\r",
+ "5 3 52\r",
+ "5 3 53\r",
+ "5 3 54\r",
+ "5 3 55\r",
+ "5 3 56\r",
+ "5 3 57\r",
+ "5 3 58"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "5 4 1\r",
+ "5 4 2\r",
+ "5 4 3\r",
+ "5 4 4\r",
+ "5 4 5\r",
+ "5 4 6\r",
+ "5 4 7\r",
+ "5 4 8\r",
+ "5 4 9\r",
+ "5 4 10\r",
+ "5 4 11\r",
+ "5 4 12\r",
+ "5 4 13\r",
+ "5 4 14\r",
+ "5 4 15\r",
+ "5 4 16\r",
+ "5 4 17\r",
+ "5 4 18\r",
+ "5 4 19\r",
+ "5 4 20\r",
+ "5 4 21\r",
+ "5 4 22\r",
+ "5 4 23\r",
+ "5 4 24\r",
+ "5 4 25\r",
+ "5 4 26\r",
+ "5 4 27\r",
+ "5 4 28\r",
+ "5 4 29\r",
+ "5 4 30\r",
+ "5 4 31\r",
+ "5 4 32\r",
+ "5 4 33\r",
+ "5 4 34\r",
+ "5 4 35\r",
+ "5 4 36\r",
+ "5 4 37\r",
+ "5 4 38\r",
+ "5 4 39\r",
+ "5 4 40\r",
+ "5 4 41\r",
+ "5 4 42\r",
+ "5 4 43\r",
+ "5 4 44\r",
+ "5 4 45\r",
+ "5 4 46\r",
+ "5 4 47\r",
+ "5 4 48\r",
+ "5 4 49\r",
+ "5 4 50\r",
+ "5 4 51\r",
+ "5 4 52\r",
+ "5 4 53\r",
+ "5 4 54\r",
+ "5 4 55\r",
+ "5 4 56\r",
+ "5 4 57\r",
+ "5 4 58\r",
+ "5 5 1\r",
+ "5 5 2\r",
+ "5 5 3\r",
+ "5 5 4\r",
+ "5 5 5\r",
+ "5 5 6\r",
+ "5 5 7\r",
+ "5 5 8\r",
+ "5 5 9\r",
+ "5 5 10\r",
+ "5 5 11\r",
+ "5 5 12\r",
+ "5 5 13\r",
+ "5 5 14\r",
+ "5 5 15\r",
+ "5 5 16\r",
+ "5 5 17\r",
+ "5 5 18\r",
+ "5 5 19\r",
+ "5 5 20\r",
+ "5 5 21\r",
+ "5 5 22\r",
+ "5 5 23\r",
+ "5 5 24\r",
+ "5 5 25\r",
+ "5 5 26\r",
+ "5 5 27\r",
+ "5 5 28\r",
+ "5 5 29\r",
+ "5 5 30\r",
+ "5 5 31\r",
+ "5 5 32\r",
+ "5 5 33\r",
+ "5 5 34\r",
+ "5 5 35\r",
+ "5 5 36\r",
+ "5 5 37\r",
+ "5 5 38\r",
+ "5 5 39\r",
+ "5 5 40\r",
+ "5 5 41\r",
+ "5 5 42\r",
+ "5 5 43\r",
+ "5 5 44\r",
+ "5 5 45\r",
+ "5 5 46\r",
+ "5 5 47\r",
+ "5 5 48\r",
+ "5 5 49\r",
+ "5 5 50\r",
+ "5 5 51\r",
+ "5 5 52\r",
+ "5 5 53\r",
+ "5 5 54\r",
+ "5 5 55\r",
+ "5 5 56\r",
+ "5 5 57\r",
+ "5 5 58\r",
+ "5 6 1\r",
+ "5 6 2\r",
+ "5 6 3\r",
+ "5 6 4\r",
+ "5 6 5\r",
+ "5 6 6\r",
+ "5 6 7\r",
+ "5 6 8\r",
+ "5 6 9\r",
+ "5 6 10\r",
+ "5 6 11\r",
+ "5 6 12\r",
+ "5 6 13\r",
+ "5 6 14\r",
+ "5 6 15\r",
+ "5 6 16\r",
+ "5 6 17\r",
+ "5 6 18\r",
+ "5 6 19\r",
+ "5 6 20\r",
+ "5 6 21\r",
+ "5 6 22\r",
+ "5 6 23\r",
+ "5 6 24\r",
+ "5 6 25\r",
+ "5 6 26\r",
+ "5 6 27\r",
+ "5 6 28\r",
+ "5 6 29\r",
+ "5 6 30\r",
+ "5 6 31\r",
+ "5 6 32\r",
+ "5 6 33\r",
+ "5 6 34\r",
+ "5 6 35\r",
+ "5 6 36\r",
+ "5 6 37\r",
+ "5 6 38\r",
+ "5 6 39\r",
+ "5 6 40\r",
+ "5 6 41\r",
+ "5 6 42\r",
+ "5 6 43\r",
+ "5 6 44\r",
+ "5 6 45\r",
+ "5 6 46\r",
+ "5 6 47\r",
+ "5 6 48\r",
+ "5 6 49\r",
+ "5 6 50\r",
+ "5 6 51\r",
+ "5 6 52\r",
+ "5 6 53\r",
+ "5 6 54\r",
+ "5 6 55\r",
+ "5 6 56\r",
+ "5 6 57\r",
+ "5 6 58\r",
+ "5 7 1\r",
+ "5 7 2\r",
+ "5 7 3\r",
+ "5 7 4\r",
+ "5 7 5\r",
+ "5 7 6\r",
+ "5 7 7\r",
+ "5 7 8\r",
+ "5 7 9\r",
+ "5 7 10\r",
+ "5 7 11\r",
+ "5 7 12\r",
+ "5 7 13\r",
+ "5 7 14\r",
+ "5 7 15\r",
+ "5 7 16\r",
+ "5 7 17\r",
+ "5 7 18\r",
+ "5 7 19\r",
+ "5 7 20\r",
+ "5 7 21\r",
+ "5 7 22\r",
+ "5 7 23\r",
+ "5 7 24\r",
+ "5 7 25\r",
+ "5 7 26\r",
+ "5 7 27\r",
+ "5 7 28\r",
+ "5 7 29\r",
+ "5 7 30\r",
+ "5 7 31\r",
+ "5 7 32\r",
+ "5 7 33\r",
+ "5 7 34\r",
+ "5 7 35\r",
+ "5 7 36\r",
+ "5 7 37\r",
+ "5 7 38\r",
+ "5 7 39\r",
+ "5 7 40\r",
+ "5 7 41\r",
+ "5 7 42\r",
+ "5 7 43\r",
+ "5 7 44\r",
+ "5 7 45\r",
+ "5 7 46\r",
+ "5 7 47\r",
+ "5 7 48\r",
+ "5 7 49\r",
+ "5 7 50\r",
+ "5 7 51\r",
+ "5 7 52\r",
+ "5 7 53\r",
+ "5 7 54\r",
+ "5 7 55\r",
+ "5 7 56\r",
+ "5 7 57\r",
+ "5 7 58\r",
+ "5 8 1\r",
+ "5 8 2\r",
+ "5 8 3\r",
+ "5 8 4\r",
+ "5 8 5\r",
+ "5 8 6\r",
+ "5 8 7\r",
+ "5 8 8\r",
+ "5 8 9\r",
+ "5 8 10\r",
+ "5 8 11\r",
+ "5 8 12\r",
+ "5 8 13\r",
+ "5 8 14\r",
+ "5 8 15\r",
+ "5 8 16\r",
+ "5 8 17\r",
+ "5 8 18\r",
+ "5 8 19\r",
+ "5 8 20\r",
+ "5 8 21\r",
+ "5 8 22\r",
+ "5 8 23\r",
+ "5 8 24\r",
+ "5 8 25\r",
+ "5 8 26\r",
+ "5 8 27\r",
+ "5 8 28\r",
+ "5 8 29\r",
+ "5 8 30\r",
+ "5 8 31\r",
+ "5 8 32\r",
+ "5 8 33\r",
+ "5 8 34\r",
+ "5 8 35\r",
+ "5 8 36\r",
+ "5 8 37\r",
+ "5 8 38\r",
+ "5 8 39\r",
+ "5 8 40\r",
+ "5 8 41\r",
+ "5 8 42\r",
+ "5 8 43\r",
+ "5 8 44\r",
+ "5 8 45\r",
+ "5 8 46\r",
+ "5 8 47\r",
+ "5 8 48\r",
+ "5 8 49\r",
+ "5 8 50\r",
+ "5 8 51\r",
+ "5 8 52\r",
+ "5 8 53\r",
+ "5 8 54\r",
+ "5 8 55\r",
+ "5 8 56\r",
+ "5 8 57\r",
+ "5 8 58\r",
+ "5 9 1\r",
+ "5 9 2\r",
+ "5 9 3\r",
+ "5 9 4\r",
+ "5 9 5\r",
+ "5 9 6\r",
+ "5 9 7\r",
+ "5 9 8\r",
+ "5 9 9\r",
+ "5 9 10\r",
+ "5 9 11\r",
+ "5 9 12\r",
+ "5 9 13\r",
+ "5 9 14\r",
+ "5 9 15\r",
+ "5 9 16\r",
+ "5 9 17\r",
+ "5 9 18\r",
+ "5 9 19\r",
+ "5 9 20\r",
+ "5 9 21\r",
+ "5 9 22\r",
+ "5 9 23\r",
+ "5 9 24\r",
+ "5 9 25\r",
+ "5 9 26\r",
+ "5 9 27\r",
+ "5 9 28\r",
+ "5 9 29\r",
+ "5 9 30\r",
+ "5 9 31\r",
+ "5 9 32\r",
+ "5 9 33\r",
+ "5 9 34\r",
+ "5 9 35\r",
+ "5 9 36\r",
+ "5 9 37\r",
+ "5 9 38\r",
+ "5 9 39\r",
+ "5 9 40\r",
+ "5 9 41\r",
+ "5 9 42\r",
+ "5 9 43\r",
+ "5 9 44\r",
+ "5 9 45\r",
+ "5 9 46\r",
+ "5 9 47\r",
+ "5 9 48\r",
+ "5 9 49\r",
+ "5 9 50\r",
+ "5 9 51\r",
+ "5 9 52\r",
+ "5 9 53\r",
+ "5 9 54\r",
+ "5 9 55\r",
+ "5 9 56\r",
+ "5 9 57\r",
+ "5 9 58\r",
+ "5 10 1\r",
+ "5 10 2\r",
+ "5 10 3\r",
+ "5 10 4\r",
+ "5 10 5\r",
+ "5 10 6\r",
+ "5 10 7\r",
+ "5 10 8\r",
+ "5 10 9\r",
+ "5 10 10\r",
+ "5 10 11\r",
+ "5 10 12\r",
+ "5 10 13\r",
+ "5 10 14\r",
+ "5 10 15\r",
+ "5 10 16\r",
+ "5 10 17\r",
+ "5 10 18\r",
+ "5 10 19\r",
+ "5 10 20\r",
+ "5 10 21\r",
+ "5 10 22\r",
+ "5 10 23\r",
+ "5 10 24\r",
+ "5 10 25\r",
+ "5 10 26\r",
+ "5 10 27\r",
+ "5 10 28\r",
+ "5 10 29\r",
+ "5 10 30\r",
+ "5 10 31\r",
+ "5 10 32\r",
+ "5 10 33\r",
+ "5 10 34\r",
+ "5 10 35\r",
+ "5 10 36\r",
+ "5 10 37\r",
+ "5 10 38\r",
+ "5 10 39\r",
+ "5 10 40\r",
+ "5 10 41\r",
+ "5 10 42\r",
+ "5 10 43\r",
+ "5 10 44\r",
+ "5 10 45\r",
+ "5 10 46\r",
+ "5 10 47\r",
+ "5 10 48\r",
+ "5 10 49\r",
+ "5 10 50\r",
+ "5 10 51\r",
+ "5 10 52\r",
+ "5 10 53\r",
+ "5 10 54\r",
+ "5 10 55\r",
+ "5 10 56\r",
+ "5 10 57\r",
+ "5 10 58\r",
+ "5 11 1\r",
+ "5 11 2\r",
+ "5 11 3\r",
+ "5 11 4\r",
+ "5 11 5\r",
+ "5 11 6\r",
+ "5 11 7\r",
+ "5 11 8\r",
+ "5 11 9\r",
+ "5 11 10\r",
+ "5 11 11\r",
+ "5 11 12\r",
+ "5 11 13\r",
+ "5 11 14\r",
+ "5 11 15\r",
+ "5 11 16\r",
+ "5 11 17\r",
+ "5 11 18\r",
+ "5 11 19\r",
+ "5 11 20\r",
+ "5 11 21\r",
+ "5 11 22\r",
+ "5 11 23\r",
+ "5 11 24\r",
+ "5 11 25\r",
+ "5 11 26\r",
+ "5 11 27\r",
+ "5 11 28\r",
+ "5 11 29\r",
+ "5 11 30\r",
+ "5 11 31\r",
+ "5 11 32\r",
+ "5 11 33\r",
+ "5 11 34\r",
+ "5 11 35\r",
+ "5 11 36\r",
+ "5 11 37\r",
+ "5 11 38\r",
+ "5 11 39\r",
+ "5 11 40\r",
+ "5 11 41\r",
+ "5 11 42\r",
+ "5 11 43\r",
+ "5 11 44\r",
+ "5 11 45\r",
+ "5 11 46\r",
+ "5 11 47\r",
+ "5 11 48\r",
+ "5 11 49\r",
+ "5 11 50\r",
+ "5 11 51\r",
+ "5 11 52\r",
+ "5 11 53\r",
+ "5 11 54\r",
+ "5 11 55\r",
+ "5 11 56\r",
+ "5 11 57\r",
+ "5 11 58\r",
+ "5 12 1\r",
+ "5 12 2\r",
+ "5 12 3\r",
+ "5 12 4\r",
+ "5 12 5\r",
+ "5 12 6\r",
+ "5 12 7\r",
+ "5 12 8\r",
+ "5 12 9\r",
+ "5 12 10\r",
+ "5 12 11\r",
+ "5 12 12\r",
+ "5 12 13\r",
+ "5 12 14\r",
+ "5 12 15\r",
+ "5 12 16\r",
+ "5 12 17\r",
+ "5 12 18\r",
+ "5 12 19\r",
+ "5 12 20\r",
+ "5 12 21\r",
+ "5 12 22\r",
+ "5 12 23\r",
+ "5 12 24\r",
+ "5 12 25\r",
+ "5 12 26\r",
+ "5 12 27\r",
+ "5 12 28\r",
+ "5 12 29\r",
+ "5 12 30\r",
+ "5 12 31\r",
+ "5 12 32\r",
+ "5 12 33\r",
+ "5 12 34\r",
+ "5 12 35\r",
+ "5 12 36\r",
+ "5 12 37\r",
+ "5 12 38\r",
+ "5 12 39\r",
+ "5 12 40\r",
+ "5 12 41\r",
+ "5 12 42\r",
+ "5 12 43\r",
+ "5 12 44\r",
+ "5 12 45\r",
+ "5 12 46\r",
+ "5 12 47\r",
+ "5 12 48\r",
+ "5 12 49\r",
+ "5 12 50\r",
+ "5 12 51\r",
+ "5 12 52\r",
+ "5 12 53\r",
+ "5 12 54\r",
+ "5 12 55\r",
+ "5 12 56\r",
+ "5 12 57\r",
+ "5 12 58\r",
+ "5 13 1\r",
+ "5 13 2\r",
+ "5 13 3\r",
+ "5 13 4\r",
+ "5 13 5\r",
+ "5 13 6\r",
+ "5 13 7\r",
+ "5 13 8\r",
+ "5 13 9\r",
+ "5 13 10\r",
+ "5 13 11\r",
+ "5 13 12\r",
+ "5 13 13\r",
+ "5 13 14\r",
+ "5 13 15\r",
+ "5 13 16\r",
+ "5 13 17\r",
+ "5 13 18\r",
+ "5 13 19\r",
+ "5 13 20\r",
+ "5 13 21\r",
+ "5 13 22\r",
+ "5 13 23\r",
+ "5 13 24\r",
+ "5 13 25\r",
+ "5 13 26\r",
+ "5 13 27\r",
+ "5 13 28\r",
+ "5 13 29\r",
+ "5 13 30\r",
+ "5 13 31\r",
+ "5 13 32\r",
+ "5 13 33\r",
+ "5 13 34\r",
+ "5 13 35\r",
+ "5 13 36\r",
+ "5 13 37\r",
+ "5 13 38\r",
+ "5 13 39\r",
+ "5 13 40\r",
+ "5 13 41\r",
+ "5 13 42\r",
+ "5 13 43\r",
+ "5 13 44\r",
+ "5 13 45\r",
+ "5 13 46\r",
+ "5 13 47\r",
+ "5 13 48\r",
+ "5 13 49\r",
+ "5 13 50\r",
+ "5 13 51\r",
+ "5 13 52\r",
+ "5 13 53\r",
+ "5 13 54\r",
+ "5 13 55\r",
+ "5 13 56\r",
+ "5 13 57\r",
+ "5 13 58\r",
+ "5 14 1\r",
+ "5 14 2\r",
+ "5 14 3\r",
+ "5 14 4\r",
+ "5 14 5\r",
+ "5 14 6\r",
+ "5 14 7\r",
+ "5 14 8\r",
+ "5 14 9\r",
+ "5 14 10\r",
+ "5 14 11\r",
+ "5 14 12\r",
+ "5 14 13\r",
+ "5 14 14\r",
+ "5 14 15\r",
+ "5 14 16\r",
+ "5 14 17\r",
+ "5 14 18\r",
+ "5 14 19\r",
+ "5 14 20\r",
+ "5 14 21\r",
+ "5 14 22\r",
+ "5 14 23\r",
+ "5 14 24\r",
+ "5 14 25\r",
+ "5 14 26\r",
+ "5 14 27\r",
+ "5 14 28\r",
+ "5 14 29\r",
+ "5 14 30\r",
+ "5 14 31\r",
+ "5 14 32\r",
+ "5 14 33\r",
+ "5 14 34\r",
+ "5 14 35\r",
+ "5 14 36\r",
+ "5 14 37\r",
+ "5 14 38\r",
+ "5 14 39\r",
+ "5 14 40\r",
+ "5 14 41\r",
+ "5 14 42\r",
+ "5 14 43\r",
+ "5 14 44\r",
+ "5 14 45\r",
+ "5 14 46\r",
+ "5 14 47\r",
+ "5 14 48\r",
+ "5 14 49\r",
+ "5 14 50\r",
+ "5 14 51\r",
+ "5 14 52\r",
+ "5 14 53\r",
+ "5 14 54\r",
+ "5 14 55\r",
+ "5 14 56\r",
+ "5 14 57\r",
+ "5 14 58\r",
+ "5 15 1\r",
+ "5 15 2\r",
+ "5 15 3\r",
+ "5 15 4\r",
+ "5 15 5\r",
+ "5 15 6\r",
+ "5 15 7\r",
+ "5 15 8\r",
+ "5 15 9\r",
+ "5 15 10\r",
+ "5 15 11\r",
+ "5 15 12\r",
+ "5 15 13\r",
+ "5 15 14\r",
+ "5 15 15\r",
+ "5 15 16\r",
+ "5 15 17\r",
+ "5 15 18\r",
+ "5 15 19\r",
+ "5 15 20\r",
+ "5 15 21\r",
+ "5 15 22\r",
+ "5 15 23\r",
+ "5 15 24\r",
+ "5 15 25\r",
+ "5 15 26\r",
+ "5 15 27\r",
+ "5 15 28\r",
+ "5 15 29\r",
+ "5 15 30\r",
+ "5 15 31\r",
+ "5 15 32\r",
+ "5 15 33\r",
+ "5 15 34\r",
+ "5 15 35\r",
+ "5 15 36\r",
+ "5 15 37\r",
+ "5 15 38\r",
+ "5 15 39\r",
+ "5 15 40\r",
+ "5 15 41\r",
+ "5 15 42\r",
+ "5 15 43\r",
+ "5 15 44\r",
+ "5 15 45\r",
+ "5 15 46\r",
+ "5 15 47\r",
+ "5 15 48\r",
+ "5 15 49\r",
+ "5 15 50\r",
+ "5 15 51\r",
+ "5 15 52\r",
+ "5 15 53\r",
+ "5 15 54\r",
+ "5 15 55\r",
+ "5 15 56\r",
+ "5 15 57\r",
+ "5 15 58\r",
+ "5 16 1\r",
+ "5 16 2\r",
+ "5 16 3\r",
+ "5 16 4\r",
+ "5 16 5\r",
+ "5 16 6\r",
+ "5 16 7\r",
+ "5 16 8\r",
+ "5 16 9\r",
+ "5 16 10\r",
+ "5 16 11\r",
+ "5 16 12\r",
+ "5 16 13\r",
+ "5 16 14\r",
+ "5 16 15\r",
+ "5 16 16\r",
+ "5 16 17\r",
+ "5 16 18\r",
+ "5 16 19\r",
+ "5 16 20\r",
+ "5 16 21\r",
+ "5 16 22\r",
+ "5 16 23\r",
+ "5 16 24\r",
+ "5 16 25\r",
+ "5 16 26\r",
+ "5 16 27\r",
+ "5 16 28\r",
+ "5 16 29\r",
+ "5 16 30\r",
+ "5 16 31\r",
+ "5 16 32\r",
+ "5 16 33\r",
+ "5 16 34\r",
+ "5 16 35\r",
+ "5 16 36\r",
+ "5 16 37\r",
+ "5 16 38\r",
+ "5 16 39\r",
+ "5 16 40\r",
+ "5 16 41\r",
+ "5 16 42\r",
+ "5 16 43\r",
+ "5 16 44\r",
+ "5 16 45\r",
+ "5 16 46\r",
+ "5 16 47\r",
+ "5 16 48\r",
+ "5 16 49\r",
+ "5 16 50\r",
+ "5 16 51\r",
+ "5 16 52\r",
+ "5 16 53\r",
+ "5 16 54\r",
+ "5 16 55\r",
+ "5 16 56\r",
+ "5 16 57\r",
+ "5 16 58\r",
+ "5 17 1\r",
+ "5 17 2\r",
+ "5 17 3\r",
+ "5 17 4\r",
+ "5 17 5\r",
+ "5 17 6\r",
+ "5 17 7\r",
+ "5 17 8\r",
+ "5 17 9\r",
+ "5 17 10\r",
+ "5 17 11\r",
+ "5 17 12\r",
+ "5 17 13\r",
+ "5 17 14\r",
+ "5 17 15\r",
+ "5 17 16\r",
+ "5 17 17\r",
+ "5 17 18\r",
+ "5 17 19\r",
+ "5 17 20\r",
+ "5 17 21\r",
+ "5 17 22\r",
+ "5 17 23\r",
+ "5 17 24\r",
+ "5 17 25\r",
+ "5 17 26\r",
+ "5 17 27\r",
+ "5 17 28\r",
+ "5 17 29\r",
+ "5 17 30\r",
+ "5 17 31\r",
+ "5 17 32\r",
+ "5 17 33\r",
+ "5 17 34\r",
+ "5 17 35\r",
+ "5 17 36\r",
+ "5 17 37\r",
+ "5 17 38\r",
+ "5 17 39\r",
+ "5 17 40\r",
+ "5 17 41\r",
+ "5 17 42\r",
+ "5 17 43\r",
+ "5 17 44\r",
+ "5 17 45\r",
+ "5 17 46\r",
+ "5 17 47\r",
+ "5 17 48\r",
+ "5 17 49\r",
+ "5 17 50\r",
+ "5 17 51\r",
+ "5 17 52\r",
+ "5 17 53\r",
+ "5 17 54\r",
+ "5 17 55\r",
+ "5 17 56\r",
+ "5 17 57\r",
+ "5 17 58\r",
+ "5 18 1\r",
+ "5 18 2\r",
+ "5 18 3\r",
+ "5 18 4\r",
+ "5 18 5\r",
+ "5 18 6\r",
+ "5 18 7\r",
+ "5 18 8\r",
+ "5 18 9\r",
+ "5 18 10\r",
+ "5 18 11\r",
+ "5 18 12\r",
+ "5 18 13\r",
+ "5 18 14\r",
+ "5 18 15\r",
+ "5 18 16\r",
+ "5 18 17\r",
+ "5 18 18\r",
+ "5 18 19\r",
+ "5 18 20\r",
+ "5 18 21\r",
+ "5 18 22\r",
+ "5 18 23\r",
+ "5 18 24\r",
+ "5 18 25\r",
+ "5 18 26\r",
+ "5 18 27\r",
+ "5 18 28\r",
+ "5 18 29\r",
+ "5 18 30\r",
+ "5 18 31\r",
+ "5 18 32\r",
+ "5 18 33\r",
+ "5 18 34\r",
+ "5 18 35\r",
+ "5 18 36\r",
+ "5 18 37\r",
+ "5 18 38\r",
+ "5 18 39\r",
+ "5 18 40\r",
+ "5 18 41\r",
+ "5 18 42\r",
+ "5 18 43\r",
+ "5 18 44\r",
+ "5 18 45\r",
+ "5 18 46\r",
+ "5 18 47\r",
+ "5 18 48\r",
+ "5 18 49\r",
+ "5 18 50\r",
+ "5 18 51\r",
+ "5 18 52\r",
+ "5 18 53\r",
+ "5 18 54\r",
+ "5 18 55\r",
+ "5 18 56\r",
+ "5 18 57\r",
+ "5 18 58\r",
+ "5 19 1\r",
+ "5 19 2\r",
+ "5 19 3\r",
+ "5 19 4\r",
+ "5 19 5\r",
+ "5 19 6\r",
+ "5 19 7\r",
+ "5 19 8\r",
+ "5 19 9\r",
+ "5 19 10\r",
+ "5 19 11\r",
+ "5 19 12\r",
+ "5 19 13\r",
+ "5 19 14\r",
+ "5 19 15\r",
+ "5 19 16\r",
+ "5 19 17\r",
+ "5 19 18\r",
+ "5 19 19\r",
+ "5 19 20\r",
+ "5 19 21\r",
+ "5 19 22\r",
+ "5 19 23\r",
+ "5 19 24\r",
+ "5 19 25\r",
+ "5 19 26\r",
+ "5 19 27\r",
+ "5 19 28\r",
+ "5 19 29\r",
+ "5 19 30\r",
+ "5 19 31\r",
+ "5 19 32\r",
+ "5 19 33\r",
+ "5 19 34\r",
+ "5 19 35\r",
+ "5 19 36\r",
+ "5 19 37\r",
+ "5 19 38\r",
+ "5 19 39\r",
+ "5 19 40\r",
+ "5 19 41\r",
+ "5 19 42\r",
+ "5 19 43\r",
+ "5 19 44\r",
+ "5 19 45\r",
+ "5 19 46\r",
+ "5 19 47\r",
+ "5 19 48\r",
+ "5 19 49\r",
+ "5 19 50\r",
+ "5 19 51\r",
+ "5 19 52\r",
+ "5 19 53\r",
+ "5 19 54\r",
+ "5 19 55\r",
+ "5 19 56\r",
+ "5 19 57\r",
+ "5 19 58\r",
+ "5 20 1\r",
+ "5 20 2\r",
+ "5 20 3\r",
+ "5 20 4\r",
+ "5 20 5\r",
+ "5 20 6\r",
+ "5 20 7\r",
+ "5 20 8\r",
+ "5 20 9\r",
+ "5 20 10\r",
+ "5 20 11\r",
+ "5 20 12\r",
+ "5 20 13\r",
+ "5 20 14\r",
+ "5 20 15\r",
+ "5 20 16\r",
+ "5 20 17\r",
+ "5 20 18\r",
+ "5 20 19\r",
+ "5 20 20\r",
+ "5 20 21\r",
+ "5 20 22\r",
+ "5 20 23\r",
+ "5 20 24\r",
+ "5 20 25\r",
+ "5 20 26\r",
+ "5 20 27\r",
+ "5 20 28\r",
+ "5 20 29\r",
+ "5 20 30\r",
+ "5 20 31\r",
+ "5 20 32\r",
+ "5 20 33\r",
+ "5 20 34\r",
+ "5 20 35\r",
+ "5 20 36\r",
+ "5 20 37\r",
+ "5 20 38\r",
+ "5 20 39\r",
+ "5 20 40\r",
+ "5 20 41\r",
+ "5 20 42\r",
+ "5 20 43\r",
+ "5 20 44\r",
+ "5 20 45\r",
+ "5 20 46\r",
+ "5 20 47\r",
+ "5 20 48\r",
+ "5 20 49\r",
+ "5 20 50\r",
+ "5 20 51\r",
+ "5 20 52\r",
+ "5 20 53\r",
+ "5 20 54\r",
+ "5 20 55\r",
+ "5 20 56\r",
+ "5 20 57\r",
+ "5 20 58\r",
+ "5 21 1\r",
+ "5 21 2\r",
+ "5 21 3\r",
+ "5 21 4\r",
+ "5 21 5\r",
+ "5 21 6\r",
+ "5 21 7\r",
+ "5 21 8\r",
+ "5 21 9\r",
+ "5 21 10\r",
+ "5 21 11\r",
+ "5 21 12\r",
+ "5 21 13\r",
+ "5 21 14\r",
+ "5 21 15\r",
+ "5 21 16\r",
+ "5 21 17\r",
+ "5 21 18\r",
+ "5 21 19\r",
+ "5 21 20\r",
+ "5 21 21\r",
+ "5 21 22\r",
+ "5 21 23\r",
+ "5 21 24\r",
+ "5 21 25\r",
+ "5 21 26\r",
+ "5 21 27\r",
+ "5 21 28\r",
+ "5 21 29\r",
+ "5 21 30\r",
+ "5 21 31\r",
+ "5 21 32\r",
+ "5 21 33\r",
+ "5 21 34\r",
+ "5 21 35\r",
+ "5 21 36\r",
+ "5 21 37\r",
+ "5 21 38\r",
+ "5 21 39\r",
+ "5 21 40\r",
+ "5 21 41\r",
+ "5 21 42\r",
+ "5 21 43\r",
+ "5 21 44\r",
+ "5 21 45\r",
+ "5 21 46\r",
+ "5 21 47\r",
+ "5 21 48\r",
+ "5 21 49\r",
+ "5 21 50\r",
+ "5 21 51\r",
+ "5 21 52\r",
+ "5 21 53\r",
+ "5 21 54\r",
+ "5 21 55\r",
+ "5 21 56\r",
+ "5 21 57\r",
+ "5 21 58\r",
+ "5 22 1\r",
+ "5 22 2\r",
+ "5 22 3\r",
+ "5 22 4\r",
+ "5 22 5\r",
+ "5 22 6\r",
+ "5 22 7\r",
+ "5 22 8\r",
+ "5 22 9\r",
+ "5 22 10\r",
+ "5 22 11\r",
+ "5 22 12\r",
+ "5 22 13\r",
+ "5 22 14\r",
+ "5 22 15\r",
+ "5 22 16\r",
+ "5 22 17\r",
+ "5 22 18\r",
+ "5 22 19\r",
+ "5 22 20\r",
+ "5 22 21\r",
+ "5 22 22\r",
+ "5 22 23\r",
+ "5 22 24\r",
+ "5 22 25\r",
+ "5 22 26\r",
+ "5 22 27\r",
+ "5 22 28\r",
+ "5 22 29\r",
+ "5 22 30\r",
+ "5 22 31\r",
+ "5 22 32\r",
+ "5 22 33\r",
+ "5 22 34\r",
+ "5 22 35\r",
+ "5 22 36\r",
+ "5 22 37\r",
+ "5 22 38\r",
+ "5 22 39\r",
+ "5 22 40\r",
+ "5 22 41\r",
+ "5 22 42\r",
+ "5 22 43\r",
+ "5 22 44\r",
+ "5 22 45\r",
+ "5 22 46\r",
+ "5 22 47\r",
+ "5 22 48\r",
+ "5 22 49\r",
+ "5 22 50\r",
+ "5 22 51\r",
+ "5 22 52\r",
+ "5 22 53\r",
+ "5 22 54\r",
+ "5 22 55\r",
+ "5 22 56\r",
+ "5 22 57\r",
+ "5 22 58\r",
+ "5 23 1\r",
+ "5 23 2\r",
+ "5 23 3\r",
+ "5 23 4\r",
+ "5 23 5\r",
+ "5 23 6\r",
+ "5 23 7\r",
+ "5 23 8\r",
+ "5 23 9\r",
+ "5 23 10\r",
+ "5 23 11\r",
+ "5 23 12\r",
+ "5 23 13\r",
+ "5 23 14\r",
+ "5 23 15\r",
+ "5 23 16\r",
+ "5 23 17\r",
+ "5 23 18\r",
+ "5 23 19\r",
+ "5 23 20\r",
+ "5 23 21\r",
+ "5 23 22\r",
+ "5 23 23\r",
+ "5 23 24\r",
+ "5 23 25\r",
+ "5 23 26\r",
+ "5 23 27\r",
+ "5 23 28\r",
+ "5 23 29\r",
+ "5 23 30\r",
+ "5 23 31\r",
+ "5 23 32\r",
+ "5 23 33\r",
+ "5 23 34\r",
+ "5 23 35\r",
+ "5 23 36\r",
+ "5 23 37\r",
+ "5 23 38\r",
+ "5 23 39\r",
+ "5 23 40\r",
+ "5 23 41\r",
+ "5 23 42\r",
+ "5 23 43\r",
+ "5 23 44\r",
+ "5 23 45\r",
+ "5 23 46\r",
+ "5 23 47\r",
+ "5 23 48\r",
+ "5 23 49\r",
+ "5 23 50\r",
+ "5 23 51\r",
+ "5 23 52\r",
+ "5 23 53\r",
+ "5 23 54\r",
+ "5 23 55\r",
+ "5 23 56\r",
+ "5 23 57\r",
+ "5 23 58\r",
+ "5 24 1\r",
+ "5 24 2\r",
+ "5 24 3\r",
+ "5 24 4\r",
+ "5 24 5\r",
+ "5 24 6\r",
+ "5 24 7\r",
+ "5 24 8\r",
+ "5 24 9\r",
+ "5 24 10\r",
+ "5 24 11\r",
+ "5 24 12\r",
+ "5 24 13\r",
+ "5 24 14\r",
+ "5 24 15\r",
+ "5 24 16\r",
+ "5 24 17\r",
+ "5 24 18\r",
+ "5 24 19\r",
+ "5 24 20\r",
+ "5 24 21\r",
+ "5 24 22\r",
+ "5 24 23\r",
+ "5 24 24\r",
+ "5 24 25\r",
+ "5 24 26\r",
+ "5 24 27\r",
+ "5 24 28\r",
+ "5 24 29\r",
+ "5 24 30\r",
+ "5 24 31\r",
+ "5 24 32\r",
+ "5 24 33\r",
+ "5 24 34\r",
+ "5 24 35\r",
+ "5 24 36\r",
+ "5 24 37\r",
+ "5 24 38\r",
+ "5 24 39\r",
+ "5 24 40\r",
+ "5 24 41\r",
+ "5 24 42\r",
+ "5 24 43\r",
+ "5 24 44\r",
+ "5 24 45\r",
+ "5 24 46\r",
+ "5 24 47\r",
+ "5 24 48\r",
+ "5 24 49\r",
+ "5 24 50\r",
+ "5 24 51\r",
+ "5 24 52\r",
+ "5 24 53\r",
+ "5 24 54\r",
+ "5 24 55\r",
+ "5 24 56\r",
+ "5 24 57\r",
+ "5 24 58\r",
+ "5 25 1\r",
+ "5 25 2\r",
+ "5 25 3\r",
+ "5 25 4\r",
+ "5 25 5\r",
+ "5 25 6\r",
+ "5 25 7\r",
+ "5 25 8\r",
+ "5 25 9\r",
+ "5 25 10\r",
+ "5 25 11\r",
+ "5 25 12\r",
+ "5 25 13\r",
+ "5 25 14\r",
+ "5 25 15\r",
+ "5 25 16\r",
+ "5 25 17\r",
+ "5 25 18\r",
+ "5 25 19\r",
+ "5 25 20\r",
+ "5 25 21\r",
+ "5 25 22\r",
+ "5 25 23\r",
+ "5 25 24\r",
+ "5 25 25\r",
+ "5 25 26\r",
+ "5 25 27\r",
+ "5 25 28\r",
+ "5 25 29\r",
+ "5 25 30\r",
+ "5 25 31\r",
+ "5 25 32\r",
+ "5 25 33\r",
+ "5 25 34\r",
+ "5 25 35\r",
+ "5 25 36\r",
+ "5 25 37\r",
+ "5 25 38\r",
+ "5 25 39\r",
+ "5 25 40\r",
+ "5 25 41\r",
+ "5 25 42\r",
+ "5 25 43\r",
+ "5 25 44\r",
+ "5 25 45\r",
+ "5 25 46\r",
+ "5 25 47\r",
+ "5 25 48\r",
+ "5 25 49\r",
+ "5 25 50\r",
+ "5 25 51\r",
+ "5 25 52\r",
+ "5 25 53\r",
+ "5 25 54\r",
+ "5 25 55\r",
+ "5 25 56\r",
+ "5 25 57\r",
+ "5 25 58\r",
+ "5 26 1\r",
+ "5 26 2\r",
+ "5 26 3\r",
+ "5 26 4\r",
+ "5 26 5\r",
+ "5 26 6\r",
+ "5 26 7\r",
+ "5 26 8\r",
+ "5 26 9\r",
+ "5 26 10\r",
+ "5 26 11\r",
+ "5 26 12\r",
+ "5 26 13\r",
+ "5 26 14\r",
+ "5 26 15\r",
+ "5 26 16\r",
+ "5 26 17\r",
+ "5 26 18\r",
+ "5 26 19\r",
+ "5 26 20\r",
+ "5 26 21\r",
+ "5 26 22\r",
+ "5 26 23\r",
+ "5 26 24\r",
+ "5 26 25\r",
+ "5 26 26\r",
+ "5 26 27\r",
+ "5 26 28\r",
+ "5 26 29\r",
+ "5 26 30\r",
+ "5 26 31\r",
+ "5 26 32\r",
+ "5 26 33\r",
+ "5 26 34\r",
+ "5 26 35\r",
+ "5 26 36\r",
+ "5 26 37\r",
+ "5 26 38\r",
+ "5 26 39\r",
+ "5 26 40\r",
+ "5 26 41\r",
+ "5 26 42\r",
+ "5 26 43\r",
+ "5 26 44\r",
+ "5 26 45\r",
+ "5 26 46\r",
+ "5 26 47\r",
+ "5 26 48\r",
+ "5 26 49\r",
+ "5 26 50\r",
+ "5 26 51\r",
+ "5 26 52\r",
+ "5 26 53\r",
+ "5 26 54\r",
+ "5 26 55\r",
+ "5 26 56\r",
+ "5 26 57\r",
+ "5 26 58\r",
+ "5 27 1\r",
+ "5 27 2\r",
+ "5 27 3\r",
+ "5 27 4\r",
+ "5 27 5\r",
+ "5 27 6\r",
+ "5 27 7\r",
+ "5 27 8\r",
+ "5 27 9\r",
+ "5 27 10\r",
+ "5 27 11\r",
+ "5 27 12\r",
+ "5 27 13\r",
+ "5 27 14\r",
+ "5 27 15\r",
+ "5 27 16\r",
+ "5 27 17\r",
+ "5 27 18\r",
+ "5 27 19\r",
+ "5 27 20\r",
+ "5 27 21\r",
+ "5 27 22\r",
+ "5 27 23\r",
+ "5 27 24\r",
+ "5 27 25\r",
+ "5 27 26\r",
+ "5 27 27\r",
+ "5 27 28\r",
+ "5 27 29\r",
+ "5 27 30\r",
+ "5 27 31\r",
+ "5 27 32\r",
+ "5 27 33\r",
+ "5 27 34\r",
+ "5 27 35\r",
+ "5 27 36\r",
+ "5 27 37\r",
+ "5 27 38\r",
+ "5 27 39\r",
+ "5 27 40\r",
+ "5 27 41\r",
+ "5 27 42\r",
+ "5 27 43\r",
+ "5 27 44\r",
+ "5 27 45\r",
+ "5 27 46\r",
+ "5 27 47\r",
+ "5 27 48\r",
+ "5 27 49\r",
+ "5 27 50\r",
+ "5 27 51\r",
+ "5 27 52\r",
+ "5 27 53\r",
+ "5 27 54\r",
+ "5 27 55\r",
+ "5 27 56\r",
+ "5 27 57\r",
+ "5 27 58\r",
+ "5 28 1\r",
+ "5 28 2\r",
+ "5 28 3\r",
+ "5 28 4\r",
+ "5 28 5\r",
+ "5 28 6\r",
+ "5 28 7\r",
+ "5 28 8\r",
+ "5 28 9\r",
+ "5 28 10\r",
+ "5 28 11\r",
+ "5 28 12\r",
+ "5 28 13\r",
+ "5 28 14\r",
+ "5 28 15\r",
+ "5 28 16\r",
+ "5 28 17\r",
+ "5 28 18\r",
+ "5 28 19\r",
+ "5 28 20\r",
+ "5 28 21\r",
+ "5 28 22\r",
+ "5 28 23\r",
+ "5 28 24\r",
+ "5 28 25\r",
+ "5 28 26\r",
+ "5 28 27\r",
+ "5 28 28\r",
+ "5 28 29\r",
+ "5 28 30\r",
+ "5 28 31\r",
+ "5 28 32\r",
+ "5 28 33\r",
+ "5 28 34\r",
+ "5 28 35\r",
+ "5 28 36\r",
+ "5 28 37\r",
+ "5 28 38\r",
+ "5 28 39\r",
+ "5 28 40\r",
+ "5 28 41\r",
+ "5 28 42\r",
+ "5 28 43\r",
+ "5 28 44\r",
+ "5 28 45\r",
+ "5 28 46\r",
+ "5 28 47\r",
+ "5 28 48\r",
+ "5 28 49\r",
+ "5 28 50\r",
+ "5 28 51\r",
+ "5 28 52\r",
+ "5 28 53\r",
+ "5 28 54\r",
+ "5 28 55\r",
+ "5 28 56\r",
+ "5 28 57\r",
+ "5 28 58\r",
+ "5 29 1\r",
+ "5 29 2\r",
+ "5 29 3\r",
+ "5 29 4\r",
+ "5 29 5\r",
+ "5 29 6\r",
+ "5 29 7\r",
+ "5 29 8\r",
+ "5 29 9\r",
+ "5 29 10\r",
+ "5 29 11\r",
+ "5 29 12\r",
+ "5 29 13\r",
+ "5 29 14\r",
+ "5 29 15\r",
+ "5 29 16\r",
+ "5 29 17\r",
+ "5 29 18\r",
+ "5 29 19\r",
+ "5 29 20\r",
+ "5 29 21\r",
+ "5 29 22\r",
+ "5 29 23\r",
+ "5 29 24\r",
+ "5 29 25\r",
+ "5 29 26\r",
+ "5 29 27\r",
+ "5 29 28\r",
+ "5 29 29\r",
+ "5 29 30\r",
+ "5 29 31\r",
+ "5 29 32\r",
+ "5 29 33\r",
+ "5 29 34\r",
+ "5 29 35\r",
+ "5 29 36\r",
+ "5 29 37\r",
+ "5 29 38\r",
+ "5 29 39\r",
+ "5 29 40\r",
+ "5 29 41\r",
+ "5 29 42\r",
+ "5 29 43\r",
+ "5 29 44\r",
+ "5 29 45\r",
+ "5 29 46\r",
+ "5 29 47\r",
+ "5 29 48\r",
+ "5 29 49\r",
+ "5 29 50\r",
+ "5 29 51\r",
+ "5 29 52\r",
+ "5 29 53\r",
+ "5 29 54\r",
+ "5 29 55\r",
+ "5 29 56\r",
+ "5 29 57\r",
+ "5 29 58\r",
+ "5 30 1\r",
+ "5 30 2\r",
+ "5 30 3\r",
+ "5 30 4\r",
+ "5 30 5\r",
+ "5 30 6\r",
+ "5 30 7\r",
+ "5 30 8\r",
+ "5 30 9\r",
+ "5 30 10\r",
+ "5 30 11\r",
+ "5 30 12\r",
+ "5 30 13\r",
+ "5 30 14\r",
+ "5 30 15\r",
+ "5 30 16\r",
+ "5 30 17\r",
+ "5 30 18\r",
+ "5 30 19\r",
+ "5 30 20\r",
+ "5 30 21\r",
+ "5 30 22\r",
+ "5 30 23\r",
+ "5 30 24\r",
+ "5 30 25\r",
+ "5 30 26\r",
+ "5 30 27\r",
+ "5 30 28\r",
+ "5 30 29\r",
+ "5 30 30\r",
+ "5 30 31\r",
+ "5 30 32\r",
+ "5 30 33\r",
+ "5 30 34\r",
+ "5 30 35\r",
+ "5 30 36\r",
+ "5 30 37\r",
+ "5 30 38\r",
+ "5 30 39\r",
+ "5 30 40\r",
+ "5 30 41\r",
+ "5 30 42\r",
+ "5 30 43\r",
+ "5 30 44\r",
+ "5 30 45\r",
+ "5 30 46\r",
+ "5 30 47\r",
+ "5 30 48\r",
+ "5 30 49\r",
+ "5 30 50\r",
+ "5 30 51\r",
+ "5 30 52\r",
+ "5 30 53\r",
+ "5 30 54\r",
+ "5 30 55\r",
+ "5 30 56\r",
+ "5 30 57\r",
+ "5 30 58\r",
+ "5 31 1\r",
+ "5 31 2\r",
+ "5 31 3\r",
+ "5 31 4\r",
+ "5 31 5\r",
+ "5 31 6\r",
+ "5 31 7\r",
+ "5 31 8\r",
+ "5 31 9\r",
+ "5 31 10\r",
+ "5 31 11\r",
+ "5 31 12\r",
+ "5 31 13\r",
+ "5 31 14\r",
+ "5 31 15\r",
+ "5 31 16\r",
+ "5 31 17\r",
+ "5 31 18\r",
+ "5 31 19\r",
+ "5 31 20\r",
+ "5 31 21\r",
+ "5 31 22\r",
+ "5 31 23\r",
+ "5 31 24\r",
+ "5 31 25\r",
+ "5 31 26\r",
+ "5 31 27\r",
+ "5 31 28\r",
+ "5 31 29\r",
+ "5 31 30\r",
+ "5 31 31\r",
+ "5 31 32\r",
+ "5 31 33\r",
+ "5 31 34\r",
+ "5 31 35\r",
+ "5 31 36\r",
+ "5 31 37\r",
+ "5 31 38\r",
+ "5 31 39\r",
+ "5 31 40\r",
+ "5 31 41\r",
+ "5 31 42\r",
+ "5 31 43\r",
+ "5 31 44\r",
+ "5 31 45\r",
+ "5 31 46\r",
+ "5 31 47\r",
+ "5 31 48\r",
+ "5 31 49\r",
+ "5 31 50\r",
+ "5 31 51\r",
+ "5 31 52\r",
+ "5 31 53\r",
+ "5 31 54\r",
+ "5 31 55\r",
+ "5 31 56\r",
+ "5 31 57\r",
+ "5 31 58\r",
+ "5 32 1\r",
+ "5 32 2\r",
+ "5 32 3\r",
+ "5 32 4\r",
+ "5 32 5\r",
+ "5 32 6\r",
+ "5 32 7\r",
+ "5 32 8\r",
+ "5 32 9\r",
+ "5 32 10\r",
+ "5 32 11\r",
+ "5 32 12\r",
+ "5 32 13\r",
+ "5 32 14\r",
+ "5 32 15\r",
+ "5 32 16\r",
+ "5 32 17\r",
+ "5 32 18\r",
+ "5 32 19\r",
+ "5 32 20\r",
+ "5 32 21\r",
+ "5 32 22\r",
+ "5 32 23\r",
+ "5 32 24\r",
+ "5 32 25\r",
+ "5 32 26\r",
+ "5 32 27\r",
+ "5 32 28\r",
+ "5 32 29\r",
+ "5 32 30\r",
+ "5 32 31\r",
+ "5 32 32\r",
+ "5 32 33\r",
+ "5 32 34\r",
+ "5 32 35\r",
+ "5 32 36\r",
+ "5 32 37\r",
+ "5 32 38\r",
+ "5 32 39\r",
+ "5 32 40\r",
+ "5 32 41\r",
+ "5 32 42\r",
+ "5 32 43\r",
+ "5 32 44\r",
+ "5 32 45\r",
+ "5 32 46\r",
+ "5 32 47\r",
+ "5 32 48\r",
+ "5 32 49\r",
+ "5 32 50\r",
+ "5 32 51\r",
+ "5 32 52\r",
+ "5 32 53\r",
+ "5 32 54\r",
+ "5 32 55\r",
+ "5 32 56\r",
+ "5 32 57\r",
+ "5 32 58\r",
+ "5 33 1\r",
+ "5 33 2\r",
+ "5 33 3\r",
+ "5 33 4\r",
+ "5 33 5\r",
+ "5 33 6\r",
+ "5 33 7\r",
+ "5 33 8\r",
+ "5 33 9\r",
+ "5 33 10\r",
+ "5 33 11\r",
+ "5 33 12\r",
+ "5 33 13\r",
+ "5 33 14\r",
+ "5 33 15\r",
+ "5 33 16\r",
+ "5 33 17\r",
+ "5 33 18\r",
+ "5 33 19\r",
+ "5 33 20\r",
+ "5 33 21\r",
+ "5 33 22\r",
+ "5 33 23\r",
+ "5 33 24\r",
+ "5 33 25\r",
+ "5 33 26\r",
+ "5 33 27\r",
+ "5 33 28\r",
+ "5 33 29\r",
+ "5 33 30\r",
+ "5 33 31\r",
+ "5 33 32\r",
+ "5 33 33\r",
+ "5 33 34\r",
+ "5 33 35\r",
+ "5 33 36\r",
+ "5 33 37\r",
+ "5 33 38\r",
+ "5 33 39\r",
+ "5 33 40\r",
+ "5 33 41\r",
+ "5 33 42\r",
+ "5 33 43\r",
+ "5 33 44\r",
+ "5 33 45\r",
+ "5 33 46\r",
+ "5 33 47\r",
+ "5 33 48\r",
+ "5 33 49\r",
+ "5 33 50\r",
+ "5 33 51\r",
+ "5 33 52\r",
+ "5 33 53\r",
+ "5 33 54\r",
+ "5 33 55\r",
+ "5 33 56\r",
+ "5 33 57\r",
+ "5 33 58\r",
+ "5 34 1\r",
+ "5 34 2\r",
+ "5 34 3\r",
+ "5 34 4\r",
+ "5 34 5\r",
+ "5 34 6\r",
+ "5 34 7\r",
+ "5 34 8\r",
+ "5 34 9\r",
+ "5 34 10\r",
+ "5 34 11\r",
+ "5 34 12\r",
+ "5 34 13\r",
+ "5 34 14\r",
+ "5 34 15\r",
+ "5 34 16\r",
+ "5 34 17\r",
+ "5 34 18\r",
+ "5 34 19\r",
+ "5 34 20\r",
+ "5 34 21\r",
+ "5 34 22\r",
+ "5 34 23\r",
+ "5 34 24\r",
+ "5 34 25\r",
+ "5 34 26\r",
+ "5 34 27\r",
+ "5 34 28\r",
+ "5 34 29\r",
+ "5 34 30\r",
+ "5 34 31\r",
+ "5 34 32\r",
+ "5 34 33\r",
+ "5 34 34\r",
+ "5 34 35\r",
+ "5 34 36\r",
+ "5 34 37\r",
+ "5 34 38\r",
+ "5 34 39\r",
+ "5 34 40\r",
+ "5 34 41\r",
+ "5 34 42\r",
+ "5 34 43\r",
+ "5 34 44\r",
+ "5 34 45\r",
+ "5 34 46\r",
+ "5 34 47\r",
+ "5 34 48\r",
+ "5 34 49\r",
+ "5 34 50\r",
+ "5 34 51\r",
+ "5 34 52\r",
+ "5 34 53\r",
+ "5 34 54\r",
+ "5 34 55\r",
+ "5 34 56\r",
+ "5 34 57\r",
+ "5 34 58\r",
+ "5 35 1\r",
+ "5 35 2\r",
+ "5 35 3\r",
+ "5 35 4\r",
+ "5 35 5\r",
+ "5 35 6\r",
+ "5 35 7\r",
+ "5 35 8\r",
+ "5 35 9\r",
+ "5 35 10\r",
+ "5 35 11\r",
+ "5 35 12\r",
+ "5 35 13\r",
+ "5 35 14\r",
+ "5 35 15\r",
+ "5 35 16\r",
+ "5 35 17\r",
+ "5 35 18\r",
+ "5 35 19\r",
+ "5 35 20\r",
+ "5 35 21\r",
+ "5 35 22\r",
+ "5 35 23\r",
+ "5 35 24\r",
+ "5 35 25\r",
+ "5 35 26\r",
+ "5 35 27\r",
+ "5 35 28\r",
+ "5 35 29\r",
+ "5 35 30\r",
+ "5 35 31\r",
+ "5 35 32\r",
+ "5 35 33\r",
+ "5 35 34\r",
+ "5 35 35\r",
+ "5 35 36\r",
+ "5 35 37\r",
+ "5 35 38\r",
+ "5 35 39\r",
+ "5 35 40\r",
+ "5 35 41\r",
+ "5 35 42\r",
+ "5 35 43\r",
+ "5 35 44\r",
+ "5 35 45\r",
+ "5 35 46\r",
+ "5 35 47\r",
+ "5 35 48\r",
+ "5 35 49\r",
+ "5 35 50\r",
+ "5 35 51\r",
+ "5 35 52\r",
+ "5 35 53\r",
+ "5 35 54\r",
+ "5 35 55\r",
+ "5 35 56\r",
+ "5 35 57\r",
+ "5 35 58\r",
+ "5 36 1\r",
+ "5 36 2\r",
+ "5 36 3\r",
+ "5 36 4\r",
+ "5 36 5\r",
+ "5 36 6\r",
+ "5 36 7\r",
+ "5 36 8\r",
+ "5 36 9\r",
+ "5 36 10\r",
+ "5 36 11\r",
+ "5 36 12\r",
+ "5 36 13\r",
+ "5 36 14\r",
+ "5 36 15\r",
+ "5 36 16\r",
+ "5 36 17\r",
+ "5 36 18\r",
+ "5 36 19\r",
+ "5 36 20\r",
+ "5 36 21\r",
+ "5 36 22\r",
+ "5 36 23\r",
+ "5 36 24\r",
+ "5 36 25\r",
+ "5 36 26\r",
+ "5 36 27\r",
+ "5 36 28\r",
+ "5 36 29\r",
+ "5 36 30\r",
+ "5 36 31\r",
+ "5 36 32\r",
+ "5 36 33\r",
+ "5 36 34\r",
+ "5 36 35\r",
+ "5 36 36\r",
+ "5 36 37\r",
+ "5 36 38\r",
+ "5 36 39\r",
+ "5 36 40\r",
+ "5 36 41\r",
+ "5 36 42\r",
+ "5 36 43\r",
+ "5 36 44\r",
+ "5 36 45\r",
+ "5 36 46\r",
+ "5 36 47\r",
+ "5 36 48\r",
+ "5 36 49\r",
+ "5 36 50\r",
+ "5 36 51\r",
+ "5 36 52\r",
+ "5 36 53\r",
+ "5 36 54\r",
+ "5 36 55\r",
+ "5 36 56\r",
+ "5 36 57\r",
+ "5 36 58\r",
+ "5 37 1\r",
+ "5 37 2\r",
+ "5 37 3\r",
+ "5 37 4\r",
+ "5 37 5\r",
+ "5 37 6\r",
+ "5 37 7\r",
+ "5 37 8\r",
+ "5 37 9\r",
+ "5 37 10\r",
+ "5 37 11\r",
+ "5 37 12\r",
+ "5 37 13\r",
+ "5 37 14\r",
+ "5 37 15\r",
+ "5 37 16\r",
+ "5 37 17\r",
+ "5 37 18\r",
+ "5 37 19\r",
+ "5 37 20\r",
+ "5 37 21\r",
+ "5 37 22\r",
+ "5 37 23\r",
+ "5 37 24\r",
+ "5 37 25\r",
+ "5 37 26\r",
+ "5 37 27\r",
+ "5 37 28\r",
+ "5 37 29\r",
+ "5 37 30\r",
+ "5 37 31\r",
+ "5 37 32\r",
+ "5 37 33\r",
+ "5 37 34\r",
+ "5 37 35\r",
+ "5 37 36\r",
+ "5 37 37\r",
+ "5 37 38\r",
+ "5 37 39\r",
+ "5 37 40\r",
+ "5 37 41\r",
+ "5 37 42\r",
+ "5 37 43\r",
+ "5 37 44\r",
+ "5 37 45\r",
+ "5 37 46\r",
+ "5 37 47\r",
+ "5 37 48\r",
+ "5 37 49\r",
+ "5 37 50\r",
+ "5 37 51\r",
+ "5 37 52\r",
+ "5 37 53\r",
+ "5 37 54\r",
+ "5 37 55\r",
+ "5 37 56\r",
+ "5 37 57\r",
+ "5 37 58\r",
+ "5 38 1\r",
+ "5 38 2\r",
+ "5 38 3\r",
+ "5 38 4\r",
+ "5 38 5\r",
+ "5 38 6\r",
+ "5 38 7\r",
+ "5 38 8\r",
+ "5 38 9\r",
+ "5 38 10\r",
+ "5 38 11\r",
+ "5 38 12\r",
+ "5 38 13\r",
+ "5 38 14\r",
+ "5 38 15\r",
+ "5 38 16\r",
+ "5 38 17\r",
+ "5 38 18\r",
+ "5 38 19\r",
+ "5 38 20\r",
+ "5 38 21\r",
+ "5 38 22\r",
+ "5 38 23\r",
+ "5 38 24\r",
+ "5 38 25\r",
+ "5 38 26\r",
+ "5 38 27\r",
+ "5 38 28\r",
+ "5 38 29\r",
+ "5 38 30\r",
+ "5 38 31\r",
+ "5 38 32\r",
+ "5 38 33\r",
+ "5 38 34\r",
+ "5 38 35\r",
+ "5 38 36\r",
+ "5 38 37\r",
+ "5 38 38\r",
+ "5 38 39\r",
+ "5 38 40\r",
+ "5 38 41\r",
+ "5 38 42\r",
+ "5 38 43\r",
+ "5 38 44\r",
+ "5 38 45\r",
+ "5 38 46\r",
+ "5 38 47\r",
+ "5 38 48\r",
+ "5 38 49\r",
+ "5 38 50\r",
+ "5 38 51\r",
+ "5 38 52\r",
+ "5 38 53\r",
+ "5 38 54\r",
+ "5 38 55\r",
+ "5 38 56\r",
+ "5 38 57\r",
+ "5 38 58\r",
+ "5 39 1\r",
+ "5 39 2\r",
+ "5 39 3\r",
+ "5 39 4\r",
+ "5 39 5\r",
+ "5 39 6\r",
+ "5 39 7\r",
+ "5 39 8\r",
+ "5 39 9\r",
+ "5 39 10\r",
+ "5 39 11\r",
+ "5 39 12\r",
+ "5 39 13\r",
+ "5 39 14\r",
+ "5 39 15\r",
+ "5 39 16\r",
+ "5 39 17\r",
+ "5 39 18\r",
+ "5 39 19\r",
+ "5 39 20\r",
+ "5 39 21\r",
+ "5 39 22\r",
+ "5 39 23\r",
+ "5 39 24\r",
+ "5 39 25\r",
+ "5 39 26\r",
+ "5 39 27\r",
+ "5 39 28\r",
+ "5 39 29\r",
+ "5 39 30\r",
+ "5 39 31\r",
+ "5 39 32\r",
+ "5 39 33\r",
+ "5 39 34\r",
+ "5 39 35\r",
+ "5 39 36\r",
+ "5 39 37\r",
+ "5 39 38\r",
+ "5 39 39\r",
+ "5 39 40\r",
+ "5 39 41\r",
+ "5 39 42\r",
+ "5 39 43\r",
+ "5 39 44\r",
+ "5 39 45\r",
+ "5 39 46\r",
+ "5 39 47\r",
+ "5 39 48\r",
+ "5 39 49\r",
+ "5 39 50\r",
+ "5 39 51\r",
+ "5 39 52\r",
+ "5 39 53\r",
+ "5 39 54\r",
+ "5 39 55\r",
+ "5 39 56\r",
+ "5 39 57\r",
+ "5 39 58\r",
+ "5 40 1\r",
+ "5 40 2\r",
+ "5 40 3\r",
+ "5 40 4\r",
+ "5 40 5\r",
+ "5 40 6\r",
+ "5 40 7\r",
+ "5 40 8\r",
+ "5 40 9\r",
+ "5 40 10\r",
+ "5 40 11\r",
+ "5 40 12\r",
+ "5 40 13\r",
+ "5 40 14\r",
+ "5 40 15\r",
+ "5 40 16\r",
+ "5 40 17\r",
+ "5 40 18\r",
+ "5 40 19\r",
+ "5 40 20\r",
+ "5 40 21\r",
+ "5 40 22\r",
+ "5 40 23\r",
+ "5 40 24\r",
+ "5 40 25\r",
+ "5 40 26\r",
+ "5 40 27\r",
+ "5 40 28\r",
+ "5 40 29\r",
+ "5 40 30\r",
+ "5 40 31\r",
+ "5 40 32\r",
+ "5 40 33\r",
+ "5 40 34\r",
+ "5 40 35\r",
+ "5 40 36\r",
+ "5 40 37\r",
+ "5 40 38\r",
+ "5 40 39\r",
+ "5 40 40\r",
+ "5 40 41\r",
+ "5 40 42\r",
+ "5 40 43\r",
+ "5 40 44\r",
+ "5 40 45\r",
+ "5 40 46\r",
+ "5 40 47\r",
+ "5 40 48\r",
+ "5 40 49\r",
+ "5 40 50\r",
+ "5 40 51\r",
+ "5 40 52\r",
+ "5 40 53\r",
+ "5 40 54\r",
+ "5 40 55\r",
+ "5 40 56\r",
+ "5 40 57\r",
+ "5 40 58\r",
+ "5 41 1\r",
+ "5 41 2\r",
+ "5 41 3\r",
+ "5 41 4\r",
+ "5 41 5\r",
+ "5 41 6\r",
+ "5 41 7\r",
+ "5 41 8\r",
+ "5 41 9\r",
+ "5 41 10\r",
+ "5 41 11\r",
+ "5 41 12\r",
+ "5 41 13\r",
+ "5 41 14\r",
+ "5 41 15\r",
+ "5 41 16\r",
+ "5 41 17\r",
+ "5 41 18\r",
+ "5 41 19\r",
+ "5 41 20\r",
+ "5 41 21\r",
+ "5 41 22\r",
+ "5 41 23\r",
+ "5 41 24\r",
+ "5 41 25\r",
+ "5 41 26\r",
+ "5 41 27\r",
+ "5 41 28\r",
+ "5 41 29\r",
+ "5 41 30\r",
+ "5 41 31\r",
+ "5 41 32\r",
+ "5 41 33\r",
+ "5 41 34\r",
+ "5 41 35\r",
+ "5 41 36\r",
+ "5 41 37\r",
+ "5 41 38\r",
+ "5 41 39\r",
+ "5 41 40\r",
+ "5 41 41\r",
+ "5 41 42\r",
+ "5 41 43\r",
+ "5 41 44\r",
+ "5 41 45\r",
+ "5 41 46\r",
+ "5 41 47\r",
+ "5 41 48\r",
+ "5 41 49\r",
+ "5 41 50\r",
+ "5 41 51\r",
+ "5 41 52\r",
+ "5 41 53\r",
+ "5 41 54\r",
+ "5 41 55\r",
+ "5 41 56\r",
+ "5 41 57\r",
+ "5 41 58\r",
+ "5 42 1\r",
+ "5 42 2\r",
+ "5 42 3\r",
+ "5 42 4\r",
+ "5 42 5\r",
+ "5 42 6\r",
+ "5 42 7\r",
+ "5 42 8\r",
+ "5 42 9\r",
+ "5 42 10\r",
+ "5 42 11\r",
+ "5 42 12\r",
+ "5 42 13\r",
+ "5 42 14\r",
+ "5 42 15\r",
+ "5 42 16\r",
+ "5 42 17\r",
+ "5 42 18\r",
+ "5 42 19\r",
+ "5 42 20\r",
+ "5 42 21\r",
+ "5 42 22\r",
+ "5 42 23\r",
+ "5 42 24\r",
+ "5 42 25\r",
+ "5 42 26\r",
+ "5 42 27\r",
+ "5 42 28\r",
+ "5 42 29\r",
+ "5 42 30\r",
+ "5 42 31\r",
+ "5 42 32\r",
+ "5 42 33\r",
+ "5 42 34\r",
+ "5 42 35\r",
+ "5 42 36\r",
+ "5 42 37\r",
+ "5 42 38\r",
+ "5 42 39\r",
+ "5 42 40\r",
+ "5 42 41\r",
+ "5 42 42\r",
+ "5 42 43\r",
+ "5 42 44\r",
+ "5 42 45\r",
+ "5 42 46\r",
+ "5 42 47\r",
+ "5 42 48\r",
+ "5 42 49\r",
+ "5 42 50\r",
+ "5 42 51\r",
+ "5 42 52\r",
+ "5 42 53\r",
+ "5 42 54\r",
+ "5 42 55\r",
+ "5 42 56\r",
+ "5 42 57\r",
+ "5 42 58\r",
+ "5 43 1\r",
+ "5 43 2\r",
+ "5 43 3\r",
+ "5 43 4\r",
+ "5 43 5\r",
+ "5 43 6\r",
+ "5 43 7\r",
+ "5 43 8\r",
+ "5 43 9\r",
+ "5 43 10\r",
+ "5 43 11\r",
+ "5 43 12\r",
+ "5 43 13\r",
+ "5 43 14\r",
+ "5 43 15\r",
+ "5 43 16\r",
+ "5 43 17\r",
+ "5 43 18\r",
+ "5 43 19\r",
+ "5 43 20\r",
+ "5 43 21\r",
+ "5 43 22\r",
+ "5 43 23\r",
+ "5 43 24\r",
+ "5 43 25\r",
+ "5 43 26\r",
+ "5 43 27\r",
+ "5 43 28\r",
+ "5 43 29\r",
+ "5 43 30\r",
+ "5 43 31\r",
+ "5 43 32\r",
+ "5 43 33\r",
+ "5 43 34\r",
+ "5 43 35\r",
+ "5 43 36\r",
+ "5 43 37\r",
+ "5 43 38\r",
+ "5 43 39\r",
+ "5 43 40\r",
+ "5 43 41\r",
+ "5 43 42\r",
+ "5 43 43\r",
+ "5 43 44\r",
+ "5 43 45\r",
+ "5 43 46\r",
+ "5 43 47\r",
+ "5 43 48\r",
+ "5 43 49\r",
+ "5 43 50\r",
+ "5 43 51\r",
+ "5 43 52\r",
+ "5 43 53\r",
+ "5 43 54\r",
+ "5 43 55\r",
+ "5 43 56\r",
+ "5 43 57\r",
+ "5 43 58\r",
+ "5 44 1\r",
+ "5 44 2\r",
+ "5 44 3\r",
+ "5 44 4\r",
+ "5 44 5\r",
+ "5 44 6\r",
+ "5 44 7\r",
+ "5 44 8\r",
+ "5 44 9\r",
+ "5 44 10\r",
+ "5 44 11\r",
+ "5 44 12\r",
+ "5 44 13\r",
+ "5 44 14\r",
+ "5 44 15\r",
+ "5 44 16\r",
+ "5 44 17\r",
+ "5 44 18\r",
+ "5 44 19\r",
+ "5 44 20\r",
+ "5 44 21\r",
+ "5 44 22\r",
+ "5 44 23\r",
+ "5 44 24\r",
+ "5 44 25\r",
+ "5 44 26\r",
+ "5 44 27\r",
+ "5 44 28\r",
+ "5 44 29\r",
+ "5 44 30\r",
+ "5 44 31\r",
+ "5 44 32\r",
+ "5 44 33\r",
+ "5 44 34\r",
+ "5 44 35\r",
+ "5 44 36\r",
+ "5 44 37\r",
+ "5 44 38\r",
+ "5 44 39\r",
+ "5 44 40\r",
+ "5 44 41\r",
+ "5 44 42\r",
+ "5 44 43\r",
+ "5 44 44\r",
+ "5 44 45\r",
+ "5 44 46\r",
+ "5 44 47\r",
+ "5 44 48\r",
+ "5 44 49\r",
+ "5 44 50\r",
+ "5 44 51\r",
+ "5 44 52\r",
+ "5 44 53\r",
+ "5 44 54\r",
+ "5 44 55\r",
+ "5 44 56\r",
+ "5 44 57\r",
+ "5 44 58\r",
+ "5 45 1\r",
+ "5 45 2\r",
+ "5 45 3\r",
+ "5 45 4\r",
+ "5 45 5\r",
+ "5 45 6\r",
+ "5 45 7\r",
+ "5 45 8\r",
+ "5 45 9\r",
+ "5 45 10\r",
+ "5 45 11\r",
+ "5 45 12\r",
+ "5 45 13\r",
+ "5 45 14\r",
+ "5 45 15\r",
+ "5 45 16\r",
+ "5 45 17\r",
+ "5 45 18\r",
+ "5 45 19\r",
+ "5 45 20\r",
+ "5 45 21\r",
+ "5 45 22\r",
+ "5 45 23\r",
+ "5 45 24\r",
+ "5 45 25\r",
+ "5 45 26\r",
+ "5 45 27\r",
+ "5 45 28\r",
+ "5 45 29\r",
+ "5 45 30\r",
+ "5 45 31\r",
+ "5 45 32\r",
+ "5 45 33\r",
+ "5 45 34\r",
+ "5 45 35\r",
+ "5 45 36\r",
+ "5 45 37\r",
+ "5 45 38\r",
+ "5 45 39\r",
+ "5 45 40\r",
+ "5 45 41\r",
+ "5 45 42\r",
+ "5 45 43\r",
+ "5 45 44\r",
+ "5 45 45\r",
+ "5 45 46\r",
+ "5 45 47\r",
+ "5 45 48\r",
+ "5 45 49\r",
+ "5 45 50\r",
+ "5 45 51\r",
+ "5 45 52\r",
+ "5 45 53\r",
+ "5 45 54\r",
+ "5 45 55\r",
+ "5 45 56\r",
+ "5 45 57\r",
+ "5 45 58\r",
+ "5 46 1\r",
+ "5 46 2\r",
+ "5 46 3\r",
+ "5 46 4\r",
+ "5 46 5\r",
+ "5 46 6\r",
+ "5 46 7\r",
+ "5 46 8\r",
+ "5 46 9\r",
+ "5 46 10\r",
+ "5 46 11\r",
+ "5 46 12\r",
+ "5 46 13\r",
+ "5 46 14\r",
+ "5 46 15\r",
+ "5 46 16\r",
+ "5 46 17\r",
+ "5 46 18\r",
+ "5 46 19\r",
+ "5 46 20\r",
+ "5 46 21\r",
+ "5 46 22\r",
+ "5 46 23\r",
+ "5 46 24\r",
+ "5 46 25\r",
+ "5 46 26\r",
+ "5 46 27\r",
+ "5 46 28\r",
+ "5 46 29\r",
+ "5 46 30\r",
+ "5 46 31\r",
+ "5 46 32\r",
+ "5 46 33\r",
+ "5 46 34\r",
+ "5 46 35\r",
+ "5 46 36\r",
+ "5 46 37\r",
+ "5 46 38\r",
+ "5 46 39\r",
+ "5 46 40\r",
+ "5 46 41\r",
+ "5 46 42\r",
+ "5 46 43\r",
+ "5 46 44\r",
+ "5 46 45\r",
+ "5 46 46\r",
+ "5 46 47\r",
+ "5 46 48\r",
+ "5 46 49\r",
+ "5 46 50\r",
+ "5 46 51\r",
+ "5 46 52\r",
+ "5 46 53\r",
+ "5 46 54\r",
+ "5 46 55\r",
+ "5 46 56\r",
+ "5 46 57\r",
+ "5 46 58\r",
+ "5 47 1\r",
+ "5 47 2\r",
+ "5 47 3\r",
+ "5 47 4\r",
+ "5 47 5\r",
+ "5 47 6\r",
+ "5 47 7\r",
+ "5 47 8\r",
+ "5 47 9\r",
+ "5 47 10\r",
+ "5 47 11\r",
+ "5 47 12\r",
+ "5 47 13\r",
+ "5 47 14\r",
+ "5 47 15\r",
+ "5 47 16\r",
+ "5 47 17\r",
+ "5 47 18\r",
+ "5 47 19\r",
+ "5 47 20\r",
+ "5 47 21\r",
+ "5 47 22\r",
+ "5 47 23\r",
+ "5 47 24\r",
+ "5 47 25\r",
+ "5 47 26\r",
+ "5 47 27\r",
+ "5 47 28\r",
+ "5 47 29\r",
+ "5 47 30\r",
+ "5 47 31\r",
+ "5 47 32\r",
+ "5 47 33\r",
+ "5 47 34\r",
+ "5 47 35\r",
+ "5 47 36\r",
+ "5 47 37\r",
+ "5 47 38\r",
+ "5 47 39\r",
+ "5 47 40\r",
+ "5 47 41\r",
+ "5 47 42\r",
+ "5 47 43\r",
+ "5 47 44\r",
+ "5 47 45\r",
+ "5 47 46\r",
+ "5 47 47\r",
+ "5 47 48\r",
+ "5 47 49\r",
+ "5 47 50\r",
+ "5 47 51\r",
+ "5 47 52\r",
+ "5 47 53\r",
+ "5 47 54\r",
+ "5 47 55\r",
+ "5 47 56\r",
+ "5 47 57\r",
+ "5 47 58\r",
+ "5 48 1\r",
+ "5 48 2\r",
+ "5 48 3\r",
+ "5 48 4\r",
+ "5 48 5\r",
+ "5 48 6\r",
+ "5 48 7\r",
+ "5 48 8\r",
+ "5 48 9\r",
+ "5 48 10\r",
+ "5 48 11\r",
+ "5 48 12\r",
+ "5 48 13\r",
+ "5 48 14\r",
+ "5 48 15\r",
+ "5 48 16\r",
+ "5 48 17\r",
+ "5 48 18\r",
+ "5 48 19\r",
+ "5 48 20\r",
+ "5 48 21\r",
+ "5 48 22\r",
+ "5 48 23\r",
+ "5 48 24\r",
+ "5 48 25\r",
+ "5 48 26\r",
+ "5 48 27\r",
+ "5 48 28\r",
+ "5 48 29\r",
+ "5 48 30\r",
+ "5 48 31\r",
+ "5 48 32\r",
+ "5 48 33\r",
+ "5 48 34\r",
+ "5 48 35\r",
+ "5 48 36\r",
+ "5 48 37\r",
+ "5 48 38\r",
+ "5 48 39\r",
+ "5 48 40\r",
+ "5 48 41\r",
+ "5 48 42\r",
+ "5 48 43\r",
+ "5 48 44\r",
+ "5 48 45\r",
+ "5 48 46\r",
+ "5 48 47\r",
+ "5 48 48\r",
+ "5 48 49\r",
+ "5 48 50\r",
+ "5 48 51\r",
+ "5 48 52\r",
+ "5 48 53\r",
+ "5 48 54\r",
+ "5 48 55\r",
+ "5 48 56\r",
+ "5 48 57\r",
+ "5 48 58\r",
+ "5 49 1\r",
+ "5 49 2\r",
+ "5 49 3\r",
+ "5 49 4\r",
+ "5 49 5\r",
+ "5 49 6\r",
+ "5 49 7\r",
+ "5 49 8\r",
+ "5 49 9\r",
+ "5 49 10\r",
+ "5 49 11\r",
+ "5 49 12\r",
+ "5 49 13\r",
+ "5 49 14\r",
+ "5 49 15\r",
+ "5 49 16\r",
+ "5 49 17\r",
+ "5 49 18\r",
+ "5 49 19\r",
+ "5 49 20\r",
+ "5 49 21\r",
+ "5 49 22\r",
+ "5 49 23\r",
+ "5 49 24\r",
+ "5 49 25\r",
+ "5 49 26\r",
+ "5 49 27\r",
+ "5 49 28\r",
+ "5 49 29\r",
+ "5 49 30\r",
+ "5 49 31\r",
+ "5 49 32\r",
+ "5 49 33\r",
+ "5 49 34\r",
+ "5 49 35\r",
+ "5 49 36\r",
+ "5 49 37\r",
+ "5 49 38\r",
+ "5 49 39\r",
+ "5 49 40\r",
+ "5 49 41\r",
+ "5 49 42\r",
+ "5 49 43\r",
+ "5 49 44\r",
+ "5 49 45\r",
+ "5 49 46\r",
+ "5 49 47\r",
+ "5 49 48\r",
+ "5 49 49\r",
+ "5 49 50\r",
+ "5 49 51\r",
+ "5 49 52\r",
+ "5 49 53\r",
+ "5 49 54\r",
+ "5 49 55\r",
+ "5 49 56\r",
+ "5 49 57\r",
+ "5 49 58\r",
+ "5 50 1\r",
+ "5 50 2\r",
+ "5 50 3\r",
+ "5 50 4\r",
+ "5 50 5\r",
+ "5 50 6\r",
+ "5 50 7\r",
+ "5 50 8\r",
+ "5 50 9\r",
+ "5 50 10\r",
+ "5 50 11\r",
+ "5 50 12\r",
+ "5 50 13\r",
+ "5 50 14\r",
+ "5 50 15\r",
+ "5 50 16\r",
+ "5 50 17\r",
+ "5 50 18\r",
+ "5 50 19"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "5 50 20\r",
+ "5 50 21\r",
+ "5 50 22\r",
+ "5 50 23\r",
+ "5 50 24\r",
+ "5 50 25\r",
+ "5 50 26\r",
+ "5 50 27\r",
+ "5 50 28\r",
+ "5 50 29\r",
+ "5 50 30\r",
+ "5 50 31\r",
+ "5 50 32\r",
+ "5 50 33\r",
+ "5 50 34\r",
+ "5 50 35\r",
+ "5 50 36\r",
+ "5 50 37\r",
+ "5 50 38\r",
+ "5 50 39\r",
+ "5 50 40\r",
+ "5 50 41\r",
+ "5 50 42\r",
+ "5 50 43\r",
+ "5 50 44\r",
+ "5 50 45\r",
+ "5 50 46\r",
+ "5 50 47\r",
+ "5 50 48\r",
+ "5 50 49\r",
+ "5 50 50\r",
+ "5 50 51\r",
+ "5 50 52\r",
+ "5 50 53\r",
+ "5 50 54\r",
+ "5 50 55\r",
+ "5 50 56\r",
+ "5 50 57\r",
+ "5 50 58\r",
+ "5 51 1\r",
+ "5 51 2\r",
+ "5 51 3\r",
+ "5 51 4\r",
+ "5 51 5\r",
+ "5 51 6\r",
+ "5 51 7\r",
+ "5 51 8\r",
+ "5 51 9\r",
+ "5 51 10\r",
+ "5 51 11\r",
+ "5 51 12\r",
+ "5 51 13\r",
+ "5 51 14\r",
+ "5 51 15\r",
+ "5 51 16\r",
+ "5 51 17\r",
+ "5 51 18\r",
+ "5 51 19\r",
+ "5 51 20\r",
+ "5 51 21\r",
+ "5 51 22\r",
+ "5 51 23\r",
+ "5 51 24\r",
+ "5 51 25\r",
+ "5 51 26\r",
+ "5 51 27\r",
+ "5 51 28\r",
+ "5 51 29\r",
+ "5 51 30\r",
+ "5 51 31\r",
+ "5 51 32\r",
+ "5 51 33\r",
+ "5 51 34\r",
+ "5 51 35\r",
+ "5 51 36\r",
+ "5 51 37\r",
+ "5 51 38\r",
+ "5 51 39\r",
+ "5 51 40\r",
+ "5 51 41\r",
+ "5 51 42\r",
+ "5 51 43\r",
+ "5 51 44\r",
+ "5 51 45\r",
+ "5 51 46\r",
+ "5 51 47\r",
+ "5 51 48\r",
+ "5 51 49\r",
+ "5 51 50\r",
+ "5 51 51\r",
+ "5 51 52\r",
+ "5 51 53\r",
+ "5 51 54\r",
+ "5 51 55\r",
+ "5 51 56\r",
+ "5 51 57\r",
+ "5 51 58\r",
+ "5 52 1\r",
+ "5 52 2\r",
+ "5 52 3\r",
+ "5 52 4\r",
+ "5 52 5\r",
+ "5 52 6\r",
+ "5 52 7\r",
+ "5 52 8\r",
+ "5 52 9\r",
+ "5 52 10\r",
+ "5 52 11\r",
+ "5 52 12\r",
+ "5 52 13\r",
+ "5 52 14\r",
+ "5 52 15\r",
+ "5 52 16\r",
+ "5 52 17\r",
+ "5 52 18\r",
+ "5 52 19\r",
+ "5 52 20\r",
+ "5 52 21\r",
+ "5 52 22\r",
+ "5 52 23\r",
+ "5 52 24\r",
+ "5 52 25\r",
+ "5 52 26\r",
+ "5 52 27\r",
+ "5 52 28\r",
+ "5 52 29\r",
+ "5 52 30\r",
+ "5 52 31\r",
+ "5 52 32\r",
+ "5 52 33\r",
+ "5 52 34\r",
+ "5 52 35\r",
+ "5 52 36\r",
+ "5 52 37\r",
+ "5 52 38\r",
+ "5 52 39\r",
+ "5 52 40\r",
+ "5 52 41\r",
+ "5 52 42\r",
+ "5 52 43\r",
+ "5 52 44\r",
+ "5 52 45\r",
+ "5 52 46\r",
+ "5 52 47\r",
+ "5 52 48\r",
+ "5 52 49\r",
+ "5 52 50\r",
+ "5 52 51\r",
+ "5 52 52\r",
+ "5 52 53\r",
+ "5 52 54\r",
+ "5 52 55\r",
+ "5 52 56\r",
+ "5 52 57\r",
+ "5 52 58\r",
+ "5 53 1\r",
+ "5 53 2\r",
+ "5 53 3\r",
+ "5 53 4\r",
+ "5 53 5\r",
+ "5 53 6\r",
+ "5 53 7\r",
+ "5 53 8\r",
+ "5 53 9\r",
+ "5 53 10\r",
+ "5 53 11\r",
+ "5 53 12\r",
+ "5 53 13\r",
+ "5 53 14\r",
+ "5 53 15\r",
+ "5 53 16\r",
+ "5 53 17\r",
+ "5 53 18\r",
+ "5 53 19\r",
+ "5 53 20\r",
+ "5 53 21\r",
+ "5 53 22\r",
+ "5 53 23\r",
+ "5 53 24\r",
+ "5 53 25\r",
+ "5 53 26\r",
+ "5 53 27\r",
+ "5 53 28\r",
+ "5 53 29\r",
+ "5 53 30\r",
+ "5 53 31\r",
+ "5 53 32\r",
+ "5 53 33\r",
+ "5 53 34\r",
+ "5 53 35\r",
+ "5 53 36\r",
+ "5 53 37\r",
+ "5 53 38\r",
+ "5 53 39\r",
+ "5 53 40\r",
+ "5 53 41\r",
+ "5 53 42\r",
+ "5 53 43\r",
+ "5 53 44\r",
+ "5 53 45\r",
+ "5 53 46\r",
+ "5 53 47\r",
+ "5 53 48\r",
+ "5 53 49\r",
+ "5 53 50\r",
+ "5 53 51\r",
+ "5 53 52\r",
+ "5 53 53\r",
+ "5 53 54\r",
+ "5 53 55\r",
+ "5 53 56\r",
+ "5 53 57\r",
+ "5 53 58\r",
+ "5 54 1\r",
+ "5 54 2\r",
+ "5 54 3\r",
+ "5 54 4\r",
+ "5 54 5\r",
+ "5 54 6\r",
+ "5 54 7\r",
+ "5 54 8\r",
+ "5 54 9\r",
+ "5 54 10\r",
+ "5 54 11\r",
+ "5 54 12\r",
+ "5 54 13\r",
+ "5 54 14\r",
+ "5 54 15\r",
+ "5 54 16\r",
+ "5 54 17\r",
+ "5 54 18\r",
+ "5 54 19\r",
+ "5 54 20\r",
+ "5 54 21\r",
+ "5 54 22\r",
+ "5 54 23\r",
+ "5 54 24\r",
+ "5 54 25\r",
+ "5 54 26\r",
+ "5 54 27\r",
+ "5 54 28\r",
+ "5 54 29\r",
+ "5 54 30\r",
+ "5 54 31\r",
+ "5 54 32\r",
+ "5 54 33\r",
+ "5 54 34\r",
+ "5 54 35\r",
+ "5 54 36\r",
+ "5 54 37\r",
+ "5 54 38\r",
+ "5 54 39\r",
+ "5 54 40\r",
+ "5 54 41\r",
+ "5 54 42\r",
+ "5 54 43\r",
+ "5 54 44\r",
+ "5 54 45\r",
+ "5 54 46\r",
+ "5 54 47\r",
+ "5 54 48\r",
+ "5 54 49\r",
+ "5 54 50\r",
+ "5 54 51\r",
+ "5 54 52\r",
+ "5 54 53\r",
+ "5 54 54\r",
+ "5 54 55\r",
+ "5 54 56\r",
+ "5 54 57\r",
+ "5 54 58\r",
+ "5 55 1\r",
+ "5 55 2\r",
+ "5 55 3\r",
+ "5 55 4\r",
+ "5 55 5\r",
+ "5 55 6\r",
+ "5 55 7\r",
+ "5 55 8\r",
+ "5 55 9\r",
+ "5 55 10\r",
+ "5 55 11\r",
+ "5 55 12\r",
+ "5 55 13\r",
+ "5 55 14\r",
+ "5 55 15\r",
+ "5 55 16\r",
+ "5 55 17\r",
+ "5 55 18\r",
+ "5 55 19\r",
+ "5 55 20\r",
+ "5 55 21\r",
+ "5 55 22\r",
+ "5 55 23\r",
+ "5 55 24\r",
+ "5 55 25\r",
+ "5 55 26\r",
+ "5 55 27\r",
+ "5 55 28\r",
+ "5 55 29\r",
+ "5 55 30\r",
+ "5 55 31\r",
+ "5 55 32\r",
+ "5 55 33\r",
+ "5 55 34\r",
+ "5 55 35\r",
+ "5 55 36\r",
+ "5 55 37\r",
+ "5 55 38\r",
+ "5 55 39\r",
+ "5 55 40\r",
+ "5 55 41\r",
+ "5 55 42\r",
+ "5 55 43\r",
+ "5 55 44\r",
+ "5 55 45\r",
+ "5 55 46\r",
+ "5 55 47\r",
+ "5 55 48\r",
+ "5 55 49\r",
+ "5 55 50\r",
+ "5 55 51\r",
+ "5 55 52\r",
+ "5 55 53\r",
+ "5 55 54\r",
+ "5 55 55\r",
+ "5 55 56\r",
+ "5 55 57\r",
+ "5 55 58\r",
+ "5 56 1\r",
+ "5 56 2\r",
+ "5 56 3\r",
+ "5 56 4\r",
+ "5 56 5\r",
+ "5 56 6\r",
+ "5 56 7\r",
+ "5 56 8\r",
+ "5 56 9\r",
+ "5 56 10\r",
+ "5 56 11\r",
+ "5 56 12\r",
+ "5 56 13\r",
+ "5 56 14\r",
+ "5 56 15\r",
+ "5 56 16\r",
+ "5 56 17\r",
+ "5 56 18\r",
+ "5 56 19\r",
+ "5 56 20\r",
+ "5 56 21\r",
+ "5 56 22\r",
+ "5 56 23\r",
+ "5 56 24\r",
+ "5 56 25\r",
+ "5 56 26\r",
+ "5 56 27\r",
+ "5 56 28\r",
+ "5 56 29\r",
+ "5 56 30\r",
+ "5 56 31\r",
+ "5 56 32\r",
+ "5 56 33\r",
+ "5 56 34\r",
+ "5 56 35\r",
+ "5 56 36\r",
+ "5 56 37\r",
+ "5 56 38\r",
+ "5 56 39\r",
+ "5 56 40\r",
+ "5 56 41\r",
+ "5 56 42\r",
+ "5 56 43\r",
+ "5 56 44\r",
+ "5 56 45\r",
+ "5 56 46\r",
+ "5 56 47\r",
+ "5 56 48\r",
+ "5 56 49\r",
+ "5 56 50\r",
+ "5 56 51\r",
+ "5 56 52\r",
+ "5 56 53\r",
+ "5 56 54\r",
+ "5 56 55\r",
+ "5 56 56\r",
+ "5 56 57\r",
+ "5 56 58\r",
+ "5 57 1\r",
+ "5 57 2\r",
+ "5 57 3\r",
+ "5 57 4\r",
+ "5 57 5\r",
+ "5 57 6\r",
+ "5 57 7\r",
+ "5 57 8\r",
+ "5 57 9\r",
+ "5 57 10\r",
+ "5 57 11\r",
+ "5 57 12\r",
+ "5 57 13\r",
+ "5 57 14\r",
+ "5 57 15\r",
+ "5 57 16\r",
+ "5 57 17\r",
+ "5 57 18\r",
+ "5 57 19\r",
+ "5 57 20\r",
+ "5 57 21\r",
+ "5 57 22\r",
+ "5 57 23\r",
+ "5 57 24\r",
+ "5 57 25\r",
+ "5 57 26\r",
+ "5 57 27\r",
+ "5 57 28\r",
+ "5 57 29\r",
+ "5 57 30\r",
+ "5 57 31\r",
+ "5 57 32\r",
+ "5 57 33\r",
+ "5 57 34\r",
+ "5 57 35\r",
+ "5 57 36\r",
+ "5 57 37\r",
+ "5 57 38\r",
+ "5 57 39\r",
+ "5 57 40\r",
+ "5 57 41\r",
+ "5 57 42\r",
+ "5 57 43\r",
+ "5 57 44\r",
+ "5 57 45\r",
+ "5 57 46\r",
+ "5 57 47\r",
+ "5 57 48\r",
+ "5 57 49\r",
+ "5 57 50\r",
+ "5 57 51\r",
+ "5 57 52\r",
+ "5 57 53\r",
+ "5 57 54\r",
+ "5 57 55\r",
+ "5 57 56\r",
+ "5 57 57\r",
+ "5 57 58\r",
+ "5 58 1\r",
+ "5 58 2\r",
+ "5 58 3\r",
+ "5 58 4\r",
+ "5 58 5\r",
+ "5 58 6\r",
+ "5 58 7\r",
+ "5 58 8\r",
+ "5 58 9\r",
+ "5 58 10\r",
+ "5 58 11\r",
+ "5 58 12\r",
+ "5 58 13\r",
+ "5 58 14\r",
+ "5 58 15\r",
+ "5 58 16\r",
+ "5 58 17\r",
+ "5 58 18\r",
+ "5 58 19\r",
+ "5 58 20\r",
+ "5 58 21\r",
+ "5 58 22\r",
+ "5 58 23\r",
+ "5 58 24\r",
+ "5 58 25\r",
+ "5 58 26\r",
+ "5 58 27\r",
+ "5 58 28\r",
+ "5 58 29\r",
+ "5 58 30\r",
+ "5 58 31\r",
+ "5 58 32\r",
+ "5 58 33\r",
+ "5 58 34\r",
+ "5 58 35\r",
+ "5 58 36\r",
+ "5 58 37\r",
+ "5 58 38\r",
+ "5 58 39\r",
+ "5 58 40\r",
+ "5 58 41\r",
+ "5 58 42\r",
+ "5 58 43\r",
+ "5 58 44\r",
+ "5 58 45\r",
+ "5 58 46\r",
+ "5 58 47\r",
+ "5 58 48\r",
+ "5 58 49\r",
+ "5 58 50\r",
+ "5 58 51\r",
+ "5 58 52\r",
+ "5 58 53\r",
+ "5 58 54\r",
+ "5 58 55\r",
+ "5 58 56\r",
+ "5 58 57\r",
+ "5 58 58\r",
+ "6 1 1\r",
+ "6 1 2\r",
+ "6 1 3\r",
+ "6 1 4\r",
+ "6 1 5\r",
+ "6 1 6\r",
+ "6 1 7\r",
+ "6 1 8\r",
+ "6 1 9\r",
+ "6 1 10\r",
+ "6 1 11\r",
+ "6 1 12\r",
+ "6 1 13\r",
+ "6 1 14\r",
+ "6 1 15\r",
+ "6 1 16\r",
+ "6 1 17\r",
+ "6 1 18\r",
+ "6 1 19\r",
+ "6 1 20\r",
+ "6 1 21\r",
+ "6 1 22\r",
+ "6 1 23\r",
+ "6 1 24\r",
+ "6 1 25\r",
+ "6 1 26\r",
+ "6 1 27\r",
+ "6 1 28\r",
+ "6 1 29\r",
+ "6 1 30\r",
+ "6 1 31\r",
+ "6 1 32\r",
+ "6 1 33\r",
+ "6 1 34\r",
+ "6 1 35\r",
+ "6 1 36\r",
+ "6 1 37\r",
+ "6 1 38\r",
+ "6 1 39\r",
+ "6 1 40\r",
+ "6 1 41\r",
+ "6 1 42\r",
+ "6 1 43\r",
+ "6 1 44\r",
+ "6 1 45\r",
+ "6 1 46\r",
+ "6 1 47\r",
+ "6 1 48\r",
+ "6 1 49\r",
+ "6 1 50\r",
+ "6 1 51\r",
+ "6 1 52\r",
+ "6 1 53\r",
+ "6 1 54\r",
+ "6 1 55\r",
+ "6 1 56\r",
+ "6 1 57\r",
+ "6 1 58\r",
+ "6 2 1\r",
+ "6 2 2\r",
+ "6 2 3\r",
+ "6 2 4\r",
+ "6 2 5\r",
+ "6 2 6\r",
+ "6 2 7\r",
+ "6 2 8\r",
+ "6 2 9\r",
+ "6 2 10\r",
+ "6 2 11\r",
+ "6 2 12\r",
+ "6 2 13\r",
+ "6 2 14\r",
+ "6 2 15\r",
+ "6 2 16\r",
+ "6 2 17\r",
+ "6 2 18\r",
+ "6 2 19\r",
+ "6 2 20\r",
+ "6 2 21\r",
+ "6 2 22\r",
+ "6 2 23\r",
+ "6 2 24\r",
+ "6 2 25\r",
+ "6 2 26\r",
+ "6 2 27\r",
+ "6 2 28\r",
+ "6 2 29\r",
+ "6 2 30\r",
+ "6 2 31\r",
+ "6 2 32\r",
+ "6 2 33\r",
+ "6 2 34\r",
+ "6 2 35\r",
+ "6 2 36\r",
+ "6 2 37\r",
+ "6 2 38\r",
+ "6 2 39\r",
+ "6 2 40\r",
+ "6 2 41\r",
+ "6 2 42\r",
+ "6 2 43\r",
+ "6 2 44\r",
+ "6 2 45\r",
+ "6 2 46\r",
+ "6 2 47\r",
+ "6 2 48\r",
+ "6 2 49\r",
+ "6 2 50\r",
+ "6 2 51\r",
+ "6 2 52\r",
+ "6 2 53\r",
+ "6 2 54\r",
+ "6 2 55\r",
+ "6 2 56\r",
+ "6 2 57\r",
+ "6 2 58\r",
+ "6 3 1\r",
+ "6 3 2\r",
+ "6 3 3\r",
+ "6 3 4\r",
+ "6 3 5\r",
+ "6 3 6\r",
+ "6 3 7\r",
+ "6 3 8\r",
+ "6 3 9\r",
+ "6 3 10\r",
+ "6 3 11\r",
+ "6 3 12\r",
+ "6 3 13\r",
+ "6 3 14\r",
+ "6 3 15\r",
+ "6 3 16\r",
+ "6 3 17\r",
+ "6 3 18\r",
+ "6 3 19\r",
+ "6 3 20\r",
+ "6 3 21\r",
+ "6 3 22\r",
+ "6 3 23\r",
+ "6 3 24\r",
+ "6 3 25\r",
+ "6 3 26\r",
+ "6 3 27\r",
+ "6 3 28\r",
+ "6 3 29\r",
+ "6 3 30\r",
+ "6 3 31\r",
+ "6 3 32\r",
+ "6 3 33\r",
+ "6 3 34\r",
+ "6 3 35\r",
+ "6 3 36\r",
+ "6 3 37\r",
+ "6 3 38\r",
+ "6 3 39\r",
+ "6 3 40\r",
+ "6 3 41\r",
+ "6 3 42\r",
+ "6 3 43\r",
+ "6 3 44\r",
+ "6 3 45\r",
+ "6 3 46\r",
+ "6 3 47\r",
+ "6 3 48\r",
+ "6 3 49\r",
+ "6 3 50\r",
+ "6 3 51\r",
+ "6 3 52\r",
+ "6 3 53\r",
+ "6 3 54\r",
+ "6 3 55\r",
+ "6 3 56\r",
+ "6 3 57\r",
+ "6 3 58\r",
+ "6 4 1\r",
+ "6 4 2\r",
+ "6 4 3\r",
+ "6 4 4\r",
+ "6 4 5\r",
+ "6 4 6\r",
+ "6 4 7\r",
+ "6 4 8\r",
+ "6 4 9\r",
+ "6 4 10\r",
+ "6 4 11\r",
+ "6 4 12\r",
+ "6 4 13\r",
+ "6 4 14\r",
+ "6 4 15\r",
+ "6 4 16\r",
+ "6 4 17\r",
+ "6 4 18\r",
+ "6 4 19\r",
+ "6 4 20\r",
+ "6 4 21\r",
+ "6 4 22\r",
+ "6 4 23\r",
+ "6 4 24\r",
+ "6 4 25\r",
+ "6 4 26\r",
+ "6 4 27\r",
+ "6 4 28\r",
+ "6 4 29\r",
+ "6 4 30\r",
+ "6 4 31\r",
+ "6 4 32\r",
+ "6 4 33\r",
+ "6 4 34\r",
+ "6 4 35\r",
+ "6 4 36\r",
+ "6 4 37\r",
+ "6 4 38\r",
+ "6 4 39\r",
+ "6 4 40\r",
+ "6 4 41\r",
+ "6 4 42\r",
+ "6 4 43\r",
+ "6 4 44\r",
+ "6 4 45\r",
+ "6 4 46\r",
+ "6 4 47\r",
+ "6 4 48\r",
+ "6 4 49\r",
+ "6 4 50\r",
+ "6 4 51\r",
+ "6 4 52\r",
+ "6 4 53\r",
+ "6 4 54\r",
+ "6 4 55\r",
+ "6 4 56\r",
+ "6 4 57\r",
+ "6 4 58\r",
+ "6 5 1\r",
+ "6 5 2\r",
+ "6 5 3\r",
+ "6 5 4\r",
+ "6 5 5\r",
+ "6 5 6\r",
+ "6 5 7\r",
+ "6 5 8\r",
+ "6 5 9\r",
+ "6 5 10\r",
+ "6 5 11\r",
+ "6 5 12\r",
+ "6 5 13\r",
+ "6 5 14\r",
+ "6 5 15\r",
+ "6 5 16\r",
+ "6 5 17\r",
+ "6 5 18\r",
+ "6 5 19\r",
+ "6 5 20\r",
+ "6 5 21\r",
+ "6 5 22\r",
+ "6 5 23\r",
+ "6 5 24\r",
+ "6 5 25\r",
+ "6 5 26\r",
+ "6 5 27\r",
+ "6 5 28\r",
+ "6 5 29\r",
+ "6 5 30\r",
+ "6 5 31\r",
+ "6 5 32\r",
+ "6 5 33\r",
+ "6 5 34\r",
+ "6 5 35\r",
+ "6 5 36\r",
+ "6 5 37\r",
+ "6 5 38\r",
+ "6 5 39\r",
+ "6 5 40\r",
+ "6 5 41\r",
+ "6 5 42\r",
+ "6 5 43\r",
+ "6 5 44\r",
+ "6 5 45\r",
+ "6 5 46\r",
+ "6 5 47\r",
+ "6 5 48\r",
+ "6 5 49\r",
+ "6 5 50\r",
+ "6 5 51\r",
+ "6 5 52\r",
+ "6 5 53\r",
+ "6 5 54\r",
+ "6 5 55\r",
+ "6 5 56\r",
+ "6 5 57\r",
+ "6 5 58\r",
+ "6 6 1\r",
+ "6 6 2\r",
+ "6 6 3\r",
+ "6 6 4\r",
+ "6 6 5\r",
+ "6 6 6\r",
+ "6 6 7\r",
+ "6 6 8\r",
+ "6 6 9\r",
+ "6 6 10\r",
+ "6 6 11\r",
+ "6 6 12\r",
+ "6 6 13\r",
+ "6 6 14\r",
+ "6 6 15\r",
+ "6 6 16\r",
+ "6 6 17\r",
+ "6 6 18\r",
+ "6 6 19\r",
+ "6 6 20\r",
+ "6 6 21\r",
+ "6 6 22\r",
+ "6 6 23\r",
+ "6 6 24\r",
+ "6 6 25\r",
+ "6 6 26\r",
+ "6 6 27\r",
+ "6 6 28\r",
+ "6 6 29\r",
+ "6 6 30\r",
+ "6 6 31\r",
+ "6 6 32\r",
+ "6 6 33\r",
+ "6 6 34\r",
+ "6 6 35\r",
+ "6 6 36\r",
+ "6 6 37\r",
+ "6 6 38\r",
+ "6 6 39\r",
+ "6 6 40\r",
+ "6 6 41\r",
+ "6 6 42\r",
+ "6 6 43\r",
+ "6 6 44\r",
+ "6 6 45\r",
+ "6 6 46\r",
+ "6 6 47\r",
+ "6 6 48\r",
+ "6 6 49\r",
+ "6 6 50\r",
+ "6 6 51\r",
+ "6 6 52\r",
+ "6 6 53\r",
+ "6 6 54\r",
+ "6 6 55\r",
+ "6 6 56\r",
+ "6 6 57\r",
+ "6 6 58\r",
+ "6 7 1\r",
+ "6 7 2\r",
+ "6 7 3\r",
+ "6 7 4\r",
+ "6 7 5\r",
+ "6 7 6\r",
+ "6 7 7\r",
+ "6 7 8\r",
+ "6 7 9\r",
+ "6 7 10\r",
+ "6 7 11\r",
+ "6 7 12\r",
+ "6 7 13\r",
+ "6 7 14\r",
+ "6 7 15\r",
+ "6 7 16\r",
+ "6 7 17\r",
+ "6 7 18\r",
+ "6 7 19\r",
+ "6 7 20\r",
+ "6 7 21\r",
+ "6 7 22\r",
+ "6 7 23\r",
+ "6 7 24\r",
+ "6 7 25\r",
+ "6 7 26\r",
+ "6 7 27\r",
+ "6 7 28\r",
+ "6 7 29\r",
+ "6 7 30\r",
+ "6 7 31\r",
+ "6 7 32\r",
+ "6 7 33\r",
+ "6 7 34\r",
+ "6 7 35\r",
+ "6 7 36\r",
+ "6 7 37\r",
+ "6 7 38\r",
+ "6 7 39\r",
+ "6 7 40\r",
+ "6 7 41\r",
+ "6 7 42\r",
+ "6 7 43\r",
+ "6 7 44\r",
+ "6 7 45\r",
+ "6 7 46\r",
+ "6 7 47\r",
+ "6 7 48\r",
+ "6 7 49\r",
+ "6 7 50\r",
+ "6 7 51\r",
+ "6 7 52\r",
+ "6 7 53\r",
+ "6 7 54\r",
+ "6 7 55\r",
+ "6 7 56\r",
+ "6 7 57\r",
+ "6 7 58\r",
+ "6 8 1\r",
+ "6 8 2\r",
+ "6 8 3\r",
+ "6 8 4\r",
+ "6 8 5\r",
+ "6 8 6\r",
+ "6 8 7\r",
+ "6 8 8\r",
+ "6 8 9\r",
+ "6 8 10\r",
+ "6 8 11\r",
+ "6 8 12\r",
+ "6 8 13\r",
+ "6 8 14\r",
+ "6 8 15\r",
+ "6 8 16\r",
+ "6 8 17\r",
+ "6 8 18\r",
+ "6 8 19\r",
+ "6 8 20\r",
+ "6 8 21\r",
+ "6 8 22\r",
+ "6 8 23\r",
+ "6 8 24\r",
+ "6 8 25\r",
+ "6 8 26\r",
+ "6 8 27\r",
+ "6 8 28\r",
+ "6 8 29\r",
+ "6 8 30\r",
+ "6 8 31\r",
+ "6 8 32\r",
+ "6 8 33\r",
+ "6 8 34\r",
+ "6 8 35\r",
+ "6 8 36\r",
+ "6 8 37\r",
+ "6 8 38\r",
+ "6 8 39\r",
+ "6 8 40\r",
+ "6 8 41\r",
+ "6 8 42\r",
+ "6 8 43\r",
+ "6 8 44\r",
+ "6 8 45\r",
+ "6 8 46\r",
+ "6 8 47\r",
+ "6 8 48\r",
+ "6 8 49\r",
+ "6 8 50\r",
+ "6 8 51\r",
+ "6 8 52\r",
+ "6 8 53\r",
+ "6 8 54\r",
+ "6 8 55\r",
+ "6 8 56\r",
+ "6 8 57\r",
+ "6 8 58\r",
+ "6 9 1\r",
+ "6 9 2\r",
+ "6 9 3\r",
+ "6 9 4\r",
+ "6 9 5\r",
+ "6 9 6\r",
+ "6 9 7\r",
+ "6 9 8\r",
+ "6 9 9\r",
+ "6 9 10\r",
+ "6 9 11\r",
+ "6 9 12\r",
+ "6 9 13\r",
+ "6 9 14\r",
+ "6 9 15\r",
+ "6 9 16\r",
+ "6 9 17\r",
+ "6 9 18\r",
+ "6 9 19\r",
+ "6 9 20\r",
+ "6 9 21\r",
+ "6 9 22\r",
+ "6 9 23\r",
+ "6 9 24\r",
+ "6 9 25\r",
+ "6 9 26\r",
+ "6 9 27\r",
+ "6 9 28\r",
+ "6 9 29\r",
+ "6 9 30\r",
+ "6 9 31\r",
+ "6 9 32\r",
+ "6 9 33\r",
+ "6 9 34\r",
+ "6 9 35\r",
+ "6 9 36\r",
+ "6 9 37\r",
+ "6 9 38\r",
+ "6 9 39\r",
+ "6 9 40\r",
+ "6 9 41\r",
+ "6 9 42\r",
+ "6 9 43\r",
+ "6 9 44\r",
+ "6 9 45\r",
+ "6 9 46\r",
+ "6 9 47\r",
+ "6 9 48\r",
+ "6 9 49\r",
+ "6 9 50\r",
+ "6 9 51\r",
+ "6 9 52\r",
+ "6 9 53\r",
+ "6 9 54\r",
+ "6 9 55\r",
+ "6 9 56\r",
+ "6 9 57\r",
+ "6 9 58\r",
+ "6 10 1\r",
+ "6 10 2\r",
+ "6 10 3\r",
+ "6 10 4\r",
+ "6 10 5\r",
+ "6 10 6\r",
+ "6 10 7\r",
+ "6 10 8\r",
+ "6 10 9\r",
+ "6 10 10\r",
+ "6 10 11\r",
+ "6 10 12\r",
+ "6 10 13\r",
+ "6 10 14\r",
+ "6 10 15\r",
+ "6 10 16\r",
+ "6 10 17\r",
+ "6 10 18\r",
+ "6 10 19\r",
+ "6 10 20\r",
+ "6 10 21\r",
+ "6 10 22\r",
+ "6 10 23\r",
+ "6 10 24\r",
+ "6 10 25\r",
+ "6 10 26\r",
+ "6 10 27\r",
+ "6 10 28\r",
+ "6 10 29\r",
+ "6 10 30\r",
+ "6 10 31\r",
+ "6 10 32\r",
+ "6 10 33\r",
+ "6 10 34\r",
+ "6 10 35\r",
+ "6 10 36\r",
+ "6 10 37\r",
+ "6 10 38\r",
+ "6 10 39\r",
+ "6 10 40\r",
+ "6 10 41\r",
+ "6 10 42\r",
+ "6 10 43\r",
+ "6 10 44\r",
+ "6 10 45\r",
+ "6 10 46\r",
+ "6 10 47\r",
+ "6 10 48\r",
+ "6 10 49\r",
+ "6 10 50\r",
+ "6 10 51\r",
+ "6 10 52\r",
+ "6 10 53\r",
+ "6 10 54\r",
+ "6 10 55\r",
+ "6 10 56\r",
+ "6 10 57\r",
+ "6 10 58\r",
+ "6 11 1\r",
+ "6 11 2\r",
+ "6 11 3\r",
+ "6 11 4\r",
+ "6 11 5\r",
+ "6 11 6\r",
+ "6 11 7\r",
+ "6 11 8\r",
+ "6 11 9\r",
+ "6 11 10\r",
+ "6 11 11\r",
+ "6 11 12\r",
+ "6 11 13\r",
+ "6 11 14\r",
+ "6 11 15\r",
+ "6 11 16\r",
+ "6 11 17\r",
+ "6 11 18\r",
+ "6 11 19\r",
+ "6 11 20\r",
+ "6 11 21\r",
+ "6 11 22\r",
+ "6 11 23\r",
+ "6 11 24\r",
+ "6 11 25\r",
+ "6 11 26\r",
+ "6 11 27\r",
+ "6 11 28\r",
+ "6 11 29\r",
+ "6 11 30\r",
+ "6 11 31\r",
+ "6 11 32\r",
+ "6 11 33\r",
+ "6 11 34\r",
+ "6 11 35\r",
+ "6 11 36\r",
+ "6 11 37\r",
+ "6 11 38\r",
+ "6 11 39\r",
+ "6 11 40\r",
+ "6 11 41\r",
+ "6 11 42\r",
+ "6 11 43\r",
+ "6 11 44\r",
+ "6 11 45\r",
+ "6 11 46\r",
+ "6 11 47\r",
+ "6 11 48\r",
+ "6 11 49\r",
+ "6 11 50\r",
+ "6 11 51\r",
+ "6 11 52\r",
+ "6 11 53\r",
+ "6 11 54\r",
+ "6 11 55\r",
+ "6 11 56\r",
+ "6 11 57\r",
+ "6 11 58\r",
+ "6 12 1\r",
+ "6 12 2\r",
+ "6 12 3\r",
+ "6 12 4\r",
+ "6 12 5\r",
+ "6 12 6\r",
+ "6 12 7\r",
+ "6 12 8\r",
+ "6 12 9\r",
+ "6 12 10\r",
+ "6 12 11\r",
+ "6 12 12\r",
+ "6 12 13\r",
+ "6 12 14\r",
+ "6 12 15\r",
+ "6 12 16\r",
+ "6 12 17\r",
+ "6 12 18\r",
+ "6 12 19\r",
+ "6 12 20\r",
+ "6 12 21\r",
+ "6 12 22\r",
+ "6 12 23\r",
+ "6 12 24\r",
+ "6 12 25\r",
+ "6 12 26\r",
+ "6 12 27\r",
+ "6 12 28\r",
+ "6 12 29\r",
+ "6 12 30\r",
+ "6 12 31\r",
+ "6 12 32\r",
+ "6 12 33\r",
+ "6 12 34\r",
+ "6 12 35\r",
+ "6 12 36\r",
+ "6 12 37\r",
+ "6 12 38\r",
+ "6 12 39\r",
+ "6 12 40\r",
+ "6 12 41\r",
+ "6 12 42\r",
+ "6 12 43\r",
+ "6 12 44\r",
+ "6 12 45\r",
+ "6 12 46\r",
+ "6 12 47\r",
+ "6 12 48\r",
+ "6 12 49\r",
+ "6 12 50\r",
+ "6 12 51\r",
+ "6 12 52\r",
+ "6 12 53\r",
+ "6 12 54\r",
+ "6 12 55\r",
+ "6 12 56\r",
+ "6 12 57\r",
+ "6 12 58\r",
+ "6 13 1\r",
+ "6 13 2\r",
+ "6 13 3\r",
+ "6 13 4\r",
+ "6 13 5\r",
+ "6 13 6\r",
+ "6 13 7\r",
+ "6 13 8\r",
+ "6 13 9\r",
+ "6 13 10\r",
+ "6 13 11\r",
+ "6 13 12\r",
+ "6 13 13\r",
+ "6 13 14\r",
+ "6 13 15\r",
+ "6 13 16\r",
+ "6 13 17\r",
+ "6 13 18\r",
+ "6 13 19\r",
+ "6 13 20\r",
+ "6 13 21\r",
+ "6 13 22\r",
+ "6 13 23\r",
+ "6 13 24\r",
+ "6 13 25\r",
+ "6 13 26\r",
+ "6 13 27\r",
+ "6 13 28\r",
+ "6 13 29\r",
+ "6 13 30\r",
+ "6 13 31\r",
+ "6 13 32\r",
+ "6 13 33\r",
+ "6 13 34\r",
+ "6 13 35\r",
+ "6 13 36\r",
+ "6 13 37\r",
+ "6 13 38\r",
+ "6 13 39\r",
+ "6 13 40\r",
+ "6 13 41\r",
+ "6 13 42\r",
+ "6 13 43\r",
+ "6 13 44\r",
+ "6 13 45\r",
+ "6 13 46\r",
+ "6 13 47\r",
+ "6 13 48\r",
+ "6 13 49\r",
+ "6 13 50\r",
+ "6 13 51\r",
+ "6 13 52\r",
+ "6 13 53\r",
+ "6 13 54\r",
+ "6 13 55\r",
+ "6 13 56\r",
+ "6 13 57\r",
+ "6 13 58\r",
+ "6 14 1\r",
+ "6 14 2\r",
+ "6 14 3\r",
+ "6 14 4\r",
+ "6 14 5\r",
+ "6 14 6\r",
+ "6 14 7\r",
+ "6 14 8\r",
+ "6 14 9\r",
+ "6 14 10\r",
+ "6 14 11\r",
+ "6 14 12\r",
+ "6 14 13\r",
+ "6 14 14\r",
+ "6 14 15\r",
+ "6 14 16\r",
+ "6 14 17\r",
+ "6 14 18\r",
+ "6 14 19\r",
+ "6 14 20\r",
+ "6 14 21\r",
+ "6 14 22\r",
+ "6 14 23\r",
+ "6 14 24\r",
+ "6 14 25\r",
+ "6 14 26\r",
+ "6 14 27\r",
+ "6 14 28\r",
+ "6 14 29\r",
+ "6 14 30\r",
+ "6 14 31\r",
+ "6 14 32\r",
+ "6 14 33\r",
+ "6 14 34\r",
+ "6 14 35\r",
+ "6 14 36\r",
+ "6 14 37\r",
+ "6 14 38\r",
+ "6 14 39\r",
+ "6 14 40\r",
+ "6 14 41\r",
+ "6 14 42\r",
+ "6 14 43\r",
+ "6 14 44\r",
+ "6 14 45\r",
+ "6 14 46\r",
+ "6 14 47\r",
+ "6 14 48\r",
+ "6 14 49\r",
+ "6 14 50\r",
+ "6 14 51\r",
+ "6 14 52\r",
+ "6 14 53\r",
+ "6 14 54\r",
+ "6 14 55\r",
+ "6 14 56\r",
+ "6 14 57\r",
+ "6 14 58\r",
+ "6 15 1\r",
+ "6 15 2\r",
+ "6 15 3\r",
+ "6 15 4\r",
+ "6 15 5\r",
+ "6 15 6\r",
+ "6 15 7\r",
+ "6 15 8\r",
+ "6 15 9\r",
+ "6 15 10\r",
+ "6 15 11\r",
+ "6 15 12\r",
+ "6 15 13\r",
+ "6 15 14\r",
+ "6 15 15\r",
+ "6 15 16\r",
+ "6 15 17\r",
+ "6 15 18\r",
+ "6 15 19\r",
+ "6 15 20\r",
+ "6 15 21\r",
+ "6 15 22\r",
+ "6 15 23\r",
+ "6 15 24\r",
+ "6 15 25\r",
+ "6 15 26\r",
+ "6 15 27\r",
+ "6 15 28\r",
+ "6 15 29\r",
+ "6 15 30\r",
+ "6 15 31\r",
+ "6 15 32\r",
+ "6 15 33\r",
+ "6 15 34\r",
+ "6 15 35\r",
+ "6 15 36\r",
+ "6 15 37\r",
+ "6 15 38\r",
+ "6 15 39\r",
+ "6 15 40\r",
+ "6 15 41\r",
+ "6 15 42\r",
+ "6 15 43\r",
+ "6 15 44\r",
+ "6 15 45\r",
+ "6 15 46\r",
+ "6 15 47\r",
+ "6 15 48\r",
+ "6 15 49\r",
+ "6 15 50\r",
+ "6 15 51\r",
+ "6 15 52\r",
+ "6 15 53\r",
+ "6 15 54\r",
+ "6 15 55\r",
+ "6 15 56\r",
+ "6 15 57\r",
+ "6 15 58\r",
+ "6 16 1\r",
+ "6 16 2\r",
+ "6 16 3\r",
+ "6 16 4\r",
+ "6 16 5\r",
+ "6 16 6\r",
+ "6 16 7\r",
+ "6 16 8\r",
+ "6 16 9\r",
+ "6 16 10\r",
+ "6 16 11\r",
+ "6 16 12\r",
+ "6 16 13\r",
+ "6 16 14\r",
+ "6 16 15\r",
+ "6 16 16\r",
+ "6 16 17\r",
+ "6 16 18\r",
+ "6 16 19\r",
+ "6 16 20\r",
+ "6 16 21\r",
+ "6 16 22\r",
+ "6 16 23\r",
+ "6 16 24\r",
+ "6 16 25\r",
+ "6 16 26\r",
+ "6 16 27\r",
+ "6 16 28\r",
+ "6 16 29\r",
+ "6 16 30\r",
+ "6 16 31\r",
+ "6 16 32\r",
+ "6 16 33\r",
+ "6 16 34\r",
+ "6 16 35\r",
+ "6 16 36\r",
+ "6 16 37\r",
+ "6 16 38\r",
+ "6 16 39\r",
+ "6 16 40\r",
+ "6 16 41\r",
+ "6 16 42\r",
+ "6 16 43\r",
+ "6 16 44\r",
+ "6 16 45\r",
+ "6 16 46\r",
+ "6 16 47\r",
+ "6 16 48\r",
+ "6 16 49\r",
+ "6 16 50\r",
+ "6 16 51\r",
+ "6 16 52\r",
+ "6 16 53\r",
+ "6 16 54\r",
+ "6 16 55\r",
+ "6 16 56\r",
+ "6 16 57\r",
+ "6 16 58\r",
+ "6 17 1\r",
+ "6 17 2\r",
+ "6 17 3\r",
+ "6 17 4\r",
+ "6 17 5\r",
+ "6 17 6\r",
+ "6 17 7\r",
+ "6 17 8\r",
+ "6 17 9\r",
+ "6 17 10\r",
+ "6 17 11\r",
+ "6 17 12\r",
+ "6 17 13\r",
+ "6 17 14\r",
+ "6 17 15\r",
+ "6 17 16\r",
+ "6 17 17\r",
+ "6 17 18\r",
+ "6 17 19\r",
+ "6 17 20\r",
+ "6 17 21\r",
+ "6 17 22\r",
+ "6 17 23\r",
+ "6 17 24\r",
+ "6 17 25\r",
+ "6 17 26\r",
+ "6 17 27\r",
+ "6 17 28\r",
+ "6 17 29\r",
+ "6 17 30\r",
+ "6 17 31\r",
+ "6 17 32\r",
+ "6 17 33\r",
+ "6 17 34\r",
+ "6 17 35\r",
+ "6 17 36\r",
+ "6 17 37\r",
+ "6 17 38\r",
+ "6 17 39\r",
+ "6 17 40\r",
+ "6 17 41\r",
+ "6 17 42\r",
+ "6 17 43\r",
+ "6 17 44\r",
+ "6 17 45\r",
+ "6 17 46\r",
+ "6 17 47\r",
+ "6 17 48\r",
+ "6 17 49\r",
+ "6 17 50\r",
+ "6 17 51\r",
+ "6 17 52\r",
+ "6 17 53\r",
+ "6 17 54\r",
+ "6 17 55\r",
+ "6 17 56\r",
+ "6 17 57\r",
+ "6 17 58\r",
+ "6 18 1\r",
+ "6 18 2\r",
+ "6 18 3\r",
+ "6 18 4\r",
+ "6 18 5\r",
+ "6 18 6\r",
+ "6 18 7\r",
+ "6 18 8\r",
+ "6 18 9\r",
+ "6 18 10\r",
+ "6 18 11\r",
+ "6 18 12\r",
+ "6 18 13\r",
+ "6 18 14\r",
+ "6 18 15\r",
+ "6 18 16\r",
+ "6 18 17\r",
+ "6 18 18\r",
+ "6 18 19\r",
+ "6 18 20\r",
+ "6 18 21\r",
+ "6 18 22\r",
+ "6 18 23\r",
+ "6 18 24\r",
+ "6 18 25\r",
+ "6 18 26\r",
+ "6 18 27\r",
+ "6 18 28\r",
+ "6 18 29\r",
+ "6 18 30\r",
+ "6 18 31\r",
+ "6 18 32\r",
+ "6 18 33\r",
+ "6 18 34\r",
+ "6 18 35\r",
+ "6 18 36\r",
+ "6 18 37\r",
+ "6 18 38\r",
+ "6 18 39\r",
+ "6 18 40\r",
+ "6 18 41\r",
+ "6 18 42\r",
+ "6 18 43\r",
+ "6 18 44\r",
+ "6 18 45\r",
+ "6 18 46\r",
+ "6 18 47\r",
+ "6 18 48\r",
+ "6 18 49\r",
+ "6 18 50\r",
+ "6 18 51\r",
+ "6 18 52\r",
+ "6 18 53\r",
+ "6 18 54\r",
+ "6 18 55\r",
+ "6 18 56\r",
+ "6 18 57\r",
+ "6 18 58\r",
+ "6 19 1\r",
+ "6 19 2\r",
+ "6 19 3\r",
+ "6 19 4\r",
+ "6 19 5\r",
+ "6 19 6\r",
+ "6 19 7\r",
+ "6 19 8\r",
+ "6 19 9\r",
+ "6 19 10\r",
+ "6 19 11\r",
+ "6 19 12\r",
+ "6 19 13\r",
+ "6 19 14\r",
+ "6 19 15\r",
+ "6 19 16\r",
+ "6 19 17\r",
+ "6 19 18\r",
+ "6 19 19\r",
+ "6 19 20\r",
+ "6 19 21\r",
+ "6 19 22\r",
+ "6 19 23\r",
+ "6 19 24\r",
+ "6 19 25\r",
+ "6 19 26\r",
+ "6 19 27\r",
+ "6 19 28\r",
+ "6 19 29\r",
+ "6 19 30\r",
+ "6 19 31\r",
+ "6 19 32\r",
+ "6 19 33\r",
+ "6 19 34\r",
+ "6 19 35\r",
+ "6 19 36\r",
+ "6 19 37\r",
+ "6 19 38\r",
+ "6 19 39\r",
+ "6 19 40\r",
+ "6 19 41\r",
+ "6 19 42\r",
+ "6 19 43\r",
+ "6 19 44\r",
+ "6 19 45\r",
+ "6 19 46\r",
+ "6 19 47\r",
+ "6 19 48\r",
+ "6 19 49\r",
+ "6 19 50\r",
+ "6 19 51\r",
+ "6 19 52\r",
+ "6 19 53\r",
+ "6 19 54\r",
+ "6 19 55\r",
+ "6 19 56\r",
+ "6 19 57\r",
+ "6 19 58\r",
+ "6 20 1\r",
+ "6 20 2\r",
+ "6 20 3\r",
+ "6 20 4\r",
+ "6 20 5\r",
+ "6 20 6\r",
+ "6 20 7\r",
+ "6 20 8\r",
+ "6 20 9\r",
+ "6 20 10\r",
+ "6 20 11\r",
+ "6 20 12\r",
+ "6 20 13\r",
+ "6 20 14\r",
+ "6 20 15\r",
+ "6 20 16\r",
+ "6 20 17\r",
+ "6 20 18\r",
+ "6 20 19\r",
+ "6 20 20\r",
+ "6 20 21\r",
+ "6 20 22\r",
+ "6 20 23\r",
+ "6 20 24\r",
+ "6 20 25\r",
+ "6 20 26\r",
+ "6 20 27\r",
+ "6 20 28\r",
+ "6 20 29\r",
+ "6 20 30\r",
+ "6 20 31\r",
+ "6 20 32\r",
+ "6 20 33\r",
+ "6 20 34\r",
+ "6 20 35\r",
+ "6 20 36\r",
+ "6 20 37\r",
+ "6 20 38\r",
+ "6 20 39\r",
+ "6 20 40\r",
+ "6 20 41\r",
+ "6 20 42\r",
+ "6 20 43\r",
+ "6 20 44\r",
+ "6 20 45\r",
+ "6 20 46\r",
+ "6 20 47\r",
+ "6 20 48\r",
+ "6 20 49\r",
+ "6 20 50\r",
+ "6 20 51\r",
+ "6 20 52\r",
+ "6 20 53\r",
+ "6 20 54\r",
+ "6 20 55\r",
+ "6 20 56\r",
+ "6 20 57\r",
+ "6 20 58\r",
+ "6 21 1\r",
+ "6 21 2\r",
+ "6 21 3\r",
+ "6 21 4\r",
+ "6 21 5\r",
+ "6 21 6\r",
+ "6 21 7\r",
+ "6 21 8\r",
+ "6 21 9\r",
+ "6 21 10\r",
+ "6 21 11\r",
+ "6 21 12\r",
+ "6 21 13\r",
+ "6 21 14\r",
+ "6 21 15\r",
+ "6 21 16\r",
+ "6 21 17\r",
+ "6 21 18\r",
+ "6 21 19\r",
+ "6 21 20\r",
+ "6 21 21\r",
+ "6 21 22\r",
+ "6 21 23\r",
+ "6 21 24\r",
+ "6 21 25\r",
+ "6 21 26\r",
+ "6 21 27\r",
+ "6 21 28\r",
+ "6 21 29\r",
+ "6 21 30\r",
+ "6 21 31\r",
+ "6 21 32\r",
+ "6 21 33\r",
+ "6 21 34\r",
+ "6 21 35\r",
+ "6 21 36\r",
+ "6 21 37\r",
+ "6 21 38\r",
+ "6 21 39\r",
+ "6 21 40\r",
+ "6 21 41\r",
+ "6 21 42\r",
+ "6 21 43\r",
+ "6 21 44\r",
+ "6 21 45\r",
+ "6 21 46\r",
+ "6 21 47\r",
+ "6 21 48\r",
+ "6 21 49\r",
+ "6 21 50\r",
+ "6 21 51\r",
+ "6 21 52\r",
+ "6 21 53\r",
+ "6 21 54\r",
+ "6 21 55\r",
+ "6 21 56\r",
+ "6 21 57\r",
+ "6 21 58\r",
+ "6 22 1\r",
+ "6 22 2\r",
+ "6 22 3\r",
+ "6 22 4\r",
+ "6 22 5\r",
+ "6 22 6\r",
+ "6 22 7\r",
+ "6 22 8\r",
+ "6 22 9\r",
+ "6 22 10\r",
+ "6 22 11\r",
+ "6 22 12\r",
+ "6 22 13\r",
+ "6 22 14\r",
+ "6 22 15\r",
+ "6 22 16\r",
+ "6 22 17\r",
+ "6 22 18\r",
+ "6 22 19\r",
+ "6 22 20\r",
+ "6 22 21\r",
+ "6 22 22\r",
+ "6 22 23\r",
+ "6 22 24\r",
+ "6 22 25\r",
+ "6 22 26\r",
+ "6 22 27\r",
+ "6 22 28\r",
+ "6 22 29\r",
+ "6 22 30\r",
+ "6 22 31\r",
+ "6 22 32\r",
+ "6 22 33\r",
+ "6 22 34\r",
+ "6 22 35\r",
+ "6 22 36\r",
+ "6 22 37\r",
+ "6 22 38\r",
+ "6 22 39\r",
+ "6 22 40\r",
+ "6 22 41\r",
+ "6 22 42\r",
+ "6 22 43\r",
+ "6 22 44\r",
+ "6 22 45\r",
+ "6 22 46\r",
+ "6 22 47\r",
+ "6 22 48\r",
+ "6 22 49\r",
+ "6 22 50\r",
+ "6 22 51\r",
+ "6 22 52\r",
+ "6 22 53\r",
+ "6 22 54\r",
+ "6 22 55\r",
+ "6 22 56\r",
+ "6 22 57\r",
+ "6 22 58\r",
+ "6 23 1\r",
+ "6 23 2\r",
+ "6 23 3\r",
+ "6 23 4\r",
+ "6 23 5\r",
+ "6 23 6\r",
+ "6 23 7\r",
+ "6 23 8\r",
+ "6 23 9\r",
+ "6 23 10\r",
+ "6 23 11\r",
+ "6 23 12\r",
+ "6 23 13\r",
+ "6 23 14\r",
+ "6 23 15\r",
+ "6 23 16\r",
+ "6 23 17\r",
+ "6 23 18\r",
+ "6 23 19\r",
+ "6 23 20\r",
+ "6 23 21\r",
+ "6 23 22\r",
+ "6 23 23\r",
+ "6 23 24\r",
+ "6 23 25\r",
+ "6 23 26\r",
+ "6 23 27\r",
+ "6 23 28\r",
+ "6 23 29\r",
+ "6 23 30\r",
+ "6 23 31\r",
+ "6 23 32\r",
+ "6 23 33\r",
+ "6 23 34\r",
+ "6 23 35\r",
+ "6 23 36\r",
+ "6 23 37\r",
+ "6 23 38\r",
+ "6 23 39\r",
+ "6 23 40\r",
+ "6 23 41\r",
+ "6 23 42\r",
+ "6 23 43\r",
+ "6 23 44\r",
+ "6 23 45\r",
+ "6 23 46\r",
+ "6 23 47\r",
+ "6 23 48\r",
+ "6 23 49\r",
+ "6 23 50\r",
+ "6 23 51\r",
+ "6 23 52\r",
+ "6 23 53\r",
+ "6 23 54\r",
+ "6 23 55\r",
+ "6 23 56\r",
+ "6 23 57\r",
+ "6 23 58\r",
+ "6 24 1\r",
+ "6 24 2\r",
+ "6 24 3\r",
+ "6 24 4\r",
+ "6 24 5\r",
+ "6 24 6\r",
+ "6 24 7\r",
+ "6 24 8\r",
+ "6 24 9\r",
+ "6 24 10\r",
+ "6 24 11\r",
+ "6 24 12\r",
+ "6 24 13\r",
+ "6 24 14\r",
+ "6 24 15\r",
+ "6 24 16\r",
+ "6 24 17\r",
+ "6 24 18\r",
+ "6 24 19\r",
+ "6 24 20\r",
+ "6 24 21\r",
+ "6 24 22\r",
+ "6 24 23\r",
+ "6 24 24\r",
+ "6 24 25\r",
+ "6 24 26\r",
+ "6 24 27\r",
+ "6 24 28\r",
+ "6 24 29\r",
+ "6 24 30\r",
+ "6 24 31\r",
+ "6 24 32\r",
+ "6 24 33\r",
+ "6 24 34\r",
+ "6 24 35\r",
+ "6 24 36\r",
+ "6 24 37\r",
+ "6 24 38\r",
+ "6 24 39\r",
+ "6 24 40\r",
+ "6 24 41\r",
+ "6 24 42\r",
+ "6 24 43\r",
+ "6 24 44\r",
+ "6 24 45\r",
+ "6 24 46\r",
+ "6 24 47\r",
+ "6 24 48\r",
+ "6 24 49\r",
+ "6 24 50\r",
+ "6 24 51\r",
+ "6 24 52\r",
+ "6 24 53\r",
+ "6 24 54\r",
+ "6 24 55\r",
+ "6 24 56\r",
+ "6 24 57\r",
+ "6 24 58\r",
+ "6 25 1\r",
+ "6 25 2\r",
+ "6 25 3\r",
+ "6 25 4\r",
+ "6 25 5\r",
+ "6 25 6\r",
+ "6 25 7\r",
+ "6 25 8\r",
+ "6 25 9\r",
+ "6 25 10\r",
+ "6 25 11\r",
+ "6 25 12\r",
+ "6 25 13\r",
+ "6 25 14\r",
+ "6 25 15\r",
+ "6 25 16\r",
+ "6 25 17\r",
+ "6 25 18\r",
+ "6 25 19\r",
+ "6 25 20\r",
+ "6 25 21\r",
+ "6 25 22\r",
+ "6 25 23\r",
+ "6 25 24\r",
+ "6 25 25\r",
+ "6 25 26\r",
+ "6 25 27\r",
+ "6 25 28\r",
+ "6 25 29\r",
+ "6 25 30\r",
+ "6 25 31\r",
+ "6 25 32\r",
+ "6 25 33\r",
+ "6 25 34\r",
+ "6 25 35\r",
+ "6 25 36\r",
+ "6 25 37\r",
+ "6 25 38\r",
+ "6 25 39\r",
+ "6 25 40\r",
+ "6 25 41\r",
+ "6 25 42\r",
+ "6 25 43\r",
+ "6 25 44\r",
+ "6 25 45\r",
+ "6 25 46\r",
+ "6 25 47\r",
+ "6 25 48\r",
+ "6 25 49\r",
+ "6 25 50\r",
+ "6 25 51\r",
+ "6 25 52\r",
+ "6 25 53\r",
+ "6 25 54\r",
+ "6 25 55\r",
+ "6 25 56\r",
+ "6 25 57\r",
+ "6 25 58\r",
+ "6 26 1\r",
+ "6 26 2\r",
+ "6 26 3\r",
+ "6 26 4\r",
+ "6 26 5\r",
+ "6 26 6\r",
+ "6 26 7\r",
+ "6 26 8\r",
+ "6 26 9\r",
+ "6 26 10\r",
+ "6 26 11\r",
+ "6 26 12\r",
+ "6 26 13\r",
+ "6 26 14\r",
+ "6 26 15\r",
+ "6 26 16\r",
+ "6 26 17\r",
+ "6 26 18\r",
+ "6 26 19\r",
+ "6 26 20\r",
+ "6 26 21\r",
+ "6 26 22\r",
+ "6 26 23\r",
+ "6 26 24\r",
+ "6 26 25\r",
+ "6 26 26\r",
+ "6 26 27\r",
+ "6 26 28\r",
+ "6 26 29\r",
+ "6 26 30\r",
+ "6 26 31\r",
+ "6 26 32\r",
+ "6 26 33\r",
+ "6 26 34\r",
+ "6 26 35\r",
+ "6 26 36\r",
+ "6 26 37\r",
+ "6 26 38\r",
+ "6 26 39\r",
+ "6 26 40\r",
+ "6 26 41\r",
+ "6 26 42\r",
+ "6 26 43\r",
+ "6 26 44\r",
+ "6 26 45\r",
+ "6 26 46\r",
+ "6 26 47\r",
+ "6 26 48\r",
+ "6 26 49\r",
+ "6 26 50\r",
+ "6 26 51\r",
+ "6 26 52\r",
+ "6 26 53\r",
+ "6 26 54\r",
+ "6 26 55\r",
+ "6 26 56\r",
+ "6 26 57\r",
+ "6 26 58\r",
+ "6 27 1\r",
+ "6 27 2\r",
+ "6 27 3\r",
+ "6 27 4\r",
+ "6 27 5\r",
+ "6 27 6\r",
+ "6 27 7\r",
+ "6 27 8\r",
+ "6 27 9\r",
+ "6 27 10\r",
+ "6 27 11\r",
+ "6 27 12\r",
+ "6 27 13\r",
+ "6 27 14\r",
+ "6 27 15\r",
+ "6 27 16\r",
+ "6 27 17\r",
+ "6 27 18\r",
+ "6 27 19\r",
+ "6 27 20\r",
+ "6 27 21\r",
+ "6 27 22\r",
+ "6 27 23\r",
+ "6 27 24\r",
+ "6 27 25\r",
+ "6 27 26\r",
+ "6 27 27\r",
+ "6 27 28\r",
+ "6 27 29\r",
+ "6 27 30\r",
+ "6 27 31\r",
+ "6 27 32\r",
+ "6 27 33\r",
+ "6 27 34\r",
+ "6 27 35\r",
+ "6 27 36\r",
+ "6 27 37\r",
+ "6 27 38\r",
+ "6 27 39\r",
+ "6 27 40\r",
+ "6 27 41\r",
+ "6 27 42\r",
+ "6 27 43\r",
+ "6 27 44\r",
+ "6 27 45\r",
+ "6 27 46\r",
+ "6 27 47\r",
+ "6 27 48\r",
+ "6 27 49\r",
+ "6 27 50\r",
+ "6 27 51\r",
+ "6 27 52\r",
+ "6 27 53\r",
+ "6 27 54\r",
+ "6 27 55\r",
+ "6 27 56\r",
+ "6 27 57\r",
+ "6 27 58\r",
+ "6 28 1\r",
+ "6 28 2\r",
+ "6 28 3\r",
+ "6 28 4\r",
+ "6 28 5\r",
+ "6 28 6\r",
+ "6 28 7\r",
+ "6 28 8\r",
+ "6 28 9\r",
+ "6 28 10\r",
+ "6 28 11\r",
+ "6 28 12\r",
+ "6 28 13\r",
+ "6 28 14\r",
+ "6 28 15\r",
+ "6 28 16\r",
+ "6 28 17\r",
+ "6 28 18\r",
+ "6 28 19\r",
+ "6 28 20\r",
+ "6 28 21\r",
+ "6 28 22\r",
+ "6 28 23\r",
+ "6 28 24\r",
+ "6 28 25\r",
+ "6 28 26\r",
+ "6 28 27\r",
+ "6 28 28\r",
+ "6 28 29\r",
+ "6 28 30\r",
+ "6 28 31\r",
+ "6 28 32\r",
+ "6 28 33\r",
+ "6 28 34\r",
+ "6 28 35\r",
+ "6 28 36\r",
+ "6 28 37\r",
+ "6 28 38\r",
+ "6 28 39\r",
+ "6 28 40\r",
+ "6 28 41\r",
+ "6 28 42\r",
+ "6 28 43\r",
+ "6 28 44\r",
+ "6 28 45\r",
+ "6 28 46\r",
+ "6 28 47\r",
+ "6 28 48\r",
+ "6 28 49\r",
+ "6 28 50\r",
+ "6 28 51\r",
+ "6 28 52\r",
+ "6 28 53\r",
+ "6 28 54\r",
+ "6 28 55\r",
+ "6 28 56\r",
+ "6 28 57\r",
+ "6 28 58\r",
+ "6 29 1\r",
+ "6 29 2\r",
+ "6 29 3\r",
+ "6 29 4\r",
+ "6 29 5\r",
+ "6 29 6\r",
+ "6 29 7\r",
+ "6 29 8\r",
+ "6 29 9\r",
+ "6 29 10\r",
+ "6 29 11\r",
+ "6 29 12"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "6 29 13\r",
+ "6 29 14\r",
+ "6 29 15\r",
+ "6 29 16\r",
+ "6 29 17\r",
+ "6 29 18\r",
+ "6 29 19\r",
+ "6 29 20\r",
+ "6 29 21\r",
+ "6 29 22\r",
+ "6 29 23\r",
+ "6 29 24\r",
+ "6 29 25\r",
+ "6 29 26\r",
+ "6 29 27\r",
+ "6 29 28\r",
+ "6 29 29\r",
+ "6 29 30\r",
+ "6 29 31\r",
+ "6 29 32\r",
+ "6 29 33\r",
+ "6 29 34\r",
+ "6 29 35\r",
+ "6 29 36\r",
+ "6 29 37\r",
+ "6 29 38\r",
+ "6 29 39\r",
+ "6 29 40\r",
+ "6 29 41\r",
+ "6 29 42\r",
+ "6 29 43\r",
+ "6 29 44\r",
+ "6 29 45\r",
+ "6 29 46\r",
+ "6 29 47\r",
+ "6 29 48\r",
+ "6 29 49\r",
+ "6 29 50\r",
+ "6 29 51\r",
+ "6 29 52\r",
+ "6 29 53\r",
+ "6 29 54\r",
+ "6 29 55\r",
+ "6 29 56\r",
+ "6 29 57\r",
+ "6 29 58\r",
+ "6 30 1\r",
+ "6 30 2\r",
+ "6 30 3\r",
+ "6 30 4\r",
+ "6 30 5\r",
+ "6 30 6\r",
+ "6 30 7\r",
+ "6 30 8\r",
+ "6 30 9\r",
+ "6 30 10\r",
+ "6 30 11\r",
+ "6 30 12\r",
+ "6 30 13\r",
+ "6 30 14\r",
+ "6 30 15\r",
+ "6 30 16\r",
+ "6 30 17\r",
+ "6 30 18\r",
+ "6 30 19\r",
+ "6 30 20\r",
+ "6 30 21\r",
+ "6 30 22\r",
+ "6 30 23\r",
+ "6 30 24\r",
+ "6 30 25\r",
+ "6 30 26\r",
+ "6 30 27\r",
+ "6 30 28\r",
+ "6 30 29\r",
+ "6 30 30\r",
+ "6 30 31\r",
+ "6 30 32\r",
+ "6 30 33\r",
+ "6 30 34\r",
+ "6 30 35\r",
+ "6 30 36\r",
+ "6 30 37\r",
+ "6 30 38\r",
+ "6 30 39\r",
+ "6 30 40\r",
+ "6 30 41\r",
+ "6 30 42\r",
+ "6 30 43\r",
+ "6 30 44\r",
+ "6 30 45\r",
+ "6 30 46\r",
+ "6 30 47\r",
+ "6 30 48\r",
+ "6 30 49\r",
+ "6 30 50\r",
+ "6 30 51\r",
+ "6 30 52\r",
+ "6 30 53\r",
+ "6 30 54\r",
+ "6 30 55\r",
+ "6 30 56\r",
+ "6 30 57\r",
+ "6 30 58\r",
+ "6 31 1\r",
+ "6 31 2\r",
+ "6 31 3\r",
+ "6 31 4\r",
+ "6 31 5\r",
+ "6 31 6\r",
+ "6 31 7\r",
+ "6 31 8\r",
+ "6 31 9\r",
+ "6 31 10\r",
+ "6 31 11\r",
+ "6 31 12\r",
+ "6 31 13\r",
+ "6 31 14\r",
+ "6 31 15\r",
+ "6 31 16\r",
+ "6 31 17\r",
+ "6 31 18\r",
+ "6 31 19\r",
+ "6 31 20\r",
+ "6 31 21\r",
+ "6 31 22\r",
+ "6 31 23\r",
+ "6 31 24\r",
+ "6 31 25\r",
+ "6 31 26\r",
+ "6 31 27\r",
+ "6 31 28\r",
+ "6 31 29\r",
+ "6 31 30\r",
+ "6 31 31\r",
+ "6 31 32\r",
+ "6 31 33\r",
+ "6 31 34\r",
+ "6 31 35\r",
+ "6 31 36\r",
+ "6 31 37\r",
+ "6 31 38\r",
+ "6 31 39\r",
+ "6 31 40\r",
+ "6 31 41\r",
+ "6 31 42\r",
+ "6 31 43\r",
+ "6 31 44\r",
+ "6 31 45\r",
+ "6 31 46\r",
+ "6 31 47\r",
+ "6 31 48\r",
+ "6 31 49\r",
+ "6 31 50\r",
+ "6 31 51\r",
+ "6 31 52\r",
+ "6 31 53\r",
+ "6 31 54\r",
+ "6 31 55\r",
+ "6 31 56\r",
+ "6 31 57\r",
+ "6 31 58\r",
+ "6 32 1\r",
+ "6 32 2\r",
+ "6 32 3\r",
+ "6 32 4\r",
+ "6 32 5\r",
+ "6 32 6\r",
+ "6 32 7\r",
+ "6 32 8\r",
+ "6 32 9\r",
+ "6 32 10\r",
+ "6 32 11\r",
+ "6 32 12\r",
+ "6 32 13\r",
+ "6 32 14\r",
+ "6 32 15\r",
+ "6 32 16\r",
+ "6 32 17\r",
+ "6 32 18\r",
+ "6 32 19\r",
+ "6 32 20\r",
+ "6 32 21\r",
+ "6 32 22\r",
+ "6 32 23\r",
+ "6 32 24\r",
+ "6 32 25\r",
+ "6 32 26\r",
+ "6 32 27\r",
+ "6 32 28\r",
+ "6 32 29\r",
+ "6 32 30\r",
+ "6 32 31\r",
+ "6 32 32\r",
+ "6 32 33\r",
+ "6 32 34\r",
+ "6 32 35\r",
+ "6 32 36\r",
+ "6 32 37\r",
+ "6 32 38\r",
+ "6 32 39\r",
+ "6 32 40\r",
+ "6 32 41\r",
+ "6 32 42\r",
+ "6 32 43\r",
+ "6 32 44\r",
+ "6 32 45\r",
+ "6 32 46\r",
+ "6 32 47\r",
+ "6 32 48\r",
+ "6 32 49\r",
+ "6 32 50\r",
+ "6 32 51\r",
+ "6 32 52\r",
+ "6 32 53\r",
+ "6 32 54\r",
+ "6 32 55\r",
+ "6 32 56\r",
+ "6 32 57\r",
+ "6 32 58\r",
+ "6 33 1\r",
+ "6 33 2\r",
+ "6 33 3\r",
+ "6 33 4\r",
+ "6 33 5\r",
+ "6 33 6\r",
+ "6 33 7\r",
+ "6 33 8\r",
+ "6 33 9\r",
+ "6 33 10\r",
+ "6 33 11\r",
+ "6 33 12\r",
+ "6 33 13\r",
+ "6 33 14\r",
+ "6 33 15\r",
+ "6 33 16\r",
+ "6 33 17\r",
+ "6 33 18\r",
+ "6 33 19\r",
+ "6 33 20\r",
+ "6 33 21\r",
+ "6 33 22\r",
+ "6 33 23\r",
+ "6 33 24\r",
+ "6 33 25\r",
+ "6 33 26\r",
+ "6 33 27\r",
+ "6 33 28\r",
+ "6 33 29\r",
+ "6 33 30\r",
+ "6 33 31\r",
+ "6 33 32\r",
+ "6 33 33\r",
+ "6 33 34\r",
+ "6 33 35\r",
+ "6 33 36\r",
+ "6 33 37\r",
+ "6 33 38\r",
+ "6 33 39\r",
+ "6 33 40\r",
+ "6 33 41\r",
+ "6 33 42\r",
+ "6 33 43\r",
+ "6 33 44\r",
+ "6 33 45\r",
+ "6 33 46\r",
+ "6 33 47\r",
+ "6 33 48\r",
+ "6 33 49\r",
+ "6 33 50\r",
+ "6 33 51\r",
+ "6 33 52\r",
+ "6 33 53\r",
+ "6 33 54\r",
+ "6 33 55\r",
+ "6 33 56\r",
+ "6 33 57\r",
+ "6 33 58\r",
+ "6 34 1\r",
+ "6 34 2\r",
+ "6 34 3\r",
+ "6 34 4\r",
+ "6 34 5\r",
+ "6 34 6\r",
+ "6 34 7\r",
+ "6 34 8\r",
+ "6 34 9\r",
+ "6 34 10\r",
+ "6 34 11\r",
+ "6 34 12\r",
+ "6 34 13\r",
+ "6 34 14\r",
+ "6 34 15\r",
+ "6 34 16\r",
+ "6 34 17\r",
+ "6 34 18\r",
+ "6 34 19\r",
+ "6 34 20\r",
+ "6 34 21\r",
+ "6 34 22\r",
+ "6 34 23\r",
+ "6 34 24\r",
+ "6 34 25\r",
+ "6 34 26\r",
+ "6 34 27\r",
+ "6 34 28\r",
+ "6 34 29\r",
+ "6 34 30\r",
+ "6 34 31\r",
+ "6 34 32\r",
+ "6 34 33\r",
+ "6 34 34\r",
+ "6 34 35\r",
+ "6 34 36\r",
+ "6 34 37\r",
+ "6 34 38\r",
+ "6 34 39\r",
+ "6 34 40\r",
+ "6 34 41\r",
+ "6 34 42\r",
+ "6 34 43\r",
+ "6 34 44\r",
+ "6 34 45\r",
+ "6 34 46\r",
+ "6 34 47\r",
+ "6 34 48\r",
+ "6 34 49\r",
+ "6 34 50\r",
+ "6 34 51\r",
+ "6 34 52\r",
+ "6 34 53\r",
+ "6 34 54\r",
+ "6 34 55\r",
+ "6 34 56\r",
+ "6 34 57\r",
+ "6 34 58\r",
+ "6 35 1\r",
+ "6 35 2\r",
+ "6 35 3\r",
+ "6 35 4\r",
+ "6 35 5\r",
+ "6 35 6\r",
+ "6 35 7\r",
+ "6 35 8\r",
+ "6 35 9\r",
+ "6 35 10\r",
+ "6 35 11\r",
+ "6 35 12\r",
+ "6 35 13\r",
+ "6 35 14\r",
+ "6 35 15\r",
+ "6 35 16\r",
+ "6 35 17\r",
+ "6 35 18\r",
+ "6 35 19\r",
+ "6 35 20\r",
+ "6 35 21\r",
+ "6 35 22\r",
+ "6 35 23\r",
+ "6 35 24\r",
+ "6 35 25\r",
+ "6 35 26\r",
+ "6 35 27\r",
+ "6 35 28\r",
+ "6 35 29\r",
+ "6 35 30\r",
+ "6 35 31\r",
+ "6 35 32\r",
+ "6 35 33\r",
+ "6 35 34\r",
+ "6 35 35\r",
+ "6 35 36\r",
+ "6 35 37\r",
+ "6 35 38\r",
+ "6 35 39\r",
+ "6 35 40\r",
+ "6 35 41\r",
+ "6 35 42\r",
+ "6 35 43\r",
+ "6 35 44\r",
+ "6 35 45\r",
+ "6 35 46\r",
+ "6 35 47\r",
+ "6 35 48\r",
+ "6 35 49\r",
+ "6 35 50\r",
+ "6 35 51\r",
+ "6 35 52\r",
+ "6 35 53\r",
+ "6 35 54\r",
+ "6 35 55\r",
+ "6 35 56\r",
+ "6 35 57\r",
+ "6 35 58\r",
+ "6 36 1\r",
+ "6 36 2\r",
+ "6 36 3\r",
+ "6 36 4\r",
+ "6 36 5\r",
+ "6 36 6\r",
+ "6 36 7\r",
+ "6 36 8\r",
+ "6 36 9\r",
+ "6 36 10\r",
+ "6 36 11\r",
+ "6 36 12\r",
+ "6 36 13\r",
+ "6 36 14\r",
+ "6 36 15\r",
+ "6 36 16\r",
+ "6 36 17\r",
+ "6 36 18\r",
+ "6 36 19\r",
+ "6 36 20\r",
+ "6 36 21\r",
+ "6 36 22\r",
+ "6 36 23\r",
+ "6 36 24\r",
+ "6 36 25\r",
+ "6 36 26\r",
+ "6 36 27\r",
+ "6 36 28\r",
+ "6 36 29\r",
+ "6 36 30\r",
+ "6 36 31\r",
+ "6 36 32\r",
+ "6 36 33\r",
+ "6 36 34\r",
+ "6 36 35\r",
+ "6 36 36\r",
+ "6 36 37\r",
+ "6 36 38\r",
+ "6 36 39\r",
+ "6 36 40\r",
+ "6 36 41\r",
+ "6 36 42\r",
+ "6 36 43\r",
+ "6 36 44\r",
+ "6 36 45\r",
+ "6 36 46\r",
+ "6 36 47\r",
+ "6 36 48\r",
+ "6 36 49\r",
+ "6 36 50\r",
+ "6 36 51\r",
+ "6 36 52\r",
+ "6 36 53\r",
+ "6 36 54\r",
+ "6 36 55\r",
+ "6 36 56\r",
+ "6 36 57\r",
+ "6 36 58\r",
+ "6 37 1\r",
+ "6 37 2\r",
+ "6 37 3\r",
+ "6 37 4\r",
+ "6 37 5\r",
+ "6 37 6\r",
+ "6 37 7\r",
+ "6 37 8\r",
+ "6 37 9\r",
+ "6 37 10\r",
+ "6 37 11\r",
+ "6 37 12\r",
+ "6 37 13\r",
+ "6 37 14\r",
+ "6 37 15\r",
+ "6 37 16\r",
+ "6 37 17\r",
+ "6 37 18\r",
+ "6 37 19\r",
+ "6 37 20\r",
+ "6 37 21\r",
+ "6 37 22\r",
+ "6 37 23\r",
+ "6 37 24\r",
+ "6 37 25\r",
+ "6 37 26\r",
+ "6 37 27\r",
+ "6 37 28\r",
+ "6 37 29\r",
+ "6 37 30\r",
+ "6 37 31\r",
+ "6 37 32\r",
+ "6 37 33\r",
+ "6 37 34\r",
+ "6 37 35\r",
+ "6 37 36\r",
+ "6 37 37\r",
+ "6 37 38\r",
+ "6 37 39\r",
+ "6 37 40\r",
+ "6 37 41\r",
+ "6 37 42\r",
+ "6 37 43\r",
+ "6 37 44\r",
+ "6 37 45\r",
+ "6 37 46\r",
+ "6 37 47\r",
+ "6 37 48\r",
+ "6 37 49\r",
+ "6 37 50\r",
+ "6 37 51\r",
+ "6 37 52\r",
+ "6 37 53\r",
+ "6 37 54\r",
+ "6 37 55\r",
+ "6 37 56\r",
+ "6 37 57\r",
+ "6 37 58\r",
+ "6 38 1\r",
+ "6 38 2\r",
+ "6 38 3\r",
+ "6 38 4\r",
+ "6 38 5\r",
+ "6 38 6\r",
+ "6 38 7\r",
+ "6 38 8\r",
+ "6 38 9\r",
+ "6 38 10\r",
+ "6 38 11\r",
+ "6 38 12\r",
+ "6 38 13\r",
+ "6 38 14\r",
+ "6 38 15\r",
+ "6 38 16\r",
+ "6 38 17\r",
+ "6 38 18\r",
+ "6 38 19\r",
+ "6 38 20\r",
+ "6 38 21\r",
+ "6 38 22\r",
+ "6 38 23\r",
+ "6 38 24\r",
+ "6 38 25\r",
+ "6 38 26\r",
+ "6 38 27\r",
+ "6 38 28\r",
+ "6 38 29\r",
+ "6 38 30\r",
+ "6 38 31\r",
+ "6 38 32\r",
+ "6 38 33\r",
+ "6 38 34\r",
+ "6 38 35\r",
+ "6 38 36\r",
+ "6 38 37\r",
+ "6 38 38\r",
+ "6 38 39\r",
+ "6 38 40\r",
+ "6 38 41\r",
+ "6 38 42\r",
+ "6 38 43\r",
+ "6 38 44\r",
+ "6 38 45\r",
+ "6 38 46\r",
+ "6 38 47\r",
+ "6 38 48\r",
+ "6 38 49\r",
+ "6 38 50\r",
+ "6 38 51\r",
+ "6 38 52\r",
+ "6 38 53\r",
+ "6 38 54\r",
+ "6 38 55\r",
+ "6 38 56\r",
+ "6 38 57\r",
+ "6 38 58\r",
+ "6 39 1\r",
+ "6 39 2\r",
+ "6 39 3\r",
+ "6 39 4\r",
+ "6 39 5\r",
+ "6 39 6\r",
+ "6 39 7\r",
+ "6 39 8\r",
+ "6 39 9\r",
+ "6 39 10\r",
+ "6 39 11\r",
+ "6 39 12\r",
+ "6 39 13\r",
+ "6 39 14\r",
+ "6 39 15\r",
+ "6 39 16\r",
+ "6 39 17\r",
+ "6 39 18\r",
+ "6 39 19\r",
+ "6 39 20\r",
+ "6 39 21\r",
+ "6 39 22\r",
+ "6 39 23\r",
+ "6 39 24\r",
+ "6 39 25\r",
+ "6 39 26\r",
+ "6 39 27\r",
+ "6 39 28\r",
+ "6 39 29\r",
+ "6 39 30\r",
+ "6 39 31\r",
+ "6 39 32\r",
+ "6 39 33\r",
+ "6 39 34\r",
+ "6 39 35\r",
+ "6 39 36\r",
+ "6 39 37\r",
+ "6 39 38\r",
+ "6 39 39\r",
+ "6 39 40\r",
+ "6 39 41\r",
+ "6 39 42\r",
+ "6 39 43\r",
+ "6 39 44\r",
+ "6 39 45\r",
+ "6 39 46\r",
+ "6 39 47\r",
+ "6 39 48\r",
+ "6 39 49\r",
+ "6 39 50\r",
+ "6 39 51\r",
+ "6 39 52\r",
+ "6 39 53\r",
+ "6 39 54\r",
+ "6 39 55\r",
+ "6 39 56\r",
+ "6 39 57\r",
+ "6 39 58\r",
+ "6 40 1\r",
+ "6 40 2\r",
+ "6 40 3\r",
+ "6 40 4\r",
+ "6 40 5\r",
+ "6 40 6\r",
+ "6 40 7\r",
+ "6 40 8\r",
+ "6 40 9\r",
+ "6 40 10\r",
+ "6 40 11\r",
+ "6 40 12\r",
+ "6 40 13\r",
+ "6 40 14\r",
+ "6 40 15\r",
+ "6 40 16\r",
+ "6 40 17\r",
+ "6 40 18\r",
+ "6 40 19\r",
+ "6 40 20\r",
+ "6 40 21\r",
+ "6 40 22\r",
+ "6 40 23\r",
+ "6 40 24\r",
+ "6 40 25\r",
+ "6 40 26\r",
+ "6 40 27\r",
+ "6 40 28\r",
+ "6 40 29\r",
+ "6 40 30\r",
+ "6 40 31\r",
+ "6 40 32\r",
+ "6 40 33\r",
+ "6 40 34\r",
+ "6 40 35\r",
+ "6 40 36\r",
+ "6 40 37\r",
+ "6 40 38\r",
+ "6 40 39\r",
+ "6 40 40\r",
+ "6 40 41\r",
+ "6 40 42\r",
+ "6 40 43\r",
+ "6 40 44\r",
+ "6 40 45\r",
+ "6 40 46\r",
+ "6 40 47\r",
+ "6 40 48\r",
+ "6 40 49\r",
+ "6 40 50\r",
+ "6 40 51\r",
+ "6 40 52\r",
+ "6 40 53\r",
+ "6 40 54\r",
+ "6 40 55\r",
+ "6 40 56\r",
+ "6 40 57\r",
+ "6 40 58\r",
+ "6 41 1\r",
+ "6 41 2\r",
+ "6 41 3\r",
+ "6 41 4\r",
+ "6 41 5\r",
+ "6 41 6\r",
+ "6 41 7\r",
+ "6 41 8\r",
+ "6 41 9\r",
+ "6 41 10\r",
+ "6 41 11\r",
+ "6 41 12\r",
+ "6 41 13\r",
+ "6 41 14\r",
+ "6 41 15\r",
+ "6 41 16\r",
+ "6 41 17\r",
+ "6 41 18\r",
+ "6 41 19\r",
+ "6 41 20\r",
+ "6 41 21\r",
+ "6 41 22\r",
+ "6 41 23\r",
+ "6 41 24\r",
+ "6 41 25\r",
+ "6 41 26\r",
+ "6 41 27\r",
+ "6 41 28\r",
+ "6 41 29\r",
+ "6 41 30\r",
+ "6 41 31\r",
+ "6 41 32\r",
+ "6 41 33\r",
+ "6 41 34\r",
+ "6 41 35\r",
+ "6 41 36\r",
+ "6 41 37\r",
+ "6 41 38\r",
+ "6 41 39\r",
+ "6 41 40\r",
+ "6 41 41\r",
+ "6 41 42\r",
+ "6 41 43\r",
+ "6 41 44\r",
+ "6 41 45\r",
+ "6 41 46\r",
+ "6 41 47\r",
+ "6 41 48\r",
+ "6 41 49\r",
+ "6 41 50\r",
+ "6 41 51\r",
+ "6 41 52\r",
+ "6 41 53\r",
+ "6 41 54\r",
+ "6 41 55\r",
+ "6 41 56\r",
+ "6 41 57\r",
+ "6 41 58\r",
+ "6 42 1\r",
+ "6 42 2\r",
+ "6 42 3\r",
+ "6 42 4\r",
+ "6 42 5\r",
+ "6 42 6\r",
+ "6 42 7\r",
+ "6 42 8\r",
+ "6 42 9\r",
+ "6 42 10\r",
+ "6 42 11\r",
+ "6 42 12\r",
+ "6 42 13\r",
+ "6 42 14\r",
+ "6 42 15\r",
+ "6 42 16\r",
+ "6 42 17\r",
+ "6 42 18\r",
+ "6 42 19\r",
+ "6 42 20\r",
+ "6 42 21\r",
+ "6 42 22\r",
+ "6 42 23\r",
+ "6 42 24\r",
+ "6 42 25\r",
+ "6 42 26\r",
+ "6 42 27\r",
+ "6 42 28\r",
+ "6 42 29\r",
+ "6 42 30\r",
+ "6 42 31\r",
+ "6 42 32\r",
+ "6 42 33\r",
+ "6 42 34\r",
+ "6 42 35\r",
+ "6 42 36\r",
+ "6 42 37\r",
+ "6 42 38\r",
+ "6 42 39\r",
+ "6 42 40\r",
+ "6 42 41\r",
+ "6 42 42\r",
+ "6 42 43\r",
+ "6 42 44\r",
+ "6 42 45\r",
+ "6 42 46\r",
+ "6 42 47\r",
+ "6 42 48\r",
+ "6 42 49\r",
+ "6 42 50\r",
+ "6 42 51\r",
+ "6 42 52\r",
+ "6 42 53\r",
+ "6 42 54\r",
+ "6 42 55\r",
+ "6 42 56\r",
+ "6 42 57\r",
+ "6 42 58\r",
+ "6 43 1\r",
+ "6 43 2\r",
+ "6 43 3\r",
+ "6 43 4\r",
+ "6 43 5\r",
+ "6 43 6\r",
+ "6 43 7\r",
+ "6 43 8\r",
+ "6 43 9\r",
+ "6 43 10\r",
+ "6 43 11\r",
+ "6 43 12\r",
+ "6 43 13\r",
+ "6 43 14\r",
+ "6 43 15\r",
+ "6 43 16\r",
+ "6 43 17\r",
+ "6 43 18\r",
+ "6 43 19\r",
+ "6 43 20\r",
+ "6 43 21\r",
+ "6 43 22\r",
+ "6 43 23\r",
+ "6 43 24\r",
+ "6 43 25\r",
+ "6 43 26\r",
+ "6 43 27\r",
+ "6 43 28\r",
+ "6 43 29\r",
+ "6 43 30\r",
+ "6 43 31\r",
+ "6 43 32\r",
+ "6 43 33\r",
+ "6 43 34\r",
+ "6 43 35\r",
+ "6 43 36\r",
+ "6 43 37\r",
+ "6 43 38\r",
+ "6 43 39\r",
+ "6 43 40\r",
+ "6 43 41\r",
+ "6 43 42\r",
+ "6 43 43\r",
+ "6 43 44\r",
+ "6 43 45\r",
+ "6 43 46\r",
+ "6 43 47\r",
+ "6 43 48\r",
+ "6 43 49\r",
+ "6 43 50\r",
+ "6 43 51\r",
+ "6 43 52\r",
+ "6 43 53\r",
+ "6 43 54\r",
+ "6 43 55\r",
+ "6 43 56\r",
+ "6 43 57\r",
+ "6 43 58\r",
+ "6 44 1\r",
+ "6 44 2\r",
+ "6 44 3\r",
+ "6 44 4\r",
+ "6 44 5\r",
+ "6 44 6\r",
+ "6 44 7\r",
+ "6 44 8\r",
+ "6 44 9\r",
+ "6 44 10\r",
+ "6 44 11\r",
+ "6 44 12\r",
+ "6 44 13\r",
+ "6 44 14\r",
+ "6 44 15\r",
+ "6 44 16\r",
+ "6 44 17\r",
+ "6 44 18\r",
+ "6 44 19\r",
+ "6 44 20\r",
+ "6 44 21\r",
+ "6 44 22\r",
+ "6 44 23\r",
+ "6 44 24\r",
+ "6 44 25\r",
+ "6 44 26\r",
+ "6 44 27\r",
+ "6 44 28\r",
+ "6 44 29\r",
+ "6 44 30\r",
+ "6 44 31\r",
+ "6 44 32\r",
+ "6 44 33\r",
+ "6 44 34\r",
+ "6 44 35\r",
+ "6 44 36\r",
+ "6 44 37\r",
+ "6 44 38\r",
+ "6 44 39\r",
+ "6 44 40\r",
+ "6 44 41\r",
+ "6 44 42\r",
+ "6 44 43\r",
+ "6 44 44\r",
+ "6 44 45\r",
+ "6 44 46\r",
+ "6 44 47\r",
+ "6 44 48\r",
+ "6 44 49\r",
+ "6 44 50\r",
+ "6 44 51\r",
+ "6 44 52\r",
+ "6 44 53\r",
+ "6 44 54\r",
+ "6 44 55\r",
+ "6 44 56\r",
+ "6 44 57\r",
+ "6 44 58\r",
+ "6 45 1\r",
+ "6 45 2\r",
+ "6 45 3\r",
+ "6 45 4\r",
+ "6 45 5\r",
+ "6 45 6\r",
+ "6 45 7\r",
+ "6 45 8\r",
+ "6 45 9\r",
+ "6 45 10\r",
+ "6 45 11\r",
+ "6 45 12\r",
+ "6 45 13\r",
+ "6 45 14\r",
+ "6 45 15\r",
+ "6 45 16\r",
+ "6 45 17\r",
+ "6 45 18\r",
+ "6 45 19\r",
+ "6 45 20\r",
+ "6 45 21\r",
+ "6 45 22\r",
+ "6 45 23\r",
+ "6 45 24\r",
+ "6 45 25\r",
+ "6 45 26\r",
+ "6 45 27\r",
+ "6 45 28\r",
+ "6 45 29\r",
+ "6 45 30\r",
+ "6 45 31\r",
+ "6 45 32\r",
+ "6 45 33\r",
+ "6 45 34\r",
+ "6 45 35\r",
+ "6 45 36\r",
+ "6 45 37\r",
+ "6 45 38\r",
+ "6 45 39\r",
+ "6 45 40\r",
+ "6 45 41\r",
+ "6 45 42\r",
+ "6 45 43\r",
+ "6 45 44\r",
+ "6 45 45\r",
+ "6 45 46\r",
+ "6 45 47\r",
+ "6 45 48\r",
+ "6 45 49\r",
+ "6 45 50\r",
+ "6 45 51\r",
+ "6 45 52\r",
+ "6 45 53\r",
+ "6 45 54\r",
+ "6 45 55\r",
+ "6 45 56\r",
+ "6 45 57\r",
+ "6 45 58\r",
+ "6 46 1\r",
+ "6 46 2\r",
+ "6 46 3\r",
+ "6 46 4\r",
+ "6 46 5\r",
+ "6 46 6\r",
+ "6 46 7\r",
+ "6 46 8\r",
+ "6 46 9\r",
+ "6 46 10\r",
+ "6 46 11\r",
+ "6 46 12\r",
+ "6 46 13\r",
+ "6 46 14\r",
+ "6 46 15\r",
+ "6 46 16\r",
+ "6 46 17\r",
+ "6 46 18\r",
+ "6 46 19\r",
+ "6 46 20\r",
+ "6 46 21\r",
+ "6 46 22\r",
+ "6 46 23\r",
+ "6 46 24\r",
+ "6 46 25\r",
+ "6 46 26\r",
+ "6 46 27\r",
+ "6 46 28\r",
+ "6 46 29\r",
+ "6 46 30\r",
+ "6 46 31\r",
+ "6 46 32\r",
+ "6 46 33\r",
+ "6 46 34\r",
+ "6 46 35\r",
+ "6 46 36\r",
+ "6 46 37\r",
+ "6 46 38\r",
+ "6 46 39\r",
+ "6 46 40\r",
+ "6 46 41\r",
+ "6 46 42\r",
+ "6 46 43\r",
+ "6 46 44\r",
+ "6 46 45\r",
+ "6 46 46\r",
+ "6 46 47\r",
+ "6 46 48\r",
+ "6 46 49\r",
+ "6 46 50\r",
+ "6 46 51\r",
+ "6 46 52\r",
+ "6 46 53\r",
+ "6 46 54\r",
+ "6 46 55\r",
+ "6 46 56\r",
+ "6 46 57\r",
+ "6 46 58\r",
+ "6 47 1\r",
+ "6 47 2\r",
+ "6 47 3\r",
+ "6 47 4\r",
+ "6 47 5\r",
+ "6 47 6\r",
+ "6 47 7\r",
+ "6 47 8\r",
+ "6 47 9\r",
+ "6 47 10\r",
+ "6 47 11\r",
+ "6 47 12\r",
+ "6 47 13\r",
+ "6 47 14\r",
+ "6 47 15\r",
+ "6 47 16\r",
+ "6 47 17\r",
+ "6 47 18\r",
+ "6 47 19\r",
+ "6 47 20\r",
+ "6 47 21\r",
+ "6 47 22\r",
+ "6 47 23\r",
+ "6 47 24\r",
+ "6 47 25\r",
+ "6 47 26\r",
+ "6 47 27\r",
+ "6 47 28\r",
+ "6 47 29\r",
+ "6 47 30\r",
+ "6 47 31\r",
+ "6 47 32\r",
+ "6 47 33\r",
+ "6 47 34\r",
+ "6 47 35\r",
+ "6 47 36\r",
+ "6 47 37\r",
+ "6 47 38\r",
+ "6 47 39\r",
+ "6 47 40\r",
+ "6 47 41\r",
+ "6 47 42\r",
+ "6 47 43\r",
+ "6 47 44\r",
+ "6 47 45\r",
+ "6 47 46\r",
+ "6 47 47\r",
+ "6 47 48\r",
+ "6 47 49\r",
+ "6 47 50\r",
+ "6 47 51\r",
+ "6 47 52\r",
+ "6 47 53\r",
+ "6 47 54\r",
+ "6 47 55\r",
+ "6 47 56\r",
+ "6 47 57\r",
+ "6 47 58\r",
+ "6 48 1\r",
+ "6 48 2\r",
+ "6 48 3\r",
+ "6 48 4\r",
+ "6 48 5\r",
+ "6 48 6\r",
+ "6 48 7\r",
+ "6 48 8\r",
+ "6 48 9\r",
+ "6 48 10\r",
+ "6 48 11\r",
+ "6 48 12\r",
+ "6 48 13\r",
+ "6 48 14\r",
+ "6 48 15\r",
+ "6 48 16\r",
+ "6 48 17\r",
+ "6 48 18\r",
+ "6 48 19\r",
+ "6 48 20\r",
+ "6 48 21\r",
+ "6 48 22\r",
+ "6 48 23\r",
+ "6 48 24\r",
+ "6 48 25\r",
+ "6 48 26\r",
+ "6 48 27\r",
+ "6 48 28\r",
+ "6 48 29\r",
+ "6 48 30\r",
+ "6 48 31\r",
+ "6 48 32\r",
+ "6 48 33\r",
+ "6 48 34\r",
+ "6 48 35\r",
+ "6 48 36\r",
+ "6 48 37\r",
+ "6 48 38\r",
+ "6 48 39\r",
+ "6 48 40\r",
+ "6 48 41\r",
+ "6 48 42\r",
+ "6 48 43\r",
+ "6 48 44\r",
+ "6 48 45\r",
+ "6 48 46\r",
+ "6 48 47\r",
+ "6 48 48\r",
+ "6 48 49\r",
+ "6 48 50\r",
+ "6 48 51\r",
+ "6 48 52\r",
+ "6 48 53\r",
+ "6 48 54\r",
+ "6 48 55\r",
+ "6 48 56\r",
+ "6 48 57\r",
+ "6 48 58\r",
+ "6 49 1\r",
+ "6 49 2\r",
+ "6 49 3\r",
+ "6 49 4\r",
+ "6 49 5\r",
+ "6 49 6\r",
+ "6 49 7\r",
+ "6 49 8\r",
+ "6 49 9\r",
+ "6 49 10\r",
+ "6 49 11\r",
+ "6 49 12\r",
+ "6 49 13\r",
+ "6 49 14\r",
+ "6 49 15\r",
+ "6 49 16\r",
+ "6 49 17\r",
+ "6 49 18\r",
+ "6 49 19\r",
+ "6 49 20\r",
+ "6 49 21\r",
+ "6 49 22\r",
+ "6 49 23\r",
+ "6 49 24\r",
+ "6 49 25\r",
+ "6 49 26\r",
+ "6 49 27\r",
+ "6 49 28\r",
+ "6 49 29\r",
+ "6 49 30\r",
+ "6 49 31\r",
+ "6 49 32\r",
+ "6 49 33\r",
+ "6 49 34\r",
+ "6 49 35\r",
+ "6 49 36\r",
+ "6 49 37\r",
+ "6 49 38\r",
+ "6 49 39\r",
+ "6 49 40\r",
+ "6 49 41\r",
+ "6 49 42\r",
+ "6 49 43\r",
+ "6 49 44\r",
+ "6 49 45\r",
+ "6 49 46\r",
+ "6 49 47\r",
+ "6 49 48\r",
+ "6 49 49\r",
+ "6 49 50\r",
+ "6 49 51\r",
+ "6 49 52\r",
+ "6 49 53\r",
+ "6 49 54\r",
+ "6 49 55\r",
+ "6 49 56\r",
+ "6 49 57\r",
+ "6 49 58\r",
+ "6 50 1\r",
+ "6 50 2\r",
+ "6 50 3\r",
+ "6 50 4\r",
+ "6 50 5\r",
+ "6 50 6\r",
+ "6 50 7\r",
+ "6 50 8\r",
+ "6 50 9\r",
+ "6 50 10\r",
+ "6 50 11\r",
+ "6 50 12\r",
+ "6 50 13\r",
+ "6 50 14\r",
+ "6 50 15\r",
+ "6 50 16\r",
+ "6 50 17\r",
+ "6 50 18\r",
+ "6 50 19\r",
+ "6 50 20\r",
+ "6 50 21\r",
+ "6 50 22\r",
+ "6 50 23\r",
+ "6 50 24\r",
+ "6 50 25\r",
+ "6 50 26\r",
+ "6 50 27\r",
+ "6 50 28\r",
+ "6 50 29\r",
+ "6 50 30\r",
+ "6 50 31\r",
+ "6 50 32\r",
+ "6 50 33\r",
+ "6 50 34\r",
+ "6 50 35\r",
+ "6 50 36\r",
+ "6 50 37\r",
+ "6 50 38\r",
+ "6 50 39\r",
+ "6 50 40\r",
+ "6 50 41\r",
+ "6 50 42\r",
+ "6 50 43\r",
+ "6 50 44\r",
+ "6 50 45\r",
+ "6 50 46\r",
+ "6 50 47\r",
+ "6 50 48\r",
+ "6 50 49\r",
+ "6 50 50\r",
+ "6 50 51\r",
+ "6 50 52\r",
+ "6 50 53\r",
+ "6 50 54\r",
+ "6 50 55\r",
+ "6 50 56\r",
+ "6 50 57\r",
+ "6 50 58\r",
+ "6 51 1\r",
+ "6 51 2\r",
+ "6 51 3\r",
+ "6 51 4\r",
+ "6 51 5\r",
+ "6 51 6\r",
+ "6 51 7\r",
+ "6 51 8\r",
+ "6 51 9\r",
+ "6 51 10\r",
+ "6 51 11\r",
+ "6 51 12\r",
+ "6 51 13\r",
+ "6 51 14\r",
+ "6 51 15\r",
+ "6 51 16\r",
+ "6 51 17\r",
+ "6 51 18\r",
+ "6 51 19\r",
+ "6 51 20\r",
+ "6 51 21\r",
+ "6 51 22\r",
+ "6 51 23\r",
+ "6 51 24\r",
+ "6 51 25\r",
+ "6 51 26\r",
+ "6 51 27\r",
+ "6 51 28\r",
+ "6 51 29\r",
+ "6 51 30\r",
+ "6 51 31\r",
+ "6 51 32\r",
+ "6 51 33\r",
+ "6 51 34\r",
+ "6 51 35\r",
+ "6 51 36\r",
+ "6 51 37\r",
+ "6 51 38\r",
+ "6 51 39\r",
+ "6 51 40\r",
+ "6 51 41\r",
+ "6 51 42\r",
+ "6 51 43\r",
+ "6 51 44\r",
+ "6 51 45\r",
+ "6 51 46\r",
+ "6 51 47\r",
+ "6 51 48\r",
+ "6 51 49\r",
+ "6 51 50\r",
+ "6 51 51\r",
+ "6 51 52\r",
+ "6 51 53\r",
+ "6 51 54\r",
+ "6 51 55\r",
+ "6 51 56\r",
+ "6 51 57\r",
+ "6 51 58\r",
+ "6 52 1\r",
+ "6 52 2\r",
+ "6 52 3\r",
+ "6 52 4\r",
+ "6 52 5\r",
+ "6 52 6\r",
+ "6 52 7\r",
+ "6 52 8\r",
+ "6 52 9\r",
+ "6 52 10\r",
+ "6 52 11\r",
+ "6 52 12\r",
+ "6 52 13\r",
+ "6 52 14\r",
+ "6 52 15\r",
+ "6 52 16\r",
+ "6 52 17\r",
+ "6 52 18\r",
+ "6 52 19\r",
+ "6 52 20\r",
+ "6 52 21\r",
+ "6 52 22\r",
+ "6 52 23\r",
+ "6 52 24\r",
+ "6 52 25\r",
+ "6 52 26\r",
+ "6 52 27\r",
+ "6 52 28\r",
+ "6 52 29\r",
+ "6 52 30\r",
+ "6 52 31\r",
+ "6 52 32\r",
+ "6 52 33\r",
+ "6 52 34\r",
+ "6 52 35\r",
+ "6 52 36\r",
+ "6 52 37\r",
+ "6 52 38\r",
+ "6 52 39\r",
+ "6 52 40\r",
+ "6 52 41\r",
+ "6 52 42\r",
+ "6 52 43\r",
+ "6 52 44\r",
+ "6 52 45\r",
+ "6 52 46\r",
+ "6 52 47\r",
+ "6 52 48\r",
+ "6 52 49\r",
+ "6 52 50\r",
+ "6 52 51\r",
+ "6 52 52\r",
+ "6 52 53\r",
+ "6 52 54\r",
+ "6 52 55\r",
+ "6 52 56\r",
+ "6 52 57\r",
+ "6 52 58\r",
+ "6 53 1\r",
+ "6 53 2\r",
+ "6 53 3\r",
+ "6 53 4\r",
+ "6 53 5\r",
+ "6 53 6\r",
+ "6 53 7\r",
+ "6 53 8\r",
+ "6 53 9\r",
+ "6 53 10\r",
+ "6 53 11\r",
+ "6 53 12\r",
+ "6 53 13\r",
+ "6 53 14\r",
+ "6 53 15\r",
+ "6 53 16\r",
+ "6 53 17\r",
+ "6 53 18\r",
+ "6 53 19\r",
+ "6 53 20\r",
+ "6 53 21\r",
+ "6 53 22\r",
+ "6 53 23\r",
+ "6 53 24\r",
+ "6 53 25\r",
+ "6 53 26\r",
+ "6 53 27\r",
+ "6 53 28\r",
+ "6 53 29\r",
+ "6 53 30\r",
+ "6 53 31\r",
+ "6 53 32\r",
+ "6 53 33\r",
+ "6 53 34\r",
+ "6 53 35\r",
+ "6 53 36\r",
+ "6 53 37\r",
+ "6 53 38\r",
+ "6 53 39\r",
+ "6 53 40\r",
+ "6 53 41\r",
+ "6 53 42\r",
+ "6 53 43\r",
+ "6 53 44\r",
+ "6 53 45\r",
+ "6 53 46\r",
+ "6 53 47\r",
+ "6 53 48\r",
+ "6 53 49\r",
+ "6 53 50\r",
+ "6 53 51\r",
+ "6 53 52\r",
+ "6 53 53\r",
+ "6 53 54\r",
+ "6 53 55\r",
+ "6 53 56\r",
+ "6 53 57\r",
+ "6 53 58\r",
+ "6 54 1\r",
+ "6 54 2\r",
+ "6 54 3\r",
+ "6 54 4\r",
+ "6 54 5\r",
+ "6 54 6\r",
+ "6 54 7\r",
+ "6 54 8\r",
+ "6 54 9\r",
+ "6 54 10\r",
+ "6 54 11\r",
+ "6 54 12\r",
+ "6 54 13\r",
+ "6 54 14\r",
+ "6 54 15\r",
+ "6 54 16\r",
+ "6 54 17\r",
+ "6 54 18\r",
+ "6 54 19\r",
+ "6 54 20\r",
+ "6 54 21\r",
+ "6 54 22\r",
+ "6 54 23\r",
+ "6 54 24\r",
+ "6 54 25\r",
+ "6 54 26\r",
+ "6 54 27\r",
+ "6 54 28\r",
+ "6 54 29\r",
+ "6 54 30\r",
+ "6 54 31\r",
+ "6 54 32\r",
+ "6 54 33\r",
+ "6 54 34\r",
+ "6 54 35\r",
+ "6 54 36\r",
+ "6 54 37\r",
+ "6 54 38\r",
+ "6 54 39\r",
+ "6 54 40\r",
+ "6 54 41\r",
+ "6 54 42\r",
+ "6 54 43\r",
+ "6 54 44\r",
+ "6 54 45\r",
+ "6 54 46\r",
+ "6 54 47\r",
+ "6 54 48\r",
+ "6 54 49\r",
+ "6 54 50\r",
+ "6 54 51\r",
+ "6 54 52\r",
+ "6 54 53\r",
+ "6 54 54\r",
+ "6 54 55\r",
+ "6 54 56\r",
+ "6 54 57\r",
+ "6 54 58\r",
+ "6 55 1\r",
+ "6 55 2\r",
+ "6 55 3\r",
+ "6 55 4\r",
+ "6 55 5\r",
+ "6 55 6\r",
+ "6 55 7\r",
+ "6 55 8\r",
+ "6 55 9\r",
+ "6 55 10\r",
+ "6 55 11\r",
+ "6 55 12\r",
+ "6 55 13\r",
+ "6 55 14\r",
+ "6 55 15\r",
+ "6 55 16\r",
+ "6 55 17\r",
+ "6 55 18\r",
+ "6 55 19\r",
+ "6 55 20\r",
+ "6 55 21\r",
+ "6 55 22\r",
+ "6 55 23\r",
+ "6 55 24\r",
+ "6 55 25\r",
+ "6 55 26\r",
+ "6 55 27\r",
+ "6 55 28\r",
+ "6 55 29\r",
+ "6 55 30\r",
+ "6 55 31\r",
+ "6 55 32\r",
+ "6 55 33\r",
+ "6 55 34\r",
+ "6 55 35\r",
+ "6 55 36\r",
+ "6 55 37\r",
+ "6 55 38\r",
+ "6 55 39\r",
+ "6 55 40\r",
+ "6 55 41\r",
+ "6 55 42\r",
+ "6 55 43\r",
+ "6 55 44\r",
+ "6 55 45\r",
+ "6 55 46\r",
+ "6 55 47\r",
+ "6 55 48\r",
+ "6 55 49\r",
+ "6 55 50\r",
+ "6 55 51\r",
+ "6 55 52\r",
+ "6 55 53\r",
+ "6 55 54\r",
+ "6 55 55\r",
+ "6 55 56\r",
+ "6 55 57\r",
+ "6 55 58\r",
+ "6 56 1\r",
+ "6 56 2\r",
+ "6 56 3\r",
+ "6 56 4\r",
+ "6 56 5\r",
+ "6 56 6\r",
+ "6 56 7\r",
+ "6 56 8\r",
+ "6 56 9\r",
+ "6 56 10\r",
+ "6 56 11\r",
+ "6 56 12\r",
+ "6 56 13\r",
+ "6 56 14\r",
+ "6 56 15\r",
+ "6 56 16\r",
+ "6 56 17\r",
+ "6 56 18\r",
+ "6 56 19\r",
+ "6 56 20\r",
+ "6 56 21\r",
+ "6 56 22\r",
+ "6 56 23\r",
+ "6 56 24\r",
+ "6 56 25\r",
+ "6 56 26\r",
+ "6 56 27\r",
+ "6 56 28\r",
+ "6 56 29\r",
+ "6 56 30\r",
+ "6 56 31\r",
+ "6 56 32\r",
+ "6 56 33\r",
+ "6 56 34\r",
+ "6 56 35\r",
+ "6 56 36\r",
+ "6 56 37\r",
+ "6 56 38\r",
+ "6 56 39\r",
+ "6 56 40\r",
+ "6 56 41\r",
+ "6 56 42\r",
+ "6 56 43\r",
+ "6 56 44\r",
+ "6 56 45\r",
+ "6 56 46\r",
+ "6 56 47\r",
+ "6 56 48\r",
+ "6 56 49\r",
+ "6 56 50\r",
+ "6 56 51\r",
+ "6 56 52\r",
+ "6 56 53\r",
+ "6 56 54\r",
+ "6 56 55\r",
+ "6 56 56\r",
+ "6 56 57\r",
+ "6 56 58\r",
+ "6 57 1\r",
+ "6 57 2\r",
+ "6 57 3\r",
+ "6 57 4\r",
+ "6 57 5\r",
+ "6 57 6\r",
+ "6 57 7\r",
+ "6 57 8\r",
+ "6 57 9\r",
+ "6 57 10\r",
+ "6 57 11\r",
+ "6 57 12\r",
+ "6 57 13\r",
+ "6 57 14\r",
+ "6 57 15\r",
+ "6 57 16\r",
+ "6 57 17\r",
+ "6 57 18\r",
+ "6 57 19\r",
+ "6 57 20\r",
+ "6 57 21\r",
+ "6 57 22\r",
+ "6 57 23\r",
+ "6 57 24\r",
+ "6 57 25\r",
+ "6 57 26\r",
+ "6 57 27\r",
+ "6 57 28\r",
+ "6 57 29\r",
+ "6 57 30\r",
+ "6 57 31\r",
+ "6 57 32\r",
+ "6 57 33\r",
+ "6 57 34\r",
+ "6 57 35\r",
+ "6 57 36\r",
+ "6 57 37\r",
+ "6 57 38\r",
+ "6 57 39\r",
+ "6 57 40\r",
+ "6 57 41\r",
+ "6 57 42\r",
+ "6 57 43\r",
+ "6 57 44\r",
+ "6 57 45\r",
+ "6 57 46\r",
+ "6 57 47\r",
+ "6 57 48\r",
+ "6 57 49\r",
+ "6 57 50\r",
+ "6 57 51\r",
+ "6 57 52\r",
+ "6 57 53\r",
+ "6 57 54\r",
+ "6 57 55\r",
+ "6 57 56\r",
+ "6 57 57\r",
+ "6 57 58\r",
+ "6 58 1\r",
+ "6 58 2\r",
+ "6 58 3\r",
+ "6 58 4\r",
+ "6 58 5\r",
+ "6 58 6\r",
+ "6 58 7\r",
+ "6 58 8\r",
+ "6 58 9\r",
+ "6 58 10\r",
+ "6 58 11\r",
+ "6 58 12\r",
+ "6 58 13\r",
+ "6 58 14\r",
+ "6 58 15\r",
+ "6 58 16\r",
+ "6 58 17\r",
+ "6 58 18\r",
+ "6 58 19\r",
+ "6 58 20\r",
+ "6 58 21\r",
+ "6 58 22\r",
+ "6 58 23\r",
+ "6 58 24\r",
+ "6 58 25\r",
+ "6 58 26\r",
+ "6 58 27\r",
+ "6 58 28\r",
+ "6 58 29\r",
+ "6 58 30\r",
+ "6 58 31\r",
+ "6 58 32\r",
+ "6 58 33\r",
+ "6 58 34\r",
+ "6 58 35\r",
+ "6 58 36\r",
+ "6 58 37\r",
+ "6 58 38\r",
+ "6 58 39\r",
+ "6 58 40\r",
+ "6 58 41\r",
+ "6 58 42\r",
+ "6 58 43\r",
+ "6 58 44\r",
+ "6 58 45\r",
+ "6 58 46\r",
+ "6 58 47\r",
+ "6 58 48\r",
+ "6 58 49\r",
+ "6 58 50\r",
+ "6 58 51\r",
+ "6 58 52\r",
+ "6 58 53\r",
+ "6 58 54\r",
+ "6 58 55\r",
+ "6 58 56\r",
+ "6 58 57\r",
+ "6 58 58\r",
+ "7 1 1\r",
+ "7 1 2\r",
+ "7 1 3\r",
+ "7 1 4\r",
+ "7 1 5\r",
+ "7 1 6\r",
+ "7 1 7\r",
+ "7 1 8\r",
+ "7 1 9\r",
+ "7 1 10\r",
+ "7 1 11\r",
+ "7 1 12\r",
+ "7 1 13\r",
+ "7 1 14\r",
+ "7 1 15\r",
+ "7 1 16\r",
+ "7 1 17\r",
+ "7 1 18\r",
+ "7 1 19\r",
+ "7 1 20\r",
+ "7 1 21\r",
+ "7 1 22\r",
+ "7 1 23\r",
+ "7 1 24\r",
+ "7 1 25\r",
+ "7 1 26\r",
+ "7 1 27\r",
+ "7 1 28\r",
+ "7 1 29\r",
+ "7 1 30\r",
+ "7 1 31\r",
+ "7 1 32\r",
+ "7 1 33\r",
+ "7 1 34\r",
+ "7 1 35\r",
+ "7 1 36\r",
+ "7 1 37\r",
+ "7 1 38\r",
+ "7 1 39\r",
+ "7 1 40\r",
+ "7 1 41\r",
+ "7 1 42\r",
+ "7 1 43\r",
+ "7 1 44\r",
+ "7 1 45\r",
+ "7 1 46\r",
+ "7 1 47\r",
+ "7 1 48\r",
+ "7 1 49\r",
+ "7 1 50\r",
+ "7 1 51\r",
+ "7 1 52\r",
+ "7 1 53\r",
+ "7 1 54\r",
+ "7 1 55\r",
+ "7 1 56\r",
+ "7 1 57\r",
+ "7 1 58\r",
+ "7 2 1\r",
+ "7 2 2\r",
+ "7 2 3\r",
+ "7 2 4\r",
+ "7 2 5\r",
+ "7 2 6\r",
+ "7 2 7\r",
+ "7 2 8\r",
+ "7 2 9\r",
+ "7 2 10\r",
+ "7 2 11\r",
+ "7 2 12\r",
+ "7 2 13\r",
+ "7 2 14\r",
+ "7 2 15\r",
+ "7 2 16\r",
+ "7 2 17\r",
+ "7 2 18\r",
+ "7 2 19\r",
+ "7 2 20\r",
+ "7 2 21\r",
+ "7 2 22\r",
+ "7 2 23\r",
+ "7 2 24\r",
+ "7 2 25\r",
+ "7 2 26\r",
+ "7 2 27\r",
+ "7 2 28\r",
+ "7 2 29\r",
+ "7 2 30\r",
+ "7 2 31\r",
+ "7 2 32\r",
+ "7 2 33\r",
+ "7 2 34\r",
+ "7 2 35\r",
+ "7 2 36\r",
+ "7 2 37\r",
+ "7 2 38\r",
+ "7 2 39\r",
+ "7 2 40\r",
+ "7 2 41\r",
+ "7 2 42\r",
+ "7 2 43\r",
+ "7 2 44\r",
+ "7 2 45\r",
+ "7 2 46\r",
+ "7 2 47\r",
+ "7 2 48\r",
+ "7 2 49\r",
+ "7 2 50\r",
+ "7 2 51\r",
+ "7 2 52\r",
+ "7 2 53\r",
+ "7 2 54\r",
+ "7 2 55\r",
+ "7 2 56\r",
+ "7 2 57\r",
+ "7 2 58\r",
+ "7 3 1\r",
+ "7 3 2\r",
+ "7 3 3\r",
+ "7 3 4\r",
+ "7 3 5\r",
+ "7 3 6\r",
+ "7 3 7\r",
+ "7 3 8\r",
+ "7 3 9\r",
+ "7 3 10\r",
+ "7 3 11\r",
+ "7 3 12\r",
+ "7 3 13\r",
+ "7 3 14\r",
+ "7 3 15\r",
+ "7 3 16\r",
+ "7 3 17\r",
+ "7 3 18\r",
+ "7 3 19\r",
+ "7 3 20\r",
+ "7 3 21\r",
+ "7 3 22\r",
+ "7 3 23\r",
+ "7 3 24\r",
+ "7 3 25\r",
+ "7 3 26\r",
+ "7 3 27\r",
+ "7 3 28\r",
+ "7 3 29\r",
+ "7 3 30\r",
+ "7 3 31\r",
+ "7 3 32\r",
+ "7 3 33\r",
+ "7 3 34\r",
+ "7 3 35\r",
+ "7 3 36\r",
+ "7 3 37\r",
+ "7 3 38\r",
+ "7 3 39\r",
+ "7 3 40\r",
+ "7 3 41\r",
+ "7 3 42\r",
+ "7 3 43\r",
+ "7 3 44\r",
+ "7 3 45\r",
+ "7 3 46\r",
+ "7 3 47\r",
+ "7 3 48\r",
+ "7 3 49\r",
+ "7 3 50\r",
+ "7 3 51\r",
+ "7 3 52\r",
+ "7 3 53\r",
+ "7 3 54\r",
+ "7 3 55\r",
+ "7 3 56\r",
+ "7 3 57\r",
+ "7 3 58\r",
+ "7 4 1\r",
+ "7 4 2\r",
+ "7 4 3\r",
+ "7 4 4\r",
+ "7 4 5\r",
+ "7 4 6\r",
+ "7 4 7\r",
+ "7 4 8\r",
+ "7 4 9\r",
+ "7 4 10\r",
+ "7 4 11\r",
+ "7 4 12\r",
+ "7 4 13\r",
+ "7 4 14\r",
+ "7 4 15\r",
+ "7 4 16\r",
+ "7 4 17\r",
+ "7 4 18\r",
+ "7 4 19\r",
+ "7 4 20\r",
+ "7 4 21\r",
+ "7 4 22\r",
+ "7 4 23\r",
+ "7 4 24\r",
+ "7 4 25\r",
+ "7 4 26\r",
+ "7 4 27\r",
+ "7 4 28\r",
+ "7 4 29\r",
+ "7 4 30\r",
+ "7 4 31\r",
+ "7 4 32\r",
+ "7 4 33\r",
+ "7 4 34\r",
+ "7 4 35\r",
+ "7 4 36\r",
+ "7 4 37\r",
+ "7 4 38\r",
+ "7 4 39\r",
+ "7 4 40\r",
+ "7 4 41\r",
+ "7 4 42\r",
+ "7 4 43\r",
+ "7 4 44\r",
+ "7 4 45\r",
+ "7 4 46\r",
+ "7 4 47\r",
+ "7 4 48\r",
+ "7 4 49\r",
+ "7 4 50\r",
+ "7 4 51\r",
+ "7 4 52\r",
+ "7 4 53\r",
+ "7 4 54\r",
+ "7 4 55\r",
+ "7 4 56\r",
+ "7 4 57\r",
+ "7 4 58\r",
+ "7 5 1\r",
+ "7 5 2\r",
+ "7 5 3\r",
+ "7 5 4\r",
+ "7 5 5\r",
+ "7 5 6\r",
+ "7 5 7\r",
+ "7 5 8\r",
+ "7 5 9\r",
+ "7 5 10\r",
+ "7 5 11\r",
+ "7 5 12\r",
+ "7 5 13\r",
+ "7 5 14\r",
+ "7 5 15\r",
+ "7 5 16\r",
+ "7 5 17\r",
+ "7 5 18\r",
+ "7 5 19\r",
+ "7 5 20\r",
+ "7 5 21\r",
+ "7 5 22\r",
+ "7 5 23\r",
+ "7 5 24\r",
+ "7 5 25\r",
+ "7 5 26\r",
+ "7 5 27\r",
+ "7 5 28\r",
+ "7 5 29\r",
+ "7 5 30\r",
+ "7 5 31\r",
+ "7 5 32\r",
+ "7 5 33\r",
+ "7 5 34\r",
+ "7 5 35\r",
+ "7 5 36\r",
+ "7 5 37\r",
+ "7 5 38\r",
+ "7 5 39\r",
+ "7 5 40\r",
+ "7 5 41\r",
+ "7 5 42\r",
+ "7 5 43\r",
+ "7 5 44\r",
+ "7 5 45\r",
+ "7 5 46\r",
+ "7 5 47\r",
+ "7 5 48\r",
+ "7 5 49\r",
+ "7 5 50\r",
+ "7 5 51\r",
+ "7 5 52\r",
+ "7 5 53\r",
+ "7 5 54\r",
+ "7 5 55\r",
+ "7 5 56\r",
+ "7 5 57\r",
+ "7 5 58\r",
+ "7 6 1\r",
+ "7 6 2\r",
+ "7 6 3\r",
+ "7 6 4\r",
+ "7 6 5\r",
+ "7 6 6\r",
+ "7 6 7\r",
+ "7 6 8\r",
+ "7 6 9\r",
+ "7 6 10\r",
+ "7 6 11\r",
+ "7 6 12\r",
+ "7 6 13\r",
+ "7 6 14\r",
+ "7 6 15\r",
+ "7 6 16\r",
+ "7 6 17\r",
+ "7 6 18\r",
+ "7 6 19\r",
+ "7 6 20\r",
+ "7 6 21\r",
+ "7 6 22\r",
+ "7 6 23\r",
+ "7 6 24\r",
+ "7 6 25\r",
+ "7 6 26\r",
+ "7 6 27\r",
+ "7 6 28\r",
+ "7 6 29\r",
+ "7 6 30\r",
+ "7 6 31\r",
+ "7 6 32\r",
+ "7 6 33\r",
+ "7 6 34\r",
+ "7 6 35\r",
+ "7 6 36\r",
+ "7 6 37\r",
+ "7 6 38\r",
+ "7 6 39\r",
+ "7 6 40\r",
+ "7 6 41\r",
+ "7 6 42\r",
+ "7 6 43\r",
+ "7 6 44\r",
+ "7 6 45\r",
+ "7 6 46\r",
+ "7 6 47\r",
+ "7 6 48\r",
+ "7 6 49\r",
+ "7 6 50\r",
+ "7 6 51\r",
+ "7 6 52\r",
+ "7 6 53\r",
+ "7 6 54\r",
+ "7 6 55\r",
+ "7 6 56\r",
+ "7 6 57\r",
+ "7 6 58\r",
+ "7 7 1\r",
+ "7 7 2\r",
+ "7 7 3\r",
+ "7 7 4\r",
+ "7 7 5\r",
+ "7 7 6\r",
+ "7 7 7\r",
+ "7 7 8\r",
+ "7 7 9\r",
+ "7 7 10\r",
+ "7 7 11\r",
+ "7 7 12\r",
+ "7 7 13\r",
+ "7 7 14\r",
+ "7 7 15\r",
+ "7 7 16\r",
+ "7 7 17\r",
+ "7 7 18\r",
+ "7 7 19\r",
+ "7 7 20\r",
+ "7 7 21\r",
+ "7 7 22\r",
+ "7 7 23\r",
+ "7 7 24\r",
+ "7 7 25\r",
+ "7 7 26\r",
+ "7 7 27\r",
+ "7 7 28\r",
+ "7 7 29\r",
+ "7 7 30\r",
+ "7 7 31\r",
+ "7 7 32\r",
+ "7 7 33\r",
+ "7 7 34\r",
+ "7 7 35\r",
+ "7 7 36\r",
+ "7 7 37\r",
+ "7 7 38\r",
+ "7 7 39\r",
+ "7 7 40\r",
+ "7 7 41\r",
+ "7 7 42\r",
+ "7 7 43\r",
+ "7 7 44\r",
+ "7 7 45\r",
+ "7 7 46\r",
+ "7 7 47\r",
+ "7 7 48\r",
+ "7 7 49\r",
+ "7 7 50\r",
+ "7 7 51\r",
+ "7 7 52\r",
+ "7 7 53\r",
+ "7 7 54\r",
+ "7 7 55\r",
+ "7 7 56\r",
+ "7 7 57\r",
+ "7 7 58\r",
+ "7 8 1\r",
+ "7 8 2\r",
+ "7 8 3\r",
+ "7 8 4\r",
+ "7 8 5\r",
+ "7 8 6\r",
+ "7 8 7\r",
+ "7 8 8\r",
+ "7 8 9\r",
+ "7 8 10\r",
+ "7 8 11\r",
+ "7 8 12\r",
+ "7 8 13\r",
+ "7 8 14\r",
+ "7 8 15\r",
+ "7 8 16\r",
+ "7 8 17\r",
+ "7 8 18\r",
+ "7 8 19\r",
+ "7 8 20\r",
+ "7 8 21\r",
+ "7 8 22\r",
+ "7 8 23\r",
+ "7 8 24\r",
+ "7 8 25\r",
+ "7 8 26\r",
+ "7 8 27\r",
+ "7 8 28\r",
+ "7 8 29\r",
+ "7 8 30\r",
+ "7 8 31\r",
+ "7 8 32\r",
+ "7 8 33\r",
+ "7 8 34\r",
+ "7 8 35\r",
+ "7 8 36\r",
+ "7 8 37\r",
+ "7 8 38\r",
+ "7 8 39\r",
+ "7 8 40\r",
+ "7 8 41\r",
+ "7 8 42\r",
+ "7 8 43\r",
+ "7 8 44\r",
+ "7 8 45\r",
+ "7 8 46\r",
+ "7 8 47\r",
+ "7 8 48\r",
+ "7 8 49\r",
+ "7 8 50\r",
+ "7 8 51\r",
+ "7 8 52\r",
+ "7 8 53\r",
+ "7 8 54\r",
+ "7 8 55\r",
+ "7 8 56\r",
+ "7 8 57\r",
+ "7 8 58\r",
+ "7 9 1\r",
+ "7 9 2\r",
+ "7 9 3\r",
+ "7 9 4\r",
+ "7 9 5\r",
+ "7 9 6\r",
+ "7 9 7\r",
+ "7 9 8\r",
+ "7 9 9\r",
+ "7 9 10\r",
+ "7 9 11\r",
+ "7 9 12\r",
+ "7 9 13\r",
+ "7 9 14\r",
+ "7 9 15\r",
+ "7 9 16\r",
+ "7 9 17\r",
+ "7 9 18\r",
+ "7 9 19\r",
+ "7 9 20\r",
+ "7 9 21\r",
+ "7 9 22\r",
+ "7 9 23\r",
+ "7 9 24\r",
+ "7 9 25\r",
+ "7 9 26\r",
+ "7 9 27\r",
+ "7 9 28\r",
+ "7 9 29\r",
+ "7 9 30\r",
+ "7 9 31\r",
+ "7 9 32\r",
+ "7 9 33\r",
+ "7 9 34\r",
+ "7 9 35\r",
+ "7 9 36\r",
+ "7 9 37\r",
+ "7 9 38\r",
+ "7 9 39\r",
+ "7 9 40\r",
+ "7 9 41\r",
+ "7 9 42\r",
+ "7 9 43\r",
+ "7 9 44\r",
+ "7 9 45\r",
+ "7 9 46\r",
+ "7 9 47\r",
+ "7 9 48\r",
+ "7 9 49\r",
+ "7 9 50\r",
+ "7 9 51\r",
+ "7 9 52\r",
+ "7 9 53\r",
+ "7 9 54\r",
+ "7 9 55\r",
+ "7 9 56\r",
+ "7 9 57\r",
+ "7 9 58\r",
+ "7 10 1\r",
+ "7 10 2\r",
+ "7 10 3\r",
+ "7 10 4\r",
+ "7 10 5\r",
+ "7 10 6\r",
+ "7 10 7\r",
+ "7 10 8\r",
+ "7 10 9\r",
+ "7 10 10\r",
+ "7 10 11\r",
+ "7 10 12\r",
+ "7 10 13\r",
+ "7 10 14\r",
+ "7 10 15\r",
+ "7 10 16\r",
+ "7 10 17\r",
+ "7 10 18\r",
+ "7 10 19\r",
+ "7 10 20\r",
+ "7 10 21\r",
+ "7 10 22\r",
+ "7 10 23\r",
+ "7 10 24\r",
+ "7 10 25\r",
+ "7 10 26\r",
+ "7 10 27"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "7 10 28\r",
+ "7 10 29\r",
+ "7 10 30\r",
+ "7 10 31\r",
+ "7 10 32\r",
+ "7 10 33\r",
+ "7 10 34\r",
+ "7 10 35\r",
+ "7 10 36\r",
+ "7 10 37\r",
+ "7 10 38\r",
+ "7 10 39\r",
+ "7 10 40\r",
+ "7 10 41\r",
+ "7 10 42\r",
+ "7 10 43\r",
+ "7 10 44\r",
+ "7 10 45\r",
+ "7 10 46\r",
+ "7 10 47\r",
+ "7 10 48\r",
+ "7 10 49\r",
+ "7 10 50\r",
+ "7 10 51\r",
+ "7 10 52\r",
+ "7 10 53\r",
+ "7 10 54\r",
+ "7 10 55\r",
+ "7 10 56\r",
+ "7 10 57\r",
+ "7 10 58\r",
+ "7 11 1\r",
+ "7 11 2\r",
+ "7 11 3\r",
+ "7 11 4\r",
+ "7 11 5\r",
+ "7 11 6\r",
+ "7 11 7\r",
+ "7 11 8\r",
+ "7 11 9\r",
+ "7 11 10\r",
+ "7 11 11\r",
+ "7 11 12\r",
+ "7 11 13\r",
+ "7 11 14\r",
+ "7 11 15\r",
+ "7 11 16\r",
+ "7 11 17\r",
+ "7 11 18\r",
+ "7 11 19\r",
+ "7 11 20\r",
+ "7 11 21\r",
+ "7 11 22\r",
+ "7 11 23\r",
+ "7 11 24\r",
+ "7 11 25\r",
+ "7 11 26\r",
+ "7 11 27\r",
+ "7 11 28\r",
+ "7 11 29\r",
+ "7 11 30\r",
+ "7 11 31\r",
+ "7 11 32\r",
+ "7 11 33\r",
+ "7 11 34\r",
+ "7 11 35\r",
+ "7 11 36\r",
+ "7 11 37\r",
+ "7 11 38\r",
+ "7 11 39\r",
+ "7 11 40\r",
+ "7 11 41\r",
+ "7 11 42\r",
+ "7 11 43\r",
+ "7 11 44\r",
+ "7 11 45\r",
+ "7 11 46\r",
+ "7 11 47\r",
+ "7 11 48\r",
+ "7 11 49\r",
+ "7 11 50\r",
+ "7 11 51\r",
+ "7 11 52\r",
+ "7 11 53\r",
+ "7 11 54\r",
+ "7 11 55\r",
+ "7 11 56\r",
+ "7 11 57\r",
+ "7 11 58\r",
+ "7 12 1\r",
+ "7 12 2\r",
+ "7 12 3\r",
+ "7 12 4\r",
+ "7 12 5\r",
+ "7 12 6\r",
+ "7 12 7\r",
+ "7 12 8\r",
+ "7 12 9\r",
+ "7 12 10\r",
+ "7 12 11\r",
+ "7 12 12\r",
+ "7 12 13\r",
+ "7 12 14\r",
+ "7 12 15\r",
+ "7 12 16\r",
+ "7 12 17\r",
+ "7 12 18\r",
+ "7 12 19\r",
+ "7 12 20\r",
+ "7 12 21\r",
+ "7 12 22\r",
+ "7 12 23\r",
+ "7 12 24\r",
+ "7 12 25\r",
+ "7 12 26\r",
+ "7 12 27\r",
+ "7 12 28\r",
+ "7 12 29\r",
+ "7 12 30\r",
+ "7 12 31\r",
+ "7 12 32\r",
+ "7 12 33\r",
+ "7 12 34\r",
+ "7 12 35\r",
+ "7 12 36\r",
+ "7 12 37\r",
+ "7 12 38\r",
+ "7 12 39\r",
+ "7 12 40\r",
+ "7 12 41\r",
+ "7 12 42\r",
+ "7 12 43\r",
+ "7 12 44\r",
+ "7 12 45\r",
+ "7 12 46\r",
+ "7 12 47\r",
+ "7 12 48\r",
+ "7 12 49\r",
+ "7 12 50\r",
+ "7 12 51\r",
+ "7 12 52\r",
+ "7 12 53\r",
+ "7 12 54\r",
+ "7 12 55\r",
+ "7 12 56\r",
+ "7 12 57\r",
+ "7 12 58\r",
+ "7 13 1\r",
+ "7 13 2\r",
+ "7 13 3\r",
+ "7 13 4\r",
+ "7 13 5\r",
+ "7 13 6\r",
+ "7 13 7\r",
+ "7 13 8\r",
+ "7 13 9\r",
+ "7 13 10\r",
+ "7 13 11\r",
+ "7 13 12\r",
+ "7 13 13\r",
+ "7 13 14\r",
+ "7 13 15\r",
+ "7 13 16\r",
+ "7 13 17\r",
+ "7 13 18\r",
+ "7 13 19\r",
+ "7 13 20\r",
+ "7 13 21\r",
+ "7 13 22\r",
+ "7 13 23\r",
+ "7 13 24\r",
+ "7 13 25\r",
+ "7 13 26\r",
+ "7 13 27\r",
+ "7 13 28\r",
+ "7 13 29\r",
+ "7 13 30\r",
+ "7 13 31\r",
+ "7 13 32\r",
+ "7 13 33\r",
+ "7 13 34\r",
+ "7 13 35\r",
+ "7 13 36\r",
+ "7 13 37\r",
+ "7 13 38\r",
+ "7 13 39\r",
+ "7 13 40\r",
+ "7 13 41\r",
+ "7 13 42\r",
+ "7 13 43\r",
+ "7 13 44\r",
+ "7 13 45\r",
+ "7 13 46\r",
+ "7 13 47\r",
+ "7 13 48\r",
+ "7 13 49\r",
+ "7 13 50\r",
+ "7 13 51\r",
+ "7 13 52\r",
+ "7 13 53\r",
+ "7 13 54\r",
+ "7 13 55\r",
+ "7 13 56\r",
+ "7 13 57\r",
+ "7 13 58\r",
+ "7 14 1\r",
+ "7 14 2\r",
+ "7 14 3\r",
+ "7 14 4\r",
+ "7 14 5\r",
+ "7 14 6\r",
+ "7 14 7\r",
+ "7 14 8\r",
+ "7 14 9\r",
+ "7 14 10\r",
+ "7 14 11\r",
+ "7 14 12\r",
+ "7 14 13\r",
+ "7 14 14\r",
+ "7 14 15\r",
+ "7 14 16\r",
+ "7 14 17\r",
+ "7 14 18\r",
+ "7 14 19\r",
+ "7 14 20\r",
+ "7 14 21\r",
+ "7 14 22\r",
+ "7 14 23\r",
+ "7 14 24\r",
+ "7 14 25\r",
+ "7 14 26\r",
+ "7 14 27\r",
+ "7 14 28\r",
+ "7 14 29\r",
+ "7 14 30\r",
+ "7 14 31\r",
+ "7 14 32\r",
+ "7 14 33\r",
+ "7 14 34\r",
+ "7 14 35\r",
+ "7 14 36\r",
+ "7 14 37\r",
+ "7 14 38\r",
+ "7 14 39\r",
+ "7 14 40\r",
+ "7 14 41\r",
+ "7 14 42\r",
+ "7 14 43\r",
+ "7 14 44\r",
+ "7 14 45\r",
+ "7 14 46\r",
+ "7 14 47\r",
+ "7 14 48\r",
+ "7 14 49\r",
+ "7 14 50\r",
+ "7 14 51\r",
+ "7 14 52\r",
+ "7 14 53\r",
+ "7 14 54\r",
+ "7 14 55\r",
+ "7 14 56\r",
+ "7 14 57\r",
+ "7 14 58\r",
+ "7 15 1\r",
+ "7 15 2\r",
+ "7 15 3\r",
+ "7 15 4\r",
+ "7 15 5\r",
+ "7 15 6\r",
+ "7 15 7\r",
+ "7 15 8\r",
+ "7 15 9\r",
+ "7 15 10\r",
+ "7 15 11\r",
+ "7 15 12\r",
+ "7 15 13\r",
+ "7 15 14\r",
+ "7 15 15\r",
+ "7 15 16\r",
+ "7 15 17\r",
+ "7 15 18\r",
+ "7 15 19\r",
+ "7 15 20\r",
+ "7 15 21\r",
+ "7 15 22\r",
+ "7 15 23\r",
+ "7 15 24\r",
+ "7 15 25\r",
+ "7 15 26\r",
+ "7 15 27\r",
+ "7 15 28\r",
+ "7 15 29\r",
+ "7 15 30\r",
+ "7 15 31\r",
+ "7 15 32\r",
+ "7 15 33\r",
+ "7 15 34\r",
+ "7 15 35\r",
+ "7 15 36\r",
+ "7 15 37\r",
+ "7 15 38\r",
+ "7 15 39\r",
+ "7 15 40\r",
+ "7 15 41\r",
+ "7 15 42\r",
+ "7 15 43\r",
+ "7 15 44\r",
+ "7 15 45\r",
+ "7 15 46\r",
+ "7 15 47\r",
+ "7 15 48\r",
+ "7 15 49\r",
+ "7 15 50\r",
+ "7 15 51\r",
+ "7 15 52\r",
+ "7 15 53\r",
+ "7 15 54\r",
+ "7 15 55\r",
+ "7 15 56\r",
+ "7 15 57\r",
+ "7 15 58\r",
+ "7 16 1\r",
+ "7 16 2\r",
+ "7 16 3\r",
+ "7 16 4\r",
+ "7 16 5\r",
+ "7 16 6\r",
+ "7 16 7\r",
+ "7 16 8\r",
+ "7 16 9\r",
+ "7 16 10\r",
+ "7 16 11\r",
+ "7 16 12\r",
+ "7 16 13\r",
+ "7 16 14\r",
+ "7 16 15\r",
+ "7 16 16\r",
+ "7 16 17\r",
+ "7 16 18\r",
+ "7 16 19\r",
+ "7 16 20\r",
+ "7 16 21\r",
+ "7 16 22\r",
+ "7 16 23\r",
+ "7 16 24\r",
+ "7 16 25\r",
+ "7 16 26\r",
+ "7 16 27\r",
+ "7 16 28\r",
+ "7 16 29\r",
+ "7 16 30\r",
+ "7 16 31\r",
+ "7 16 32\r",
+ "7 16 33\r",
+ "7 16 34\r",
+ "7 16 35\r",
+ "7 16 36\r",
+ "7 16 37\r",
+ "7 16 38\r",
+ "7 16 39\r",
+ "7 16 40\r",
+ "7 16 41\r",
+ "7 16 42\r",
+ "7 16 43\r",
+ "7 16 44\r",
+ "7 16 45\r",
+ "7 16 46\r",
+ "7 16 47\r",
+ "7 16 48\r",
+ "7 16 49\r",
+ "7 16 50\r",
+ "7 16 51\r",
+ "7 16 52\r",
+ "7 16 53\r",
+ "7 16 54\r",
+ "7 16 55\r",
+ "7 16 56\r",
+ "7 16 57\r",
+ "7 16 58\r",
+ "7 17 1\r",
+ "7 17 2\r",
+ "7 17 3\r",
+ "7 17 4\r",
+ "7 17 5\r",
+ "7 17 6\r",
+ "7 17 7\r",
+ "7 17 8\r",
+ "7 17 9\r",
+ "7 17 10\r",
+ "7 17 11\r",
+ "7 17 12\r",
+ "7 17 13\r",
+ "7 17 14\r",
+ "7 17 15\r",
+ "7 17 16\r",
+ "7 17 17\r",
+ "7 17 18\r",
+ "7 17 19\r",
+ "7 17 20\r",
+ "7 17 21\r",
+ "7 17 22\r",
+ "7 17 23\r",
+ "7 17 24\r",
+ "7 17 25\r",
+ "7 17 26\r",
+ "7 17 27\r",
+ "7 17 28\r",
+ "7 17 29\r",
+ "7 17 30\r",
+ "7 17 31\r",
+ "7 17 32\r",
+ "7 17 33\r",
+ "7 17 34\r",
+ "7 17 35\r",
+ "7 17 36\r",
+ "7 17 37\r",
+ "7 17 38\r",
+ "7 17 39\r",
+ "7 17 40\r",
+ "7 17 41\r",
+ "7 17 42\r",
+ "7 17 43\r",
+ "7 17 44\r",
+ "7 17 45\r",
+ "7 17 46\r",
+ "7 17 47\r",
+ "7 17 48\r",
+ "7 17 49\r",
+ "7 17 50\r",
+ "7 17 51\r",
+ "7 17 52\r",
+ "7 17 53\r",
+ "7 17 54\r",
+ "7 17 55\r",
+ "7 17 56\r",
+ "7 17 57\r",
+ "7 17 58\r",
+ "7 18 1\r",
+ "7 18 2\r",
+ "7 18 3\r",
+ "7 18 4\r",
+ "7 18 5\r",
+ "7 18 6\r",
+ "7 18 7\r",
+ "7 18 8\r",
+ "7 18 9\r",
+ "7 18 10\r",
+ "7 18 11\r",
+ "7 18 12\r",
+ "7 18 13\r",
+ "7 18 14\r",
+ "7 18 15\r",
+ "7 18 16\r",
+ "7 18 17\r",
+ "7 18 18\r",
+ "7 18 19\r",
+ "7 18 20\r",
+ "7 18 21\r",
+ "7 18 22\r",
+ "7 18 23\r",
+ "7 18 24\r",
+ "7 18 25\r",
+ "7 18 26\r",
+ "7 18 27\r",
+ "7 18 28\r",
+ "7 18 29\r",
+ "7 18 30\r",
+ "7 18 31\r",
+ "7 18 32\r",
+ "7 18 33\r",
+ "7 18 34\r",
+ "7 18 35\r",
+ "7 18 36\r",
+ "7 18 37\r",
+ "7 18 38\r",
+ "7 18 39\r",
+ "7 18 40\r",
+ "7 18 41\r",
+ "7 18 42\r",
+ "7 18 43\r",
+ "7 18 44\r",
+ "7 18 45\r",
+ "7 18 46\r",
+ "7 18 47\r",
+ "7 18 48\r",
+ "7 18 49\r",
+ "7 18 50\r",
+ "7 18 51\r",
+ "7 18 52\r",
+ "7 18 53\r",
+ "7 18 54\r",
+ "7 18 55\r",
+ "7 18 56\r",
+ "7 18 57\r",
+ "7 18 58\r",
+ "7 19 1\r",
+ "7 19 2\r",
+ "7 19 3\r",
+ "7 19 4\r",
+ "7 19 5\r",
+ "7 19 6\r",
+ "7 19 7\r",
+ "7 19 8\r",
+ "7 19 9\r",
+ "7 19 10\r",
+ "7 19 11\r",
+ "7 19 12\r",
+ "7 19 13\r",
+ "7 19 14\r",
+ "7 19 15\r",
+ "7 19 16\r",
+ "7 19 17\r",
+ "7 19 18\r",
+ "7 19 19\r",
+ "7 19 20\r",
+ "7 19 21\r",
+ "7 19 22\r",
+ "7 19 23\r",
+ "7 19 24\r",
+ "7 19 25\r",
+ "7 19 26\r",
+ "7 19 27\r",
+ "7 19 28\r",
+ "7 19 29\r",
+ "7 19 30\r",
+ "7 19 31\r",
+ "7 19 32\r",
+ "7 19 33\r",
+ "7 19 34\r",
+ "7 19 35\r",
+ "7 19 36\r",
+ "7 19 37\r",
+ "7 19 38\r",
+ "7 19 39\r",
+ "7 19 40\r",
+ "7 19 41\r",
+ "7 19 42\r",
+ "7 19 43\r",
+ "7 19 44\r",
+ "7 19 45\r",
+ "7 19 46\r",
+ "7 19 47\r",
+ "7 19 48\r",
+ "7 19 49\r",
+ "7 19 50\r",
+ "7 19 51\r",
+ "7 19 52\r",
+ "7 19 53\r",
+ "7 19 54\r",
+ "7 19 55\r",
+ "7 19 56\r",
+ "7 19 57\r",
+ "7 19 58\r",
+ "7 20 1\r",
+ "7 20 2\r",
+ "7 20 3\r",
+ "7 20 4\r",
+ "7 20 5\r",
+ "7 20 6\r",
+ "7 20 7\r",
+ "7 20 8\r",
+ "7 20 9\r",
+ "7 20 10\r",
+ "7 20 11\r",
+ "7 20 12\r",
+ "7 20 13\r",
+ "7 20 14\r",
+ "7 20 15\r",
+ "7 20 16\r",
+ "7 20 17\r",
+ "7 20 18\r",
+ "7 20 19\r",
+ "7 20 20\r",
+ "7 20 21\r",
+ "7 20 22\r",
+ "7 20 23\r",
+ "7 20 24\r",
+ "7 20 25\r",
+ "7 20 26\r",
+ "7 20 27\r",
+ "7 20 28\r",
+ "7 20 29\r",
+ "7 20 30\r",
+ "7 20 31\r",
+ "7 20 32\r",
+ "7 20 33\r",
+ "7 20 34\r",
+ "7 20 35\r",
+ "7 20 36\r",
+ "7 20 37\r",
+ "7 20 38\r",
+ "7 20 39\r",
+ "7 20 40\r",
+ "7 20 41\r",
+ "7 20 42\r",
+ "7 20 43\r",
+ "7 20 44\r",
+ "7 20 45\r",
+ "7 20 46\r",
+ "7 20 47\r",
+ "7 20 48\r",
+ "7 20 49\r",
+ "7 20 50\r",
+ "7 20 51\r",
+ "7 20 52\r",
+ "7 20 53\r",
+ "7 20 54\r",
+ "7 20 55\r",
+ "7 20 56\r",
+ "7 20 57\r",
+ "7 20 58\r",
+ "7 21 1\r",
+ "7 21 2\r",
+ "7 21 3\r",
+ "7 21 4\r",
+ "7 21 5\r",
+ "7 21 6\r",
+ "7 21 7\r",
+ "7 21 8\r",
+ "7 21 9\r",
+ "7 21 10\r",
+ "7 21 11\r",
+ "7 21 12\r",
+ "7 21 13\r",
+ "7 21 14\r",
+ "7 21 15\r",
+ "7 21 16\r",
+ "7 21 17\r",
+ "7 21 18\r",
+ "7 21 19\r",
+ "7 21 20\r",
+ "7 21 21\r",
+ "7 21 22\r",
+ "7 21 23\r",
+ "7 21 24\r",
+ "7 21 25\r",
+ "7 21 26\r",
+ "7 21 27\r",
+ "7 21 28\r",
+ "7 21 29\r",
+ "7 21 30\r",
+ "7 21 31\r",
+ "7 21 32\r",
+ "7 21 33\r",
+ "7 21 34\r",
+ "7 21 35\r",
+ "7 21 36\r",
+ "7 21 37\r",
+ "7 21 38\r",
+ "7 21 39\r",
+ "7 21 40\r",
+ "7 21 41\r",
+ "7 21 42\r",
+ "7 21 43\r",
+ "7 21 44\r",
+ "7 21 45\r",
+ "7 21 46\r",
+ "7 21 47\r",
+ "7 21 48\r",
+ "7 21 49\r",
+ "7 21 50\r",
+ "7 21 51\r",
+ "7 21 52\r",
+ "7 21 53\r",
+ "7 21 54\r",
+ "7 21 55\r",
+ "7 21 56\r",
+ "7 21 57\r",
+ "7 21 58\r",
+ "7 22 1\r",
+ "7 22 2\r",
+ "7 22 3\r",
+ "7 22 4\r",
+ "7 22 5\r",
+ "7 22 6\r",
+ "7 22 7\r",
+ "7 22 8\r",
+ "7 22 9\r",
+ "7 22 10\r",
+ "7 22 11\r",
+ "7 22 12\r",
+ "7 22 13\r",
+ "7 22 14\r",
+ "7 22 15\r",
+ "7 22 16\r",
+ "7 22 17\r",
+ "7 22 18\r",
+ "7 22 19\r",
+ "7 22 20\r",
+ "7 22 21\r",
+ "7 22 22\r",
+ "7 22 23\r",
+ "7 22 24\r",
+ "7 22 25\r",
+ "7 22 26\r",
+ "7 22 27\r",
+ "7 22 28\r",
+ "7 22 29\r",
+ "7 22 30\r",
+ "7 22 31\r",
+ "7 22 32\r",
+ "7 22 33\r",
+ "7 22 34\r",
+ "7 22 35\r",
+ "7 22 36\r",
+ "7 22 37\r",
+ "7 22 38\r",
+ "7 22 39\r",
+ "7 22 40\r",
+ "7 22 41\r",
+ "7 22 42\r",
+ "7 22 43\r",
+ "7 22 44\r",
+ "7 22 45\r",
+ "7 22 46\r",
+ "7 22 47\r",
+ "7 22 48\r",
+ "7 22 49\r",
+ "7 22 50\r",
+ "7 22 51\r",
+ "7 22 52\r",
+ "7 22 53\r",
+ "7 22 54\r",
+ "7 22 55\r",
+ "7 22 56\r",
+ "7 22 57\r",
+ "7 22 58\r",
+ "7 23 1\r",
+ "7 23 2\r",
+ "7 23 3\r",
+ "7 23 4\r",
+ "7 23 5\r",
+ "7 23 6\r",
+ "7 23 7\r",
+ "7 23 8\r",
+ "7 23 9\r",
+ "7 23 10\r",
+ "7 23 11\r",
+ "7 23 12\r",
+ "7 23 13\r",
+ "7 23 14\r",
+ "7 23 15\r",
+ "7 23 16\r",
+ "7 23 17\r",
+ "7 23 18\r",
+ "7 23 19\r",
+ "7 23 20\r",
+ "7 23 21\r",
+ "7 23 22\r",
+ "7 23 23\r",
+ "7 23 24\r",
+ "7 23 25\r",
+ "7 23 26\r",
+ "7 23 27\r",
+ "7 23 28\r",
+ "7 23 29\r",
+ "7 23 30\r",
+ "7 23 31\r",
+ "7 23 32\r",
+ "7 23 33\r",
+ "7 23 34\r",
+ "7 23 35\r",
+ "7 23 36\r",
+ "7 23 37\r",
+ "7 23 38\r",
+ "7 23 39\r",
+ "7 23 40\r",
+ "7 23 41\r",
+ "7 23 42\r",
+ "7 23 43\r",
+ "7 23 44\r",
+ "7 23 45\r",
+ "7 23 46\r",
+ "7 23 47\r",
+ "7 23 48\r",
+ "7 23 49\r",
+ "7 23 50\r",
+ "7 23 51\r",
+ "7 23 52\r",
+ "7 23 53\r",
+ "7 23 54\r",
+ "7 23 55\r",
+ "7 23 56\r",
+ "7 23 57\r",
+ "7 23 58\r",
+ "7 24 1\r",
+ "7 24 2\r",
+ "7 24 3\r",
+ "7 24 4\r",
+ "7 24 5\r",
+ "7 24 6\r",
+ "7 24 7\r",
+ "7 24 8\r",
+ "7 24 9\r",
+ "7 24 10\r",
+ "7 24 11\r",
+ "7 24 12\r",
+ "7 24 13\r",
+ "7 24 14\r",
+ "7 24 15\r",
+ "7 24 16\r",
+ "7 24 17\r",
+ "7 24 18\r",
+ "7 24 19\r",
+ "7 24 20\r",
+ "7 24 21\r",
+ "7 24 22\r",
+ "7 24 23\r",
+ "7 24 24\r",
+ "7 24 25\r",
+ "7 24 26\r",
+ "7 24 27\r",
+ "7 24 28\r",
+ "7 24 29\r",
+ "7 24 30\r",
+ "7 24 31\r",
+ "7 24 32\r",
+ "7 24 33\r",
+ "7 24 34\r",
+ "7 24 35\r",
+ "7 24 36\r",
+ "7 24 37\r",
+ "7 24 38\r",
+ "7 24 39\r",
+ "7 24 40\r",
+ "7 24 41\r",
+ "7 24 42\r",
+ "7 24 43\r",
+ "7 24 44\r",
+ "7 24 45\r",
+ "7 24 46\r",
+ "7 24 47\r",
+ "7 24 48\r",
+ "7 24 49\r",
+ "7 24 50\r",
+ "7 24 51\r",
+ "7 24 52\r",
+ "7 24 53\r",
+ "7 24 54\r",
+ "7 24 55\r",
+ "7 24 56\r",
+ "7 24 57\r",
+ "7 24 58\r",
+ "7 25 1\r",
+ "7 25 2\r",
+ "7 25 3\r",
+ "7 25 4\r",
+ "7 25 5\r",
+ "7 25 6\r",
+ "7 25 7\r",
+ "7 25 8\r",
+ "7 25 9\r",
+ "7 25 10\r",
+ "7 25 11\r",
+ "7 25 12\r",
+ "7 25 13\r",
+ "7 25 14\r",
+ "7 25 15\r",
+ "7 25 16\r",
+ "7 25 17\r",
+ "7 25 18\r",
+ "7 25 19\r",
+ "7 25 20\r",
+ "7 25 21\r",
+ "7 25 22\r",
+ "7 25 23\r",
+ "7 25 24\r",
+ "7 25 25\r",
+ "7 25 26\r",
+ "7 25 27\r",
+ "7 25 28\r",
+ "7 25 29\r",
+ "7 25 30\r",
+ "7 25 31\r",
+ "7 25 32\r",
+ "7 25 33\r",
+ "7 25 34\r",
+ "7 25 35\r",
+ "7 25 36\r",
+ "7 25 37\r",
+ "7 25 38\r",
+ "7 25 39\r",
+ "7 25 40\r",
+ "7 25 41\r",
+ "7 25 42\r",
+ "7 25 43\r",
+ "7 25 44\r",
+ "7 25 45\r",
+ "7 25 46\r",
+ "7 25 47\r",
+ "7 25 48\r",
+ "7 25 49\r",
+ "7 25 50\r",
+ "7 25 51\r",
+ "7 25 52\r",
+ "7 25 53\r",
+ "7 25 54\r",
+ "7 25 55\r",
+ "7 25 56\r",
+ "7 25 57\r",
+ "7 25 58\r",
+ "7 26 1\r",
+ "7 26 2\r",
+ "7 26 3\r",
+ "7 26 4\r",
+ "7 26 5\r",
+ "7 26 6\r",
+ "7 26 7\r",
+ "7 26 8\r",
+ "7 26 9\r",
+ "7 26 10\r",
+ "7 26 11\r",
+ "7 26 12\r",
+ "7 26 13\r",
+ "7 26 14\r",
+ "7 26 15\r",
+ "7 26 16\r",
+ "7 26 17\r",
+ "7 26 18\r",
+ "7 26 19\r",
+ "7 26 20\r",
+ "7 26 21\r",
+ "7 26 22\r",
+ "7 26 23\r",
+ "7 26 24\r",
+ "7 26 25\r",
+ "7 26 26\r",
+ "7 26 27\r",
+ "7 26 28\r",
+ "7 26 29\r",
+ "7 26 30\r",
+ "7 26 31\r",
+ "7 26 32\r",
+ "7 26 33\r",
+ "7 26 34\r",
+ "7 26 35\r",
+ "7 26 36\r",
+ "7 26 37\r",
+ "7 26 38\r",
+ "7 26 39\r",
+ "7 26 40\r",
+ "7 26 41\r",
+ "7 26 42\r",
+ "7 26 43\r",
+ "7 26 44\r",
+ "7 26 45\r",
+ "7 26 46\r",
+ "7 26 47\r",
+ "7 26 48\r",
+ "7 26 49\r",
+ "7 26 50\r",
+ "7 26 51\r",
+ "7 26 52\r",
+ "7 26 53\r",
+ "7 26 54\r",
+ "7 26 55\r",
+ "7 26 56\r",
+ "7 26 57\r",
+ "7 26 58\r",
+ "7 27 1\r",
+ "7 27 2\r",
+ "7 27 3\r",
+ "7 27 4\r",
+ "7 27 5\r",
+ "7 27 6\r",
+ "7 27 7\r",
+ "7 27 8\r",
+ "7 27 9\r",
+ "7 27 10\r",
+ "7 27 11\r",
+ "7 27 12\r",
+ "7 27 13\r",
+ "7 27 14\r",
+ "7 27 15\r",
+ "7 27 16\r",
+ "7 27 17\r",
+ "7 27 18\r",
+ "7 27 19\r",
+ "7 27 20\r",
+ "7 27 21\r",
+ "7 27 22\r",
+ "7 27 23\r",
+ "7 27 24\r",
+ "7 27 25\r",
+ "7 27 26\r",
+ "7 27 27\r",
+ "7 27 28\r",
+ "7 27 29\r",
+ "7 27 30\r",
+ "7 27 31\r",
+ "7 27 32\r",
+ "7 27 33\r",
+ "7 27 34\r",
+ "7 27 35\r",
+ "7 27 36\r",
+ "7 27 37\r",
+ "7 27 38\r",
+ "7 27 39\r",
+ "7 27 40\r",
+ "7 27 41\r",
+ "7 27 42\r",
+ "7 27 43\r",
+ "7 27 44\r",
+ "7 27 45\r",
+ "7 27 46\r",
+ "7 27 47\r",
+ "7 27 48\r",
+ "7 27 49\r",
+ "7 27 50\r",
+ "7 27 51\r",
+ "7 27 52\r",
+ "7 27 53\r",
+ "7 27 54\r",
+ "7 27 55\r",
+ "7 27 56\r",
+ "7 27 57\r",
+ "7 27 58\r",
+ "7 28 1\r",
+ "7 28 2\r",
+ "7 28 3\r",
+ "7 28 4\r",
+ "7 28 5\r",
+ "7 28 6\r",
+ "7 28 7\r",
+ "7 28 8\r",
+ "7 28 9\r",
+ "7 28 10\r",
+ "7 28 11\r",
+ "7 28 12\r",
+ "7 28 13\r",
+ "7 28 14\r",
+ "7 28 15\r",
+ "7 28 16\r",
+ "7 28 17\r",
+ "7 28 18\r",
+ "7 28 19\r",
+ "7 28 20\r",
+ "7 28 21\r",
+ "7 28 22\r",
+ "7 28 23\r",
+ "7 28 24\r",
+ "7 28 25\r",
+ "7 28 26\r",
+ "7 28 27\r",
+ "7 28 28\r",
+ "7 28 29\r",
+ "7 28 30\r",
+ "7 28 31\r",
+ "7 28 32\r",
+ "7 28 33\r",
+ "7 28 34\r",
+ "7 28 35\r",
+ "7 28 36\r",
+ "7 28 37\r",
+ "7 28 38\r",
+ "7 28 39\r",
+ "7 28 40\r",
+ "7 28 41\r",
+ "7 28 42\r",
+ "7 28 43\r",
+ "7 28 44\r",
+ "7 28 45\r",
+ "7 28 46\r",
+ "7 28 47\r",
+ "7 28 48\r",
+ "7 28 49\r",
+ "7 28 50\r",
+ "7 28 51\r",
+ "7 28 52\r",
+ "7 28 53\r",
+ "7 28 54\r",
+ "7 28 55\r",
+ "7 28 56\r",
+ "7 28 57\r",
+ "7 28 58\r",
+ "7 29 1\r",
+ "7 29 2\r",
+ "7 29 3\r",
+ "7 29 4\r",
+ "7 29 5\r",
+ "7 29 6\r",
+ "7 29 7\r",
+ "7 29 8\r",
+ "7 29 9\r",
+ "7 29 10\r",
+ "7 29 11\r",
+ "7 29 12\r",
+ "7 29 13\r",
+ "7 29 14\r",
+ "7 29 15\r",
+ "7 29 16\r",
+ "7 29 17\r",
+ "7 29 18\r",
+ "7 29 19\r",
+ "7 29 20\r",
+ "7 29 21\r",
+ "7 29 22\r",
+ "7 29 23\r",
+ "7 29 24\r",
+ "7 29 25\r",
+ "7 29 26\r",
+ "7 29 27\r",
+ "7 29 28\r",
+ "7 29 29\r",
+ "7 29 30\r",
+ "7 29 31\r",
+ "7 29 32\r",
+ "7 29 33\r",
+ "7 29 34\r",
+ "7 29 35\r",
+ "7 29 36\r",
+ "7 29 37\r",
+ "7 29 38\r",
+ "7 29 39\r",
+ "7 29 40\r",
+ "7 29 41\r",
+ "7 29 42\r",
+ "7 29 43\r",
+ "7 29 44\r",
+ "7 29 45\r",
+ "7 29 46\r",
+ "7 29 47\r",
+ "7 29 48\r",
+ "7 29 49\r",
+ "7 29 50\r",
+ "7 29 51\r",
+ "7 29 52\r",
+ "7 29 53\r",
+ "7 29 54\r",
+ "7 29 55\r",
+ "7 29 56\r",
+ "7 29 57\r",
+ "7 29 58\r",
+ "7 30 1\r",
+ "7 30 2\r",
+ "7 30 3\r",
+ "7 30 4\r",
+ "7 30 5\r",
+ "7 30 6\r",
+ "7 30 7\r",
+ "7 30 8\r",
+ "7 30 9\r",
+ "7 30 10\r",
+ "7 30 11\r",
+ "7 30 12\r",
+ "7 30 13\r",
+ "7 30 14\r",
+ "7 30 15\r",
+ "7 30 16\r",
+ "7 30 17\r",
+ "7 30 18\r",
+ "7 30 19\r",
+ "7 30 20\r",
+ "7 30 21\r",
+ "7 30 22\r",
+ "7 30 23\r",
+ "7 30 24\r",
+ "7 30 25\r",
+ "7 30 26\r",
+ "7 30 27\r",
+ "7 30 28\r",
+ "7 30 29\r",
+ "7 30 30\r",
+ "7 30 31\r",
+ "7 30 32\r",
+ "7 30 33\r",
+ "7 30 34\r",
+ "7 30 35\r",
+ "7 30 36\r",
+ "7 30 37\r",
+ "7 30 38\r",
+ "7 30 39\r",
+ "7 30 40\r",
+ "7 30 41\r",
+ "7 30 42\r",
+ "7 30 43\r",
+ "7 30 44\r",
+ "7 30 45\r",
+ "7 30 46\r",
+ "7 30 47\r",
+ "7 30 48\r",
+ "7 30 49\r",
+ "7 30 50\r",
+ "7 30 51\r",
+ "7 30 52\r",
+ "7 30 53\r",
+ "7 30 54\r",
+ "7 30 55\r",
+ "7 30 56\r",
+ "7 30 57\r",
+ "7 30 58\r",
+ "7 31 1\r",
+ "7 31 2\r",
+ "7 31 3\r",
+ "7 31 4\r",
+ "7 31 5\r",
+ "7 31 6\r",
+ "7 31 7\r",
+ "7 31 8\r",
+ "7 31 9\r",
+ "7 31 10\r",
+ "7 31 11\r",
+ "7 31 12\r",
+ "7 31 13\r",
+ "7 31 14\r",
+ "7 31 15\r",
+ "7 31 16\r",
+ "7 31 17\r",
+ "7 31 18\r",
+ "7 31 19\r",
+ "7 31 20\r",
+ "7 31 21\r",
+ "7 31 22\r",
+ "7 31 23\r",
+ "7 31 24\r",
+ "7 31 25\r",
+ "7 31 26\r",
+ "7 31 27\r",
+ "7 31 28\r",
+ "7 31 29\r",
+ "7 31 30\r",
+ "7 31 31\r",
+ "7 31 32\r",
+ "7 31 33\r",
+ "7 31 34\r",
+ "7 31 35\r",
+ "7 31 36\r",
+ "7 31 37\r",
+ "7 31 38\r",
+ "7 31 39\r",
+ "7 31 40\r",
+ "7 31 41\r",
+ "7 31 42\r",
+ "7 31 43\r",
+ "7 31 44\r",
+ "7 31 45\r",
+ "7 31 46\r",
+ "7 31 47\r",
+ "7 31 48\r",
+ "7 31 49\r",
+ "7 31 50\r",
+ "7 31 51\r",
+ "7 31 52\r",
+ "7 31 53\r",
+ "7 31 54\r",
+ "7 31 55\r",
+ "7 31 56\r",
+ "7 31 57\r",
+ "7 31 58\r",
+ "7 32 1\r",
+ "7 32 2\r",
+ "7 32 3\r",
+ "7 32 4\r",
+ "7 32 5\r",
+ "7 32 6\r",
+ "7 32 7\r",
+ "7 32 8\r",
+ "7 32 9\r",
+ "7 32 10\r",
+ "7 32 11\r",
+ "7 32 12\r",
+ "7 32 13\r",
+ "7 32 14\r",
+ "7 32 15\r",
+ "7 32 16\r",
+ "7 32 17\r",
+ "7 32 18\r",
+ "7 32 19\r",
+ "7 32 20\r",
+ "7 32 21\r",
+ "7 32 22\r",
+ "7 32 23\r",
+ "7 32 24\r",
+ "7 32 25\r",
+ "7 32 26\r",
+ "7 32 27\r",
+ "7 32 28\r",
+ "7 32 29\r",
+ "7 32 30\r",
+ "7 32 31\r",
+ "7 32 32\r",
+ "7 32 33\r",
+ "7 32 34\r",
+ "7 32 35\r",
+ "7 32 36\r",
+ "7 32 37\r",
+ "7 32 38\r",
+ "7 32 39\r",
+ "7 32 40\r",
+ "7 32 41\r",
+ "7 32 42\r",
+ "7 32 43\r",
+ "7 32 44\r",
+ "7 32 45\r",
+ "7 32 46\r",
+ "7 32 47\r",
+ "7 32 48\r",
+ "7 32 49\r",
+ "7 32 50\r",
+ "7 32 51\r",
+ "7 32 52\r",
+ "7 32 53\r",
+ "7 32 54\r",
+ "7 32 55\r",
+ "7 32 56\r",
+ "7 32 57\r",
+ "7 32 58\r",
+ "7 33 1\r",
+ "7 33 2\r",
+ "7 33 3\r",
+ "7 33 4\r",
+ "7 33 5\r",
+ "7 33 6\r",
+ "7 33 7\r",
+ "7 33 8\r",
+ "7 33 9\r",
+ "7 33 10\r",
+ "7 33 11\r",
+ "7 33 12\r",
+ "7 33 13\r",
+ "7 33 14\r",
+ "7 33 15\r",
+ "7 33 16\r",
+ "7 33 17\r",
+ "7 33 18\r",
+ "7 33 19\r",
+ "7 33 20\r",
+ "7 33 21\r",
+ "7 33 22\r",
+ "7 33 23\r",
+ "7 33 24\r",
+ "7 33 25\r",
+ "7 33 26\r",
+ "7 33 27\r",
+ "7 33 28\r",
+ "7 33 29\r",
+ "7 33 30\r",
+ "7 33 31\r",
+ "7 33 32\r",
+ "7 33 33\r",
+ "7 33 34\r",
+ "7 33 35\r",
+ "7 33 36\r",
+ "7 33 37\r",
+ "7 33 38\r",
+ "7 33 39\r",
+ "7 33 40\r",
+ "7 33 41\r",
+ "7 33 42\r",
+ "7 33 43\r",
+ "7 33 44\r",
+ "7 33 45\r",
+ "7 33 46\r",
+ "7 33 47\r",
+ "7 33 48\r",
+ "7 33 49\r",
+ "7 33 50\r",
+ "7 33 51\r",
+ "7 33 52\r",
+ "7 33 53\r",
+ "7 33 54\r",
+ "7 33 55\r",
+ "7 33 56\r",
+ "7 33 57\r",
+ "7 33 58\r",
+ "7 34 1\r",
+ "7 34 2\r",
+ "7 34 3\r",
+ "7 34 4\r",
+ "7 34 5\r",
+ "7 34 6\r",
+ "7 34 7\r",
+ "7 34 8\r",
+ "7 34 9\r",
+ "7 34 10\r",
+ "7 34 11\r",
+ "7 34 12\r",
+ "7 34 13\r",
+ "7 34 14\r",
+ "7 34 15\r",
+ "7 34 16\r",
+ "7 34 17\r",
+ "7 34 18\r",
+ "7 34 19\r",
+ "7 34 20\r",
+ "7 34 21\r",
+ "7 34 22\r",
+ "7 34 23\r",
+ "7 34 24\r",
+ "7 34 25\r",
+ "7 34 26\r",
+ "7 34 27\r",
+ "7 34 28\r",
+ "7 34 29\r",
+ "7 34 30\r",
+ "7 34 31\r",
+ "7 34 32\r",
+ "7 34 33\r",
+ "7 34 34\r",
+ "7 34 35\r",
+ "7 34 36\r",
+ "7 34 37\r",
+ "7 34 38\r",
+ "7 34 39\r",
+ "7 34 40\r",
+ "7 34 41\r",
+ "7 34 42\r",
+ "7 34 43\r",
+ "7 34 44\r",
+ "7 34 45\r",
+ "7 34 46\r",
+ "7 34 47\r",
+ "7 34 48\r",
+ "7 34 49\r",
+ "7 34 50\r",
+ "7 34 51\r",
+ "7 34 52\r",
+ "7 34 53\r",
+ "7 34 54\r",
+ "7 34 55\r",
+ "7 34 56\r",
+ "7 34 57\r",
+ "7 34 58\r",
+ "7 35 1\r",
+ "7 35 2\r",
+ "7 35 3\r",
+ "7 35 4\r",
+ "7 35 5\r",
+ "7 35 6\r",
+ "7 35 7\r",
+ "7 35 8\r",
+ "7 35 9\r",
+ "7 35 10\r",
+ "7 35 11\r",
+ "7 35 12\r",
+ "7 35 13\r",
+ "7 35 14\r",
+ "7 35 15\r",
+ "7 35 16\r",
+ "7 35 17\r",
+ "7 35 18\r",
+ "7 35 19\r",
+ "7 35 20\r",
+ "7 35 21\r",
+ "7 35 22\r",
+ "7 35 23\r",
+ "7 35 24\r",
+ "7 35 25\r",
+ "7 35 26\r",
+ "7 35 27\r",
+ "7 35 28\r",
+ "7 35 29\r",
+ "7 35 30\r",
+ "7 35 31\r",
+ "7 35 32\r",
+ "7 35 33\r",
+ "7 35 34\r",
+ "7 35 35\r",
+ "7 35 36\r",
+ "7 35 37\r",
+ "7 35 38\r",
+ "7 35 39\r",
+ "7 35 40\r",
+ "7 35 41\r",
+ "7 35 42\r",
+ "7 35 43\r",
+ "7 35 44\r",
+ "7 35 45\r",
+ "7 35 46\r",
+ "7 35 47\r",
+ "7 35 48\r",
+ "7 35 49\r",
+ "7 35 50\r",
+ "7 35 51\r",
+ "7 35 52\r",
+ "7 35 53\r",
+ "7 35 54\r",
+ "7 35 55\r",
+ "7 35 56\r",
+ "7 35 57\r",
+ "7 35 58\r",
+ "7 36 1\r",
+ "7 36 2\r",
+ "7 36 3\r",
+ "7 36 4\r",
+ "7 36 5\r",
+ "7 36 6\r",
+ "7 36 7\r",
+ "7 36 8\r",
+ "7 36 9\r",
+ "7 36 10\r",
+ "7 36 11\r",
+ "7 36 12\r",
+ "7 36 13\r",
+ "7 36 14\r",
+ "7 36 15\r",
+ "7 36 16\r",
+ "7 36 17\r",
+ "7 36 18\r",
+ "7 36 19\r",
+ "7 36 20\r",
+ "7 36 21\r",
+ "7 36 22\r",
+ "7 36 23\r",
+ "7 36 24\r",
+ "7 36 25\r",
+ "7 36 26\r",
+ "7 36 27\r",
+ "7 36 28\r",
+ "7 36 29\r",
+ "7 36 30\r",
+ "7 36 31\r",
+ "7 36 32\r",
+ "7 36 33\r",
+ "7 36 34\r",
+ "7 36 35\r",
+ "7 36 36\r",
+ "7 36 37\r",
+ "7 36 38\r",
+ "7 36 39\r",
+ "7 36 40\r",
+ "7 36 41\r",
+ "7 36 42\r",
+ "7 36 43\r",
+ "7 36 44\r",
+ "7 36 45\r",
+ "7 36 46\r",
+ "7 36 47\r",
+ "7 36 48\r",
+ "7 36 49\r",
+ "7 36 50\r",
+ "7 36 51\r",
+ "7 36 52\r",
+ "7 36 53\r",
+ "7 36 54\r",
+ "7 36 55\r",
+ "7 36 56\r",
+ "7 36 57\r",
+ "7 36 58\r",
+ "7 37 1\r",
+ "7 37 2\r",
+ "7 37 3\r",
+ "7 37 4\r",
+ "7 37 5\r",
+ "7 37 6\r",
+ "7 37 7\r",
+ "7 37 8\r",
+ "7 37 9\r",
+ "7 37 10\r",
+ "7 37 11\r",
+ "7 37 12\r",
+ "7 37 13\r",
+ "7 37 14\r",
+ "7 37 15\r",
+ "7 37 16\r",
+ "7 37 17\r",
+ "7 37 18\r",
+ "7 37 19\r",
+ "7 37 20\r",
+ "7 37 21\r",
+ "7 37 22\r",
+ "7 37 23\r",
+ "7 37 24\r",
+ "7 37 25\r",
+ "7 37 26\r",
+ "7 37 27\r",
+ "7 37 28\r",
+ "7 37 29\r",
+ "7 37 30\r",
+ "7 37 31\r",
+ "7 37 32\r",
+ "7 37 33\r",
+ "7 37 34\r",
+ "7 37 35\r",
+ "7 37 36\r",
+ "7 37 37\r",
+ "7 37 38\r",
+ "7 37 39\r",
+ "7 37 40\r",
+ "7 37 41\r",
+ "7 37 42\r",
+ "7 37 43\r",
+ "7 37 44\r",
+ "7 37 45\r",
+ "7 37 46\r",
+ "7 37 47\r",
+ "7 37 48\r",
+ "7 37 49\r",
+ "7 37 50\r",
+ "7 37 51\r",
+ "7 37 52\r",
+ "7 37 53\r",
+ "7 37 54\r",
+ "7 37 55\r",
+ "7 37 56\r",
+ "7 37 57\r",
+ "7 37 58\r",
+ "7 38 1\r",
+ "7 38 2\r",
+ "7 38 3\r",
+ "7 38 4\r",
+ "7 38 5\r",
+ "7 38 6\r",
+ "7 38 7\r",
+ "7 38 8\r",
+ "7 38 9\r",
+ "7 38 10\r",
+ "7 38 11\r",
+ "7 38 12\r",
+ "7 38 13\r",
+ "7 38 14\r",
+ "7 38 15\r",
+ "7 38 16\r",
+ "7 38 17\r",
+ "7 38 18\r",
+ "7 38 19\r",
+ "7 38 20\r",
+ "7 38 21\r",
+ "7 38 22\r",
+ "7 38 23\r",
+ "7 38 24\r",
+ "7 38 25\r",
+ "7 38 26\r",
+ "7 38 27\r",
+ "7 38 28\r",
+ "7 38 29\r",
+ "7 38 30\r",
+ "7 38 31\r",
+ "7 38 32\r",
+ "7 38 33\r",
+ "7 38 34\r",
+ "7 38 35\r",
+ "7 38 36\r",
+ "7 38 37\r",
+ "7 38 38\r",
+ "7 38 39\r",
+ "7 38 40\r",
+ "7 38 41\r",
+ "7 38 42\r",
+ "7 38 43\r",
+ "7 38 44\r",
+ "7 38 45\r",
+ "7 38 46\r",
+ "7 38 47\r",
+ "7 38 48\r",
+ "7 38 49\r",
+ "7 38 50\r",
+ "7 38 51\r",
+ "7 38 52\r",
+ "7 38 53\r",
+ "7 38 54\r",
+ "7 38 55\r",
+ "7 38 56\r",
+ "7 38 57\r",
+ "7 38 58\r",
+ "7 39 1\r",
+ "7 39 2\r",
+ "7 39 3\r",
+ "7 39 4\r",
+ "7 39 5\r",
+ "7 39 6\r",
+ "7 39 7\r",
+ "7 39 8\r",
+ "7 39 9\r",
+ "7 39 10\r",
+ "7 39 11\r",
+ "7 39 12\r",
+ "7 39 13\r",
+ "7 39 14\r",
+ "7 39 15\r",
+ "7 39 16\r",
+ "7 39 17\r",
+ "7 39 18\r",
+ "7 39 19\r",
+ "7 39 20\r",
+ "7 39 21\r",
+ "7 39 22\r",
+ "7 39 23\r",
+ "7 39 24\r",
+ "7 39 25\r",
+ "7 39 26\r",
+ "7 39 27\r",
+ "7 39 28\r",
+ "7 39 29\r",
+ "7 39 30\r",
+ "7 39 31\r",
+ "7 39 32\r",
+ "7 39 33\r",
+ "7 39 34\r",
+ "7 39 35\r",
+ "7 39 36\r",
+ "7 39 37\r",
+ "7 39 38\r",
+ "7 39 39\r",
+ "7 39 40\r",
+ "7 39 41\r",
+ "7 39 42\r",
+ "7 39 43\r",
+ "7 39 44\r",
+ "7 39 45\r",
+ "7 39 46\r",
+ "7 39 47\r",
+ "7 39 48\r",
+ "7 39 49\r",
+ "7 39 50\r",
+ "7 39 51\r",
+ "7 39 52\r",
+ "7 39 53\r",
+ "7 39 54\r",
+ "7 39 55\r",
+ "7 39 56\r",
+ "7 39 57\r",
+ "7 39 58\r",
+ "7 40 1\r",
+ "7 40 2\r",
+ "7 40 3\r",
+ "7 40 4\r",
+ "7 40 5\r",
+ "7 40 6\r",
+ "7 40 7\r",
+ "7 40 8\r",
+ "7 40 9\r",
+ "7 40 10\r",
+ "7 40 11\r",
+ "7 40 12\r",
+ "7 40 13\r",
+ "7 40 14\r",
+ "7 40 15\r",
+ "7 40 16\r",
+ "7 40 17\r",
+ "7 40 18\r",
+ "7 40 19\r",
+ "7 40 20\r",
+ "7 40 21\r",
+ "7 40 22\r",
+ "7 40 23\r",
+ "7 40 24\r",
+ "7 40 25\r",
+ "7 40 26\r",
+ "7 40 27\r",
+ "7 40 28\r",
+ "7 40 29\r",
+ "7 40 30\r",
+ "7 40 31\r",
+ "7 40 32\r",
+ "7 40 33\r",
+ "7 40 34\r",
+ "7 40 35\r",
+ "7 40 36\r",
+ "7 40 37\r",
+ "7 40 38\r",
+ "7 40 39\r",
+ "7 40 40\r",
+ "7 40 41\r",
+ "7 40 42\r",
+ "7 40 43\r",
+ "7 40 44\r",
+ "7 40 45\r",
+ "7 40 46\r",
+ "7 40 47\r",
+ "7 40 48\r",
+ "7 40 49\r",
+ "7 40 50\r",
+ "7 40 51\r",
+ "7 40 52\r",
+ "7 40 53\r",
+ "7 40 54\r",
+ "7 40 55\r",
+ "7 40 56\r",
+ "7 40 57\r",
+ "7 40 58\r",
+ "7 41 1\r",
+ "7 41 2\r",
+ "7 41 3\r",
+ "7 41 4\r",
+ "7 41 5\r",
+ "7 41 6\r",
+ "7 41 7\r",
+ "7 41 8\r",
+ "7 41 9\r",
+ "7 41 10\r",
+ "7 41 11\r",
+ "7 41 12\r",
+ "7 41 13\r",
+ "7 41 14\r",
+ "7 41 15\r",
+ "7 41 16\r",
+ "7 41 17\r",
+ "7 41 18\r",
+ "7 41 19\r",
+ "7 41 20\r",
+ "7 41 21\r",
+ "7 41 22\r",
+ "7 41 23\r",
+ "7 41 24\r",
+ "7 41 25\r",
+ "7 41 26\r",
+ "7 41 27\r",
+ "7 41 28\r",
+ "7 41 29\r",
+ "7 41 30\r",
+ "7 41 31\r",
+ "7 41 32\r",
+ "7 41 33\r",
+ "7 41 34\r",
+ "7 41 35\r",
+ "7 41 36\r",
+ "7 41 37\r",
+ "7 41 38\r",
+ "7 41 39\r",
+ "7 41 40\r",
+ "7 41 41\r",
+ "7 41 42\r",
+ "7 41 43\r",
+ "7 41 44\r",
+ "7 41 45\r",
+ "7 41 46\r",
+ "7 41 47\r",
+ "7 41 48\r",
+ "7 41 49\r",
+ "7 41 50\r",
+ "7 41 51\r",
+ "7 41 52\r",
+ "7 41 53\r",
+ "7 41 54\r",
+ "7 41 55\r",
+ "7 41 56\r",
+ "7 41 57\r",
+ "7 41 58\r",
+ "7 42 1\r",
+ "7 42 2\r",
+ "7 42 3\r",
+ "7 42 4\r",
+ "7 42 5\r",
+ "7 42 6\r",
+ "7 42 7\r",
+ "7 42 8\r",
+ "7 42 9\r",
+ "7 42 10\r",
+ "7 42 11\r",
+ "7 42 12\r",
+ "7 42 13\r",
+ "7 42 14\r",
+ "7 42 15\r",
+ "7 42 16\r",
+ "7 42 17\r",
+ "7 42 18\r",
+ "7 42 19\r",
+ "7 42 20\r",
+ "7 42 21\r",
+ "7 42 22\r",
+ "7 42 23\r",
+ "7 42 24\r",
+ "7 42 25\r",
+ "7 42 26\r",
+ "7 42 27\r",
+ "7 42 28\r",
+ "7 42 29\r",
+ "7 42 30\r",
+ "7 42 31\r",
+ "7 42 32\r",
+ "7 42 33\r",
+ "7 42 34\r",
+ "7 42 35\r",
+ "7 42 36\r",
+ "7 42 37\r",
+ "7 42 38\r",
+ "7 42 39\r",
+ "7 42 40\r",
+ "7 42 41\r",
+ "7 42 42\r",
+ "7 42 43\r",
+ "7 42 44\r",
+ "7 42 45\r",
+ "7 42 46\r",
+ "7 42 47\r",
+ "7 42 48\r",
+ "7 42 49\r",
+ "7 42 50\r",
+ "7 42 51\r",
+ "7 42 52\r",
+ "7 42 53\r",
+ "7 42 54\r",
+ "7 42 55\r",
+ "7 42 56\r",
+ "7 42 57\r",
+ "7 42 58\r",
+ "7 43 1\r",
+ "7 43 2\r",
+ "7 43 3\r",
+ "7 43 4\r",
+ "7 43 5\r",
+ "7 43 6\r",
+ "7 43 7\r",
+ "7 43 8\r",
+ "7 43 9\r",
+ "7 43 10\r",
+ "7 43 11\r",
+ "7 43 12\r",
+ "7 43 13\r",
+ "7 43 14\r",
+ "7 43 15\r",
+ "7 43 16\r",
+ "7 43 17\r",
+ "7 43 18\r",
+ "7 43 19\r",
+ "7 43 20\r",
+ "7 43 21\r",
+ "7 43 22\r",
+ "7 43 23\r",
+ "7 43 24\r",
+ "7 43 25\r",
+ "7 43 26\r",
+ "7 43 27\r",
+ "7 43 28\r",
+ "7 43 29\r",
+ "7 43 30\r",
+ "7 43 31\r",
+ "7 43 32\r",
+ "7 43 33\r",
+ "7 43 34\r",
+ "7 43 35\r",
+ "7 43 36\r",
+ "7 43 37\r",
+ "7 43 38\r",
+ "7 43 39\r",
+ "7 43 40\r",
+ "7 43 41\r",
+ "7 43 42\r",
+ "7 43 43\r",
+ "7 43 44\r",
+ "7 43 45\r",
+ "7 43 46\r",
+ "7 43 47\r",
+ "7 43 48\r",
+ "7 43 49\r",
+ "7 43 50\r",
+ "7 43 51\r",
+ "7 43 52\r",
+ "7 43 53\r",
+ "7 43 54\r",
+ "7 43 55\r",
+ "7 43 56\r",
+ "7 43 57\r",
+ "7 43 58\r",
+ "7 44 1\r",
+ "7 44 2\r",
+ "7 44 3\r",
+ "7 44 4\r",
+ "7 44 5\r",
+ "7 44 6\r",
+ "7 44 7\r",
+ "7 44 8\r",
+ "7 44 9\r",
+ "7 44 10\r",
+ "7 44 11\r",
+ "7 44 12\r",
+ "7 44 13\r",
+ "7 44 14\r",
+ "7 44 15\r",
+ "7 44 16\r",
+ "7 44 17\r",
+ "7 44 18\r",
+ "7 44 19\r",
+ "7 44 20\r",
+ "7 44 21\r",
+ "7 44 22\r",
+ "7 44 23\r",
+ "7 44 24\r",
+ "7 44 25\r",
+ "7 44 26\r",
+ "7 44 27\r",
+ "7 44 28\r",
+ "7 44 29\r",
+ "7 44 30\r",
+ "7 44 31\r",
+ "7 44 32\r",
+ "7 44 33\r",
+ "7 44 34\r",
+ "7 44 35\r",
+ "7 44 36\r",
+ "7 44 37\r",
+ "7 44 38\r",
+ "7 44 39\r",
+ "7 44 40\r",
+ "7 44 41\r",
+ "7 44 42\r",
+ "7 44 43\r",
+ "7 44 44\r",
+ "7 44 45\r",
+ "7 44 46\r",
+ "7 44 47\r",
+ "7 44 48\r",
+ "7 44 49\r",
+ "7 44 50\r",
+ "7 44 51\r",
+ "7 44 52\r",
+ "7 44 53\r",
+ "7 44 54\r",
+ "7 44 55\r",
+ "7 44 56\r",
+ "7 44 57\r",
+ "7 44 58\r",
+ "7 45 1\r",
+ "7 45 2\r",
+ "7 45 3\r",
+ "7 45 4\r",
+ "7 45 5\r",
+ "7 45 6\r",
+ "7 45 7\r",
+ "7 45 8\r",
+ "7 45 9\r",
+ "7 45 10\r",
+ "7 45 11\r",
+ "7 45 12\r",
+ "7 45 13\r",
+ "7 45 14\r",
+ "7 45 15\r",
+ "7 45 16\r",
+ "7 45 17\r",
+ "7 45 18\r",
+ "7 45 19\r",
+ "7 45 20\r",
+ "7 45 21\r",
+ "7 45 22\r",
+ "7 45 23\r",
+ "7 45 24\r",
+ "7 45 25\r",
+ "7 45 26\r",
+ "7 45 27\r",
+ "7 45 28\r",
+ "7 45 29\r",
+ "7 45 30\r",
+ "7 45 31\r",
+ "7 45 32\r",
+ "7 45 33\r",
+ "7 45 34\r",
+ "7 45 35\r",
+ "7 45 36\r",
+ "7 45 37\r",
+ "7 45 38\r",
+ "7 45 39\r",
+ "7 45 40\r",
+ "7 45 41\r",
+ "7 45 42\r",
+ "7 45 43\r",
+ "7 45 44\r",
+ "7 45 45\r",
+ "7 45 46\r",
+ "7 45 47\r",
+ "7 45 48\r",
+ "7 45 49\r",
+ "7 45 50\r",
+ "7 45 51\r",
+ "7 45 52\r",
+ "7 45 53\r",
+ "7 45 54\r",
+ "7 45 55\r",
+ "7 45 56\r",
+ "7 45 57\r",
+ "7 45 58\r",
+ "7 46 1\r",
+ "7 46 2\r",
+ "7 46 3\r",
+ "7 46 4\r",
+ "7 46 5\r",
+ "7 46 6\r",
+ "7 46 7\r",
+ "7 46 8\r",
+ "7 46 9\r",
+ "7 46 10\r",
+ "7 46 11\r",
+ "7 46 12\r",
+ "7 46 13\r",
+ "7 46 14\r",
+ "7 46 15\r",
+ "7 46 16\r",
+ "7 46 17\r",
+ "7 46 18\r",
+ "7 46 19\r",
+ "7 46 20\r",
+ "7 46 21\r",
+ "7 46 22\r",
+ "7 46 23\r",
+ "7 46 24\r",
+ "7 46 25\r",
+ "7 46 26\r",
+ "7 46 27\r",
+ "7 46 28\r",
+ "7 46 29\r",
+ "7 46 30\r",
+ "7 46 31\r",
+ "7 46 32\r",
+ "7 46 33\r",
+ "7 46 34\r",
+ "7 46 35\r",
+ "7 46 36\r",
+ "7 46 37\r",
+ "7 46 38\r",
+ "7 46 39\r",
+ "7 46 40\r",
+ "7 46 41\r",
+ "7 46 42\r",
+ "7 46 43\r",
+ "7 46 44\r",
+ "7 46 45\r",
+ "7 46 46\r",
+ "7 46 47\r",
+ "7 46 48\r",
+ "7 46 49\r",
+ "7 46 50\r",
+ "7 46 51\r",
+ "7 46 52\r",
+ "7 46 53\r",
+ "7 46 54\r",
+ "7 46 55\r",
+ "7 46 56\r",
+ "7 46 57\r",
+ "7 46 58\r",
+ "7 47 1\r",
+ "7 47 2\r",
+ "7 47 3\r",
+ "7 47 4\r",
+ "7 47 5\r",
+ "7 47 6\r",
+ "7 47 7\r",
+ "7 47 8\r",
+ "7 47 9\r",
+ "7 47 10\r",
+ "7 47 11\r",
+ "7 47 12\r",
+ "7 47 13\r",
+ "7 47 14\r",
+ "7 47 15\r",
+ "7 47 16\r",
+ "7 47 17\r",
+ "7 47 18\r",
+ "7 47 19\r",
+ "7 47 20\r",
+ "7 47 21\r",
+ "7 47 22\r",
+ "7 47 23\r",
+ "7 47 24\r",
+ "7 47 25\r",
+ "7 47 26\r",
+ "7 47 27\r",
+ "7 47 28\r",
+ "7 47 29\r",
+ "7 47 30\r",
+ "7 47 31\r",
+ "7 47 32\r",
+ "7 47 33\r",
+ "7 47 34\r",
+ "7 47 35\r",
+ "7 47 36\r",
+ "7 47 37\r",
+ "7 47 38\r",
+ "7 47 39\r",
+ "7 47 40\r",
+ "7 47 41\r",
+ "7 47 42\r",
+ "7 47 43\r",
+ "7 47 44\r",
+ "7 47 45\r",
+ "7 47 46\r",
+ "7 47 47\r",
+ "7 47 48\r",
+ "7 47 49\r",
+ "7 47 50\r",
+ "7 47 51\r",
+ "7 47 52\r",
+ "7 47 53\r",
+ "7 47 54\r",
+ "7 47 55\r",
+ "7 47 56\r",
+ "7 47 57\r",
+ "7 47 58\r",
+ "7 48 1\r",
+ "7 48 2\r",
+ "7 48 3\r",
+ "7 48 4\r",
+ "7 48 5\r",
+ "7 48 6\r",
+ "7 48 7\r",
+ "7 48 8\r",
+ "7 48 9\r",
+ "7 48 10\r",
+ "7 48 11\r",
+ "7 48 12\r",
+ "7 48 13\r",
+ "7 48 14\r",
+ "7 48 15\r",
+ "7 48 16\r",
+ "7 48 17\r",
+ "7 48 18\r",
+ "7 48 19\r",
+ "7 48 20\r",
+ "7 48 21\r",
+ "7 48 22\r",
+ "7 48 23\r",
+ "7 48 24\r",
+ "7 48 25\r",
+ "7 48 26\r",
+ "7 48 27\r",
+ "7 48 28\r",
+ "7 48 29\r",
+ "7 48 30\r",
+ "7 48 31\r",
+ "7 48 32\r",
+ "7 48 33\r",
+ "7 48 34\r",
+ "7 48 35\r",
+ "7 48 36\r",
+ "7 48 37\r",
+ "7 48 38\r",
+ "7 48 39\r",
+ "7 48 40\r",
+ "7 48 41\r",
+ "7 48 42\r",
+ "7 48 43\r",
+ "7 48 44\r",
+ "7 48 45\r",
+ "7 48 46\r",
+ "7 48 47\r",
+ "7 48 48\r",
+ "7 48 49\r",
+ "7 48 50\r",
+ "7 48 51\r",
+ "7 48 52\r",
+ "7 48 53\r",
+ "7 48 54\r",
+ "7 48 55\r",
+ "7 48 56\r",
+ "7 48 57\r",
+ "7 48 58\r",
+ "7 49 1\r",
+ "7 49 2\r",
+ "7 49 3\r",
+ "7 49 4\r",
+ "7 49 5\r",
+ "7 49 6\r",
+ "7 49 7\r",
+ "7 49 8\r",
+ "7 49 9\r",
+ "7 49 10\r",
+ "7 49 11\r",
+ "7 49 12\r",
+ "7 49 13\r",
+ "7 49 14\r",
+ "7 49 15\r",
+ "7 49 16\r",
+ "7 49 17\r",
+ "7 49 18\r",
+ "7 49 19\r",
+ "7 49 20\r",
+ "7 49 21\r",
+ "7 49 22\r",
+ "7 49 23\r",
+ "7 49 24\r",
+ "7 49 25\r",
+ "7 49 26\r",
+ "7 49 27\r",
+ "7 49 28\r",
+ "7 49 29\r",
+ "7 49 30\r",
+ "7 49 31\r",
+ "7 49 32\r",
+ "7 49 33\r",
+ "7 49 34\r",
+ "7 49 35\r",
+ "7 49 36\r",
+ "7 49 37\r",
+ "7 49 38\r",
+ "7 49 39\r",
+ "7 49 40\r",
+ "7 49 41\r",
+ "7 49 42\r",
+ "7 49 43\r",
+ "7 49 44\r",
+ "7 49 45\r",
+ "7 49 46\r",
+ "7 49 47\r",
+ "7 49 48\r",
+ "7 49 49\r",
+ "7 49 50\r",
+ "7 49 51\r",
+ "7 49 52\r",
+ "7 49 53\r",
+ "7 49 54\r",
+ "7 49 55\r",
+ "7 49 56\r",
+ "7 49 57\r",
+ "7 49 58\r",
+ "7 50 1\r",
+ "7 50 2\r",
+ "7 50 3\r",
+ "7 50 4\r",
+ "7 50 5\r",
+ "7 50 6\r",
+ "7 50 7\r",
+ "7 50 8\r",
+ "7 50 9\r",
+ "7 50 10\r",
+ "7 50 11\r",
+ "7 50 12\r",
+ "7 50 13\r",
+ "7 50 14\r",
+ "7 50 15\r",
+ "7 50 16\r",
+ "7 50 17\r",
+ "7 50 18\r",
+ "7 50 19\r",
+ "7 50 20\r",
+ "7 50 21\r",
+ "7 50 22\r",
+ "7 50 23\r",
+ "7 50 24\r",
+ "7 50 25\r",
+ "7 50 26\r",
+ "7 50 27\r",
+ "7 50 28\r",
+ "7 50 29\r",
+ "7 50 30\r",
+ "7 50 31\r",
+ "7 50 32\r",
+ "7 50 33\r",
+ "7 50 34\r",
+ "7 50 35\r",
+ "7 50 36\r",
+ "7 50 37\r",
+ "7 50 38\r",
+ "7 50 39\r",
+ "7 50 40\r",
+ "7 50 41\r",
+ "7 50 42\r",
+ "7 50 43\r",
+ "7 50 44\r",
+ "7 50 45\r",
+ "7 50 46\r",
+ "7 50 47\r",
+ "7 50 48\r",
+ "7 50 49\r",
+ "7 50 50\r",
+ "7 50 51\r",
+ "7 50 52\r",
+ "7 50 53\r",
+ "7 50 54\r",
+ "7 50 55\r",
+ "7 50 56\r",
+ "7 50 57\r",
+ "7 50 58\r",
+ "7 51 1\r",
+ "7 51 2\r",
+ "7 51 3\r",
+ "7 51 4\r",
+ "7 51 5\r",
+ "7 51 6\r",
+ "7 51 7\r",
+ "7 51 8\r",
+ "7 51 9\r",
+ "7 51 10\r",
+ "7 51 11\r",
+ "7 51 12\r",
+ "7 51 13\r",
+ "7 51 14\r",
+ "7 51 15\r",
+ "7 51 16\r",
+ "7 51 17\r",
+ "7 51 18\r",
+ "7 51 19\r",
+ "7 51 20\r",
+ "7 51 21\r",
+ "7 51 22\r",
+ "7 51 23\r",
+ "7 51 24\r",
+ "7 51 25\r",
+ "7 51 26\r",
+ "7 51 27\r",
+ "7 51 28\r",
+ "7 51 29\r",
+ "7 51 30\r",
+ "7 51 31\r",
+ "7 51 32\r",
+ "7 51 33\r",
+ "7 51 34\r",
+ "7 51 35\r",
+ "7 51 36\r",
+ "7 51 37\r",
+ "7 51 38\r",
+ "7 51 39\r",
+ "7 51 40\r",
+ "7 51 41\r",
+ "7 51 42\r",
+ "7 51 43\r",
+ "7 51 44\r",
+ "7 51 45\r",
+ "7 51 46\r",
+ "7 51 47\r",
+ "7 51 48\r",
+ "7 51 49\r",
+ "7 51 50\r",
+ "7 51 51\r",
+ "7 51 52\r",
+ "7 51 53\r",
+ "7 51 54\r",
+ "7 51 55\r",
+ "7 51 56\r",
+ "7 51 57\r",
+ "7 51 58\r",
+ "7 52 1\r",
+ "7 52 2\r",
+ "7 52 3\r",
+ "7 52 4\r",
+ "7 52 5\r",
+ "7 52 6\r",
+ "7 52 7\r",
+ "7 52 8\r",
+ "7 52 9\r",
+ "7 52 10\r",
+ "7 52 11\r",
+ "7 52 12\r",
+ "7 52 13\r",
+ "7 52 14\r",
+ "7 52 15\r",
+ "7 52 16\r",
+ "7 52 17\r",
+ "7 52 18\r",
+ "7 52 19\r",
+ "7 52 20\r",
+ "7 52 21\r",
+ "7 52 22\r",
+ "7 52 23\r",
+ "7 52 24\r",
+ "7 52 25\r",
+ "7 52 26\r",
+ "7 52 27\r",
+ "7 52 28\r",
+ "7 52 29\r",
+ "7 52 30\r",
+ "7 52 31\r",
+ "7 52 32\r",
+ "7 52 33\r",
+ "7 52 34\r",
+ "7 52 35\r",
+ "7 52 36\r",
+ "7 52 37\r",
+ "7 52 38\r",
+ "7 52 39\r",
+ "7 52 40\r",
+ "7 52 41\r",
+ "7 52 42\r",
+ "7 52 43\r",
+ "7 52 44\r",
+ "7 52 45\r",
+ "7 52 46\r",
+ "7 52 47\r",
+ "7 52 48\r",
+ "7 52 49\r",
+ "7 52 50\r",
+ "7 52 51\r",
+ "7 52 52\r",
+ "7 52 53\r",
+ "7 52 54\r",
+ "7 52 55\r",
+ "7 52 56\r",
+ "7 52 57\r",
+ "7 52 58\r",
+ "7 53 1\r",
+ "7 53 2\r",
+ "7 53 3\r",
+ "7 53 4\r",
+ "7 53 5\r",
+ "7 53 6\r",
+ "7 53 7\r",
+ "7 53 8\r",
+ "7 53 9\r",
+ "7 53 10\r",
+ "7 53 11\r",
+ "7 53 12\r",
+ "7 53 13\r",
+ "7 53 14\r",
+ "7 53 15\r",
+ "7 53 16\r",
+ "7 53 17\r",
+ "7 53 18\r",
+ "7 53 19\r",
+ "7 53 20\r",
+ "7 53 21\r",
+ "7 53 22\r",
+ "7 53 23\r",
+ "7 53 24\r",
+ "7 53 25\r",
+ "7 53 26\r",
+ "7 53 27\r",
+ "7 53 28\r",
+ "7 53 29\r",
+ "7 53 30\r",
+ "7 53 31\r",
+ "7 53 32\r",
+ "7 53 33\r",
+ "7 53 34\r",
+ "7 53 35\r",
+ "7 53 36\r",
+ "7 53 37\r",
+ "7 53 38\r",
+ "7 53 39\r",
+ "7 53 40\r",
+ "7 53 41\r",
+ "7 53 42\r",
+ "7 53 43\r",
+ "7 53 44\r",
+ "7 53 45\r",
+ "7 53 46\r",
+ "7 53 47\r",
+ "7 53 48\r",
+ "7 53 49\r",
+ "7 53 50\r",
+ "7 53 51\r",
+ "7 53 52\r",
+ "7 53 53\r",
+ "7 53 54\r",
+ "7 53 55\r",
+ "7 53 56\r",
+ "7 53 57\r",
+ "7 53 58\r",
+ "7 54 1\r",
+ "7 54 2\r",
+ "7 54 3\r",
+ "7 54 4\r",
+ "7 54 5\r",
+ "7 54 6\r",
+ "7 54 7\r",
+ "7 54 8\r",
+ "7 54 9\r",
+ "7 54 10\r",
+ "7 54 11\r",
+ "7 54 12\r",
+ "7 54 13\r",
+ "7 54 14\r",
+ "7 54 15\r",
+ "7 54 16\r",
+ "7 54 17\r",
+ "7 54 18\r",
+ "7 54 19\r",
+ "7 54 20\r",
+ "7 54 21\r",
+ "7 54 22\r",
+ "7 54 23\r",
+ "7 54 24\r",
+ "7 54 25\r",
+ "7 54 26\r",
+ "7 54 27\r",
+ "7 54 28\r",
+ "7 54 29\r",
+ "7 54 30\r",
+ "7 54 31\r",
+ "7 54 32\r",
+ "7 54 33\r",
+ "7 54 34\r",
+ "7 54 35\r",
+ "7 54 36\r",
+ "7 54 37\r",
+ "7 54 38\r",
+ "7 54 39\r",
+ "7 54 40\r",
+ "7 54 41\r",
+ "7 54 42\r",
+ "7 54 43\r",
+ "7 54 44\r",
+ "7 54 45\r",
+ "7 54 46\r",
+ "7 54 47\r",
+ "7 54 48\r",
+ "7 54 49\r",
+ "7 54 50\r",
+ "7 54 51\r",
+ "7 54 52\r",
+ "7 54 53\r",
+ "7 54 54\r",
+ "7 54 55\r",
+ "7 54 56\r",
+ "7 54 57\r",
+ "7 54 58\r",
+ "7 55 1\r",
+ "7 55 2\r",
+ "7 55 3\r",
+ "7 55 4\r",
+ "7 55 5\r",
+ "7 55 6\r",
+ "7 55 7\r",
+ "7 55 8\r",
+ "7 55 9\r",
+ "7 55 10\r",
+ "7 55 11\r",
+ "7 55 12\r",
+ "7 55 13\r",
+ "7 55 14\r",
+ "7 55 15\r",
+ "7 55 16\r",
+ "7 55 17\r",
+ "7 55 18\r",
+ "7 55 19\r",
+ "7 55 20\r",
+ "7 55 21\r",
+ "7 55 22\r",
+ "7 55 23\r",
+ "7 55 24\r",
+ "7 55 25\r",
+ "7 55 26\r",
+ "7 55 27\r",
+ "7 55 28\r",
+ "7 55 29\r",
+ "7 55 30\r",
+ "7 55 31\r",
+ "7 55 32\r",
+ "7 55 33\r",
+ "7 55 34\r",
+ "7 55 35\r",
+ "7 55 36\r",
+ "7 55 37\r",
+ "7 55 38\r",
+ "7 55 39\r",
+ "7 55 40\r",
+ "7 55 41\r",
+ "7 55 42\r",
+ "7 55 43\r",
+ "7 55 44\r",
+ "7 55 45\r",
+ "7 55 46\r",
+ "7 55 47\r",
+ "7 55 48\r",
+ "7 55 49\r",
+ "7 55 50\r",
+ "7 55 51\r",
+ "7 55 52\r",
+ "7 55 53\r",
+ "7 55 54\r",
+ "7 55 55\r",
+ "7 55 56\r",
+ "7 55 57\r",
+ "7 55 58\r",
+ "7 56 1\r",
+ "7 56 2\r",
+ "7 56 3\r",
+ "7 56 4\r",
+ "7 56 5\r",
+ "7 56 6\r",
+ "7 56 7\r",
+ "7 56 8\r",
+ "7 56 9\r",
+ "7 56 10\r",
+ "7 56 11\r",
+ "7 56 12\r",
+ "7 56 13\r",
+ "7 56 14\r",
+ "7 56 15\r",
+ "7 56 16\r",
+ "7 56 17\r",
+ "7 56 18\r",
+ "7 56 19\r",
+ "7 56 20\r",
+ "7 56 21\r",
+ "7 56 22\r",
+ "7 56 23\r",
+ "7 56 24\r",
+ "7 56 25\r",
+ "7 56 26\r",
+ "7 56 27\r",
+ "7 56 28\r",
+ "7 56 29\r",
+ "7 56 30\r",
+ "7 56 31\r",
+ "7 56 32\r",
+ "7 56 33\r",
+ "7 56 34\r",
+ "7 56 35\r",
+ "7 56 36\r",
+ "7 56 37\r",
+ "7 56 38\r",
+ "7 56 39\r",
+ "7 56 40\r",
+ "7 56 41\r",
+ "7 56 42\r",
+ "7 56 43"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "7 56 44\r",
+ "7 56 45\r",
+ "7 56 46\r",
+ "7 56 47\r",
+ "7 56 48\r",
+ "7 56 49\r",
+ "7 56 50\r",
+ "7 56 51\r",
+ "7 56 52\r",
+ "7 56 53\r",
+ "7 56 54\r",
+ "7 56 55\r",
+ "7 56 56\r",
+ "7 56 57\r",
+ "7 56 58\r",
+ "7 57 1\r",
+ "7 57 2\r",
+ "7 57 3\r",
+ "7 57 4\r",
+ "7 57 5\r",
+ "7 57 6\r",
+ "7 57 7\r",
+ "7 57 8\r",
+ "7 57 9\r",
+ "7 57 10\r",
+ "7 57 11\r",
+ "7 57 12\r",
+ "7 57 13\r",
+ "7 57 14\r",
+ "7 57 15\r",
+ "7 57 16\r",
+ "7 57 17\r",
+ "7 57 18\r",
+ "7 57 19\r",
+ "7 57 20\r",
+ "7 57 21\r",
+ "7 57 22\r",
+ "7 57 23\r",
+ "7 57 24\r",
+ "7 57 25\r",
+ "7 57 26\r",
+ "7 57 27\r",
+ "7 57 28\r",
+ "7 57 29\r",
+ "7 57 30\r",
+ "7 57 31\r",
+ "7 57 32\r",
+ "7 57 33\r",
+ "7 57 34\r",
+ "7 57 35\r",
+ "7 57 36\r",
+ "7 57 37\r",
+ "7 57 38\r",
+ "7 57 39\r",
+ "7 57 40\r",
+ "7 57 41\r",
+ "7 57 42\r",
+ "7 57 43\r",
+ "7 57 44\r",
+ "7 57 45\r",
+ "7 57 46\r",
+ "7 57 47\r",
+ "7 57 48\r",
+ "7 57 49\r",
+ "7 57 50\r",
+ "7 57 51\r",
+ "7 57 52\r",
+ "7 57 53\r",
+ "7 57 54\r",
+ "7 57 55\r",
+ "7 57 56\r",
+ "7 57 57\r",
+ "7 57 58\r",
+ "7 58 1\r",
+ "7 58 2\r",
+ "7 58 3\r",
+ "7 58 4\r",
+ "7 58 5\r",
+ "7 58 6\r",
+ "7 58 7\r",
+ "7 58 8\r",
+ "7 58 9\r",
+ "7 58 10\r",
+ "7 58 11\r",
+ "7 58 12\r",
+ "7 58 13\r",
+ "7 58 14\r",
+ "7 58 15\r",
+ "7 58 16\r",
+ "7 58 17\r",
+ "7 58 18\r",
+ "7 58 19\r",
+ "7 58 20\r",
+ "7 58 21\r",
+ "7 58 22\r",
+ "7 58 23\r",
+ "7 58 24\r",
+ "7 58 25\r",
+ "7 58 26\r",
+ "7 58 27\r",
+ "7 58 28\r",
+ "7 58 29\r",
+ "7 58 30\r",
+ "7 58 31\r",
+ "7 58 32\r",
+ "7 58 33\r",
+ "7 58 34\r",
+ "7 58 35\r",
+ "7 58 36\r",
+ "7 58 37\r",
+ "7 58 38\r",
+ "7 58 39\r",
+ "7 58 40\r",
+ "7 58 41\r",
+ "7 58 42\r",
+ "7 58 43\r",
+ "7 58 44\r",
+ "7 58 45\r",
+ "7 58 46\r",
+ "7 58 47\r",
+ "7 58 48\r",
+ "7 58 49\r",
+ "7 58 50\r",
+ "7 58 51\r",
+ "7 58 52\r",
+ "7 58 53\r",
+ "7 58 54\r",
+ "7 58 55\r",
+ "7 58 56\r",
+ "7 58 57\r",
+ "7 58 58\r",
+ "8 1 1\r",
+ "8 1 2\r",
+ "8 1 3\r",
+ "8 1 4\r",
+ "8 1 5\r",
+ "8 1 6\r",
+ "8 1 7\r",
+ "8 1 8\r",
+ "8 1 9\r",
+ "8 1 10\r",
+ "8 1 11\r",
+ "8 1 12\r",
+ "8 1 13\r",
+ "8 1 14\r",
+ "8 1 15\r",
+ "8 1 16\r",
+ "8 1 17\r",
+ "8 1 18\r",
+ "8 1 19\r",
+ "8 1 20\r",
+ "8 1 21\r",
+ "8 1 22\r",
+ "8 1 23\r",
+ "8 1 24\r",
+ "8 1 25\r",
+ "8 1 26\r",
+ "8 1 27\r",
+ "8 1 28\r",
+ "8 1 29\r",
+ "8 1 30\r",
+ "8 1 31\r",
+ "8 1 32\r",
+ "8 1 33\r",
+ "8 1 34\r",
+ "8 1 35\r",
+ "8 1 36\r",
+ "8 1 37\r",
+ "8 1 38\r",
+ "8 1 39\r",
+ "8 1 40\r",
+ "8 1 41\r",
+ "8 1 42\r",
+ "8 1 43\r",
+ "8 1 44\r",
+ "8 1 45\r",
+ "8 1 46\r",
+ "8 1 47\r",
+ "8 1 48\r",
+ "8 1 49\r",
+ "8 1 50\r",
+ "8 1 51\r",
+ "8 1 52\r",
+ "8 1 53\r",
+ "8 1 54\r",
+ "8 1 55\r",
+ "8 1 56\r",
+ "8 1 57\r",
+ "8 1 58\r",
+ "8 2 1\r",
+ "8 2 2\r",
+ "8 2 3\r",
+ "8 2 4\r",
+ "8 2 5\r",
+ "8 2 6\r",
+ "8 2 7\r",
+ "8 2 8\r",
+ "8 2 9\r",
+ "8 2 10\r",
+ "8 2 11\r",
+ "8 2 12\r",
+ "8 2 13\r",
+ "8 2 14\r",
+ "8 2 15\r",
+ "8 2 16\r",
+ "8 2 17\r",
+ "8 2 18\r",
+ "8 2 19\r",
+ "8 2 20\r",
+ "8 2 21\r",
+ "8 2 22\r",
+ "8 2 23\r",
+ "8 2 24\r",
+ "8 2 25\r",
+ "8 2 26\r",
+ "8 2 27\r",
+ "8 2 28\r",
+ "8 2 29\r",
+ "8 2 30\r",
+ "8 2 31\r",
+ "8 2 32\r",
+ "8 2 33\r",
+ "8 2 34\r",
+ "8 2 35\r",
+ "8 2 36\r",
+ "8 2 37\r",
+ "8 2 38\r",
+ "8 2 39\r",
+ "8 2 40\r",
+ "8 2 41\r",
+ "8 2 42\r",
+ "8 2 43\r",
+ "8 2 44\r",
+ "8 2 45\r",
+ "8 2 46\r",
+ "8 2 47\r",
+ "8 2 48\r",
+ "8 2 49\r",
+ "8 2 50\r",
+ "8 2 51\r",
+ "8 2 52\r",
+ "8 2 53\r",
+ "8 2 54\r",
+ "8 2 55\r",
+ "8 2 56\r",
+ "8 2 57\r",
+ "8 2 58\r",
+ "8 3 1\r",
+ "8 3 2\r",
+ "8 3 3\r",
+ "8 3 4\r",
+ "8 3 5\r",
+ "8 3 6\r",
+ "8 3 7\r",
+ "8 3 8\r",
+ "8 3 9\r",
+ "8 3 10\r",
+ "8 3 11\r",
+ "8 3 12\r",
+ "8 3 13\r",
+ "8 3 14\r",
+ "8 3 15\r",
+ "8 3 16\r",
+ "8 3 17\r",
+ "8 3 18\r",
+ "8 3 19\r",
+ "8 3 20\r",
+ "8 3 21\r",
+ "8 3 22\r",
+ "8 3 23\r",
+ "8 3 24\r",
+ "8 3 25\r",
+ "8 3 26\r",
+ "8 3 27\r",
+ "8 3 28\r",
+ "8 3 29\r",
+ "8 3 30\r",
+ "8 3 31\r",
+ "8 3 32\r",
+ "8 3 33\r",
+ "8 3 34\r",
+ "8 3 35\r",
+ "8 3 36\r",
+ "8 3 37\r",
+ "8 3 38\r",
+ "8 3 39\r",
+ "8 3 40\r",
+ "8 3 41\r",
+ "8 3 42\r",
+ "8 3 43\r",
+ "8 3 44\r",
+ "8 3 45\r",
+ "8 3 46\r",
+ "8 3 47\r",
+ "8 3 48\r",
+ "8 3 49\r",
+ "8 3 50\r",
+ "8 3 51\r",
+ "8 3 52\r",
+ "8 3 53\r",
+ "8 3 54\r",
+ "8 3 55\r",
+ "8 3 56\r",
+ "8 3 57\r",
+ "8 3 58\r",
+ "8 4 1\r",
+ "8 4 2\r",
+ "8 4 3\r",
+ "8 4 4\r",
+ "8 4 5\r",
+ "8 4 6\r",
+ "8 4 7\r",
+ "8 4 8\r",
+ "8 4 9\r",
+ "8 4 10\r",
+ "8 4 11\r",
+ "8 4 12\r",
+ "8 4 13\r",
+ "8 4 14\r",
+ "8 4 15\r",
+ "8 4 16\r",
+ "8 4 17\r",
+ "8 4 18\r",
+ "8 4 19\r",
+ "8 4 20\r",
+ "8 4 21\r",
+ "8 4 22\r",
+ "8 4 23\r",
+ "8 4 24\r",
+ "8 4 25\r",
+ "8 4 26\r",
+ "8 4 27\r",
+ "8 4 28\r",
+ "8 4 29\r",
+ "8 4 30\r",
+ "8 4 31\r",
+ "8 4 32\r",
+ "8 4 33\r",
+ "8 4 34\r",
+ "8 4 35\r",
+ "8 4 36\r",
+ "8 4 37\r",
+ "8 4 38\r",
+ "8 4 39\r",
+ "8 4 40\r",
+ "8 4 41\r",
+ "8 4 42\r",
+ "8 4 43\r",
+ "8 4 44\r",
+ "8 4 45\r",
+ "8 4 46\r",
+ "8 4 47\r",
+ "8 4 48\r",
+ "8 4 49\r",
+ "8 4 50\r",
+ "8 4 51\r",
+ "8 4 52\r",
+ "8 4 53\r",
+ "8 4 54\r",
+ "8 4 55\r",
+ "8 4 56\r",
+ "8 4 57\r",
+ "8 4 58\r",
+ "8 5 1\r",
+ "8 5 2\r",
+ "8 5 3\r",
+ "8 5 4\r",
+ "8 5 5\r",
+ "8 5 6\r",
+ "8 5 7\r",
+ "8 5 8\r",
+ "8 5 9\r",
+ "8 5 10\r",
+ "8 5 11\r",
+ "8 5 12\r",
+ "8 5 13\r",
+ "8 5 14\r",
+ "8 5 15\r",
+ "8 5 16\r",
+ "8 5 17\r",
+ "8 5 18\r",
+ "8 5 19\r",
+ "8 5 20\r",
+ "8 5 21\r",
+ "8 5 22\r",
+ "8 5 23\r",
+ "8 5 24\r",
+ "8 5 25\r",
+ "8 5 26\r",
+ "8 5 27\r",
+ "8 5 28\r",
+ "8 5 29\r",
+ "8 5 30\r",
+ "8 5 31\r",
+ "8 5 32\r",
+ "8 5 33\r",
+ "8 5 34\r",
+ "8 5 35\r",
+ "8 5 36\r",
+ "8 5 37\r",
+ "8 5 38\r",
+ "8 5 39\r",
+ "8 5 40\r",
+ "8 5 41\r",
+ "8 5 42\r",
+ "8 5 43\r",
+ "8 5 44\r",
+ "8 5 45\r",
+ "8 5 46\r",
+ "8 5 47\r",
+ "8 5 48\r",
+ "8 5 49\r",
+ "8 5 50\r",
+ "8 5 51\r",
+ "8 5 52\r",
+ "8 5 53\r",
+ "8 5 54\r",
+ "8 5 55\r",
+ "8 5 56\r",
+ "8 5 57\r",
+ "8 5 58\r",
+ "8 6 1\r",
+ "8 6 2\r",
+ "8 6 3\r",
+ "8 6 4\r",
+ "8 6 5\r",
+ "8 6 6\r",
+ "8 6 7\r",
+ "8 6 8\r",
+ "8 6 9\r",
+ "8 6 10\r",
+ "8 6 11\r",
+ "8 6 12\r",
+ "8 6 13\r",
+ "8 6 14\r",
+ "8 6 15\r",
+ "8 6 16\r",
+ "8 6 17\r",
+ "8 6 18\r",
+ "8 6 19\r",
+ "8 6 20\r",
+ "8 6 21\r",
+ "8 6 22\r",
+ "8 6 23\r",
+ "8 6 24\r",
+ "8 6 25\r",
+ "8 6 26\r",
+ "8 6 27\r",
+ "8 6 28\r",
+ "8 6 29\r",
+ "8 6 30\r",
+ "8 6 31\r",
+ "8 6 32\r",
+ "8 6 33\r",
+ "8 6 34\r",
+ "8 6 35\r",
+ "8 6 36\r",
+ "8 6 37\r",
+ "8 6 38\r",
+ "8 6 39\r",
+ "8 6 40\r",
+ "8 6 41\r",
+ "8 6 42\r",
+ "8 6 43\r",
+ "8 6 44\r",
+ "8 6 45\r",
+ "8 6 46\r",
+ "8 6 47\r",
+ "8 6 48\r",
+ "8 6 49\r",
+ "8 6 50\r",
+ "8 6 51\r",
+ "8 6 52\r",
+ "8 6 53\r",
+ "8 6 54\r",
+ "8 6 55\r",
+ "8 6 56\r",
+ "8 6 57\r",
+ "8 6 58\r",
+ "8 7 1\r",
+ "8 7 2\r",
+ "8 7 3\r",
+ "8 7 4\r",
+ "8 7 5\r",
+ "8 7 6\r",
+ "8 7 7\r",
+ "8 7 8\r",
+ "8 7 9\r",
+ "8 7 10\r",
+ "8 7 11\r",
+ "8 7 12\r",
+ "8 7 13\r",
+ "8 7 14\r",
+ "8 7 15\r",
+ "8 7 16\r",
+ "8 7 17\r",
+ "8 7 18\r",
+ "8 7 19\r",
+ "8 7 20\r",
+ "8 7 21\r",
+ "8 7 22\r",
+ "8 7 23\r",
+ "8 7 24\r",
+ "8 7 25\r",
+ "8 7 26\r",
+ "8 7 27\r",
+ "8 7 28\r",
+ "8 7 29\r",
+ "8 7 30\r",
+ "8 7 31\r",
+ "8 7 32\r",
+ "8 7 33\r",
+ "8 7 34\r",
+ "8 7 35\r",
+ "8 7 36\r",
+ "8 7 37\r",
+ "8 7 38\r",
+ "8 7 39\r",
+ "8 7 40\r",
+ "8 7 41\r",
+ "8 7 42\r",
+ "8 7 43\r",
+ "8 7 44\r",
+ "8 7 45\r",
+ "8 7 46\r",
+ "8 7 47\r",
+ "8 7 48\r",
+ "8 7 49\r",
+ "8 7 50\r",
+ "8 7 51\r",
+ "8 7 52\r",
+ "8 7 53\r",
+ "8 7 54\r",
+ "8 7 55\r",
+ "8 7 56\r",
+ "8 7 57\r",
+ "8 7 58\r",
+ "8 8 1\r",
+ "8 8 2\r",
+ "8 8 3\r",
+ "8 8 4\r",
+ "8 8 5\r",
+ "8 8 6\r",
+ "8 8 7\r",
+ "8 8 8\r",
+ "8 8 9\r",
+ "8 8 10\r",
+ "8 8 11\r",
+ "8 8 12\r",
+ "8 8 13\r",
+ "8 8 14\r",
+ "8 8 15\r",
+ "8 8 16\r",
+ "8 8 17\r",
+ "8 8 18\r",
+ "8 8 19\r",
+ "8 8 20\r",
+ "8 8 21\r",
+ "8 8 22\r",
+ "8 8 23\r",
+ "8 8 24\r",
+ "8 8 25\r",
+ "8 8 26\r",
+ "8 8 27\r",
+ "8 8 28\r",
+ "8 8 29\r",
+ "8 8 30\r",
+ "8 8 31\r",
+ "8 8 32\r",
+ "8 8 33\r",
+ "8 8 34\r",
+ "8 8 35\r",
+ "8 8 36\r",
+ "8 8 37\r",
+ "8 8 38\r",
+ "8 8 39\r",
+ "8 8 40\r",
+ "8 8 41\r",
+ "8 8 42\r",
+ "8 8 43\r",
+ "8 8 44\r",
+ "8 8 45\r",
+ "8 8 46\r",
+ "8 8 47\r",
+ "8 8 48\r",
+ "8 8 49\r",
+ "8 8 50\r",
+ "8 8 51\r",
+ "8 8 52\r",
+ "8 8 53\r",
+ "8 8 54\r",
+ "8 8 55\r",
+ "8 8 56\r",
+ "8 8 57\r",
+ "8 8 58\r",
+ "8 9 1\r",
+ "8 9 2\r",
+ "8 9 3\r",
+ "8 9 4\r",
+ "8 9 5\r",
+ "8 9 6\r",
+ "8 9 7\r",
+ "8 9 8\r",
+ "8 9 9\r",
+ "8 9 10\r",
+ "8 9 11\r",
+ "8 9 12\r",
+ "8 9 13\r",
+ "8 9 14\r",
+ "8 9 15\r",
+ "8 9 16\r",
+ "8 9 17\r",
+ "8 9 18\r",
+ "8 9 19\r",
+ "8 9 20\r",
+ "8 9 21\r",
+ "8 9 22\r",
+ "8 9 23\r",
+ "8 9 24\r",
+ "8 9 25\r",
+ "8 9 26\r",
+ "8 9 27\r",
+ "8 9 28\r",
+ "8 9 29\r",
+ "8 9 30\r",
+ "8 9 31\r",
+ "8 9 32\r",
+ "8 9 33\r",
+ "8 9 34\r",
+ "8 9 35\r",
+ "8 9 36\r",
+ "8 9 37\r",
+ "8 9 38\r",
+ "8 9 39\r",
+ "8 9 40\r",
+ "8 9 41\r",
+ "8 9 42\r",
+ "8 9 43\r",
+ "8 9 44\r",
+ "8 9 45\r",
+ "8 9 46\r",
+ "8 9 47\r",
+ "8 9 48\r",
+ "8 9 49\r",
+ "8 9 50\r",
+ "8 9 51\r",
+ "8 9 52\r",
+ "8 9 53\r",
+ "8 9 54\r",
+ "8 9 55\r",
+ "8 9 56\r",
+ "8 9 57\r",
+ "8 9 58\r",
+ "8 10 1\r",
+ "8 10 2\r",
+ "8 10 3\r",
+ "8 10 4\r",
+ "8 10 5\r",
+ "8 10 6\r",
+ "8 10 7\r",
+ "8 10 8\r",
+ "8 10 9\r",
+ "8 10 10\r",
+ "8 10 11\r",
+ "8 10 12\r",
+ "8 10 13\r",
+ "8 10 14\r",
+ "8 10 15\r",
+ "8 10 16\r",
+ "8 10 17\r",
+ "8 10 18\r",
+ "8 10 19\r",
+ "8 10 20\r",
+ "8 10 21\r",
+ "8 10 22\r",
+ "8 10 23\r",
+ "8 10 24\r",
+ "8 10 25\r",
+ "8 10 26\r",
+ "8 10 27\r",
+ "8 10 28\r",
+ "8 10 29\r",
+ "8 10 30\r",
+ "8 10 31\r",
+ "8 10 32\r",
+ "8 10 33\r",
+ "8 10 34\r",
+ "8 10 35\r",
+ "8 10 36\r",
+ "8 10 37\r",
+ "8 10 38\r",
+ "8 10 39\r",
+ "8 10 40\r",
+ "8 10 41\r",
+ "8 10 42\r",
+ "8 10 43\r",
+ "8 10 44\r",
+ "8 10 45\r",
+ "8 10 46\r",
+ "8 10 47\r",
+ "8 10 48\r",
+ "8 10 49\r",
+ "8 10 50\r",
+ "8 10 51\r",
+ "8 10 52\r",
+ "8 10 53\r",
+ "8 10 54\r",
+ "8 10 55\r",
+ "8 10 56\r",
+ "8 10 57\r",
+ "8 10 58\r",
+ "8 11 1\r",
+ "8 11 2\r",
+ "8 11 3\r",
+ "8 11 4\r",
+ "8 11 5\r",
+ "8 11 6\r",
+ "8 11 7\r",
+ "8 11 8\r",
+ "8 11 9\r",
+ "8 11 10\r",
+ "8 11 11\r",
+ "8 11 12\r",
+ "8 11 13\r",
+ "8 11 14\r",
+ "8 11 15\r",
+ "8 11 16\r",
+ "8 11 17\r",
+ "8 11 18\r",
+ "8 11 19\r",
+ "8 11 20\r",
+ "8 11 21\r",
+ "8 11 22\r",
+ "8 11 23\r",
+ "8 11 24\r",
+ "8 11 25\r",
+ "8 11 26\r",
+ "8 11 27\r",
+ "8 11 28\r",
+ "8 11 29\r",
+ "8 11 30\r",
+ "8 11 31\r",
+ "8 11 32\r",
+ "8 11 33\r",
+ "8 11 34\r",
+ "8 11 35\r",
+ "8 11 36\r",
+ "8 11 37\r",
+ "8 11 38\r",
+ "8 11 39\r",
+ "8 11 40\r",
+ "8 11 41\r",
+ "8 11 42\r",
+ "8 11 43\r",
+ "8 11 44\r",
+ "8 11 45\r",
+ "8 11 46\r",
+ "8 11 47\r",
+ "8 11 48\r",
+ "8 11 49\r",
+ "8 11 50\r",
+ "8 11 51\r",
+ "8 11 52\r",
+ "8 11 53\r",
+ "8 11 54\r",
+ "8 11 55\r",
+ "8 11 56\r",
+ "8 11 57\r",
+ "8 11 58\r",
+ "8 12 1\r",
+ "8 12 2\r",
+ "8 12 3\r",
+ "8 12 4\r",
+ "8 12 5\r",
+ "8 12 6\r",
+ "8 12 7\r",
+ "8 12 8\r",
+ "8 12 9\r",
+ "8 12 10\r",
+ "8 12 11\r",
+ "8 12 12\r",
+ "8 12 13\r",
+ "8 12 14\r",
+ "8 12 15\r",
+ "8 12 16\r",
+ "8 12 17\r",
+ "8 12 18\r",
+ "8 12 19\r",
+ "8 12 20\r",
+ "8 12 21\r",
+ "8 12 22\r",
+ "8 12 23\r",
+ "8 12 24\r",
+ "8 12 25\r",
+ "8 12 26\r",
+ "8 12 27\r",
+ "8 12 28\r",
+ "8 12 29\r",
+ "8 12 30\r",
+ "8 12 31\r",
+ "8 12 32\r",
+ "8 12 33\r",
+ "8 12 34\r",
+ "8 12 35\r",
+ "8 12 36\r",
+ "8 12 37\r",
+ "8 12 38\r",
+ "8 12 39\r",
+ "8 12 40\r",
+ "8 12 41\r",
+ "8 12 42\r",
+ "8 12 43\r",
+ "8 12 44\r",
+ "8 12 45\r",
+ "8 12 46\r",
+ "8 12 47\r",
+ "8 12 48\r",
+ "8 12 49\r",
+ "8 12 50\r",
+ "8 12 51\r",
+ "8 12 52\r",
+ "8 12 53\r",
+ "8 12 54\r",
+ "8 12 55\r",
+ "8 12 56\r",
+ "8 12 57\r",
+ "8 12 58\r",
+ "8 13 1\r",
+ "8 13 2\r",
+ "8 13 3\r",
+ "8 13 4\r",
+ "8 13 5\r",
+ "8 13 6\r",
+ "8 13 7\r",
+ "8 13 8\r",
+ "8 13 9\r",
+ "8 13 10\r",
+ "8 13 11\r",
+ "8 13 12\r",
+ "8 13 13\r",
+ "8 13 14\r",
+ "8 13 15\r",
+ "8 13 16\r",
+ "8 13 17\r",
+ "8 13 18\r",
+ "8 13 19\r",
+ "8 13 20\r",
+ "8 13 21\r",
+ "8 13 22\r",
+ "8 13 23\r",
+ "8 13 24\r",
+ "8 13 25\r",
+ "8 13 26\r",
+ "8 13 27\r",
+ "8 13 28\r",
+ "8 13 29\r",
+ "8 13 30\r",
+ "8 13 31\r",
+ "8 13 32\r",
+ "8 13 33\r",
+ "8 13 34\r",
+ "8 13 35\r",
+ "8 13 36\r",
+ "8 13 37\r",
+ "8 13 38\r",
+ "8 13 39\r",
+ "8 13 40\r",
+ "8 13 41\r",
+ "8 13 42\r",
+ "8 13 43\r",
+ "8 13 44\r",
+ "8 13 45\r",
+ "8 13 46\r",
+ "8 13 47\r",
+ "8 13 48\r",
+ "8 13 49\r",
+ "8 13 50\r",
+ "8 13 51\r",
+ "8 13 52\r",
+ "8 13 53\r",
+ "8 13 54\r",
+ "8 13 55\r",
+ "8 13 56\r",
+ "8 13 57\r",
+ "8 13 58\r",
+ "8 14 1\r",
+ "8 14 2\r",
+ "8 14 3\r",
+ "8 14 4\r",
+ "8 14 5\r",
+ "8 14 6\r",
+ "8 14 7\r",
+ "8 14 8\r",
+ "8 14 9\r",
+ "8 14 10\r",
+ "8 14 11\r",
+ "8 14 12\r",
+ "8 14 13\r",
+ "8 14 14\r",
+ "8 14 15\r",
+ "8 14 16\r",
+ "8 14 17\r",
+ "8 14 18\r",
+ "8 14 19\r",
+ "8 14 20\r",
+ "8 14 21\r",
+ "8 14 22\r",
+ "8 14 23\r",
+ "8 14 24\r",
+ "8 14 25\r",
+ "8 14 26\r",
+ "8 14 27\r",
+ "8 14 28\r",
+ "8 14 29\r",
+ "8 14 30\r",
+ "8 14 31\r",
+ "8 14 32\r",
+ "8 14 33\r",
+ "8 14 34\r",
+ "8 14 35\r",
+ "8 14 36\r",
+ "8 14 37\r",
+ "8 14 38\r",
+ "8 14 39\r",
+ "8 14 40\r",
+ "8 14 41\r",
+ "8 14 42\r",
+ "8 14 43\r",
+ "8 14 44\r",
+ "8 14 45\r",
+ "8 14 46\r",
+ "8 14 47\r",
+ "8 14 48\r",
+ "8 14 49\r",
+ "8 14 50\r",
+ "8 14 51\r",
+ "8 14 52\r",
+ "8 14 53\r",
+ "8 14 54\r",
+ "8 14 55\r",
+ "8 14 56\r",
+ "8 14 57\r",
+ "8 14 58\r",
+ "8 15 1\r",
+ "8 15 2\r",
+ "8 15 3\r",
+ "8 15 4\r",
+ "8 15 5\r",
+ "8 15 6\r",
+ "8 15 7\r",
+ "8 15 8\r",
+ "8 15 9\r",
+ "8 15 10\r",
+ "8 15 11\r",
+ "8 15 12\r",
+ "8 15 13\r",
+ "8 15 14\r",
+ "8 15 15\r",
+ "8 15 16\r",
+ "8 15 17\r",
+ "8 15 18\r",
+ "8 15 19\r",
+ "8 15 20\r",
+ "8 15 21\r",
+ "8 15 22\r",
+ "8 15 23\r",
+ "8 15 24\r",
+ "8 15 25\r",
+ "8 15 26\r",
+ "8 15 27\r",
+ "8 15 28\r",
+ "8 15 29\r",
+ "8 15 30\r",
+ "8 15 31\r",
+ "8 15 32\r",
+ "8 15 33\r",
+ "8 15 34\r",
+ "8 15 35\r",
+ "8 15 36\r",
+ "8 15 37\r",
+ "8 15 38\r",
+ "8 15 39\r",
+ "8 15 40\r",
+ "8 15 41\r",
+ "8 15 42\r",
+ "8 15 43\r",
+ "8 15 44\r",
+ "8 15 45\r",
+ "8 15 46\r",
+ "8 15 47\r",
+ "8 15 48\r",
+ "8 15 49\r",
+ "8 15 50\r",
+ "8 15 51\r",
+ "8 15 52\r",
+ "8 15 53\r",
+ "8 15 54\r",
+ "8 15 55\r",
+ "8 15 56\r",
+ "8 15 57\r",
+ "8 15 58\r",
+ "8 16 1\r",
+ "8 16 2\r",
+ "8 16 3\r",
+ "8 16 4\r",
+ "8 16 5\r",
+ "8 16 6\r",
+ "8 16 7\r",
+ "8 16 8\r",
+ "8 16 9\r",
+ "8 16 10\r",
+ "8 16 11\r",
+ "8 16 12\r",
+ "8 16 13\r",
+ "8 16 14\r",
+ "8 16 15\r",
+ "8 16 16\r",
+ "8 16 17\r",
+ "8 16 18\r",
+ "8 16 19\r",
+ "8 16 20\r",
+ "8 16 21\r",
+ "8 16 22\r",
+ "8 16 23\r",
+ "8 16 24\r",
+ "8 16 25\r",
+ "8 16 26\r",
+ "8 16 27\r",
+ "8 16 28\r",
+ "8 16 29\r",
+ "8 16 30\r",
+ "8 16 31\r",
+ "8 16 32\r",
+ "8 16 33\r",
+ "8 16 34\r",
+ "8 16 35\r",
+ "8 16 36\r",
+ "8 16 37\r",
+ "8 16 38\r",
+ "8 16 39\r",
+ "8 16 40\r",
+ "8 16 41\r",
+ "8 16 42\r",
+ "8 16 43\r",
+ "8 16 44\r",
+ "8 16 45\r",
+ "8 16 46\r",
+ "8 16 47\r",
+ "8 16 48\r",
+ "8 16 49\r",
+ "8 16 50\r",
+ "8 16 51\r",
+ "8 16 52\r",
+ "8 16 53\r",
+ "8 16 54\r",
+ "8 16 55\r",
+ "8 16 56\r",
+ "8 16 57\r",
+ "8 16 58\r",
+ "8 17 1\r",
+ "8 17 2\r",
+ "8 17 3\r",
+ "8 17 4\r",
+ "8 17 5\r",
+ "8 17 6\r",
+ "8 17 7\r",
+ "8 17 8\r",
+ "8 17 9\r",
+ "8 17 10\r",
+ "8 17 11\r",
+ "8 17 12\r",
+ "8 17 13\r",
+ "8 17 14\r",
+ "8 17 15\r",
+ "8 17 16\r",
+ "8 17 17\r",
+ "8 17 18\r",
+ "8 17 19\r",
+ "8 17 20\r",
+ "8 17 21\r",
+ "8 17 22\r",
+ "8 17 23\r",
+ "8 17 24\r",
+ "8 17 25\r",
+ "8 17 26\r",
+ "8 17 27\r",
+ "8 17 28\r",
+ "8 17 29\r",
+ "8 17 30\r",
+ "8 17 31\r",
+ "8 17 32\r",
+ "8 17 33\r",
+ "8 17 34\r",
+ "8 17 35\r",
+ "8 17 36\r",
+ "8 17 37\r",
+ "8 17 38\r",
+ "8 17 39\r",
+ "8 17 40\r",
+ "8 17 41\r",
+ "8 17 42\r",
+ "8 17 43\r",
+ "8 17 44\r",
+ "8 17 45\r",
+ "8 17 46\r",
+ "8 17 47\r",
+ "8 17 48\r",
+ "8 17 49\r",
+ "8 17 50\r",
+ "8 17 51\r",
+ "8 17 52\r",
+ "8 17 53\r",
+ "8 17 54\r",
+ "8 17 55\r",
+ "8 17 56\r",
+ "8 17 57\r",
+ "8 17 58\r",
+ "8 18 1\r",
+ "8 18 2\r",
+ "8 18 3\r",
+ "8 18 4\r",
+ "8 18 5\r",
+ "8 18 6\r",
+ "8 18 7\r",
+ "8 18 8\r",
+ "8 18 9\r",
+ "8 18 10\r",
+ "8 18 11\r",
+ "8 18 12\r",
+ "8 18 13\r",
+ "8 18 14\r",
+ "8 18 15\r",
+ "8 18 16\r",
+ "8 18 17\r",
+ "8 18 18\r",
+ "8 18 19\r",
+ "8 18 20\r",
+ "8 18 21\r",
+ "8 18 22\r",
+ "8 18 23\r",
+ "8 18 24\r",
+ "8 18 25\r",
+ "8 18 26\r",
+ "8 18 27\r",
+ "8 18 28\r",
+ "8 18 29\r",
+ "8 18 30\r",
+ "8 18 31\r",
+ "8 18 32\r",
+ "8 18 33\r",
+ "8 18 34\r",
+ "8 18 35\r",
+ "8 18 36\r",
+ "8 18 37\r",
+ "8 18 38\r",
+ "8 18 39\r",
+ "8 18 40\r",
+ "8 18 41\r",
+ "8 18 42\r",
+ "8 18 43\r",
+ "8 18 44\r",
+ "8 18 45\r",
+ "8 18 46\r",
+ "8 18 47\r",
+ "8 18 48\r",
+ "8 18 49\r",
+ "8 18 50\r",
+ "8 18 51\r",
+ "8 18 52\r",
+ "8 18 53\r",
+ "8 18 54\r",
+ "8 18 55\r",
+ "8 18 56\r",
+ "8 18 57\r",
+ "8 18 58\r",
+ "8 19 1\r",
+ "8 19 2\r",
+ "8 19 3\r",
+ "8 19 4\r",
+ "8 19 5\r",
+ "8 19 6\r",
+ "8 19 7\r",
+ "8 19 8\r",
+ "8 19 9\r",
+ "8 19 10\r",
+ "8 19 11\r",
+ "8 19 12\r",
+ "8 19 13\r",
+ "8 19 14\r",
+ "8 19 15\r",
+ "8 19 16\r",
+ "8 19 17\r",
+ "8 19 18\r",
+ "8 19 19\r",
+ "8 19 20\r",
+ "8 19 21\r",
+ "8 19 22\r",
+ "8 19 23\r",
+ "8 19 24\r",
+ "8 19 25\r",
+ "8 19 26\r",
+ "8 19 27\r",
+ "8 19 28\r",
+ "8 19 29\r",
+ "8 19 30\r",
+ "8 19 31\r",
+ "8 19 32\r",
+ "8 19 33\r",
+ "8 19 34\r",
+ "8 19 35\r",
+ "8 19 36\r",
+ "8 19 37\r",
+ "8 19 38\r",
+ "8 19 39\r",
+ "8 19 40\r",
+ "8 19 41\r",
+ "8 19 42\r",
+ "8 19 43\r",
+ "8 19 44\r",
+ "8 19 45\r",
+ "8 19 46\r",
+ "8 19 47\r",
+ "8 19 48\r",
+ "8 19 49\r",
+ "8 19 50\r",
+ "8 19 51\r",
+ "8 19 52\r",
+ "8 19 53\r",
+ "8 19 54\r",
+ "8 19 55\r",
+ "8 19 56\r",
+ "8 19 57\r",
+ "8 19 58\r",
+ "8 20 1\r",
+ "8 20 2\r",
+ "8 20 3\r",
+ "8 20 4\r",
+ "8 20 5\r",
+ "8 20 6\r",
+ "8 20 7\r",
+ "8 20 8\r",
+ "8 20 9\r",
+ "8 20 10\r",
+ "8 20 11\r",
+ "8 20 12\r",
+ "8 20 13\r",
+ "8 20 14\r",
+ "8 20 15\r",
+ "8 20 16\r",
+ "8 20 17\r",
+ "8 20 18\r",
+ "8 20 19\r",
+ "8 20 20\r",
+ "8 20 21\r",
+ "8 20 22\r",
+ "8 20 23\r",
+ "8 20 24\r",
+ "8 20 25\r",
+ "8 20 26\r",
+ "8 20 27\r",
+ "8 20 28\r",
+ "8 20 29\r",
+ "8 20 30\r",
+ "8 20 31\r",
+ "8 20 32\r",
+ "8 20 33\r",
+ "8 20 34\r",
+ "8 20 35\r",
+ "8 20 36\r",
+ "8 20 37\r",
+ "8 20 38\r",
+ "8 20 39\r",
+ "8 20 40\r",
+ "8 20 41\r",
+ "8 20 42\r",
+ "8 20 43\r",
+ "8 20 44\r",
+ "8 20 45\r",
+ "8 20 46\r",
+ "8 20 47\r",
+ "8 20 48\r",
+ "8 20 49\r",
+ "8 20 50\r",
+ "8 20 51\r",
+ "8 20 52\r",
+ "8 20 53\r",
+ "8 20 54\r",
+ "8 20 55\r",
+ "8 20 56\r",
+ "8 20 57\r",
+ "8 20 58\r",
+ "8 21 1\r",
+ "8 21 2\r",
+ "8 21 3\r",
+ "8 21 4\r",
+ "8 21 5\r",
+ "8 21 6\r",
+ "8 21 7\r",
+ "8 21 8\r",
+ "8 21 9\r",
+ "8 21 10\r",
+ "8 21 11\r",
+ "8 21 12\r",
+ "8 21 13\r",
+ "8 21 14\r",
+ "8 21 15\r",
+ "8 21 16\r",
+ "8 21 17\r",
+ "8 21 18\r",
+ "8 21 19\r",
+ "8 21 20\r",
+ "8 21 21\r",
+ "8 21 22\r",
+ "8 21 23\r",
+ "8 21 24\r",
+ "8 21 25\r",
+ "8 21 26\r",
+ "8 21 27\r",
+ "8 21 28\r",
+ "8 21 29\r",
+ "8 21 30\r",
+ "8 21 31\r",
+ "8 21 32\r",
+ "8 21 33\r",
+ "8 21 34\r",
+ "8 21 35\r",
+ "8 21 36\r",
+ "8 21 37\r",
+ "8 21 38\r",
+ "8 21 39\r",
+ "8 21 40\r",
+ "8 21 41\r",
+ "8 21 42\r",
+ "8 21 43\r",
+ "8 21 44\r",
+ "8 21 45\r",
+ "8 21 46\r",
+ "8 21 47\r",
+ "8 21 48\r",
+ "8 21 49\r",
+ "8 21 50\r",
+ "8 21 51\r",
+ "8 21 52\r",
+ "8 21 53\r",
+ "8 21 54\r",
+ "8 21 55\r",
+ "8 21 56\r",
+ "8 21 57\r",
+ "8 21 58\r",
+ "8 22 1\r",
+ "8 22 2\r",
+ "8 22 3\r",
+ "8 22 4\r",
+ "8 22 5\r",
+ "8 22 6\r",
+ "8 22 7\r",
+ "8 22 8\r",
+ "8 22 9\r",
+ "8 22 10\r",
+ "8 22 11\r",
+ "8 22 12\r",
+ "8 22 13\r",
+ "8 22 14\r",
+ "8 22 15\r",
+ "8 22 16\r",
+ "8 22 17\r",
+ "8 22 18\r",
+ "8 22 19\r",
+ "8 22 20\r",
+ "8 22 21\r",
+ "8 22 22\r",
+ "8 22 23\r",
+ "8 22 24\r",
+ "8 22 25\r",
+ "8 22 26\r",
+ "8 22 27\r",
+ "8 22 28\r",
+ "8 22 29\r",
+ "8 22 30\r",
+ "8 22 31\r",
+ "8 22 32\r",
+ "8 22 33\r",
+ "8 22 34\r",
+ "8 22 35\r",
+ "8 22 36\r",
+ "8 22 37\r",
+ "8 22 38\r",
+ "8 22 39\r",
+ "8 22 40\r",
+ "8 22 41\r",
+ "8 22 42\r",
+ "8 22 43\r",
+ "8 22 44\r",
+ "8 22 45\r",
+ "8 22 46\r",
+ "8 22 47\r",
+ "8 22 48\r",
+ "8 22 49\r",
+ "8 22 50\r",
+ "8 22 51\r",
+ "8 22 52\r",
+ "8 22 53\r",
+ "8 22 54\r",
+ "8 22 55\r",
+ "8 22 56\r",
+ "8 22 57\r",
+ "8 22 58\r",
+ "8 23 1\r",
+ "8 23 2\r",
+ "8 23 3\r",
+ "8 23 4\r",
+ "8 23 5\r",
+ "8 23 6\r",
+ "8 23 7\r",
+ "8 23 8\r",
+ "8 23 9\r",
+ "8 23 10\r",
+ "8 23 11\r",
+ "8 23 12\r",
+ "8 23 13\r",
+ "8 23 14\r",
+ "8 23 15\r",
+ "8 23 16\r",
+ "8 23 17\r",
+ "8 23 18\r",
+ "8 23 19\r",
+ "8 23 20\r",
+ "8 23 21\r",
+ "8 23 22\r",
+ "8 23 23\r",
+ "8 23 24\r",
+ "8 23 25\r",
+ "8 23 26\r",
+ "8 23 27\r",
+ "8 23 28\r",
+ "8 23 29\r",
+ "8 23 30\r",
+ "8 23 31\r",
+ "8 23 32\r",
+ "8 23 33\r",
+ "8 23 34\r",
+ "8 23 35\r",
+ "8 23 36\r",
+ "8 23 37\r",
+ "8 23 38\r",
+ "8 23 39\r",
+ "8 23 40\r",
+ "8 23 41\r",
+ "8 23 42\r",
+ "8 23 43\r",
+ "8 23 44\r",
+ "8 23 45\r",
+ "8 23 46\r",
+ "8 23 47\r",
+ "8 23 48\r",
+ "8 23 49\r",
+ "8 23 50\r",
+ "8 23 51\r",
+ "8 23 52\r",
+ "8 23 53\r",
+ "8 23 54\r",
+ "8 23 55\r",
+ "8 23 56\r",
+ "8 23 57\r",
+ "8 23 58\r",
+ "8 24 1\r",
+ "8 24 2\r",
+ "8 24 3\r",
+ "8 24 4\r",
+ "8 24 5\r",
+ "8 24 6\r",
+ "8 24 7\r",
+ "8 24 8\r",
+ "8 24 9\r",
+ "8 24 10\r",
+ "8 24 11\r",
+ "8 24 12\r",
+ "8 24 13\r",
+ "8 24 14\r",
+ "8 24 15\r",
+ "8 24 16\r",
+ "8 24 17\r",
+ "8 24 18\r",
+ "8 24 19\r",
+ "8 24 20\r",
+ "8 24 21\r",
+ "8 24 22\r",
+ "8 24 23\r",
+ "8 24 24\r",
+ "8 24 25\r",
+ "8 24 26\r",
+ "8 24 27\r",
+ "8 24 28\r",
+ "8 24 29\r",
+ "8 24 30\r",
+ "8 24 31\r",
+ "8 24 32\r",
+ "8 24 33\r",
+ "8 24 34\r",
+ "8 24 35\r",
+ "8 24 36\r",
+ "8 24 37\r",
+ "8 24 38\r",
+ "8 24 39\r",
+ "8 24 40\r",
+ "8 24 41\r",
+ "8 24 42\r",
+ "8 24 43\r",
+ "8 24 44\r",
+ "8 24 45\r",
+ "8 24 46\r",
+ "8 24 47\r",
+ "8 24 48\r",
+ "8 24 49\r",
+ "8 24 50\r",
+ "8 24 51\r",
+ "8 24 52\r",
+ "8 24 53\r",
+ "8 24 54\r",
+ "8 24 55\r",
+ "8 24 56\r",
+ "8 24 57\r",
+ "8 24 58\r",
+ "8 25 1\r",
+ "8 25 2\r",
+ "8 25 3\r",
+ "8 25 4\r",
+ "8 25 5\r",
+ "8 25 6\r",
+ "8 25 7\r",
+ "8 25 8\r",
+ "8 25 9\r",
+ "8 25 10\r",
+ "8 25 11\r",
+ "8 25 12\r",
+ "8 25 13\r",
+ "8 25 14\r",
+ "8 25 15\r",
+ "8 25 16\r",
+ "8 25 17\r",
+ "8 25 18\r",
+ "8 25 19\r",
+ "8 25 20\r",
+ "8 25 21\r",
+ "8 25 22\r",
+ "8 25 23\r",
+ "8 25 24\r",
+ "8 25 25\r",
+ "8 25 26\r",
+ "8 25 27\r",
+ "8 25 28\r",
+ "8 25 29\r",
+ "8 25 30\r",
+ "8 25 31\r",
+ "8 25 32\r",
+ "8 25 33\r",
+ "8 25 34\r",
+ "8 25 35\r",
+ "8 25 36\r",
+ "8 25 37\r",
+ "8 25 38\r",
+ "8 25 39\r",
+ "8 25 40\r",
+ "8 25 41\r",
+ "8 25 42\r",
+ "8 25 43\r",
+ "8 25 44\r",
+ "8 25 45\r",
+ "8 25 46\r",
+ "8 25 47\r",
+ "8 25 48\r",
+ "8 25 49\r",
+ "8 25 50\r",
+ "8 25 51\r",
+ "8 25 52\r",
+ "8 25 53\r",
+ "8 25 54\r",
+ "8 25 55\r",
+ "8 25 56\r",
+ "8 25 57\r",
+ "8 25 58\r",
+ "8 26 1\r",
+ "8 26 2\r",
+ "8 26 3\r",
+ "8 26 4\r",
+ "8 26 5\r",
+ "8 26 6\r",
+ "8 26 7\r",
+ "8 26 8\r",
+ "8 26 9\r",
+ "8 26 10\r",
+ "8 26 11\r",
+ "8 26 12\r",
+ "8 26 13\r",
+ "8 26 14\r",
+ "8 26 15\r",
+ "8 26 16\r",
+ "8 26 17\r",
+ "8 26 18\r",
+ "8 26 19\r",
+ "8 26 20\r",
+ "8 26 21\r",
+ "8 26 22\r",
+ "8 26 23\r",
+ "8 26 24\r",
+ "8 26 25\r",
+ "8 26 26\r",
+ "8 26 27\r",
+ "8 26 28\r",
+ "8 26 29\r",
+ "8 26 30\r",
+ "8 26 31\r",
+ "8 26 32\r",
+ "8 26 33\r",
+ "8 26 34\r",
+ "8 26 35\r",
+ "8 26 36\r",
+ "8 26 37\r",
+ "8 26 38\r",
+ "8 26 39\r",
+ "8 26 40\r",
+ "8 26 41\r",
+ "8 26 42\r",
+ "8 26 43\r",
+ "8 26 44\r",
+ "8 26 45\r",
+ "8 26 46\r",
+ "8 26 47\r",
+ "8 26 48\r",
+ "8 26 49\r",
+ "8 26 50\r",
+ "8 26 51\r",
+ "8 26 52\r",
+ "8 26 53\r",
+ "8 26 54\r",
+ "8 26 55\r",
+ "8 26 56\r",
+ "8 26 57\r",
+ "8 26 58\r",
+ "8 27 1\r",
+ "8 27 2\r",
+ "8 27 3\r",
+ "8 27 4\r",
+ "8 27 5\r",
+ "8 27 6\r",
+ "8 27 7\r",
+ "8 27 8\r",
+ "8 27 9\r",
+ "8 27 10\r",
+ "8 27 11\r",
+ "8 27 12\r",
+ "8 27 13\r",
+ "8 27 14\r",
+ "8 27 15\r",
+ "8 27 16\r",
+ "8 27 17\r",
+ "8 27 18\r",
+ "8 27 19\r",
+ "8 27 20\r",
+ "8 27 21\r",
+ "8 27 22\r",
+ "8 27 23\r",
+ "8 27 24\r",
+ "8 27 25\r",
+ "8 27 26\r",
+ "8 27 27\r",
+ "8 27 28\r",
+ "8 27 29\r",
+ "8 27 30\r",
+ "8 27 31\r",
+ "8 27 32\r",
+ "8 27 33\r",
+ "8 27 34\r",
+ "8 27 35\r",
+ "8 27 36\r",
+ "8 27 37\r",
+ "8 27 38\r",
+ "8 27 39\r",
+ "8 27 40\r",
+ "8 27 41\r",
+ "8 27 42\r",
+ "8 27 43\r",
+ "8 27 44\r",
+ "8 27 45\r",
+ "8 27 46\r",
+ "8 27 47\r",
+ "8 27 48\r",
+ "8 27 49\r",
+ "8 27 50\r",
+ "8 27 51\r",
+ "8 27 52\r",
+ "8 27 53\r",
+ "8 27 54\r",
+ "8 27 55\r",
+ "8 27 56\r",
+ "8 27 57\r",
+ "8 27 58\r",
+ "8 28 1\r",
+ "8 28 2\r",
+ "8 28 3\r",
+ "8 28 4\r",
+ "8 28 5\r",
+ "8 28 6\r",
+ "8 28 7\r",
+ "8 28 8\r",
+ "8 28 9\r",
+ "8 28 10\r",
+ "8 28 11\r",
+ "8 28 12\r",
+ "8 28 13\r",
+ "8 28 14\r",
+ "8 28 15\r",
+ "8 28 16\r",
+ "8 28 17\r",
+ "8 28 18\r",
+ "8 28 19\r",
+ "8 28 20\r",
+ "8 28 21\r",
+ "8 28 22\r",
+ "8 28 23\r",
+ "8 28 24\r",
+ "8 28 25\r",
+ "8 28 26\r",
+ "8 28 27\r",
+ "8 28 28\r",
+ "8 28 29\r",
+ "8 28 30\r",
+ "8 28 31\r",
+ "8 28 32\r",
+ "8 28 33\r",
+ "8 28 34\r",
+ "8 28 35\r",
+ "8 28 36\r",
+ "8 28 37\r",
+ "8 28 38\r",
+ "8 28 39\r",
+ "8 28 40\r",
+ "8 28 41\r",
+ "8 28 42\r",
+ "8 28 43\r",
+ "8 28 44\r",
+ "8 28 45\r",
+ "8 28 46\r",
+ "8 28 47\r",
+ "8 28 48\r",
+ "8 28 49\r",
+ "8 28 50\r",
+ "8 28 51\r",
+ "8 28 52\r",
+ "8 28 53\r",
+ "8 28 54\r",
+ "8 28 55\r",
+ "8 28 56\r",
+ "8 28 57\r",
+ "8 28 58\r",
+ "8 29 1\r",
+ "8 29 2\r",
+ "8 29 3\r",
+ "8 29 4\r",
+ "8 29 5\r",
+ "8 29 6\r",
+ "8 29 7\r",
+ "8 29 8\r",
+ "8 29 9\r",
+ "8 29 10\r",
+ "8 29 11\r",
+ "8 29 12\r",
+ "8 29 13\r",
+ "8 29 14\r",
+ "8 29 15\r",
+ "8 29 16\r",
+ "8 29 17\r",
+ "8 29 18\r",
+ "8 29 19\r",
+ "8 29 20\r",
+ "8 29 21\r",
+ "8 29 22\r",
+ "8 29 23\r",
+ "8 29 24\r",
+ "8 29 25\r",
+ "8 29 26\r",
+ "8 29 27\r",
+ "8 29 28\r",
+ "8 29 29\r",
+ "8 29 30\r",
+ "8 29 31\r",
+ "8 29 32\r",
+ "8 29 33\r",
+ "8 29 34\r",
+ "8 29 35\r",
+ "8 29 36\r",
+ "8 29 37\r",
+ "8 29 38\r",
+ "8 29 39\r",
+ "8 29 40\r",
+ "8 29 41\r",
+ "8 29 42\r",
+ "8 29 43\r",
+ "8 29 44\r",
+ "8 29 45\r",
+ "8 29 46\r",
+ "8 29 47\r",
+ "8 29 48\r",
+ "8 29 49\r",
+ "8 29 50\r",
+ "8 29 51\r",
+ "8 29 52\r",
+ "8 29 53\r",
+ "8 29 54\r",
+ "8 29 55\r",
+ "8 29 56\r",
+ "8 29 57\r",
+ "8 29 58\r",
+ "8 30 1\r",
+ "8 30 2\r",
+ "8 30 3\r",
+ "8 30 4\r",
+ "8 30 5\r",
+ "8 30 6\r",
+ "8 30 7\r",
+ "8 30 8\r",
+ "8 30 9\r",
+ "8 30 10\r",
+ "8 30 11\r",
+ "8 30 12\r",
+ "8 30 13\r",
+ "8 30 14\r",
+ "8 30 15\r",
+ "8 30 16\r",
+ "8 30 17\r",
+ "8 30 18\r",
+ "8 30 19\r",
+ "8 30 20\r",
+ "8 30 21\r",
+ "8 30 22\r",
+ "8 30 23\r",
+ "8 30 24\r",
+ "8 30 25\r",
+ "8 30 26\r",
+ "8 30 27\r",
+ "8 30 28\r",
+ "8 30 29\r",
+ "8 30 30\r",
+ "8 30 31\r",
+ "8 30 32\r",
+ "8 30 33\r",
+ "8 30 34\r",
+ "8 30 35\r",
+ "8 30 36\r",
+ "8 30 37\r",
+ "8 30 38\r",
+ "8 30 39\r",
+ "8 30 40\r",
+ "8 30 41\r",
+ "8 30 42\r",
+ "8 30 43\r",
+ "8 30 44\r",
+ "8 30 45\r",
+ "8 30 46\r",
+ "8 30 47\r",
+ "8 30 48\r",
+ "8 30 49\r",
+ "8 30 50\r",
+ "8 30 51\r",
+ "8 30 52\r",
+ "8 30 53\r",
+ "8 30 54\r",
+ "8 30 55\r",
+ "8 30 56\r",
+ "8 30 57\r",
+ "8 30 58\r",
+ "8 31 1\r",
+ "8 31 2\r",
+ "8 31 3\r",
+ "8 31 4\r",
+ "8 31 5\r",
+ "8 31 6\r",
+ "8 31 7\r",
+ "8 31 8\r",
+ "8 31 9\r",
+ "8 31 10\r",
+ "8 31 11\r",
+ "8 31 12\r",
+ "8 31 13\r",
+ "8 31 14\r",
+ "8 31 15\r",
+ "8 31 16\r",
+ "8 31 17\r",
+ "8 31 18\r",
+ "8 31 19\r",
+ "8 31 20\r",
+ "8 31 21\r",
+ "8 31 22\r",
+ "8 31 23\r",
+ "8 31 24\r",
+ "8 31 25\r",
+ "8 31 26\r",
+ "8 31 27\r",
+ "8 31 28\r",
+ "8 31 29\r",
+ "8 31 30\r",
+ "8 31 31\r",
+ "8 31 32\r",
+ "8 31 33\r",
+ "8 31 34\r",
+ "8 31 35\r",
+ "8 31 36\r",
+ "8 31 37\r",
+ "8 31 38\r",
+ "8 31 39\r",
+ "8 31 40\r",
+ "8 31 41\r",
+ "8 31 42\r",
+ "8 31 43\r",
+ "8 31 44\r",
+ "8 31 45\r",
+ "8 31 46\r",
+ "8 31 47\r",
+ "8 31 48\r",
+ "8 31 49\r",
+ "8 31 50\r",
+ "8 31 51\r",
+ "8 31 52\r",
+ "8 31 53\r",
+ "8 31 54\r",
+ "8 31 55\r",
+ "8 31 56\r",
+ "8 31 57\r",
+ "8 31 58\r",
+ "8 32 1\r",
+ "8 32 2\r",
+ "8 32 3\r",
+ "8 32 4\r",
+ "8 32 5\r",
+ "8 32 6\r",
+ "8 32 7\r",
+ "8 32 8\r",
+ "8 32 9\r",
+ "8 32 10\r",
+ "8 32 11\r",
+ "8 32 12\r",
+ "8 32 13\r",
+ "8 32 14\r",
+ "8 32 15\r",
+ "8 32 16\r",
+ "8 32 17\r",
+ "8 32 18\r",
+ "8 32 19\r",
+ "8 32 20\r",
+ "8 32 21\r",
+ "8 32 22\r",
+ "8 32 23\r",
+ "8 32 24\r",
+ "8 32 25\r",
+ "8 32 26\r",
+ "8 32 27\r",
+ "8 32 28\r",
+ "8 32 29\r",
+ "8 32 30\r",
+ "8 32 31\r",
+ "8 32 32\r",
+ "8 32 33\r",
+ "8 32 34\r",
+ "8 32 35\r",
+ "8 32 36\r",
+ "8 32 37\r",
+ "8 32 38\r",
+ "8 32 39\r",
+ "8 32 40\r",
+ "8 32 41\r",
+ "8 32 42\r",
+ "8 32 43\r",
+ "8 32 44\r",
+ "8 32 45\r",
+ "8 32 46\r",
+ "8 32 47\r",
+ "8 32 48\r",
+ "8 32 49\r",
+ "8 32 50\r",
+ "8 32 51\r",
+ "8 32 52\r",
+ "8 32 53\r",
+ "8 32 54\r",
+ "8 32 55\r",
+ "8 32 56\r",
+ "8 32 57\r",
+ "8 32 58\r",
+ "8 33 1\r",
+ "8 33 2\r",
+ "8 33 3\r",
+ "8 33 4\r",
+ "8 33 5\r",
+ "8 33 6\r",
+ "8 33 7\r",
+ "8 33 8\r",
+ "8 33 9\r",
+ "8 33 10\r",
+ "8 33 11\r",
+ "8 33 12\r",
+ "8 33 13\r",
+ "8 33 14\r",
+ "8 33 15\r",
+ "8 33 16\r",
+ "8 33 17\r",
+ "8 33 18\r",
+ "8 33 19\r",
+ "8 33 20\r",
+ "8 33 21\r",
+ "8 33 22\r",
+ "8 33 23\r",
+ "8 33 24\r",
+ "8 33 25\r",
+ "8 33 26\r",
+ "8 33 27\r",
+ "8 33 28\r",
+ "8 33 29\r",
+ "8 33 30\r",
+ "8 33 31\r",
+ "8 33 32\r",
+ "8 33 33\r",
+ "8 33 34\r",
+ "8 33 35\r",
+ "8 33 36\r",
+ "8 33 37\r",
+ "8 33 38\r",
+ "8 33 39\r",
+ "8 33 40\r",
+ "8 33 41\r",
+ "8 33 42\r",
+ "8 33 43\r",
+ "8 33 44\r",
+ "8 33 45\r",
+ "8 33 46\r",
+ "8 33 47\r",
+ "8 33 48\r",
+ "8 33 49\r",
+ "8 33 50\r",
+ "8 33 51\r",
+ "8 33 52\r",
+ "8 33 53\r",
+ "8 33 54\r",
+ "8 33 55\r",
+ "8 33 56\r",
+ "8 33 57\r",
+ "8 33 58\r",
+ "8 34 1\r",
+ "8 34 2\r",
+ "8 34 3\r",
+ "8 34 4\r",
+ "8 34 5\r",
+ "8 34 6\r",
+ "8 34 7\r",
+ "8 34 8\r",
+ "8 34 9\r",
+ "8 34 10\r",
+ "8 34 11\r",
+ "8 34 12\r",
+ "8 34 13\r",
+ "8 34 14\r",
+ "8 34 15\r",
+ "8 34 16\r",
+ "8 34 17\r",
+ "8 34 18\r",
+ "8 34 19\r",
+ "8 34 20\r",
+ "8 34 21\r",
+ "8 34 22\r",
+ "8 34 23\r",
+ "8 34 24\r",
+ "8 34 25\r",
+ "8 34 26\r",
+ "8 34 27\r",
+ "8 34 28\r",
+ "8 34 29\r",
+ "8 34 30\r",
+ "8 34 31\r",
+ "8 34 32\r",
+ "8 34 33\r",
+ "8 34 34\r",
+ "8 34 35\r",
+ "8 34 36\r",
+ "8 34 37\r",
+ "8 34 38\r",
+ "8 34 39\r",
+ "8 34 40\r",
+ "8 34 41\r",
+ "8 34 42\r",
+ "8 34 43\r",
+ "8 34 44\r",
+ "8 34 45\r",
+ "8 34 46\r",
+ "8 34 47\r",
+ "8 34 48\r",
+ "8 34 49\r",
+ "8 34 50\r",
+ "8 34 51\r",
+ "8 34 52\r",
+ "8 34 53\r",
+ "8 34 54\r",
+ "8 34 55\r",
+ "8 34 56\r",
+ "8 34 57\r",
+ "8 34 58\r",
+ "8 35 1\r",
+ "8 35 2\r",
+ "8 35 3\r",
+ "8 35 4\r",
+ "8 35 5\r",
+ "8 35 6\r",
+ "8 35 7\r",
+ "8 35 8\r",
+ "8 35 9\r",
+ "8 35 10\r",
+ "8 35 11\r",
+ "8 35 12\r",
+ "8 35 13\r",
+ "8 35 14\r",
+ "8 35 15\r",
+ "8 35 16\r",
+ "8 35 17\r",
+ "8 35 18\r",
+ "8 35 19\r",
+ "8 35 20\r",
+ "8 35 21\r",
+ "8 35 22\r",
+ "8 35 23\r",
+ "8 35 24\r",
+ "8 35 25\r",
+ "8 35 26\r",
+ "8 35 27\r",
+ "8 35 28\r",
+ "8 35 29\r",
+ "8 35 30\r",
+ "8 35 31\r",
+ "8 35 32\r",
+ "8 35 33\r",
+ "8 35 34\r",
+ "8 35 35\r",
+ "8 35 36\r",
+ "8 35 37\r",
+ "8 35 38\r",
+ "8 35 39\r",
+ "8 35 40\r",
+ "8 35 41\r",
+ "8 35 42\r",
+ "8 35 43\r",
+ "8 35 44\r",
+ "8 35 45\r",
+ "8 35 46\r",
+ "8 35 47\r",
+ "8 35 48\r",
+ "8 35 49\r",
+ "8 35 50\r",
+ "8 35 51\r",
+ "8 35 52\r",
+ "8 35 53\r",
+ "8 35 54\r",
+ "8 35 55\r",
+ "8 35 56\r",
+ "8 35 57\r",
+ "8 35 58\r",
+ "8 36 1\r",
+ "8 36 2\r",
+ "8 36 3\r",
+ "8 36 4\r",
+ "8 36 5\r",
+ "8 36 6\r",
+ "8 36 7\r",
+ "8 36 8\r",
+ "8 36 9\r",
+ "8 36 10\r",
+ "8 36 11\r",
+ "8 36 12\r",
+ "8 36 13\r",
+ "8 36 14\r",
+ "8 36 15\r",
+ "8 36 16\r",
+ "8 36 17\r",
+ "8 36 18\r",
+ "8 36 19\r",
+ "8 36 20\r",
+ "8 36 21\r",
+ "8 36 22\r",
+ "8 36 23\r",
+ "8 36 24\r",
+ "8 36 25\r",
+ "8 36 26\r",
+ "8 36 27\r",
+ "8 36 28\r",
+ "8 36 29\r",
+ "8 36 30\r",
+ "8 36 31\r",
+ "8 36 32\r",
+ "8 36 33\r",
+ "8 36 34\r",
+ "8 36 35\r",
+ "8 36 36\r",
+ "8 36 37\r",
+ "8 36 38\r",
+ "8 36 39\r",
+ "8 36 40\r",
+ "8 36 41\r",
+ "8 36 42\r",
+ "8 36 43\r",
+ "8 36 44\r",
+ "8 36 45\r",
+ "8 36 46\r",
+ "8 36 47\r",
+ "8 36 48\r",
+ "8 36 49\r",
+ "8 36 50\r",
+ "8 36 51\r",
+ "8 36 52\r",
+ "8 36 53\r",
+ "8 36 54\r",
+ "8 36 55\r",
+ "8 36 56\r",
+ "8 36 57\r",
+ "8 36 58\r",
+ "8 37 1\r",
+ "8 37 2\r",
+ "8 37 3\r",
+ "8 37 4\r",
+ "8 37 5\r",
+ "8 37 6\r",
+ "8 37 7\r",
+ "8 37 8\r",
+ "8 37 9\r",
+ "8 37 10\r",
+ "8 37 11\r",
+ "8 37 12\r",
+ "8 37 13\r",
+ "8 37 14\r",
+ "8 37 15\r",
+ "8 37 16\r",
+ "8 37 17\r",
+ "8 37 18\r",
+ "8 37 19\r",
+ "8 37 20\r",
+ "8 37 21\r",
+ "8 37 22\r",
+ "8 37 23\r",
+ "8 37 24\r",
+ "8 37 25\r",
+ "8 37 26\r",
+ "8 37 27\r",
+ "8 37 28\r",
+ "8 37 29\r",
+ "8 37 30\r",
+ "8 37 31\r",
+ "8 37 32\r",
+ "8 37 33\r",
+ "8 37 34\r",
+ "8 37 35\r",
+ "8 37 36\r",
+ "8 37 37\r",
+ "8 37 38\r",
+ "8 37 39\r",
+ "8 37 40\r",
+ "8 37 41\r",
+ "8 37 42\r",
+ "8 37 43\r",
+ "8 37 44\r",
+ "8 37 45\r",
+ "8 37 46\r",
+ "8 37 47\r",
+ "8 37 48\r",
+ "8 37 49\r",
+ "8 37 50\r",
+ "8 37 51\r",
+ "8 37 52\r",
+ "8 37 53\r",
+ "8 37 54\r",
+ "8 37 55\r",
+ "8 37 56\r",
+ "8 37 57\r",
+ "8 37 58\r",
+ "8 38 1\r",
+ "8 38 2\r",
+ "8 38 3\r",
+ "8 38 4\r",
+ "8 38 5\r",
+ "8 38 6\r",
+ "8 38 7\r",
+ "8 38 8\r",
+ "8 38 9\r",
+ "8 38 10\r",
+ "8 38 11\r",
+ "8 38 12\r",
+ "8 38 13\r",
+ "8 38 14\r",
+ "8 38 15\r",
+ "8 38 16\r",
+ "8 38 17\r",
+ "8 38 18\r",
+ "8 38 19\r",
+ "8 38 20\r",
+ "8 38 21\r",
+ "8 38 22\r",
+ "8 38 23\r",
+ "8 38 24\r",
+ "8 38 25\r",
+ "8 38 26\r",
+ "8 38 27\r",
+ "8 38 28\r",
+ "8 38 29\r",
+ "8 38 30\r",
+ "8 38 31\r",
+ "8 38 32\r",
+ "8 38 33\r",
+ "8 38 34\r",
+ "8 38 35\r",
+ "8 38 36\r",
+ "8 38 37\r",
+ "8 38 38\r",
+ "8 38 39\r",
+ "8 38 40\r",
+ "8 38 41\r",
+ "8 38 42\r",
+ "8 38 43\r",
+ "8 38 44\r",
+ "8 38 45\r",
+ "8 38 46\r",
+ "8 38 47\r",
+ "8 38 48\r",
+ "8 38 49\r",
+ "8 38 50\r",
+ "8 38 51\r",
+ "8 38 52\r",
+ "8 38 53\r",
+ "8 38 54\r",
+ "8 38 55\r",
+ "8 38 56\r",
+ "8 38 57\r",
+ "8 38 58\r",
+ "8 39 1\r",
+ "8 39 2\r",
+ "8 39 3\r",
+ "8 39 4\r",
+ "8 39 5\r",
+ "8 39 6\r",
+ "8 39 7\r",
+ "8 39 8\r",
+ "8 39 9\r",
+ "8 39 10\r",
+ "8 39 11\r",
+ "8 39 12\r",
+ "8 39 13\r",
+ "8 39 14\r",
+ "8 39 15\r",
+ "8 39 16\r",
+ "8 39 17\r",
+ "8 39 18\r",
+ "8 39 19\r",
+ "8 39 20\r",
+ "8 39 21\r",
+ "8 39 22\r",
+ "8 39 23\r",
+ "8 39 24\r",
+ "8 39 25\r",
+ "8 39 26\r",
+ "8 39 27\r",
+ "8 39 28\r",
+ "8 39 29\r",
+ "8 39 30\r",
+ "8 39 31\r",
+ "8 39 32\r",
+ "8 39 33\r",
+ "8 39 34\r",
+ "8 39 35\r",
+ "8 39 36\r",
+ "8 39 37\r",
+ "8 39 38\r",
+ "8 39 39\r",
+ "8 39 40\r",
+ "8 39 41\r",
+ "8 39 42\r",
+ "8 39 43\r",
+ "8 39 44\r",
+ "8 39 45\r",
+ "8 39 46\r",
+ "8 39 47\r",
+ "8 39 48\r",
+ "8 39 49\r",
+ "8 39 50\r",
+ "8 39 51\r",
+ "8 39 52\r",
+ "8 39 53\r",
+ "8 39 54\r",
+ "8 39 55\r",
+ "8 39 56\r",
+ "8 39 57\r",
+ "8 39 58\r",
+ "8 40 1\r",
+ "8 40 2\r",
+ "8 40 3\r",
+ "8 40 4\r",
+ "8 40 5\r",
+ "8 40 6\r",
+ "8 40 7\r",
+ "8 40 8\r",
+ "8 40 9\r",
+ "8 40 10\r",
+ "8 40 11\r",
+ "8 40 12\r",
+ "8 40 13\r",
+ "8 40 14\r",
+ "8 40 15\r",
+ "8 40 16\r",
+ "8 40 17\r",
+ "8 40 18\r",
+ "8 40 19\r",
+ "8 40 20\r",
+ "8 40 21\r",
+ "8 40 22\r",
+ "8 40 23\r",
+ "8 40 24\r",
+ "8 40 25\r",
+ "8 40 26\r",
+ "8 40 27\r",
+ "8 40 28\r",
+ "8 40 29\r",
+ "8 40 30\r",
+ "8 40 31\r",
+ "8 40 32\r",
+ "8 40 33\r",
+ "8 40 34\r",
+ "8 40 35\r",
+ "8 40 36\r",
+ "8 40 37\r",
+ "8 40 38\r",
+ "8 40 39\r",
+ "8 40 40\r",
+ "8 40 41\r",
+ "8 40 42\r",
+ "8 40 43\r",
+ "8 40 44\r",
+ "8 40 45\r",
+ "8 40 46\r",
+ "8 40 47\r",
+ "8 40 48\r",
+ "8 40 49\r",
+ "8 40 50\r",
+ "8 40 51\r",
+ "8 40 52\r",
+ "8 40 53\r",
+ "8 40 54\r",
+ "8 40 55\r",
+ "8 40 56\r",
+ "8 40 57\r",
+ "8 40 58\r",
+ "8 41 1\r",
+ "8 41 2\r",
+ "8 41 3\r",
+ "8 41 4\r",
+ "8 41 5\r",
+ "8 41 6\r",
+ "8 41 7\r",
+ "8 41 8\r",
+ "8 41 9\r",
+ "8 41 10\r",
+ "8 41 11\r",
+ "8 41 12\r",
+ "8 41 13\r",
+ "8 41 14\r",
+ "8 41 15\r",
+ "8 41 16\r",
+ "8 41 17\r",
+ "8 41 18\r",
+ "8 41 19\r",
+ "8 41 20\r",
+ "8 41 21\r",
+ "8 41 22\r",
+ "8 41 23\r",
+ "8 41 24\r",
+ "8 41 25\r",
+ "8 41 26\r",
+ "8 41 27\r",
+ "8 41 28\r",
+ "8 41 29\r",
+ "8 41 30\r",
+ "8 41 31\r",
+ "8 41 32\r",
+ "8 41 33\r",
+ "8 41 34\r",
+ "8 41 35\r",
+ "8 41 36\r",
+ "8 41 37\r",
+ "8 41 38\r",
+ "8 41 39\r",
+ "8 41 40\r",
+ "8 41 41\r",
+ "8 41 42\r",
+ "8 41 43\r",
+ "8 41 44\r",
+ "8 41 45\r",
+ "8 41 46\r",
+ "8 41 47\r",
+ "8 41 48\r",
+ "8 41 49\r",
+ "8 41 50\r",
+ "8 41 51\r",
+ "8 41 52\r",
+ "8 41 53\r",
+ "8 41 54\r",
+ "8 41 55\r",
+ "8 41 56\r",
+ "8 41 57\r",
+ "8 41 58\r",
+ "8 42 1\r",
+ "8 42 2\r",
+ "8 42 3\r",
+ "8 42 4\r",
+ "8 42 5\r",
+ "8 42 6\r",
+ "8 42 7\r",
+ "8 42 8\r",
+ "8 42 9\r",
+ "8 42 10\r",
+ "8 42 11\r",
+ "8 42 12\r",
+ "8 42 13\r",
+ "8 42 14\r",
+ "8 42 15\r",
+ "8 42 16\r",
+ "8 42 17\r",
+ "8 42 18\r",
+ "8 42 19\r",
+ "8 42 20\r",
+ "8 42 21\r",
+ "8 42 22\r",
+ "8 42 23\r",
+ "8 42 24\r",
+ "8 42 25\r",
+ "8 42 26\r",
+ "8 42 27\r",
+ "8 42 28\r",
+ "8 42 29\r",
+ "8 42 30\r",
+ "8 42 31\r",
+ "8 42 32\r",
+ "8 42 33\r",
+ "8 42 34\r",
+ "8 42 35\r",
+ "8 42 36\r",
+ "8 42 37\r",
+ "8 42 38\r",
+ "8 42 39\r",
+ "8 42 40\r",
+ "8 42 41\r",
+ "8 42 42\r",
+ "8 42 43\r",
+ "8 42 44\r",
+ "8 42 45\r",
+ "8 42 46\r",
+ "8 42 47\r",
+ "8 42 48\r",
+ "8 42 49\r",
+ "8 42 50\r",
+ "8 42 51\r",
+ "8 42 52\r",
+ "8 42 53\r",
+ "8 42 54\r",
+ "8 42 55\r",
+ "8 42 56\r",
+ "8 42 57\r",
+ "8 42 58\r",
+ "8 43 1\r",
+ "8 43 2\r",
+ "8 43 3\r",
+ "8 43 4\r",
+ "8 43 5\r",
+ "8 43 6\r",
+ "8 43 7\r",
+ "8 43 8\r",
+ "8 43 9\r",
+ "8 43 10\r",
+ "8 43 11\r",
+ "8 43 12\r",
+ "8 43 13\r",
+ "8 43 14\r",
+ "8 43 15\r",
+ "8 43 16\r",
+ "8 43 17\r",
+ "8 43 18\r",
+ "8 43 19\r",
+ "8 43 20\r",
+ "8 43 21\r",
+ "8 43 22\r",
+ "8 43 23\r",
+ "8 43 24\r",
+ "8 43 25\r",
+ "8 43 26\r",
+ "8 43 27\r",
+ "8 43 28\r",
+ "8 43 29\r",
+ "8 43 30\r",
+ "8 43 31\r",
+ "8 43 32\r",
+ "8 43 33\r",
+ "8 43 34\r",
+ "8 43 35\r",
+ "8 43 36\r",
+ "8 43 37\r",
+ "8 43 38\r",
+ "8 43 39\r",
+ "8 43 40\r",
+ "8 43 41\r",
+ "8 43 42\r",
+ "8 43 43\r",
+ "8 43 44\r",
+ "8 43 45\r",
+ "8 43 46\r",
+ "8 43 47\r",
+ "8 43 48\r",
+ "8 43 49\r",
+ "8 43 50\r",
+ "8 43 51\r",
+ "8 43 52\r",
+ "8 43 53\r",
+ "8 43 54\r",
+ "8 43 55\r",
+ "8 43 56\r",
+ "8 43 57\r",
+ "8 43 58\r",
+ "8 44 1\r",
+ "8 44 2\r",
+ "8 44 3\r",
+ "8 44 4\r",
+ "8 44 5\r",
+ "8 44 6\r",
+ "8 44 7\r",
+ "8 44 8\r",
+ "8 44 9\r",
+ "8 44 10\r",
+ "8 44 11\r",
+ "8 44 12\r",
+ "8 44 13\r",
+ "8 44 14\r",
+ "8 44 15\r",
+ "8 44 16\r",
+ "8 44 17\r",
+ "8 44 18\r",
+ "8 44 19\r",
+ "8 44 20\r",
+ "8 44 21\r",
+ "8 44 22\r",
+ "8 44 23\r",
+ "8 44 24\r",
+ "8 44 25\r",
+ "8 44 26\r",
+ "8 44 27\r",
+ "8 44 28\r",
+ "8 44 29\r",
+ "8 44 30\r",
+ "8 44 31\r",
+ "8 44 32\r",
+ "8 44 33\r",
+ "8 44 34\r",
+ "8 44 35\r",
+ "8 44 36\r",
+ "8 44 37\r",
+ "8 44 38\r",
+ "8 44 39\r",
+ "8 44 40\r",
+ "8 44 41\r",
+ "8 44 42\r",
+ "8 44 43\r",
+ "8 44 44\r",
+ "8 44 45\r",
+ "8 44 46\r",
+ "8 44 47\r",
+ "8 44 48\r",
+ "8 44 49\r",
+ "8 44 50\r",
+ "8 44 51\r",
+ "8 44 52\r",
+ "8 44 53\r",
+ "8 44 54\r",
+ "8 44 55\r",
+ "8 44 56\r",
+ "8 44 57\r",
+ "8 44 58\r",
+ "8 45 1\r",
+ "8 45 2\r",
+ "8 45 3\r",
+ "8 45 4\r",
+ "8 45 5\r",
+ "8 45 6\r",
+ "8 45 7\r",
+ "8 45 8\r",
+ "8 45 9"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "8 45 10\r",
+ "8 45 11\r",
+ "8 45 12\r",
+ "8 45 13\r",
+ "8 45 14\r",
+ "8 45 15\r",
+ "8 45 16\r",
+ "8 45 17\r",
+ "8 45 18\r",
+ "8 45 19\r",
+ "8 45 20\r",
+ "8 45 21\r",
+ "8 45 22\r",
+ "8 45 23\r",
+ "8 45 24\r",
+ "8 45 25\r",
+ "8 45 26\r",
+ "8 45 27\r",
+ "8 45 28\r",
+ "8 45 29\r",
+ "8 45 30\r",
+ "8 45 31\r",
+ "8 45 32\r",
+ "8 45 33\r",
+ "8 45 34\r",
+ "8 45 35\r",
+ "8 45 36\r",
+ "8 45 37\r",
+ "8 45 38\r",
+ "8 45 39\r",
+ "8 45 40\r",
+ "8 45 41\r",
+ "8 45 42\r",
+ "8 45 43\r",
+ "8 45 44\r",
+ "8 45 45\r",
+ "8 45 46\r",
+ "8 45 47\r",
+ "8 45 48\r",
+ "8 45 49\r",
+ "8 45 50\r",
+ "8 45 51\r",
+ "8 45 52\r",
+ "8 45 53\r",
+ "8 45 54\r",
+ "8 45 55\r",
+ "8 45 56\r",
+ "8 45 57\r",
+ "8 45 58\r",
+ "8 46 1\r",
+ "8 46 2\r",
+ "8 46 3\r",
+ "8 46 4\r",
+ "8 46 5\r",
+ "8 46 6\r",
+ "8 46 7\r",
+ "8 46 8\r",
+ "8 46 9\r",
+ "8 46 10\r",
+ "8 46 11\r",
+ "8 46 12\r",
+ "8 46 13\r",
+ "8 46 14\r",
+ "8 46 15\r",
+ "8 46 16\r",
+ "8 46 17\r",
+ "8 46 18\r",
+ "8 46 19\r",
+ "8 46 20\r",
+ "8 46 21\r",
+ "8 46 22\r",
+ "8 46 23\r",
+ "8 46 24\r",
+ "8 46 25\r",
+ "8 46 26\r",
+ "8 46 27\r",
+ "8 46 28\r",
+ "8 46 29\r",
+ "8 46 30\r",
+ "8 46 31\r",
+ "8 46 32\r",
+ "8 46 33\r",
+ "8 46 34\r",
+ "8 46 35\r",
+ "8 46 36\r",
+ "8 46 37\r",
+ "8 46 38\r",
+ "8 46 39\r",
+ "8 46 40\r",
+ "8 46 41\r",
+ "8 46 42\r",
+ "8 46 43\r",
+ "8 46 44\r",
+ "8 46 45\r",
+ "8 46 46\r",
+ "8 46 47\r",
+ "8 46 48\r",
+ "8 46 49\r",
+ "8 46 50\r",
+ "8 46 51\r",
+ "8 46 52\r",
+ "8 46 53\r",
+ "8 46 54\r",
+ "8 46 55\r",
+ "8 46 56\r",
+ "8 46 57\r",
+ "8 46 58\r",
+ "8 47 1\r",
+ "8 47 2\r",
+ "8 47 3\r",
+ "8 47 4\r",
+ "8 47 5\r",
+ "8 47 6\r",
+ "8 47 7\r",
+ "8 47 8\r",
+ "8 47 9\r",
+ "8 47 10\r",
+ "8 47 11\r",
+ "8 47 12\r",
+ "8 47 13\r",
+ "8 47 14\r",
+ "8 47 15\r",
+ "8 47 16\r",
+ "8 47 17\r",
+ "8 47 18\r",
+ "8 47 19\r",
+ "8 47 20\r",
+ "8 47 21\r",
+ "8 47 22\r",
+ "8 47 23\r",
+ "8 47 24\r",
+ "8 47 25\r",
+ "8 47 26\r",
+ "8 47 27\r",
+ "8 47 28\r",
+ "8 47 29\r",
+ "8 47 30\r",
+ "8 47 31\r",
+ "8 47 32\r",
+ "8 47 33\r",
+ "8 47 34\r",
+ "8 47 35\r",
+ "8 47 36\r",
+ "8 47 37\r",
+ "8 47 38\r",
+ "8 47 39\r",
+ "8 47 40\r",
+ "8 47 41\r",
+ "8 47 42\r",
+ "8 47 43\r",
+ "8 47 44\r",
+ "8 47 45\r",
+ "8 47 46\r",
+ "8 47 47\r",
+ "8 47 48\r",
+ "8 47 49\r",
+ "8 47 50\r",
+ "8 47 51\r",
+ "8 47 52\r",
+ "8 47 53\r",
+ "8 47 54\r",
+ "8 47 55\r",
+ "8 47 56\r",
+ "8 47 57\r",
+ "8 47 58\r",
+ "8 48 1\r",
+ "8 48 2\r",
+ "8 48 3\r",
+ "8 48 4\r",
+ "8 48 5\r",
+ "8 48 6\r",
+ "8 48 7\r",
+ "8 48 8\r",
+ "8 48 9\r",
+ "8 48 10\r",
+ "8 48 11\r",
+ "8 48 12\r",
+ "8 48 13\r",
+ "8 48 14\r",
+ "8 48 15\r",
+ "8 48 16\r",
+ "8 48 17\r",
+ "8 48 18\r",
+ "8 48 19\r",
+ "8 48 20\r",
+ "8 48 21\r",
+ "8 48 22\r",
+ "8 48 23\r",
+ "8 48 24\r",
+ "8 48 25\r",
+ "8 48 26\r",
+ "8 48 27\r",
+ "8 48 28\r",
+ "8 48 29\r",
+ "8 48 30\r",
+ "8 48 31\r",
+ "8 48 32\r",
+ "8 48 33\r",
+ "8 48 34\r",
+ "8 48 35\r",
+ "8 48 36\r",
+ "8 48 37\r",
+ "8 48 38\r",
+ "8 48 39\r",
+ "8 48 40\r",
+ "8 48 41\r",
+ "8 48 42\r",
+ "8 48 43\r",
+ "8 48 44\r",
+ "8 48 45\r",
+ "8 48 46\r",
+ "8 48 47\r",
+ "8 48 48\r",
+ "8 48 49\r",
+ "8 48 50\r",
+ "8 48 51\r",
+ "8 48 52\r",
+ "8 48 53\r",
+ "8 48 54\r",
+ "8 48 55\r",
+ "8 48 56\r",
+ "8 48 57\r",
+ "8 48 58\r",
+ "8 49 1\r",
+ "8 49 2\r",
+ "8 49 3\r",
+ "8 49 4\r",
+ "8 49 5\r",
+ "8 49 6\r",
+ "8 49 7\r",
+ "8 49 8\r",
+ "8 49 9\r",
+ "8 49 10\r",
+ "8 49 11\r",
+ "8 49 12\r",
+ "8 49 13\r",
+ "8 49 14\r",
+ "8 49 15\r",
+ "8 49 16\r",
+ "8 49 17\r",
+ "8 49 18\r",
+ "8 49 19\r",
+ "8 49 20\r",
+ "8 49 21\r",
+ "8 49 22\r",
+ "8 49 23\r",
+ "8 49 24\r",
+ "8 49 25\r",
+ "8 49 26\r",
+ "8 49 27\r",
+ "8 49 28\r",
+ "8 49 29\r",
+ "8 49 30\r",
+ "8 49 31\r",
+ "8 49 32\r",
+ "8 49 33\r",
+ "8 49 34\r",
+ "8 49 35\r",
+ "8 49 36\r",
+ "8 49 37\r",
+ "8 49 38\r",
+ "8 49 39\r",
+ "8 49 40\r",
+ "8 49 41\r",
+ "8 49 42\r",
+ "8 49 43\r",
+ "8 49 44\r",
+ "8 49 45\r",
+ "8 49 46\r",
+ "8 49 47\r",
+ "8 49 48\r",
+ "8 49 49\r",
+ "8 49 50\r",
+ "8 49 51\r",
+ "8 49 52\r",
+ "8 49 53\r",
+ "8 49 54\r",
+ "8 49 55\r",
+ "8 49 56\r",
+ "8 49 57\r",
+ "8 49 58\r",
+ "8 50 1\r",
+ "8 50 2\r",
+ "8 50 3\r",
+ "8 50 4\r",
+ "8 50 5\r",
+ "8 50 6\r",
+ "8 50 7\r",
+ "8 50 8\r",
+ "8 50 9\r",
+ "8 50 10\r",
+ "8 50 11\r",
+ "8 50 12\r",
+ "8 50 13\r",
+ "8 50 14\r",
+ "8 50 15\r",
+ "8 50 16\r",
+ "8 50 17\r",
+ "8 50 18\r",
+ "8 50 19\r",
+ "8 50 20\r",
+ "8 50 21\r",
+ "8 50 22\r",
+ "8 50 23\r",
+ "8 50 24\r",
+ "8 50 25\r",
+ "8 50 26\r",
+ "8 50 27\r",
+ "8 50 28\r",
+ "8 50 29\r",
+ "8 50 30\r",
+ "8 50 31\r",
+ "8 50 32\r",
+ "8 50 33\r",
+ "8 50 34\r",
+ "8 50 35\r",
+ "8 50 36\r",
+ "8 50 37\r",
+ "8 50 38\r",
+ "8 50 39\r",
+ "8 50 40\r",
+ "8 50 41\r",
+ "8 50 42\r",
+ "8 50 43\r",
+ "8 50 44\r",
+ "8 50 45\r",
+ "8 50 46\r",
+ "8 50 47\r",
+ "8 50 48\r",
+ "8 50 49\r",
+ "8 50 50\r",
+ "8 50 51\r",
+ "8 50 52\r",
+ "8 50 53\r",
+ "8 50 54\r",
+ "8 50 55\r",
+ "8 50 56\r",
+ "8 50 57\r",
+ "8 50 58\r",
+ "8 51 1\r",
+ "8 51 2\r",
+ "8 51 3\r",
+ "8 51 4\r",
+ "8 51 5\r",
+ "8 51 6\r",
+ "8 51 7\r",
+ "8 51 8\r",
+ "8 51 9\r",
+ "8 51 10\r",
+ "8 51 11\r",
+ "8 51 12\r",
+ "8 51 13\r",
+ "8 51 14\r",
+ "8 51 15\r",
+ "8 51 16\r",
+ "8 51 17\r",
+ "8 51 18\r",
+ "8 51 19\r",
+ "8 51 20\r",
+ "8 51 21\r",
+ "8 51 22\r",
+ "8 51 23\r",
+ "8 51 24\r",
+ "8 51 25\r",
+ "8 51 26\r",
+ "8 51 27\r",
+ "8 51 28\r",
+ "8 51 29\r",
+ "8 51 30\r",
+ "8 51 31\r",
+ "8 51 32\r",
+ "8 51 33\r",
+ "8 51 34\r",
+ "8 51 35\r",
+ "8 51 36\r",
+ "8 51 37\r",
+ "8 51 38\r",
+ "8 51 39\r",
+ "8 51 40\r",
+ "8 51 41\r",
+ "8 51 42\r",
+ "8 51 43\r",
+ "8 51 44\r",
+ "8 51 45\r",
+ "8 51 46\r",
+ "8 51 47\r",
+ "8 51 48\r",
+ "8 51 49\r",
+ "8 51 50\r",
+ "8 51 51\r",
+ "8 51 52\r",
+ "8 51 53\r",
+ "8 51 54\r",
+ "8 51 55\r",
+ "8 51 56\r",
+ "8 51 57\r",
+ "8 51 58\r",
+ "8 52 1\r",
+ "8 52 2\r",
+ "8 52 3\r",
+ "8 52 4\r",
+ "8 52 5\r",
+ "8 52 6\r",
+ "8 52 7\r",
+ "8 52 8\r",
+ "8 52 9\r",
+ "8 52 10\r",
+ "8 52 11\r",
+ "8 52 12\r",
+ "8 52 13\r",
+ "8 52 14\r",
+ "8 52 15\r",
+ "8 52 16\r",
+ "8 52 17\r",
+ "8 52 18\r",
+ "8 52 19\r",
+ "8 52 20\r",
+ "8 52 21\r",
+ "8 52 22\r",
+ "8 52 23\r",
+ "8 52 24\r",
+ "8 52 25\r",
+ "8 52 26\r",
+ "8 52 27\r",
+ "8 52 28\r",
+ "8 52 29\r",
+ "8 52 30\r",
+ "8 52 31\r",
+ "8 52 32\r",
+ "8 52 33\r",
+ "8 52 34\r",
+ "8 52 35\r",
+ "8 52 36\r",
+ "8 52 37\r",
+ "8 52 38\r",
+ "8 52 39\r",
+ "8 52 40\r",
+ "8 52 41\r",
+ "8 52 42\r",
+ "8 52 43\r",
+ "8 52 44\r",
+ "8 52 45\r",
+ "8 52 46\r",
+ "8 52 47\r",
+ "8 52 48\r",
+ "8 52 49\r",
+ "8 52 50\r",
+ "8 52 51\r",
+ "8 52 52\r",
+ "8 52 53\r",
+ "8 52 54\r",
+ "8 52 55\r",
+ "8 52 56\r",
+ "8 52 57\r",
+ "8 52 58\r",
+ "8 53 1\r",
+ "8 53 2\r",
+ "8 53 3\r",
+ "8 53 4\r",
+ "8 53 5\r",
+ "8 53 6\r",
+ "8 53 7\r",
+ "8 53 8\r",
+ "8 53 9\r",
+ "8 53 10\r",
+ "8 53 11\r",
+ "8 53 12\r",
+ "8 53 13\r",
+ "8 53 14\r",
+ "8 53 15\r",
+ "8 53 16\r",
+ "8 53 17\r",
+ "8 53 18\r",
+ "8 53 19\r",
+ "8 53 20\r",
+ "8 53 21\r",
+ "8 53 22\r",
+ "8 53 23\r",
+ "8 53 24\r",
+ "8 53 25\r",
+ "8 53 26\r",
+ "8 53 27\r",
+ "8 53 28\r",
+ "8 53 29\r",
+ "8 53 30\r",
+ "8 53 31\r",
+ "8 53 32\r",
+ "8 53 33\r",
+ "8 53 34\r",
+ "8 53 35\r",
+ "8 53 36\r",
+ "8 53 37\r",
+ "8 53 38\r",
+ "8 53 39\r",
+ "8 53 40\r",
+ "8 53 41\r",
+ "8 53 42\r",
+ "8 53 43\r",
+ "8 53 44\r",
+ "8 53 45\r",
+ "8 53 46\r",
+ "8 53 47\r",
+ "8 53 48\r",
+ "8 53 49\r",
+ "8 53 50\r",
+ "8 53 51\r",
+ "8 53 52\r",
+ "8 53 53\r",
+ "8 53 54\r",
+ "8 53 55\r",
+ "8 53 56\r",
+ "8 53 57\r",
+ "8 53 58\r",
+ "8 54 1\r",
+ "8 54 2\r",
+ "8 54 3\r",
+ "8 54 4\r",
+ "8 54 5\r",
+ "8 54 6\r",
+ "8 54 7\r",
+ "8 54 8\r",
+ "8 54 9\r",
+ "8 54 10\r",
+ "8 54 11\r",
+ "8 54 12\r",
+ "8 54 13\r",
+ "8 54 14\r",
+ "8 54 15\r",
+ "8 54 16\r",
+ "8 54 17\r",
+ "8 54 18\r",
+ "8 54 19\r",
+ "8 54 20\r",
+ "8 54 21\r",
+ "8 54 22\r",
+ "8 54 23\r",
+ "8 54 24\r",
+ "8 54 25\r",
+ "8 54 26\r",
+ "8 54 27\r",
+ "8 54 28\r",
+ "8 54 29\r",
+ "8 54 30\r",
+ "8 54 31\r",
+ "8 54 32\r",
+ "8 54 33\r",
+ "8 54 34\r",
+ "8 54 35\r",
+ "8 54 36\r",
+ "8 54 37\r",
+ "8 54 38\r",
+ "8 54 39\r",
+ "8 54 40\r",
+ "8 54 41\r",
+ "8 54 42\r",
+ "8 54 43\r",
+ "8 54 44\r",
+ "8 54 45\r",
+ "8 54 46\r",
+ "8 54 47\r",
+ "8 54 48\r",
+ "8 54 49\r",
+ "8 54 50\r",
+ "8 54 51\r",
+ "8 54 52\r",
+ "8 54 53\r",
+ "8 54 54\r",
+ "8 54 55\r",
+ "8 54 56\r",
+ "8 54 57\r",
+ "8 54 58\r",
+ "8 55 1\r",
+ "8 55 2\r",
+ "8 55 3\r",
+ "8 55 4\r",
+ "8 55 5\r",
+ "8 55 6\r",
+ "8 55 7\r",
+ "8 55 8\r",
+ "8 55 9\r",
+ "8 55 10\r",
+ "8 55 11\r",
+ "8 55 12\r",
+ "8 55 13\r",
+ "8 55 14\r",
+ "8 55 15\r",
+ "8 55 16\r",
+ "8 55 17\r",
+ "8 55 18\r",
+ "8 55 19\r",
+ "8 55 20\r",
+ "8 55 21\r",
+ "8 55 22\r",
+ "8 55 23\r",
+ "8 55 24\r",
+ "8 55 25\r",
+ "8 55 26\r",
+ "8 55 27\r",
+ "8 55 28\r",
+ "8 55 29\r",
+ "8 55 30\r",
+ "8 55 31\r",
+ "8 55 32\r",
+ "8 55 33\r",
+ "8 55 34\r",
+ "8 55 35\r",
+ "8 55 36\r",
+ "8 55 37\r",
+ "8 55 38\r",
+ "8 55 39\r",
+ "8 55 40\r",
+ "8 55 41\r",
+ "8 55 42\r",
+ "8 55 43\r",
+ "8 55 44\r",
+ "8 55 45\r",
+ "8 55 46\r",
+ "8 55 47\r",
+ "8 55 48\r",
+ "8 55 49\r",
+ "8 55 50\r",
+ "8 55 51\r",
+ "8 55 52\r",
+ "8 55 53\r",
+ "8 55 54\r",
+ "8 55 55\r",
+ "8 55 56\r",
+ "8 55 57\r",
+ "8 55 58\r",
+ "8 56 1\r",
+ "8 56 2\r",
+ "8 56 3\r",
+ "8 56 4\r",
+ "8 56 5\r",
+ "8 56 6\r",
+ "8 56 7\r",
+ "8 56 8\r",
+ "8 56 9\r",
+ "8 56 10\r",
+ "8 56 11\r",
+ "8 56 12\r",
+ "8 56 13\r",
+ "8 56 14\r",
+ "8 56 15\r",
+ "8 56 16\r",
+ "8 56 17\r",
+ "8 56 18\r",
+ "8 56 19\r",
+ "8 56 20\r",
+ "8 56 21\r",
+ "8 56 22\r",
+ "8 56 23\r",
+ "8 56 24\r",
+ "8 56 25\r",
+ "8 56 26\r",
+ "8 56 27\r",
+ "8 56 28\r",
+ "8 56 29\r",
+ "8 56 30\r",
+ "8 56 31\r",
+ "8 56 32\r",
+ "8 56 33\r",
+ "8 56 34\r",
+ "8 56 35\r",
+ "8 56 36\r",
+ "8 56 37\r",
+ "8 56 38\r",
+ "8 56 39\r",
+ "8 56 40\r",
+ "8 56 41\r",
+ "8 56 42\r",
+ "8 56 43\r",
+ "8 56 44\r",
+ "8 56 45\r",
+ "8 56 46\r",
+ "8 56 47\r",
+ "8 56 48\r",
+ "8 56 49\r",
+ "8 56 50\r",
+ "8 56 51\r",
+ "8 56 52\r",
+ "8 56 53\r",
+ "8 56 54\r",
+ "8 56 55\r",
+ "8 56 56\r",
+ "8 56 57\r",
+ "8 56 58\r",
+ "8 57 1\r",
+ "8 57 2\r",
+ "8 57 3\r",
+ "8 57 4\r",
+ "8 57 5\r",
+ "8 57 6\r",
+ "8 57 7\r",
+ "8 57 8\r",
+ "8 57 9\r",
+ "8 57 10\r",
+ "8 57 11\r",
+ "8 57 12\r",
+ "8 57 13\r",
+ "8 57 14\r",
+ "8 57 15\r",
+ "8 57 16\r",
+ "8 57 17\r",
+ "8 57 18\r",
+ "8 57 19\r",
+ "8 57 20\r",
+ "8 57 21\r",
+ "8 57 22\r",
+ "8 57 23\r",
+ "8 57 24\r",
+ "8 57 25\r",
+ "8 57 26\r",
+ "8 57 27\r",
+ "8 57 28\r",
+ "8 57 29\r",
+ "8 57 30\r",
+ "8 57 31\r",
+ "8 57 32\r",
+ "8 57 33\r",
+ "8 57 34\r",
+ "8 57 35\r",
+ "8 57 36\r",
+ "8 57 37\r",
+ "8 57 38\r",
+ "8 57 39\r",
+ "8 57 40\r",
+ "8 57 41\r",
+ "8 57 42\r",
+ "8 57 43\r",
+ "8 57 44\r",
+ "8 57 45\r",
+ "8 57 46\r",
+ "8 57 47\r",
+ "8 57 48\r",
+ "8 57 49\r",
+ "8 57 50\r",
+ "8 57 51\r",
+ "8 57 52\r",
+ "8 57 53\r",
+ "8 57 54\r",
+ "8 57 55\r",
+ "8 57 56\r",
+ "8 57 57\r",
+ "8 57 58\r",
+ "8 58 1\r",
+ "8 58 2\r",
+ "8 58 3\r",
+ "8 58 4\r",
+ "8 58 5\r",
+ "8 58 6\r",
+ "8 58 7\r",
+ "8 58 8\r",
+ "8 58 9\r",
+ "8 58 10\r",
+ "8 58 11\r",
+ "8 58 12\r",
+ "8 58 13\r",
+ "8 58 14\r",
+ "8 58 15\r",
+ "8 58 16\r",
+ "8 58 17\r",
+ "8 58 18\r",
+ "8 58 19\r",
+ "8 58 20\r",
+ "8 58 21\r",
+ "8 58 22\r",
+ "8 58 23\r",
+ "8 58 24\r",
+ "8 58 25\r",
+ "8 58 26\r",
+ "8 58 27\r",
+ "8 58 28\r",
+ "8 58 29\r",
+ "8 58 30\r",
+ "8 58 31\r",
+ "8 58 32\r",
+ "8 58 33\r",
+ "8 58 34\r",
+ "8 58 35\r",
+ "8 58 36\r",
+ "8 58 37\r",
+ "8 58 38\r",
+ "8 58 39\r",
+ "8 58 40\r",
+ "8 58 41\r",
+ "8 58 42\r",
+ "8 58 43\r",
+ "8 58 44\r",
+ "8 58 45\r",
+ "8 58 46\r",
+ "8 58 47\r",
+ "8 58 48\r",
+ "8 58 49\r",
+ "8 58 50\r",
+ "8 58 51\r",
+ "8 58 52\r",
+ "8 58 53\r",
+ "8 58 54\r",
+ "8 58 55\r",
+ "8 58 56\r",
+ "8 58 57\r",
+ "8 58 58\r",
+ "9 1 1\r",
+ "9 1 2\r",
+ "9 1 3\r",
+ "9 1 4\r",
+ "9 1 5\r",
+ "9 1 6\r",
+ "9 1 7\r",
+ "9 1 8\r",
+ "9 1 9\r",
+ "9 1 10\r",
+ "9 1 11\r",
+ "9 1 12\r",
+ "9 1 13\r",
+ "9 1 14\r",
+ "9 1 15\r",
+ "9 1 16\r",
+ "9 1 17\r",
+ "9 1 18\r",
+ "9 1 19\r",
+ "9 1 20\r",
+ "9 1 21\r",
+ "9 1 22\r",
+ "9 1 23\r",
+ "9 1 24\r",
+ "9 1 25\r",
+ "9 1 26\r",
+ "9 1 27\r",
+ "9 1 28\r",
+ "9 1 29\r",
+ "9 1 30\r",
+ "9 1 31\r",
+ "9 1 32\r",
+ "9 1 33\r",
+ "9 1 34\r",
+ "9 1 35\r",
+ "9 1 36\r",
+ "9 1 37\r",
+ "9 1 38\r",
+ "9 1 39\r",
+ "9 1 40\r",
+ "9 1 41\r",
+ "9 1 42\r",
+ "9 1 43\r",
+ "9 1 44\r",
+ "9 1 45\r",
+ "9 1 46\r",
+ "9 1 47\r",
+ "9 1 48\r",
+ "9 1 49\r",
+ "9 1 50\r",
+ "9 1 51\r",
+ "9 1 52\r",
+ "9 1 53\r",
+ "9 1 54\r",
+ "9 1 55\r",
+ "9 1 56\r",
+ "9 1 57\r",
+ "9 1 58\r",
+ "9 2 1\r",
+ "9 2 2\r",
+ "9 2 3\r",
+ "9 2 4\r",
+ "9 2 5\r",
+ "9 2 6\r",
+ "9 2 7\r",
+ "9 2 8\r",
+ "9 2 9\r",
+ "9 2 10\r",
+ "9 2 11\r",
+ "9 2 12\r",
+ "9 2 13\r",
+ "9 2 14\r",
+ "9 2 15\r",
+ "9 2 16\r",
+ "9 2 17\r",
+ "9 2 18\r",
+ "9 2 19\r",
+ "9 2 20\r",
+ "9 2 21\r",
+ "9 2 22\r",
+ "9 2 23\r",
+ "9 2 24\r",
+ "9 2 25\r",
+ "9 2 26\r",
+ "9 2 27\r",
+ "9 2 28\r",
+ "9 2 29\r",
+ "9 2 30\r",
+ "9 2 31\r",
+ "9 2 32\r",
+ "9 2 33\r",
+ "9 2 34\r",
+ "9 2 35\r",
+ "9 2 36\r",
+ "9 2 37\r",
+ "9 2 38\r",
+ "9 2 39\r",
+ "9 2 40\r",
+ "9 2 41\r",
+ "9 2 42\r",
+ "9 2 43\r",
+ "9 2 44\r",
+ "9 2 45\r",
+ "9 2 46\r",
+ "9 2 47\r",
+ "9 2 48\r",
+ "9 2 49\r",
+ "9 2 50\r",
+ "9 2 51\r",
+ "9 2 52\r",
+ "9 2 53\r",
+ "9 2 54\r",
+ "9 2 55\r",
+ "9 2 56\r",
+ "9 2 57\r",
+ "9 2 58\r",
+ "9 3 1\r",
+ "9 3 2\r",
+ "9 3 3\r",
+ "9 3 4\r",
+ "9 3 5\r",
+ "9 3 6\r",
+ "9 3 7\r",
+ "9 3 8\r",
+ "9 3 9\r",
+ "9 3 10\r",
+ "9 3 11\r",
+ "9 3 12\r",
+ "9 3 13\r",
+ "9 3 14\r",
+ "9 3 15\r",
+ "9 3 16\r",
+ "9 3 17\r",
+ "9 3 18\r",
+ "9 3 19\r",
+ "9 3 20\r",
+ "9 3 21\r",
+ "9 3 22\r",
+ "9 3 23\r",
+ "9 3 24\r",
+ "9 3 25\r",
+ "9 3 26\r",
+ "9 3 27\r",
+ "9 3 28\r",
+ "9 3 29\r",
+ "9 3 30\r",
+ "9 3 31\r",
+ "9 3 32\r",
+ "9 3 33\r",
+ "9 3 34\r",
+ "9 3 35\r",
+ "9 3 36\r",
+ "9 3 37\r",
+ "9 3 38\r",
+ "9 3 39\r",
+ "9 3 40\r",
+ "9 3 41\r",
+ "9 3 42\r",
+ "9 3 43\r",
+ "9 3 44\r",
+ "9 3 45\r",
+ "9 3 46\r",
+ "9 3 47\r",
+ "9 3 48\r",
+ "9 3 49\r",
+ "9 3 50\r",
+ "9 3 51\r",
+ "9 3 52\r",
+ "9 3 53\r",
+ "9 3 54\r",
+ "9 3 55\r",
+ "9 3 56\r",
+ "9 3 57\r",
+ "9 3 58\r",
+ "9 4 1\r",
+ "9 4 2\r",
+ "9 4 3\r",
+ "9 4 4\r",
+ "9 4 5\r",
+ "9 4 6\r",
+ "9 4 7\r",
+ "9 4 8\r",
+ "9 4 9\r",
+ "9 4 10\r",
+ "9 4 11\r",
+ "9 4 12\r",
+ "9 4 13\r",
+ "9 4 14\r",
+ "9 4 15\r",
+ "9 4 16\r",
+ "9 4 17\r",
+ "9 4 18\r",
+ "9 4 19\r",
+ "9 4 20\r",
+ "9 4 21\r",
+ "9 4 22\r",
+ "9 4 23\r",
+ "9 4 24\r",
+ "9 4 25\r",
+ "9 4 26\r",
+ "9 4 27\r",
+ "9 4 28\r",
+ "9 4 29\r",
+ "9 4 30\r",
+ "9 4 31\r",
+ "9 4 32\r",
+ "9 4 33\r",
+ "9 4 34\r",
+ "9 4 35\r",
+ "9 4 36\r",
+ "9 4 37\r",
+ "9 4 38\r",
+ "9 4 39\r",
+ "9 4 40\r",
+ "9 4 41\r",
+ "9 4 42\r",
+ "9 4 43\r",
+ "9 4 44\r",
+ "9 4 45\r",
+ "9 4 46\r",
+ "9 4 47\r",
+ "9 4 48\r",
+ "9 4 49\r",
+ "9 4 50\r",
+ "9 4 51\r",
+ "9 4 52\r",
+ "9 4 53\r",
+ "9 4 54\r",
+ "9 4 55\r",
+ "9 4 56\r",
+ "9 4 57\r",
+ "9 4 58\r",
+ "9 5 1\r",
+ "9 5 2\r",
+ "9 5 3\r",
+ "9 5 4\r",
+ "9 5 5\r",
+ "9 5 6\r",
+ "9 5 7\r",
+ "9 5 8\r",
+ "9 5 9\r",
+ "9 5 10\r",
+ "9 5 11\r",
+ "9 5 12\r",
+ "9 5 13\r",
+ "9 5 14\r",
+ "9 5 15\r",
+ "9 5 16\r",
+ "9 5 17\r",
+ "9 5 18\r",
+ "9 5 19\r",
+ "9 5 20\r",
+ "9 5 21\r",
+ "9 5 22\r",
+ "9 5 23\r",
+ "9 5 24\r",
+ "9 5 25\r",
+ "9 5 26\r",
+ "9 5 27\r",
+ "9 5 28\r",
+ "9 5 29\r",
+ "9 5 30\r",
+ "9 5 31\r",
+ "9 5 32\r",
+ "9 5 33\r",
+ "9 5 34\r",
+ "9 5 35\r",
+ "9 5 36\r",
+ "9 5 37\r",
+ "9 5 38\r",
+ "9 5 39\r",
+ "9 5 40\r",
+ "9 5 41\r",
+ "9 5 42\r",
+ "9 5 43\r",
+ "9 5 44\r",
+ "9 5 45\r",
+ "9 5 46\r",
+ "9 5 47\r",
+ "9 5 48\r",
+ "9 5 49\r",
+ "9 5 50\r",
+ "9 5 51\r",
+ "9 5 52\r",
+ "9 5 53\r",
+ "9 5 54\r",
+ "9 5 55\r",
+ "9 5 56\r",
+ "9 5 57\r",
+ "9 5 58\r",
+ "9 6 1\r",
+ "9 6 2\r",
+ "9 6 3\r",
+ "9 6 4\r",
+ "9 6 5\r",
+ "9 6 6\r",
+ "9 6 7\r",
+ "9 6 8\r",
+ "9 6 9\r",
+ "9 6 10\r",
+ "9 6 11\r",
+ "9 6 12\r",
+ "9 6 13\r",
+ "9 6 14\r",
+ "9 6 15\r",
+ "9 6 16\r",
+ "9 6 17\r",
+ "9 6 18\r",
+ "9 6 19\r",
+ "9 6 20\r",
+ "9 6 21\r",
+ "9 6 22\r",
+ "9 6 23\r",
+ "9 6 24\r",
+ "9 6 25\r",
+ "9 6 26\r",
+ "9 6 27\r",
+ "9 6 28\r",
+ "9 6 29\r",
+ "9 6 30\r",
+ "9 6 31\r",
+ "9 6 32\r",
+ "9 6 33\r",
+ "9 6 34\r",
+ "9 6 35\r",
+ "9 6 36\r",
+ "9 6 37\r",
+ "9 6 38\r",
+ "9 6 39\r",
+ "9 6 40\r",
+ "9 6 41\r",
+ "9 6 42\r",
+ "9 6 43\r",
+ "9 6 44\r",
+ "9 6 45\r",
+ "9 6 46\r",
+ "9 6 47\r",
+ "9 6 48\r",
+ "9 6 49\r",
+ "9 6 50\r",
+ "9 6 51\r",
+ "9 6 52\r",
+ "9 6 53\r",
+ "9 6 54\r",
+ "9 6 55\r",
+ "9 6 56\r",
+ "9 6 57\r",
+ "9 6 58\r",
+ "9 7 1\r",
+ "9 7 2\r",
+ "9 7 3\r",
+ "9 7 4\r",
+ "9 7 5\r",
+ "9 7 6\r",
+ "9 7 7\r",
+ "9 7 8\r",
+ "9 7 9\r",
+ "9 7 10\r",
+ "9 7 11\r",
+ "9 7 12\r",
+ "9 7 13\r",
+ "9 7 14\r",
+ "9 7 15\r",
+ "9 7 16\r",
+ "9 7 17\r",
+ "9 7 18\r",
+ "9 7 19\r",
+ "9 7 20\r",
+ "9 7 21\r",
+ "9 7 22\r",
+ "9 7 23\r",
+ "9 7 24\r",
+ "9 7 25\r",
+ "9 7 26\r",
+ "9 7 27\r",
+ "9 7 28\r",
+ "9 7 29\r",
+ "9 7 30\r",
+ "9 7 31\r",
+ "9 7 32\r",
+ "9 7 33\r",
+ "9 7 34\r",
+ "9 7 35\r",
+ "9 7 36\r",
+ "9 7 37\r",
+ "9 7 38\r",
+ "9 7 39\r",
+ "9 7 40\r",
+ "9 7 41\r",
+ "9 7 42\r",
+ "9 7 43\r",
+ "9 7 44\r",
+ "9 7 45\r",
+ "9 7 46\r",
+ "9 7 47\r",
+ "9 7 48\r",
+ "9 7 49\r",
+ "9 7 50\r",
+ "9 7 51\r",
+ "9 7 52\r",
+ "9 7 53\r",
+ "9 7 54\r",
+ "9 7 55\r",
+ "9 7 56\r",
+ "9 7 57\r",
+ "9 7 58\r",
+ "9 8 1\r",
+ "9 8 2\r",
+ "9 8 3\r",
+ "9 8 4\r",
+ "9 8 5\r",
+ "9 8 6\r",
+ "9 8 7\r",
+ "9 8 8\r",
+ "9 8 9\r",
+ "9 8 10\r",
+ "9 8 11\r",
+ "9 8 12\r",
+ "9 8 13\r",
+ "9 8 14\r",
+ "9 8 15\r",
+ "9 8 16\r",
+ "9 8 17\r",
+ "9 8 18\r",
+ "9 8 19\r",
+ "9 8 20\r",
+ "9 8 21\r",
+ "9 8 22\r",
+ "9 8 23\r",
+ "9 8 24\r",
+ "9 8 25\r",
+ "9 8 26\r",
+ "9 8 27\r",
+ "9 8 28\r",
+ "9 8 29\r",
+ "9 8 30\r",
+ "9 8 31\r",
+ "9 8 32\r",
+ "9 8 33\r",
+ "9 8 34\r",
+ "9 8 35\r",
+ "9 8 36\r",
+ "9 8 37\r",
+ "9 8 38\r",
+ "9 8 39\r",
+ "9 8 40\r",
+ "9 8 41\r",
+ "9 8 42\r",
+ "9 8 43\r",
+ "9 8 44\r",
+ "9 8 45\r",
+ "9 8 46\r",
+ "9 8 47\r",
+ "9 8 48\r",
+ "9 8 49\r",
+ "9 8 50\r",
+ "9 8 51\r",
+ "9 8 52\r",
+ "9 8 53\r",
+ "9 8 54\r",
+ "9 8 55\r",
+ "9 8 56\r",
+ "9 8 57\r",
+ "9 8 58\r",
+ "9 9 1\r",
+ "9 9 2\r",
+ "9 9 3\r",
+ "9 9 4\r",
+ "9 9 5\r",
+ "9 9 6\r",
+ "9 9 7\r",
+ "9 9 8\r",
+ "9 9 9\r",
+ "9 9 10\r",
+ "9 9 11\r",
+ "9 9 12\r",
+ "9 9 13\r",
+ "9 9 14\r",
+ "9 9 15\r",
+ "9 9 16\r",
+ "9 9 17\r",
+ "9 9 18\r",
+ "9 9 19\r",
+ "9 9 20\r",
+ "9 9 21\r",
+ "9 9 22\r",
+ "9 9 23\r",
+ "9 9 24\r",
+ "9 9 25\r",
+ "9 9 26\r",
+ "9 9 27\r",
+ "9 9 28\r",
+ "9 9 29\r",
+ "9 9 30\r",
+ "9 9 31\r",
+ "9 9 32\r",
+ "9 9 33\r",
+ "9 9 34\r",
+ "9 9 35\r",
+ "9 9 36\r",
+ "9 9 37\r",
+ "9 9 38\r",
+ "9 9 39\r",
+ "9 9 40\r",
+ "9 9 41\r",
+ "9 9 42\r",
+ "9 9 43\r",
+ "9 9 44\r",
+ "9 9 45\r",
+ "9 9 46\r",
+ "9 9 47\r",
+ "9 9 48\r",
+ "9 9 49\r",
+ "9 9 50\r",
+ "9 9 51\r",
+ "9 9 52\r",
+ "9 9 53\r",
+ "9 9 54\r",
+ "9 9 55\r",
+ "9 9 56\r",
+ "9 9 57\r",
+ "9 9 58\r",
+ "9 10 1\r",
+ "9 10 2\r",
+ "9 10 3\r",
+ "9 10 4\r",
+ "9 10 5\r",
+ "9 10 6\r",
+ "9 10 7\r",
+ "9 10 8\r",
+ "9 10 9\r",
+ "9 10 10\r",
+ "9 10 11\r",
+ "9 10 12\r",
+ "9 10 13\r",
+ "9 10 14\r",
+ "9 10 15\r",
+ "9 10 16\r",
+ "9 10 17\r",
+ "9 10 18\r",
+ "9 10 19\r",
+ "9 10 20\r",
+ "9 10 21\r",
+ "9 10 22\r",
+ "9 10 23\r",
+ "9 10 24\r",
+ "9 10 25\r",
+ "9 10 26\r",
+ "9 10 27\r",
+ "9 10 28\r",
+ "9 10 29\r",
+ "9 10 30\r",
+ "9 10 31\r",
+ "9 10 32\r",
+ "9 10 33\r",
+ "9 10 34\r",
+ "9 10 35\r",
+ "9 10 36\r",
+ "9 10 37\r",
+ "9 10 38\r",
+ "9 10 39\r",
+ "9 10 40\r",
+ "9 10 41\r",
+ "9 10 42\r",
+ "9 10 43\r",
+ "9 10 44\r",
+ "9 10 45\r",
+ "9 10 46\r",
+ "9 10 47\r",
+ "9 10 48\r",
+ "9 10 49\r",
+ "9 10 50\r",
+ "9 10 51\r",
+ "9 10 52\r",
+ "9 10 53\r",
+ "9 10 54\r",
+ "9 10 55\r",
+ "9 10 56\r",
+ "9 10 57\r",
+ "9 10 58\r",
+ "9 11 1\r",
+ "9 11 2\r",
+ "9 11 3\r",
+ "9 11 4\r",
+ "9 11 5\r",
+ "9 11 6\r",
+ "9 11 7\r",
+ "9 11 8\r",
+ "9 11 9\r",
+ "9 11 10\r",
+ "9 11 11\r",
+ "9 11 12\r",
+ "9 11 13\r",
+ "9 11 14\r",
+ "9 11 15\r",
+ "9 11 16\r",
+ "9 11 17\r",
+ "9 11 18\r",
+ "9 11 19\r",
+ "9 11 20\r",
+ "9 11 21\r",
+ "9 11 22\r",
+ "9 11 23\r",
+ "9 11 24\r",
+ "9 11 25\r",
+ "9 11 26\r",
+ "9 11 27\r",
+ "9 11 28\r",
+ "9 11 29\r",
+ "9 11 30\r",
+ "9 11 31\r",
+ "9 11 32\r",
+ "9 11 33\r",
+ "9 11 34\r",
+ "9 11 35\r",
+ "9 11 36\r",
+ "9 11 37\r",
+ "9 11 38\r",
+ "9 11 39\r",
+ "9 11 40\r",
+ "9 11 41\r",
+ "9 11 42\r",
+ "9 11 43\r",
+ "9 11 44\r",
+ "9 11 45\r",
+ "9 11 46\r",
+ "9 11 47\r",
+ "9 11 48\r",
+ "9 11 49\r",
+ "9 11 50\r",
+ "9 11 51\r",
+ "9 11 52\r",
+ "9 11 53\r",
+ "9 11 54\r",
+ "9 11 55\r",
+ "9 11 56\r",
+ "9 11 57\r",
+ "9 11 58\r",
+ "9 12 1\r",
+ "9 12 2\r",
+ "9 12 3\r",
+ "9 12 4\r",
+ "9 12 5\r",
+ "9 12 6\r",
+ "9 12 7\r",
+ "9 12 8\r",
+ "9 12 9\r",
+ "9 12 10\r",
+ "9 12 11\r",
+ "9 12 12\r",
+ "9 12 13\r",
+ "9 12 14\r",
+ "9 12 15\r",
+ "9 12 16\r",
+ "9 12 17\r",
+ "9 12 18\r",
+ "9 12 19\r",
+ "9 12 20\r",
+ "9 12 21\r",
+ "9 12 22\r",
+ "9 12 23\r",
+ "9 12 24\r",
+ "9 12 25\r",
+ "9 12 26\r",
+ "9 12 27\r",
+ "9 12 28\r",
+ "9 12 29\r",
+ "9 12 30\r",
+ "9 12 31\r",
+ "9 12 32\r",
+ "9 12 33\r",
+ "9 12 34\r",
+ "9 12 35\r",
+ "9 12 36\r",
+ "9 12 37\r",
+ "9 12 38\r",
+ "9 12 39\r",
+ "9 12 40\r",
+ "9 12 41\r",
+ "9 12 42\r",
+ "9 12 43\r",
+ "9 12 44\r",
+ "9 12 45\r",
+ "9 12 46\r",
+ "9 12 47\r",
+ "9 12 48\r",
+ "9 12 49\r",
+ "9 12 50\r",
+ "9 12 51\r",
+ "9 12 52\r",
+ "9 12 53\r",
+ "9 12 54\r",
+ "9 12 55\r",
+ "9 12 56\r",
+ "9 12 57\r",
+ "9 12 58\r",
+ "9 13 1\r",
+ "9 13 2\r",
+ "9 13 3\r",
+ "9 13 4\r",
+ "9 13 5\r",
+ "9 13 6\r",
+ "9 13 7\r",
+ "9 13 8\r",
+ "9 13 9\r",
+ "9 13 10\r",
+ "9 13 11\r",
+ "9 13 12\r",
+ "9 13 13\r",
+ "9 13 14\r",
+ "9 13 15\r",
+ "9 13 16\r",
+ "9 13 17\r",
+ "9 13 18\r",
+ "9 13 19\r",
+ "9 13 20\r",
+ "9 13 21\r",
+ "9 13 22\r",
+ "9 13 23\r",
+ "9 13 24\r",
+ "9 13 25\r",
+ "9 13 26\r",
+ "9 13 27\r",
+ "9 13 28\r",
+ "9 13 29\r",
+ "9 13 30\r",
+ "9 13 31\r",
+ "9 13 32\r",
+ "9 13 33\r",
+ "9 13 34\r",
+ "9 13 35\r",
+ "9 13 36\r",
+ "9 13 37\r",
+ "9 13 38\r",
+ "9 13 39\r",
+ "9 13 40\r",
+ "9 13 41\r",
+ "9 13 42\r",
+ "9 13 43\r",
+ "9 13 44\r",
+ "9 13 45\r",
+ "9 13 46\r",
+ "9 13 47\r",
+ "9 13 48\r",
+ "9 13 49\r",
+ "9 13 50\r",
+ "9 13 51\r",
+ "9 13 52\r",
+ "9 13 53\r",
+ "9 13 54\r",
+ "9 13 55\r",
+ "9 13 56\r",
+ "9 13 57\r",
+ "9 13 58\r",
+ "9 14 1\r",
+ "9 14 2\r",
+ "9 14 3\r",
+ "9 14 4\r",
+ "9 14 5\r",
+ "9 14 6\r",
+ "9 14 7\r",
+ "9 14 8\r",
+ "9 14 9\r",
+ "9 14 10\r",
+ "9 14 11\r",
+ "9 14 12\r",
+ "9 14 13\r",
+ "9 14 14\r",
+ "9 14 15\r",
+ "9 14 16\r",
+ "9 14 17\r",
+ "9 14 18\r",
+ "9 14 19\r",
+ "9 14 20\r",
+ "9 14 21\r",
+ "9 14 22\r",
+ "9 14 23\r",
+ "9 14 24\r",
+ "9 14 25\r",
+ "9 14 26\r",
+ "9 14 27\r",
+ "9 14 28\r",
+ "9 14 29\r",
+ "9 14 30\r",
+ "9 14 31\r",
+ "9 14 32\r",
+ "9 14 33\r",
+ "9 14 34\r",
+ "9 14 35\r",
+ "9 14 36\r",
+ "9 14 37\r",
+ "9 14 38\r",
+ "9 14 39\r",
+ "9 14 40\r",
+ "9 14 41\r",
+ "9 14 42\r",
+ "9 14 43\r",
+ "9 14 44\r",
+ "9 14 45\r",
+ "9 14 46\r",
+ "9 14 47\r",
+ "9 14 48\r",
+ "9 14 49\r",
+ "9 14 50\r",
+ "9 14 51\r",
+ "9 14 52\r",
+ "9 14 53\r",
+ "9 14 54\r",
+ "9 14 55\r",
+ "9 14 56\r",
+ "9 14 57\r",
+ "9 14 58\r",
+ "9 15 1\r",
+ "9 15 2\r",
+ "9 15 3\r",
+ "9 15 4\r",
+ "9 15 5\r",
+ "9 15 6\r",
+ "9 15 7\r",
+ "9 15 8\r",
+ "9 15 9\r",
+ "9 15 10\r",
+ "9 15 11\r",
+ "9 15 12\r",
+ "9 15 13\r",
+ "9 15 14\r",
+ "9 15 15\r",
+ "9 15 16\r",
+ "9 15 17\r",
+ "9 15 18\r",
+ "9 15 19\r",
+ "9 15 20\r",
+ "9 15 21\r",
+ "9 15 22\r",
+ "9 15 23\r",
+ "9 15 24\r",
+ "9 15 25\r",
+ "9 15 26\r",
+ "9 15 27\r",
+ "9 15 28\r",
+ "9 15 29\r",
+ "9 15 30\r",
+ "9 15 31\r",
+ "9 15 32\r",
+ "9 15 33\r",
+ "9 15 34\r",
+ "9 15 35\r",
+ "9 15 36\r",
+ "9 15 37\r",
+ "9 15 38\r",
+ "9 15 39\r",
+ "9 15 40\r",
+ "9 15 41\r",
+ "9 15 42\r",
+ "9 15 43\r",
+ "9 15 44\r",
+ "9 15 45\r",
+ "9 15 46\r",
+ "9 15 47\r",
+ "9 15 48\r",
+ "9 15 49\r",
+ "9 15 50\r",
+ "9 15 51\r",
+ "9 15 52\r",
+ "9 15 53\r",
+ "9 15 54\r",
+ "9 15 55\r",
+ "9 15 56\r",
+ "9 15 57\r",
+ "9 15 58\r",
+ "9 16 1\r",
+ "9 16 2\r",
+ "9 16 3\r",
+ "9 16 4\r",
+ "9 16 5\r",
+ "9 16 6\r",
+ "9 16 7\r",
+ "9 16 8\r",
+ "9 16 9\r",
+ "9 16 10\r",
+ "9 16 11\r",
+ "9 16 12\r",
+ "9 16 13\r",
+ "9 16 14\r",
+ "9 16 15\r",
+ "9 16 16\r",
+ "9 16 17\r",
+ "9 16 18\r",
+ "9 16 19\r",
+ "9 16 20\r",
+ "9 16 21\r",
+ "9 16 22\r",
+ "9 16 23\r",
+ "9 16 24\r",
+ "9 16 25\r",
+ "9 16 26\r",
+ "9 16 27\r",
+ "9 16 28\r",
+ "9 16 29\r",
+ "9 16 30\r",
+ "9 16 31\r",
+ "9 16 32\r",
+ "9 16 33\r",
+ "9 16 34\r",
+ "9 16 35\r",
+ "9 16 36\r",
+ "9 16 37\r",
+ "9 16 38\r",
+ "9 16 39\r",
+ "9 16 40\r",
+ "9 16 41\r",
+ "9 16 42\r",
+ "9 16 43\r",
+ "9 16 44\r",
+ "9 16 45\r",
+ "9 16 46\r",
+ "9 16 47\r",
+ "9 16 48\r",
+ "9 16 49\r",
+ "9 16 50\r",
+ "9 16 51\r",
+ "9 16 52\r",
+ "9 16 53\r",
+ "9 16 54\r",
+ "9 16 55\r",
+ "9 16 56\r",
+ "9 16 57\r",
+ "9 16 58\r",
+ "9 17 1\r",
+ "9 17 2\r",
+ "9 17 3\r",
+ "9 17 4\r",
+ "9 17 5\r",
+ "9 17 6\r",
+ "9 17 7\r",
+ "9 17 8\r",
+ "9 17 9\r",
+ "9 17 10\r",
+ "9 17 11\r",
+ "9 17 12\r",
+ "9 17 13\r",
+ "9 17 14\r",
+ "9 17 15\r",
+ "9 17 16\r",
+ "9 17 17\r",
+ "9 17 18\r",
+ "9 17 19\r",
+ "9 17 20\r",
+ "9 17 21\r",
+ "9 17 22\r",
+ "9 17 23\r",
+ "9 17 24\r",
+ "9 17 25\r",
+ "9 17 26\r",
+ "9 17 27\r",
+ "9 17 28\r",
+ "9 17 29\r",
+ "9 17 30\r",
+ "9 17 31\r",
+ "9 17 32\r",
+ "9 17 33\r",
+ "9 17 34\r",
+ "9 17 35\r",
+ "9 17 36\r",
+ "9 17 37\r",
+ "9 17 38\r",
+ "9 17 39\r",
+ "9 17 40\r",
+ "9 17 41\r",
+ "9 17 42\r",
+ "9 17 43\r",
+ "9 17 44\r",
+ "9 17 45\r",
+ "9 17 46\r",
+ "9 17 47\r",
+ "9 17 48\r",
+ "9 17 49\r",
+ "9 17 50\r",
+ "9 17 51\r",
+ "9 17 52\r",
+ "9 17 53\r",
+ "9 17 54\r",
+ "9 17 55\r",
+ "9 17 56\r",
+ "9 17 57\r",
+ "9 17 58\r",
+ "9 18 1\r",
+ "9 18 2\r",
+ "9 18 3\r",
+ "9 18 4\r",
+ "9 18 5\r",
+ "9 18 6\r",
+ "9 18 7\r",
+ "9 18 8\r",
+ "9 18 9\r",
+ "9 18 10\r",
+ "9 18 11\r",
+ "9 18 12\r",
+ "9 18 13\r",
+ "9 18 14\r",
+ "9 18 15\r",
+ "9 18 16\r",
+ "9 18 17\r",
+ "9 18 18\r",
+ "9 18 19\r",
+ "9 18 20\r",
+ "9 18 21\r",
+ "9 18 22\r",
+ "9 18 23\r",
+ "9 18 24\r",
+ "9 18 25\r",
+ "9 18 26\r",
+ "9 18 27\r",
+ "9 18 28\r",
+ "9 18 29\r",
+ "9 18 30\r",
+ "9 18 31\r",
+ "9 18 32\r",
+ "9 18 33\r",
+ "9 18 34\r",
+ "9 18 35\r",
+ "9 18 36\r",
+ "9 18 37\r",
+ "9 18 38\r",
+ "9 18 39\r",
+ "9 18 40\r",
+ "9 18 41\r",
+ "9 18 42\r",
+ "9 18 43\r",
+ "9 18 44\r",
+ "9 18 45\r",
+ "9 18 46\r",
+ "9 18 47\r",
+ "9 18 48\r",
+ "9 18 49\r",
+ "9 18 50\r",
+ "9 18 51\r",
+ "9 18 52\r",
+ "9 18 53\r",
+ "9 18 54\r",
+ "9 18 55\r",
+ "9 18 56\r",
+ "9 18 57\r",
+ "9 18 58\r",
+ "9 19 1\r",
+ "9 19 2\r",
+ "9 19 3\r",
+ "9 19 4\r",
+ "9 19 5\r",
+ "9 19 6\r",
+ "9 19 7\r",
+ "9 19 8\r",
+ "9 19 9\r",
+ "9 19 10\r",
+ "9 19 11\r",
+ "9 19 12\r",
+ "9 19 13\r",
+ "9 19 14\r",
+ "9 19 15\r",
+ "9 19 16\r",
+ "9 19 17\r",
+ "9 19 18\r",
+ "9 19 19\r",
+ "9 19 20\r",
+ "9 19 21\r",
+ "9 19 22\r",
+ "9 19 23\r",
+ "9 19 24\r",
+ "9 19 25\r",
+ "9 19 26\r",
+ "9 19 27\r",
+ "9 19 28\r",
+ "9 19 29\r",
+ "9 19 30\r",
+ "9 19 31\r",
+ "9 19 32\r",
+ "9 19 33\r",
+ "9 19 34\r",
+ "9 19 35\r",
+ "9 19 36\r",
+ "9 19 37\r",
+ "9 19 38\r",
+ "9 19 39\r",
+ "9 19 40\r",
+ "9 19 41\r",
+ "9 19 42\r",
+ "9 19 43\r",
+ "9 19 44\r",
+ "9 19 45\r",
+ "9 19 46\r",
+ "9 19 47\r",
+ "9 19 48\r",
+ "9 19 49\r",
+ "9 19 50\r",
+ "9 19 51\r",
+ "9 19 52\r",
+ "9 19 53\r",
+ "9 19 54\r",
+ "9 19 55\r",
+ "9 19 56\r",
+ "9 19 57\r",
+ "9 19 58\r",
+ "9 20 1\r",
+ "9 20 2\r",
+ "9 20 3\r",
+ "9 20 4\r",
+ "9 20 5\r",
+ "9 20 6\r",
+ "9 20 7\r",
+ "9 20 8\r",
+ "9 20 9\r",
+ "9 20 10\r",
+ "9 20 11\r",
+ "9 20 12\r",
+ "9 20 13\r",
+ "9 20 14\r",
+ "9 20 15\r",
+ "9 20 16\r",
+ "9 20 17\r",
+ "9 20 18\r",
+ "9 20 19\r",
+ "9 20 20\r",
+ "9 20 21\r",
+ "9 20 22\r",
+ "9 20 23\r",
+ "9 20 24\r",
+ "9 20 25\r",
+ "9 20 26\r",
+ "9 20 27\r",
+ "9 20 28\r",
+ "9 20 29\r",
+ "9 20 30\r",
+ "9 20 31\r",
+ "9 20 32\r",
+ "9 20 33\r",
+ "9 20 34\r",
+ "9 20 35\r",
+ "9 20 36\r",
+ "9 20 37\r",
+ "9 20 38\r",
+ "9 20 39\r",
+ "9 20 40\r",
+ "9 20 41\r",
+ "9 20 42\r",
+ "9 20 43\r",
+ "9 20 44\r",
+ "9 20 45\r",
+ "9 20 46\r",
+ "9 20 47\r",
+ "9 20 48\r",
+ "9 20 49\r",
+ "9 20 50\r",
+ "9 20 51\r",
+ "9 20 52\r",
+ "9 20 53\r",
+ "9 20 54\r",
+ "9 20 55\r",
+ "9 20 56\r",
+ "9 20 57\r",
+ "9 20 58\r",
+ "9 21 1\r",
+ "9 21 2\r",
+ "9 21 3\r",
+ "9 21 4\r",
+ "9 21 5\r",
+ "9 21 6\r",
+ "9 21 7\r",
+ "9 21 8\r",
+ "9 21 9\r",
+ "9 21 10\r",
+ "9 21 11\r",
+ "9 21 12\r",
+ "9 21 13\r",
+ "9 21 14\r",
+ "9 21 15\r",
+ "9 21 16\r",
+ "9 21 17\r",
+ "9 21 18\r",
+ "9 21 19\r",
+ "9 21 20\r",
+ "9 21 21\r",
+ "9 21 22\r",
+ "9 21 23\r",
+ "9 21 24\r",
+ "9 21 25\r",
+ "9 21 26\r",
+ "9 21 27\r",
+ "9 21 28\r",
+ "9 21 29\r",
+ "9 21 30\r",
+ "9 21 31\r",
+ "9 21 32\r",
+ "9 21 33\r",
+ "9 21 34\r",
+ "9 21 35\r",
+ "9 21 36\r",
+ "9 21 37\r",
+ "9 21 38\r",
+ "9 21 39\r",
+ "9 21 40\r",
+ "9 21 41\r",
+ "9 21 42\r",
+ "9 21 43\r",
+ "9 21 44\r",
+ "9 21 45\r",
+ "9 21 46\r",
+ "9 21 47\r",
+ "9 21 48\r",
+ "9 21 49\r",
+ "9 21 50\r",
+ "9 21 51\r",
+ "9 21 52\r",
+ "9 21 53\r",
+ "9 21 54\r",
+ "9 21 55\r",
+ "9 21 56\r",
+ "9 21 57\r",
+ "9 21 58\r",
+ "9 22 1\r",
+ "9 22 2\r",
+ "9 22 3\r",
+ "9 22 4\r",
+ "9 22 5\r",
+ "9 22 6\r",
+ "9 22 7\r",
+ "9 22 8\r",
+ "9 22 9\r",
+ "9 22 10\r",
+ "9 22 11\r",
+ "9 22 12\r",
+ "9 22 13\r",
+ "9 22 14\r",
+ "9 22 15\r",
+ "9 22 16\r",
+ "9 22 17\r",
+ "9 22 18\r",
+ "9 22 19\r",
+ "9 22 20\r",
+ "9 22 21\r",
+ "9 22 22\r",
+ "9 22 23\r",
+ "9 22 24\r",
+ "9 22 25\r",
+ "9 22 26\r",
+ "9 22 27\r",
+ "9 22 28\r",
+ "9 22 29\r",
+ "9 22 30\r",
+ "9 22 31\r",
+ "9 22 32\r",
+ "9 22 33\r",
+ "9 22 34\r",
+ "9 22 35\r",
+ "9 22 36\r",
+ "9 22 37\r",
+ "9 22 38\r",
+ "9 22 39\r",
+ "9 22 40\r",
+ "9 22 41\r",
+ "9 22 42\r",
+ "9 22 43\r",
+ "9 22 44\r",
+ "9 22 45\r",
+ "9 22 46\r",
+ "9 22 47\r",
+ "9 22 48\r",
+ "9 22 49\r",
+ "9 22 50\r",
+ "9 22 51\r",
+ "9 22 52\r",
+ "9 22 53\r",
+ "9 22 54\r",
+ "9 22 55\r",
+ "9 22 56\r",
+ "9 22 57\r",
+ "9 22 58\r",
+ "9 23 1\r",
+ "9 23 2\r",
+ "9 23 3\r",
+ "9 23 4\r",
+ "9 23 5\r",
+ "9 23 6\r",
+ "9 23 7\r",
+ "9 23 8\r",
+ "9 23 9\r",
+ "9 23 10\r",
+ "9 23 11\r",
+ "9 23 12\r",
+ "9 23 13\r",
+ "9 23 14\r",
+ "9 23 15\r",
+ "9 23 16\r",
+ "9 23 17\r",
+ "9 23 18\r",
+ "9 23 19\r",
+ "9 23 20\r",
+ "9 23 21\r",
+ "9 23 22\r",
+ "9 23 23\r",
+ "9 23 24\r",
+ "9 23 25\r",
+ "9 23 26\r",
+ "9 23 27\r",
+ "9 23 28\r",
+ "9 23 29\r",
+ "9 23 30\r",
+ "9 23 31\r",
+ "9 23 32\r",
+ "9 23 33\r",
+ "9 23 34\r",
+ "9 23 35\r",
+ "9 23 36\r",
+ "9 23 37\r",
+ "9 23 38\r",
+ "9 23 39\r",
+ "9 23 40\r",
+ "9 23 41\r",
+ "9 23 42\r",
+ "9 23 43\r",
+ "9 23 44\r",
+ "9 23 45\r",
+ "9 23 46\r",
+ "9 23 47\r",
+ "9 23 48\r",
+ "9 23 49\r",
+ "9 23 50\r",
+ "9 23 51\r",
+ "9 23 52\r",
+ "9 23 53\r",
+ "9 23 54\r",
+ "9 23 55\r",
+ "9 23 56\r",
+ "9 23 57\r",
+ "9 23 58\r",
+ "9 24 1\r",
+ "9 24 2\r",
+ "9 24 3\r",
+ "9 24 4\r",
+ "9 24 5\r",
+ "9 24 6\r",
+ "9 24 7\r",
+ "9 24 8\r",
+ "9 24 9\r",
+ "9 24 10\r",
+ "9 24 11\r",
+ "9 24 12\r",
+ "9 24 13\r",
+ "9 24 14\r",
+ "9 24 15\r",
+ "9 24 16\r",
+ "9 24 17\r",
+ "9 24 18\r",
+ "9 24 19\r",
+ "9 24 20\r",
+ "9 24 21\r",
+ "9 24 22\r",
+ "9 24 23\r",
+ "9 24 24\r",
+ "9 24 25\r",
+ "9 24 26\r",
+ "9 24 27\r",
+ "9 24 28\r",
+ "9 24 29\r",
+ "9 24 30\r",
+ "9 24 31\r",
+ "9 24 32\r",
+ "9 24 33\r",
+ "9 24 34\r",
+ "9 24 35\r",
+ "9 24 36\r",
+ "9 24 37\r",
+ "9 24 38\r",
+ "9 24 39\r",
+ "9 24 40\r",
+ "9 24 41\r",
+ "9 24 42\r",
+ "9 24 43\r",
+ "9 24 44\r",
+ "9 24 45\r",
+ "9 24 46\r",
+ "9 24 47\r",
+ "9 24 48\r",
+ "9 24 49\r",
+ "9 24 50\r",
+ "9 24 51\r",
+ "9 24 52\r",
+ "9 24 53\r",
+ "9 24 54\r",
+ "9 24 55\r",
+ "9 24 56\r",
+ "9 24 57\r",
+ "9 24 58\r",
+ "9 25 1\r",
+ "9 25 2\r",
+ "9 25 3\r",
+ "9 25 4\r",
+ "9 25 5\r",
+ "9 25 6\r",
+ "9 25 7\r",
+ "9 25 8\r",
+ "9 25 9\r",
+ "9 25 10\r",
+ "9 25 11\r",
+ "9 25 12\r",
+ "9 25 13\r",
+ "9 25 14\r",
+ "9 25 15\r",
+ "9 25 16\r",
+ "9 25 17\r",
+ "9 25 18\r",
+ "9 25 19\r",
+ "9 25 20\r",
+ "9 25 21\r",
+ "9 25 22\r",
+ "9 25 23\r",
+ "9 25 24\r",
+ "9 25 25\r",
+ "9 25 26\r",
+ "9 25 27\r",
+ "9 25 28\r",
+ "9 25 29\r",
+ "9 25 30\r",
+ "9 25 31\r",
+ "9 25 32\r",
+ "9 25 33\r",
+ "9 25 34\r",
+ "9 25 35\r",
+ "9 25 36\r",
+ "9 25 37\r",
+ "9 25 38\r",
+ "9 25 39\r",
+ "9 25 40\r",
+ "9 25 41\r",
+ "9 25 42\r",
+ "9 25 43\r",
+ "9 25 44\r",
+ "9 25 45\r",
+ "9 25 46\r",
+ "9 25 47\r",
+ "9 25 48\r",
+ "9 25 49\r",
+ "9 25 50\r",
+ "9 25 51\r",
+ "9 25 52\r",
+ "9 25 53\r",
+ "9 25 54\r",
+ "9 25 55\r",
+ "9 25 56\r",
+ "9 25 57\r",
+ "9 25 58\r",
+ "9 26 1\r",
+ "9 26 2\r",
+ "9 26 3\r",
+ "9 26 4\r",
+ "9 26 5\r",
+ "9 26 6\r",
+ "9 26 7\r",
+ "9 26 8\r",
+ "9 26 9\r",
+ "9 26 10\r",
+ "9 26 11\r",
+ "9 26 12\r",
+ "9 26 13\r",
+ "9 26 14\r",
+ "9 26 15\r",
+ "9 26 16\r",
+ "9 26 17\r",
+ "9 26 18\r",
+ "9 26 19\r",
+ "9 26 20\r",
+ "9 26 21\r",
+ "9 26 22\r",
+ "9 26 23\r",
+ "9 26 24\r",
+ "9 26 25\r",
+ "9 26 26\r",
+ "9 26 27\r",
+ "9 26 28\r",
+ "9 26 29\r",
+ "9 26 30\r",
+ "9 26 31\r",
+ "9 26 32\r",
+ "9 26 33\r",
+ "9 26 34\r",
+ "9 26 35\r",
+ "9 26 36\r",
+ "9 26 37\r",
+ "9 26 38\r",
+ "9 26 39\r",
+ "9 26 40\r",
+ "9 26 41\r",
+ "9 26 42\r",
+ "9 26 43\r",
+ "9 26 44\r",
+ "9 26 45\r",
+ "9 26 46\r",
+ "9 26 47\r",
+ "9 26 48\r",
+ "9 26 49\r",
+ "9 26 50\r",
+ "9 26 51\r",
+ "9 26 52\r",
+ "9 26 53\r",
+ "9 26 54\r",
+ "9 26 55\r",
+ "9 26 56\r",
+ "9 26 57\r",
+ "9 26 58\r",
+ "9 27 1\r",
+ "9 27 2\r",
+ "9 27 3\r",
+ "9 27 4\r",
+ "9 27 5\r",
+ "9 27 6\r",
+ "9 27 7\r",
+ "9 27 8\r",
+ "9 27 9\r",
+ "9 27 10\r",
+ "9 27 11\r",
+ "9 27 12\r",
+ "9 27 13\r",
+ "9 27 14\r",
+ "9 27 15\r",
+ "9 27 16\r",
+ "9 27 17\r",
+ "9 27 18\r",
+ "9 27 19\r",
+ "9 27 20\r",
+ "9 27 21\r",
+ "9 27 22\r",
+ "9 27 23\r",
+ "9 27 24\r",
+ "9 27 25\r",
+ "9 27 26\r",
+ "9 27 27\r",
+ "9 27 28\r",
+ "9 27 29\r",
+ "9 27 30\r",
+ "9 27 31\r",
+ "9 27 32\r",
+ "9 27 33\r",
+ "9 27 34\r",
+ "9 27 35\r",
+ "9 27 36\r",
+ "9 27 37\r",
+ "9 27 38\r",
+ "9 27 39\r",
+ "9 27 40\r",
+ "9 27 41\r",
+ "9 27 42\r",
+ "9 27 43\r",
+ "9 27 44\r",
+ "9 27 45\r",
+ "9 27 46\r",
+ "9 27 47\r",
+ "9 27 48\r",
+ "9 27 49\r",
+ "9 27 50\r",
+ "9 27 51\r",
+ "9 27 52\r",
+ "9 27 53\r",
+ "9 27 54\r",
+ "9 27 55\r",
+ "9 27 56\r",
+ "9 27 57\r",
+ "9 27 58\r",
+ "9 28 1\r",
+ "9 28 2\r",
+ "9 28 3\r",
+ "9 28 4\r",
+ "9 28 5\r",
+ "9 28 6\r",
+ "9 28 7\r",
+ "9 28 8\r",
+ "9 28 9\r",
+ "9 28 10\r",
+ "9 28 11\r",
+ "9 28 12\r",
+ "9 28 13\r",
+ "9 28 14\r",
+ "9 28 15\r",
+ "9 28 16\r",
+ "9 28 17\r",
+ "9 28 18\r",
+ "9 28 19\r",
+ "9 28 20\r",
+ "9 28 21\r",
+ "9 28 22\r",
+ "9 28 23\r",
+ "9 28 24\r",
+ "9 28 25\r",
+ "9 28 26\r",
+ "9 28 27\r",
+ "9 28 28\r",
+ "9 28 29\r",
+ "9 28 30\r",
+ "9 28 31\r",
+ "9 28 32\r",
+ "9 28 33\r",
+ "9 28 34\r",
+ "9 28 35\r",
+ "9 28 36\r",
+ "9 28 37\r",
+ "9 28 38\r",
+ "9 28 39\r",
+ "9 28 40\r",
+ "9 28 41\r",
+ "9 28 42\r",
+ "9 28 43\r",
+ "9 28 44\r",
+ "9 28 45\r",
+ "9 28 46\r",
+ "9 28 47\r",
+ "9 28 48\r",
+ "9 28 49\r",
+ "9 28 50\r",
+ "9 28 51\r",
+ "9 28 52\r",
+ "9 28 53\r",
+ "9 28 54\r",
+ "9 28 55\r",
+ "9 28 56\r",
+ "9 28 57\r",
+ "9 28 58\r",
+ "9 29 1\r",
+ "9 29 2\r",
+ "9 29 3\r",
+ "9 29 4\r",
+ "9 29 5\r",
+ "9 29 6\r",
+ "9 29 7\r",
+ "9 29 8\r",
+ "9 29 9\r",
+ "9 29 10\r",
+ "9 29 11\r",
+ "9 29 12\r",
+ "9 29 13\r",
+ "9 29 14\r",
+ "9 29 15\r",
+ "9 29 16\r",
+ "9 29 17\r",
+ "9 29 18\r",
+ "9 29 19\r",
+ "9 29 20\r",
+ "9 29 21\r",
+ "9 29 22\r",
+ "9 29 23\r",
+ "9 29 24\r",
+ "9 29 25\r",
+ "9 29 26\r",
+ "9 29 27\r",
+ "9 29 28\r",
+ "9 29 29\r",
+ "9 29 30\r",
+ "9 29 31\r",
+ "9 29 32\r",
+ "9 29 33\r",
+ "9 29 34\r",
+ "9 29 35\r",
+ "9 29 36\r",
+ "9 29 37\r",
+ "9 29 38\r",
+ "9 29 39\r",
+ "9 29 40\r",
+ "9 29 41\r",
+ "9 29 42\r",
+ "9 29 43\r",
+ "9 29 44\r",
+ "9 29 45\r",
+ "9 29 46\r",
+ "9 29 47\r",
+ "9 29 48\r",
+ "9 29 49\r",
+ "9 29 50\r",
+ "9 29 51\r",
+ "9 29 52\r",
+ "9 29 53\r",
+ "9 29 54\r",
+ "9 29 55\r",
+ "9 29 56\r",
+ "9 29 57\r",
+ "9 29 58\r",
+ "9 30 1\r",
+ "9 30 2\r",
+ "9 30 3\r",
+ "9 30 4\r",
+ "9 30 5\r",
+ "9 30 6\r",
+ "9 30 7\r",
+ "9 30 8\r",
+ "9 30 9\r",
+ "9 30 10\r",
+ "9 30 11\r",
+ "9 30 12\r",
+ "9 30 13\r",
+ "9 30 14\r",
+ "9 30 15\r",
+ "9 30 16\r",
+ "9 30 17\r",
+ "9 30 18\r",
+ "9 30 19\r",
+ "9 30 20\r",
+ "9 30 21\r",
+ "9 30 22\r",
+ "9 30 23\r",
+ "9 30 24\r",
+ "9 30 25\r",
+ "9 30 26\r",
+ "9 30 27\r",
+ "9 30 28\r",
+ "9 30 29\r",
+ "9 30 30\r",
+ "9 30 31\r",
+ "9 30 32\r",
+ "9 30 33\r",
+ "9 30 34\r",
+ "9 30 35\r",
+ "9 30 36\r",
+ "9 30 37\r",
+ "9 30 38\r",
+ "9 30 39\r",
+ "9 30 40\r",
+ "9 30 41\r",
+ "9 30 42\r",
+ "9 30 43\r",
+ "9 30 44\r",
+ "9 30 45\r",
+ "9 30 46\r",
+ "9 30 47\r",
+ "9 30 48\r",
+ "9 30 49\r",
+ "9 30 50\r",
+ "9 30 51\r",
+ "9 30 52\r",
+ "9 30 53\r",
+ "9 30 54\r",
+ "9 30 55\r",
+ "9 30 56\r",
+ "9 30 57\r",
+ "9 30 58\r",
+ "9 31 1\r",
+ "9 31 2\r",
+ "9 31 3\r",
+ "9 31 4\r",
+ "9 31 5\r",
+ "9 31 6\r",
+ "9 31 7\r",
+ "9 31 8\r",
+ "9 31 9\r",
+ "9 31 10\r",
+ "9 31 11\r",
+ "9 31 12\r",
+ "9 31 13\r",
+ "9 31 14\r",
+ "9 31 15\r",
+ "9 31 16\r",
+ "9 31 17\r",
+ "9 31 18\r",
+ "9 31 19\r",
+ "9 31 20\r",
+ "9 31 21\r",
+ "9 31 22\r",
+ "9 31 23\r",
+ "9 31 24\r",
+ "9 31 25\r",
+ "9 31 26\r",
+ "9 31 27\r",
+ "9 31 28\r",
+ "9 31 29\r",
+ "9 31 30\r",
+ "9 31 31\r",
+ "9 31 32\r",
+ "9 31 33\r",
+ "9 31 34\r",
+ "9 31 35\r",
+ "9 31 36\r",
+ "9 31 37\r",
+ "9 31 38\r",
+ "9 31 39\r",
+ "9 31 40\r",
+ "9 31 41\r",
+ "9 31 42\r",
+ "9 31 43\r",
+ "9 31 44\r",
+ "9 31 45\r",
+ "9 31 46\r",
+ "9 31 47\r",
+ "9 31 48\r",
+ "9 31 49\r",
+ "9 31 50\r",
+ "9 31 51\r",
+ "9 31 52\r",
+ "9 31 53\r",
+ "9 31 54\r",
+ "9 31 55\r",
+ "9 31 56\r",
+ "9 31 57\r",
+ "9 31 58\r",
+ "9 32 1\r",
+ "9 32 2\r",
+ "9 32 3\r",
+ "9 32 4\r",
+ "9 32 5\r",
+ "9 32 6\r",
+ "9 32 7\r",
+ "9 32 8\r",
+ "9 32 9\r",
+ "9 32 10\r",
+ "9 32 11\r",
+ "9 32 12\r",
+ "9 32 13\r",
+ "9 32 14\r",
+ "9 32 15\r",
+ "9 32 16\r",
+ "9 32 17\r",
+ "9 32 18\r",
+ "9 32 19\r",
+ "9 32 20\r",
+ "9 32 21\r",
+ "9 32 22\r",
+ "9 32 23\r",
+ "9 32 24\r",
+ "9 32 25\r",
+ "9 32 26\r",
+ "9 32 27\r",
+ "9 32 28\r",
+ "9 32 29\r",
+ "9 32 30\r",
+ "9 32 31\r",
+ "9 32 32\r",
+ "9 32 33\r",
+ "9 32 34\r",
+ "9 32 35\r",
+ "9 32 36\r",
+ "9 32 37\r",
+ "9 32 38\r",
+ "9 32 39\r",
+ "9 32 40\r",
+ "9 32 41\r",
+ "9 32 42\r",
+ "9 32 43\r",
+ "9 32 44\r",
+ "9 32 45\r",
+ "9 32 46\r",
+ "9 32 47\r",
+ "9 32 48\r",
+ "9 32 49\r",
+ "9 32 50\r",
+ "9 32 51\r",
+ "9 32 52\r",
+ "9 32 53\r",
+ "9 32 54\r",
+ "9 32 55\r",
+ "9 32 56\r",
+ "9 32 57\r",
+ "9 32 58\r",
+ "9 33 1\r",
+ "9 33 2\r",
+ "9 33 3\r",
+ "9 33 4\r",
+ "9 33 5\r",
+ "9 33 6\r",
+ "9 33 7\r",
+ "9 33 8"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "9 33 9\r",
+ "9 33 10\r",
+ "9 33 11\r",
+ "9 33 12\r",
+ "9 33 13\r",
+ "9 33 14\r",
+ "9 33 15\r",
+ "9 33 16\r",
+ "9 33 17\r",
+ "9 33 18\r",
+ "9 33 19\r",
+ "9 33 20\r",
+ "9 33 21\r",
+ "9 33 22\r",
+ "9 33 23\r",
+ "9 33 24\r",
+ "9 33 25\r",
+ "9 33 26\r",
+ "9 33 27\r",
+ "9 33 28\r",
+ "9 33 29\r",
+ "9 33 30\r",
+ "9 33 31\r",
+ "9 33 32\r",
+ "9 33 33\r",
+ "9 33 34\r",
+ "9 33 35\r",
+ "9 33 36\r",
+ "9 33 37\r",
+ "9 33 38\r",
+ "9 33 39\r",
+ "9 33 40\r",
+ "9 33 41\r",
+ "9 33 42\r",
+ "9 33 43\r",
+ "9 33 44\r",
+ "9 33 45\r",
+ "9 33 46\r",
+ "9 33 47\r",
+ "9 33 48\r",
+ "9 33 49\r",
+ "9 33 50\r",
+ "9 33 51\r",
+ "9 33 52\r",
+ "9 33 53\r",
+ "9 33 54\r",
+ "9 33 55\r",
+ "9 33 56\r",
+ "9 33 57\r",
+ "9 33 58\r",
+ "9 34 1\r",
+ "9 34 2\r",
+ "9 34 3\r",
+ "9 34 4\r",
+ "9 34 5\r",
+ "9 34 6\r",
+ "9 34 7\r",
+ "9 34 8\r",
+ "9 34 9\r",
+ "9 34 10\r",
+ "9 34 11\r",
+ "9 34 12\r",
+ "9 34 13\r",
+ "9 34 14\r",
+ "9 34 15\r",
+ "9 34 16\r",
+ "9 34 17\r",
+ "9 34 18\r",
+ "9 34 19\r",
+ "9 34 20\r",
+ "9 34 21\r",
+ "9 34 22\r",
+ "9 34 23\r",
+ "9 34 24\r",
+ "9 34 25\r",
+ "9 34 26\r",
+ "9 34 27\r",
+ "9 34 28\r",
+ "9 34 29\r",
+ "9 34 30\r",
+ "9 34 31\r",
+ "9 34 32\r",
+ "9 34 33\r",
+ "9 34 34\r",
+ "9 34 35\r",
+ "9 34 36\r",
+ "9 34 37\r",
+ "9 34 38\r",
+ "9 34 39\r",
+ "9 34 40\r",
+ "9 34 41\r",
+ "9 34 42\r",
+ "9 34 43\r",
+ "9 34 44\r",
+ "9 34 45\r",
+ "9 34 46\r",
+ "9 34 47\r",
+ "9 34 48\r",
+ "9 34 49\r",
+ "9 34 50\r",
+ "9 34 51\r",
+ "9 34 52\r",
+ "9 34 53\r",
+ "9 34 54\r",
+ "9 34 55\r",
+ "9 34 56\r",
+ "9 34 57\r",
+ "9 34 58\r",
+ "9 35 1\r",
+ "9 35 2\r",
+ "9 35 3\r",
+ "9 35 4\r",
+ "9 35 5\r",
+ "9 35 6\r",
+ "9 35 7\r",
+ "9 35 8\r",
+ "9 35 9\r",
+ "9 35 10\r",
+ "9 35 11\r",
+ "9 35 12\r",
+ "9 35 13\r",
+ "9 35 14\r",
+ "9 35 15\r",
+ "9 35 16\r",
+ "9 35 17\r",
+ "9 35 18\r",
+ "9 35 19\r",
+ "9 35 20\r",
+ "9 35 21\r",
+ "9 35 22\r",
+ "9 35 23\r",
+ "9 35 24\r",
+ "9 35 25\r",
+ "9 35 26\r",
+ "9 35 27\r",
+ "9 35 28\r",
+ "9 35 29\r",
+ "9 35 30\r",
+ "9 35 31\r",
+ "9 35 32\r",
+ "9 35 33\r",
+ "9 35 34\r",
+ "9 35 35\r",
+ "9 35 36\r",
+ "9 35 37\r",
+ "9 35 38\r",
+ "9 35 39\r",
+ "9 35 40\r",
+ "9 35 41\r",
+ "9 35 42\r",
+ "9 35 43\r",
+ "9 35 44\r",
+ "9 35 45\r",
+ "9 35 46\r",
+ "9 35 47\r",
+ "9 35 48\r",
+ "9 35 49\r",
+ "9 35 50\r",
+ "9 35 51\r",
+ "9 35 52\r",
+ "9 35 53\r",
+ "9 35 54\r",
+ "9 35 55\r",
+ "9 35 56\r",
+ "9 35 57\r",
+ "9 35 58\r",
+ "9 36 1\r",
+ "9 36 2\r",
+ "9 36 3\r",
+ "9 36 4\r",
+ "9 36 5\r",
+ "9 36 6\r",
+ "9 36 7\r",
+ "9 36 8\r",
+ "9 36 9\r",
+ "9 36 10\r",
+ "9 36 11\r",
+ "9 36 12\r",
+ "9 36 13\r",
+ "9 36 14\r",
+ "9 36 15\r",
+ "9 36 16\r",
+ "9 36 17\r",
+ "9 36 18\r",
+ "9 36 19\r",
+ "9 36 20\r",
+ "9 36 21\r",
+ "9 36 22\r",
+ "9 36 23\r",
+ "9 36 24\r",
+ "9 36 25\r",
+ "9 36 26\r",
+ "9 36 27\r",
+ "9 36 28\r",
+ "9 36 29\r",
+ "9 36 30\r",
+ "9 36 31\r",
+ "9 36 32\r",
+ "9 36 33\r",
+ "9 36 34\r",
+ "9 36 35\r",
+ "9 36 36\r",
+ "9 36 37\r",
+ "9 36 38\r",
+ "9 36 39\r",
+ "9 36 40\r",
+ "9 36 41\r",
+ "9 36 42\r",
+ "9 36 43\r",
+ "9 36 44\r",
+ "9 36 45\r",
+ "9 36 46\r",
+ "9 36 47\r",
+ "9 36 48\r",
+ "9 36 49\r",
+ "9 36 50\r",
+ "9 36 51\r",
+ "9 36 52\r",
+ "9 36 53\r",
+ "9 36 54\r",
+ "9 36 55\r",
+ "9 36 56\r",
+ "9 36 57\r",
+ "9 36 58\r",
+ "9 37 1\r",
+ "9 37 2\r",
+ "9 37 3\r",
+ "9 37 4\r",
+ "9 37 5\r",
+ "9 37 6\r",
+ "9 37 7\r",
+ "9 37 8\r",
+ "9 37 9\r",
+ "9 37 10\r",
+ "9 37 11\r",
+ "9 37 12\r",
+ "9 37 13\r",
+ "9 37 14\r",
+ "9 37 15\r",
+ "9 37 16\r",
+ "9 37 17\r",
+ "9 37 18\r",
+ "9 37 19\r",
+ "9 37 20\r",
+ "9 37 21\r",
+ "9 37 22\r",
+ "9 37 23\r",
+ "9 37 24\r",
+ "9 37 25\r",
+ "9 37 26\r",
+ "9 37 27\r",
+ "9 37 28\r",
+ "9 37 29\r",
+ "9 37 30\r",
+ "9 37 31\r",
+ "9 37 32\r",
+ "9 37 33\r",
+ "9 37 34\r",
+ "9 37 35\r",
+ "9 37 36\r",
+ "9 37 37\r",
+ "9 37 38\r",
+ "9 37 39\r",
+ "9 37 40\r",
+ "9 37 41\r",
+ "9 37 42\r",
+ "9 37 43\r",
+ "9 37 44\r",
+ "9 37 45\r",
+ "9 37 46\r",
+ "9 37 47\r",
+ "9 37 48\r",
+ "9 37 49\r",
+ "9 37 50\r",
+ "9 37 51\r",
+ "9 37 52\r",
+ "9 37 53\r",
+ "9 37 54\r",
+ "9 37 55\r",
+ "9 37 56\r",
+ "9 37 57\r",
+ "9 37 58\r",
+ "9 38 1\r",
+ "9 38 2\r",
+ "9 38 3\r",
+ "9 38 4\r",
+ "9 38 5\r",
+ "9 38 6\r",
+ "9 38 7\r",
+ "9 38 8\r",
+ "9 38 9\r",
+ "9 38 10\r",
+ "9 38 11\r",
+ "9 38 12\r",
+ "9 38 13\r",
+ "9 38 14\r",
+ "9 38 15\r",
+ "9 38 16\r",
+ "9 38 17\r",
+ "9 38 18\r",
+ "9 38 19\r",
+ "9 38 20\r",
+ "9 38 21\r",
+ "9 38 22\r",
+ "9 38 23\r",
+ "9 38 24\r",
+ "9 38 25\r",
+ "9 38 26\r",
+ "9 38 27\r",
+ "9 38 28\r",
+ "9 38 29\r",
+ "9 38 30\r",
+ "9 38 31\r",
+ "9 38 32\r",
+ "9 38 33\r",
+ "9 38 34\r",
+ "9 38 35\r",
+ "9 38 36\r",
+ "9 38 37\r",
+ "9 38 38\r",
+ "9 38 39\r",
+ "9 38 40\r",
+ "9 38 41\r",
+ "9 38 42\r",
+ "9 38 43\r",
+ "9 38 44\r",
+ "9 38 45\r",
+ "9 38 46\r",
+ "9 38 47\r",
+ "9 38 48\r",
+ "9 38 49\r",
+ "9 38 50\r",
+ "9 38 51\r",
+ "9 38 52\r",
+ "9 38 53\r",
+ "9 38 54\r",
+ "9 38 55\r",
+ "9 38 56\r",
+ "9 38 57\r",
+ "9 38 58\r",
+ "9 39 1\r",
+ "9 39 2\r",
+ "9 39 3\r",
+ "9 39 4\r",
+ "9 39 5\r",
+ "9 39 6\r",
+ "9 39 7\r",
+ "9 39 8\r",
+ "9 39 9\r",
+ "9 39 10\r",
+ "9 39 11\r",
+ "9 39 12\r",
+ "9 39 13\r",
+ "9 39 14\r",
+ "9 39 15\r",
+ "9 39 16\r",
+ "9 39 17\r",
+ "9 39 18\r",
+ "9 39 19\r",
+ "9 39 20\r",
+ "9 39 21\r",
+ "9 39 22\r",
+ "9 39 23\r",
+ "9 39 24\r",
+ "9 39 25\r",
+ "9 39 26\r",
+ "9 39 27\r",
+ "9 39 28\r",
+ "9 39 29\r",
+ "9 39 30\r",
+ "9 39 31\r",
+ "9 39 32\r",
+ "9 39 33\r",
+ "9 39 34\r",
+ "9 39 35\r",
+ "9 39 36\r",
+ "9 39 37\r",
+ "9 39 38\r",
+ "9 39 39\r",
+ "9 39 40\r",
+ "9 39 41\r",
+ "9 39 42\r",
+ "9 39 43\r",
+ "9 39 44\r",
+ "9 39 45\r",
+ "9 39 46\r",
+ "9 39 47\r",
+ "9 39 48\r",
+ "9 39 49\r",
+ "9 39 50\r",
+ "9 39 51\r",
+ "9 39 52\r",
+ "9 39 53\r",
+ "9 39 54\r",
+ "9 39 55\r",
+ "9 39 56\r",
+ "9 39 57\r",
+ "9 39 58\r",
+ "9 40 1\r",
+ "9 40 2\r",
+ "9 40 3\r",
+ "9 40 4\r",
+ "9 40 5\r",
+ "9 40 6\r",
+ "9 40 7\r",
+ "9 40 8\r",
+ "9 40 9\r",
+ "9 40 10\r",
+ "9 40 11\r",
+ "9 40 12\r",
+ "9 40 13\r",
+ "9 40 14\r",
+ "9 40 15\r",
+ "9 40 16\r",
+ "9 40 17\r",
+ "9 40 18\r",
+ "9 40 19\r",
+ "9 40 20\r",
+ "9 40 21\r",
+ "9 40 22\r",
+ "9 40 23\r",
+ "9 40 24\r",
+ "9 40 25\r",
+ "9 40 26\r",
+ "9 40 27\r",
+ "9 40 28\r",
+ "9 40 29\r",
+ "9 40 30\r",
+ "9 40 31\r",
+ "9 40 32\r",
+ "9 40 33\r",
+ "9 40 34\r",
+ "9 40 35\r",
+ "9 40 36\r",
+ "9 40 37\r",
+ "9 40 38\r",
+ "9 40 39\r",
+ "9 40 40\r",
+ "9 40 41\r",
+ "9 40 42\r",
+ "9 40 43\r",
+ "9 40 44\r",
+ "9 40 45\r",
+ "9 40 46\r",
+ "9 40 47\r",
+ "9 40 48\r",
+ "9 40 49\r",
+ "9 40 50\r",
+ "9 40 51\r",
+ "9 40 52\r",
+ "9 40 53\r",
+ "9 40 54\r",
+ "9 40 55\r",
+ "9 40 56\r",
+ "9 40 57\r",
+ "9 40 58\r",
+ "9 41 1\r",
+ "9 41 2\r",
+ "9 41 3\r",
+ "9 41 4\r",
+ "9 41 5\r",
+ "9 41 6\r",
+ "9 41 7\r",
+ "9 41 8\r",
+ "9 41 9\r",
+ "9 41 10\r",
+ "9 41 11\r",
+ "9 41 12\r",
+ "9 41 13\r",
+ "9 41 14\r",
+ "9 41 15\r",
+ "9 41 16\r",
+ "9 41 17\r",
+ "9 41 18\r",
+ "9 41 19\r",
+ "9 41 20\r",
+ "9 41 21\r",
+ "9 41 22\r",
+ "9 41 23\r",
+ "9 41 24\r",
+ "9 41 25\r",
+ "9 41 26\r",
+ "9 41 27\r",
+ "9 41 28\r",
+ "9 41 29\r",
+ "9 41 30\r",
+ "9 41 31\r",
+ "9 41 32\r",
+ "9 41 33\r",
+ "9 41 34\r",
+ "9 41 35\r",
+ "9 41 36\r",
+ "9 41 37\r",
+ "9 41 38\r",
+ "9 41 39\r",
+ "9 41 40\r",
+ "9 41 41\r",
+ "9 41 42\r",
+ "9 41 43\r",
+ "9 41 44\r",
+ "9 41 45\r",
+ "9 41 46\r",
+ "9 41 47\r",
+ "9 41 48\r",
+ "9 41 49\r",
+ "9 41 50\r",
+ "9 41 51\r",
+ "9 41 52\r",
+ "9 41 53\r",
+ "9 41 54\r",
+ "9 41 55\r",
+ "9 41 56\r",
+ "9 41 57\r",
+ "9 41 58\r",
+ "9 42 1\r",
+ "9 42 2\r",
+ "9 42 3\r",
+ "9 42 4\r",
+ "9 42 5\r",
+ "9 42 6\r",
+ "9 42 7\r",
+ "9 42 8\r",
+ "9 42 9\r",
+ "9 42 10\r",
+ "9 42 11\r",
+ "9 42 12\r",
+ "9 42 13\r",
+ "9 42 14\r",
+ "9 42 15\r",
+ "9 42 16\r",
+ "9 42 17\r",
+ "9 42 18\r",
+ "9 42 19\r",
+ "9 42 20\r",
+ "9 42 21\r",
+ "9 42 22\r",
+ "9 42 23\r",
+ "9 42 24\r",
+ "9 42 25\r",
+ "9 42 26\r",
+ "9 42 27\r",
+ "9 42 28\r",
+ "9 42 29\r",
+ "9 42 30\r",
+ "9 42 31\r",
+ "9 42 32\r",
+ "9 42 33\r",
+ "9 42 34\r",
+ "9 42 35\r",
+ "9 42 36\r",
+ "9 42 37\r",
+ "9 42 38\r",
+ "9 42 39\r",
+ "9 42 40\r",
+ "9 42 41\r",
+ "9 42 42\r",
+ "9 42 43\r",
+ "9 42 44\r",
+ "9 42 45\r",
+ "9 42 46\r",
+ "9 42 47\r",
+ "9 42 48\r",
+ "9 42 49\r",
+ "9 42 50\r",
+ "9 42 51\r",
+ "9 42 52\r",
+ "9 42 53\r",
+ "9 42 54\r",
+ "9 42 55\r",
+ "9 42 56\r",
+ "9 42 57\r",
+ "9 42 58\r",
+ "9 43 1\r",
+ "9 43 2\r",
+ "9 43 3\r",
+ "9 43 4\r",
+ "9 43 5\r",
+ "9 43 6\r",
+ "9 43 7\r",
+ "9 43 8\r",
+ "9 43 9\r",
+ "9 43 10\r",
+ "9 43 11\r",
+ "9 43 12\r",
+ "9 43 13\r",
+ "9 43 14\r",
+ "9 43 15\r",
+ "9 43 16\r",
+ "9 43 17\r",
+ "9 43 18\r",
+ "9 43 19\r",
+ "9 43 20\r",
+ "9 43 21\r",
+ "9 43 22\r",
+ "9 43 23\r",
+ "9 43 24\r",
+ "9 43 25\r",
+ "9 43 26\r",
+ "9 43 27\r",
+ "9 43 28\r",
+ "9 43 29\r",
+ "9 43 30\r",
+ "9 43 31\r",
+ "9 43 32\r",
+ "9 43 33\r",
+ "9 43 34\r",
+ "9 43 35\r",
+ "9 43 36\r",
+ "9 43 37\r",
+ "9 43 38\r",
+ "9 43 39\r",
+ "9 43 40\r",
+ "9 43 41\r",
+ "9 43 42\r",
+ "9 43 43\r",
+ "9 43 44\r",
+ "9 43 45\r",
+ "9 43 46\r",
+ "9 43 47\r",
+ "9 43 48\r",
+ "9 43 49\r",
+ "9 43 50\r",
+ "9 43 51\r",
+ "9 43 52\r",
+ "9 43 53\r",
+ "9 43 54\r",
+ "9 43 55\r",
+ "9 43 56\r",
+ "9 43 57\r",
+ "9 43 58\r",
+ "9 44 1\r",
+ "9 44 2\r",
+ "9 44 3\r",
+ "9 44 4\r",
+ "9 44 5\r",
+ "9 44 6\r",
+ "9 44 7\r",
+ "9 44 8\r",
+ "9 44 9\r",
+ "9 44 10\r",
+ "9 44 11\r",
+ "9 44 12\r",
+ "9 44 13\r",
+ "9 44 14\r",
+ "9 44 15\r",
+ "9 44 16\r",
+ "9 44 17\r",
+ "9 44 18\r",
+ "9 44 19\r",
+ "9 44 20\r",
+ "9 44 21\r",
+ "9 44 22\r",
+ "9 44 23\r",
+ "9 44 24\r",
+ "9 44 25\r",
+ "9 44 26\r",
+ "9 44 27\r",
+ "9 44 28\r",
+ "9 44 29\r",
+ "9 44 30\r",
+ "9 44 31\r",
+ "9 44 32\r",
+ "9 44 33\r",
+ "9 44 34\r",
+ "9 44 35\r",
+ "9 44 36\r",
+ "9 44 37\r",
+ "9 44 38\r",
+ "9 44 39\r",
+ "9 44 40\r",
+ "9 44 41\r",
+ "9 44 42\r",
+ "9 44 43\r",
+ "9 44 44\r",
+ "9 44 45\r",
+ "9 44 46\r",
+ "9 44 47\r",
+ "9 44 48\r",
+ "9 44 49\r",
+ "9 44 50\r",
+ "9 44 51\r",
+ "9 44 52\r",
+ "9 44 53\r",
+ "9 44 54\r",
+ "9 44 55\r",
+ "9 44 56\r",
+ "9 44 57\r",
+ "9 44 58\r",
+ "9 45 1\r",
+ "9 45 2\r",
+ "9 45 3\r",
+ "9 45 4\r",
+ "9 45 5\r",
+ "9 45 6\r",
+ "9 45 7\r",
+ "9 45 8\r",
+ "9 45 9\r",
+ "9 45 10\r",
+ "9 45 11\r",
+ "9 45 12\r",
+ "9 45 13\r",
+ "9 45 14\r",
+ "9 45 15\r",
+ "9 45 16\r",
+ "9 45 17\r",
+ "9 45 18\r",
+ "9 45 19\r",
+ "9 45 20\r",
+ "9 45 21\r",
+ "9 45 22\r",
+ "9 45 23\r",
+ "9 45 24\r",
+ "9 45 25\r",
+ "9 45 26\r",
+ "9 45 27\r",
+ "9 45 28\r",
+ "9 45 29\r",
+ "9 45 30\r",
+ "9 45 31\r",
+ "9 45 32\r",
+ "9 45 33\r",
+ "9 45 34\r",
+ "9 45 35\r",
+ "9 45 36\r",
+ "9 45 37\r",
+ "9 45 38\r",
+ "9 45 39\r",
+ "9 45 40\r",
+ "9 45 41\r",
+ "9 45 42\r",
+ "9 45 43\r",
+ "9 45 44\r",
+ "9 45 45\r",
+ "9 45 46\r",
+ "9 45 47\r",
+ "9 45 48\r",
+ "9 45 49\r",
+ "9 45 50\r",
+ "9 45 51\r",
+ "9 45 52\r",
+ "9 45 53\r",
+ "9 45 54\r",
+ "9 45 55\r",
+ "9 45 56\r",
+ "9 45 57\r",
+ "9 45 58\r",
+ "9 46 1\r",
+ "9 46 2\r",
+ "9 46 3\r",
+ "9 46 4\r",
+ "9 46 5\r",
+ "9 46 6\r",
+ "9 46 7\r",
+ "9 46 8\r",
+ "9 46 9\r",
+ "9 46 10\r",
+ "9 46 11\r",
+ "9 46 12\r",
+ "9 46 13\r",
+ "9 46 14\r",
+ "9 46 15\r",
+ "9 46 16\r",
+ "9 46 17\r",
+ "9 46 18\r",
+ "9 46 19\r",
+ "9 46 20\r",
+ "9 46 21\r",
+ "9 46 22\r",
+ "9 46 23\r",
+ "9 46 24\r",
+ "9 46 25\r",
+ "9 46 26\r",
+ "9 46 27\r",
+ "9 46 28\r",
+ "9 46 29\r",
+ "9 46 30\r",
+ "9 46 31\r",
+ "9 46 32\r",
+ "9 46 33\r",
+ "9 46 34\r",
+ "9 46 35\r",
+ "9 46 36\r",
+ "9 46 37\r",
+ "9 46 38\r",
+ "9 46 39\r",
+ "9 46 40\r",
+ "9 46 41\r",
+ "9 46 42\r",
+ "9 46 43\r",
+ "9 46 44\r",
+ "9 46 45\r",
+ "9 46 46\r",
+ "9 46 47\r",
+ "9 46 48\r",
+ "9 46 49\r",
+ "9 46 50\r",
+ "9 46 51\r",
+ "9 46 52\r",
+ "9 46 53\r",
+ "9 46 54\r",
+ "9 46 55\r",
+ "9 46 56\r",
+ "9 46 57\r",
+ "9 46 58\r",
+ "9 47 1\r",
+ "9 47 2\r",
+ "9 47 3\r",
+ "9 47 4\r",
+ "9 47 5\r",
+ "9 47 6\r",
+ "9 47 7\r",
+ "9 47 8\r",
+ "9 47 9\r",
+ "9 47 10\r",
+ "9 47 11\r",
+ "9 47 12\r",
+ "9 47 13\r",
+ "9 47 14\r",
+ "9 47 15\r",
+ "9 47 16\r",
+ "9 47 17\r",
+ "9 47 18\r",
+ "9 47 19\r",
+ "9 47 20\r",
+ "9 47 21\r",
+ "9 47 22\r",
+ "9 47 23\r",
+ "9 47 24\r",
+ "9 47 25\r",
+ "9 47 26\r",
+ "9 47 27\r",
+ "9 47 28\r",
+ "9 47 29\r",
+ "9 47 30\r",
+ "9 47 31\r",
+ "9 47 32\r",
+ "9 47 33\r",
+ "9 47 34\r",
+ "9 47 35\r",
+ "9 47 36\r",
+ "9 47 37\r",
+ "9 47 38\r",
+ "9 47 39\r",
+ "9 47 40\r",
+ "9 47 41\r",
+ "9 47 42\r",
+ "9 47 43\r",
+ "9 47 44\r",
+ "9 47 45\r",
+ "9 47 46\r",
+ "9 47 47\r",
+ "9 47 48\r",
+ "9 47 49\r",
+ "9 47 50\r",
+ "9 47 51\r",
+ "9 47 52\r",
+ "9 47 53\r",
+ "9 47 54\r",
+ "9 47 55\r",
+ "9 47 56\r",
+ "9 47 57\r",
+ "9 47 58\r",
+ "9 48 1\r",
+ "9 48 2\r",
+ "9 48 3\r",
+ "9 48 4\r",
+ "9 48 5\r",
+ "9 48 6\r",
+ "9 48 7\r",
+ "9 48 8\r",
+ "9 48 9\r",
+ "9 48 10\r",
+ "9 48 11\r",
+ "9 48 12\r",
+ "9 48 13\r",
+ "9 48 14\r",
+ "9 48 15\r",
+ "9 48 16\r",
+ "9 48 17\r",
+ "9 48 18\r",
+ "9 48 19\r",
+ "9 48 20\r",
+ "9 48 21\r",
+ "9 48 22\r",
+ "9 48 23\r",
+ "9 48 24\r",
+ "9 48 25\r",
+ "9 48 26\r",
+ "9 48 27\r",
+ "9 48 28\r",
+ "9 48 29\r",
+ "9 48 30\r",
+ "9 48 31\r",
+ "9 48 32\r",
+ "9 48 33\r",
+ "9 48 34\r",
+ "9 48 35\r",
+ "9 48 36\r",
+ "9 48 37\r",
+ "9 48 38\r",
+ "9 48 39\r",
+ "9 48 40\r",
+ "9 48 41\r",
+ "9 48 42\r",
+ "9 48 43\r",
+ "9 48 44\r",
+ "9 48 45\r",
+ "9 48 46\r",
+ "9 48 47\r",
+ "9 48 48\r",
+ "9 48 49\r",
+ "9 48 50\r",
+ "9 48 51\r",
+ "9 48 52\r",
+ "9 48 53\r",
+ "9 48 54\r",
+ "9 48 55\r",
+ "9 48 56\r",
+ "9 48 57\r",
+ "9 48 58\r",
+ "9 49 1\r",
+ "9 49 2\r",
+ "9 49 3\r",
+ "9 49 4\r",
+ "9 49 5\r",
+ "9 49 6\r",
+ "9 49 7\r",
+ "9 49 8\r",
+ "9 49 9\r",
+ "9 49 10\r",
+ "9 49 11\r",
+ "9 49 12\r",
+ "9 49 13\r",
+ "9 49 14\r",
+ "9 49 15\r",
+ "9 49 16\r",
+ "9 49 17\r",
+ "9 49 18\r",
+ "9 49 19\r",
+ "9 49 20\r",
+ "9 49 21\r",
+ "9 49 22\r",
+ "9 49 23\r",
+ "9 49 24\r",
+ "9 49 25\r",
+ "9 49 26\r",
+ "9 49 27\r",
+ "9 49 28\r",
+ "9 49 29\r",
+ "9 49 30\r",
+ "9 49 31\r",
+ "9 49 32\r",
+ "9 49 33\r",
+ "9 49 34\r",
+ "9 49 35\r",
+ "9 49 36\r",
+ "9 49 37\r",
+ "9 49 38\r",
+ "9 49 39\r",
+ "9 49 40\r",
+ "9 49 41\r",
+ "9 49 42\r",
+ "9 49 43\r",
+ "9 49 44\r",
+ "9 49 45\r",
+ "9 49 46\r",
+ "9 49 47\r",
+ "9 49 48\r",
+ "9 49 49\r",
+ "9 49 50\r",
+ "9 49 51\r",
+ "9 49 52\r",
+ "9 49 53\r",
+ "9 49 54\r",
+ "9 49 55\r",
+ "9 49 56\r",
+ "9 49 57\r",
+ "9 49 58\r",
+ "9 50 1\r",
+ "9 50 2\r",
+ "9 50 3\r",
+ "9 50 4\r",
+ "9 50 5\r",
+ "9 50 6\r",
+ "9 50 7\r",
+ "9 50 8\r",
+ "9 50 9\r",
+ "9 50 10\r",
+ "9 50 11\r",
+ "9 50 12\r",
+ "9 50 13\r",
+ "9 50 14\r",
+ "9 50 15\r",
+ "9 50 16\r",
+ "9 50 17\r",
+ "9 50 18\r",
+ "9 50 19\r",
+ "9 50 20\r",
+ "9 50 21\r",
+ "9 50 22\r",
+ "9 50 23\r",
+ "9 50 24\r",
+ "9 50 25\r",
+ "9 50 26\r",
+ "9 50 27\r",
+ "9 50 28\r",
+ "9 50 29\r",
+ "9 50 30\r",
+ "9 50 31\r",
+ "9 50 32\r",
+ "9 50 33\r",
+ "9 50 34\r",
+ "9 50 35\r",
+ "9 50 36\r",
+ "9 50 37\r",
+ "9 50 38\r",
+ "9 50 39\r",
+ "9 50 40\r",
+ "9 50 41\r",
+ "9 50 42\r",
+ "9 50 43\r",
+ "9 50 44\r",
+ "9 50 45\r",
+ "9 50 46\r",
+ "9 50 47\r",
+ "9 50 48\r",
+ "9 50 49\r",
+ "9 50 50\r",
+ "9 50 51\r",
+ "9 50 52\r",
+ "9 50 53\r",
+ "9 50 54\r",
+ "9 50 55\r",
+ "9 50 56\r",
+ "9 50 57\r",
+ "9 50 58\r",
+ "9 51 1\r",
+ "9 51 2\r",
+ "9 51 3\r",
+ "9 51 4\r",
+ "9 51 5\r",
+ "9 51 6\r",
+ "9 51 7\r",
+ "9 51 8\r",
+ "9 51 9\r",
+ "9 51 10\r",
+ "9 51 11\r",
+ "9 51 12\r",
+ "9 51 13\r",
+ "9 51 14\r",
+ "9 51 15\r",
+ "9 51 16\r",
+ "9 51 17\r",
+ "9 51 18\r",
+ "9 51 19\r",
+ "9 51 20\r",
+ "9 51 21\r",
+ "9 51 22\r",
+ "9 51 23\r",
+ "9 51 24\r",
+ "9 51 25\r",
+ "9 51 26\r",
+ "9 51 27\r",
+ "9 51 28\r",
+ "9 51 29\r",
+ "9 51 30\r",
+ "9 51 31\r",
+ "9 51 32\r",
+ "9 51 33\r",
+ "9 51 34\r",
+ "9 51 35\r",
+ "9 51 36\r",
+ "9 51 37\r",
+ "9 51 38\r",
+ "9 51 39\r",
+ "9 51 40\r",
+ "9 51 41\r",
+ "9 51 42\r",
+ "9 51 43\r",
+ "9 51 44\r",
+ "9 51 45\r",
+ "9 51 46\r",
+ "9 51 47\r",
+ "9 51 48\r",
+ "9 51 49\r",
+ "9 51 50\r",
+ "9 51 51\r",
+ "9 51 52\r",
+ "9 51 53\r",
+ "9 51 54\r",
+ "9 51 55\r",
+ "9 51 56\r",
+ "9 51 57\r",
+ "9 51 58\r",
+ "9 52 1\r",
+ "9 52 2\r",
+ "9 52 3\r",
+ "9 52 4\r",
+ "9 52 5\r",
+ "9 52 6\r",
+ "9 52 7\r",
+ "9 52 8\r",
+ "9 52 9\r",
+ "9 52 10\r",
+ "9 52 11\r",
+ "9 52 12\r",
+ "9 52 13\r",
+ "9 52 14\r",
+ "9 52 15\r",
+ "9 52 16\r",
+ "9 52 17\r",
+ "9 52 18\r",
+ "9 52 19\r",
+ "9 52 20\r",
+ "9 52 21\r",
+ "9 52 22\r",
+ "9 52 23\r",
+ "9 52 24\r",
+ "9 52 25\r",
+ "9 52 26\r",
+ "9 52 27\r",
+ "9 52 28\r",
+ "9 52 29\r",
+ "9 52 30\r",
+ "9 52 31\r",
+ "9 52 32\r",
+ "9 52 33\r",
+ "9 52 34\r",
+ "9 52 35\r",
+ "9 52 36\r",
+ "9 52 37\r",
+ "9 52 38\r",
+ "9 52 39\r",
+ "9 52 40\r",
+ "9 52 41\r",
+ "9 52 42\r",
+ "9 52 43\r",
+ "9 52 44\r",
+ "9 52 45\r",
+ "9 52 46\r",
+ "9 52 47\r",
+ "9 52 48\r",
+ "9 52 49\r",
+ "9 52 50\r",
+ "9 52 51\r",
+ "9 52 52\r",
+ "9 52 53\r",
+ "9 52 54\r",
+ "9 52 55\r",
+ "9 52 56\r",
+ "9 52 57\r",
+ "9 52 58\r",
+ "9 53 1\r",
+ "9 53 2\r",
+ "9 53 3\r",
+ "9 53 4\r",
+ "9 53 5\r",
+ "9 53 6\r",
+ "9 53 7\r",
+ "9 53 8\r",
+ "9 53 9\r",
+ "9 53 10\r",
+ "9 53 11\r",
+ "9 53 12\r",
+ "9 53 13\r",
+ "9 53 14\r",
+ "9 53 15\r",
+ "9 53 16\r",
+ "9 53 17\r",
+ "9 53 18\r",
+ "9 53 19\r",
+ "9 53 20\r",
+ "9 53 21\r",
+ "9 53 22\r",
+ "9 53 23\r",
+ "9 53 24\r",
+ "9 53 25\r",
+ "9 53 26\r",
+ "9 53 27\r",
+ "9 53 28\r",
+ "9 53 29\r",
+ "9 53 30\r",
+ "9 53 31\r",
+ "9 53 32\r",
+ "9 53 33\r",
+ "9 53 34\r",
+ "9 53 35\r",
+ "9 53 36\r",
+ "9 53 37\r",
+ "9 53 38\r",
+ "9 53 39\r",
+ "9 53 40\r",
+ "9 53 41\r",
+ "9 53 42\r",
+ "9 53 43\r",
+ "9 53 44\r",
+ "9 53 45\r",
+ "9 53 46\r",
+ "9 53 47\r",
+ "9 53 48\r",
+ "9 53 49\r",
+ "9 53 50\r",
+ "9 53 51\r",
+ "9 53 52\r",
+ "9 53 53\r",
+ "9 53 54\r",
+ "9 53 55\r",
+ "9 53 56\r",
+ "9 53 57\r",
+ "9 53 58\r",
+ "9 54 1\r",
+ "9 54 2\r",
+ "9 54 3\r",
+ "9 54 4\r",
+ "9 54 5\r",
+ "9 54 6\r",
+ "9 54 7\r",
+ "9 54 8\r",
+ "9 54 9\r",
+ "9 54 10\r",
+ "9 54 11\r",
+ "9 54 12\r",
+ "9 54 13\r",
+ "9 54 14\r",
+ "9 54 15\r",
+ "9 54 16\r",
+ "9 54 17\r",
+ "9 54 18\r",
+ "9 54 19\r",
+ "9 54 20\r",
+ "9 54 21\r",
+ "9 54 22\r",
+ "9 54 23\r",
+ "9 54 24\r",
+ "9 54 25\r",
+ "9 54 26\r",
+ "9 54 27\r",
+ "9 54 28\r",
+ "9 54 29\r",
+ "9 54 30\r",
+ "9 54 31\r",
+ "9 54 32\r",
+ "9 54 33\r",
+ "9 54 34\r",
+ "9 54 35\r",
+ "9 54 36\r",
+ "9 54 37\r",
+ "9 54 38\r",
+ "9 54 39\r",
+ "9 54 40\r",
+ "9 54 41\r",
+ "9 54 42\r",
+ "9 54 43\r",
+ "9 54 44\r",
+ "9 54 45\r",
+ "9 54 46\r",
+ "9 54 47\r",
+ "9 54 48\r",
+ "9 54 49\r",
+ "9 54 50\r",
+ "9 54 51\r",
+ "9 54 52\r",
+ "9 54 53\r",
+ "9 54 54\r",
+ "9 54 55\r",
+ "9 54 56\r",
+ "9 54 57\r",
+ "9 54 58\r",
+ "9 55 1\r",
+ "9 55 2\r",
+ "9 55 3\r",
+ "9 55 4\r",
+ "9 55 5\r",
+ "9 55 6\r",
+ "9 55 7\r",
+ "9 55 8\r",
+ "9 55 9\r",
+ "9 55 10\r",
+ "9 55 11\r",
+ "9 55 12\r",
+ "9 55 13\r",
+ "9 55 14\r",
+ "9 55 15\r",
+ "9 55 16\r",
+ "9 55 17\r",
+ "9 55 18\r",
+ "9 55 19\r",
+ "9 55 20\r",
+ "9 55 21\r",
+ "9 55 22\r",
+ "9 55 23\r",
+ "9 55 24\r",
+ "9 55 25\r",
+ "9 55 26\r",
+ "9 55 27\r",
+ "9 55 28\r",
+ "9 55 29\r",
+ "9 55 30\r",
+ "9 55 31\r",
+ "9 55 32\r",
+ "9 55 33\r",
+ "9 55 34\r",
+ "9 55 35\r",
+ "9 55 36\r",
+ "9 55 37\r",
+ "9 55 38\r",
+ "9 55 39\r",
+ "9 55 40\r",
+ "9 55 41\r",
+ "9 55 42\r",
+ "9 55 43\r",
+ "9 55 44\r",
+ "9 55 45\r",
+ "9 55 46\r",
+ "9 55 47\r",
+ "9 55 48\r",
+ "9 55 49\r",
+ "9 55 50\r",
+ "9 55 51\r",
+ "9 55 52\r",
+ "9 55 53\r",
+ "9 55 54\r",
+ "9 55 55\r",
+ "9 55 56\r",
+ "9 55 57\r",
+ "9 55 58\r",
+ "9 56 1\r",
+ "9 56 2\r",
+ "9 56 3\r",
+ "9 56 4\r",
+ "9 56 5\r",
+ "9 56 6\r",
+ "9 56 7\r",
+ "9 56 8\r",
+ "9 56 9\r",
+ "9 56 10\r",
+ "9 56 11\r",
+ "9 56 12\r",
+ "9 56 13\r",
+ "9 56 14\r",
+ "9 56 15\r",
+ "9 56 16\r",
+ "9 56 17\r",
+ "9 56 18\r",
+ "9 56 19\r",
+ "9 56 20\r",
+ "9 56 21\r",
+ "9 56 22\r",
+ "9 56 23\r",
+ "9 56 24\r",
+ "9 56 25\r",
+ "9 56 26\r",
+ "9 56 27\r",
+ "9 56 28\r",
+ "9 56 29\r",
+ "9 56 30\r",
+ "9 56 31\r",
+ "9 56 32\r",
+ "9 56 33\r",
+ "9 56 34\r",
+ "9 56 35\r",
+ "9 56 36\r",
+ "9 56 37\r",
+ "9 56 38\r",
+ "9 56 39\r",
+ "9 56 40\r",
+ "9 56 41\r",
+ "9 56 42\r",
+ "9 56 43\r",
+ "9 56 44\r",
+ "9 56 45\r",
+ "9 56 46\r",
+ "9 56 47\r",
+ "9 56 48\r",
+ "9 56 49\r",
+ "9 56 50\r",
+ "9 56 51\r",
+ "9 56 52\r",
+ "9 56 53\r",
+ "9 56 54\r",
+ "9 56 55\r",
+ "9 56 56\r",
+ "9 56 57\r",
+ "9 56 58\r",
+ "9 57 1\r",
+ "9 57 2\r",
+ "9 57 3\r",
+ "9 57 4\r",
+ "9 57 5\r",
+ "9 57 6\r",
+ "9 57 7\r",
+ "9 57 8\r",
+ "9 57 9\r",
+ "9 57 10\r",
+ "9 57 11\r",
+ "9 57 12\r",
+ "9 57 13\r",
+ "9 57 14\r",
+ "9 57 15\r",
+ "9 57 16\r",
+ "9 57 17\r",
+ "9 57 18\r",
+ "9 57 19\r",
+ "9 57 20\r",
+ "9 57 21\r",
+ "9 57 22\r",
+ "9 57 23\r",
+ "9 57 24\r",
+ "9 57 25\r",
+ "9 57 26\r",
+ "9 57 27\r",
+ "9 57 28\r",
+ "9 57 29\r",
+ "9 57 30\r",
+ "9 57 31\r",
+ "9 57 32\r",
+ "9 57 33\r",
+ "9 57 34\r",
+ "9 57 35\r",
+ "9 57 36\r",
+ "9 57 37\r",
+ "9 57 38\r",
+ "9 57 39\r",
+ "9 57 40\r",
+ "9 57 41\r",
+ "9 57 42\r",
+ "9 57 43\r",
+ "9 57 44\r",
+ "9 57 45\r",
+ "9 57 46\r",
+ "9 57 47\r",
+ "9 57 48\r",
+ "9 57 49\r",
+ "9 57 50\r",
+ "9 57 51\r",
+ "9 57 52\r",
+ "9 57 53\r",
+ "9 57 54\r",
+ "9 57 55\r",
+ "9 57 56\r",
+ "9 57 57\r",
+ "9 57 58\r",
+ "9 58 1\r",
+ "9 58 2\r",
+ "9 58 3\r",
+ "9 58 4\r",
+ "9 58 5\r",
+ "9 58 6\r",
+ "9 58 7\r",
+ "9 58 8\r",
+ "9 58 9\r",
+ "9 58 10\r",
+ "9 58 11\r",
+ "9 58 12\r",
+ "9 58 13\r",
+ "9 58 14\r",
+ "9 58 15\r",
+ "9 58 16\r",
+ "9 58 17\r",
+ "9 58 18\r",
+ "9 58 19\r",
+ "9 58 20\r",
+ "9 58 21\r",
+ "9 58 22\r",
+ "9 58 23\r",
+ "9 58 24\r",
+ "9 58 25\r",
+ "9 58 26\r",
+ "9 58 27\r",
+ "9 58 28\r",
+ "9 58 29\r",
+ "9 58 30\r",
+ "9 58 31\r",
+ "9 58 32\r",
+ "9 58 33\r",
+ "9 58 34\r",
+ "9 58 35\r",
+ "9 58 36\r",
+ "9 58 37\r",
+ "9 58 38\r",
+ "9 58 39\r",
+ "9 58 40\r",
+ "9 58 41\r",
+ "9 58 42\r",
+ "9 58 43\r",
+ "9 58 44\r",
+ "9 58 45\r",
+ "9 58 46\r",
+ "9 58 47\r",
+ "9 58 48\r",
+ "9 58 49\r",
+ "9 58 50\r",
+ "9 58 51\r",
+ "9 58 52\r",
+ "9 58 53\r",
+ "9 58 54\r",
+ "9 58 55\r",
+ "9 58 56\r",
+ "9 58 57\r",
+ "9 58 58\r",
+ "10 1 1\r",
+ "10 1 2\r",
+ "10 1 3\r",
+ "10 1 4\r",
+ "10 1 5\r",
+ "10 1 6\r",
+ "10 1 7\r",
+ "10 1 8\r",
+ "10 1 9\r",
+ "10 1 10\r",
+ "10 1 11\r",
+ "10 1 12\r",
+ "10 1 13\r",
+ "10 1 14\r",
+ "10 1 15\r",
+ "10 1 16\r",
+ "10 1 17\r",
+ "10 1 18\r",
+ "10 1 19\r",
+ "10 1 20\r",
+ "10 1 21\r",
+ "10 1 22\r",
+ "10 1 23\r",
+ "10 1 24\r",
+ "10 1 25\r",
+ "10 1 26\r",
+ "10 1 27\r",
+ "10 1 28\r",
+ "10 1 29\r",
+ "10 1 30\r",
+ "10 1 31\r",
+ "10 1 32\r",
+ "10 1 33\r",
+ "10 1 34\r",
+ "10 1 35\r",
+ "10 1 36\r",
+ "10 1 37\r",
+ "10 1 38\r",
+ "10 1 39\r",
+ "10 1 40\r",
+ "10 1 41\r",
+ "10 1 42\r",
+ "10 1 43\r",
+ "10 1 44\r",
+ "10 1 45\r",
+ "10 1 46\r",
+ "10 1 47\r",
+ "10 1 48\r",
+ "10 1 49\r",
+ "10 1 50\r",
+ "10 1 51\r",
+ "10 1 52\r",
+ "10 1 53\r",
+ "10 1 54\r",
+ "10 1 55\r",
+ "10 1 56\r",
+ "10 1 57\r",
+ "10 1 58\r",
+ "10 2 1\r",
+ "10 2 2\r",
+ "10 2 3\r",
+ "10 2 4\r",
+ "10 2 5\r",
+ "10 2 6\r",
+ "10 2 7\r",
+ "10 2 8\r",
+ "10 2 9\r",
+ "10 2 10\r",
+ "10 2 11\r",
+ "10 2 12\r",
+ "10 2 13\r",
+ "10 2 14\r",
+ "10 2 15\r",
+ "10 2 16\r",
+ "10 2 17\r",
+ "10 2 18\r",
+ "10 2 19\r",
+ "10 2 20\r",
+ "10 2 21\r",
+ "10 2 22\r",
+ "10 2 23\r",
+ "10 2 24\r",
+ "10 2 25\r",
+ "10 2 26\r",
+ "10 2 27\r",
+ "10 2 28\r",
+ "10 2 29\r",
+ "10 2 30\r",
+ "10 2 31\r",
+ "10 2 32\r",
+ "10 2 33\r",
+ "10 2 34\r",
+ "10 2 35\r",
+ "10 2 36\r",
+ "10 2 37\r",
+ "10 2 38\r",
+ "10 2 39\r",
+ "10 2 40\r",
+ "10 2 41\r",
+ "10 2 42\r",
+ "10 2 43\r",
+ "10 2 44\r",
+ "10 2 45\r",
+ "10 2 46\r",
+ "10 2 47\r",
+ "10 2 48\r",
+ "10 2 49\r",
+ "10 2 50\r",
+ "10 2 51\r",
+ "10 2 52\r",
+ "10 2 53\r",
+ "10 2 54\r",
+ "10 2 55\r",
+ "10 2 56\r",
+ "10 2 57\r",
+ "10 2 58\r",
+ "10 3 1\r",
+ "10 3 2\r",
+ "10 3 3\r",
+ "10 3 4\r",
+ "10 3 5\r",
+ "10 3 6\r",
+ "10 3 7\r",
+ "10 3 8\r",
+ "10 3 9\r",
+ "10 3 10\r",
+ "10 3 11\r",
+ "10 3 12\r",
+ "10 3 13\r",
+ "10 3 14\r",
+ "10 3 15\r",
+ "10 3 16\r",
+ "10 3 17\r",
+ "10 3 18\r",
+ "10 3 19\r",
+ "10 3 20\r",
+ "10 3 21\r",
+ "10 3 22\r",
+ "10 3 23\r",
+ "10 3 24\r",
+ "10 3 25\r",
+ "10 3 26\r",
+ "10 3 27\r",
+ "10 3 28\r",
+ "10 3 29\r",
+ "10 3 30\r",
+ "10 3 31\r",
+ "10 3 32\r",
+ "10 3 33\r",
+ "10 3 34\r",
+ "10 3 35\r",
+ "10 3 36\r",
+ "10 3 37\r",
+ "10 3 38\r",
+ "10 3 39\r",
+ "10 3 40\r",
+ "10 3 41\r",
+ "10 3 42\r",
+ "10 3 43\r",
+ "10 3 44\r",
+ "10 3 45\r",
+ "10 3 46\r",
+ "10 3 47\r",
+ "10 3 48\r",
+ "10 3 49\r",
+ "10 3 50\r",
+ "10 3 51\r",
+ "10 3 52\r",
+ "10 3 53\r",
+ "10 3 54\r",
+ "10 3 55\r",
+ "10 3 56\r",
+ "10 3 57\r",
+ "10 3 58\r",
+ "10 4 1\r",
+ "10 4 2\r",
+ "10 4 3\r",
+ "10 4 4\r",
+ "10 4 5\r",
+ "10 4 6\r",
+ "10 4 7\r",
+ "10 4 8\r",
+ "10 4 9\r",
+ "10 4 10\r",
+ "10 4 11\r",
+ "10 4 12\r",
+ "10 4 13\r",
+ "10 4 14\r",
+ "10 4 15\r",
+ "10 4 16\r",
+ "10 4 17\r",
+ "10 4 18\r",
+ "10 4 19\r",
+ "10 4 20\r",
+ "10 4 21\r",
+ "10 4 22\r",
+ "10 4 23\r",
+ "10 4 24\r",
+ "10 4 25\r",
+ "10 4 26\r",
+ "10 4 27\r",
+ "10 4 28\r",
+ "10 4 29\r",
+ "10 4 30\r",
+ "10 4 31\r",
+ "10 4 32\r",
+ "10 4 33\r",
+ "10 4 34\r",
+ "10 4 35\r",
+ "10 4 36\r",
+ "10 4 37\r",
+ "10 4 38\r",
+ "10 4 39\r",
+ "10 4 40\r",
+ "10 4 41\r",
+ "10 4 42\r",
+ "10 4 43\r",
+ "10 4 44\r",
+ "10 4 45\r",
+ "10 4 46\r",
+ "10 4 47\r",
+ "10 4 48\r",
+ "10 4 49\r",
+ "10 4 50\r",
+ "10 4 51\r",
+ "10 4 52\r",
+ "10 4 53\r",
+ "10 4 54\r",
+ "10 4 55\r",
+ "10 4 56\r",
+ "10 4 57\r",
+ "10 4 58\r",
+ "10 5 1\r",
+ "10 5 2\r",
+ "10 5 3\r",
+ "10 5 4\r",
+ "10 5 5\r",
+ "10 5 6\r",
+ "10 5 7\r",
+ "10 5 8\r",
+ "10 5 9\r",
+ "10 5 10\r",
+ "10 5 11\r",
+ "10 5 12\r",
+ "10 5 13\r",
+ "10 5 14\r",
+ "10 5 15\r",
+ "10 5 16\r",
+ "10 5 17\r",
+ "10 5 18\r",
+ "10 5 19\r",
+ "10 5 20\r",
+ "10 5 21\r",
+ "10 5 22\r",
+ "10 5 23\r",
+ "10 5 24\r",
+ "10 5 25\r",
+ "10 5 26\r",
+ "10 5 27\r",
+ "10 5 28\r",
+ "10 5 29\r",
+ "10 5 30\r",
+ "10 5 31\r",
+ "10 5 32\r",
+ "10 5 33\r",
+ "10 5 34\r",
+ "10 5 35\r",
+ "10 5 36\r",
+ "10 5 37\r",
+ "10 5 38\r",
+ "10 5 39\r",
+ "10 5 40\r",
+ "10 5 41\r",
+ "10 5 42\r",
+ "10 5 43\r",
+ "10 5 44\r",
+ "10 5 45\r",
+ "10 5 46\r",
+ "10 5 47\r",
+ "10 5 48\r",
+ "10 5 49\r",
+ "10 5 50\r",
+ "10 5 51\r",
+ "10 5 52\r",
+ "10 5 53\r",
+ "10 5 54\r",
+ "10 5 55\r",
+ "10 5 56\r",
+ "10 5 57\r",
+ "10 5 58\r",
+ "10 6 1\r",
+ "10 6 2\r",
+ "10 6 3\r",
+ "10 6 4\r",
+ "10 6 5\r",
+ "10 6 6\r",
+ "10 6 7\r",
+ "10 6 8\r",
+ "10 6 9\r",
+ "10 6 10\r",
+ "10 6 11\r",
+ "10 6 12\r",
+ "10 6 13\r",
+ "10 6 14\r",
+ "10 6 15\r",
+ "10 6 16\r",
+ "10 6 17\r",
+ "10 6 18\r",
+ "10 6 19\r",
+ "10 6 20\r",
+ "10 6 21\r",
+ "10 6 22\r",
+ "10 6 23\r",
+ "10 6 24\r",
+ "10 6 25\r",
+ "10 6 26\r",
+ "10 6 27\r",
+ "10 6 28\r",
+ "10 6 29\r",
+ "10 6 30\r",
+ "10 6 31\r",
+ "10 6 32\r",
+ "10 6 33\r",
+ "10 6 34\r",
+ "10 6 35\r",
+ "10 6 36\r",
+ "10 6 37\r",
+ "10 6 38\r",
+ "10 6 39\r",
+ "10 6 40\r",
+ "10 6 41\r",
+ "10 6 42\r",
+ "10 6 43\r",
+ "10 6 44\r",
+ "10 6 45\r",
+ "10 6 46\r",
+ "10 6 47\r",
+ "10 6 48\r",
+ "10 6 49\r",
+ "10 6 50\r",
+ "10 6 51\r",
+ "10 6 52\r",
+ "10 6 53\r",
+ "10 6 54\r",
+ "10 6 55\r",
+ "10 6 56\r",
+ "10 6 57\r",
+ "10 6 58\r",
+ "10 7 1\r",
+ "10 7 2\r",
+ "10 7 3\r",
+ "10 7 4\r",
+ "10 7 5\r",
+ "10 7 6\r",
+ "10 7 7\r",
+ "10 7 8\r",
+ "10 7 9\r",
+ "10 7 10\r",
+ "10 7 11\r",
+ "10 7 12\r",
+ "10 7 13\r",
+ "10 7 14\r",
+ "10 7 15\r",
+ "10 7 16\r",
+ "10 7 17\r",
+ "10 7 18\r",
+ "10 7 19\r",
+ "10 7 20\r",
+ "10 7 21\r",
+ "10 7 22\r",
+ "10 7 23\r",
+ "10 7 24\r",
+ "10 7 25\r",
+ "10 7 26\r",
+ "10 7 27\r",
+ "10 7 28\r",
+ "10 7 29\r",
+ "10 7 30\r",
+ "10 7 31\r",
+ "10 7 32\r",
+ "10 7 33\r",
+ "10 7 34\r",
+ "10 7 35\r",
+ "10 7 36\r",
+ "10 7 37\r",
+ "10 7 38\r",
+ "10 7 39\r",
+ "10 7 40\r",
+ "10 7 41\r",
+ "10 7 42\r",
+ "10 7 43\r",
+ "10 7 44\r",
+ "10 7 45\r",
+ "10 7 46\r",
+ "10 7 47\r",
+ "10 7 48\r",
+ "10 7 49\r",
+ "10 7 50\r",
+ "10 7 51\r",
+ "10 7 52\r",
+ "10 7 53\r",
+ "10 7 54\r",
+ "10 7 55\r",
+ "10 7 56\r",
+ "10 7 57\r",
+ "10 7 58\r",
+ "10 8 1\r",
+ "10 8 2\r",
+ "10 8 3\r",
+ "10 8 4\r",
+ "10 8 5\r",
+ "10 8 6\r",
+ "10 8 7\r",
+ "10 8 8\r",
+ "10 8 9\r",
+ "10 8 10\r",
+ "10 8 11\r",
+ "10 8 12\r",
+ "10 8 13\r",
+ "10 8 14\r",
+ "10 8 15\r",
+ "10 8 16\r",
+ "10 8 17\r",
+ "10 8 18\r",
+ "10 8 19\r",
+ "10 8 20\r",
+ "10 8 21\r",
+ "10 8 22\r",
+ "10 8 23\r",
+ "10 8 24\r",
+ "10 8 25\r",
+ "10 8 26\r",
+ "10 8 27\r",
+ "10 8 28\r",
+ "10 8 29\r",
+ "10 8 30\r",
+ "10 8 31\r",
+ "10 8 32\r",
+ "10 8 33\r",
+ "10 8 34\r",
+ "10 8 35\r",
+ "10 8 36\r",
+ "10 8 37\r",
+ "10 8 38\r",
+ "10 8 39\r",
+ "10 8 40\r",
+ "10 8 41\r",
+ "10 8 42\r",
+ "10 8 43\r",
+ "10 8 44\r",
+ "10 8 45\r",
+ "10 8 46\r",
+ "10 8 47\r",
+ "10 8 48\r",
+ "10 8 49\r",
+ "10 8 50\r",
+ "10 8 51\r",
+ "10 8 52\r",
+ "10 8 53\r",
+ "10 8 54\r",
+ "10 8 55\r",
+ "10 8 56\r",
+ "10 8 57\r",
+ "10 8 58\r",
+ "10 9 1\r",
+ "10 9 2\r",
+ "10 9 3\r",
+ "10 9 4\r",
+ "10 9 5\r",
+ "10 9 6\r",
+ "10 9 7\r",
+ "10 9 8\r",
+ "10 9 9\r",
+ "10 9 10\r",
+ "10 9 11\r",
+ "10 9 12\r",
+ "10 9 13\r",
+ "10 9 14\r",
+ "10 9 15\r",
+ "10 9 16\r",
+ "10 9 17\r",
+ "10 9 18\r",
+ "10 9 19\r",
+ "10 9 20\r",
+ "10 9 21\r",
+ "10 9 22\r",
+ "10 9 23\r",
+ "10 9 24\r",
+ "10 9 25\r",
+ "10 9 26\r",
+ "10 9 27\r",
+ "10 9 28\r",
+ "10 9 29\r",
+ "10 9 30\r",
+ "10 9 31\r",
+ "10 9 32\r",
+ "10 9 33\r",
+ "10 9 34\r",
+ "10 9 35\r",
+ "10 9 36\r",
+ "10 9 37\r",
+ "10 9 38\r",
+ "10 9 39\r",
+ "10 9 40\r",
+ "10 9 41\r",
+ "10 9 42\r",
+ "10 9 43\r",
+ "10 9 44\r",
+ "10 9 45\r",
+ "10 9 46\r",
+ "10 9 47\r",
+ "10 9 48\r",
+ "10 9 49\r",
+ "10 9 50\r",
+ "10 9 51\r",
+ "10 9 52\r",
+ "10 9 53\r",
+ "10 9 54\r",
+ "10 9 55\r",
+ "10 9 56\r",
+ "10 9 57\r",
+ "10 9 58\r",
+ "10 10 1\r",
+ "10 10 2\r",
+ "10 10 3\r",
+ "10 10 4\r",
+ "10 10 5\r",
+ "10 10 6\r",
+ "10 10 7\r",
+ "10 10 8\r",
+ "10 10 9\r",
+ "10 10 10\r",
+ "10 10 11\r",
+ "10 10 12\r",
+ "10 10 13\r",
+ "10 10 14\r",
+ "10 10 15\r",
+ "10 10 16\r",
+ "10 10 17\r",
+ "10 10 18\r",
+ "10 10 19\r",
+ "10 10 20\r",
+ "10 10 21\r",
+ "10 10 22\r",
+ "10 10 23\r",
+ "10 10 24\r",
+ "10 10 25\r",
+ "10 10 26\r",
+ "10 10 27\r",
+ "10 10 28\r",
+ "10 10 29\r",
+ "10 10 30\r",
+ "10 10 31\r",
+ "10 10 32\r",
+ "10 10 33\r",
+ "10 10 34\r",
+ "10 10 35\r",
+ "10 10 36\r",
+ "10 10 37\r",
+ "10 10 38\r",
+ "10 10 39\r",
+ "10 10 40\r",
+ "10 10 41\r",
+ "10 10 42\r",
+ "10 10 43\r",
+ "10 10 44\r",
+ "10 10 45\r",
+ "10 10 46\r",
+ "10 10 47\r",
+ "10 10 48\r",
+ "10 10 49\r",
+ "10 10 50\r",
+ "10 10 51\r",
+ "10 10 52\r",
+ "10 10 53\r",
+ "10 10 54\r",
+ "10 10 55\r",
+ "10 10 56\r",
+ "10 10 57\r",
+ "10 10 58\r",
+ "10 11 1\r",
+ "10 11 2\r",
+ "10 11 3\r",
+ "10 11 4\r",
+ "10 11 5\r",
+ "10 11 6\r",
+ "10 11 7\r",
+ "10 11 8\r",
+ "10 11 9\r",
+ "10 11 10\r",
+ "10 11 11\r",
+ "10 11 12\r",
+ "10 11 13\r",
+ "10 11 14\r",
+ "10 11 15\r",
+ "10 11 16\r",
+ "10 11 17\r",
+ "10 11 18\r",
+ "10 11 19\r",
+ "10 11 20\r",
+ "10 11 21\r",
+ "10 11 22\r",
+ "10 11 23\r",
+ "10 11 24\r",
+ "10 11 25\r",
+ "10 11 26\r",
+ "10 11 27\r",
+ "10 11 28\r",
+ "10 11 29\r",
+ "10 11 30\r",
+ "10 11 31\r",
+ "10 11 32\r",
+ "10 11 33\r",
+ "10 11 34\r",
+ "10 11 35\r",
+ "10 11 36\r",
+ "10 11 37\r",
+ "10 11 38\r",
+ "10 11 39\r",
+ "10 11 40\r",
+ "10 11 41\r",
+ "10 11 42\r",
+ "10 11 43\r",
+ "10 11 44\r",
+ "10 11 45\r",
+ "10 11 46\r",
+ "10 11 47\r",
+ "10 11 48\r",
+ "10 11 49\r",
+ "10 11 50\r",
+ "10 11 51\r",
+ "10 11 52\r",
+ "10 11 53\r",
+ "10 11 54\r",
+ "10 11 55\r",
+ "10 11 56\r",
+ "10 11 57\r",
+ "10 11 58\r",
+ "10 12 1\r",
+ "10 12 2\r",
+ "10 12 3\r",
+ "10 12 4\r",
+ "10 12 5\r",
+ "10 12 6\r",
+ "10 12 7\r",
+ "10 12 8\r",
+ "10 12 9\r",
+ "10 12 10\r",
+ "10 12 11\r",
+ "10 12 12\r",
+ "10 12 13\r",
+ "10 12 14\r",
+ "10 12 15\r",
+ "10 12 16\r",
+ "10 12 17\r",
+ "10 12 18\r",
+ "10 12 19\r",
+ "10 12 20\r",
+ "10 12 21\r",
+ "10 12 22\r",
+ "10 12 23\r",
+ "10 12 24\r",
+ "10 12 25\r",
+ "10 12 26\r",
+ "10 12 27\r",
+ "10 12 28\r",
+ "10 12 29\r",
+ "10 12 30\r",
+ "10 12 31\r",
+ "10 12 32\r",
+ "10 12 33\r",
+ "10 12 34\r",
+ "10 12 35\r",
+ "10 12 36\r",
+ "10 12 37\r",
+ "10 12 38\r",
+ "10 12 39\r",
+ "10 12 40\r",
+ "10 12 41\r",
+ "10 12 42\r",
+ "10 12 43\r",
+ "10 12 44\r",
+ "10 12 45\r",
+ "10 12 46\r",
+ "10 12 47\r",
+ "10 12 48\r",
+ "10 12 49\r",
+ "10 12 50\r",
+ "10 12 51\r",
+ "10 12 52\r",
+ "10 12 53\r",
+ "10 12 54\r",
+ "10 12 55\r",
+ "10 12 56\r",
+ "10 12 57\r",
+ "10 12 58\r",
+ "10 13 1\r",
+ "10 13 2\r",
+ "10 13 3\r",
+ "10 13 4\r",
+ "10 13 5\r",
+ "10 13 6\r",
+ "10 13 7\r",
+ "10 13 8\r",
+ "10 13 9\r",
+ "10 13 10\r",
+ "10 13 11\r",
+ "10 13 12\r",
+ "10 13 13\r",
+ "10 13 14\r",
+ "10 13 15\r",
+ "10 13 16\r",
+ "10 13 17\r",
+ "10 13 18\r",
+ "10 13 19\r",
+ "10 13 20\r",
+ "10 13 21\r",
+ "10 13 22\r",
+ "10 13 23\r",
+ "10 13 24\r",
+ "10 13 25\r",
+ "10 13 26\r",
+ "10 13 27\r",
+ "10 13 28\r",
+ "10 13 29\r",
+ "10 13 30\r",
+ "10 13 31\r",
+ "10 13 32\r",
+ "10 13 33\r",
+ "10 13 34\r",
+ "10 13 35\r",
+ "10 13 36\r",
+ "10 13 37\r",
+ "10 13 38\r",
+ "10 13 39\r",
+ "10 13 40\r",
+ "10 13 41\r",
+ "10 13 42\r",
+ "10 13 43\r",
+ "10 13 44\r",
+ "10 13 45\r",
+ "10 13 46\r",
+ "10 13 47\r",
+ "10 13 48\r",
+ "10 13 49\r",
+ "10 13 50\r",
+ "10 13 51\r",
+ "10 13 52\r",
+ "10 13 53\r",
+ "10 13 54\r",
+ "10 13 55\r",
+ "10 13 56\r",
+ "10 13 57\r",
+ "10 13 58\r",
+ "10 14 1\r",
+ "10 14 2\r",
+ "10 14 3\r",
+ "10 14 4\r",
+ "10 14 5\r",
+ "10 14 6\r",
+ "10 14 7\r",
+ "10 14 8\r",
+ "10 14 9\r",
+ "10 14 10\r",
+ "10 14 11\r",
+ "10 14 12\r",
+ "10 14 13\r",
+ "10 14 14\r",
+ "10 14 15\r",
+ "10 14 16\r",
+ "10 14 17\r",
+ "10 14 18\r",
+ "10 14 19\r",
+ "10 14 20\r",
+ "10 14 21\r",
+ "10 14 22\r",
+ "10 14 23\r",
+ "10 14 24\r",
+ "10 14 25\r",
+ "10 14 26\r",
+ "10 14 27\r",
+ "10 14 28\r",
+ "10 14 29\r",
+ "10 14 30\r",
+ "10 14 31\r",
+ "10 14 32\r",
+ "10 14 33\r",
+ "10 14 34\r",
+ "10 14 35\r",
+ "10 14 36\r",
+ "10 14 37\r",
+ "10 14 38\r",
+ "10 14 39\r",
+ "10 14 40\r",
+ "10 14 41\r",
+ "10 14 42\r",
+ "10 14 43\r",
+ "10 14 44\r",
+ "10 14 45\r",
+ "10 14 46\r",
+ "10 14 47\r",
+ "10 14 48\r",
+ "10 14 49\r",
+ "10 14 50\r",
+ "10 14 51\r",
+ "10 14 52\r",
+ "10 14 53\r",
+ "10 14 54\r",
+ "10 14 55\r",
+ "10 14 56\r",
+ "10 14 57\r",
+ "10 14 58\r",
+ "10 15 1\r",
+ "10 15 2\r",
+ "10 15 3\r",
+ "10 15 4\r",
+ "10 15 5\r",
+ "10 15 6\r",
+ "10 15 7\r",
+ "10 15 8\r",
+ "10 15 9\r",
+ "10 15 10\r",
+ "10 15 11\r",
+ "10 15 12\r",
+ "10 15 13\r",
+ "10 15 14\r",
+ "10 15 15\r",
+ "10 15 16\r",
+ "10 15 17\r",
+ "10 15 18\r",
+ "10 15 19\r",
+ "10 15 20\r",
+ "10 15 21\r",
+ "10 15 22\r",
+ "10 15 23\r",
+ "10 15 24\r",
+ "10 15 25\r",
+ "10 15 26\r",
+ "10 15 27\r",
+ "10 15 28\r",
+ "10 15 29\r",
+ "10 15 30\r",
+ "10 15 31\r",
+ "10 15 32\r",
+ "10 15 33\r",
+ "10 15 34\r",
+ "10 15 35\r",
+ "10 15 36\r",
+ "10 15 37\r",
+ "10 15 38\r",
+ "10 15 39\r",
+ "10 15 40\r",
+ "10 15 41\r",
+ "10 15 42\r",
+ "10 15 43\r",
+ "10 15 44\r",
+ "10 15 45\r",
+ "10 15 46\r",
+ "10 15 47\r",
+ "10 15 48\r",
+ "10 15 49\r",
+ "10 15 50\r",
+ "10 15 51\r",
+ "10 15 52\r",
+ "10 15 53\r",
+ "10 15 54\r",
+ "10 15 55\r",
+ "10 15 56\r",
+ "10 15 57\r",
+ "10 15 58\r",
+ "10 16 1\r",
+ "10 16 2\r",
+ "10 16 3\r",
+ "10 16 4\r",
+ "10 16 5\r",
+ "10 16 6\r",
+ "10 16 7\r",
+ "10 16 8\r",
+ "10 16 9\r",
+ "10 16 10\r",
+ "10 16 11\r",
+ "10 16 12\r",
+ "10 16 13\r",
+ "10 16 14\r",
+ "10 16 15\r",
+ "10 16 16\r",
+ "10 16 17\r",
+ "10 16 18\r",
+ "10 16 19\r",
+ "10 16 20\r",
+ "10 16 21\r",
+ "10 16 22\r",
+ "10 16 23\r",
+ "10 16 24\r",
+ "10 16 25\r",
+ "10 16 26\r",
+ "10 16 27\r",
+ "10 16 28\r",
+ "10 16 29\r",
+ "10 16 30\r",
+ "10 16 31\r",
+ "10 16 32\r",
+ "10 16 33\r",
+ "10 16 34\r",
+ "10 16 35\r",
+ "10 16 36\r",
+ "10 16 37\r",
+ "10 16 38\r",
+ "10 16 39\r",
+ "10 16 40\r",
+ "10 16 41\r",
+ "10 16 42\r",
+ "10 16 43\r",
+ "10 16 44\r",
+ "10 16 45\r",
+ "10 16 46\r",
+ "10 16 47\r",
+ "10 16 48\r",
+ "10 16 49\r",
+ "10 16 50\r",
+ "10 16 51\r",
+ "10 16 52\r",
+ "10 16 53\r",
+ "10 16 54\r",
+ "10 16 55\r",
+ "10 16 56\r",
+ "10 16 57\r",
+ "10 16 58\r",
+ "10 17 1\r",
+ "10 17 2\r",
+ "10 17 3\r",
+ "10 17 4\r",
+ "10 17 5\r",
+ "10 17 6\r",
+ "10 17 7\r",
+ "10 17 8\r",
+ "10 17 9\r",
+ "10 17 10\r",
+ "10 17 11\r",
+ "10 17 12\r",
+ "10 17 13\r",
+ "10 17 14\r",
+ "10 17 15\r",
+ "10 17 16\r",
+ "10 17 17\r",
+ "10 17 18\r",
+ "10 17 19\r",
+ "10 17 20\r",
+ "10 17 21\r",
+ "10 17 22\r",
+ "10 17 23\r",
+ "10 17 24\r",
+ "10 17 25\r",
+ "10 17 26\r",
+ "10 17 27\r",
+ "10 17 28\r",
+ "10 17 29\r",
+ "10 17 30\r",
+ "10 17 31\r",
+ "10 17 32\r",
+ "10 17 33\r",
+ "10 17 34\r",
+ "10 17 35\r",
+ "10 17 36\r",
+ "10 17 37\r",
+ "10 17 38\r",
+ "10 17 39\r",
+ "10 17 40\r",
+ "10 17 41\r",
+ "10 17 42\r",
+ "10 17 43\r",
+ "10 17 44\r",
+ "10 17 45\r",
+ "10 17 46\r",
+ "10 17 47\r",
+ "10 17 48\r",
+ "10 17 49\r",
+ "10 17 50\r",
+ "10 17 51\r",
+ "10 17 52\r",
+ "10 17 53\r",
+ "10 17 54\r",
+ "10 17 55\r",
+ "10 17 56\r",
+ "10 17 57\r",
+ "10 17 58\r",
+ "10 18 1\r",
+ "10 18 2\r",
+ "10 18 3\r",
+ "10 18 4\r",
+ "10 18 5\r",
+ "10 18 6\r",
+ "10 18 7\r",
+ "10 18 8\r",
+ "10 18 9\r",
+ "10 18 10\r",
+ "10 18 11\r",
+ "10 18 12\r",
+ "10 18 13\r",
+ "10 18 14\r",
+ "10 18 15\r",
+ "10 18 16\r",
+ "10 18 17\r",
+ "10 18 18\r",
+ "10 18 19\r",
+ "10 18 20\r",
+ "10 18 21\r",
+ "10 18 22\r",
+ "10 18 23\r",
+ "10 18 24\r",
+ "10 18 25\r",
+ "10 18 26\r",
+ "10 18 27\r",
+ "10 18 28\r",
+ "10 18 29\r",
+ "10 18 30\r",
+ "10 18 31\r",
+ "10 18 32\r",
+ "10 18 33\r",
+ "10 18 34\r",
+ "10 18 35\r",
+ "10 18 36\r",
+ "10 18 37\r",
+ "10 18 38\r",
+ "10 18 39\r",
+ "10 18 40\r",
+ "10 18 41\r",
+ "10 18 42\r",
+ "10 18 43\r",
+ "10 18 44\r",
+ "10 18 45\r",
+ "10 18 46\r",
+ "10 18 47\r",
+ "10 18 48\r",
+ "10 18 49\r",
+ "10 18 50\r",
+ "10 18 51\r",
+ "10 18 52\r",
+ "10 18 53\r",
+ "10 18 54\r",
+ "10 18 55\r",
+ "10 18 56\r",
+ "10 18 57\r",
+ "10 18 58\r",
+ "10 19 1\r",
+ "10 19 2\r",
+ "10 19 3\r",
+ "10 19 4\r",
+ "10 19 5\r",
+ "10 19 6\r",
+ "10 19 7\r",
+ "10 19 8\r",
+ "10 19 9\r",
+ "10 19 10\r",
+ "10 19 11\r",
+ "10 19 12\r",
+ "10 19 13\r",
+ "10 19 14\r",
+ "10 19 15\r",
+ "10 19 16\r",
+ "10 19 17\r",
+ "10 19 18\r",
+ "10 19 19\r",
+ "10 19 20\r",
+ "10 19 21\r",
+ "10 19 22\r",
+ "10 19 23\r",
+ "10 19 24\r",
+ "10 19 25\r",
+ "10 19 26\r",
+ "10 19 27\r",
+ "10 19 28\r",
+ "10 19 29\r",
+ "10 19 30\r",
+ "10 19 31\r",
+ "10 19 32\r",
+ "10 19 33\r",
+ "10 19 34\r",
+ "10 19 35\r",
+ "10 19 36\r",
+ "10 19 37\r",
+ "10 19 38\r",
+ "10 19 39\r",
+ "10 19 40\r",
+ "10 19 41\r",
+ "10 19 42\r",
+ "10 19 43\r",
+ "10 19 44\r",
+ "10 19 45\r",
+ "10 19 46\r",
+ "10 19 47\r",
+ "10 19 48\r",
+ "10 19 49\r",
+ "10 19 50\r",
+ "10 19 51\r",
+ "10 19 52\r",
+ "10 19 53\r",
+ "10 19 54\r",
+ "10 19 55\r",
+ "10 19 56\r",
+ "10 19 57\r",
+ "10 19 58\r",
+ "10 20 1\r",
+ "10 20 2\r",
+ "10 20 3\r",
+ "10 20 4\r",
+ "10 20 5\r",
+ "10 20 6\r",
+ "10 20 7\r",
+ "10 20 8\r",
+ "10 20 9\r",
+ "10 20 10\r",
+ "10 20 11\r",
+ "10 20 12\r",
+ "10 20 13\r",
+ "10 20 14\r",
+ "10 20 15\r",
+ "10 20 16\r",
+ "10 20 17\r",
+ "10 20 18\r",
+ "10 20 19\r",
+ "10 20 20\r",
+ "10 20 21\r",
+ "10 20 22\r",
+ "10 20 23\r",
+ "10 20 24\r",
+ "10 20 25\r",
+ "10 20 26\r",
+ "10 20 27\r",
+ "10 20 28\r",
+ "10 20 29\r",
+ "10 20 30\r",
+ "10 20 31"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "10 20 32\r",
+ "10 20 33\r",
+ "10 20 34\r",
+ "10 20 35\r",
+ "10 20 36\r",
+ "10 20 37\r",
+ "10 20 38\r",
+ "10 20 39\r",
+ "10 20 40\r",
+ "10 20 41\r",
+ "10 20 42\r",
+ "10 20 43\r",
+ "10 20 44\r",
+ "10 20 45\r",
+ "10 20 46\r",
+ "10 20 47\r",
+ "10 20 48\r",
+ "10 20 49\r",
+ "10 20 50\r",
+ "10 20 51\r",
+ "10 20 52\r",
+ "10 20 53\r",
+ "10 20 54\r",
+ "10 20 55\r",
+ "10 20 56\r",
+ "10 20 57\r",
+ "10 20 58\r",
+ "10 21 1\r",
+ "10 21 2\r",
+ "10 21 3\r",
+ "10 21 4\r",
+ "10 21 5\r",
+ "10 21 6\r",
+ "10 21 7\r",
+ "10 21 8\r",
+ "10 21 9\r",
+ "10 21 10\r",
+ "10 21 11\r",
+ "10 21 12\r",
+ "10 21 13\r",
+ "10 21 14\r",
+ "10 21 15\r",
+ "10 21 16\r",
+ "10 21 17\r",
+ "10 21 18\r",
+ "10 21 19\r",
+ "10 21 20\r",
+ "10 21 21\r",
+ "10 21 22\r",
+ "10 21 23\r",
+ "10 21 24\r",
+ "10 21 25\r",
+ "10 21 26\r",
+ "10 21 27\r",
+ "10 21 28\r",
+ "10 21 29\r",
+ "10 21 30\r",
+ "10 21 31\r",
+ "10 21 32\r",
+ "10 21 33\r",
+ "10 21 34\r",
+ "10 21 35\r",
+ "10 21 36\r",
+ "10 21 37\r",
+ "10 21 38\r",
+ "10 21 39\r",
+ "10 21 40\r",
+ "10 21 41\r",
+ "10 21 42\r",
+ "10 21 43\r",
+ "10 21 44\r",
+ "10 21 45\r",
+ "10 21 46\r",
+ "10 21 47\r",
+ "10 21 48\r",
+ "10 21 49\r",
+ "10 21 50\r",
+ "10 21 51\r",
+ "10 21 52\r",
+ "10 21 53\r",
+ "10 21 54\r",
+ "10 21 55\r",
+ "10 21 56\r",
+ "10 21 57\r",
+ "10 21 58\r",
+ "10 22 1\r",
+ "10 22 2\r",
+ "10 22 3\r",
+ "10 22 4\r",
+ "10 22 5\r",
+ "10 22 6\r",
+ "10 22 7\r",
+ "10 22 8\r",
+ "10 22 9\r",
+ "10 22 10\r",
+ "10 22 11\r",
+ "10 22 12\r",
+ "10 22 13\r",
+ "10 22 14\r",
+ "10 22 15\r",
+ "10 22 16\r",
+ "10 22 17\r",
+ "10 22 18\r",
+ "10 22 19\r",
+ "10 22 20\r",
+ "10 22 21\r",
+ "10 22 22\r",
+ "10 22 23\r",
+ "10 22 24\r",
+ "10 22 25\r",
+ "10 22 26\r",
+ "10 22 27\r",
+ "10 22 28\r",
+ "10 22 29\r",
+ "10 22 30\r",
+ "10 22 31\r",
+ "10 22 32\r",
+ "10 22 33\r",
+ "10 22 34\r",
+ "10 22 35\r",
+ "10 22 36\r",
+ "10 22 37\r",
+ "10 22 38\r",
+ "10 22 39\r",
+ "10 22 40\r",
+ "10 22 41\r",
+ "10 22 42\r",
+ "10 22 43\r",
+ "10 22 44\r",
+ "10 22 45\r",
+ "10 22 46\r",
+ "10 22 47\r",
+ "10 22 48\r",
+ "10 22 49\r",
+ "10 22 50\r",
+ "10 22 51\r",
+ "10 22 52\r",
+ "10 22 53\r",
+ "10 22 54\r",
+ "10 22 55\r",
+ "10 22 56\r",
+ "10 22 57\r",
+ "10 22 58\r",
+ "10 23 1\r",
+ "10 23 2\r",
+ "10 23 3\r",
+ "10 23 4\r",
+ "10 23 5\r",
+ "10 23 6\r",
+ "10 23 7\r",
+ "10 23 8\r",
+ "10 23 9\r",
+ "10 23 10\r",
+ "10 23 11\r",
+ "10 23 12\r",
+ "10 23 13\r",
+ "10 23 14\r",
+ "10 23 15\r",
+ "10 23 16\r",
+ "10 23 17\r",
+ "10 23 18\r",
+ "10 23 19\r",
+ "10 23 20\r",
+ "10 23 21\r",
+ "10 23 22\r",
+ "10 23 23\r",
+ "10 23 24\r",
+ "10 23 25\r",
+ "10 23 26\r",
+ "10 23 27\r",
+ "10 23 28\r",
+ "10 23 29\r",
+ "10 23 30\r",
+ "10 23 31\r",
+ "10 23 32\r",
+ "10 23 33\r",
+ "10 23 34\r",
+ "10 23 35\r",
+ "10 23 36\r",
+ "10 23 37\r",
+ "10 23 38\r",
+ "10 23 39\r",
+ "10 23 40\r",
+ "10 23 41\r",
+ "10 23 42\r",
+ "10 23 43\r",
+ "10 23 44\r",
+ "10 23 45\r",
+ "10 23 46\r",
+ "10 23 47\r",
+ "10 23 48\r",
+ "10 23 49\r",
+ "10 23 50\r",
+ "10 23 51\r",
+ "10 23 52\r",
+ "10 23 53\r",
+ "10 23 54\r",
+ "10 23 55\r",
+ "10 23 56\r",
+ "10 23 57\r",
+ "10 23 58\r",
+ "10 24 1\r",
+ "10 24 2\r",
+ "10 24 3\r",
+ "10 24 4\r",
+ "10 24 5\r",
+ "10 24 6\r",
+ "10 24 7\r",
+ "10 24 8\r",
+ "10 24 9\r",
+ "10 24 10\r",
+ "10 24 11\r",
+ "10 24 12\r",
+ "10 24 13\r",
+ "10 24 14\r",
+ "10 24 15\r",
+ "10 24 16\r",
+ "10 24 17\r",
+ "10 24 18\r",
+ "10 24 19\r",
+ "10 24 20\r",
+ "10 24 21\r",
+ "10 24 22\r",
+ "10 24 23\r",
+ "10 24 24\r",
+ "10 24 25\r",
+ "10 24 26\r",
+ "10 24 27\r",
+ "10 24 28\r",
+ "10 24 29\r",
+ "10 24 30\r",
+ "10 24 31\r",
+ "10 24 32\r",
+ "10 24 33\r",
+ "10 24 34\r",
+ "10 24 35\r",
+ "10 24 36\r",
+ "10 24 37\r",
+ "10 24 38\r",
+ "10 24 39\r",
+ "10 24 40\r",
+ "10 24 41\r",
+ "10 24 42\r",
+ "10 24 43\r",
+ "10 24 44\r",
+ "10 24 45\r",
+ "10 24 46\r",
+ "10 24 47\r",
+ "10 24 48\r",
+ "10 24 49\r",
+ "10 24 50\r",
+ "10 24 51\r",
+ "10 24 52\r",
+ "10 24 53\r",
+ "10 24 54\r",
+ "10 24 55\r",
+ "10 24 56\r",
+ "10 24 57\r",
+ "10 24 58\r",
+ "10 25 1\r",
+ "10 25 2\r",
+ "10 25 3\r",
+ "10 25 4\r",
+ "10 25 5\r",
+ "10 25 6\r",
+ "10 25 7\r",
+ "10 25 8\r",
+ "10 25 9\r",
+ "10 25 10\r",
+ "10 25 11\r",
+ "10 25 12\r",
+ "10 25 13\r",
+ "10 25 14\r",
+ "10 25 15\r",
+ "10 25 16\r",
+ "10 25 17\r",
+ "10 25 18\r",
+ "10 25 19\r",
+ "10 25 20\r",
+ "10 25 21\r",
+ "10 25 22\r",
+ "10 25 23\r",
+ "10 25 24\r",
+ "10 25 25\r",
+ "10 25 26\r",
+ "10 25 27\r",
+ "10 25 28\r",
+ "10 25 29\r",
+ "10 25 30\r",
+ "10 25 31\r",
+ "10 25 32\r",
+ "10 25 33\r",
+ "10 25 34\r",
+ "10 25 35\r",
+ "10 25 36\r",
+ "10 25 37\r",
+ "10 25 38\r",
+ "10 25 39\r",
+ "10 25 40\r",
+ "10 25 41\r",
+ "10 25 42\r",
+ "10 25 43\r",
+ "10 25 44\r",
+ "10 25 45\r",
+ "10 25 46\r",
+ "10 25 47\r",
+ "10 25 48\r",
+ "10 25 49\r",
+ "10 25 50\r",
+ "10 25 51\r",
+ "10 25 52\r",
+ "10 25 53\r",
+ "10 25 54\r",
+ "10 25 55\r",
+ "10 25 56\r",
+ "10 25 57\r",
+ "10 25 58\r",
+ "10 26 1\r",
+ "10 26 2\r",
+ "10 26 3\r",
+ "10 26 4\r",
+ "10 26 5\r",
+ "10 26 6\r",
+ "10 26 7\r",
+ "10 26 8\r",
+ "10 26 9\r",
+ "10 26 10\r",
+ "10 26 11\r",
+ "10 26 12\r",
+ "10 26 13\r",
+ "10 26 14\r",
+ "10 26 15\r",
+ "10 26 16\r",
+ "10 26 17\r",
+ "10 26 18\r",
+ "10 26 19\r",
+ "10 26 20\r",
+ "10 26 21\r",
+ "10 26 22\r",
+ "10 26 23\r",
+ "10 26 24\r",
+ "10 26 25\r",
+ "10 26 26\r",
+ "10 26 27\r",
+ "10 26 28\r",
+ "10 26 29\r",
+ "10 26 30\r",
+ "10 26 31\r",
+ "10 26 32\r",
+ "10 26 33\r",
+ "10 26 34\r",
+ "10 26 35\r",
+ "10 26 36\r",
+ "10 26 37\r",
+ "10 26 38\r",
+ "10 26 39\r",
+ "10 26 40\r",
+ "10 26 41\r",
+ "10 26 42\r",
+ "10 26 43\r",
+ "10 26 44\r",
+ "10 26 45\r",
+ "10 26 46\r",
+ "10 26 47\r",
+ "10 26 48\r",
+ "10 26 49\r",
+ "10 26 50\r",
+ "10 26 51\r",
+ "10 26 52\r",
+ "10 26 53\r",
+ "10 26 54\r",
+ "10 26 55\r",
+ "10 26 56\r",
+ "10 26 57\r",
+ "10 26 58\r",
+ "10 27 1\r",
+ "10 27 2\r",
+ "10 27 3\r",
+ "10 27 4\r",
+ "10 27 5\r",
+ "10 27 6\r",
+ "10 27 7\r",
+ "10 27 8\r",
+ "10 27 9\r",
+ "10 27 10\r",
+ "10 27 11\r",
+ "10 27 12\r",
+ "10 27 13\r",
+ "10 27 14\r",
+ "10 27 15\r",
+ "10 27 16\r",
+ "10 27 17\r",
+ "10 27 18\r",
+ "10 27 19\r",
+ "10 27 20\r",
+ "10 27 21\r",
+ "10 27 22\r",
+ "10 27 23\r",
+ "10 27 24\r",
+ "10 27 25\r",
+ "10 27 26\r",
+ "10 27 27\r",
+ "10 27 28\r",
+ "10 27 29\r",
+ "10 27 30\r",
+ "10 27 31\r",
+ "10 27 32\r",
+ "10 27 33\r",
+ "10 27 34\r",
+ "10 27 35\r",
+ "10 27 36\r",
+ "10 27 37\r",
+ "10 27 38\r",
+ "10 27 39\r",
+ "10 27 40\r",
+ "10 27 41\r",
+ "10 27 42\r",
+ "10 27 43\r",
+ "10 27 44\r",
+ "10 27 45\r",
+ "10 27 46\r",
+ "10 27 47\r",
+ "10 27 48\r",
+ "10 27 49\r",
+ "10 27 50\r",
+ "10 27 51\r",
+ "10 27 52\r",
+ "10 27 53\r",
+ "10 27 54\r",
+ "10 27 55\r",
+ "10 27 56\r",
+ "10 27 57\r",
+ "10 27 58\r",
+ "10 28 1\r",
+ "10 28 2\r",
+ "10 28 3\r",
+ "10 28 4\r",
+ "10 28 5\r",
+ "10 28 6\r",
+ "10 28 7\r",
+ "10 28 8\r",
+ "10 28 9\r",
+ "10 28 10\r",
+ "10 28 11\r",
+ "10 28 12\r",
+ "10 28 13\r",
+ "10 28 14\r",
+ "10 28 15\r",
+ "10 28 16\r",
+ "10 28 17\r",
+ "10 28 18\r",
+ "10 28 19\r",
+ "10 28 20\r",
+ "10 28 21\r",
+ "10 28 22\r",
+ "10 28 23\r",
+ "10 28 24\r",
+ "10 28 25\r",
+ "10 28 26\r",
+ "10 28 27\r",
+ "10 28 28\r",
+ "10 28 29\r",
+ "10 28 30\r",
+ "10 28 31\r",
+ "10 28 32\r",
+ "10 28 33\r",
+ "10 28 34\r",
+ "10 28 35\r",
+ "10 28 36\r",
+ "10 28 37\r",
+ "10 28 38\r",
+ "10 28 39\r",
+ "10 28 40\r",
+ "10 28 41\r",
+ "10 28 42\r",
+ "10 28 43\r",
+ "10 28 44\r",
+ "10 28 45\r",
+ "10 28 46\r",
+ "10 28 47\r",
+ "10 28 48\r",
+ "10 28 49\r",
+ "10 28 50\r",
+ "10 28 51\r",
+ "10 28 52\r",
+ "10 28 53\r",
+ "10 28 54\r",
+ "10 28 55\r",
+ "10 28 56\r",
+ "10 28 57\r",
+ "10 28 58\r",
+ "10 29 1\r",
+ "10 29 2\r",
+ "10 29 3\r",
+ "10 29 4\r",
+ "10 29 5\r",
+ "10 29 6\r",
+ "10 29 7\r",
+ "10 29 8\r",
+ "10 29 9\r",
+ "10 29 10\r",
+ "10 29 11\r",
+ "10 29 12\r",
+ "10 29 13\r",
+ "10 29 14\r",
+ "10 29 15\r",
+ "10 29 16\r",
+ "10 29 17\r",
+ "10 29 18\r",
+ "10 29 19\r",
+ "10 29 20\r",
+ "10 29 21\r",
+ "10 29 22\r",
+ "10 29 23\r",
+ "10 29 24\r",
+ "10 29 25\r",
+ "10 29 26\r",
+ "10 29 27\r",
+ "10 29 28\r",
+ "10 29 29\r",
+ "10 29 30\r",
+ "10 29 31\r",
+ "10 29 32\r",
+ "10 29 33\r",
+ "10 29 34\r",
+ "10 29 35\r",
+ "10 29 36\r",
+ "10 29 37\r",
+ "10 29 38\r",
+ "10 29 39\r",
+ "10 29 40\r",
+ "10 29 41\r",
+ "10 29 42\r",
+ "10 29 43\r",
+ "10 29 44\r",
+ "10 29 45\r",
+ "10 29 46\r",
+ "10 29 47\r",
+ "10 29 48\r",
+ "10 29 49\r",
+ "10 29 50\r",
+ "10 29 51\r",
+ "10 29 52\r",
+ "10 29 53\r",
+ "10 29 54\r",
+ "10 29 55\r",
+ "10 29 56\r",
+ "10 29 57\r",
+ "10 29 58\r",
+ "10 30 1\r",
+ "10 30 2\r",
+ "10 30 3\r",
+ "10 30 4\r",
+ "10 30 5\r",
+ "10 30 6\r",
+ "10 30 7\r",
+ "10 30 8\r",
+ "10 30 9\r",
+ "10 30 10\r",
+ "10 30 11\r",
+ "10 30 12\r",
+ "10 30 13\r",
+ "10 30 14\r",
+ "10 30 15\r",
+ "10 30 16\r",
+ "10 30 17\r",
+ "10 30 18\r",
+ "10 30 19\r",
+ "10 30 20\r",
+ "10 30 21\r",
+ "10 30 22\r",
+ "10 30 23\r",
+ "10 30 24\r",
+ "10 30 25\r",
+ "10 30 26\r",
+ "10 30 27\r",
+ "10 30 28\r",
+ "10 30 29\r",
+ "10 30 30\r",
+ "10 30 31\r",
+ "10 30 32\r",
+ "10 30 33\r",
+ "10 30 34\r",
+ "10 30 35\r",
+ "10 30 36\r",
+ "10 30 37\r",
+ "10 30 38\r",
+ "10 30 39\r",
+ "10 30 40\r",
+ "10 30 41\r",
+ "10 30 42\r",
+ "10 30 43\r",
+ "10 30 44\r",
+ "10 30 45\r",
+ "10 30 46\r",
+ "10 30 47\r",
+ "10 30 48\r",
+ "10 30 49\r",
+ "10 30 50\r",
+ "10 30 51\r",
+ "10 30 52\r",
+ "10 30 53\r",
+ "10 30 54\r",
+ "10 30 55\r",
+ "10 30 56\r",
+ "10 30 57\r",
+ "10 30 58\r",
+ "10 31 1\r",
+ "10 31 2\r",
+ "10 31 3\r",
+ "10 31 4\r",
+ "10 31 5\r",
+ "10 31 6\r",
+ "10 31 7\r",
+ "10 31 8\r",
+ "10 31 9\r",
+ "10 31 10\r",
+ "10 31 11\r",
+ "10 31 12\r",
+ "10 31 13\r",
+ "10 31 14\r",
+ "10 31 15\r",
+ "10 31 16\r",
+ "10 31 17\r",
+ "10 31 18\r",
+ "10 31 19\r",
+ "10 31 20\r",
+ "10 31 21\r",
+ "10 31 22\r",
+ "10 31 23\r",
+ "10 31 24\r",
+ "10 31 25\r",
+ "10 31 26\r",
+ "10 31 27\r",
+ "10 31 28\r",
+ "10 31 29\r",
+ "10 31 30\r",
+ "10 31 31\r",
+ "10 31 32\r",
+ "10 31 33\r",
+ "10 31 34\r",
+ "10 31 35\r",
+ "10 31 36\r",
+ "10 31 37\r",
+ "10 31 38\r",
+ "10 31 39\r",
+ "10 31 40\r",
+ "10 31 41\r",
+ "10 31 42\r",
+ "10 31 43\r",
+ "10 31 44\r",
+ "10 31 45\r",
+ "10 31 46\r",
+ "10 31 47\r",
+ "10 31 48\r",
+ "10 31 49\r",
+ "10 31 50\r",
+ "10 31 51\r",
+ "10 31 52\r",
+ "10 31 53\r",
+ "10 31 54\r",
+ "10 31 55\r",
+ "10 31 56\r",
+ "10 31 57\r",
+ "10 31 58\r",
+ "10 32 1\r",
+ "10 32 2\r",
+ "10 32 3\r",
+ "10 32 4\r",
+ "10 32 5\r",
+ "10 32 6\r",
+ "10 32 7\r",
+ "10 32 8\r",
+ "10 32 9\r",
+ "10 32 10\r",
+ "10 32 11\r",
+ "10 32 12\r",
+ "10 32 13\r",
+ "10 32 14\r",
+ "10 32 15\r",
+ "10 32 16\r",
+ "10 32 17\r",
+ "10 32 18\r",
+ "10 32 19\r",
+ "10 32 20\r",
+ "10 32 21\r",
+ "10 32 22\r",
+ "10 32 23\r",
+ "10 32 24\r",
+ "10 32 25\r",
+ "10 32 26\r",
+ "10 32 27\r",
+ "10 32 28\r",
+ "10 32 29\r",
+ "10 32 30\r",
+ "10 32 31\r",
+ "10 32 32\r",
+ "10 32 33\r",
+ "10 32 34\r",
+ "10 32 35\r",
+ "10 32 36\r",
+ "10 32 37\r",
+ "10 32 38\r",
+ "10 32 39\r",
+ "10 32 40\r",
+ "10 32 41\r",
+ "10 32 42\r",
+ "10 32 43\r",
+ "10 32 44\r",
+ "10 32 45\r",
+ "10 32 46\r",
+ "10 32 47\r",
+ "10 32 48\r",
+ "10 32 49\r",
+ "10 32 50\r",
+ "10 32 51\r",
+ "10 32 52\r",
+ "10 32 53\r",
+ "10 32 54\r",
+ "10 32 55\r",
+ "10 32 56\r",
+ "10 32 57\r",
+ "10 32 58\r",
+ "10 33 1\r",
+ "10 33 2\r",
+ "10 33 3\r",
+ "10 33 4\r",
+ "10 33 5\r",
+ "10 33 6\r",
+ "10 33 7\r",
+ "10 33 8\r",
+ "10 33 9\r",
+ "10 33 10\r",
+ "10 33 11\r",
+ "10 33 12\r",
+ "10 33 13\r",
+ "10 33 14\r",
+ "10 33 15\r",
+ "10 33 16\r",
+ "10 33 17\r",
+ "10 33 18\r",
+ "10 33 19\r",
+ "10 33 20\r",
+ "10 33 21\r",
+ "10 33 22\r",
+ "10 33 23\r",
+ "10 33 24\r",
+ "10 33 25\r",
+ "10 33 26\r",
+ "10 33 27\r",
+ "10 33 28\r",
+ "10 33 29\r",
+ "10 33 30\r",
+ "10 33 31\r",
+ "10 33 32\r",
+ "10 33 33\r",
+ "10 33 34\r",
+ "10 33 35\r",
+ "10 33 36\r",
+ "10 33 37\r",
+ "10 33 38\r",
+ "10 33 39\r",
+ "10 33 40\r",
+ "10 33 41\r",
+ "10 33 42\r",
+ "10 33 43\r",
+ "10 33 44\r",
+ "10 33 45\r",
+ "10 33 46\r",
+ "10 33 47\r",
+ "10 33 48\r",
+ "10 33 49\r",
+ "10 33 50\r",
+ "10 33 51\r",
+ "10 33 52\r",
+ "10 33 53\r",
+ "10 33 54\r",
+ "10 33 55\r",
+ "10 33 56\r",
+ "10 33 57\r",
+ "10 33 58\r",
+ "10 34 1\r",
+ "10 34 2\r",
+ "10 34 3\r",
+ "10 34 4\r",
+ "10 34 5\r",
+ "10 34 6\r",
+ "10 34 7\r",
+ "10 34 8\r",
+ "10 34 9\r",
+ "10 34 10\r",
+ "10 34 11\r",
+ "10 34 12\r",
+ "10 34 13\r",
+ "10 34 14\r",
+ "10 34 15\r",
+ "10 34 16\r",
+ "10 34 17\r",
+ "10 34 18\r",
+ "10 34 19\r",
+ "10 34 20\r",
+ "10 34 21\r",
+ "10 34 22\r",
+ "10 34 23\r",
+ "10 34 24\r",
+ "10 34 25\r",
+ "10 34 26\r",
+ "10 34 27\r",
+ "10 34 28\r",
+ "10 34 29\r",
+ "10 34 30\r",
+ "10 34 31\r",
+ "10 34 32\r",
+ "10 34 33\r",
+ "10 34 34\r",
+ "10 34 35\r",
+ "10 34 36\r",
+ "10 34 37\r",
+ "10 34 38\r",
+ "10 34 39\r",
+ "10 34 40\r",
+ "10 34 41\r",
+ "10 34 42\r",
+ "10 34 43\r",
+ "10 34 44\r",
+ "10 34 45\r",
+ "10 34 46\r",
+ "10 34 47\r",
+ "10 34 48\r",
+ "10 34 49\r",
+ "10 34 50\r",
+ "10 34 51\r",
+ "10 34 52\r",
+ "10 34 53\r",
+ "10 34 54\r",
+ "10 34 55\r",
+ "10 34 56\r",
+ "10 34 57\r",
+ "10 34 58\r",
+ "10 35 1\r",
+ "10 35 2\r",
+ "10 35 3\r",
+ "10 35 4\r",
+ "10 35 5\r",
+ "10 35 6\r",
+ "10 35 7\r",
+ "10 35 8\r",
+ "10 35 9\r",
+ "10 35 10\r",
+ "10 35 11\r",
+ "10 35 12\r",
+ "10 35 13\r",
+ "10 35 14\r",
+ "10 35 15\r",
+ "10 35 16\r",
+ "10 35 17\r",
+ "10 35 18\r",
+ "10 35 19\r",
+ "10 35 20\r",
+ "10 35 21\r",
+ "10 35 22\r",
+ "10 35 23\r",
+ "10 35 24\r",
+ "10 35 25\r",
+ "10 35 26\r",
+ "10 35 27\r",
+ "10 35 28\r",
+ "10 35 29\r",
+ "10 35 30\r",
+ "10 35 31\r",
+ "10 35 32\r",
+ "10 35 33\r",
+ "10 35 34\r",
+ "10 35 35\r",
+ "10 35 36\r",
+ "10 35 37\r",
+ "10 35 38\r",
+ "10 35 39\r",
+ "10 35 40\r",
+ "10 35 41\r",
+ "10 35 42\r",
+ "10 35 43\r",
+ "10 35 44\r",
+ "10 35 45\r",
+ "10 35 46\r",
+ "10 35 47\r",
+ "10 35 48\r",
+ "10 35 49\r",
+ "10 35 50\r",
+ "10 35 51\r",
+ "10 35 52\r",
+ "10 35 53\r",
+ "10 35 54\r",
+ "10 35 55\r",
+ "10 35 56\r",
+ "10 35 57\r",
+ "10 35 58\r",
+ "10 36 1\r",
+ "10 36 2\r",
+ "10 36 3\r",
+ "10 36 4\r",
+ "10 36 5\r",
+ "10 36 6\r",
+ "10 36 7\r",
+ "10 36 8\r",
+ "10 36 9\r",
+ "10 36 10\r",
+ "10 36 11\r",
+ "10 36 12\r",
+ "10 36 13\r",
+ "10 36 14\r",
+ "10 36 15\r",
+ "10 36 16\r",
+ "10 36 17\r",
+ "10 36 18\r",
+ "10 36 19\r",
+ "10 36 20\r",
+ "10 36 21\r",
+ "10 36 22\r",
+ "10 36 23\r",
+ "10 36 24\r",
+ "10 36 25\r",
+ "10 36 26\r",
+ "10 36 27\r",
+ "10 36 28\r",
+ "10 36 29\r",
+ "10 36 30\r",
+ "10 36 31\r",
+ "10 36 32\r",
+ "10 36 33\r",
+ "10 36 34\r",
+ "10 36 35\r",
+ "10 36 36\r",
+ "10 36 37\r",
+ "10 36 38\r",
+ "10 36 39\r",
+ "10 36 40\r",
+ "10 36 41\r",
+ "10 36 42\r",
+ "10 36 43\r",
+ "10 36 44\r",
+ "10 36 45\r",
+ "10 36 46\r",
+ "10 36 47\r",
+ "10 36 48\r",
+ "10 36 49\r",
+ "10 36 50\r",
+ "10 36 51\r",
+ "10 36 52\r",
+ "10 36 53\r",
+ "10 36 54\r",
+ "10 36 55\r",
+ "10 36 56\r",
+ "10 36 57\r",
+ "10 36 58\r",
+ "10 37 1\r",
+ "10 37 2\r",
+ "10 37 3\r",
+ "10 37 4\r",
+ "10 37 5\r",
+ "10 37 6\r",
+ "10 37 7\r",
+ "10 37 8\r",
+ "10 37 9\r",
+ "10 37 10\r",
+ "10 37 11\r",
+ "10 37 12\r",
+ "10 37 13\r",
+ "10 37 14\r",
+ "10 37 15\r",
+ "10 37 16\r",
+ "10 37 17\r",
+ "10 37 18\r",
+ "10 37 19\r",
+ "10 37 20\r",
+ "10 37 21\r",
+ "10 37 22\r",
+ "10 37 23\r",
+ "10 37 24\r",
+ "10 37 25\r",
+ "10 37 26\r",
+ "10 37 27\r",
+ "10 37 28\r",
+ "10 37 29\r",
+ "10 37 30\r",
+ "10 37 31\r",
+ "10 37 32\r",
+ "10 37 33\r",
+ "10 37 34\r",
+ "10 37 35\r",
+ "10 37 36\r",
+ "10 37 37\r",
+ "10 37 38\r",
+ "10 37 39\r",
+ "10 37 40\r",
+ "10 37 41\r",
+ "10 37 42\r",
+ "10 37 43\r",
+ "10 37 44\r",
+ "10 37 45\r",
+ "10 37 46\r",
+ "10 37 47\r",
+ "10 37 48\r",
+ "10 37 49\r",
+ "10 37 50\r",
+ "10 37 51\r",
+ "10 37 52\r",
+ "10 37 53\r",
+ "10 37 54\r",
+ "10 37 55\r",
+ "10 37 56\r",
+ "10 37 57\r",
+ "10 37 58\r",
+ "10 38 1\r",
+ "10 38 2\r",
+ "10 38 3\r",
+ "10 38 4\r",
+ "10 38 5\r",
+ "10 38 6\r",
+ "10 38 7\r",
+ "10 38 8\r",
+ "10 38 9\r",
+ "10 38 10\r",
+ "10 38 11\r",
+ "10 38 12\r",
+ "10 38 13\r",
+ "10 38 14\r",
+ "10 38 15\r",
+ "10 38 16\r",
+ "10 38 17\r",
+ "10 38 18\r",
+ "10 38 19\r",
+ "10 38 20\r",
+ "10 38 21\r",
+ "10 38 22\r",
+ "10 38 23\r",
+ "10 38 24\r",
+ "10 38 25\r",
+ "10 38 26\r",
+ "10 38 27\r",
+ "10 38 28\r",
+ "10 38 29\r",
+ "10 38 30\r",
+ "10 38 31\r",
+ "10 38 32\r",
+ "10 38 33\r",
+ "10 38 34\r",
+ "10 38 35\r",
+ "10 38 36\r",
+ "10 38 37\r",
+ "10 38 38\r",
+ "10 38 39\r",
+ "10 38 40\r",
+ "10 38 41\r",
+ "10 38 42\r",
+ "10 38 43\r",
+ "10 38 44\r",
+ "10 38 45\r",
+ "10 38 46\r",
+ "10 38 47\r",
+ "10 38 48\r",
+ "10 38 49\r",
+ "10 38 50\r",
+ "10 38 51\r",
+ "10 38 52\r",
+ "10 38 53\r",
+ "10 38 54\r",
+ "10 38 55\r",
+ "10 38 56\r",
+ "10 38 57\r",
+ "10 38 58\r",
+ "10 39 1\r",
+ "10 39 2\r",
+ "10 39 3\r",
+ "10 39 4\r",
+ "10 39 5\r",
+ "10 39 6\r",
+ "10 39 7\r",
+ "10 39 8\r",
+ "10 39 9\r",
+ "10 39 10\r",
+ "10 39 11\r",
+ "10 39 12\r",
+ "10 39 13\r",
+ "10 39 14\r",
+ "10 39 15\r",
+ "10 39 16\r",
+ "10 39 17\r",
+ "10 39 18\r",
+ "10 39 19\r",
+ "10 39 20\r",
+ "10 39 21\r",
+ "10 39 22\r",
+ "10 39 23\r",
+ "10 39 24\r",
+ "10 39 25\r",
+ "10 39 26\r",
+ "10 39 27\r",
+ "10 39 28\r",
+ "10 39 29\r",
+ "10 39 30\r",
+ "10 39 31\r",
+ "10 39 32\r",
+ "10 39 33\r",
+ "10 39 34\r",
+ "10 39 35\r",
+ "10 39 36\r",
+ "10 39 37\r",
+ "10 39 38\r",
+ "10 39 39\r",
+ "10 39 40\r",
+ "10 39 41\r",
+ "10 39 42\r",
+ "10 39 43\r",
+ "10 39 44\r",
+ "10 39 45\r",
+ "10 39 46\r",
+ "10 39 47\r",
+ "10 39 48\r",
+ "10 39 49\r",
+ "10 39 50\r",
+ "10 39 51\r",
+ "10 39 52\r",
+ "10 39 53\r",
+ "10 39 54\r",
+ "10 39 55\r",
+ "10 39 56\r",
+ "10 39 57\r",
+ "10 39 58\r",
+ "10 40 1\r",
+ "10 40 2\r",
+ "10 40 3\r",
+ "10 40 4\r",
+ "10 40 5\r",
+ "10 40 6\r",
+ "10 40 7\r",
+ "10 40 8\r",
+ "10 40 9\r",
+ "10 40 10\r",
+ "10 40 11\r",
+ "10 40 12\r",
+ "10 40 13\r",
+ "10 40 14\r",
+ "10 40 15\r",
+ "10 40 16\r",
+ "10 40 17\r",
+ "10 40 18\r",
+ "10 40 19\r",
+ "10 40 20\r",
+ "10 40 21\r",
+ "10 40 22\r",
+ "10 40 23\r",
+ "10 40 24\r",
+ "10 40 25\r",
+ "10 40 26\r",
+ "10 40 27\r",
+ "10 40 28\r",
+ "10 40 29\r",
+ "10 40 30\r",
+ "10 40 31\r",
+ "10 40 32\r",
+ "10 40 33\r",
+ "10 40 34\r",
+ "10 40 35\r",
+ "10 40 36\r",
+ "10 40 37\r",
+ "10 40 38\r",
+ "10 40 39\r",
+ "10 40 40\r",
+ "10 40 41\r",
+ "10 40 42\r",
+ "10 40 43\r",
+ "10 40 44\r",
+ "10 40 45\r",
+ "10 40 46\r",
+ "10 40 47\r",
+ "10 40 48\r",
+ "10 40 49\r",
+ "10 40 50\r",
+ "10 40 51\r",
+ "10 40 52\r",
+ "10 40 53\r",
+ "10 40 54\r",
+ "10 40 55\r",
+ "10 40 56\r",
+ "10 40 57\r",
+ "10 40 58\r",
+ "10 41 1\r",
+ "10 41 2\r",
+ "10 41 3\r",
+ "10 41 4\r",
+ "10 41 5\r",
+ "10 41 6\r",
+ "10 41 7\r",
+ "10 41 8\r",
+ "10 41 9\r",
+ "10 41 10\r",
+ "10 41 11\r",
+ "10 41 12\r",
+ "10 41 13\r",
+ "10 41 14\r",
+ "10 41 15\r",
+ "10 41 16\r",
+ "10 41 17\r",
+ "10 41 18\r",
+ "10 41 19\r",
+ "10 41 20\r",
+ "10 41 21\r",
+ "10 41 22\r",
+ "10 41 23\r",
+ "10 41 24\r",
+ "10 41 25\r",
+ "10 41 26\r",
+ "10 41 27\r",
+ "10 41 28\r",
+ "10 41 29\r",
+ "10 41 30\r",
+ "10 41 31\r",
+ "10 41 32\r",
+ "10 41 33\r",
+ "10 41 34\r",
+ "10 41 35\r",
+ "10 41 36\r",
+ "10 41 37\r",
+ "10 41 38\r",
+ "10 41 39\r",
+ "10 41 40\r",
+ "10 41 41\r",
+ "10 41 42\r",
+ "10 41 43\r",
+ "10 41 44\r",
+ "10 41 45\r",
+ "10 41 46\r",
+ "10 41 47\r",
+ "10 41 48\r",
+ "10 41 49\r",
+ "10 41 50\r",
+ "10 41 51\r",
+ "10 41 52\r",
+ "10 41 53\r",
+ "10 41 54\r",
+ "10 41 55\r",
+ "10 41 56\r",
+ "10 41 57\r",
+ "10 41 58\r",
+ "10 42 1\r",
+ "10 42 2\r",
+ "10 42 3\r",
+ "10 42 4\r",
+ "10 42 5\r",
+ "10 42 6\r",
+ "10 42 7\r",
+ "10 42 8\r",
+ "10 42 9\r",
+ "10 42 10\r",
+ "10 42 11\r",
+ "10 42 12\r",
+ "10 42 13\r",
+ "10 42 14\r",
+ "10 42 15\r",
+ "10 42 16\r",
+ "10 42 17\r",
+ "10 42 18\r",
+ "10 42 19\r",
+ "10 42 20\r",
+ "10 42 21\r",
+ "10 42 22\r",
+ "10 42 23\r",
+ "10 42 24\r",
+ "10 42 25\r",
+ "10 42 26\r",
+ "10 42 27\r",
+ "10 42 28\r",
+ "10 42 29\r",
+ "10 42 30\r",
+ "10 42 31\r",
+ "10 42 32\r",
+ "10 42 33\r",
+ "10 42 34\r",
+ "10 42 35\r",
+ "10 42 36\r",
+ "10 42 37\r",
+ "10 42 38\r",
+ "10 42 39\r",
+ "10 42 40\r",
+ "10 42 41\r",
+ "10 42 42\r",
+ "10 42 43\r",
+ "10 42 44\r",
+ "10 42 45\r",
+ "10 42 46\r",
+ "10 42 47\r",
+ "10 42 48\r",
+ "10 42 49\r",
+ "10 42 50\r",
+ "10 42 51\r",
+ "10 42 52\r",
+ "10 42 53\r",
+ "10 42 54\r",
+ "10 42 55\r",
+ "10 42 56\r",
+ "10 42 57\r",
+ "10 42 58\r",
+ "10 43 1\r",
+ "10 43 2\r",
+ "10 43 3\r",
+ "10 43 4\r",
+ "10 43 5\r",
+ "10 43 6\r",
+ "10 43 7\r",
+ "10 43 8\r",
+ "10 43 9\r",
+ "10 43 10\r",
+ "10 43 11\r",
+ "10 43 12\r",
+ "10 43 13\r",
+ "10 43 14\r",
+ "10 43 15\r",
+ "10 43 16\r",
+ "10 43 17\r",
+ "10 43 18\r",
+ "10 43 19\r",
+ "10 43 20\r",
+ "10 43 21\r",
+ "10 43 22\r",
+ "10 43 23\r",
+ "10 43 24\r",
+ "10 43 25\r",
+ "10 43 26\r",
+ "10 43 27\r",
+ "10 43 28\r",
+ "10 43 29\r",
+ "10 43 30\r",
+ "10 43 31\r",
+ "10 43 32\r",
+ "10 43 33\r",
+ "10 43 34\r",
+ "10 43 35\r",
+ "10 43 36\r",
+ "10 43 37\r",
+ "10 43 38\r",
+ "10 43 39\r",
+ "10 43 40\r",
+ "10 43 41\r",
+ "10 43 42\r",
+ "10 43 43\r",
+ "10 43 44\r",
+ "10 43 45\r",
+ "10 43 46\r",
+ "10 43 47\r",
+ "10 43 48\r",
+ "10 43 49\r",
+ "10 43 50\r",
+ "10 43 51\r",
+ "10 43 52\r",
+ "10 43 53\r",
+ "10 43 54\r",
+ "10 43 55\r",
+ "10 43 56\r",
+ "10 43 57\r",
+ "10 43 58\r",
+ "10 44 1\r",
+ "10 44 2\r",
+ "10 44 3\r",
+ "10 44 4\r",
+ "10 44 5\r",
+ "10 44 6\r",
+ "10 44 7\r",
+ "10 44 8\r",
+ "10 44 9\r",
+ "10 44 10\r",
+ "10 44 11\r",
+ "10 44 12\r",
+ "10 44 13\r",
+ "10 44 14\r",
+ "10 44 15\r",
+ "10 44 16\r",
+ "10 44 17\r",
+ "10 44 18\r",
+ "10 44 19\r",
+ "10 44 20\r",
+ "10 44 21\r",
+ "10 44 22\r",
+ "10 44 23\r",
+ "10 44 24\r",
+ "10 44 25\r",
+ "10 44 26\r",
+ "10 44 27\r",
+ "10 44 28\r",
+ "10 44 29\r",
+ "10 44 30\r",
+ "10 44 31\r",
+ "10 44 32\r",
+ "10 44 33\r",
+ "10 44 34\r",
+ "10 44 35\r",
+ "10 44 36\r",
+ "10 44 37\r",
+ "10 44 38\r",
+ "10 44 39\r",
+ "10 44 40\r",
+ "10 44 41\r",
+ "10 44 42\r",
+ "10 44 43\r",
+ "10 44 44\r",
+ "10 44 45\r",
+ "10 44 46\r",
+ "10 44 47\r",
+ "10 44 48\r",
+ "10 44 49\r",
+ "10 44 50\r",
+ "10 44 51\r",
+ "10 44 52\r",
+ "10 44 53\r",
+ "10 44 54\r",
+ "10 44 55\r",
+ "10 44 56\r",
+ "10 44 57\r",
+ "10 44 58\r",
+ "10 45 1\r",
+ "10 45 2\r",
+ "10 45 3\r",
+ "10 45 4\r",
+ "10 45 5\r",
+ "10 45 6\r",
+ "10 45 7\r",
+ "10 45 8\r",
+ "10 45 9\r",
+ "10 45 10\r",
+ "10 45 11\r",
+ "10 45 12\r",
+ "10 45 13\r",
+ "10 45 14\r",
+ "10 45 15\r",
+ "10 45 16\r",
+ "10 45 17\r",
+ "10 45 18\r",
+ "10 45 19\r",
+ "10 45 20\r",
+ "10 45 21\r",
+ "10 45 22\r",
+ "10 45 23\r",
+ "10 45 24\r",
+ "10 45 25\r",
+ "10 45 26\r",
+ "10 45 27\r",
+ "10 45 28\r",
+ "10 45 29\r",
+ "10 45 30\r",
+ "10 45 31\r",
+ "10 45 32\r",
+ "10 45 33\r",
+ "10 45 34\r",
+ "10 45 35\r",
+ "10 45 36\r",
+ "10 45 37\r",
+ "10 45 38\r",
+ "10 45 39\r",
+ "10 45 40\r",
+ "10 45 41\r",
+ "10 45 42\r",
+ "10 45 43\r",
+ "10 45 44\r",
+ "10 45 45\r",
+ "10 45 46\r",
+ "10 45 47\r",
+ "10 45 48\r",
+ "10 45 49\r",
+ "10 45 50\r",
+ "10 45 51\r",
+ "10 45 52\r",
+ "10 45 53\r",
+ "10 45 54\r",
+ "10 45 55\r",
+ "10 45 56\r",
+ "10 45 57\r",
+ "10 45 58\r",
+ "10 46 1\r",
+ "10 46 2\r",
+ "10 46 3\r",
+ "10 46 4\r",
+ "10 46 5\r",
+ "10 46 6\r",
+ "10 46 7\r",
+ "10 46 8\r",
+ "10 46 9\r",
+ "10 46 10\r",
+ "10 46 11\r",
+ "10 46 12\r",
+ "10 46 13\r",
+ "10 46 14\r",
+ "10 46 15\r",
+ "10 46 16\r",
+ "10 46 17\r",
+ "10 46 18\r",
+ "10 46 19\r",
+ "10 46 20\r",
+ "10 46 21\r",
+ "10 46 22\r",
+ "10 46 23\r",
+ "10 46 24\r",
+ "10 46 25\r",
+ "10 46 26\r",
+ "10 46 27\r",
+ "10 46 28\r",
+ "10 46 29\r",
+ "10 46 30\r",
+ "10 46 31\r",
+ "10 46 32\r",
+ "10 46 33\r",
+ "10 46 34\r",
+ "10 46 35\r",
+ "10 46 36\r",
+ "10 46 37\r",
+ "10 46 38\r",
+ "10 46 39\r",
+ "10 46 40\r",
+ "10 46 41\r",
+ "10 46 42\r",
+ "10 46 43\r",
+ "10 46 44\r",
+ "10 46 45\r",
+ "10 46 46\r",
+ "10 46 47\r",
+ "10 46 48\r",
+ "10 46 49\r",
+ "10 46 50\r",
+ "10 46 51\r",
+ "10 46 52\r",
+ "10 46 53\r",
+ "10 46 54\r",
+ "10 46 55\r",
+ "10 46 56\r",
+ "10 46 57\r",
+ "10 46 58\r",
+ "10 47 1\r",
+ "10 47 2\r",
+ "10 47 3\r",
+ "10 47 4\r",
+ "10 47 5\r",
+ "10 47 6\r",
+ "10 47 7\r",
+ "10 47 8\r",
+ "10 47 9\r",
+ "10 47 10\r",
+ "10 47 11\r",
+ "10 47 12\r",
+ "10 47 13\r",
+ "10 47 14\r",
+ "10 47 15\r",
+ "10 47 16\r",
+ "10 47 17\r",
+ "10 47 18\r",
+ "10 47 19\r",
+ "10 47 20\r",
+ "10 47 21\r",
+ "10 47 22\r",
+ "10 47 23\r",
+ "10 47 24\r",
+ "10 47 25\r",
+ "10 47 26\r",
+ "10 47 27\r",
+ "10 47 28\r",
+ "10 47 29\r",
+ "10 47 30\r",
+ "10 47 31\r",
+ "10 47 32\r",
+ "10 47 33\r",
+ "10 47 34\r",
+ "10 47 35\r",
+ "10 47 36\r",
+ "10 47 37\r",
+ "10 47 38\r",
+ "10 47 39\r",
+ "10 47 40\r",
+ "10 47 41\r",
+ "10 47 42\r",
+ "10 47 43\r",
+ "10 47 44\r",
+ "10 47 45\r",
+ "10 47 46\r",
+ "10 47 47\r",
+ "10 47 48\r",
+ "10 47 49\r",
+ "10 47 50\r",
+ "10 47 51\r",
+ "10 47 52\r",
+ "10 47 53\r",
+ "10 47 54\r",
+ "10 47 55\r",
+ "10 47 56\r",
+ "10 47 57\r",
+ "10 47 58\r",
+ "10 48 1\r",
+ "10 48 2\r",
+ "10 48 3\r",
+ "10 48 4\r",
+ "10 48 5\r",
+ "10 48 6\r",
+ "10 48 7\r",
+ "10 48 8\r",
+ "10 48 9\r",
+ "10 48 10\r",
+ "10 48 11\r",
+ "10 48 12\r",
+ "10 48 13\r",
+ "10 48 14\r",
+ "10 48 15\r",
+ "10 48 16\r",
+ "10 48 17\r",
+ "10 48 18\r",
+ "10 48 19\r",
+ "10 48 20\r",
+ "10 48 21\r",
+ "10 48 22\r",
+ "10 48 23\r",
+ "10 48 24\r",
+ "10 48 25\r",
+ "10 48 26\r",
+ "10 48 27\r",
+ "10 48 28\r",
+ "10 48 29\r",
+ "10 48 30\r",
+ "10 48 31\r",
+ "10 48 32\r",
+ "10 48 33\r",
+ "10 48 34\r",
+ "10 48 35\r",
+ "10 48 36\r",
+ "10 48 37\r",
+ "10 48 38\r",
+ "10 48 39\r",
+ "10 48 40\r",
+ "10 48 41\r",
+ "10 48 42\r",
+ "10 48 43\r",
+ "10 48 44\r",
+ "10 48 45\r",
+ "10 48 46\r",
+ "10 48 47\r",
+ "10 48 48\r",
+ "10 48 49\r",
+ "10 48 50\r",
+ "10 48 51\r",
+ "10 48 52\r",
+ "10 48 53\r",
+ "10 48 54\r",
+ "10 48 55\r",
+ "10 48 56\r",
+ "10 48 57\r",
+ "10 48 58\r",
+ "10 49 1\r",
+ "10 49 2\r",
+ "10 49 3\r",
+ "10 49 4\r",
+ "10 49 5\r",
+ "10 49 6\r",
+ "10 49 7\r",
+ "10 49 8\r",
+ "10 49 9\r",
+ "10 49 10\r",
+ "10 49 11\r",
+ "10 49 12\r",
+ "10 49 13\r",
+ "10 49 14\r",
+ "10 49 15\r",
+ "10 49 16\r",
+ "10 49 17\r",
+ "10 49 18\r",
+ "10 49 19\r",
+ "10 49 20\r",
+ "10 49 21\r",
+ "10 49 22\r",
+ "10 49 23\r",
+ "10 49 24\r",
+ "10 49 25\r",
+ "10 49 26\r",
+ "10 49 27\r",
+ "10 49 28\r",
+ "10 49 29\r",
+ "10 49 30\r",
+ "10 49 31\r",
+ "10 49 32\r",
+ "10 49 33\r",
+ "10 49 34\r",
+ "10 49 35\r",
+ "10 49 36\r",
+ "10 49 37\r",
+ "10 49 38\r",
+ "10 49 39\r",
+ "10 49 40\r",
+ "10 49 41\r",
+ "10 49 42\r",
+ "10 49 43\r",
+ "10 49 44\r",
+ "10 49 45\r",
+ "10 49 46\r",
+ "10 49 47\r",
+ "10 49 48\r",
+ "10 49 49\r",
+ "10 49 50\r",
+ "10 49 51\r",
+ "10 49 52\r",
+ "10 49 53\r",
+ "10 49 54\r",
+ "10 49 55\r",
+ "10 49 56\r",
+ "10 49 57\r",
+ "10 49 58\r",
+ "10 50 1\r",
+ "10 50 2\r",
+ "10 50 3\r",
+ "10 50 4\r",
+ "10 50 5\r",
+ "10 50 6\r",
+ "10 50 7\r",
+ "10 50 8\r",
+ "10 50 9\r",
+ "10 50 10\r",
+ "10 50 11\r",
+ "10 50 12\r",
+ "10 50 13\r",
+ "10 50 14\r",
+ "10 50 15\r",
+ "10 50 16\r",
+ "10 50 17\r",
+ "10 50 18\r",
+ "10 50 19\r",
+ "10 50 20\r",
+ "10 50 21\r",
+ "10 50 22\r",
+ "10 50 23\r",
+ "10 50 24\r",
+ "10 50 25\r",
+ "10 50 26\r",
+ "10 50 27\r",
+ "10 50 28\r",
+ "10 50 29\r",
+ "10 50 30\r",
+ "10 50 31\r",
+ "10 50 32\r",
+ "10 50 33\r",
+ "10 50 34\r",
+ "10 50 35\r",
+ "10 50 36\r",
+ "10 50 37\r",
+ "10 50 38\r",
+ "10 50 39\r",
+ "10 50 40\r",
+ "10 50 41\r",
+ "10 50 42\r",
+ "10 50 43\r",
+ "10 50 44\r",
+ "10 50 45\r",
+ "10 50 46\r",
+ "10 50 47\r",
+ "10 50 48\r",
+ "10 50 49\r",
+ "10 50 50\r",
+ "10 50 51\r",
+ "10 50 52\r",
+ "10 50 53\r",
+ "10 50 54\r",
+ "10 50 55\r",
+ "10 50 56\r",
+ "10 50 57\r",
+ "10 50 58\r",
+ "10 51 1\r",
+ "10 51 2\r",
+ "10 51 3\r",
+ "10 51 4\r",
+ "10 51 5\r",
+ "10 51 6\r",
+ "10 51 7\r",
+ "10 51 8\r",
+ "10 51 9\r",
+ "10 51 10\r",
+ "10 51 11\r",
+ "10 51 12\r",
+ "10 51 13\r",
+ "10 51 14\r",
+ "10 51 15\r",
+ "10 51 16\r",
+ "10 51 17\r",
+ "10 51 18\r",
+ "10 51 19\r",
+ "10 51 20\r",
+ "10 51 21\r",
+ "10 51 22\r",
+ "10 51 23\r",
+ "10 51 24\r",
+ "10 51 25\r",
+ "10 51 26\r",
+ "10 51 27\r",
+ "10 51 28\r",
+ "10 51 29\r",
+ "10 51 30\r",
+ "10 51 31\r",
+ "10 51 32\r",
+ "10 51 33\r",
+ "10 51 34\r",
+ "10 51 35\r",
+ "10 51 36\r",
+ "10 51 37\r",
+ "10 51 38\r",
+ "10 51 39\r",
+ "10 51 40\r",
+ "10 51 41\r",
+ "10 51 42\r",
+ "10 51 43\r",
+ "10 51 44\r",
+ "10 51 45\r",
+ "10 51 46\r",
+ "10 51 47\r",
+ "10 51 48\r",
+ "10 51 49\r",
+ "10 51 50\r",
+ "10 51 51\r",
+ "10 51 52\r",
+ "10 51 53\r",
+ "10 51 54\r",
+ "10 51 55\r",
+ "10 51 56\r",
+ "10 51 57\r",
+ "10 51 58\r",
+ "10 52 1\r",
+ "10 52 2\r",
+ "10 52 3\r",
+ "10 52 4\r",
+ "10 52 5\r",
+ "10 52 6\r",
+ "10 52 7\r",
+ "10 52 8\r",
+ "10 52 9\r",
+ "10 52 10\r",
+ "10 52 11\r",
+ "10 52 12\r",
+ "10 52 13\r",
+ "10 52 14\r",
+ "10 52 15\r",
+ "10 52 16\r",
+ "10 52 17\r",
+ "10 52 18\r",
+ "10 52 19\r",
+ "10 52 20\r",
+ "10 52 21\r",
+ "10 52 22\r",
+ "10 52 23\r",
+ "10 52 24\r",
+ "10 52 25\r",
+ "10 52 26\r",
+ "10 52 27\r",
+ "10 52 28\r",
+ "10 52 29\r",
+ "10 52 30\r",
+ "10 52 31\r",
+ "10 52 32\r",
+ "10 52 33\r",
+ "10 52 34\r",
+ "10 52 35\r",
+ "10 52 36\r",
+ "10 52 37\r",
+ "10 52 38\r",
+ "10 52 39\r",
+ "10 52 40\r",
+ "10 52 41\r",
+ "10 52 42\r",
+ "10 52 43\r",
+ "10 52 44\r",
+ "10 52 45\r",
+ "10 52 46\r",
+ "10 52 47\r",
+ "10 52 48\r",
+ "10 52 49\r",
+ "10 52 50\r",
+ "10 52 51\r",
+ "10 52 52\r",
+ "10 52 53\r",
+ "10 52 54\r",
+ "10 52 55\r",
+ "10 52 56\r",
+ "10 52 57\r",
+ "10 52 58\r",
+ "10 53 1\r",
+ "10 53 2\r",
+ "10 53 3\r",
+ "10 53 4\r",
+ "10 53 5\r",
+ "10 53 6\r",
+ "10 53 7\r",
+ "10 53 8\r",
+ "10 53 9\r",
+ "10 53 10\r",
+ "10 53 11\r",
+ "10 53 12\r",
+ "10 53 13\r",
+ "10 53 14\r",
+ "10 53 15\r",
+ "10 53 16\r",
+ "10 53 17\r",
+ "10 53 18\r",
+ "10 53 19\r",
+ "10 53 20\r",
+ "10 53 21\r",
+ "10 53 22\r",
+ "10 53 23\r",
+ "10 53 24\r",
+ "10 53 25\r",
+ "10 53 26\r",
+ "10 53 27\r",
+ "10 53 28\r",
+ "10 53 29\r",
+ "10 53 30\r",
+ "10 53 31\r",
+ "10 53 32\r",
+ "10 53 33\r",
+ "10 53 34\r",
+ "10 53 35\r",
+ "10 53 36\r",
+ "10 53 37\r",
+ "10 53 38\r",
+ "10 53 39\r",
+ "10 53 40\r",
+ "10 53 41\r",
+ "10 53 42\r",
+ "10 53 43\r",
+ "10 53 44\r",
+ "10 53 45\r",
+ "10 53 46\r",
+ "10 53 47\r",
+ "10 53 48\r",
+ "10 53 49\r",
+ "10 53 50\r",
+ "10 53 51\r",
+ "10 53 52\r",
+ "10 53 53\r",
+ "10 53 54\r",
+ "10 53 55\r",
+ "10 53 56\r",
+ "10 53 57\r",
+ "10 53 58\r",
+ "10 54 1\r",
+ "10 54 2\r",
+ "10 54 3\r",
+ "10 54 4\r",
+ "10 54 5\r",
+ "10 54 6\r",
+ "10 54 7\r",
+ "10 54 8\r",
+ "10 54 9\r",
+ "10 54 10\r",
+ "10 54 11\r",
+ "10 54 12\r",
+ "10 54 13\r",
+ "10 54 14\r",
+ "10 54 15\r",
+ "10 54 16\r",
+ "10 54 17\r",
+ "10 54 18\r",
+ "10 54 19\r",
+ "10 54 20\r",
+ "10 54 21\r",
+ "10 54 22\r",
+ "10 54 23\r",
+ "10 54 24\r",
+ "10 54 25\r",
+ "10 54 26\r",
+ "10 54 27\r",
+ "10 54 28\r",
+ "10 54 29\r",
+ "10 54 30\r",
+ "10 54 31\r",
+ "10 54 32\r",
+ "10 54 33\r",
+ "10 54 34\r",
+ "10 54 35\r",
+ "10 54 36\r",
+ "10 54 37\r",
+ "10 54 38\r",
+ "10 54 39\r",
+ "10 54 40\r",
+ "10 54 41\r",
+ "10 54 42\r",
+ "10 54 43\r",
+ "10 54 44\r",
+ "10 54 45\r",
+ "10 54 46\r",
+ "10 54 47\r",
+ "10 54 48\r",
+ "10 54 49\r",
+ "10 54 50\r",
+ "10 54 51\r",
+ "10 54 52\r",
+ "10 54 53\r",
+ "10 54 54\r",
+ "10 54 55\r",
+ "10 54 56\r",
+ "10 54 57\r",
+ "10 54 58\r",
+ "10 55 1\r",
+ "10 55 2\r",
+ "10 55 3\r",
+ "10 55 4\r",
+ "10 55 5\r",
+ "10 55 6\r",
+ "10 55 7\r",
+ "10 55 8\r",
+ "10 55 9\r",
+ "10 55 10\r",
+ "10 55 11\r",
+ "10 55 12\r",
+ "10 55 13\r",
+ "10 55 14\r",
+ "10 55 15\r",
+ "10 55 16\r",
+ "10 55 17\r",
+ "10 55 18\r",
+ "10 55 19\r",
+ "10 55 20\r",
+ "10 55 21\r",
+ "10 55 22\r",
+ "10 55 23\r",
+ "10 55 24\r",
+ "10 55 25\r",
+ "10 55 26\r",
+ "10 55 27\r",
+ "10 55 28\r",
+ "10 55 29\r",
+ "10 55 30\r",
+ "10 55 31\r",
+ "10 55 32\r",
+ "10 55 33\r",
+ "10 55 34\r",
+ "10 55 35\r",
+ "10 55 36\r",
+ "10 55 37\r",
+ "10 55 38\r",
+ "10 55 39\r",
+ "10 55 40\r",
+ "10 55 41\r",
+ "10 55 42\r",
+ "10 55 43\r",
+ "10 55 44\r",
+ "10 55 45\r",
+ "10 55 46\r",
+ "10 55 47\r",
+ "10 55 48\r",
+ "10 55 49\r",
+ "10 55 50\r",
+ "10 55 51\r",
+ "10 55 52\r",
+ "10 55 53\r",
+ "10 55 54\r",
+ "10 55 55\r",
+ "10 55 56\r",
+ "10 55 57\r",
+ "10 55 58\r",
+ "10 56 1\r",
+ "10 56 2\r",
+ "10 56 3\r",
+ "10 56 4\r",
+ "10 56 5\r",
+ "10 56 6\r",
+ "10 56 7\r",
+ "10 56 8\r",
+ "10 56 9\r",
+ "10 56 10\r",
+ "10 56 11\r",
+ "10 56 12\r",
+ "10 56 13\r",
+ "10 56 14\r",
+ "10 56 15\r",
+ "10 56 16\r",
+ "10 56 17\r",
+ "10 56 18\r",
+ "10 56 19\r",
+ "10 56 20\r",
+ "10 56 21\r",
+ "10 56 22\r",
+ "10 56 23\r",
+ "10 56 24\r",
+ "10 56 25\r",
+ "10 56 26\r",
+ "10 56 27\r",
+ "10 56 28\r",
+ "10 56 29\r",
+ "10 56 30\r",
+ "10 56 31\r",
+ "10 56 32\r",
+ "10 56 33\r",
+ "10 56 34\r",
+ "10 56 35\r",
+ "10 56 36\r",
+ "10 56 37\r",
+ "10 56 38\r",
+ "10 56 39\r",
+ "10 56 40\r",
+ "10 56 41\r",
+ "10 56 42\r",
+ "10 56 43\r",
+ "10 56 44\r",
+ "10 56 45\r",
+ "10 56 46\r",
+ "10 56 47\r",
+ "10 56 48\r",
+ "10 56 49\r",
+ "10 56 50\r",
+ "10 56 51\r",
+ "10 56 52\r",
+ "10 56 53\r",
+ "10 56 54\r",
+ "10 56 55\r",
+ "10 56 56\r",
+ "10 56 57\r",
+ "10 56 58\r",
+ "10 57 1\r",
+ "10 57 2\r",
+ "10 57 3\r",
+ "10 57 4\r",
+ "10 57 5\r",
+ "10 57 6\r",
+ "10 57 7\r",
+ "10 57 8\r",
+ "10 57 9\r",
+ "10 57 10\r",
+ "10 57 11\r",
+ "10 57 12\r",
+ "10 57 13\r",
+ "10 57 14\r",
+ "10 57 15\r",
+ "10 57 16\r",
+ "10 57 17\r",
+ "10 57 18\r",
+ "10 57 19\r",
+ "10 57 20\r",
+ "10 57 21\r",
+ "10 57 22\r",
+ "10 57 23\r",
+ "10 57 24\r",
+ "10 57 25\r",
+ "10 57 26\r",
+ "10 57 27\r",
+ "10 57 28\r",
+ "10 57 29\r",
+ "10 57 30\r",
+ "10 57 31\r",
+ "10 57 32\r",
+ "10 57 33\r",
+ "10 57 34\r",
+ "10 57 35\r",
+ "10 57 36\r",
+ "10 57 37\r",
+ "10 57 38\r",
+ "10 57 39\r",
+ "10 57 40\r",
+ "10 57 41\r",
+ "10 57 42\r",
+ "10 57 43\r",
+ "10 57 44\r",
+ "10 57 45\r",
+ "10 57 46\r",
+ "10 57 47\r",
+ "10 57 48\r",
+ "10 57 49\r",
+ "10 57 50\r",
+ "10 57 51\r",
+ "10 57 52\r",
+ "10 57 53\r",
+ "10 57 54\r",
+ "10 57 55\r",
+ "10 57 56\r",
+ "10 57 57\r",
+ "10 57 58\r",
+ "10 58 1\r",
+ "10 58 2\r",
+ "10 58 3\r",
+ "10 58 4\r",
+ "10 58 5\r",
+ "10 58 6\r",
+ "10 58 7\r",
+ "10 58 8\r",
+ "10 58 9\r",
+ "10 58 10\r",
+ "10 58 11\r",
+ "10 58 12\r",
+ "10 58 13\r",
+ "10 58 14\r",
+ "10 58 15\r",
+ "10 58 16\r",
+ "10 58 17\r",
+ "10 58 18\r",
+ "10 58 19\r",
+ "10 58 20\r",
+ "10 58 21\r",
+ "10 58 22\r",
+ "10 58 23\r",
+ "10 58 24\r",
+ "10 58 25\r",
+ "10 58 26\r",
+ "10 58 27\r",
+ "10 58 28\r",
+ "10 58 29\r",
+ "10 58 30\r",
+ "10 58 31\r",
+ "10 58 32\r",
+ "10 58 33\r",
+ "10 58 34\r",
+ "10 58 35\r",
+ "10 58 36\r",
+ "10 58 37\r",
+ "10 58 38\r",
+ "10 58 39\r",
+ "10 58 40\r",
+ "10 58 41\r",
+ "10 58 42\r",
+ "10 58 43\r",
+ "10 58 44\r",
+ "10 58 45\r",
+ "10 58 46\r",
+ "10 58 47\r",
+ "10 58 48\r",
+ "10 58 49\r",
+ "10 58 50\r",
+ "10 58 51\r",
+ "10 58 52\r",
+ "10 58 53\r",
+ "10 58 54\r",
+ "10 58 55\r",
+ "10 58 56\r",
+ "10 58 57\r",
+ "10 58 58\r",
+ "11 1 1\r",
+ "11 1 2\r",
+ "11 1 3\r",
+ "11 1 4\r",
+ "11 1 5\r",
+ "11 1 6\r",
+ "11 1 7\r",
+ "11 1 8\r",
+ "11 1 9\r",
+ "11 1 10\r",
+ "11 1 11\r",
+ "11 1 12\r",
+ "11 1 13\r",
+ "11 1 14\r",
+ "11 1 15\r",
+ "11 1 16\r",
+ "11 1 17\r",
+ "11 1 18\r",
+ "11 1 19\r",
+ "11 1 20\r",
+ "11 1 21\r",
+ "11 1 22\r",
+ "11 1 23\r",
+ "11 1 24\r",
+ "11 1 25\r",
+ "11 1 26\r",
+ "11 1 27\r",
+ "11 1 28\r",
+ "11 1 29\r",
+ "11 1 30\r",
+ "11 1 31\r",
+ "11 1 32\r",
+ "11 1 33\r",
+ "11 1 34\r",
+ "11 1 35\r",
+ "11 1 36\r",
+ "11 1 37\r",
+ "11 1 38\r",
+ "11 1 39\r",
+ "11 1 40\r",
+ "11 1 41\r",
+ "11 1 42\r",
+ "11 1 43\r",
+ "11 1 44\r",
+ "11 1 45\r",
+ "11 1 46\r",
+ "11 1 47\r",
+ "11 1 48\r",
+ "11 1 49\r",
+ "11 1 50\r",
+ "11 1 51\r",
+ "11 1 52\r",
+ "11 1 53\r",
+ "11 1 54\r",
+ "11 1 55\r",
+ "11 1 56\r",
+ "11 1 57\r",
+ "11 1 58\r",
+ "11 2 1\r",
+ "11 2 2\r",
+ "11 2 3\r",
+ "11 2 4\r",
+ "11 2 5\r",
+ "11 2 6\r",
+ "11 2 7\r",
+ "11 2 8\r",
+ "11 2 9\r",
+ "11 2 10\r",
+ "11 2 11\r",
+ "11 2 12\r",
+ "11 2 13\r",
+ "11 2 14\r",
+ "11 2 15\r",
+ "11 2 16\r",
+ "11 2 17\r",
+ "11 2 18\r",
+ "11 2 19\r",
+ "11 2 20\r",
+ "11 2 21\r",
+ "11 2 22\r",
+ "11 2 23\r",
+ "11 2 24\r",
+ "11 2 25\r",
+ "11 2 26\r",
+ "11 2 27\r",
+ "11 2 28\r",
+ "11 2 29\r",
+ "11 2 30\r",
+ "11 2 31\r",
+ "11 2 32\r",
+ "11 2 33\r",
+ "11 2 34\r",
+ "11 2 35\r",
+ "11 2 36\r",
+ "11 2 37\r",
+ "11 2 38\r",
+ "11 2 39\r",
+ "11 2 40\r",
+ "11 2 41\r",
+ "11 2 42\r",
+ "11 2 43\r",
+ "11 2 44\r",
+ "11 2 45\r",
+ "11 2 46\r",
+ "11 2 47\r",
+ "11 2 48\r",
+ "11 2 49\r",
+ "11 2 50\r",
+ "11 2 51\r",
+ "11 2 52\r",
+ "11 2 53\r",
+ "11 2 54\r",
+ "11 2 55\r",
+ "11 2 56\r",
+ "11 2 57\r",
+ "11 2 58\r",
+ "11 3 1\r",
+ "11 3 2\r",
+ "11 3 3\r",
+ "11 3 4\r",
+ "11 3 5\r",
+ "11 3 6\r",
+ "11 3 7\r",
+ "11 3 8\r",
+ "11 3 9\r",
+ "11 3 10\r",
+ "11 3 11\r",
+ "11 3 12\r",
+ "11 3 13\r",
+ "11 3 14\r",
+ "11 3 15\r",
+ "11 3 16\r",
+ "11 3 17\r",
+ "11 3 18\r",
+ "11 3 19\r",
+ "11 3 20\r",
+ "11 3 21\r",
+ "11 3 22\r",
+ "11 3 23\r",
+ "11 3 24\r",
+ "11 3 25\r",
+ "11 3 26\r",
+ "11 3 27\r",
+ "11 3 28\r",
+ "11 3 29\r",
+ "11 3 30\r",
+ "11 3 31\r",
+ "11 3 32\r",
+ "11 3 33\r",
+ "11 3 34\r",
+ "11 3 35\r",
+ "11 3 36\r",
+ "11 3 37\r",
+ "11 3 38\r",
+ "11 3 39\r",
+ "11 3 40\r",
+ "11 3 41\r",
+ "11 3 42\r",
+ "11 3 43\r",
+ "11 3 44\r",
+ "11 3 45\r",
+ "11 3 46\r",
+ "11 3 47\r",
+ "11 3 48\r",
+ "11 3 49\r",
+ "11 3 50\r",
+ "11 3 51\r",
+ "11 3 52\r",
+ "11 3 53\r",
+ "11 3 54\r",
+ "11 3 55\r",
+ "11 3 56\r",
+ "11 3 57\r",
+ "11 3 58\r",
+ "11 4 1\r",
+ "11 4 2\r",
+ "11 4 3\r",
+ "11 4 4\r",
+ "11 4 5\r",
+ "11 4 6\r",
+ "11 4 7\r",
+ "11 4 8\r",
+ "11 4 9\r",
+ "11 4 10\r",
+ "11 4 11\r",
+ "11 4 12\r",
+ "11 4 13\r",
+ "11 4 14\r",
+ "11 4 15\r",
+ "11 4 16\r",
+ "11 4 17\r",
+ "11 4 18\r",
+ "11 4 19\r",
+ "11 4 20\r",
+ "11 4 21\r",
+ "11 4 22\r",
+ "11 4 23\r",
+ "11 4 24\r",
+ "11 4 25\r",
+ "11 4 26\r",
+ "11 4 27\r",
+ "11 4 28\r",
+ "11 4 29\r",
+ "11 4 30\r",
+ "11 4 31\r",
+ "11 4 32\r",
+ "11 4 33\r",
+ "11 4 34\r",
+ "11 4 35\r",
+ "11 4 36\r",
+ "11 4 37\r",
+ "11 4 38\r",
+ "11 4 39\r",
+ "11 4 40\r",
+ "11 4 41\r",
+ "11 4 42\r",
+ "11 4 43\r",
+ "11 4 44\r",
+ "11 4 45\r",
+ "11 4 46\r",
+ "11 4 47\r",
+ "11 4 48\r",
+ "11 4 49\r",
+ "11 4 50\r",
+ "11 4 51\r",
+ "11 4 52\r",
+ "11 4 53\r",
+ "11 4 54\r",
+ "11 4 55\r",
+ "11 4 56\r",
+ "11 4 57\r",
+ "11 4 58\r",
+ "11 5 1\r",
+ "11 5 2\r",
+ "11 5 3\r",
+ "11 5 4\r",
+ "11 5 5\r",
+ "11 5 6\r",
+ "11 5 7\r",
+ "11 5 8\r",
+ "11 5 9\r",
+ "11 5 10\r",
+ "11 5 11\r",
+ "11 5 12\r",
+ "11 5 13\r",
+ "11 5 14\r",
+ "11 5 15\r",
+ "11 5 16\r",
+ "11 5 17\r",
+ "11 5 18\r",
+ "11 5 19\r",
+ "11 5 20\r",
+ "11 5 21\r",
+ "11 5 22\r",
+ "11 5 23\r",
+ "11 5 24\r",
+ "11 5 25\r",
+ "11 5 26\r",
+ "11 5 27\r",
+ "11 5 28\r",
+ "11 5 29\r",
+ "11 5 30\r",
+ "11 5 31\r",
+ "11 5 32\r",
+ "11 5 33\r",
+ "11 5 34\r",
+ "11 5 35\r",
+ "11 5 36\r",
+ "11 5 37\r",
+ "11 5 38\r",
+ "11 5 39\r",
+ "11 5 40\r",
+ "11 5 41\r",
+ "11 5 42\r",
+ "11 5 43\r",
+ "11 5 44\r",
+ "11 5 45\r",
+ "11 5 46\r",
+ "11 5 47\r",
+ "11 5 48\r",
+ "11 5 49\r",
+ "11 5 50\r",
+ "11 5 51\r",
+ "11 5 52\r",
+ "11 5 53\r",
+ "11 5 54\r",
+ "11 5 55\r",
+ "11 5 56\r",
+ "11 5 57\r",
+ "11 5 58\r",
+ "11 6 1\r",
+ "11 6 2\r",
+ "11 6 3\r",
+ "11 6 4\r",
+ "11 6 5\r",
+ "11 6 6\r",
+ "11 6 7\r",
+ "11 6 8\r",
+ "11 6 9\r",
+ "11 6 10\r",
+ "11 6 11\r",
+ "11 6 12\r",
+ "11 6 13\r",
+ "11 6 14\r",
+ "11 6 15\r",
+ "11 6 16\r",
+ "11 6 17\r",
+ "11 6 18\r",
+ "11 6 19\r",
+ "11 6 20\r",
+ "11 6 21\r",
+ "11 6 22\r",
+ "11 6 23\r",
+ "11 6 24\r",
+ "11 6 25\r",
+ "11 6 26\r",
+ "11 6 27\r",
+ "11 6 28\r",
+ "11 6 29\r",
+ "11 6 30\r",
+ "11 6 31\r",
+ "11 6 32\r",
+ "11 6 33\r",
+ "11 6 34\r",
+ "11 6 35\r",
+ "11 6 36\r",
+ "11 6 37\r",
+ "11 6 38\r",
+ "11 6 39\r",
+ "11 6 40\r",
+ "11 6 41\r",
+ "11 6 42\r",
+ "11 6 43\r",
+ "11 6 44\r",
+ "11 6 45\r",
+ "11 6 46\r",
+ "11 6 47\r",
+ "11 6 48\r",
+ "11 6 49\r",
+ "11 6 50\r",
+ "11 6 51\r",
+ "11 6 52\r",
+ "11 6 53\r",
+ "11 6 54\r",
+ "11 6 55\r",
+ "11 6 56\r",
+ "11 6 57\r",
+ "11 6 58\r",
+ "11 7 1\r",
+ "11 7 2\r",
+ "11 7 3\r",
+ "11 7 4\r",
+ "11 7 5\r",
+ "11 7 6\r",
+ "11 7 7\r",
+ "11 7 8\r",
+ "11 7 9\r",
+ "11 7 10\r",
+ "11 7 11\r",
+ "11 7 12\r",
+ "11 7 13\r",
+ "11 7 14\r",
+ "11 7 15\r",
+ "11 7 16\r",
+ "11 7 17\r",
+ "11 7 18\r",
+ "11 7 19\r",
+ "11 7 20\r",
+ "11 7 21\r",
+ "11 7 22\r",
+ "11 7 23\r",
+ "11 7 24\r",
+ "11 7 25\r",
+ "11 7 26\r",
+ "11 7 27\r",
+ "11 7 28\r",
+ "11 7 29\r",
+ "11 7 30\r",
+ "11 7 31\r",
+ "11 7 32\r",
+ "11 7 33\r",
+ "11 7 34\r",
+ "11 7 35\r",
+ "11 7 36\r",
+ "11 7 37\r",
+ "11 7 38\r",
+ "11 7 39\r",
+ "11 7 40\r",
+ "11 7 41\r",
+ "11 7 42\r",
+ "11 7 43\r",
+ "11 7 44\r",
+ "11 7 45\r",
+ "11 7 46\r",
+ "11 7 47\r",
+ "11 7 48\r",
+ "11 7 49\r",
+ "11 7 50\r",
+ "11 7 51\r",
+ "11 7 52\r",
+ "11 7 53\r",
+ "11 7 54\r",
+ "11 7 55\r",
+ "11 7 56\r",
+ "11 7 57\r",
+ "11 7 58\r",
+ "11 8 1\r",
+ "11 8 2\r",
+ "11 8 3\r",
+ "11 8 4\r",
+ "11 8 5\r",
+ "11 8 6\r",
+ "11 8 7\r",
+ "11 8 8\r",
+ "11 8 9\r",
+ "11 8 10\r",
+ "11 8 11\r",
+ "11 8 12\r",
+ "11 8 13\r",
+ "11 8 14\r",
+ "11 8 15\r",
+ "11 8 16\r",
+ "11 8 17\r",
+ "11 8 18\r",
+ "11 8 19\r",
+ "11 8 20\r",
+ "11 8 21\r",
+ "11 8 22\r",
+ "11 8 23\r",
+ "11 8 24\r",
+ "11 8 25\r",
+ "11 8 26\r",
+ "11 8 27\r",
+ "11 8 28\r",
+ "11 8 29\r",
+ "11 8 30\r",
+ "11 8 31\r",
+ "11 8 32\r",
+ "11 8 33\r",
+ "11 8 34\r",
+ "11 8 35\r",
+ "11 8 36\r",
+ "11 8 37\r",
+ "11 8 38\r",
+ "11 8 39\r",
+ "11 8 40\r",
+ "11 8 41\r",
+ "11 8 42\r",
+ "11 8 43\r",
+ "11 8 44\r",
+ "11 8 45\r",
+ "11 8 46\r",
+ "11 8 47\r",
+ "11 8 48\r",
+ "11 8 49\r",
+ "11 8 50\r",
+ "11 8 51\r",
+ "11 8 52\r",
+ "11 8 53\r",
+ "11 8 54\r",
+ "11 8 55\r",
+ "11 8 56\r",
+ "11 8 57\r",
+ "11 8 58\r",
+ "11 9 1\r",
+ "11 9 2\r",
+ "11 9 3\r",
+ "11 9 4\r",
+ "11 9 5\r",
+ "11 9 6\r",
+ "11 9 7\r",
+ "11 9 8\r",
+ "11 9 9\r",
+ "11 9 10\r",
+ "11 9 11\r",
+ "11 9 12\r",
+ "11 9 13\r",
+ "11 9 14\r",
+ "11 9 15\r",
+ "11 9 16\r",
+ "11 9 17\r",
+ "11 9 18\r",
+ "11 9 19\r",
+ "11 9 20\r",
+ "11 9 21\r",
+ "11 9 22\r",
+ "11 9 23\r",
+ "11 9 24"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "11 9 25\r",
+ "11 9 26\r",
+ "11 9 27\r",
+ "11 9 28\r",
+ "11 9 29\r",
+ "11 9 30\r",
+ "11 9 31\r",
+ "11 9 32\r",
+ "11 9 33\r",
+ "11 9 34\r",
+ "11 9 35\r",
+ "11 9 36\r",
+ "11 9 37\r",
+ "11 9 38\r",
+ "11 9 39\r",
+ "11 9 40\r",
+ "11 9 41\r",
+ "11 9 42\r",
+ "11 9 43\r",
+ "11 9 44\r",
+ "11 9 45\r",
+ "11 9 46\r",
+ "11 9 47\r",
+ "11 9 48\r",
+ "11 9 49\r",
+ "11 9 50\r",
+ "11 9 51\r",
+ "11 9 52\r",
+ "11 9 53\r",
+ "11 9 54\r",
+ "11 9 55\r",
+ "11 9 56\r",
+ "11 9 57\r",
+ "11 9 58\r",
+ "11 10 1\r",
+ "11 10 2\r",
+ "11 10 3\r",
+ "11 10 4\r",
+ "11 10 5\r",
+ "11 10 6\r",
+ "11 10 7\r",
+ "11 10 8\r",
+ "11 10 9\r",
+ "11 10 10\r",
+ "11 10 11\r",
+ "11 10 12\r",
+ "11 10 13\r",
+ "11 10 14\r",
+ "11 10 15\r",
+ "11 10 16\r",
+ "11 10 17\r",
+ "11 10 18\r",
+ "11 10 19\r",
+ "11 10 20\r",
+ "11 10 21\r",
+ "11 10 22\r",
+ "11 10 23\r",
+ "11 10 24\r",
+ "11 10 25\r",
+ "11 10 26\r",
+ "11 10 27\r",
+ "11 10 28\r",
+ "11 10 29\r",
+ "11 10 30\r",
+ "11 10 31\r",
+ "11 10 32\r",
+ "11 10 33\r",
+ "11 10 34\r",
+ "11 10 35\r",
+ "11 10 36\r",
+ "11 10 37\r",
+ "11 10 38\r",
+ "11 10 39\r",
+ "11 10 40\r",
+ "11 10 41\r",
+ "11 10 42\r",
+ "11 10 43\r",
+ "11 10 44\r",
+ "11 10 45\r",
+ "11 10 46\r",
+ "11 10 47\r",
+ "11 10 48\r",
+ "11 10 49\r",
+ "11 10 50\r",
+ "11 10 51\r",
+ "11 10 52\r",
+ "11 10 53\r",
+ "11 10 54\r",
+ "11 10 55\r",
+ "11 10 56\r",
+ "11 10 57\r",
+ "11 10 58\r",
+ "11 11 1\r",
+ "11 11 2\r",
+ "11 11 3\r",
+ "11 11 4\r",
+ "11 11 5\r",
+ "11 11 6\r",
+ "11 11 7\r",
+ "11 11 8\r",
+ "11 11 9\r",
+ "11 11 10\r",
+ "11 11 11\r",
+ "11 11 12\r",
+ "11 11 13\r",
+ "11 11 14\r",
+ "11 11 15\r",
+ "11 11 16\r",
+ "11 11 17\r",
+ "11 11 18\r",
+ "11 11 19\r",
+ "11 11 20\r",
+ "11 11 21\r",
+ "11 11 22\r",
+ "11 11 23\r",
+ "11 11 24\r",
+ "11 11 25\r",
+ "11 11 26\r",
+ "11 11 27\r",
+ "11 11 28\r",
+ "11 11 29\r",
+ "11 11 30\r",
+ "11 11 31\r",
+ "11 11 32\r",
+ "11 11 33\r",
+ "11 11 34\r",
+ "11 11 35\r",
+ "11 11 36\r",
+ "11 11 37\r",
+ "11 11 38\r",
+ "11 11 39\r",
+ "11 11 40\r",
+ "11 11 41\r",
+ "11 11 42\r",
+ "11 11 43\r",
+ "11 11 44\r",
+ "11 11 45\r",
+ "11 11 46\r",
+ "11 11 47\r",
+ "11 11 48\r",
+ "11 11 49\r",
+ "11 11 50\r",
+ "11 11 51\r",
+ "11 11 52\r",
+ "11 11 53\r",
+ "11 11 54\r",
+ "11 11 55\r",
+ "11 11 56\r",
+ "11 11 57\r",
+ "11 11 58\r",
+ "11 12 1\r",
+ "11 12 2\r",
+ "11 12 3\r",
+ "11 12 4\r",
+ "11 12 5\r",
+ "11 12 6\r",
+ "11 12 7\r",
+ "11 12 8\r",
+ "11 12 9\r",
+ "11 12 10\r",
+ "11 12 11\r",
+ "11 12 12\r",
+ "11 12 13\r",
+ "11 12 14\r",
+ "11 12 15\r",
+ "11 12 16\r",
+ "11 12 17\r",
+ "11 12 18\r",
+ "11 12 19\r",
+ "11 12 20\r",
+ "11 12 21\r",
+ "11 12 22\r",
+ "11 12 23\r",
+ "11 12 24\r",
+ "11 12 25\r",
+ "11 12 26\r",
+ "11 12 27\r",
+ "11 12 28\r",
+ "11 12 29\r",
+ "11 12 30\r",
+ "11 12 31\r",
+ "11 12 32\r",
+ "11 12 33\r",
+ "11 12 34\r",
+ "11 12 35\r",
+ "11 12 36\r",
+ "11 12 37\r",
+ "11 12 38\r",
+ "11 12 39\r",
+ "11 12 40\r",
+ "11 12 41\r",
+ "11 12 42\r",
+ "11 12 43\r",
+ "11 12 44\r",
+ "11 12 45\r",
+ "11 12 46\r",
+ "11 12 47\r",
+ "11 12 48\r",
+ "11 12 49\r",
+ "11 12 50\r",
+ "11 12 51\r",
+ "11 12 52\r",
+ "11 12 53\r",
+ "11 12 54\r",
+ "11 12 55\r",
+ "11 12 56\r",
+ "11 12 57\r",
+ "11 12 58\r",
+ "11 13 1\r",
+ "11 13 2\r",
+ "11 13 3\r",
+ "11 13 4\r",
+ "11 13 5\r",
+ "11 13 6\r",
+ "11 13 7\r",
+ "11 13 8\r",
+ "11 13 9\r",
+ "11 13 10\r",
+ "11 13 11\r",
+ "11 13 12\r",
+ "11 13 13\r",
+ "11 13 14\r",
+ "11 13 15\r",
+ "11 13 16\r",
+ "11 13 17\r",
+ "11 13 18\r",
+ "11 13 19\r",
+ "11 13 20\r",
+ "11 13 21\r",
+ "11 13 22\r",
+ "11 13 23\r",
+ "11 13 24\r",
+ "11 13 25\r",
+ "11 13 26\r",
+ "11 13 27\r",
+ "11 13 28\r",
+ "11 13 29\r",
+ "11 13 30\r",
+ "11 13 31\r",
+ "11 13 32\r",
+ "11 13 33\r",
+ "11 13 34\r",
+ "11 13 35\r",
+ "11 13 36\r",
+ "11 13 37\r",
+ "11 13 38\r",
+ "11 13 39\r",
+ "11 13 40\r",
+ "11 13 41\r",
+ "11 13 42\r",
+ "11 13 43\r",
+ "11 13 44\r",
+ "11 13 45\r",
+ "11 13 46\r",
+ "11 13 47\r",
+ "11 13 48\r",
+ "11 13 49\r",
+ "11 13 50\r",
+ "11 13 51\r",
+ "11 13 52\r",
+ "11 13 53\r",
+ "11 13 54\r",
+ "11 13 55\r",
+ "11 13 56\r",
+ "11 13 57\r",
+ "11 13 58\r",
+ "11 14 1\r",
+ "11 14 2\r",
+ "11 14 3\r",
+ "11 14 4\r",
+ "11 14 5\r",
+ "11 14 6\r",
+ "11 14 7\r",
+ "11 14 8\r",
+ "11 14 9\r",
+ "11 14 10\r",
+ "11 14 11\r",
+ "11 14 12\r",
+ "11 14 13\r",
+ "11 14 14\r",
+ "11 14 15\r",
+ "11 14 16\r",
+ "11 14 17\r",
+ "11 14 18\r",
+ "11 14 19\r",
+ "11 14 20\r",
+ "11 14 21\r",
+ "11 14 22\r",
+ "11 14 23\r",
+ "11 14 24\r",
+ "11 14 25\r",
+ "11 14 26\r",
+ "11 14 27\r",
+ "11 14 28\r",
+ "11 14 29\r",
+ "11 14 30\r",
+ "11 14 31\r",
+ "11 14 32\r",
+ "11 14 33\r",
+ "11 14 34\r",
+ "11 14 35\r",
+ "11 14 36\r",
+ "11 14 37\r",
+ "11 14 38\r",
+ "11 14 39\r",
+ "11 14 40\r",
+ "11 14 41\r",
+ "11 14 42\r",
+ "11 14 43\r",
+ "11 14 44\r",
+ "11 14 45\r",
+ "11 14 46\r",
+ "11 14 47\r",
+ "11 14 48\r",
+ "11 14 49\r",
+ "11 14 50\r",
+ "11 14 51\r",
+ "11 14 52\r",
+ "11 14 53\r",
+ "11 14 54\r",
+ "11 14 55\r",
+ "11 14 56\r",
+ "11 14 57\r",
+ "11 14 58\r",
+ "11 15 1\r",
+ "11 15 2\r",
+ "11 15 3\r",
+ "11 15 4\r",
+ "11 15 5\r",
+ "11 15 6\r",
+ "11 15 7\r",
+ "11 15 8\r",
+ "11 15 9\r",
+ "11 15 10\r",
+ "11 15 11\r",
+ "11 15 12\r",
+ "11 15 13\r",
+ "11 15 14\r",
+ "11 15 15\r",
+ "11 15 16\r",
+ "11 15 17\r",
+ "11 15 18\r",
+ "11 15 19\r",
+ "11 15 20\r",
+ "11 15 21\r",
+ "11 15 22\r",
+ "11 15 23\r",
+ "11 15 24\r",
+ "11 15 25\r",
+ "11 15 26\r",
+ "11 15 27\r",
+ "11 15 28\r",
+ "11 15 29\r",
+ "11 15 30\r",
+ "11 15 31\r",
+ "11 15 32\r",
+ "11 15 33\r",
+ "11 15 34\r",
+ "11 15 35\r",
+ "11 15 36\r",
+ "11 15 37\r",
+ "11 15 38\r",
+ "11 15 39\r",
+ "11 15 40\r",
+ "11 15 41\r",
+ "11 15 42\r",
+ "11 15 43\r",
+ "11 15 44\r",
+ "11 15 45\r",
+ "11 15 46\r",
+ "11 15 47\r",
+ "11 15 48\r",
+ "11 15 49\r",
+ "11 15 50\r",
+ "11 15 51\r",
+ "11 15 52\r",
+ "11 15 53\r",
+ "11 15 54\r",
+ "11 15 55\r",
+ "11 15 56\r",
+ "11 15 57\r",
+ "11 15 58\r",
+ "11 16 1\r",
+ "11 16 2\r",
+ "11 16 3\r",
+ "11 16 4\r",
+ "11 16 5\r",
+ "11 16 6\r",
+ "11 16 7\r",
+ "11 16 8\r",
+ "11 16 9\r",
+ "11 16 10\r",
+ "11 16 11\r",
+ "11 16 12\r",
+ "11 16 13\r",
+ "11 16 14\r",
+ "11 16 15\r",
+ "11 16 16\r",
+ "11 16 17\r",
+ "11 16 18\r",
+ "11 16 19\r",
+ "11 16 20\r",
+ "11 16 21\r",
+ "11 16 22\r",
+ "11 16 23\r",
+ "11 16 24\r",
+ "11 16 25\r",
+ "11 16 26\r",
+ "11 16 27\r",
+ "11 16 28\r",
+ "11 16 29\r",
+ "11 16 30\r",
+ "11 16 31\r",
+ "11 16 32\r",
+ "11 16 33\r",
+ "11 16 34\r",
+ "11 16 35\r",
+ "11 16 36\r",
+ "11 16 37\r",
+ "11 16 38\r",
+ "11 16 39\r",
+ "11 16 40\r",
+ "11 16 41\r",
+ "11 16 42\r",
+ "11 16 43\r",
+ "11 16 44\r",
+ "11 16 45\r",
+ "11 16 46\r",
+ "11 16 47\r",
+ "11 16 48\r",
+ "11 16 49\r",
+ "11 16 50\r",
+ "11 16 51\r",
+ "11 16 52\r",
+ "11 16 53\r",
+ "11 16 54\r",
+ "11 16 55\r",
+ "11 16 56\r",
+ "11 16 57\r",
+ "11 16 58\r",
+ "11 17 1\r",
+ "11 17 2\r",
+ "11 17 3\r",
+ "11 17 4\r",
+ "11 17 5\r",
+ "11 17 6\r",
+ "11 17 7\r",
+ "11 17 8\r",
+ "11 17 9\r",
+ "11 17 10\r",
+ "11 17 11\r",
+ "11 17 12\r",
+ "11 17 13\r",
+ "11 17 14\r",
+ "11 17 15\r",
+ "11 17 16\r",
+ "11 17 17\r",
+ "11 17 18\r",
+ "11 17 19\r",
+ "11 17 20\r",
+ "11 17 21\r",
+ "11 17 22\r",
+ "11 17 23\r",
+ "11 17 24\r",
+ "11 17 25\r",
+ "11 17 26\r",
+ "11 17 27\r",
+ "11 17 28\r",
+ "11 17 29\r",
+ "11 17 30\r",
+ "11 17 31\r",
+ "11 17 32\r",
+ "11 17 33\r",
+ "11 17 34\r",
+ "11 17 35\r",
+ "11 17 36\r",
+ "11 17 37\r",
+ "11 17 38\r",
+ "11 17 39\r",
+ "11 17 40\r",
+ "11 17 41\r",
+ "11 17 42\r",
+ "11 17 43\r",
+ "11 17 44\r",
+ "11 17 45\r",
+ "11 17 46\r",
+ "11 17 47\r",
+ "11 17 48\r",
+ "11 17 49\r",
+ "11 17 50\r",
+ "11 17 51\r",
+ "11 17 52\r",
+ "11 17 53\r",
+ "11 17 54\r",
+ "11 17 55\r",
+ "11 17 56\r",
+ "11 17 57\r",
+ "11 17 58\r",
+ "11 18 1\r",
+ "11 18 2\r",
+ "11 18 3\r",
+ "11 18 4\r",
+ "11 18 5\r",
+ "11 18 6\r",
+ "11 18 7\r",
+ "11 18 8\r",
+ "11 18 9\r",
+ "11 18 10\r",
+ "11 18 11\r",
+ "11 18 12\r",
+ "11 18 13\r",
+ "11 18 14\r",
+ "11 18 15\r",
+ "11 18 16\r",
+ "11 18 17\r",
+ "11 18 18\r",
+ "11 18 19\r",
+ "11 18 20\r",
+ "11 18 21\r",
+ "11 18 22\r",
+ "11 18 23\r",
+ "11 18 24\r",
+ "11 18 25\r",
+ "11 18 26\r",
+ "11 18 27\r",
+ "11 18 28\r",
+ "11 18 29\r",
+ "11 18 30\r",
+ "11 18 31\r",
+ "11 18 32\r",
+ "11 18 33\r",
+ "11 18 34\r",
+ "11 18 35\r",
+ "11 18 36\r",
+ "11 18 37\r",
+ "11 18 38\r",
+ "11 18 39\r",
+ "11 18 40\r",
+ "11 18 41\r",
+ "11 18 42\r",
+ "11 18 43\r",
+ "11 18 44\r",
+ "11 18 45\r",
+ "11 18 46\r",
+ "11 18 47\r",
+ "11 18 48\r",
+ "11 18 49\r",
+ "11 18 50\r",
+ "11 18 51\r",
+ "11 18 52\r",
+ "11 18 53\r",
+ "11 18 54\r",
+ "11 18 55\r",
+ "11 18 56\r",
+ "11 18 57\r",
+ "11 18 58\r",
+ "11 19 1\r",
+ "11 19 2\r",
+ "11 19 3\r",
+ "11 19 4\r",
+ "11 19 5\r",
+ "11 19 6\r",
+ "11 19 7\r",
+ "11 19 8\r",
+ "11 19 9\r",
+ "11 19 10\r",
+ "11 19 11\r",
+ "11 19 12\r",
+ "11 19 13\r",
+ "11 19 14\r",
+ "11 19 15\r",
+ "11 19 16\r",
+ "11 19 17\r",
+ "11 19 18\r",
+ "11 19 19\r",
+ "11 19 20\r",
+ "11 19 21\r",
+ "11 19 22\r",
+ "11 19 23\r",
+ "11 19 24\r",
+ "11 19 25\r",
+ "11 19 26\r",
+ "11 19 27\r",
+ "11 19 28\r",
+ "11 19 29\r",
+ "11 19 30\r",
+ "11 19 31\r",
+ "11 19 32\r",
+ "11 19 33\r",
+ "11 19 34\r",
+ "11 19 35\r",
+ "11 19 36\r",
+ "11 19 37\r",
+ "11 19 38\r",
+ "11 19 39\r",
+ "11 19 40\r",
+ "11 19 41\r",
+ "11 19 42\r",
+ "11 19 43\r",
+ "11 19 44\r",
+ "11 19 45\r",
+ "11 19 46\r",
+ "11 19 47\r",
+ "11 19 48\r",
+ "11 19 49\r",
+ "11 19 50\r",
+ "11 19 51\r",
+ "11 19 52\r",
+ "11 19 53\r",
+ "11 19 54\r",
+ "11 19 55\r",
+ "11 19 56\r",
+ "11 19 57\r",
+ "11 19 58\r",
+ "11 20 1\r",
+ "11 20 2\r",
+ "11 20 3\r",
+ "11 20 4\r",
+ "11 20 5\r",
+ "11 20 6\r",
+ "11 20 7\r",
+ "11 20 8\r",
+ "11 20 9\r",
+ "11 20 10\r",
+ "11 20 11\r",
+ "11 20 12\r",
+ "11 20 13\r",
+ "11 20 14\r",
+ "11 20 15\r",
+ "11 20 16\r",
+ "11 20 17\r",
+ "11 20 18\r",
+ "11 20 19\r",
+ "11 20 20\r",
+ "11 20 21\r",
+ "11 20 22\r",
+ "11 20 23\r",
+ "11 20 24\r",
+ "11 20 25\r",
+ "11 20 26\r",
+ "11 20 27\r",
+ "11 20 28\r",
+ "11 20 29\r",
+ "11 20 30\r",
+ "11 20 31\r",
+ "11 20 32\r",
+ "11 20 33\r",
+ "11 20 34\r",
+ "11 20 35\r",
+ "11 20 36\r",
+ "11 20 37\r",
+ "11 20 38\r",
+ "11 20 39\r",
+ "11 20 40\r",
+ "11 20 41\r",
+ "11 20 42\r",
+ "11 20 43\r",
+ "11 20 44\r",
+ "11 20 45\r",
+ "11 20 46\r",
+ "11 20 47\r",
+ "11 20 48\r",
+ "11 20 49\r",
+ "11 20 50\r",
+ "11 20 51\r",
+ "11 20 52\r",
+ "11 20 53\r",
+ "11 20 54\r",
+ "11 20 55\r",
+ "11 20 56\r",
+ "11 20 57\r",
+ "11 20 58\r",
+ "11 21 1\r",
+ "11 21 2\r",
+ "11 21 3\r",
+ "11 21 4\r",
+ "11 21 5\r",
+ "11 21 6\r",
+ "11 21 7\r",
+ "11 21 8\r",
+ "11 21 9\r",
+ "11 21 10\r",
+ "11 21 11\r",
+ "11 21 12\r",
+ "11 21 13\r",
+ "11 21 14\r",
+ "11 21 15\r",
+ "11 21 16\r",
+ "11 21 17\r",
+ "11 21 18\r",
+ "11 21 19\r",
+ "11 21 20\r",
+ "11 21 21\r",
+ "11 21 22\r",
+ "11 21 23\r",
+ "11 21 24\r",
+ "11 21 25\r",
+ "11 21 26\r",
+ "11 21 27\r",
+ "11 21 28\r",
+ "11 21 29\r",
+ "11 21 30\r",
+ "11 21 31\r",
+ "11 21 32\r",
+ "11 21 33\r",
+ "11 21 34\r",
+ "11 21 35\r",
+ "11 21 36\r",
+ "11 21 37\r",
+ "11 21 38\r",
+ "11 21 39\r",
+ "11 21 40\r",
+ "11 21 41\r",
+ "11 21 42\r",
+ "11 21 43\r",
+ "11 21 44\r",
+ "11 21 45\r",
+ "11 21 46\r",
+ "11 21 47\r",
+ "11 21 48\r",
+ "11 21 49\r",
+ "11 21 50\r",
+ "11 21 51\r",
+ "11 21 52\r",
+ "11 21 53\r",
+ "11 21 54\r",
+ "11 21 55\r",
+ "11 21 56\r",
+ "11 21 57\r",
+ "11 21 58\r",
+ "11 22 1\r",
+ "11 22 2\r",
+ "11 22 3\r",
+ "11 22 4\r",
+ "11 22 5\r",
+ "11 22 6\r",
+ "11 22 7\r",
+ "11 22 8\r",
+ "11 22 9\r",
+ "11 22 10\r",
+ "11 22 11\r",
+ "11 22 12\r",
+ "11 22 13\r",
+ "11 22 14\r",
+ "11 22 15\r",
+ "11 22 16\r",
+ "11 22 17\r",
+ "11 22 18\r",
+ "11 22 19\r",
+ "11 22 20\r",
+ "11 22 21\r",
+ "11 22 22\r",
+ "11 22 23\r",
+ "11 22 24\r",
+ "11 22 25\r",
+ "11 22 26\r",
+ "11 22 27\r",
+ "11 22 28\r",
+ "11 22 29\r",
+ "11 22 30\r",
+ "11 22 31\r",
+ "11 22 32\r",
+ "11 22 33\r",
+ "11 22 34\r",
+ "11 22 35\r",
+ "11 22 36\r",
+ "11 22 37\r",
+ "11 22 38\r",
+ "11 22 39\r",
+ "11 22 40\r",
+ "11 22 41\r",
+ "11 22 42\r",
+ "11 22 43\r",
+ "11 22 44\r",
+ "11 22 45\r",
+ "11 22 46\r",
+ "11 22 47\r",
+ "11 22 48\r",
+ "11 22 49\r",
+ "11 22 50\r",
+ "11 22 51\r",
+ "11 22 52\r",
+ "11 22 53\r",
+ "11 22 54\r",
+ "11 22 55\r",
+ "11 22 56\r",
+ "11 22 57\r",
+ "11 22 58\r",
+ "11 23 1\r",
+ "11 23 2\r",
+ "11 23 3\r",
+ "11 23 4\r",
+ "11 23 5\r",
+ "11 23 6\r",
+ "11 23 7\r",
+ "11 23 8\r",
+ "11 23 9\r",
+ "11 23 10\r",
+ "11 23 11\r",
+ "11 23 12\r",
+ "11 23 13\r",
+ "11 23 14\r",
+ "11 23 15\r",
+ "11 23 16\r",
+ "11 23 17\r",
+ "11 23 18\r",
+ "11 23 19\r",
+ "11 23 20\r",
+ "11 23 21\r",
+ "11 23 22\r",
+ "11 23 23\r",
+ "11 23 24\r",
+ "11 23 25\r",
+ "11 23 26\r",
+ "11 23 27\r",
+ "11 23 28\r",
+ "11 23 29\r",
+ "11 23 30\r",
+ "11 23 31\r",
+ "11 23 32\r",
+ "11 23 33\r",
+ "11 23 34\r",
+ "11 23 35\r",
+ "11 23 36\r",
+ "11 23 37\r",
+ "11 23 38\r",
+ "11 23 39\r",
+ "11 23 40\r",
+ "11 23 41\r",
+ "11 23 42\r",
+ "11 23 43\r",
+ "11 23 44\r",
+ "11 23 45\r",
+ "11 23 46\r",
+ "11 23 47\r",
+ "11 23 48\r",
+ "11 23 49\r",
+ "11 23 50\r",
+ "11 23 51\r",
+ "11 23 52\r",
+ "11 23 53\r",
+ "11 23 54\r",
+ "11 23 55\r",
+ "11 23 56\r",
+ "11 23 57\r",
+ "11 23 58\r",
+ "11 24 1\r",
+ "11 24 2\r",
+ "11 24 3\r",
+ "11 24 4\r",
+ "11 24 5\r",
+ "11 24 6\r",
+ "11 24 7\r",
+ "11 24 8\r",
+ "11 24 9\r",
+ "11 24 10\r",
+ "11 24 11\r",
+ "11 24 12\r",
+ "11 24 13\r",
+ "11 24 14\r",
+ "11 24 15\r",
+ "11 24 16\r",
+ "11 24 17\r",
+ "11 24 18\r",
+ "11 24 19\r",
+ "11 24 20\r",
+ "11 24 21\r",
+ "11 24 22\r",
+ "11 24 23\r",
+ "11 24 24\r",
+ "11 24 25\r",
+ "11 24 26\r",
+ "11 24 27\r",
+ "11 24 28\r",
+ "11 24 29\r",
+ "11 24 30\r",
+ "11 24 31\r",
+ "11 24 32\r",
+ "11 24 33\r",
+ "11 24 34\r",
+ "11 24 35\r",
+ "11 24 36\r",
+ "11 24 37\r",
+ "11 24 38\r",
+ "11 24 39\r",
+ "11 24 40\r",
+ "11 24 41\r",
+ "11 24 42\r",
+ "11 24 43\r",
+ "11 24 44\r",
+ "11 24 45\r",
+ "11 24 46\r",
+ "11 24 47\r",
+ "11 24 48\r",
+ "11 24 49\r",
+ "11 24 50\r",
+ "11 24 51\r",
+ "11 24 52\r",
+ "11 24 53\r",
+ "11 24 54\r",
+ "11 24 55\r",
+ "11 24 56\r",
+ "11 24 57\r",
+ "11 24 58\r",
+ "11 25 1\r",
+ "11 25 2\r",
+ "11 25 3\r",
+ "11 25 4\r",
+ "11 25 5\r",
+ "11 25 6\r",
+ "11 25 7\r",
+ "11 25 8\r",
+ "11 25 9\r",
+ "11 25 10\r",
+ "11 25 11\r",
+ "11 25 12\r",
+ "11 25 13\r",
+ "11 25 14\r",
+ "11 25 15\r",
+ "11 25 16\r",
+ "11 25 17\r",
+ "11 25 18\r",
+ "11 25 19\r",
+ "11 25 20\r",
+ "11 25 21\r",
+ "11 25 22\r",
+ "11 25 23\r",
+ "11 25 24\r",
+ "11 25 25\r",
+ "11 25 26\r",
+ "11 25 27\r",
+ "11 25 28\r",
+ "11 25 29\r",
+ "11 25 30\r",
+ "11 25 31\r",
+ "11 25 32\r",
+ "11 25 33\r",
+ "11 25 34\r",
+ "11 25 35\r",
+ "11 25 36\r",
+ "11 25 37\r",
+ "11 25 38\r",
+ "11 25 39\r",
+ "11 25 40\r",
+ "11 25 41\r",
+ "11 25 42\r",
+ "11 25 43\r",
+ "11 25 44\r",
+ "11 25 45\r",
+ "11 25 46\r",
+ "11 25 47\r",
+ "11 25 48\r",
+ "11 25 49\r",
+ "11 25 50\r",
+ "11 25 51\r",
+ "11 25 52\r",
+ "11 25 53\r",
+ "11 25 54\r",
+ "11 25 55\r",
+ "11 25 56\r",
+ "11 25 57\r",
+ "11 25 58\r",
+ "11 26 1\r",
+ "11 26 2\r",
+ "11 26 3\r",
+ "11 26 4\r",
+ "11 26 5\r",
+ "11 26 6\r",
+ "11 26 7\r",
+ "11 26 8\r",
+ "11 26 9\r",
+ "11 26 10\r",
+ "11 26 11\r",
+ "11 26 12\r",
+ "11 26 13\r",
+ "11 26 14\r",
+ "11 26 15\r",
+ "11 26 16\r",
+ "11 26 17\r",
+ "11 26 18\r",
+ "11 26 19\r",
+ "11 26 20\r",
+ "11 26 21\r",
+ "11 26 22\r",
+ "11 26 23\r",
+ "11 26 24\r",
+ "11 26 25\r",
+ "11 26 26\r",
+ "11 26 27\r",
+ "11 26 28\r",
+ "11 26 29\r",
+ "11 26 30\r",
+ "11 26 31\r",
+ "11 26 32\r",
+ "11 26 33\r",
+ "11 26 34\r",
+ "11 26 35\r",
+ "11 26 36\r",
+ "11 26 37\r",
+ "11 26 38\r",
+ "11 26 39\r",
+ "11 26 40\r",
+ "11 26 41\r",
+ "11 26 42\r",
+ "11 26 43\r",
+ "11 26 44\r",
+ "11 26 45\r",
+ "11 26 46\r",
+ "11 26 47\r",
+ "11 26 48\r",
+ "11 26 49\r",
+ "11 26 50\r",
+ "11 26 51\r",
+ "11 26 52\r",
+ "11 26 53\r",
+ "11 26 54\r",
+ "11 26 55\r",
+ "11 26 56\r",
+ "11 26 57\r",
+ "11 26 58\r",
+ "11 27 1\r",
+ "11 27 2\r",
+ "11 27 3\r",
+ "11 27 4\r",
+ "11 27 5\r",
+ "11 27 6\r",
+ "11 27 7\r",
+ "11 27 8\r",
+ "11 27 9\r",
+ "11 27 10\r",
+ "11 27 11\r",
+ "11 27 12\r",
+ "11 27 13\r",
+ "11 27 14\r",
+ "11 27 15\r",
+ "11 27 16\r",
+ "11 27 17\r",
+ "11 27 18\r",
+ "11 27 19\r",
+ "11 27 20\r",
+ "11 27 21\r",
+ "11 27 22\r",
+ "11 27 23\r",
+ "11 27 24\r",
+ "11 27 25\r",
+ "11 27 26\r",
+ "11 27 27\r",
+ "11 27 28\r",
+ "11 27 29\r",
+ "11 27 30\r",
+ "11 27 31\r",
+ "11 27 32\r",
+ "11 27 33\r",
+ "11 27 34\r",
+ "11 27 35\r",
+ "11 27 36\r",
+ "11 27 37\r",
+ "11 27 38\r",
+ "11 27 39\r",
+ "11 27 40\r",
+ "11 27 41\r",
+ "11 27 42\r",
+ "11 27 43\r",
+ "11 27 44\r",
+ "11 27 45\r",
+ "11 27 46\r",
+ "11 27 47\r",
+ "11 27 48\r",
+ "11 27 49\r",
+ "11 27 50\r",
+ "11 27 51\r",
+ "11 27 52\r",
+ "11 27 53\r",
+ "11 27 54\r",
+ "11 27 55\r",
+ "11 27 56\r",
+ "11 27 57\r",
+ "11 27 58\r",
+ "11 28 1\r",
+ "11 28 2\r",
+ "11 28 3\r",
+ "11 28 4\r",
+ "11 28 5\r",
+ "11 28 6\r",
+ "11 28 7\r",
+ "11 28 8\r",
+ "11 28 9\r",
+ "11 28 10\r",
+ "11 28 11\r",
+ "11 28 12\r",
+ "11 28 13\r",
+ "11 28 14\r",
+ "11 28 15\r",
+ "11 28 16\r",
+ "11 28 17\r",
+ "11 28 18\r",
+ "11 28 19\r",
+ "11 28 20\r",
+ "11 28 21\r",
+ "11 28 22\r",
+ "11 28 23\r",
+ "11 28 24\r",
+ "11 28 25\r",
+ "11 28 26\r",
+ "11 28 27\r",
+ "11 28 28\r",
+ "11 28 29\r",
+ "11 28 30\r",
+ "11 28 31\r",
+ "11 28 32\r",
+ "11 28 33\r",
+ "11 28 34\r",
+ "11 28 35\r",
+ "11 28 36\r",
+ "11 28 37\r",
+ "11 28 38\r",
+ "11 28 39\r",
+ "11 28 40\r",
+ "11 28 41\r",
+ "11 28 42\r",
+ "11 28 43\r",
+ "11 28 44\r",
+ "11 28 45\r",
+ "11 28 46\r",
+ "11 28 47\r",
+ "11 28 48\r",
+ "11 28 49\r",
+ "11 28 50\r",
+ "11 28 51\r",
+ "11 28 52\r",
+ "11 28 53\r",
+ "11 28 54\r",
+ "11 28 55\r",
+ "11 28 56\r",
+ "11 28 57\r",
+ "11 28 58\r",
+ "11 29 1\r",
+ "11 29 2\r",
+ "11 29 3\r",
+ "11 29 4\r",
+ "11 29 5\r",
+ "11 29 6\r",
+ "11 29 7\r",
+ "11 29 8\r",
+ "11 29 9\r",
+ "11 29 10\r",
+ "11 29 11\r",
+ "11 29 12\r",
+ "11 29 13\r",
+ "11 29 14\r",
+ "11 29 15\r",
+ "11 29 16\r",
+ "11 29 17\r",
+ "11 29 18\r",
+ "11 29 19\r",
+ "11 29 20\r",
+ "11 29 21\r",
+ "11 29 22\r",
+ "11 29 23\r",
+ "11 29 24\r",
+ "11 29 25\r",
+ "11 29 26\r",
+ "11 29 27\r",
+ "11 29 28\r",
+ "11 29 29\r",
+ "11 29 30\r",
+ "11 29 31\r",
+ "11 29 32\r",
+ "11 29 33\r",
+ "11 29 34\r",
+ "11 29 35\r",
+ "11 29 36\r",
+ "11 29 37\r",
+ "11 29 38\r",
+ "11 29 39\r",
+ "11 29 40\r",
+ "11 29 41\r",
+ "11 29 42\r",
+ "11 29 43\r",
+ "11 29 44\r",
+ "11 29 45\r",
+ "11 29 46\r",
+ "11 29 47\r",
+ "11 29 48\r",
+ "11 29 49\r",
+ "11 29 50\r",
+ "11 29 51\r",
+ "11 29 52\r",
+ "11 29 53\r",
+ "11 29 54\r",
+ "11 29 55\r",
+ "11 29 56\r",
+ "11 29 57\r",
+ "11 29 58\r",
+ "11 30 1\r",
+ "11 30 2\r",
+ "11 30 3\r",
+ "11 30 4\r",
+ "11 30 5\r",
+ "11 30 6\r",
+ "11 30 7\r",
+ "11 30 8\r",
+ "11 30 9\r",
+ "11 30 10\r",
+ "11 30 11\r",
+ "11 30 12\r",
+ "11 30 13\r",
+ "11 30 14\r",
+ "11 30 15\r",
+ "11 30 16\r",
+ "11 30 17\r",
+ "11 30 18\r",
+ "11 30 19\r",
+ "11 30 20\r",
+ "11 30 21\r",
+ "11 30 22\r",
+ "11 30 23\r",
+ "11 30 24\r",
+ "11 30 25\r",
+ "11 30 26\r",
+ "11 30 27\r",
+ "11 30 28\r",
+ "11 30 29\r",
+ "11 30 30\r",
+ "11 30 31\r",
+ "11 30 32\r",
+ "11 30 33\r",
+ "11 30 34\r",
+ "11 30 35\r",
+ "11 30 36\r",
+ "11 30 37\r",
+ "11 30 38\r",
+ "11 30 39\r",
+ "11 30 40\r",
+ "11 30 41\r",
+ "11 30 42\r",
+ "11 30 43\r",
+ "11 30 44\r",
+ "11 30 45\r",
+ "11 30 46\r",
+ "11 30 47\r",
+ "11 30 48\r",
+ "11 30 49\r",
+ "11 30 50\r",
+ "11 30 51\r",
+ "11 30 52\r",
+ "11 30 53\r",
+ "11 30 54\r",
+ "11 30 55\r",
+ "11 30 56\r",
+ "11 30 57\r",
+ "11 30 58\r",
+ "11 31 1\r",
+ "11 31 2\r",
+ "11 31 3\r",
+ "11 31 4\r",
+ "11 31 5\r",
+ "11 31 6\r",
+ "11 31 7\r",
+ "11 31 8\r",
+ "11 31 9\r",
+ "11 31 10\r",
+ "11 31 11\r",
+ "11 31 12\r",
+ "11 31 13\r",
+ "11 31 14\r",
+ "11 31 15\r",
+ "11 31 16\r",
+ "11 31 17\r",
+ "11 31 18\r",
+ "11 31 19\r",
+ "11 31 20\r",
+ "11 31 21\r",
+ "11 31 22\r",
+ "11 31 23\r",
+ "11 31 24\r",
+ "11 31 25\r",
+ "11 31 26\r",
+ "11 31 27\r",
+ "11 31 28\r",
+ "11 31 29\r",
+ "11 31 30\r",
+ "11 31 31\r",
+ "11 31 32\r",
+ "11 31 33\r",
+ "11 31 34\r",
+ "11 31 35\r",
+ "11 31 36\r",
+ "11 31 37\r",
+ "11 31 38\r",
+ "11 31 39\r",
+ "11 31 40\r",
+ "11 31 41\r",
+ "11 31 42\r",
+ "11 31 43\r",
+ "11 31 44\r",
+ "11 31 45\r",
+ "11 31 46\r",
+ "11 31 47\r",
+ "11 31 48\r",
+ "11 31 49\r",
+ "11 31 50\r",
+ "11 31 51\r",
+ "11 31 52\r",
+ "11 31 53\r",
+ "11 31 54\r",
+ "11 31 55\r",
+ "11 31 56\r",
+ "11 31 57\r",
+ "11 31 58\r",
+ "11 32 1\r",
+ "11 32 2\r",
+ "11 32 3\r",
+ "11 32 4\r",
+ "11 32 5\r",
+ "11 32 6\r",
+ "11 32 7\r",
+ "11 32 8\r",
+ "11 32 9\r",
+ "11 32 10\r",
+ "11 32 11\r",
+ "11 32 12\r",
+ "11 32 13\r",
+ "11 32 14\r",
+ "11 32 15\r",
+ "11 32 16\r",
+ "11 32 17\r",
+ "11 32 18\r",
+ "11 32 19\r",
+ "11 32 20\r",
+ "11 32 21\r",
+ "11 32 22\r",
+ "11 32 23\r",
+ "11 32 24\r",
+ "11 32 25\r",
+ "11 32 26\r",
+ "11 32 27\r",
+ "11 32 28\r",
+ "11 32 29\r",
+ "11 32 30\r",
+ "11 32 31\r",
+ "11 32 32\r",
+ "11 32 33\r",
+ "11 32 34\r",
+ "11 32 35\r",
+ "11 32 36\r",
+ "11 32 37\r",
+ "11 32 38\r",
+ "11 32 39\r",
+ "11 32 40\r",
+ "11 32 41\r",
+ "11 32 42\r",
+ "11 32 43\r",
+ "11 32 44\r",
+ "11 32 45\r",
+ "11 32 46\r",
+ "11 32 47\r",
+ "11 32 48\r",
+ "11 32 49\r",
+ "11 32 50\r",
+ "11 32 51\r",
+ "11 32 52\r",
+ "11 32 53\r",
+ "11 32 54\r",
+ "11 32 55\r",
+ "11 32 56\r",
+ "11 32 57\r",
+ "11 32 58\r",
+ "11 33 1\r",
+ "11 33 2\r",
+ "11 33 3\r",
+ "11 33 4\r",
+ "11 33 5\r",
+ "11 33 6\r",
+ "11 33 7\r",
+ "11 33 8\r",
+ "11 33 9\r",
+ "11 33 10\r",
+ "11 33 11\r",
+ "11 33 12\r",
+ "11 33 13\r",
+ "11 33 14\r",
+ "11 33 15\r",
+ "11 33 16\r",
+ "11 33 17\r",
+ "11 33 18\r",
+ "11 33 19\r",
+ "11 33 20\r",
+ "11 33 21\r",
+ "11 33 22\r",
+ "11 33 23\r",
+ "11 33 24\r",
+ "11 33 25\r",
+ "11 33 26\r",
+ "11 33 27\r",
+ "11 33 28\r",
+ "11 33 29\r",
+ "11 33 30\r",
+ "11 33 31\r",
+ "11 33 32\r",
+ "11 33 33\r",
+ "11 33 34\r",
+ "11 33 35\r",
+ "11 33 36\r",
+ "11 33 37\r",
+ "11 33 38\r",
+ "11 33 39\r",
+ "11 33 40\r",
+ "11 33 41\r",
+ "11 33 42\r",
+ "11 33 43\r",
+ "11 33 44\r",
+ "11 33 45\r",
+ "11 33 46\r",
+ "11 33 47\r",
+ "11 33 48\r",
+ "11 33 49\r",
+ "11 33 50\r",
+ "11 33 51\r",
+ "11 33 52\r",
+ "11 33 53\r",
+ "11 33 54\r",
+ "11 33 55\r",
+ "11 33 56\r",
+ "11 33 57\r",
+ "11 33 58\r",
+ "11 34 1\r",
+ "11 34 2\r",
+ "11 34 3\r",
+ "11 34 4\r",
+ "11 34 5\r",
+ "11 34 6\r",
+ "11 34 7\r",
+ "11 34 8\r",
+ "11 34 9\r",
+ "11 34 10\r",
+ "11 34 11\r",
+ "11 34 12\r",
+ "11 34 13\r",
+ "11 34 14\r",
+ "11 34 15\r",
+ "11 34 16\r",
+ "11 34 17\r",
+ "11 34 18\r",
+ "11 34 19\r",
+ "11 34 20\r",
+ "11 34 21\r",
+ "11 34 22\r",
+ "11 34 23\r",
+ "11 34 24\r",
+ "11 34 25\r",
+ "11 34 26\r",
+ "11 34 27\r",
+ "11 34 28\r",
+ "11 34 29\r",
+ "11 34 30\r",
+ "11 34 31\r",
+ "11 34 32\r",
+ "11 34 33\r",
+ "11 34 34\r",
+ "11 34 35\r",
+ "11 34 36\r",
+ "11 34 37\r",
+ "11 34 38\r",
+ "11 34 39\r",
+ "11 34 40\r",
+ "11 34 41\r",
+ "11 34 42\r",
+ "11 34 43\r",
+ "11 34 44\r",
+ "11 34 45\r",
+ "11 34 46\r",
+ "11 34 47\r",
+ "11 34 48\r",
+ "11 34 49\r",
+ "11 34 50\r",
+ "11 34 51\r",
+ "11 34 52\r",
+ "11 34 53\r",
+ "11 34 54\r",
+ "11 34 55\r",
+ "11 34 56\r",
+ "11 34 57\r",
+ "11 34 58\r",
+ "11 35 1\r",
+ "11 35 2\r",
+ "11 35 3\r",
+ "11 35 4\r",
+ "11 35 5\r",
+ "11 35 6\r",
+ "11 35 7\r",
+ "11 35 8\r",
+ "11 35 9\r",
+ "11 35 10\r",
+ "11 35 11\r",
+ "11 35 12\r",
+ "11 35 13\r",
+ "11 35 14\r",
+ "11 35 15\r",
+ "11 35 16\r",
+ "11 35 17\r",
+ "11 35 18\r",
+ "11 35 19\r",
+ "11 35 20\r",
+ "11 35 21\r",
+ "11 35 22\r",
+ "11 35 23\r",
+ "11 35 24\r",
+ "11 35 25\r",
+ "11 35 26\r",
+ "11 35 27\r",
+ "11 35 28\r",
+ "11 35 29\r",
+ "11 35 30\r",
+ "11 35 31\r",
+ "11 35 32\r",
+ "11 35 33\r",
+ "11 35 34\r",
+ "11 35 35\r",
+ "11 35 36\r",
+ "11 35 37\r",
+ "11 35 38\r",
+ "11 35 39\r",
+ "11 35 40\r",
+ "11 35 41\r",
+ "11 35 42\r",
+ "11 35 43\r",
+ "11 35 44\r",
+ "11 35 45\r",
+ "11 35 46\r",
+ "11 35 47\r",
+ "11 35 48\r",
+ "11 35 49\r",
+ "11 35 50\r",
+ "11 35 51\r",
+ "11 35 52\r",
+ "11 35 53\r",
+ "11 35 54\r",
+ "11 35 55\r",
+ "11 35 56\r",
+ "11 35 57\r",
+ "11 35 58\r",
+ "11 36 1\r",
+ "11 36 2\r",
+ "11 36 3\r",
+ "11 36 4\r",
+ "11 36 5\r",
+ "11 36 6\r",
+ "11 36 7\r",
+ "11 36 8\r",
+ "11 36 9\r",
+ "11 36 10\r",
+ "11 36 11\r",
+ "11 36 12\r",
+ "11 36 13\r",
+ "11 36 14\r",
+ "11 36 15\r",
+ "11 36 16\r",
+ "11 36 17\r",
+ "11 36 18\r",
+ "11 36 19\r",
+ "11 36 20\r",
+ "11 36 21\r",
+ "11 36 22\r",
+ "11 36 23\r",
+ "11 36 24\r",
+ "11 36 25\r",
+ "11 36 26\r",
+ "11 36 27\r",
+ "11 36 28\r",
+ "11 36 29\r",
+ "11 36 30\r",
+ "11 36 31\r",
+ "11 36 32\r",
+ "11 36 33\r",
+ "11 36 34\r",
+ "11 36 35\r",
+ "11 36 36\r",
+ "11 36 37\r",
+ "11 36 38\r",
+ "11 36 39\r",
+ "11 36 40\r",
+ "11 36 41\r",
+ "11 36 42\r",
+ "11 36 43\r",
+ "11 36 44\r",
+ "11 36 45\r",
+ "11 36 46\r",
+ "11 36 47\r",
+ "11 36 48\r",
+ "11 36 49\r",
+ "11 36 50\r",
+ "11 36 51\r",
+ "11 36 52\r",
+ "11 36 53\r",
+ "11 36 54\r",
+ "11 36 55\r",
+ "11 36 56\r",
+ "11 36 57\r",
+ "11 36 58\r",
+ "11 37 1\r",
+ "11 37 2\r",
+ "11 37 3\r",
+ "11 37 4\r",
+ "11 37 5\r",
+ "11 37 6\r",
+ "11 37 7\r",
+ "11 37 8\r",
+ "11 37 9\r",
+ "11 37 10\r",
+ "11 37 11\r",
+ "11 37 12\r",
+ "11 37 13\r",
+ "11 37 14\r",
+ "11 37 15\r",
+ "11 37 16\r",
+ "11 37 17\r",
+ "11 37 18\r",
+ "11 37 19\r",
+ "11 37 20\r",
+ "11 37 21\r",
+ "11 37 22\r",
+ "11 37 23\r",
+ "11 37 24\r",
+ "11 37 25\r",
+ "11 37 26\r",
+ "11 37 27\r",
+ "11 37 28\r",
+ "11 37 29\r",
+ "11 37 30\r",
+ "11 37 31\r",
+ "11 37 32\r",
+ "11 37 33\r",
+ "11 37 34\r",
+ "11 37 35\r",
+ "11 37 36\r",
+ "11 37 37\r",
+ "11 37 38\r",
+ "11 37 39\r",
+ "11 37 40\r",
+ "11 37 41\r",
+ "11 37 42\r",
+ "11 37 43\r",
+ "11 37 44\r",
+ "11 37 45\r",
+ "11 37 46\r",
+ "11 37 47\r",
+ "11 37 48\r",
+ "11 37 49\r",
+ "11 37 50\r",
+ "11 37 51\r",
+ "11 37 52\r",
+ "11 37 53\r",
+ "11 37 54\r",
+ "11 37 55\r",
+ "11 37 56\r",
+ "11 37 57\r",
+ "11 37 58\r",
+ "11 38 1\r",
+ "11 38 2\r",
+ "11 38 3\r",
+ "11 38 4\r",
+ "11 38 5\r",
+ "11 38 6\r",
+ "11 38 7\r",
+ "11 38 8\r",
+ "11 38 9\r",
+ "11 38 10\r",
+ "11 38 11\r",
+ "11 38 12\r",
+ "11 38 13\r",
+ "11 38 14\r",
+ "11 38 15\r",
+ "11 38 16\r",
+ "11 38 17\r",
+ "11 38 18\r",
+ "11 38 19\r",
+ "11 38 20\r",
+ "11 38 21\r",
+ "11 38 22\r",
+ "11 38 23\r",
+ "11 38 24\r",
+ "11 38 25\r",
+ "11 38 26\r",
+ "11 38 27\r",
+ "11 38 28\r",
+ "11 38 29\r",
+ "11 38 30\r",
+ "11 38 31\r",
+ "11 38 32\r",
+ "11 38 33\r",
+ "11 38 34\r",
+ "11 38 35\r",
+ "11 38 36\r",
+ "11 38 37\r",
+ "11 38 38\r",
+ "11 38 39\r",
+ "11 38 40\r",
+ "11 38 41\r",
+ "11 38 42\r",
+ "11 38 43\r",
+ "11 38 44\r",
+ "11 38 45\r",
+ "11 38 46\r",
+ "11 38 47\r",
+ "11 38 48\r",
+ "11 38 49\r",
+ "11 38 50\r",
+ "11 38 51\r",
+ "11 38 52\r",
+ "11 38 53\r",
+ "11 38 54\r",
+ "11 38 55\r",
+ "11 38 56\r",
+ "11 38 57\r",
+ "11 38 58\r",
+ "11 39 1\r",
+ "11 39 2\r",
+ "11 39 3\r",
+ "11 39 4\r",
+ "11 39 5\r",
+ "11 39 6\r",
+ "11 39 7\r",
+ "11 39 8\r",
+ "11 39 9\r",
+ "11 39 10\r",
+ "11 39 11\r",
+ "11 39 12\r",
+ "11 39 13\r",
+ "11 39 14\r",
+ "11 39 15\r",
+ "11 39 16\r",
+ "11 39 17\r",
+ "11 39 18\r",
+ "11 39 19\r",
+ "11 39 20\r",
+ "11 39 21\r",
+ "11 39 22\r",
+ "11 39 23\r",
+ "11 39 24\r",
+ "11 39 25\r",
+ "11 39 26\r",
+ "11 39 27\r",
+ "11 39 28\r",
+ "11 39 29\r",
+ "11 39 30\r",
+ "11 39 31\r",
+ "11 39 32\r",
+ "11 39 33\r",
+ "11 39 34\r",
+ "11 39 35\r",
+ "11 39 36\r",
+ "11 39 37\r",
+ "11 39 38\r",
+ "11 39 39\r",
+ "11 39 40\r",
+ "11 39 41\r",
+ "11 39 42\r",
+ "11 39 43\r",
+ "11 39 44\r",
+ "11 39 45\r",
+ "11 39 46\r",
+ "11 39 47\r",
+ "11 39 48\r",
+ "11 39 49\r",
+ "11 39 50\r",
+ "11 39 51\r",
+ "11 39 52\r",
+ "11 39 53\r",
+ "11 39 54\r",
+ "11 39 55\r",
+ "11 39 56\r",
+ "11 39 57\r",
+ "11 39 58\r",
+ "11 40 1\r",
+ "11 40 2\r",
+ "11 40 3\r",
+ "11 40 4\r",
+ "11 40 5\r",
+ "11 40 6\r",
+ "11 40 7\r",
+ "11 40 8\r",
+ "11 40 9\r",
+ "11 40 10\r",
+ "11 40 11\r",
+ "11 40 12\r",
+ "11 40 13\r",
+ "11 40 14\r",
+ "11 40 15\r",
+ "11 40 16\r",
+ "11 40 17\r",
+ "11 40 18\r",
+ "11 40 19\r",
+ "11 40 20\r",
+ "11 40 21\r",
+ "11 40 22\r",
+ "11 40 23\r",
+ "11 40 24\r",
+ "11 40 25\r",
+ "11 40 26\r",
+ "11 40 27\r",
+ "11 40 28\r",
+ "11 40 29\r",
+ "11 40 30\r",
+ "11 40 31\r",
+ "11 40 32\r",
+ "11 40 33\r",
+ "11 40 34\r",
+ "11 40 35\r",
+ "11 40 36\r",
+ "11 40 37\r",
+ "11 40 38\r",
+ "11 40 39\r",
+ "11 40 40\r",
+ "11 40 41\r",
+ "11 40 42\r",
+ "11 40 43\r",
+ "11 40 44\r",
+ "11 40 45\r",
+ "11 40 46\r",
+ "11 40 47\r",
+ "11 40 48\r",
+ "11 40 49\r",
+ "11 40 50\r",
+ "11 40 51\r",
+ "11 40 52\r",
+ "11 40 53\r",
+ "11 40 54\r",
+ "11 40 55\r",
+ "11 40 56\r",
+ "11 40 57\r",
+ "11 40 58\r",
+ "11 41 1\r",
+ "11 41 2\r",
+ "11 41 3\r",
+ "11 41 4\r",
+ "11 41 5\r",
+ "11 41 6\r",
+ "11 41 7\r",
+ "11 41 8\r",
+ "11 41 9\r",
+ "11 41 10\r",
+ "11 41 11\r",
+ "11 41 12\r",
+ "11 41 13\r",
+ "11 41 14\r",
+ "11 41 15\r",
+ "11 41 16\r",
+ "11 41 17\r",
+ "11 41 18\r",
+ "11 41 19\r",
+ "11 41 20\r",
+ "11 41 21\r",
+ "11 41 22\r",
+ "11 41 23\r",
+ "11 41 24\r",
+ "11 41 25\r",
+ "11 41 26\r",
+ "11 41 27\r",
+ "11 41 28\r",
+ "11 41 29\r",
+ "11 41 30\r",
+ "11 41 31\r",
+ "11 41 32\r",
+ "11 41 33\r",
+ "11 41 34\r",
+ "11 41 35\r",
+ "11 41 36\r",
+ "11 41 37\r",
+ "11 41 38\r",
+ "11 41 39\r",
+ "11 41 40\r",
+ "11 41 41\r",
+ "11 41 42\r",
+ "11 41 43\r",
+ "11 41 44\r",
+ "11 41 45\r",
+ "11 41 46\r",
+ "11 41 47\r",
+ "11 41 48\r",
+ "11 41 49\r",
+ "11 41 50\r",
+ "11 41 51\r",
+ "11 41 52\r",
+ "11 41 53\r",
+ "11 41 54\r",
+ "11 41 55\r",
+ "11 41 56\r",
+ "11 41 57\r",
+ "11 41 58\r",
+ "11 42 1\r",
+ "11 42 2\r",
+ "11 42 3\r",
+ "11 42 4\r",
+ "11 42 5\r",
+ "11 42 6\r",
+ "11 42 7\r",
+ "11 42 8\r",
+ "11 42 9\r",
+ "11 42 10\r",
+ "11 42 11\r",
+ "11 42 12\r",
+ "11 42 13\r",
+ "11 42 14\r",
+ "11 42 15\r",
+ "11 42 16\r",
+ "11 42 17\r",
+ "11 42 18\r",
+ "11 42 19\r",
+ "11 42 20\r",
+ "11 42 21\r",
+ "11 42 22\r",
+ "11 42 23\r",
+ "11 42 24\r",
+ "11 42 25\r",
+ "11 42 26\r",
+ "11 42 27\r",
+ "11 42 28\r",
+ "11 42 29\r",
+ "11 42 30\r",
+ "11 42 31\r",
+ "11 42 32\r",
+ "11 42 33\r",
+ "11 42 34\r",
+ "11 42 35\r",
+ "11 42 36\r",
+ "11 42 37\r",
+ "11 42 38\r",
+ "11 42 39\r",
+ "11 42 40\r",
+ "11 42 41\r",
+ "11 42 42\r",
+ "11 42 43\r",
+ "11 42 44\r",
+ "11 42 45\r",
+ "11 42 46\r",
+ "11 42 47\r",
+ "11 42 48\r",
+ "11 42 49\r",
+ "11 42 50\r",
+ "11 42 51\r",
+ "11 42 52\r",
+ "11 42 53\r",
+ "11 42 54\r",
+ "11 42 55\r",
+ "11 42 56\r",
+ "11 42 57\r",
+ "11 42 58\r",
+ "11 43 1\r",
+ "11 43 2\r",
+ "11 43 3\r",
+ "11 43 4\r",
+ "11 43 5\r",
+ "11 43 6\r",
+ "11 43 7\r",
+ "11 43 8\r",
+ "11 43 9\r",
+ "11 43 10\r",
+ "11 43 11\r",
+ "11 43 12\r",
+ "11 43 13\r",
+ "11 43 14\r",
+ "11 43 15\r",
+ "11 43 16\r",
+ "11 43 17\r",
+ "11 43 18\r",
+ "11 43 19\r",
+ "11 43 20\r",
+ "11 43 21\r",
+ "11 43 22\r",
+ "11 43 23\r",
+ "11 43 24\r",
+ "11 43 25\r",
+ "11 43 26\r",
+ "11 43 27\r",
+ "11 43 28\r",
+ "11 43 29\r",
+ "11 43 30\r",
+ "11 43 31\r",
+ "11 43 32\r",
+ "11 43 33\r",
+ "11 43 34\r",
+ "11 43 35\r",
+ "11 43 36\r",
+ "11 43 37\r",
+ "11 43 38\r",
+ "11 43 39\r",
+ "11 43 40\r",
+ "11 43 41\r",
+ "11 43 42\r",
+ "11 43 43\r",
+ "11 43 44\r",
+ "11 43 45\r",
+ "11 43 46\r",
+ "11 43 47\r",
+ "11 43 48\r",
+ "11 43 49\r",
+ "11 43 50\r",
+ "11 43 51\r",
+ "11 43 52\r",
+ "11 43 53\r",
+ "11 43 54\r",
+ "11 43 55\r",
+ "11 43 56\r",
+ "11 43 57\r",
+ "11 43 58\r",
+ "11 44 1\r",
+ "11 44 2\r",
+ "11 44 3\r",
+ "11 44 4\r",
+ "11 44 5\r",
+ "11 44 6\r",
+ "11 44 7\r",
+ "11 44 8\r",
+ "11 44 9\r",
+ "11 44 10\r",
+ "11 44 11\r",
+ "11 44 12\r",
+ "11 44 13\r",
+ "11 44 14\r",
+ "11 44 15\r",
+ "11 44 16\r",
+ "11 44 17\r",
+ "11 44 18\r",
+ "11 44 19\r",
+ "11 44 20\r",
+ "11 44 21\r",
+ "11 44 22\r",
+ "11 44 23\r",
+ "11 44 24\r",
+ "11 44 25\r",
+ "11 44 26\r",
+ "11 44 27\r",
+ "11 44 28\r",
+ "11 44 29\r",
+ "11 44 30\r",
+ "11 44 31\r",
+ "11 44 32\r",
+ "11 44 33\r",
+ "11 44 34\r",
+ "11 44 35\r",
+ "11 44 36\r",
+ "11 44 37\r",
+ "11 44 38\r",
+ "11 44 39\r",
+ "11 44 40\r",
+ "11 44 41\r",
+ "11 44 42\r",
+ "11 44 43\r",
+ "11 44 44\r",
+ "11 44 45\r",
+ "11 44 46\r",
+ "11 44 47\r",
+ "11 44 48\r",
+ "11 44 49\r",
+ "11 44 50\r",
+ "11 44 51\r",
+ "11 44 52\r",
+ "11 44 53\r",
+ "11 44 54\r",
+ "11 44 55\r",
+ "11 44 56\r",
+ "11 44 57\r",
+ "11 44 58\r",
+ "11 45 1\r",
+ "11 45 2\r",
+ "11 45 3\r",
+ "11 45 4\r",
+ "11 45 5\r",
+ "11 45 6\r",
+ "11 45 7\r",
+ "11 45 8\r",
+ "11 45 9\r",
+ "11 45 10\r",
+ "11 45 11\r",
+ "11 45 12\r",
+ "11 45 13\r",
+ "11 45 14\r",
+ "11 45 15\r",
+ "11 45 16\r",
+ "11 45 17\r",
+ "11 45 18\r",
+ "11 45 19\r",
+ "11 45 20\r",
+ "11 45 21\r",
+ "11 45 22\r",
+ "11 45 23\r",
+ "11 45 24\r",
+ "11 45 25\r",
+ "11 45 26\r",
+ "11 45 27\r",
+ "11 45 28\r",
+ "11 45 29\r",
+ "11 45 30\r",
+ "11 45 31\r",
+ "11 45 32\r",
+ "11 45 33\r",
+ "11 45 34\r",
+ "11 45 35\r",
+ "11 45 36\r",
+ "11 45 37\r",
+ "11 45 38\r",
+ "11 45 39\r",
+ "11 45 40\r",
+ "11 45 41\r",
+ "11 45 42\r",
+ "11 45 43\r",
+ "11 45 44\r",
+ "11 45 45\r",
+ "11 45 46\r",
+ "11 45 47\r",
+ "11 45 48\r",
+ "11 45 49\r",
+ "11 45 50\r",
+ "11 45 51\r",
+ "11 45 52\r",
+ "11 45 53\r",
+ "11 45 54\r",
+ "11 45 55\r",
+ "11 45 56\r",
+ "11 45 57\r",
+ "11 45 58\r",
+ "11 46 1\r",
+ "11 46 2\r",
+ "11 46 3\r",
+ "11 46 4\r",
+ "11 46 5\r",
+ "11 46 6\r",
+ "11 46 7\r",
+ "11 46 8\r",
+ "11 46 9\r",
+ "11 46 10\r",
+ "11 46 11\r",
+ "11 46 12\r",
+ "11 46 13\r",
+ "11 46 14\r",
+ "11 46 15\r",
+ "11 46 16\r",
+ "11 46 17\r",
+ "11 46 18\r",
+ "11 46 19\r",
+ "11 46 20\r",
+ "11 46 21\r",
+ "11 46 22\r",
+ "11 46 23\r",
+ "11 46 24\r",
+ "11 46 25\r",
+ "11 46 26\r",
+ "11 46 27\r",
+ "11 46 28\r",
+ "11 46 29\r",
+ "11 46 30\r",
+ "11 46 31\r",
+ "11 46 32\r",
+ "11 46 33\r",
+ "11 46 34\r",
+ "11 46 35\r",
+ "11 46 36\r",
+ "11 46 37\r",
+ "11 46 38\r",
+ "11 46 39\r",
+ "11 46 40\r",
+ "11 46 41\r",
+ "11 46 42\r",
+ "11 46 43\r",
+ "11 46 44\r",
+ "11 46 45\r",
+ "11 46 46\r",
+ "11 46 47\r",
+ "11 46 48\r",
+ "11 46 49\r",
+ "11 46 50\r",
+ "11 46 51\r",
+ "11 46 52\r",
+ "11 46 53\r",
+ "11 46 54\r",
+ "11 46 55\r",
+ "11 46 56\r",
+ "11 46 57\r",
+ "11 46 58\r",
+ "11 47 1\r",
+ "11 47 2\r",
+ "11 47 3\r",
+ "11 47 4\r",
+ "11 47 5\r",
+ "11 47 6\r",
+ "11 47 7\r",
+ "11 47 8\r",
+ "11 47 9\r",
+ "11 47 10\r",
+ "11 47 11\r",
+ "11 47 12\r",
+ "11 47 13\r",
+ "11 47 14\r",
+ "11 47 15\r",
+ "11 47 16\r",
+ "11 47 17\r",
+ "11 47 18\r",
+ "11 47 19\r",
+ "11 47 20\r",
+ "11 47 21\r",
+ "11 47 22\r",
+ "11 47 23\r",
+ "11 47 24\r",
+ "11 47 25\r",
+ "11 47 26\r",
+ "11 47 27\r",
+ "11 47 28\r",
+ "11 47 29\r",
+ "11 47 30\r",
+ "11 47 31\r",
+ "11 47 32\r",
+ "11 47 33\r",
+ "11 47 34\r",
+ "11 47 35\r",
+ "11 47 36\r",
+ "11 47 37\r",
+ "11 47 38\r",
+ "11 47 39\r",
+ "11 47 40\r",
+ "11 47 41\r",
+ "11 47 42\r",
+ "11 47 43\r",
+ "11 47 44\r",
+ "11 47 45\r",
+ "11 47 46\r",
+ "11 47 47\r",
+ "11 47 48\r",
+ "11 47 49\r",
+ "11 47 50\r",
+ "11 47 51\r",
+ "11 47 52\r",
+ "11 47 53\r",
+ "11 47 54\r",
+ "11 47 55\r",
+ "11 47 56\r",
+ "11 47 57\r",
+ "11 47 58\r",
+ "11 48 1\r",
+ "11 48 2\r",
+ "11 48 3\r",
+ "11 48 4\r",
+ "11 48 5\r",
+ "11 48 6\r",
+ "11 48 7\r",
+ "11 48 8\r",
+ "11 48 9\r",
+ "11 48 10\r",
+ "11 48 11\r",
+ "11 48 12\r",
+ "11 48 13\r",
+ "11 48 14\r",
+ "11 48 15\r",
+ "11 48 16\r",
+ "11 48 17\r",
+ "11 48 18\r",
+ "11 48 19\r",
+ "11 48 20\r",
+ "11 48 21\r",
+ "11 48 22\r",
+ "11 48 23\r",
+ "11 48 24\r",
+ "11 48 25\r",
+ "11 48 26\r",
+ "11 48 27\r",
+ "11 48 28\r",
+ "11 48 29\r",
+ "11 48 30\r",
+ "11 48 31\r",
+ "11 48 32\r",
+ "11 48 33\r",
+ "11 48 34\r",
+ "11 48 35\r",
+ "11 48 36\r",
+ "11 48 37\r",
+ "11 48 38\r",
+ "11 48 39\r",
+ "11 48 40\r",
+ "11 48 41\r",
+ "11 48 42\r",
+ "11 48 43\r",
+ "11 48 44\r",
+ "11 48 45\r",
+ "11 48 46\r",
+ "11 48 47\r",
+ "11 48 48\r",
+ "11 48 49\r",
+ "11 48 50\r",
+ "11 48 51\r",
+ "11 48 52\r",
+ "11 48 53\r",
+ "11 48 54\r",
+ "11 48 55\r",
+ "11 48 56\r",
+ "11 48 57\r",
+ "11 48 58\r",
+ "11 49 1\r",
+ "11 49 2\r",
+ "11 49 3\r",
+ "11 49 4\r",
+ "11 49 5\r",
+ "11 49 6\r",
+ "11 49 7\r",
+ "11 49 8\r",
+ "11 49 9\r",
+ "11 49 10\r",
+ "11 49 11\r",
+ "11 49 12\r",
+ "11 49 13\r",
+ "11 49 14\r",
+ "11 49 15\r",
+ "11 49 16\r",
+ "11 49 17\r",
+ "11 49 18\r",
+ "11 49 19\r",
+ "11 49 20\r",
+ "11 49 21\r",
+ "11 49 22\r",
+ "11 49 23\r",
+ "11 49 24\r",
+ "11 49 25\r",
+ "11 49 26\r",
+ "11 49 27\r",
+ "11 49 28\r",
+ "11 49 29\r",
+ "11 49 30\r",
+ "11 49 31\r",
+ "11 49 32\r",
+ "11 49 33\r",
+ "11 49 34\r",
+ "11 49 35\r",
+ "11 49 36\r",
+ "11 49 37\r",
+ "11 49 38\r",
+ "11 49 39\r",
+ "11 49 40\r",
+ "11 49 41\r",
+ "11 49 42\r",
+ "11 49 43\r",
+ "11 49 44\r",
+ "11 49 45\r",
+ "11 49 46\r",
+ "11 49 47\r",
+ "11 49 48\r",
+ "11 49 49\r",
+ "11 49 50\r",
+ "11 49 51\r",
+ "11 49 52\r",
+ "11 49 53\r",
+ "11 49 54\r",
+ "11 49 55\r",
+ "11 49 56\r",
+ "11 49 57\r",
+ "11 49 58\r",
+ "11 50 1\r",
+ "11 50 2\r",
+ "11 50 3\r",
+ "11 50 4\r",
+ "11 50 5\r",
+ "11 50 6\r",
+ "11 50 7\r",
+ "11 50 8\r",
+ "11 50 9\r",
+ "11 50 10\r",
+ "11 50 11\r",
+ "11 50 12\r",
+ "11 50 13\r",
+ "11 50 14\r",
+ "11 50 15\r",
+ "11 50 16\r",
+ "11 50 17\r",
+ "11 50 18\r",
+ "11 50 19\r",
+ "11 50 20\r",
+ "11 50 21\r",
+ "11 50 22\r",
+ "11 50 23\r",
+ "11 50 24\r",
+ "11 50 25\r",
+ "11 50 26\r",
+ "11 50 27\r",
+ "11 50 28\r",
+ "11 50 29\r",
+ "11 50 30\r",
+ "11 50 31\r",
+ "11 50 32\r",
+ "11 50 33\r",
+ "11 50 34\r",
+ "11 50 35\r",
+ "11 50 36\r",
+ "11 50 37\r",
+ "11 50 38\r",
+ "11 50 39\r",
+ "11 50 40\r",
+ "11 50 41\r",
+ "11 50 42\r",
+ "11 50 43\r",
+ "11 50 44\r",
+ "11 50 45\r",
+ "11 50 46\r",
+ "11 50 47\r",
+ "11 50 48\r",
+ "11 50 49\r",
+ "11 50 50\r",
+ "11 50 51\r",
+ "11 50 52\r",
+ "11 50 53\r",
+ "11 50 54\r",
+ "11 50 55\r",
+ "11 50 56\r",
+ "11 50 57\r",
+ "11 50 58\r",
+ "11 51 1\r",
+ "11 51 2\r",
+ "11 51 3\r",
+ "11 51 4\r",
+ "11 51 5\r",
+ "11 51 6\r",
+ "11 51 7\r",
+ "11 51 8\r",
+ "11 51 9\r",
+ "11 51 10\r",
+ "11 51 11\r",
+ "11 51 12\r",
+ "11 51 13\r",
+ "11 51 14\r",
+ "11 51 15\r",
+ "11 51 16\r",
+ "11 51 17\r",
+ "11 51 18\r",
+ "11 51 19\r",
+ "11 51 20\r",
+ "11 51 21\r",
+ "11 51 22\r",
+ "11 51 23\r",
+ "11 51 24\r",
+ "11 51 25\r",
+ "11 51 26\r",
+ "11 51 27\r",
+ "11 51 28\r",
+ "11 51 29\r",
+ "11 51 30\r",
+ "11 51 31\r",
+ "11 51 32\r",
+ "11 51 33\r",
+ "11 51 34\r",
+ "11 51 35\r",
+ "11 51 36\r",
+ "11 51 37\r",
+ "11 51 38\r",
+ "11 51 39\r",
+ "11 51 40\r",
+ "11 51 41\r",
+ "11 51 42\r",
+ "11 51 43\r",
+ "11 51 44\r",
+ "11 51 45\r",
+ "11 51 46\r",
+ "11 51 47\r",
+ "11 51 48\r",
+ "11 51 49\r",
+ "11 51 50\r",
+ "11 51 51\r",
+ "11 51 52\r",
+ "11 51 53\r",
+ "11 51 54\r",
+ "11 51 55\r",
+ "11 51 56\r",
+ "11 51 57\r",
+ "11 51 58\r",
+ "11 52 1\r",
+ "11 52 2\r",
+ "11 52 3\r",
+ "11 52 4\r",
+ "11 52 5\r",
+ "11 52 6\r",
+ "11 52 7\r",
+ "11 52 8\r",
+ "11 52 9\r",
+ "11 52 10\r",
+ "11 52 11\r",
+ "11 52 12\r",
+ "11 52 13\r",
+ "11 52 14\r",
+ "11 52 15\r",
+ "11 52 16\r",
+ "11 52 17\r",
+ "11 52 18\r",
+ "11 52 19\r",
+ "11 52 20\r",
+ "11 52 21\r",
+ "11 52 22\r",
+ "11 52 23\r",
+ "11 52 24\r",
+ "11 52 25\r",
+ "11 52 26\r",
+ "11 52 27\r",
+ "11 52 28\r",
+ "11 52 29\r",
+ "11 52 30\r",
+ "11 52 31\r",
+ "11 52 32\r",
+ "11 52 33\r",
+ "11 52 34\r",
+ "11 52 35\r",
+ "11 52 36\r",
+ "11 52 37\r",
+ "11 52 38\r",
+ "11 52 39\r",
+ "11 52 40\r",
+ "11 52 41\r",
+ "11 52 42\r",
+ "11 52 43\r",
+ "11 52 44"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\r",
+ "11 52 45\r",
+ "11 52 46\r",
+ "11 52 47\r",
+ "11 52 48\r",
+ "11 52 49\r",
+ "11 52 50\r",
+ "11 52 51\r",
+ "11 52 52\r",
+ "11 52 53\r",
+ "11 52 54\r",
+ "11 52 55\r",
+ "11 52 56\r",
+ "11 52 57\r",
+ "11 52 58\r",
+ "11 53 1\r",
+ "11 53 2\r",
+ "11 53 3\r",
+ "11 53 4\r",
+ "11 53 5\r",
+ "11 53 6\r",
+ "11 53 7\r",
+ "11 53 8\r",
+ "11 53 9\r",
+ "11 53 10\r",
+ "11 53 11\r",
+ "11 53 12\r",
+ "11 53 13\r",
+ "11 53 14\r",
+ "11 53 15\r",
+ "11 53 16\r",
+ "11 53 17\r",
+ "11 53 18\r",
+ "11 53 19\r",
+ "11 53 20\r",
+ "11 53 21\r",
+ "11 53 22\r",
+ "11 53 23\r",
+ "11 53 24\r",
+ "11 53 25\r",
+ "11 53 26\r",
+ "11 53 27\r",
+ "11 53 28\r",
+ "11 53 29\r",
+ "11 53 30\r",
+ "11 53 31\r",
+ "11 53 32\r",
+ "11 53 33\r",
+ "11 53 34\r",
+ "11 53 35\r",
+ "11 53 36\r",
+ "11 53 37\r",
+ "11 53 38\r",
+ "11 53 39\r",
+ "11 53 40\r",
+ "11 53 41\r",
+ "11 53 42\r",
+ "11 53 43\r",
+ "11 53 44\r",
+ "11 53 45\r",
+ "11 53 46\r",
+ "11 53 47\r",
+ "11 53 48\r",
+ "11 53 49\r",
+ "11 53 50\r",
+ "11 53 51\r",
+ "11 53 52\r",
+ "11 53 53\r",
+ "11 53 54\r",
+ "11 53 55\r",
+ "11 53 56\r",
+ "11 53 57\r",
+ "11 53 58\r",
+ "11 54 1\r",
+ "11 54 2\r",
+ "11 54 3\r",
+ "11 54 4\r",
+ "11 54 5\r",
+ "11 54 6\r",
+ "11 54 7\r",
+ "11 54 8\r",
+ "11 54 9\r",
+ "11 54 10\r",
+ "11 54 11\r",
+ "11 54 12\r",
+ "11 54 13\r",
+ "11 54 14\r",
+ "11 54 15\r",
+ "11 54 16\r",
+ "11 54 17\r",
+ "11 54 18\r",
+ "11 54 19\r",
+ "11 54 20\r",
+ "11 54 21\r",
+ "11 54 22\r",
+ "11 54 23\r",
+ "11 54 24\r",
+ "11 54 25\r",
+ "11 54 26\r",
+ "11 54 27\r",
+ "11 54 28\r",
+ "11 54 29\r",
+ "11 54 30\r",
+ "11 54 31\r",
+ "11 54 32\r",
+ "11 54 33\r",
+ "11 54 34\r",
+ "11 54 35\r",
+ "11 54 36\r",
+ "11 54 37\r",
+ "11 54 38\r",
+ "11 54 39\r",
+ "11 54 40\r",
+ "11 54 41\r",
+ "11 54 42\r",
+ "11 54 43\r",
+ "11 54 44\r",
+ "11 54 45\r",
+ "11 54 46\r",
+ "11 54 47\r",
+ "11 54 48\r",
+ "11 54 49\r",
+ "11 54 50\r",
+ "11 54 51\r",
+ "11 54 52\r",
+ "11 54 53\r",
+ "11 54 54\r",
+ "11 54 55\r",
+ "11 54 56\r",
+ "11 54 57\r",
+ "11 54 58\r",
+ "11 55 1\r",
+ "11 55 2\r",
+ "11 55 3\r",
+ "11 55 4\r",
+ "11 55 5\r",
+ "11 55 6\r",
+ "11 55 7\r",
+ "11 55 8\r",
+ "11 55 9\r",
+ "11 55 10\r",
+ "11 55 11\r",
+ "11 55 12\r",
+ "11 55 13\r",
+ "11 55 14\r",
+ "11 55 15\r",
+ "11 55 16\r",
+ "11 55 17\r",
+ "11 55 18\r",
+ "11 55 19\r",
+ "11 55 20\r",
+ "11 55 21\r",
+ "11 55 22\r",
+ "11 55 23\r",
+ "11 55 24\r",
+ "11 55 25\r",
+ "11 55 26\r",
+ "11 55 27\r",
+ "11 55 28\r",
+ "11 55 29\r",
+ "11 55 30\r",
+ "11 55 31\r",
+ "11 55 32\r",
+ "11 55 33\r",
+ "11 55 34\r",
+ "11 55 35\r",
+ "11 55 36\r",
+ "11 55 37\r",
+ "11 55 38\r",
+ "11 55 39\r",
+ "11 55 40\r",
+ "11 55 41\r",
+ "11 55 42\r",
+ "11 55 43\r",
+ "11 55 44\r",
+ "11 55 45\r",
+ "11 55 46\r",
+ "11 55 47\r",
+ "11 55 48\r",
+ "11 55 49\r",
+ "11 55 50\r",
+ "11 55 51\r",
+ "11 55 52\r",
+ "11 55 53\r",
+ "11 55 54\r",
+ "11 55 55\r",
+ "11 55 56\r",
+ "11 55 57\r",
+ "11 55 58\r",
+ "11 56 1\r",
+ "11 56 2\r",
+ "11 56 3\r",
+ "11 56 4\r",
+ "11 56 5\r",
+ "11 56 6\r",
+ "11 56 7\r",
+ "11 56 8\r",
+ "11 56 9\r",
+ "11 56 10\r",
+ "11 56 11\r",
+ "11 56 12\r",
+ "11 56 13\r",
+ "11 56 14\r",
+ "11 56 15\r",
+ "11 56 16\r",
+ "11 56 17\r",
+ "11 56 18\r",
+ "11 56 19\r",
+ "11 56 20\r",
+ "11 56 21\r",
+ "11 56 22\r",
+ "11 56 23\r",
+ "11 56 24\r",
+ "11 56 25\r",
+ "11 56 26\r",
+ "11 56 27\r",
+ "11 56 28\r",
+ "11 56 29\r",
+ "11 56 30\r",
+ "11 56 31\r",
+ "11 56 32\r",
+ "11 56 33\r",
+ "11 56 34\r",
+ "11 56 35\r",
+ "11 56 36\r",
+ "11 56 37\r",
+ "11 56 38\r",
+ "11 56 39\r",
+ "11 56 40\r",
+ "11 56 41\r",
+ "11 56 42\r",
+ "11 56 43\r",
+ "11 56 44\r",
+ "11 56 45\r",
+ "11 56 46\r",
+ "11 56 47\r",
+ "11 56 48\r",
+ "11 56 49\r",
+ "11 56 50\r",
+ "11 56 51\r",
+ "11 56 52\r",
+ "11 56 53\r",
+ "11 56 54\r",
+ "11 56 55\r",
+ "11 56 56\r",
+ "11 56 57\r",
+ "11 56 58\r",
+ "11 57 1\r",
+ "11 57 2\r",
+ "11 57 3\r",
+ "11 57 4\r",
+ "11 57 5\r",
+ "11 57 6\r",
+ "11 57 7\r",
+ "11 57 8\r",
+ "11 57 9\r",
+ "11 57 10\r",
+ "11 57 11\r",
+ "11 57 12\r",
+ "11 57 13\r",
+ "11 57 14\r",
+ "11 57 15\r",
+ "11 57 16\r",
+ "11 57 17\r",
+ "11 57 18\r",
+ "11 57 19\r",
+ "11 57 20\r",
+ "11 57 21\r",
+ "11 57 22\r",
+ "11 57 23\r",
+ "11 57 24\r",
+ "11 57 25\r",
+ "11 57 26\r",
+ "11 57 27\r",
+ "11 57 28\r",
+ "11 57 29\r",
+ "11 57 30\r",
+ "11 57 31\r",
+ "11 57 32\r",
+ "11 57 33\r",
+ "11 57 34\r",
+ "11 57 35\r",
+ "11 57 36\r",
+ "11 57 37\r",
+ "11 57 38\r",
+ "11 57 39\r",
+ "11 57 40\r",
+ "11 57 41\r",
+ "11 57 42\r",
+ "11 57 43\r",
+ "11 57 44\r",
+ "11 57 45\r",
+ "11 57 46\r",
+ "11 57 47\r",
+ "11 57 48\r",
+ "11 57 49\r",
+ "11 57 50\r",
+ "11 57 51\r",
+ "11 57 52\r",
+ "11 57 53\r",
+ "11 57 54\r",
+ "11 57 55\r",
+ "11 57 56\r",
+ "11 57 57\r",
+ "11 57 58\r",
+ "11 58 1\r",
+ "11 58 2\r",
+ "11 58 3\r",
+ "11 58 4\r",
+ "11 58 5\r",
+ "11 58 6\r",
+ "11 58 7\r",
+ "11 58 8\r",
+ "11 58 9\r",
+ "11 58 10\r",
+ "11 58 11\r",
+ "11 58 12\r",
+ "11 58 13\r",
+ "11 58 14\r",
+ "11 58 15\r",
+ "11 58 16\r",
+ "11 58 17\r",
+ "11 58 18\r",
+ "11 58 19\r",
+ "11 58 20\r",
+ "11 58 21\r",
+ "11 58 22\r",
+ "11 58 23\r",
+ "11 58 24\r",
+ "11 58 25\r",
+ "11 58 26\r",
+ "11 58 27\r",
+ "11 58 28\r",
+ "11 58 29\r",
+ "11 58 30\r",
+ "11 58 31\r",
+ "11 58 32\r",
+ "11 58 33\r",
+ "11 58 34\r",
+ "11 58 35\r",
+ "11 58 36\r",
+ "11 58 37\r",
+ "11 58 38\r",
+ "11 58 39\r",
+ "11 58 40\r",
+ "11 58 41\r",
+ "11 58 42\r",
+ "11 58 43\r",
+ "11 58 44\r",
+ "11 58 45\r",
+ "11 58 46\r",
+ "11 58 47\r",
+ "11 58 48\r",
+ "11 58 49\r",
+ "11 58 50\r",
+ "11 58 51\r",
+ "11 58 52\r",
+ "11 58 53\r",
+ "11 58 54\r",
+ "11 58 55\r",
+ "11 58 56\r",
+ "11 58 57\r",
+ "11 58 58"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.33, Page number: 131<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count occurrence of 0 to 9 digits between 1 and given decimal number\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "n = int(raw_input(\"Enter a Decimal Number : \"))\n",
+ "st = [0 for x in range(10)] #10 array elements initialized as 0\n",
+ "\n",
+ "#Calculation\n",
+ "for l in range(1,n+1):\n",
+ " t = l\n",
+ " while t != 0:\n",
+ " k = t % 10\n",
+ " t = t / 10\n",
+ " st[k] += 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nOccurrence of 0-9 digits between 1 to %d Numbers.\"%(n))\n",
+ "sys.stdout.write(\"\\n========== == === ====== ======= = == == ========\")\n",
+ "\n",
+ "for i in range(0,10):\n",
+ " if st[i] > 0:\n",
+ " sys.stdout.write(\"\\n%d Occurs %8d Times.\"%(i,st[i]))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Decimal Number : 15\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Occurrence of 0-9 digits between 1 to 15 Numbers.\n",
+ "========== == === ====== ======= = == == ========\n",
+ "0 Occurs 1 Times.\n",
+ "1 Occurs 8 Times.\n",
+ "2 Occurs 2 Times.\n",
+ "3 Occurs 2 Times.\n",
+ "4 Occurs 2 Times.\n",
+ "5 Occurs 2 Times.\n",
+ "6 Occurs 1 Times.\n",
+ "7 Occurs 1 Times.\n",
+ "8 Occurs 1 Times.\n",
+ "9 Occurs 1 Times."
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.34, Page number: 132<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display sum of digits of a given number\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "s = 0\n",
+ "n = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "\n",
+ "sys.stdout.write(\"\\nSum of Digits till a single digit\\n %d\"%(n))\n",
+ "\n",
+ "while n != 0:\n",
+ " s = s + n%10\n",
+ " n = n/10\n",
+ " if n == 0 and s > 9:\n",
+ " sys.stdout.write(\"\\n %2d\"%(s))\n",
+ " n = s\n",
+ " s = 0\n",
+ "\n",
+ "sys.stdout.write(\"\\n %2d\"%(s))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 4687\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Sum of Digits till a single digit\n",
+ " 4687\n",
+ " 25\n",
+ " 7"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.35, Page number: 133<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display octal numbers in binary. Attach a parity bit with \"1\"\n",
+ "#if number of 1s are even otherwise \"0\".\n",
+ "# OR\n",
+ "#Generate odd parity to octal numbers 0 to 7. Express each number in binary\n",
+ "#and attach the parity bit\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "c = 0\n",
+ "j = 12\n",
+ "k = 2\n",
+ "\n",
+ "#Calculation & Result\n",
+ "\n",
+ "sys.stdout.write(\"\\nBinary Bits Parity Bits\")\n",
+ "sys.stdout.write(\"\\n============= ==============\\n\")\n",
+ "\n",
+ "for x in range(0,8):\n",
+ " k += 1\n",
+ " j = 12\n",
+ " y = x\n",
+ " for a in range(0,3):\n",
+ " b = y % 2\n",
+ " #gotoxy\n",
+ " sys.stdout.write(\"\\t%d\"%(b))\n",
+ " y = y / 2\n",
+ " if b == 1:\n",
+ " c += 1\n",
+ " if c%2 == 0:\n",
+ " #gotoxy\n",
+ " sys.stdout.write(\"\\t1\")\n",
+ " else:\n",
+ " #gotosy\n",
+ " sys.stdout.write(\"\\t0\\n\")\n",
+ " c = 0\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Binary Bits Parity Bits\n",
+ "============= ==============\n",
+ "\t0\t0\t0\t1\t1\t0\t0\t0\n",
+ "\t0\t1\t0\t0\n",
+ "\t1\t1\t0\t1\t0\t0\t1\t0\n",
+ "\t1\t0\t1\t1\t0\t1\t1\t1\t1\t1\t1\t0\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.36, Page number: 135<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Evaluate the series x - x^3/3! + x^5/5! - .... x^n/n!\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "c = 3.0\n",
+ "f = 1.0\n",
+ "\n",
+ "#Give x as float value and n as int value\n",
+ "\n",
+ "x = float(raw_input(\"Enter x & n : \")) #use commas to input values\n",
+ "n = int(raw_input(\"Enter x & n : \")) \n",
+ "\n",
+ "sum1 = x #since sum is built-in function in python,\n",
+ " #sum1 is used instead of sum\n",
+ "\n",
+ "#Calculation & Result\n",
+ "\n",
+ "for i in range(3,n+1,2):\n",
+ " f = 1\n",
+ " if c%2 != 0:\n",
+ " for l in range(1,i+1):\n",
+ " f = f * l\n",
+ " sum1 = sum1 - pow(x,i)/ f\n",
+ " else:\n",
+ " for l in range(1,i+1):\n",
+ " f = f * l\n",
+ " sum1 = sum1 + pow(x,i)/ f\n",
+ " c += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\nSum of series Numbers : %f\"%(sum1))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter x & n : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter x & n : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Sum of series Numbers : 0.933333"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.37, Page number: 136<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Evaluate the series x + x^2/2! + x^4/4! + .... x^n/n!\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "f = 1.0\n",
+ "\n",
+ "#Give x as float value and y as int value\n",
+ "\n",
+ "x = float(raw_input(\"Enter x & y : \")) #use commas to input values\n",
+ "y = int(raw_input(\"Enter x & y : \")) \n",
+ "\n",
+ "sum1 = x #since sum is built-in function in python,\n",
+ " #sum1 is used instead of sum\n",
+ "\n",
+ "#Calculation & Result\n",
+ "\n",
+ "for i in range(2,y+1,2):\n",
+ " f = 1\n",
+ " for l in range(1,i+1):\n",
+ " f = f * l\n",
+ " sum1 = sum1 + pow(x,i)/ f\n",
+ "\n",
+ "sys.stdout.write(\"\\nSum of Series : %f\"%(sum1))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter x & y : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter x & y : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Sum of Series : 22.666667"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.38, Page number: 136<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Evaluate the series 1 - 1/1! + 2/2! - 3/3! .... n/n!\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "c = 3\n",
+ "\n",
+ "n = int(raw_input(\"Enter value of n : \"))\n",
+ "\n",
+ "sum1 = 1.0 #since sum is built-in function in python,\n",
+ " #sum1 is used instead of sum\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "for i in range(1,n+1):\n",
+ " f = 1.0\n",
+ " if c%2 != 0:\n",
+ " for l in range(1,i+1):\n",
+ " f = f * l\n",
+ " k = float(i / f)\n",
+ " sum1 = sum1 - k\n",
+ " else:\n",
+ " for l in range(1,i+1):\n",
+ " f = f * l\n",
+ " sum1 = sum1 + float(i/f)\n",
+ " c += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nSum of series Numbers : %f\"%(sum1))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of n : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Sum of series Numbers : 0.500000"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.39, Page number: 137<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the Armstrong numbers in three digits from 100 to 999. If sum of cubes of each digits\n",
+ "#of the number is equal to number itself, then the number is called as an Armstrong number.\n",
+ "#(For eg. 153 = 1^3 + 5^3 + 3^3 = 153)\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "cube = 0\n",
+ "\n",
+ "sys.stdout.write(\"The Following Numbers are Armstrong numbers.\")\n",
+ "\n",
+ "#Calculation & Result\n",
+ "\n",
+ "for k in range(100,999+1):\n",
+ " cube = 0\n",
+ " x = 1\n",
+ " d = 3\n",
+ " n = k\n",
+ " while x <= d:\n",
+ " i = n % 10\n",
+ " cube = cube + pow(i,3)\n",
+ " n = n / 10\n",
+ " x += 1\n",
+ " if cube == k:\n",
+ " sys.stdout.write(\"\\n\\t%d\"%(k))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Following Numbers are Armstrong numbers.\n",
+ "\t153\n",
+ "\t370\n",
+ "\t371\n",
+ "\t407"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.40, Page number: 138<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.40.py\n",
+ "#Program to display the stars as shown below\n",
+ "#*\n",
+ "#**\n",
+ "#***\n",
+ "#****\n",
+ "#*****\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "\n",
+ "x = int(raw_input(\"How many lines stars (*) should be printed ? \"))\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "for i in range(1,x+1):\n",
+ " for j in range(1,i+1):\n",
+ " sys.stdout.write(\"*\")\n",
+ " sys.stdout.write(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many lines stars (*) should be printed ? 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "*\n",
+ "**\n",
+ "***\n",
+ "****\n",
+ "*****\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.41, Page number: 139<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Generate the given pattern\n",
+ "#6 5 4 3 2 1 0\n",
+ "#5 4 3 2 1 0\n",
+ "#4 3 2 1 0\n",
+ "#3 2 1 0\n",
+ "#2 1 0\n",
+ "#1 0\n",
+ "#0\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "while i >= 0:\n",
+ " c = i\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " while True:\n",
+ " sys.stdout.write(\"%3d\"%(c))\n",
+ " if c == 0:\n",
+ " break\n",
+ " c -= 1\n",
+ " i -= 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " 6 5 4 3 2 1 0\n",
+ " 5 4 3 2 1 0\n",
+ " 4 3 2 1 0\n",
+ " 3 2 1 0\n",
+ " 2 1 0\n",
+ " 1 0\n",
+ " 0"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.42, Page number: 140<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the series of numbers as given below\n",
+ "#1\n",
+ "#1 2\n",
+ "#1 2 3\n",
+ "#1 2 3 4\n",
+ "\n",
+ "#4 3 2 1\n",
+ "#3 2 1\n",
+ "#2 1\n",
+ "#1\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter value of x : \"))\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "for j in range(1,x+1):\n",
+ " for i in range(1,j+1):\n",
+ " sys.stdout.write(\"%3d\"%(i))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ "\n",
+ "sys.stdout.write(\"\\n\")\n",
+ "\n",
+ "for j in range(x,0,-1):\n",
+ " for i in range(j,0,-1):\n",
+ " sys.stdout.write(\"%3d\"%(i))\n",
+ " sys.stdout.write(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of x : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1\n",
+ " 1 2\n",
+ " 1 2 3\n",
+ " 1 2 3 4\n",
+ "\n",
+ " 4 3 2 1\n",
+ " 3 2 1\n",
+ " 2 1\n",
+ " 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.43, Page number: 142<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to display the series of numbers as given below\n",
+ "#1\n",
+ "#2 1\n",
+ "#3 2 1\n",
+ "#4 3 2 1\n",
+ "\n",
+ "#4 3 2 1\n",
+ "#3 2 1\n",
+ "#2 1\n",
+ "#1\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter value of x : \"))\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "for j in range(1,x+1):\n",
+ " for i in range(j,0,-1):\n",
+ " sys.stdout.write(\"%3d\"%(i))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ "\n",
+ "sys.stdout.write(\"\\n\")\n",
+ "\n",
+ "for j in range(x,0,-1):\n",
+ " for i in range(j,0,-1):\n",
+ " sys.stdout.write(\"%3d\"%(i))\n",
+ " sys.stdout.write(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of x : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1\n",
+ " 2 1\n",
+ " 3 2 1\n",
+ " 4 3 2 1\n",
+ "\n",
+ " 4 3 2 1\n",
+ " 3 2 1\n",
+ " 2 1\n",
+ " 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.44, Page number: 143<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Generate the pyramid structure using numberical\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter a number : \"))\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "for j in range(0,x+1):\n",
+ " for i in range(0-j,j+1):\n",
+ " sys.stdout.write(\"%3d\"%(abs(i)))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 0\n",
+ " 1 0 1\n",
+ " 2 1 0 1 2\n",
+ " 3 2 1 0 1 2 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.45, Page number: 143<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert binary to decimal number\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = [1 for i in range(1,5+1)] #defines the array x and initializes the elements with 0\n",
+ "y = x[0]\n",
+ "\n",
+ "sys.stdout.write(\"\\nValues in different Iterations\")\n",
+ "sys.stdout.write(\"\\n====== == ========= ==========\\n\")\n",
+ "\n",
+ "for i in range(0,4):\n",
+ " y = y * 2 + x[i+1]\n",
+ " sys.stdout.write(\"[%d] %d\\t\"%(i+1,y))\n",
+ "\n",
+ "sys.stdout.write(\"\\nEquivalent of [\")\n",
+ "\n",
+ "for i in range(0,5):\n",
+ " sys.stdout.write(\"%d\"%(x[i]))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"] in Decimal Number is : \")\n",
+ "sys.stdout.write(\"%d\\t\"%(y))\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Values in different Iterations\n",
+ "====== == ========= ==========\n",
+ "[1] 3\t[2] 7\t[3] 15\t[4] 31\t\n",
+ "Equivalent of [11111] in Decimal Number is : 31\t"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.46, Page number: 144<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to add a parity bit with four binary bits such that the total\n",
+ "#number of one's should be even\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "bit = [0 for i in range(0,5)] #defines the array bit and initializes the elements with 0\n",
+ "c = 0\n",
+ "\n",
+ "sys.stdout.write(\"\\nEnter four bits : \")\n",
+ "\n",
+ "for j in range(0,4):\n",
+ " x = int(raw_input(\" \"))\n",
+ " bit[j] = x\n",
+ " if bit[j] == 1:\n",
+ " c += 1\n",
+ " else:\n",
+ " if bit[j] > 1 or bit[j] < 0:\n",
+ " j -= 1\n",
+ " continue\n",
+ " if c%2 == 0:\n",
+ " bit[j] = 0\n",
+ " else:\n",
+ " bit[j] = 1 \n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nMessage bits together with parity bit : \")\n",
+ "for j in range(0,5):\n",
+ " sys.stdout.write(\"%d\"%(bit[j]))\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter four bits : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Message bits together with parity bit : 11110"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.47, Page number: 145<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert binary to decimal number. Enter the binary bits by using for loop\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "\n",
+ "z = [0 for i in range(0,10)] #defines the array z and initializes the elements with 0\n",
+ "\n",
+ "sys.stdout.write(\"Enter the number of bits :- \")\n",
+ "b = int(raw_input(\"\"))\n",
+ "\n",
+ "sys.stdout.write(\"\\nEnter the binary bits : \")\n",
+ "for i in range(0,b):\n",
+ " z[i] = int(raw_input(\"\"))\n",
+ "\n",
+ "a = z[0]\n",
+ "\n",
+ "for i in range(0,b-1):\n",
+ " a = a * 2 + z[i+1]\n",
+ " sys.stdout.write(\"\\n%d\"%(a))\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nDecimal Number is : %d \"%(a))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of bits :- "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter the binary bits : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "2\n",
+ "4\n",
+ "8\n",
+ "17\n",
+ "Decimal Number is : 17 "
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.48, Page number: 147<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Verify the truth table of AND gate. Assume AND gate has two\n",
+ "#input bits A & B and one output bit C.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "\n",
+ "a = [0 for i in range(0,4)] #defines the array a,b & c and initializes the elements with 0\n",
+ "b = [0 for i in range(0,4)]\n",
+ "c = [0 for i in range(0,4)]\n",
+ "\n",
+ "sys.stdout.write(\"\\nEnter Four Bits : \")\n",
+ "for x in range(0,4):\n",
+ " a[x] = int(raw_input(\"\"))\n",
+ " \n",
+ " if a[x] > 1 or a[x] < 0:\n",
+ " x -= 1\n",
+ " continue\n",
+ "\n",
+ "sys.stdout.write(\"\\nEnter Four Bits : \")\n",
+ "for x in range(0,4):\n",
+ " b[x] = int(raw_input(\"\"))\n",
+ " \n",
+ " if b[x] > 1 or b[x] < 0:\n",
+ " x -= 1\n",
+ " continue\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nA B C\")\n",
+ "for x in range(0,4):\n",
+ " if a[x] == 1 and b[x] == 1:\n",
+ " c[x] = 1\n",
+ " else:\n",
+ " c[x] = 0\n",
+ " sys.stdout.write(\"\\n%d %d %d\"%(a[x],b[x],c[x]))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Four Bits : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Four Bits : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "A B C\n",
+ "1 1 1\n",
+ "0 0 0\n",
+ "1 0 0\n",
+ "0 1 0"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.49, Page number: 148<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Verify the truth table of OR gate. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "\n",
+ "a = [0 for i in range(0,4)] #defines the array a,b & c and initializes the elements with 0\n",
+ "b = [0 for i in range(0,4)]\n",
+ "c = [0 for i in range(0,4)]\n",
+ "\n",
+ "sys.stdout.write(\"\\nEnter Four Bits : \")\n",
+ "for x in range(0,4):\n",
+ " a[x] = int(raw_input(\"\"))\n",
+ " \n",
+ " if a[x] > 1 or a[x] < 0:\n",
+ " x -= 1\n",
+ " continue\n",
+ "\n",
+ "sys.stdout.write(\"\\nEnter Four Bits : \")\n",
+ "for x in range(0,4):\n",
+ " b[x] = int(raw_input(\"\"))\n",
+ " \n",
+ " if b[x] > 1 or b[x] < 0:\n",
+ " x -= 1\n",
+ " continue\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nA B C\")\n",
+ "for x in range(0,4):\n",
+ " if a[x] == 0 and b[x] == 0:\n",
+ " c[x] = 0\n",
+ " else:\n",
+ " c[x] = 1\n",
+ " sys.stdout.write(\"\\n%d %d %d\"%(a[x],b[x],c[x]))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Four Bits : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Four Bits : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "A B C\n",
+ "1 1 1\n",
+ "1 0 1\n",
+ "1 0 1\n",
+ "0 0 0"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.50, Page number: 149<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Verify the truth table of EX-OR gate. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "\n",
+ "a = [0 for i in range(0,4)] #defines the array a,b & c and initializes the elements with 0\n",
+ "b = [0 for i in range(0,4)]\n",
+ "c = [0 for i in range(0,4)]\n",
+ "\n",
+ "sys.stdout.write(\"\\nEnter Four Bits : \")\n",
+ "for x in range(0,4):\n",
+ " a[x] = int(raw_input(\"\"))\n",
+ " \n",
+ " if a[x] > 1 or a[x] < 0:\n",
+ " x -= 1\n",
+ " continue\n",
+ "\n",
+ "sys.stdout.write(\"\\nEnter Four Bits : \")\n",
+ "for x in range(0,4):\n",
+ " b[x] = int(raw_input(\"\"))\n",
+ " \n",
+ " if b[x] > 1 or b[x] < 0:\n",
+ " x -= 1\n",
+ " continue\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nA B C\")\n",
+ "for x in range(0,4):\n",
+ " if a[x] == 0 and b[x] == 1:\n",
+ " c[x] = 1\n",
+ " else:\n",
+ " if a[x] == 1 and b[x] == 0:\n",
+ " c[x] = 1\n",
+ " else:\n",
+ " c[x] = 0\n",
+ " sys.stdout.write(\"\\n%d %d %d\"%(a[x],b[x],c[x]))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Four Bits : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Four Bits : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "A B C\n",
+ "1 1 0\n",
+ "1 0 1\n",
+ "1 0 1\n",
+ "0 0 0"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.51, Page number: 151<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the Hamming code for the entered binary code. Assume the binary code of four bits in length.\n",
+ "#The hamming code should be seven bits.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "\n",
+ "#defines the array a,b & c and initializes the elements with 0\n",
+ "b = [0 for i in range(0,4)]\n",
+ "c = [0 for i in range(0,7)]\n",
+ "\n",
+ "sys.stdout.write(\"\\nRead the Binary Numbers : \")\n",
+ "for x in range(0,4):\n",
+ " b[x] = int(raw_input(\"\"))\n",
+ "\n",
+ "#Piece copy operation\n",
+ "c[0] = b[0]\n",
+ "c[1] = b[1]\n",
+ "c[2] = b[2]\n",
+ "c[4] = b[3]\n",
+ "\n",
+ "sys.stdout.write(\"\\nBefore xOR operation : \")\n",
+ " \n",
+ "for x in range(0,7):\n",
+ " sys.stdout.write(\"%3d\"%(c[x]))\n",
+ "\n",
+ "c[6] = c[0] ^ c[2] ^ c[4]\n",
+ "c[5] = c[0] ^ c[1] ^ c[4]\n",
+ "c[3] = c[0] ^ c[1] ^ c[2]\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nHamming code after XOR operation : \")\n",
+ "for x in range(0,7):\n",
+ " sys.stdout.write(\"%3d\"%(c[x]))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Read the Binary Numbers : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Before xOR operation : 1 0 1 0 0 0 0\n",
+ "Hamming code after XOR operation : 1 0 1 0 0 1 0"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.52, Page number: 152<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the results of students appear in six subjects. The result declared should be as per the \n",
+ "#following table.\n",
+ "#TOTAL MARKS RESULT\n",
+ "#>= 420 Distinction\n",
+ "#>= 360 First Division\n",
+ "#>= 240 Second Division\n",
+ "#Otherwise Fail\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "DISTINCTION = 420\n",
+ "FIRST = 360\n",
+ "SECOND = 240\n",
+ "\n",
+ "number = int(raw_input(\"Enter number of Students : \"))\n",
+ "\n",
+ "#Read the values and calculation\n",
+ "for i in range(1,number+1):\n",
+ " roll_no = int(raw_input(\"Enter Roll Number : \"))\n",
+ " total = 0\n",
+ " sys.stdout.write(\"\\nEnter Marks of 6 Subjects for Roll no %d : \"%(roll_no))\n",
+ " for j in range(1,6+1):\n",
+ " marks = int(raw_input(\"\"))\n",
+ " total = total + marks\n",
+ " sys.stdout.write(\"\\nTOTAL MARKS = %d\"%(total))\n",
+ " if total >= DISTINCTION:\n",
+ " sys.stdout.write(\"\\n(Distinction)\\n\\n\")\n",
+ " else:\n",
+ " if total >= FIRST:\n",
+ " sys.stdout.write(\"\\n(First Division)\\n\\n\")\n",
+ " else:\n",
+ " if total >= SECOND:\n",
+ " sys.stdout.write(\"\\n(Second Division)\\n\\n\")\n",
+ " else:\n",
+ " sys.stdout.write(\"\\n(***Fail***)\")\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of Students : 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Roll Number : 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Marks of 6 Subjects for Roll no 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "42\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "52\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "62\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "72\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "82\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "92\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "TOTAL MARKS = 402\n",
+ "(First Division)\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.53, Page number: 154<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the string \"You have learnt C program\" 9 times using while loop\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 1\n",
+ "\n",
+ "#Result\n",
+ "while x < 10:\n",
+ " sys.stdout.write(\"\\nYou have learnt C program\")\n",
+ " x += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "You have learnt C program\n",
+ "You have learnt C program\n",
+ "You have learnt C program\n",
+ "You have learnt C program\n",
+ "You have learnt C program\n",
+ "You have learnt C program\n",
+ "You have learnt C program\n",
+ "You have learnt C program\n",
+ "You have learnt C program"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.54, Page number: 155<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Add 10 consecutive numbers starting from 1 using while loop.\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 1\n",
+ "sum1 = 0 #since sum is a builtin function in python, sum1 is used instead of sum\n",
+ "\n",
+ "#Calculation\n",
+ "while a <= 10:\n",
+ " sys.stdout.write(\"%3d\"%(a))\n",
+ " sum1 = sum1 + a\n",
+ " a += 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nSum of 10 numbers : %d\"%(sum1))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1 2 3 4 5 6 7 8 9 10\n",
+ "Sum of 10 numbers : 55"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.55, Page number: 155<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate factorial of a given number using while loop.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "fact = 1\n",
+ "\n",
+ "a = int(raw_input(\"Enter The Number : \"))\n",
+ "\n",
+ "#Calculation\n",
+ "while a >= 1:\n",
+ " sys.stdout.write(\" %d * \"%(a))\n",
+ " fact = fact * a\n",
+ " a -= 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\" = %d\"%(fact))\n",
+ "sys.stdout.write(\"\\nFactorial of Given number is %d\"%(fact))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter The Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 5 * 4 * 3 * 2 * 1 * = 120\n",
+ "Factorial of Given number is 120"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.56, Page number: 156<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate factorial of a given number using while loop.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "fact = 1\n",
+ "b = 1\n",
+ "\n",
+ "a = int(raw_input(\"Enter The Number : \"))\n",
+ "\n",
+ "#Calculation\n",
+ "while b <= a:\n",
+ " sys.stdout.write(\" %d * \"%(b))\n",
+ " fact = fact * b\n",
+ " b += 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\" = %d\"%(fact))\n",
+ "sys.stdout.write(\"\\nFactorial of %d is %d\"%(b-1,fact))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter The Number : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1 * 2 * 3 * 4 * = 24\n",
+ "Factorial of 4 is 24"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.57, Page number: 157<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert decimal number to binary number\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "y = 40\n",
+ "rev = [0 for i in range(1,10)]\n",
+ "c = 1\n",
+ "\n",
+ "x = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "#since gotoxy() function is not available in python, the reminders are stored in an array and displayed in reverse order\n",
+ "\n",
+ "sys.stdout.write(\"\\nBinary Number : \")\n",
+ "while x != 0:\n",
+ " rev[c] = x % 2\n",
+ " x = x / 2\n",
+ " c += 1\n",
+ "\n",
+ "for i in range(c-1,0,-1):\n",
+ " sys.stdout.write(\"%d\"%(rev[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 25\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Binary Number : 11001"
+ ]
+ }
+ ],
+ "prompt_number": 63
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.58, Page number: 157<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert decimal number to user defined number system. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "y = 35\n",
+ "rev = 0\n",
+ "c = 1\n",
+ "rev = [0 for i in range(1,10)]\n",
+ "\n",
+ "m = int(raw_input(\"Enter the Decimal Number : \"))\n",
+ "b = int(raw_input(\"Enter base of number system : \"))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "sys.stdout.write(\"\\nThe Number Obtained : \")\n",
+ "\n",
+ "#since gotoxy() function is not available in python, the reminders are stored in an array and displayed in reverse order\n",
+ "while m != 0:\n",
+ " rev[c] = m % b\n",
+ " c += 1\n",
+ " m = m / b\n",
+ "\n",
+ "for i in range(c-1,0,-1):\n",
+ " sys.stdout.write(\"%d\"%rev[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the Decimal Number : 50\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter base of number system : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The Number Obtained : 200"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.59, Page number: 158<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert binary number to equivalent decimal number\n",
+ "\n",
+ "\n",
+ "#Variable Initialization\n",
+ "y = 0\n",
+ "p = 0\n",
+ "\n",
+ "n = int(raw_input(\"Enter a Binary Number : \"))\n",
+ "\n",
+ "#Calculation\n",
+ "while n != 0:\n",
+ " x = n % 10\n",
+ " if x > 1 or x < 0:\n",
+ " sys.stdout.write(\"\\nInvalid Digit\")\n",
+ " break\n",
+ " else:\n",
+ " y = y + x * pow(2,p)\n",
+ " n = n / 10\n",
+ " p += 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nEquivalent Decimal Number is %d.\"%(y))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Binary Number : 1111\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Equivalent Decimal Number is 15."
+ ]
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.60, Page number: 159<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read a positive integer number 'n' and generate the numbers in the following way.\n",
+ "#If entered number is 5 the output will be as follows.\n",
+ "#OUTPUT : 5 4 3 2 1 0 1 2 3 4 5\n",
+ "\n",
+ "\n",
+ "#Variable Initialization\n",
+ "k = 0\n",
+ "\n",
+ "n = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "i = n + 1\n",
+ "k = k - n\n",
+ "\n",
+ "while i != k:\n",
+ " sys.stdout.write(\"%3d\"%(abs(k)))\n",
+ " k += 1\n",
+ "\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 3 2 1 0 1 2 3"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.61, Page number: 160<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Enter a number through keyboard and find the sum of the digits.\n",
+ "\n",
+ "\n",
+ "#Variable Initialization\n",
+ "k = 1\n",
+ "sum1 = 0 #since sum is a built-in function in python, sum1 used instead of sum\n",
+ "\n",
+ "n = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Calculation \n",
+ "while n != 0:\n",
+ " k = n % 10\n",
+ " sum1 = sum1 + k\n",
+ " k = n / 10\n",
+ " n = k\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Sum of digits %d\"%(sum1))\n",
+ "\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 842\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum of digits 14"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.62, Page number: 161<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Enter few numbers and count the positive and negative numbers together\n",
+ "#with their sums. When 0 is entered program should be terminated.\n",
+ "\n",
+ "\n",
+ "#Variable Initialization\n",
+ "p = 0\n",
+ "n = 0\n",
+ "j = 1\n",
+ "s = 0\n",
+ "ns = 0\n",
+ "\n",
+ "#Calculation \n",
+ "sys.stdout.write(\"Enter Numbers (0) Exit : \")\n",
+ "while j != 0:\n",
+ " j = int(raw_input(\"\"))\n",
+ " if j > 0:\n",
+ " p += 1\n",
+ " s = s + j\n",
+ " else:\n",
+ " if j < 0:\n",
+ " n += 1\n",
+ " ns = ns + j\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nTotal Positive Numbers : %d\"%(p))\n",
+ "sys.stdout.write(\"\\nTotal Negative Numbers : %d\"%(n))\n",
+ "sys.stdout.write(\"\\nSum of Positive Numbers : %d\"%(s))\n",
+ "sys.stdout.write(\"\\nSum of Negative Numbers : %d\"%(ns))\n",
+ "\n",
+ "\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Numbers (0) Exit : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Total Positive Numbers : 5\n",
+ "Total Negative Numbers : 3\n",
+ "Sum of Positive Numbers : 15\n",
+ "Sum of Negative Numbers : -17"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.63, Page number: 162<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find sum of odd and even numbers separately by sorting the given numbers into\n",
+ "#odd and even numbers\n",
+ "\n",
+ "#Variable Initialization\n",
+ "c = 1\n",
+ "odd = 0\n",
+ "even = 0\n",
+ "\n",
+ "a = int(raw_input(\"Enter a Number : \"))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "sys.stdout.write(\"ODD EVEN\\n\")\n",
+ "while c <= a:\n",
+ " b = c % 2\n",
+ " while b == 0:\n",
+ " sys.stdout.write(\"\\t%d \"%(c))\n",
+ " even = even + c\n",
+ " b = 1\n",
+ " b = c % 2\n",
+ " while b != 0:\n",
+ " sys.stdout.write(\"\\n%d\"%(c))\n",
+ " odd = odd + c\n",
+ " b = 0\n",
+ " c += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\n==============================\")\n",
+ "sys.stdout.write(\"\\n %d %d\"%(odd,even))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number : 10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ODD EVEN\n",
+ "\n",
+ "1\t2 \n",
+ "3\t4 \n",
+ "5\t6 \n",
+ "7\t8 \n",
+ "9\t10 \n",
+ "==============================\n",
+ " 25 30"
+ ]
+ }
+ ],
+ "prompt_number": 70
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.64, Page number: 163<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the entered number in reverse order.\n",
+ "\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 1\n",
+ "\n",
+ "d = int(raw_input(\"Enter the number of digits : \"))\n",
+ "n = int(raw_input(\"Enter the number which is to be reversed : -\"))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "sys.stdout.write(\"\\nThe Reversed Number is :-\")\n",
+ "\n",
+ "while x <= d:\n",
+ " i = n % 10\n",
+ " sys.stdout.write(\"%d\"%(i))\n",
+ " n = n / 10\n",
+ " x += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of digits : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number which is to be reversed : -5428\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The Reversed Number is :-8245"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.65, Page number: 163<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Separate capitals, small, symbols and numbers from a statement\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 0\n",
+ "c = 0\n",
+ "s = 0\n",
+ "h = 0\n",
+ "n = 0\n",
+ "\n",
+ "#Array declaration\n",
+ "scan = [0 for i in range(0,40)]\n",
+ "cap = [0 for i in range(0,20)]\n",
+ "small = [0 for i in range(0,20)]\n",
+ "num = [0 for i in range(0,20)]\n",
+ "oth = [0 for i in range(0,20)]\n",
+ "\n",
+ "scan = raw_input(\"Enter Text Here : \")\n",
+ "\n",
+ "i = 0\n",
+ "\n",
+ "while i < len(scan): #There is no null termination character in python.\n",
+ " if scan[i] >= '0' and scan[i] <= '9':\n",
+ " n += 1\n",
+ " num[n] = scan[i]\n",
+ " else:\n",
+ " if scan[i] >= 'A' and scan[i] <= 'Z':\n",
+ " c += 1\n",
+ " cap[c] = scan[i]\n",
+ " else:\n",
+ " if scan[i] >= 'a' and scan[i] <= 'z':\n",
+ " s += 1\n",
+ " small[s] = scan[i]\n",
+ " else:\n",
+ " h += 1\n",
+ " oth[h] = scan[i]\n",
+ " \n",
+ " i += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nCapital Letters : [\")\n",
+ "for i in range(0,20):\n",
+ " sys.stdout.write(\"%c\"%cap[i])\n",
+ "\n",
+ "sys.stdout.write(\"]\\nSmall Letters : [\")\n",
+ "for i in range(0,20):\n",
+ " sys.stdout.write(\"%c\"%(small[i]))\n",
+ " \n",
+ "sys.stdout.write(\"]\\nNumeric Letters : [\")\n",
+ "for i in range(0,20):\n",
+ " sys.stdout.write(\"%c\"%(num[i]))\n",
+ "\n",
+ "sys.stdout.write(\"]\\nOther Letters : [\")\n",
+ "for i in range(0,20):\n",
+ " sys.stdout.write(\"%c\"%(oth[i]))\n",
+ "sys.stdout.write(\"]\")\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text Here : HAVE A NICE DAY, contact me on 51606.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Capital Letters : [\u0000HAVEANICEDAY\u0000\u0000\u0000\u0000\u0000\u0000\u0000]\n",
+ "Small Letters : [\u0000contactmeon\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000]\n",
+ "Numeric Letters : [\u000051606\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000]\n",
+ "Other Letters : [\u0000 , .\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000]"
+ ]
+ }
+ ],
+ "prompt_number": 72
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.66, Page number: 165<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sort numbers, upper and lower case alphabets\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 48\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\" NUMBERS\\n\")\n",
+ "while i <= 57:\n",
+ " sys.stdout.write(\"%2c\"%(i))\n",
+ " i += 1\n",
+ "\n",
+ "i += 7\n",
+ "\n",
+ "sys.stdout.write(\"\\n CAPITAL ALPHABETS\\n\")\n",
+ "while i <= 90:\n",
+ " sys.stdout.write(\"%2c\"%(i))\n",
+ " i += 1\n",
+ " \n",
+ "i += 6\n",
+ "\n",
+ "sys.stdout.write(\"\\n SMALL ALPHABETS\\n\")\n",
+ "while i <= 122:\n",
+ " sys.stdout.write(\"%2c\"%(i))\n",
+ " i += 1\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " NUMBERS\n",
+ " 0 1 2 3 4 5 6 7 8 9\n",
+ " CAPITAL ALPHABETS\n",
+ " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\n",
+ " SMALL ALPHABETS\n",
+ " a b c d e f g h i j k l m n o p q r s t u v w x y z"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.67, Page number: 165<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sort numbers, upper and lower case alphabets\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 48\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Numbers : \")\n",
+ "while i < 124:\n",
+ " if i < 58:\n",
+ " sys.stdout.write(\"%2c\"%(i))\n",
+ " else:\n",
+ " if i == 58:\n",
+ " sys.stdout.write(\"\\nCapital Letters : \")\n",
+ " i += 7\n",
+ " if i > 64 and i < 91:\n",
+ " sys.stdout.write(\"%2c\"%(i))\n",
+ " if i == 90:\n",
+ " sys.stdout.write(\"\\nSmall Letters : \")\n",
+ " i += 7\n",
+ " if i > 96 and i < 123:\n",
+ " sys.stdout.write(\"%2c\"%(i))\n",
+ " i += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Numbers : 0 1 2 3 4 5 6 7 8 9\n",
+ "Capital Letters : A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\n",
+ "Small Letters : a b c d e f g h i j k l m n o p q r s t u v w x y z"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.68, Page number: 167<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display all ASCII numbers and their equivalent character, numbers and symbols using while loop. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 64\n",
+ "c = 'Y'\n",
+ "\n",
+ "#Result\n",
+ "while c == 'Y':\n",
+ " sys.stdout.write(\"\\t%c (%d)\"%(i,i))\n",
+ " i += 1\n",
+ " sys.stdout.write(\"\\nPrint (Y/N)\")\n",
+ " c = raw_input(\"\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t@ (64)\n",
+ "Print (Y/N)\tA (65)"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Print (Y/N)\tB (66)"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Print (Y/N)\tC (67)"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Print (Y/N)"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.69, Page number: 168<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert entered character into its opposite case. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\n*Enter 'E' to exit\")\n",
+ "sys.stdout.write(\"\\n*Enter only characters\")\n",
+ "\n",
+ "while c != 'E':\n",
+ " sys.stdout.write(\"\\nEnter a character : \")\n",
+ " c = raw_input(\"Enter a character :\")\n",
+ " if c == c.upper():\n",
+ " c = ord(c)\n",
+ " sys.stdout.write(\"\\tIt's Lower Case : %c\"%(chr(c+32)))\n",
+ " else:\n",
+ " c = ord(c)\n",
+ " sys.stdout.write(\"\\tIt's Upper Case : %s\"%(chr(c-32)))\n",
+ " c = chr(c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "*Enter 'E' to exit\n",
+ "*Enter only characters\n",
+ "Enter a character : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a character :s\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\tIt's Upper Case : S\n",
+ "Enter a character : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a character :A\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\tIt's Lower Case : a\n",
+ "Enter a character : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a character :E\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\tIt's Lower Case : e"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.70, Page number: 169<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print numbers after each iteration and messages after termination of each loop using 3 nested while loop.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 1\n",
+ "j = 1\n",
+ "k = 1\n",
+ "\n",
+ "#Result\n",
+ "while i < 4:\n",
+ " while j < 3:\n",
+ " while k < 2:\n",
+ " sys.stdout.write(\"\\n\\ni = %d j = %d k = %d\"%(i,j,k))\n",
+ " k += 1\n",
+ " sys.stdout.write(\"\\nInner Loop (k) Completed.\")\n",
+ " k = 1\n",
+ " j += 1\n",
+ " sys.stdout.write(\"\\nMiddle Loop (j) Completed.\")\n",
+ " j = 1\n",
+ " i += 1\n",
+ "sys.stdout.write(\"\\nOuter Loop (i) Completed.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "i = 1 j = 1 k = 1\n",
+ "Inner Loop (k) Completed.\n",
+ "\n",
+ "i = 1 j = 2 k = 1\n",
+ "Inner Loop (k) Completed.\n",
+ "Middle Loop (j) Completed.\n",
+ "\n",
+ "i = 2 j = 1 k = 1\n",
+ "Inner Loop (k) Completed.\n",
+ "\n",
+ "i = 2 j = 2 k = 1\n",
+ "Inner Loop (k) Completed.\n",
+ "Middle Loop (j) Completed.\n",
+ "\n",
+ "i = 3 j = 1 k = 1\n",
+ "Inner Loop (k) Completed.\n",
+ "\n",
+ "i = 3 j = 2 k = 1\n",
+ "Inner Loop (k) Completed.\n",
+ "Middle Loop (j) Completed.\n",
+ "Outer Loop (i) Completed."
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.71, Page number: 170<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display a message \"This is a program of do while loop\". for 5 times using do while loop.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 1\n",
+ "\n",
+ "#Result\n",
+ "#There is no do..while loop in python\n",
+ "while i <= 5:\n",
+ " sys.stdout.write(\"\\nThis is a program of do while loop.\")\n",
+ " i += 1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "This is a program of do while loop.\n",
+ "This is a program of do while loop.\n",
+ "This is a program of do while loop.\n",
+ "This is a program of do while loop.\n",
+ "This is a program of do while loop."
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.72, Page number: 171<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Print the entered number in reverse order and find sum and product of digits using do-while loop. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "#since sum is a built-in function in python, sum1 is used instead of sum\n",
+ "x = 1\n",
+ "mul = 1\n",
+ "sum1 = 0\n",
+ "\n",
+ "d = int(raw_input(\"Enter the number of digits : -\"))\n",
+ "n = int(raw_input(\"Enter the number which is to be reversed :-\"))\n",
+ "\n",
+ "#Result\n",
+ "#There is no do..while loop in python\n",
+ "sys.stdout.write(\"\\nReveresed Number :- \")\n",
+ "while x <= d:\n",
+ " i = n % 10\n",
+ " sys.stdout.write(\"%d\"%(i))\n",
+ " sum1 = sum1 + i\n",
+ " mul = mul * i\n",
+ " n = n / 10\n",
+ " x += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\nAddition of digits :- %4d\"%(sum1))\n",
+ "sys.stdout.write(\"\\nMultiplication of digits :- %4d\"%(mul))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of digits : -4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number which is to be reversed :-4321\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Reveresed Number :- 1234\n",
+ "Addition of digits :- 10\n",
+ "Multiplication of digits :- 24"
+ ]
+ }
+ ],
+ "prompt_number": 74
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.73, Page number: 172<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Attempt the question 6.72 by considering the false condition i.e. the value of i should\n",
+ "#be initially larger than the value in the while loop.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 7\n",
+ "\n",
+ "#Result\n",
+ "#There is no do-while loop in python\n",
+ "sys.stdout.write(\"\\nThis is a program of do while loop\")\n",
+ "while i <= 5:\n",
+ " sys.stdout.write(\"\\nThis is a program of do while loop\")\n",
+ " i += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "This is a program of do while loop"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.74, Page number: 172<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the cubes of 1 to 10 numbers using do-while loop.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nPrint the numbers and their cubes\\n\")\n",
+ "while x <= 10:\n",
+ " y = pow(x,3)\n",
+ " sys.stdout.write(\"%4d %27d\\n\"%(x,y))\n",
+ " x += 1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Print the numbers and their cubes\n",
+ " 1 1\n",
+ " 2 8\n",
+ " 3 27\n",
+ " 4 64\n",
+ " 5 125\n",
+ " 6 216\n",
+ " 7 343\n",
+ " 8 512\n",
+ " 9 729\n",
+ " 10 1000\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.75, Page number: 173<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the given number is prime or not.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 2\n",
+ "n = int(raw_input(\"Enter The number for testing (prime or not) : \"))\n",
+ "\n",
+ "#Result\n",
+ "#There is no do-while loop in python\n",
+ "while x < n:\n",
+ " if n % x == 0:\n",
+ " sys.stdout.write(\"\\nThe number %d is not prime.\"%(n))\n",
+ " exit(0)\n",
+ " x += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\nThe number %d is prime\"%(n))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter The number for testing (prime or not) : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The number 5 is prime"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.76, Page number: 174<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count the number of students having age less than 25 and weight less than 50Kg out of five.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "count = 0\n",
+ "x = 1\n",
+ "\n",
+ "sys.stdout.write(\"\\nEnter data of 5 boys\\n\")\n",
+ "sys.stdout.write(\"\\nAge Weight\\n\")\n",
+ "\n",
+ "#There is no do-while loop in python\n",
+ "while x <= 5:\n",
+ " age = int(raw_input(\"\"))\n",
+ " wt = float(raw_input(\"\"))\n",
+ " if age < 25 and wt < 50:\n",
+ " count += 1\n",
+ " x += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nNumber of boys with age < 25\")\n",
+ "sys.stdout.write(\"and weight < 50Kg = %d\\n\"%(count))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter data of 5 boys\n",
+ "\n",
+ "Age Weight\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "24\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "51\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "45\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "51\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "35\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "24\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "54\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Number of boys with age < 25and weight < 50Kg = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.77, Page number: 175<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compute the factorial of given number using do while loop.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "fact = 1\n",
+ "a = int(raw_input(\"Enter The Number : \"))\n",
+ "sys.stdout.write(\"\\nEnter The Number : %d\\n\"%(a))\n",
+ "\n",
+ "#Calculation\n",
+ "#There is no do-while loop in python\n",
+ "while a >= 1:\n",
+ " sys.stdout.write(\"%d * \"%(a))\n",
+ " fact = fact * a\n",
+ " a -= 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\" = %d\"%(fact))\n",
+ "sys.stdout.write(\"\\nFactorial of Given number is %d\"%(fact))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter The Number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter The Number : 5\n",
+ "5 * 4 * 3 * 2 * 1 * = 120\n",
+ "Factorial of Given number is 120"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.78, Page number: 175<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Evaluate the series such as 1+2+3+ .. i. Using do-while loop. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 1\n",
+ "s = 0\n",
+ "\n",
+ "i = int(raw_input(\"Enter a number : \"))\n",
+ "\n",
+ "#Calculation and Result\n",
+ "#There is no do-while loop in python\n",
+ "while a <= i:\n",
+ " sys.stdout.write(\"%d + \"%(a))\n",
+ " s = s + a\n",
+ " a += 1\n",
+ " \n",
+ "sys.stdout.write(\"\\b\\bs = %d\"%(s))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 + 2 + 3 + 4 + 5 + \b\bs = 15"
+ ]
+ }
+ ],
+ "prompt_number": 78
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.79, Page number: 176<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use while statement in do-while loop and print values from 1 to 5\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = 0\n",
+ "\n",
+ "#There is no do-while loop in python\n",
+ "while x < 5:\n",
+ " x += 1\n",
+ " sys.stdout.write(\"\\t%d\"%(x))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t1\t2\t3\t4\t5"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter7.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter7.ipynb new file mode 100755 index 00000000..ac82414f --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter7.ipynb @@ -0,0 +1,3644 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 7: Arrays<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.1, Page number: 186<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print size of various data types using arrays.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = [0 for i in range(0,10)]\n",
+ "c = ['0' for i in range(0,10)]\n",
+ "l = [sys.maxint+5 for i in range(0,10)]\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"The type 'int' requires %d Bytes\"%(sys.getsizeof(int)))\n",
+ "sys.stdout.write(\"\\nThe type 'char' requires %d Bytes\"%(sys.getsizeof(str)))\n",
+ "sys.stdout.write(\"\\nThe type 'long' requires %d Bytes\"%(sys.getsizeof(long)))\n",
+ "sys.stdout.write(\"\\n%d memory locations are reserved for ten 'int' elements\"%(sys.getsizeof(i)))\n",
+ "sys.stdout.write(\"\\n%d memory locations are reserved for ten 'int' elements\"%(sys.getsizeof(c)))\n",
+ "sys.stdout.write(\"\\n%d memory locations are reserved for ten 'int' elements\"%(sys.getsizeof(l)))\n",
+ "\n",
+ "#python data types are different from C"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The type 'int' requires 436 Bytes\n",
+ "The type 'char' requires 436 Bytes\n",
+ "The type 'long' requires 436 Bytes\n",
+ "12 memory locations are reserved for ten 'int' elements\n",
+ "100 memory locations are reserved for ten 'int' elements\n",
+ "100 memory locations are reserved for ten 'int' elements"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.2, Page number: 187<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display character array with their address.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "name = ['A','R','R','A','Y']\n",
+ "i = 0\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nCharacter Memory Location\\n\")\n",
+ "while i < len(name):\n",
+ " sys.stdout.write(\"\\n[%c]\\t\\t[%d]\"%(name[i],id(name[i])))\n",
+ " i += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Character Memory Location\n",
+ "\n",
+ "[A]\t\t[31712968]\n",
+ "[R]\t\t[31527832]\n",
+ "[R]\t\t[31527832]\n",
+ "[A]\t\t[31712968]\n",
+ "[Y]\t\t[31712248]"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.3, Page number: 188<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find sum of even and odd numbers from 1 to 10. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "sumo = 0\n",
+ "sume = 0\n",
+ "i = 0\n",
+ "a = -1\n",
+ "b = -1\n",
+ "\n",
+ "odd = [0 for i in range(0,5)]\n",
+ "even = [0 for i in range(0,5)]\n",
+ "\n",
+ "#Calculation\n",
+ "for i in range(1,10+1):\n",
+ " if i%2 == 0:\n",
+ " a += 1\n",
+ " even[a] = i\n",
+ " else:\n",
+ " b += 1\n",
+ " odd[b] = i\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\n\\tEven \\t\\tOdd\")\n",
+ "for i in range(0,5):\n",
+ " sys.stdout.write(\"\\n\\t %d\\t\\t %d\"%(even[i],odd[i]))\n",
+ " sume = sume + even[i]\n",
+ " sumo = sumo + odd[i]\n",
+ "\n",
+ "sys.stdout.write(\"\\n\\t==========================\\n\")\n",
+ "sys.stdout.write(\"Addition : %d %14d\"%(sume,sumo))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\tEven \t\tOdd\n",
+ "\t 2\t\t 1\n",
+ "\t 4\t\t 3\n",
+ "\t 6\t\t 5\n",
+ "\t 8\t\t 7\n",
+ "\t 10\t\t 9\n",
+ "\t==========================\n",
+ "Addition : 30 25"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.4, Page number: 189<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find sum of even numbers and product of odd numbers from 5 input values.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 0\n",
+ "m = 1\n",
+ "num = [0 for i in range(0,5)]\n",
+ "\n",
+ "for i in range(0,5):\n",
+ " sys.stdout.write(\"\\nEnter Number [%d] : \"%(i+1))\n",
+ " num[i] = int(raw_input(\"\"))\n",
+ "\n",
+ "#Calculation and Result\n",
+ "sys.stdout.write(\"\\n==================================\")\n",
+ "for i in range(0,5):\n",
+ " if num[i]%2 == 0:\n",
+ " sys.stdout.write(\"\\nEven Number : %d\"%(num[i]))\n",
+ " a = a + num[i]\n",
+ " else:\n",
+ " sys.stdout.write(\"\\nOdd Number : %d\"%(num[i]))\n",
+ " m = m * num[i]\n",
+ "\n",
+ "sys.stdout.write(\"\\n==================================\")\n",
+ "sys.stdout.write(\"\\nAddition of Even Numbers : %d\"%(a))\n",
+ "sys.stdout.write(\"\\nProduct of Odd Numbers : %d\"%(m))\n",
+ "sys.stdout.write(\"\\n==================================\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Number [1] : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Number [2] : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Number [3] : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Number [4] : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Number [5] : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "==================================\n",
+ "Odd Number : 1\n",
+ "Even Number : 2\n",
+ "Odd Number : 3\n",
+ "Even Number : 4\n",
+ "Odd Number : 5\n",
+ "==================================\n",
+ "Addition of Even Numbers : 6\n",
+ "Product of Odd Numbers : 15\n",
+ "=================================="
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.5, Page number: 190<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print string in the reverse order.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "s = ['0' for i in range(0,15)]\n",
+ "\n",
+ "s = raw_input(\"Enter a String : \\n\")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Reverse String : \\n\")\n",
+ "\n",
+ "#Since there is no null terminating character for string in python, length of string is taken to give the index range\n",
+ "#index range is given -1 to include the index 0 also.\n",
+ "\n",
+ "for i in range(len(s)-1,-1,-1): \n",
+ " sys.stdout.write(\"%c\"%s[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a String : \n",
+ "HELLO\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverse String : \n",
+ "OLLEH"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.6, Page number: 191<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detect the occurrence of a character in a given string.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "s = ['0' for i in range(0,15)]\n",
+ "c = 0\n",
+ "\n",
+ "s = raw_input(\"Enter a String : \")\n",
+ "f = raw_input(\"Enter a Character to Find :\")\n",
+ "\n",
+ "#Calculation\n",
+ "for i in range(0,len(s)):\n",
+ " if s[i] == f:\n",
+ " c += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"The Character (%c) in a String (%s) occurs %d times.\"%(f,s,c))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a String : programmer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Character to Find :r\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Character (r) in a String (programmer) occurs 3 times."
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.7, Page number: 192<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the elements of two arrays in two separate columns and add their\n",
+ "#corresponding elements and display in the 3rd column.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "num = [24,34,12,44,56,17]\n",
+ "num1 = [12,24,35,78,85,22]\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Element of Array 1st - 2nd Array Addition\\n\")\n",
+ "for i in range(0,5+1):\n",
+ " sys.stdout.write(\"\\n\\t\\t%d + %d = %d\"%(num[i],num1[i],num[i]+num1[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Element of Array 1st - 2nd Array Addition\n",
+ "\n",
+ "\t\t24 + 12 = 36\n",
+ "\t\t34 + 24 = 58\n",
+ "\t\t12 + 35 = 47\n",
+ "\t\t44 + 78 = 122\n",
+ "\t\t56 + 85 = 141\n",
+ "\t\t17 + 22 = 39"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.8, Page number: 192<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find sum of 3 numbers by entering as character type.\n",
+ "\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "real = [['0' for i in range(0,6)] for i in range(0,6)]\n",
+ "ima = [['0' for i in range(0,6)] for i in range(0,6)]\n",
+ "\n",
+ "for l in range(0,3):\n",
+ " c = int(raw_input(\"Enter Number : \"))\n",
+ " r = c/255\n",
+ " i = c%255\n",
+ " real[l][5] = r\n",
+ " ima[l][5] = i\n",
+ "\n",
+ "c = 0\n",
+ "\n",
+ "for l in range(0,3):\n",
+ " c = c + real[l][5]*255 + ima[l][5]\n",
+ "\n",
+ "sys.stdout.write(\"\\nSum of 3 Numbers : %3ld\"%(c))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number : 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Sum of 3 Numbers : 12"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.9, Page number: 193<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Accept any string upto 15 characters. Display the elements of string with their\n",
+ "#element numbers in a separate column.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "#name = ['0' for i in range(0,15)]\n",
+ "name = raw_input(\"Enter your name : \")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Element no. & Character\\n\")\n",
+ "for i in range(0,len(name)): #There is no null termination character for string in python\n",
+ " sys.stdout.write(\"\\n%d \\t %c\"%(i,name[i])) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name : amit\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Element no. & Character\n",
+ "\n",
+ "0 \t a\n",
+ "1 \t m\n",
+ "2 \t i\n",
+ "3 \t t"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.10, Page number: 194<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display names of days of a week \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "day = [0 for i in range(0,7)]\n",
+ "\n",
+ "sys.stdout.write(\"Enter numbers between 1 to 7 : \")\n",
+ "for i in range(0,6+1):\n",
+ " day[i] = int(raw_input(\"\"))\n",
+ "\n",
+ "#Result\n",
+ "#There is no switch statement in python. use functions and dictionary or if statement instead.\n",
+ "for i in range(0,6+1):\n",
+ " if day[i] == 1:\n",
+ " sys.stdout.write(\"\\n%dst day of week is Sunday\"%(day[i]))\n",
+ " else:\n",
+ " if day[i] == 2:\n",
+ " sys.stdout.write(\"\\n%dnd day of week is Monday\"%(day[i]))\n",
+ " else:\n",
+ " if day[i] == 3:\n",
+ " sys.stdout.write(\"\\n%drd day of week is Tuesday\"%(day[i]))\n",
+ " else:\n",
+ " if day[i] == 4:\n",
+ " sys.stdout.write(\"\\n%dth day of week is Wednesday\"%(day[i]))\n",
+ " else:\n",
+ " if day[i] == 5:\n",
+ " sys.stdout.write(\"\\n%dth day of week is Thursday\"%(day[i]))\n",
+ " else:\n",
+ " if day[i] == 6:\n",
+ " sys.stdout.write(\"\\n%dth day of week is Friday\"%(day[i]))\n",
+ " else:\n",
+ " if day[i] == 7:\n",
+ " sys.stdout.write(\"\\n%dth day of week is Saturday\"%(day[i]))\n",
+ " else:\n",
+ " sys.stdout.write(\"\\n%dth is invalid day.\"%(day[i]))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter numbers between 1 to 7 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "1st day of week is Sunday\n",
+ "3rd day of week is Tuesday\n",
+ "2nd day of week is Monday\n",
+ "4th day of week is Wednesday\n",
+ "5th day of week is Thursday\n",
+ "7th day of week is Saturday\n",
+ "8th is invalid day."
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.11, Page number: 195<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the contents of two arrays where the 1st array should contain the string and 2nd numerical numbers.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "city = ['N','A','N','D','E','D']\n",
+ "pin = [4,3,1,6,0,3]\n",
+ "\n",
+ "#Result\n",
+ "for i in city:\n",
+ " sys.stdout.write(\"%c\"%(i))\n",
+ "\n",
+ "sys.stdout.write(\" - \")\n",
+ "for i in pin:\n",
+ " sys.stdout.write(\"%d\"%(i))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NANDED - 431603"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.12, Page number: 195<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the number of days of different months of year.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "month = [31,28,31,30,31,30,31,31,30,31,30,31]\n",
+ "\n",
+ "#Result\n",
+ "for i in range(0,11+1):\n",
+ " sys.stdout.write(\"\\nMonth [%d] of a year contains %d days.\"%(i+1,month[i]))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Month [1] of a year contains 31 days.\n",
+ "Month [2] of a year contains 28 days.\n",
+ "Month [3] of a year contains 31 days.\n",
+ "Month [4] of a year contains 30 days.\n",
+ "Month [5] of a year contains 31 days.\n",
+ "Month [6] of a year contains 30 days.\n",
+ "Month [7] of a year contains 31 days.\n",
+ "Month [8] of a year contains 31 days.\n",
+ "Month [9] of a year contains 30 days.\n",
+ "Month [10] of a year contains 31 days.\n",
+ "Month [11] of a year contains 30 days.\n",
+ "Month [12] of a year contains 31 days."
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.13, Page number: 197<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the number of days of given month of a year.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "month = [1,3,5,7,8,10,12,4,6,9,11,2]\n",
+ "\n",
+ "mn = int(raw_input(\"Enter Number of Month : \"))\n",
+ "\n",
+ "for i in range(0,11+1):\n",
+ " if mn == month[i]: #There is no goto statement in python\n",
+ " if i+1 == 12:\n",
+ " sys.stdout.write(\"Month (%d) Contains 28 days.\"%(month[i]))\n",
+ " if i+1 < 8:\n",
+ " sys.stdout.write(\"Month (%d) Contains 31 days.\"%(month[i]))\n",
+ " if i+1 > 7 and i+1 != 12:\n",
+ " sys.stdout.write(\"Month (%d) Contains 30 days.\"%(month[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number of Month : 2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Month (2) Contains 28 days."
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.14, Page number: 198<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the average sales of an item out of 12 months sale.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "#Since sum is a built in function in python, sum1 is used instead of sum.\n",
+ "sum1 = 0\n",
+ "avg = 0\n",
+ "\n",
+ "sys.stdout.write(\"Enter Month No.- Sale of an Item/month\\n\")\n",
+ "\n",
+ "item = [0 for i in range(0,11+1)]\n",
+ "for sale in range(0,11+1):\n",
+ " item[sale] = int(raw_input(\"\\t%d = \"%(sale+1)))\n",
+ "\n",
+ "#Calculation\n",
+ "for sale in range(0,11+1):\n",
+ " sum1 = sum1 + item[sale]\n",
+ "\n",
+ "avg = sum1/12.0\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nAverage Sale if an item/month = %f\"%(avg))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Month No.- Sale of an Item/month\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t1 = 125\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t2 = 225\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t3 = 325\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t4 = 425\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t5 = 525\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t6 = 625\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t7 = 725\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t8 = 825\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t9 = 925\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t10 = 500\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t11 = 600\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t12 = 700\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Average Sale if an item/month = 543.750000"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.15, Page number: 199<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the similar elements in an array and find the occurrence of similar\n",
+ "#numbers for number of times.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "k = 0\n",
+ "j = 1\n",
+ "\n",
+ "item = [0 for i in range(0,4+1)]\n",
+ "sys.stdout.write(\"\\nEnter Numbers.\\n\")\n",
+ "for i in range(0,4+1):\n",
+ " item[i] = int(raw_input(\"%d = \"%(i)))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "for j in range(0,4+1):\n",
+ " for i in range(j+1,4+1):\n",
+ " if item[j] == item[i]:\n",
+ " sys.stdout.write(\"\\n%d %d Elements are same.\"%(j,i))\n",
+ " k += 1\n",
+ "\n",
+ "if k == 10:\n",
+ " sys.stdout.write(\"\\nAll elements are same\")\n",
+ "else:\n",
+ " if k == 0:\n",
+ " sys.stdout.write(\"\\nNo Elements are same.\")\n",
+ " else:\n",
+ " sys.stdout.write(\"\\nElements Contains Double Numbers.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter Numbers.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 = 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 = 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 = 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3 = 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 = 9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "0 3 Elements are same.\n",
+ "Elements Contains Double Numbers."
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.16, Page number: 200<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate and display total cost of 4 models of Pentium PCs.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "pccode = [1,2,3,4]\n",
+ "t = 0\n",
+ "price = [25000,30000,35000,40000]\n",
+ "stock = [25,20,15,20]\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nStock & Total Cost Details\")\n",
+ "sys.stdout.write(\"\\n========================================================\")\n",
+ "sys.stdout.write(\"\\nModel\\t\\tQty.\\tRate(Rs.)\\tTotal Value\")\n",
+ "sys.stdout.write(\"\\n========================================================\")\n",
+ "\n",
+ "for i in range(0,3+1):\n",
+ " sys.stdout.write(\"\\nPentium%d\\t%d\\t%8ld %15ld\"%(pccode[i],stock[i],price[i],price[i]*stock[i]))\n",
+ " t = t + price[i] * stock[i]\n",
+ "\n",
+ "sys.stdout.write(\"\\n========================================================\")\n",
+ "sys.stdout.write(\"\\nTotal Value of All PCs in Rs. %ld\"%(t))\n",
+ "sys.stdout.write(\"\\n========================================================\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Stock & Total Cost Details\n",
+ "========================================================\n",
+ "Model\t\tQty.\tRate(Rs.)\tTotal Value\n",
+ "========================================================\n",
+ "Pentium1\t25\t 25000 625000\n",
+ "Pentium2\t20\t 30000 600000\n",
+ "Pentium3\t15\t 35000 525000\n",
+ "Pentium4\t20\t 40000 800000\n",
+ "========================================================\n",
+ "Total Value of All PCs in Rs. 2550000\n",
+ "========================================================"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.17, Page number: 201<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the given message by using putc() and stdout() functions.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "msg = \"C is Easy\"\n",
+ "i = 0\n",
+ "\n",
+ "#Result\n",
+ "#There is no putc function and null termination in python.\n",
+ "while i < len(msg):\n",
+ " sys.stdout.write(\"%c\"%(msg[i]))\n",
+ " i += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C is Easy"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.18, Page number: 202<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the text through keyboard and display it by using\n",
+ "#stdin and stdout streams.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "ch = raw_input(\"Input a Text : \")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"The Text Entered was\\n\")\n",
+ "\n",
+ "for i in ch:\n",
+ " sys.stdout.write(\"%c\"%(i))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input a Text : Hello World\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Text Entered was\n",
+ "Hello World"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.19, Page number: 202<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sort the given strings alphabetically.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text = raw_input(\"Enter Text Below : \")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Sorted Text Below : \\n\")\n",
+ "for i in range(65,90+1):\n",
+ " for j in range(0,len(text)):\n",
+ " if text[j] == chr(i).upper() or text[j] == chr(i).lower():\n",
+ " sys.stdout.write(\"%c\"%(text[j]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text Below : Hello\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted Text Below : \n",
+ "eHllo"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.20, Page number: 203<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Arrange the numbers in increasing and decreasing order\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "sys.stdout.write(\"Enter ten numbers : \")\n",
+ "a = [0 for i in range(0,10)]\n",
+ "\n",
+ "for i in range(0,10):\n",
+ " a[i] = int(raw_input(\"\"))\n",
+ "sum1 = 0\n",
+ "\n",
+ "#Calculation\n",
+ "sum1 = sum(a)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Numbers In Ascending Order : \")\n",
+ "for i in range(0,sum1):\n",
+ " for j in range(0,10):\n",
+ " if i == a[j]:\n",
+ " sys.stdout.write(\"%3d\"%(a[j]))\n",
+ " \n",
+ "sys.stdout.write(\"\\nNumbers In Descending Order : \")\n",
+ "for i in range(sum1,0,-1):\n",
+ " for j in range(0,10):\n",
+ " if i == a[j]:\n",
+ " sys.stdout.write(\"%3d\"%(a[j]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter ten numbers : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Numbers In Ascending Order : 1 2 3 4 5 7 9 9 10 12\n",
+ "Numbers In Descending Order : 12 10 9 9 7 5 4 3 2 1"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.21, Page number: 205<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sorting in ascending order by comparison method.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "\n",
+ "n = int(raw_input(\"Enter how many numbers to sort : \"))\n",
+ "\n",
+ "num = [0 for i in range(0,n)]\n",
+ "for i in range(0,n):\n",
+ " num[i] = int(raw_input(\"Enter numbers # %2d : \"%(i+1)))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"The Numbers Entered through keyboard\\n\")\n",
+ "for i in range(0,n):\n",
+ " sys.stdout.write(\"%4d\"%(num[i]))\n",
+ "for i in range(0,n-1):\n",
+ " for j in range(i+1,n):\n",
+ " if num[i] > num[j]:\n",
+ " temp = num[i]\n",
+ " num[i] = num[j]\n",
+ " num[j] = temp\n",
+ "\n",
+ "sys.stdout.write(\"\\nThe Numbers in ascending order\\n\")\n",
+ "for i in num:\n",
+ " sys.stdout.write(\"%4d\"%(i))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter how many numbers to sort : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter numbers # 1 : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter numbers # 2 : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter numbers # 3 : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter numbers # 4 : 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter numbers # 5 : 9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Numbers Entered through keyboard\n",
+ " 8 3 2 1 9\n",
+ "The Numbers in ascending order\n",
+ " 1 2 3 8 9"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.22, Page number: 206<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Evaluate the series contains sum of square of\n",
+ "#numbers from 1 to n. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "s = 0\n",
+ "sqr = [0 for i in range(0,15)]\n",
+ "\n",
+ "n = int(raw_input(\"Enter value of n : \"))\n",
+ "\n",
+ "for i in range(0,n):\n",
+ " sqr[i] = pow(i+1,2)\n",
+ " \n",
+ "for i in range(0,n):\n",
+ " sys.stdout.write(\"%d\\n\"%(sqr[i]))\n",
+ " s = s + sqr[i]\n",
+ " \n",
+ "sys.stdout.write(\"Sum of square : %d\"%(s))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of n : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "4\n",
+ "9\n",
+ "16\n",
+ "Sum of square : 30"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.23, Page number: 207<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display two dimensional array elements together with their addresses\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [[0 for i in range(0,3)]for i in range(0,3)]\n",
+ "c = 1\n",
+ "\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " a[i][j] = c\n",
+ " c += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"Array Elements and addresses.\\n\")\n",
+ "sys.stdout.write(\" Col-0 Col-1 Col-2\\n\")\n",
+ "sys.stdout.write(\"========================================================\")\n",
+ "sys.stdout.write(\"\\nRow0\")\n",
+ "\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " sys.stdout.write(\" %d [%5d]\"%(a[i][j],id(a[i][j])))\n",
+ " sys.stdout.write(\"\\nRow%d\"%(i+1))\n",
+ "\n",
+ "sys.stdout.write(\"\\r\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array Elements and addresses.\n",
+ " Col-0 Col-1 Col-2\n",
+ "========================================================\n",
+ "Row0 1 [6215912] 2 [6215900] 3 [6215888]\n",
+ "Row1 4 [6215876] 5 [6215864] 6 [6215852]\n",
+ "Row2 7 [6215840] 8 [6215828] 9 [6215816]\n",
+ "Row3\r"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.24, Page number: 208<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the elements of two-dimensional array.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [[1,2,3],[4,5,6],[7,8,9]]\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"Elements of An Array.\\n\")\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " sys.stdout.write(\"%5d\"%(a[i][j]))\n",
+ " sys.stdout.write(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Elements of An Array.\n",
+ " 1 2 3\n",
+ " 4 5 6\n",
+ " 7 8 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.25, Page number: 209<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read codenos and balance and count the number of codenos, \n",
+ "#which are having the balance less than 1000.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "j = 0\n",
+ "bal = [[0 for i in range(0,5)]for i in range(0,5)]\n",
+ "\n",
+ "for i in range(0,5):\n",
+ " bal[i][1] = int(raw_input(\"Enter Code No & Balance : \"))\n",
+ " bal[i][2] = int(raw_input(\"Enter Code No & Balance : \"))\n",
+ " \n",
+ "sys.stdout.write(\"Your Entered Data : \")\n",
+ "for i in range(0,5):\n",
+ " sys.stdout.write(\"\\n%d %d\"%(bal[i][1],bal[i][2]))\n",
+ " if bal[i][2] < 1000:\n",
+ " j += 1\n",
+ " \n",
+ "sys.stdout.write(\"\\nBalance Less than 1000 are %d\"%(j))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 900\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 800\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 1200\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 550\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Code No & Balance : 600\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your Entered Data : \n",
+ "1 900\n",
+ "2 800\n",
+ "3 1200\n",
+ "4 550\n",
+ "5 600\n",
+ "Balance Less than 1000 are 4"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.26, Page number: 210<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Accept three elements in a one dimensional array and compute addition,square\n",
+ "#and cube. Display the results in two dimensional array.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [[0 for i in range(0,3)]for i in range(0,3)]\n",
+ "b = [0 for i in range(0,3)]\n",
+ "j = 0\n",
+ "\n",
+ "for i in range(0,3):\n",
+ " b[i] = int(raw_input(\"Enter Three Numbers : \"))\n",
+ "\n",
+ "#Calculation\n",
+ "for i in range(0,3):\n",
+ " a[i][j] = b[i]*2\n",
+ " a[i][j+1] = pow(b[i],2)\n",
+ " a[i][j+2] = pow(b[i],3)\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"Number\\tAddition\\tSquare\\t\\tCube\\n\")\n",
+ "for i in range(0,3):\n",
+ " sys.stdout.write(\"\\n%d\"%(b[i]))\n",
+ " for j in range(0,3):\n",
+ " sys.stdout.write(\"\\t%4d\\t\"%(a[i][j]))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three Numbers : 7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number\tAddition\tSquare\t\tCube\n",
+ "\n",
+ "5\t 10\t\t 25\t\t 125\t\n",
+ "\n",
+ "6\t 12\t\t 36\t\t 216\t\n",
+ "\n",
+ "7\t 14\t\t 49\t\t 343\t\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.27, Page number: 211<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read and display matrix\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [[0 for i in range(0,10)]for i in range(0,10)]\n",
+ "row = int(raw_input(\"Enter Order of matrix upto (10x10) A : \"))\n",
+ "col = int(raw_input(\"Enter Order of matrix upto (10x10) A : \"))\n",
+ "\n",
+ "for i in range(0,row):\n",
+ " for j in range(0,col):\n",
+ " a[i][j] = int(raw_input(\"Enter Elements of matrix A : \"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nThe Matrix is : \\n\")\n",
+ "for i in range(0,row):\n",
+ " for j in range(0,col):\n",
+ " sys.stdout.write(\"%6d\"%(a[i][j]))\n",
+ " sys.stdout.write(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Order of matrix upto (10x10) A : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Order of matrix upto (10x10) A : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The Matrix is : \n",
+ " 3 5 8\n",
+ " 4 8 5\n",
+ " 8 5 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.28, Page number: 212<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Transpose of matrix\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [[0 for i in range(0,10)]for i in range(0,10)]\n",
+ "b = [[0 for i in range(0,10)]for i in range(0,10)]\n",
+ "row1 = int(raw_input(\"Enter Order of matrix upto (10x10) A : \"))\n",
+ "col1 = int(raw_input(\"Enter Order of matrix upto (10x10) A : \"))\n",
+ "\n",
+ "for i in range(0,row1):\n",
+ " for j in range(0,col1):\n",
+ " a[i][j] = int(raw_input(\"Enter Elements of matrix A : \"))\n",
+ "row2 = col1\n",
+ "col2 = row1\n",
+ "\n",
+ "#Calculation\n",
+ "for i in range(0,row1):\n",
+ " for j in range(0,col1):\n",
+ " b[j][i] = a[i][j]\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nThe Matrix is : \\n\")\n",
+ "for i in range(0,row2):\n",
+ " for j in range(0,col2):\n",
+ " sys.stdout.write(\"%4d\"%(b[i][j]))\n",
+ " sys.stdout.write(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Order of matrix upto (10x10) A : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Order of matrix upto (10x10) A : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix A : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The Matrix is : \n",
+ " 3 4 8\n",
+ " 5 8 5\n",
+ " 8 5 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.29, Page number: 213<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Transpose of 3x3 matrix\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "mat = [[0 for i in range(0,3)]for i in range(0,3)]\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " mat[i][j] = int(raw_input(\"Enter Elements of matrix \"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Transpose of the matrix\\n\")\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " sys.stdout.write(\"\\t%d\"%(mat[j][i]))\n",
+ " sys.stdout.write(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix 9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix 7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of matrix 2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transpose of the matrix\n",
+ "\t5\t2\t7\n",
+ "\t8\t5\t5\n",
+ "\t9\t4\t2\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.30, Page number: 214<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Addition and subtraction of two matrices \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [[0 for i in range(0,10)]for i in range(0,10)]\n",
+ "b = [[0 for i in range(0,10)]for i in range(0,10)]\n",
+ "\n",
+ "r1 = int(raw_input(\"Enter Order of Matrix A & B upto 10x10\"))\n",
+ "c1 = int(raw_input(\"Enter Order of Matrix A & B upto 10x10\"))\n",
+ "\n",
+ "for i in range(0,r1):\n",
+ " for j in range(0,c1):\n",
+ " a[i][j] = int(raw_input(\"Enter Elements of Matrix A:\"))\n",
+ "\n",
+ "for i in range(0,r1):\n",
+ " for j in range(0,c1):\n",
+ " b[i][j] = int(raw_input(\"Enter Elements of Matrix B:\"))\n",
+ "\n",
+ "#Calculation and Result\n",
+ "sys.stdout.write(\"\\nMatrix Addition\\n\")\n",
+ "for i in range(0,r1):\n",
+ " for j in range(0,c1):\n",
+ " sys.stdout.write(\"%5d\"%(a[i][j]+b[i][j]))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ "\n",
+ "sys.stdout.write(\"\\nMatrix Subtraction\\n\")\n",
+ "for i in range(0,r1):\n",
+ " for j in range(0,c1):\n",
+ " sys.stdout.write(\"%5d\"%(a[i][j]-b[i][j]))\n",
+ " sys.stdout.write(\"\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Order of Matrix A & B upto 10x103\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Order of Matrix A & B upto 10x103\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Matrix Addition\n",
+ " 5 8 13\n",
+ " 2 14 12\n",
+ " 8 16 6\n",
+ "\n",
+ "Matrix Subtraction\n",
+ " 3 2 3\n",
+ " 2 4 4\n",
+ " -4 2 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.31, Page number: 216<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Multiplication of two matrices \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [[0 for i in range(0,10)]for i in range(0,10)]\n",
+ "b = [[0 for i in range(0,10)]for i in range(0,10)]\n",
+ "\n",
+ "r1 = int(raw_input(\"Enter Order of Matrix A & B upto 10x10\"))\n",
+ "c1 = int(raw_input(\"Enter Order of Matrix A & B upto 10x10\"))\n",
+ "\n",
+ "for i in range(0,r1):\n",
+ " for j in range(0,c1):\n",
+ " a[i][j] = int(raw_input(\"Enter Elements of Matrix A:\"))\n",
+ "\n",
+ "for i in range(0,r1):\n",
+ " for j in range(0,c1):\n",
+ " b[i][j] = int(raw_input(\"Enter Elements of Matrix B:\"))\n",
+ "\n",
+ "#Calculation and Result\n",
+ "sys.stdout.write(\"\\nMultiplication of corresponding elements\\n\")\n",
+ "for i in range(0,r1):\n",
+ " for j in range(0,c1):\n",
+ " sys.stdout.write(\"%5d\"%(a[i][j]*b[i][j]))\n",
+ " sys.stdout.write(\"\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Order of Matrix A & B upto 10x103\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Order of Matrix A & B upto 10x103\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix A:4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Elements of Matrix B:2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Multiplication of corresponding elements\n",
+ " 4 15 40\n",
+ " 0 45 32\n",
+ " 12 63 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.32, Page number: 217<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the Quantity & Price of various Pentium models using an array and\n",
+ "#Compute the total cost of all models.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "pc = [[0 for i in range(0,4)]for i in range(0,4)]\n",
+ "t = 0\n",
+ "\n",
+ "for i in range(0,4):\n",
+ " for j in range(0,2):\n",
+ " pc[i][j] = int(raw_input(\"Enter Qty. & Price for Pentium %d : \"%(i+1)))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"=====================================================\")\n",
+ "sys.stdout.write(\"\\nModel\\tQty.\\tRate(Rs.)\\tTotal Value\")\n",
+ "sys.stdout.write(\"\\n=====================================================\")\n",
+ "for i in range(0,4):\n",
+ " sys.stdout.write(\"\\nPentium %d %2ld %6ld %15ld\"%(i+1,pc[i][0],pc[i][1],pc[i][0]*pc[i][1]))\n",
+ " t = t + pc[i][0] * pc[i][1]\n",
+ "\n",
+ "sys.stdout.write(\"\\n=====================================================\")\n",
+ "sys.stdout.write(\"\\nTotal Value of All PCs in Rs. %ld\"%(t))\n",
+ "sys.stdout.write(\"\\n=====================================================\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Qty. & Price for Pentium 1 : 25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Qty. & Price for Pentium 1 : 25000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Qty. & Price for Pentium 2 : 20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Qty. & Price for Pentium 2 : 40000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Qty. & Price for Pentium 3 : 15\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Qty. & Price for Pentium 3 : 35000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Qty. & Price for Pentium 4 : 20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Qty. & Price for Pentium 4 : 40000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "=====================================================\n",
+ "Model\tQty.\tRate(Rs.)\tTotal Value\n",
+ "=====================================================\n",
+ "Pentium 1 25 25000 625000\n",
+ "Pentium 2 20 40000 800000\n",
+ "Pentium 3 15 35000 525000\n",
+ "Pentium 4 20 40000 800000\n",
+ "=====================================================\n",
+ "Total Value of All PCs in Rs. 2750000\n",
+ "====================================================="
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.33, Page number: 218<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the capacity of HD, it's price and quantity available in the form of an array\n",
+ "# and compute the cost of HD\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "hd = [[0 for i in range(0,4)]for i in range(0,4)]\n",
+ "t = 0\n",
+ "\n",
+ "for j in range(0,4):\n",
+ " for i in range(0,3):\n",
+ " hd[i][j] = int(raw_input(\"Enter Capacity, Price & Qty.:\"))\n",
+ " \n",
+ "sys.stdout.write(\"====================================================================\\n\")\n",
+ "sys.stdout.write(\"HD Capacity\\tGB Price Rs.\\tQuantity Total Value Rs.\")\n",
+ "sys.stdout.write(\"\\n====================================================================\\n\")\n",
+ "\n",
+ "for j in range(0,4):\n",
+ " for i in range(0,3):\n",
+ " sys.stdout.write(\"%2ld\"%(hd[i][j]))\n",
+ " sys.stdout.write(\"\\t\\t\")\n",
+ " if i == 2:\n",
+ " sys.stdout.write(\"%5ld\"%(hd[i-1][j]*hd[i][j]))\n",
+ " t = t + hd[i-1][j] * hd[i][j]\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " \n",
+ "sys.stdout.write(\"====================================================================\")\n",
+ "sys.stdout.write(\"\\nTotal Value Rs. %37ld\"%(t))\n",
+ "sys.stdout.write(\"\\n====================================================================\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:8000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:12000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:40\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:15000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:15\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:90\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:20000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Capacity, Price & Qty.:10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "====================================================================\n",
+ "HD Capacity\tGB Price Rs.\tQuantity Total Value Rs.\n",
+ "====================================================================\n",
+ "10\t\t8000\t\t25\t\t200000\n",
+ "20\t\t12000\t\t20\t\t240000\n",
+ "40\t\t15000\t\t15\t\t225000\n",
+ "90\t\t20000\t\t10\t\t200000\n",
+ "====================================================================\n",
+ "Total Value Rs. 865000\n",
+ "===================================================================="
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.34, Page number: 220<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the names of the cities with their base addresses.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "city = [\"Mumbai\",\"Chennai\",\"Kolkata\",\"Pune\",\"Delhi\"]\n",
+ "\n",
+ "#Result\n",
+ "for i in range(0,5):\n",
+ " sys.stdout.write(\"Base Address = %u\"%(id(city[i]))) #Memory address will differ in different systems\n",
+ " sys.stdout.write(\"\\tString = %s\\n\"%(city[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base Address = 60549024\tString = Mumbai\n",
+ "Base Address = 60550048\tString = Chennai\n",
+ "Base Address = 60550592\tString = Kolkata\n",
+ "Base Address = 60551104\tString = Pune\n",
+ "Base Address = 60550240\tString = Delhi\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.35, Page number: 220<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the binary bits corresponding to Hexadecimal numbers from\n",
+ "#0 to E and attach an odd parity to Hex numbers and display them.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "bin = [[0 for i in range(0,16)]for i in range(0,16)]\n",
+ "a = 0\n",
+ "c = 0\n",
+ "\n",
+ "for x in range(0,16):\n",
+ " y = x\n",
+ " for a in range(0,4):\n",
+ " bin[x][a] = y%2\n",
+ " y = y/2\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nInput Bits\\t Parity Bits\")\n",
+ "sys.stdout.write(\"\\n===================================\")\n",
+ "\n",
+ "for x in range(0,16):\n",
+ " c = 0\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " for y in range(3,0-1,-1):\n",
+ " sys.stdout.write(\"%3d\"%(bin[x][y]))\n",
+ " if bin[x][y] == 1:\n",
+ " c += 1\n",
+ " if c%2 == 0:\n",
+ " sys.stdout.write(\"%7d\"%(1))\n",
+ " else:\n",
+ " sys.stdout.write(\"%7d\"%(0))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Input Bits\t Parity Bits\n",
+ "===================================\n",
+ " 0 0 0 0 1\n",
+ " 0 0 0 1 0\n",
+ " 0 0 1 0 0\n",
+ " 0 0 1 1 1\n",
+ " 0 1 0 0 0\n",
+ " 0 1 0 1 1\n",
+ " 0 1 1 0 1\n",
+ " 0 1 1 1 0\n",
+ " 1 0 0 0 0\n",
+ " 1 0 0 1 1\n",
+ " 1 0 1 0 1\n",
+ " 1 0 1 1 0\n",
+ " 1 1 0 0 1\n",
+ " 1 1 0 1 0\n",
+ " 1 1 1 0 0\n",
+ " 1 1 1 1 1"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.36, Page number: 222<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert binary to gray codes.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "bin1 = [[0 for i in range(0,16)]for i in range(0,16)]\n",
+ "a = 0\n",
+ "c = 0\n",
+ "\n",
+ "#Calculation\n",
+ "for x in range(0,16):\n",
+ " y = x\n",
+ " for a in range(0,4):\n",
+ " bin1[x][a] = y%2\n",
+ " y = y/2\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nBinary Bits\\tGray Bits\")\n",
+ "sys.stdout.write(\"\\n==================================\")\n",
+ "\n",
+ "for x in range(0,16):\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " for y in range(3,0-1,-1):\n",
+ " sys.stdout.write(\"%3d\"%(bin1[x][y]))\n",
+ " sys.stdout.write(\"%5d %2d %2d %2d\"%(bin1[x][3],(bin1[x][3]^bin1[x][2]),(bin1[x][2]^bin1[x][1]),(bin1[x][1]^bin1[x][0])))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Binary Bits\tGray Bits\n",
+ "==================================\n",
+ " 0 0 0 0 0 0 0 0\n",
+ " 0 0 0 1 0 0 0 1\n",
+ " 0 0 1 0 0 0 1 1\n",
+ " 0 0 1 1 0 0 1 0\n",
+ " 0 1 0 0 0 1 1 0\n",
+ " 0 1 0 1 0 1 1 1\n",
+ " 0 1 1 0 0 1 0 1\n",
+ " 0 1 1 1 0 1 0 0\n",
+ " 1 0 0 0 1 1 0 0\n",
+ " 1 0 0 1 1 1 0 1\n",
+ " 1 0 1 0 1 1 1 1\n",
+ " 1 0 1 1 1 1 1 0\n",
+ " 1 1 0 0 1 0 1 0\n",
+ " 1 1 0 1 1 0 1 1\n",
+ " 1 1 1 0 1 0 0 1\n",
+ " 1 1 1 1 1 0 0 0"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.37, Page number: 224<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#working of three dimensional array.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "array_3d = [[[0 for i in range(0,3)]for i in range(0,3)]for i in range(0,3)]\n",
+ "\n",
+ "for a in range(0,3):\n",
+ " for b in range(0,3):\n",
+ " for c in range(0,3):\n",
+ " array_3d[a][b][c] = a+b+c\n",
+ "\n",
+ "#Result\n",
+ "for a in range(0,3):\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " for b in range(0,3):\n",
+ " for c in range(0,3):\n",
+ " sys.stdout.write(\"%3d\"%(array_3d[a][b][c]))\n",
+ " sys.stdout.write(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " 0 1 2\n",
+ " 1 2 3\n",
+ " 2 3 4\n",
+ "\n",
+ " 1 2 3\n",
+ " 2 3 4\n",
+ " 3 4 5\n",
+ "\n",
+ " 2 3 4\n",
+ " 3 4 5\n",
+ " 4 5 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.38, Page number: 225<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#working of four dimensional array\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "array_4d = [[[[0 for i in range(0,2)]for i in range(0,2)]for i in range(0,2)]for i in range(0,2)]\n",
+ "\n",
+ "for a in range(0,2):\n",
+ " for b in range(0,2):\n",
+ " for c in range(0,2):\n",
+ " for d in range(0,2):\n",
+ " array_4d[a][b][c][d] = a+b+c+d\n",
+ " \n",
+ "#Result\n",
+ "for a in range(0,2):\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " for b in range(0,2):\n",
+ " for c in range(0,2):\n",
+ " for d in range(0,2):\n",
+ " sys.stdout.write(\"%3d\"%(array_4d[a][b][c][d]))\n",
+ " sys.stdout.write(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " 0 1\n",
+ " 1 2\n",
+ " 1 2\n",
+ " 2 3\n",
+ "\n",
+ " 1 2\n",
+ " 2 3\n",
+ " 2 3\n",
+ " 3 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.39, Page number: 226<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read the quantity & rate of certain items using multidimensional\n",
+ "#array. Calculate total cost by multiplying quantity & rate and offer 2%\n",
+ "#discount on it & display the net amount.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "m = [[[[0 for i in range(0,2)]for i in range(0,2)]for i in range(0,2)]for i in range(0,2)]\n",
+ "\n",
+ "for a in range(0,2):\n",
+ " for b in range(0,2):\n",
+ " for c in range(0,2):\n",
+ " for d in range(0,1):\n",
+ " if a == 0:\n",
+ " m[a][b][c][d] = int(raw_input(\"Enter Quantity & Rate\\na=%d b=%d c=%d d=%d\"%(a,b,c,d)))\n",
+ " m[a][b][c][d+1] = int(raw_input(\"Enter Quantity & Rate\\na=%d b=%d c=%d d=%d\"%(a,b,c,d)))\n",
+ " else:\n",
+ " m[a][b][c][d] = m[a-1][b][c][d] * m[a-1][b][c][d+1]\n",
+ " m[a][b][c][d+1] = m[a-1][b][c][d] * m[a-1][b][c][d+1] *2/100\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\n============================================================\\n\")\n",
+ "sys.stdout.write(\"Quantity\\tRate\\tAmoount\\tDiscount(@2%)\\tNet Amount\\n\")\n",
+ "sys.stdout.write(\"============================================================\\n\")\n",
+ "\n",
+ "for a in range(0,1):\n",
+ " for b in range(0,2):\n",
+ " for c in range(0,2):\n",
+ " for d in range(0,1):\n",
+ " sys.stdout.write(\"\\n%10ld %10ld\"%(m[a][b][c][d],m[a][b][c][d+1]))\n",
+ " sys.stdout.write(\"%8ld.00 %6ld.00 %12ld.00\"%(m[a+1][b][c][d],m[a+1][b][c][d+1],m[a+1][b][c][d] - m[a+1][b][c][d+1]))\n",
+ " \n",
+ "sys.stdout.write(\"\\n============================================================\")\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Quantity & Rate\n",
+ "a=0 b=0 c=0 d=025\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Quantity & Rate\n",
+ "a=0 b=0 c=0 d=050\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Quantity & Rate\n",
+ "a=0 b=0 c=1 d=030\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Quantity & Rate\n",
+ "a=0 b=0 c=1 d=060\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Quantity & Rate\n",
+ "a=0 b=1 c=0 d=035\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Quantity & Rate\n",
+ "a=0 b=1 c=0 d=070\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Quantity & Rate\n",
+ "a=0 b=1 c=1 d=040\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Quantity & Rate\n",
+ "a=0 b=1 c=1 d=075\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "============================================================\n",
+ "Quantity\tRate\tAmoount\tDiscount(@2%)\tNet Amount\n",
+ "============================================================\n",
+ "\n",
+ " 25 50 1250.00 25.00 1225.00\n",
+ " 30 60 1800.00 36.00 1764.00\n",
+ " 35 70 2450.00 49.00 2401.00\n",
+ " 40 75 3000.00 60.00 2940.00\n",
+ "============================================================"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.40, Page number: 227<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read string from a character array.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "in1 = raw_input(\"\") #Since in is a keyword in python, in1 is used\n",
+ "\n",
+ "#Result\n",
+ "#There is no sscanf() function in python\n",
+ "out = in1\n",
+ "sys.stdout.write(\"%s\\n\"%(out))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "HELLO\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.41, Page number: 228<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read integers in character array, convert and assign them to integer\n",
+ "#variable.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable initialization\n",
+ "in1 = raw_input(\"Enter Integers : \")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Value of int x : %s\"%(in1))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integers : 123\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of int x : 123"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.42, Page number: 229<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#use of sprintf()\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 10\n",
+ "c = 'C'\n",
+ "p = 3.14\n",
+ "\n",
+ "spf = str(\"%d %c %.2f\"%(a,c,p)) #There is no sprintf() function in python\n",
+ "sys.stdout.write(\"\\n%s\"%(spf))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "10 C 3.14"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.43, Page number: 229<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Complete the string by filling the spaces with appropriate characters\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "name = \"Mas er ngA SIC\"\n",
+ "name1 = ['' for i in range(0,20)]\n",
+ "x = 0\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Mastering ANSI C\\n\")\n",
+ "\n",
+ "while x < len(name): #There is no null terminating character in python\n",
+ " if name[x] == ' ':\n",
+ " n = raw_input(\"\")\n",
+ " name1[x] = n\n",
+ " else:\n",
+ " name1[x] = name[x]\n",
+ " x += 1\n",
+ " \n",
+ "sys.stdout.write(\"%s\"%(name1))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mastering ANSI C\n",
+ "['M', 'a', 's', 't', 'e', 'r', 'i', 'n', 'g', 'A', 'N', 'S', 'I', 'C', '', '', '', '', '', '']"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter8.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter8.ipynb new file mode 100755 index 00000000..3243f3f8 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter8.ipynb @@ -0,0 +1,2750 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 8: Working with Strings & Standard Functions<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.1, Page number: 236<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display string without considering NULL character\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "name1 = 'SANJAY'\n",
+ "#There is no null termination character in python\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Name1 = %s\"%(name1))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name1 = SANJAY"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.2, Page number: 236<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display successive strings\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "name1 = 'SANJAY'\n",
+ "name2 = 'SANJAY'\n",
+ "#There is no null termination character in python\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Name1 = %s\"%name1)\n",
+ "sys.stdout.write(\"\\nName2 = %s\"%(name2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name1 = SANJAY\n",
+ "Name2 = SANJAY"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.3, Page number: 237<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print \"WELCOME\" by using different formats of initialization \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "#in python, string initialization can be done using single quotes and double quotes\n",
+ "arr1 = 'WELCOME'\n",
+ "arr2 = \"WELCOME\"\n",
+ "arr3 = 'WELCOME'\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nArray1 = %s\"%(arr1))\n",
+ "sys.stdout.write(\"\\nArray2 = %s\"%(arr2))\n",
+ "sys.stdout.write(\"\\nArray3 = %s\"%(arr3))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Array1 = WELCOME\n",
+ "Array2 = WELCOME\n",
+ "Array3 = WELCOME"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.4, Page number: 238<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the string 'PRABHAKAR' using various format specifications\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text = \"PRABHAKAR\"\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"%s\\n\"%(text))\n",
+ "sys.stdout.write(\"%.5s\\n\"%(text))\n",
+ "sys.stdout.write(\"%.8s\\n\"%(text))\n",
+ "sys.stdout.write(\"%.15s\\n\"%(text))\n",
+ "sys.stdout.write(\"%-10.4s\\n\"%(text))\n",
+ "sys.stdout.write(\"%11s\\n\"%(text))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "PRABHAKAR\n",
+ "PRABH\n",
+ "PRABHAKA\n",
+ "PRABHAKAR\n",
+ "PRAB \n",
+ " PRABHAKAR\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.5, Page number: 239<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the elements of the character array using while loop.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text = \"HAVE A NICE DAY\"\n",
+ "i = 0\n",
+ "\n",
+ "#Result\n",
+ "#There is no null character for strings in python\n",
+ "\n",
+ "while i < 15:\n",
+ " sys.stdout.write(\"%c\"%(text[i]))\n",
+ " i += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "HAVE A NICE DAY"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.6, Page number: 239<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the elements of the character array.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text = \"HAVE A NICE DAY\"\n",
+ "i = 0\n",
+ "\n",
+ "#Result\n",
+ "#There is no null character for strings in python\n",
+ "\n",
+ "while i < 15:\n",
+ " sys.stdout.write(\"%c\"%(text[i]))\n",
+ " i += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "HAVE A NICE DAY"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.7, Page number: 241<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count the number of characters in a given string\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text = raw_input(\"Type Text Below\")\n",
+ "\n",
+ "#Calculation\n",
+ "len1 = len(text) #since len in a built in function in python, len1 is used\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Length of String = %d\"%(len1))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type Text BelowHello\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of String = 5"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.8, Page number: 241<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the length of the string\n",
+ "#and find its equivalent ASCII codes.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "\n",
+ "#Variable Initialization\n",
+ "name = raw_input(\"Enter your name : \")\n",
+ "l = len(name)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Your Name is %s & \"%(name))\n",
+ "sys.stdout.write(\"it contains %d characters\"%(l))\n",
+ "sys.stdout.write(\"\\n\\nName & it's Ascii Equivalent.\\n\")\n",
+ "sys.stdout.write(\"=====================================\\n\")\n",
+ "\n",
+ "for i in range(0,l):\n",
+ " sys.stdout.write(\"\\n%c\\t\\t%d\"%(name[i],ord(name[i]))) #ord() function is used to get the ASCII value of a character"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name : SACHIN\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your Name is SACHIN & it contains 6 characters\n",
+ "\n",
+ "Name & it's Ascii Equivalent.\n",
+ "=====================================\n",
+ "\n",
+ "S\t\t83\n",
+ "A\t\t65\n",
+ "C\t\t67\n",
+ "H\t\t72\n",
+ "I\t\t73\n",
+ "N\t\t78"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.9, Page number: 242<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Remove the occurrences of 'The' word from entered text\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "j = 0\n",
+ "line = raw_input(\"Enter Text Below.\")\n",
+ "l = len(line)\n",
+ "line2 = ['0' for i in range(0,80)]\n",
+ "i = 0\n",
+ "\n",
+ "#Calculation\n",
+ "while i < l:\n",
+ " if (i >= l-4 or l ==3) and (line[l-4] == ' ' and line[l-3] == 't' and line[l-2] == 'h' and line[l-1] == 'e'):\n",
+ " continue\n",
+ " if line[i] == 't' and line[i+1] == 'h' and line[i+2] == 'e' and line[i+3] == ' ':\n",
+ " i += 3\n",
+ " continue\n",
+ " else:\n",
+ " line2[j] = line[i]\n",
+ " j += 1\n",
+ " i += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nText With 'The' -: %s\"%(line))\n",
+ "sys.stdout.write(\"\\nText Without 'The' -: \")\n",
+ "for l in range(0,j):\n",
+ " sys.stdout.write(\"%c\"%(line2[l]))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text Below.Printf write data to the screen.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Text With 'The' -: Printf write data to the screen.\n",
+ "Text Without 'The' -: Printf write data to screen."
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.10, Page number: 243<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Delete all the occurrences of vowels in a given text.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "j = 0\n",
+ "line = raw_input(\"Enter Text Below.\")\n",
+ "\n",
+ "#Calculation\n",
+ "for i in range(0,len(line)):\n",
+ " if line[i] == 'a' or line[i] == 'e' or line[i] == 'i' or line[i] == 'o' or line[i] == 'u':\n",
+ " continue\n",
+ " else:\n",
+ " line2[j] = line[i]\n",
+ " j += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"Text With Vowels -: %s\"%(line))\n",
+ "sys.stdout.write(\"\\nText Without Vowels -: \")\n",
+ "for l in range(0,j): #There is no null terminating character in python, so we have to specify length\n",
+ " sys.stdout.write(\"%c\"%(line2[l])) \n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text Below.Have a nice day.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Text With Vowels -: Have a nice day.\n",
+ "Text Without Vowels -: Hv nc dy."
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.11, Page number: 244<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the length of characteres in a given string including and excluding spaces.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 0\n",
+ "len1 = 0 #Since len is a built in function in python, len1 is used\n",
+ "ex = 0\n",
+ "\n",
+ "text = raw_input(\"Enter Text Here : \")\n",
+ "\n",
+ "#Calculation\n",
+ "while i != len(text)-1: #There is no null terminating character in python.\n",
+ " if text[i] == ' ':\n",
+ " ex += 1\n",
+ " else:\n",
+ " len1 += 1\n",
+ " i += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nLengh of String Including Spaces : %d\"%(len1+ex))\n",
+ "sys.stdout.write(\"\\nLengh of String Excluding Spaces : %d\"%(len1))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text Here : Time is Money.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Lengh of String Including Spaces : 13\n",
+ "Lengh of String Excluding Spaces : 11"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.12, Page number: 245<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the length of entered string and display it as per output shown.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "string = raw_input(\"Enter a String\")\n",
+ "ln = len(string)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nLength of Given String : %d\"%(ln))\n",
+ "sys.stdout.write(\"\\nSequence of Characters Displayed on Screen\")\n",
+ "sys.stdout.write(\"\\n======== == ========== ========= == ======\")\n",
+ "sys.stdout.write(\"\\n\\n\")\n",
+ "\n",
+ "for c in range(0,ln-2+1):\n",
+ " d = c + 1\n",
+ " sys.stdout.write(\"\\t%.*s\\n\"%(d,string))\n",
+ "\n",
+ "for c in range(ln,0-1,-1):\n",
+ " d = c + 1\n",
+ " sys.stdout.write(\"\\t%.*s\\n\"%(d,string))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a StringHAPPY\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Length of Given String : 5\n",
+ "Sequence of Characters Displayed on Screen\n",
+ "======== == ========== ========= == ======\n",
+ "\n",
+ "\tH\n",
+ "\tHA\n",
+ "\tHAP\n",
+ "\tHAPP\n",
+ "\tHAPPY\n",
+ "\tHAPPY\n",
+ "\tHAPP\n",
+ "\tHAP\n",
+ "\tHA\n",
+ "\tH\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.13, Page number: 247<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy contents of one string to another string by using strcpy()\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "ori = raw_input(\"Enter Your Name : \")\n",
+ "\n",
+ "#Process\n",
+ "dup = ori #In python, string values can be simply copied using assignment operator\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Original String : %s\"%(ori))\n",
+ "sys.stdout.write(\"\\nDuplicate String : %s\"%(dup))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Name : SACHIN\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original String : SACHIN\n",
+ "Duplicate String : SACHIN"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.14, Page number: 247<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy contents of one string to another, without strcpy() function.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "ori = raw_input(\"Enter Your Name : \")\n",
+ "\n",
+ "#Calculation\n",
+ "dup = ori #In python, string values can be simply copied using assignment operator\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"Original String : %s\"%(ori))\n",
+ "sys.stdout.write(\"\\nDuplicate String : %s\"%(dup))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Name : SACHIN\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original String : SACHIN\n",
+ "Duplicate String : SACHIN"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.15, Page number: 248<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy source string to destination string upto a specified length.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "str1 = raw_input(\"Enter Source String : \")\n",
+ "str2 = raw_input(\"Enter Destination String : \")\n",
+ "n = int(raw_input(\"Enter Number of Characters to Replace in Destination String :\"))\n",
+ "\n",
+ "#Calculation\n",
+ "str2 = str1[:n] + str2[n:] #Since python strings are not mutable, first and second array elements to be added to make a new one\n",
+ " \n",
+ "sys.stdout.write(\"Source String -: %s\"%(str1))\n",
+ "sys.stdout.write(\"\\nDestination String -: %s\"%(str2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Source String : wonderful\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Destination String : beautiful\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number of Characters to Replace in Destination String :6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Source String -: wonderful\n",
+ "Destination String -: wonderful"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.16, Page number: 249<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare the two string using stricmp() function. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "sr = raw_input(\"Enter String(1) :\")\n",
+ "tar = raw_input(\"Enter String(2) :\")\n",
+ "\n",
+ "diff = (sr == tar) #in python, relational operators can be used directly\n",
+ "\n",
+ "if diff == 0:\n",
+ " sys.stdout.write(\"The Two Strings are Identical.\")\n",
+ "else:\n",
+ " sys.stdout.write(\"The Tow Strings are Different\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String(1) :HELLO\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String(2) :hello\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Two Strings are Identical."
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.17, Page number: 250<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Perform following.\n",
+ "\n",
+ "# 1. Display the question \"What is the Unit of Traffic?\"\n",
+ "# 2. Accept the Answer.\n",
+ "# 3. If the answer is wrong (other than Earlang) display \"Try again!\" & continues to answer.\n",
+ "# 4. Otherwise, if it is correct \"Earlang\" display the message \"Answer is correct\".\n",
+ "# 5. If the user gives correct anser in first two attempts the program will terminate.\n",
+ "# 6. If the user fails to provide correct answer in three attempts the program itself gives the answer.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Calculation & Result\n",
+ "for i in range(0,3):\n",
+ " ans = raw_input(\"What is the Unit of Traffic ?\")\n",
+ " \n",
+ " if ans == \"Earlang\":\n",
+ " sys.stdout.write(\"\\nAnswer is Correct.\")\n",
+ " else:\n",
+ " if i < 3:\n",
+ " sys.stdout.write(\"\\nTry Again !\\n\")\n",
+ " \n",
+ "if i == 3:\n",
+ " sys.stdout.write(\"\\nUnit of Traffic is Earlang.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "What is the Unit of Traffic ?Earlan\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Try Again !\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "What is the Unit of Traffic ?Earlam\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Try Again !\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "What is the Unit of Traffic ?Earlang\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Answer is Correct."
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.18, Page number: 252<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare two strings upto specified length.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "sr = raw_input(\"Enter String(1):\")\n",
+ "tar = raw_input(\"Enter String(2):\")\n",
+ "n = int(raw_input(\"Enter Lenght upto which comparison is to be made\"))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "diff = (sr == tar[:n])\n",
+ "\n",
+ "if diff == 0:\n",
+ " sys.stdout.write(\"The Two Strings are Identical upto %d characters.\"%(n))\n",
+ "else:\n",
+ " sys.stdout.write(\"The Two Strings are Different\")\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String(1):HELLO\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String(2):HE MAN\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Lenght upto which comparison is to be made2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Two Strings are Identical upto 2 characters."
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.19, Page number: 253<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare two strings and display the position in which it is different.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "diff = 0\n",
+ "sr = raw_input(\"Enter String(1) :\")\n",
+ "tar = raw_input(\"Enter String(2) :\")\n",
+ "\n",
+ "#Checking\n",
+ "for i in range(0,len(sr)):\n",
+ " if sr[i] != tar[i]:\n",
+ " sys.stdout.write(\"%c %c\\n\"%(sr[i],tar[i]))\n",
+ " diff += 1\n",
+ " \n",
+ "#Result\n",
+ "if len(sr) == len(tar) and diff == 0:\n",
+ " sys.stdout.write(\"\\nThe Two Strings are Identical\")\n",
+ "else:\n",
+ " sys.stdout.write(\"\\nThe Two Strings are Different at %d places.\"%(diff))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String(1) :BEST LUCK\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String(2) :GOOD LUCK\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B G\n",
+ "E O\n",
+ "S O\n",
+ "T D\n",
+ "\n",
+ "The Two Strings are Different at 4 places."
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.20, Page number: 254<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert upper case string to lower case using strlwr().\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "upper = raw_input(\"Enter a string in Upper case :\")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"After strlwr() : %s\"%(upper.lower()))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a string in Upper case :ABCDEFG\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After strlwr() : abcdefg"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.21, Page number: 254<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert Lower case string to upper case using strupr()\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "upper = raw_input(\"Enter a string in Lower Case :\")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"After strupr() : %s\"%(upper.upper()))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a string in Lower Case :abcdefg\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After strupr() : ABCDEFG"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.22, Page number: 255<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the duplicate string using strdup() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text1 = raw_input(\"Enter Text : \")\n",
+ "\n",
+ "#Result\n",
+ "text2 = text1 #in python, a string can be duplicated by just using the assignment operator\n",
+ "\n",
+ "sys.stdout.write(\"Original String = %s\\nDuplicate String = %s\"%(text1,text2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text : Today is a Good Day.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original String = Today is a Good Day.\n",
+ "Duplicate String = Today is a Good Day."
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.23, Page number: 256<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find first occurrence of a given character in a given string. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "string = raw_input(\"Enter Text Below :\")\n",
+ "ch = raw_input(\"Character to find :\")\n",
+ "\n",
+ "#Result\n",
+ "chp = string.count(ch)\n",
+ "if chp:\n",
+ " sys.stdout.write(\"Character %s found in string\"%(ch))\n",
+ "else:\n",
+ " sys.stdout.write(\"Character %s not found in string\"%(ch))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text Below :Hello Begineers.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Character to find :r\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Character r found in string"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.24, Page number: 257<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find first occurrence of a given character in a given string and display the memory location. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "line1 = raw_input(\"Enter Text :\")\n",
+ "line2 = raw_input(\"Enter Character to find from the text : \")\n",
+ "\n",
+ "for i in range(0,len(line1)):\n",
+ " sys.stdout.write(\"%c %d\\n\"%(line1[i],id(line1[i])))\n",
+ "\n",
+ "chp = line1.count(line2)\n",
+ "if chp:\n",
+ " sys.stdout.write(\"\\nAddress of first %s returned by strchr() is %d\"%(line2,id(line1[chp])))\n",
+ "else:\n",
+ " sys.stdout.write(\"'%s' String is not present in Given String \"%(line2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text :HELLO\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Character to find from the text : L\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H 20382328\n",
+ "E 20384080\n",
+ "L 19678272\n",
+ "L 19678272\n",
+ "O 20198416\n",
+ "\n",
+ "Address of first L returned by strchr() is 19678272"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.25, Page number: 258<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the occurrence of second string in the first string.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "line1 = raw_input(\"Enter Line1 :\")\n",
+ "line2 = raw_input(\"Enter Line2 :\")\n",
+ "\n",
+ "#Calculation & Result\n",
+ "chp = line1.count(line2)\n",
+ "\n",
+ "if chp:\n",
+ " sys.stdout.write(\"'%s' String is present in Given String.\"%(line2))\n",
+ "else:\n",
+ " sys.stdout.write(\"'%s' String is not present in Given String.\"%(line2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Line1 :INDIA IS MY COUNTRY.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Line2 :INDIA\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "'INDIA' String is present in Given String."
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.26, Page number: 259<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Append second string at the end of first string using strcat() function\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text1 = raw_input(\"Enter Text1 :\")\n",
+ "text2 = raw_input(\"Enter Text2 :\")\n",
+ "\n",
+ "#Calculation and Result\n",
+ "text1 = text1 + \" \" + text2 #in python, '+' operator can also be used for string concatenation\n",
+ "\n",
+ "sys.stdout.write(\"%s\"%(text1))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text1 :I Am\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text2 :an Indian\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I Am an Indian"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.27, Page number: 259<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Concatenate two strings without use of standard functions.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "fname = raw_input(\"First Name :\")\n",
+ "sname = raw_input(\"Second Name :\")\n",
+ "lname = raw_input(\"Last Name :\")\n",
+ "\n",
+ "#Calculation\n",
+ "name = fname + \" \" + sname + \" \" + lname\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nComplete Name After Concatenation.\\n\")\n",
+ "sys.stdout.write(\"%s\"%(name))\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "First Name :MOHAN\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Second Name :KARAMCHAND\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Last Name :GANDHI\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Complete Name After Concatenation.\n",
+ "MOHAN KARAMCHAND GANDHI"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.28, Page number: 261<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Append second string with specified (n) number of characters at the end of first string.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text1 = raw_input(\"Enter Text1 :\")\n",
+ "text2 = raw_input(\"Enter Text2 :\")\n",
+ "n = int(raw_input(\"Enter Number of Characters to Add :\"))\n",
+ "\n",
+ "#Calculation & Result\n",
+ "text1 = text1 + \" \" + text2[:n]\n",
+ "\n",
+ "sys.stdout.write(\"%s\\n\"%(text1))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text1 :MAY I\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text2 :COME IN ?\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number of Characters to Add :4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MAY I COME\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.29, Page number: 261<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reverse of the given string.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text = raw_input(\"Enter String\")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Reverse String\\n\")\n",
+ "text = text[::-1]\n",
+ "#This is extended slice syntax. It works by doing [begin:end:step] \n",
+ "#by leaving begin and end off and specifying a step of -1, it reverses a string.\n",
+ "\n",
+ "sys.stdout.write(\"%s\"%(text))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter StringABCDEFGHI\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverse String\n",
+ "IHGFEDCBA"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.30, Page number: 262<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reverse of the given string.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text = raw_input(\"Enter String\")\n",
+ "i = 0\n",
+ "\n",
+ "#Result\n",
+ "while i < len(text):\n",
+ " sys.stdout.write(\"\\n%c is stored at location %d\"%(text[i],id(text[i])))\n",
+ " i += 1\n",
+ " \n",
+ "sys.stdout.write(\"\\nReverse String :- \")\n",
+ "text = text[::-1]\n",
+ "#This is extended slice syntax. It works by doing [begin:end:step] \n",
+ "#by leaving begin and end off and specifying a step of -1, it reverses a string.\n",
+ "\n",
+ "sys.stdout.write(\"%s\"%(text))\n",
+ "\n",
+ "i = 0\n",
+ "while i < len(text):\n",
+ " sys.stdout.write(\"\\n%c is stored at location %d\"%(text[i],id(text[i])))\n",
+ " i += 1\n",
+ "\n",
+ "#Memory address differs in different systems"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter StringABC\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "A is stored at location 20383432\n",
+ "B is stored at location 20198992\n",
+ "C is stored at location 20199040\n",
+ "Reverse String :- CBA\n",
+ "C is stored at location 20199040\n",
+ "B is stored at location 20198992\n",
+ "A is stored at location 20383432"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.31, Page number: 263<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Replace (set) given string with given symbol. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "string = raw_input(\"Enter String :\")\n",
+ "symbol = raw_input(\"Enter Symbol for Replacement : \")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Before strset(): %s\\n\"%(string))\n",
+ "string = symbol*len(string)\n",
+ "\n",
+ "sys.stdout.write(\"After strset() : %s\"%(string))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String :LEARN C\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Symbol for Replacement : Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Before strset(): LEARN C\n",
+ "After strset() : YYYYYYY"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.32, Page number: 264<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Replace (set) given string with given symbol for given number of arguments.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "string = raw_input(\"Enter String :\")\n",
+ "symbol = raw_input(\"Enter Symbol for Replacement : \")\n",
+ "n = int(raw_input(\"How many String Character to be replaced.\"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Before strset() : %s\\n\"%(string))\n",
+ "\n",
+ "string = symbol * n + string[n:]\n",
+ "sys.stdout.write(\"After strset() : %s\\n\"%(string))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String :ABCDEFGHIJ\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Symbol for Replacement : +\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many String Character to be replaced.4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Before strset() : ABCDEFGHIJ\n",
+ "After strset() : ++++EFGHIJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.33, Page number: 265<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the position from which the two strings are different.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "stra = raw_input(\"First String : \")\n",
+ "strb = raw_input(\"Second String : \")\n",
+ "\n",
+ "#There is no built in function for python to check upto which position the strings are equal.\n",
+ "for length in range(min(len(stra), len(strb))):\n",
+ " if stra[length] != strb[length]:\n",
+ " break\n",
+ "\n",
+ "sys.stdout.write(\"After %d Characters there is no match.\"%(length))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "First String : GOOD MORNING\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Second String : GOOD BYE\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After 5 Characters there is no match."
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.34, Page number: 266<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print given string from first occurrence of given character.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text1 = raw_input(\"Enter String : \")\n",
+ "text2 = raw_input(\"Enter Character :\")\n",
+ "\n",
+ "for length in range(0,len(text1)):\n",
+ " if text1[length] == text2[0]:\n",
+ " break\n",
+ " \n",
+ "sys.stdout.write(\"String from given Character : %s\"%(text1[length:]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter String : INDIA IS GREAT\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Character :G\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "String from given Character : GREAT"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.35, Page number: 266<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count a character that appears in a given text\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 0\n",
+ "count = 0\n",
+ "text = raw_input(\"Type Text Below.\")\n",
+ "find = raw_input(\"Type a character to count : \")\n",
+ "\n",
+ "#Calculation\n",
+ "while i < len(text): #There is no null terminating character for python string\n",
+ " if text[i] == find:\n",
+ " count += 1\n",
+ " i += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nCharacter (%s) found in Given String = %d Times.\"%(find,count))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type Text Below.Programming\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type a character to count : m\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Character (m) found in Given String = 2 Times."
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.36, Page number: 267<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count the character 'm' in a given string.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "count = 0\n",
+ "text = raw_input(\"\") #it is easy to get string at once in python\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"%s\"%(text))\n",
+ "\n",
+ "for i in range(0,len(text)):\n",
+ " if text[i] == '\\n':\n",
+ " break\n",
+ " else:\n",
+ " if text[i] == 'm':\n",
+ " count += 1\n",
+ " \n",
+ "sys.stdout.write(\"\\n\\nCharacter 'm' Found in Text = %d times.\"%(count))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Programming is a skill.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Programming is a skill.\n",
+ "\n",
+ "Character 'm' Found in Text = 2 times."
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.37, Page number: 268<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count the characters 'm', 'r', and 'o' that appears in a string without using any functions\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "text = \"Programming is good habit\"\n",
+ "m = 0\n",
+ "o = 0\n",
+ "r = 0\n",
+ "\n",
+ "#Calculation\n",
+ "for i in range(0,len(text)):\n",
+ " if text[i] == 'm':\n",
+ " m += 1\n",
+ " if text[i] == 'r':\n",
+ " r += 1\n",
+ " if text[i] == 'o':\n",
+ " o += 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nCharacter 'm' Found in Text = %d times.\\n\"%(m))\n",
+ "sys.stdout.write(\"\\nCharacter 'r' Found in Text = %d times.\\n\"%(r))\n",
+ "sys.stdout.write(\"\\nCharacter 'o' Found in Text = %d times.\"%(o))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Character 'm' Found in Text = 2 times.\n",
+ "\n",
+ "Character 'r' Found in Text = 2 times.\n",
+ "\n",
+ "Character 'o' Found in Text = 3 times."
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.38, Page number: 269<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy contents of one string to another string\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "ori = raw_input(\"Enter Your Name :\")\n",
+ "\n",
+ "#Copying\n",
+ "#Since strings in python are immutable, individual character assignment is not possible.\n",
+ "#but assignment operator simply copies the entire string to another\n",
+ "\n",
+ "dup = ori\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Original String : %s\"%(ori))\n",
+ "sys.stdout.write(\"\\nDuplicate String : %s\"%(dup))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Name :SACHIN\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original String : SACHIN\n",
+ "Duplicate String : SACHIN"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.39, Page number: 270<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Palindrome or not.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = 0\n",
+ "str1 = raw_input(\"Enter the word : \") #Since str is a keyword in python, str1 is used\n",
+ "j = len(str1)-1\n",
+ "\n",
+ "#Calculation\n",
+ "while i < j:\n",
+ " if str1[i] == str1[j]:\n",
+ " test = 1\n",
+ " else:\n",
+ " test = 0\n",
+ " break\n",
+ " i += 1\n",
+ " j -= 1\n",
+ " \n",
+ "#Result\n",
+ "if test == 1:\n",
+ " sys.stdout.write(\"Word is palindrome.\")\n",
+ "else:\n",
+ " sys.stdout.write(\"\\nWord is not Palindrome.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the word : ABBA\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Word is palindrome."
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.40, Page number: 271<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare the string using strcmp() function and display their ASCII difference.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a1 = \"NAGPUR\"\n",
+ "a2 = \"NAGPUR\"\n",
+ "a3 = \"PANDHARPUR\"\n",
+ "a4 = \"KOLHAPUR\"\n",
+ "a5 = \"AURANGABAD\"\n",
+ "a6 = \"HYDERABAD\"\n",
+ "\n",
+ "#Calculation\n",
+ "#There is no built in function which returns the ascii value differece of two strings\n",
+ "#ord function gives the ascii value of a character\n",
+ "c1 = ord(a1[0]) - ord(a2[0])\n",
+ "c2 = ord(a3[0]) - ord(a4[0])\n",
+ "c3 = ord(a5[0]) - ord(a6[0])\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nAscii Difference between two strings\\n\")\n",
+ "sys.stdout.write(\"Difference between (%s %s) = %d\\n\"%(a1,a2,c1))\n",
+ "sys.stdout.write(\"Difference between (%s %s) = %d\\n\"%(a3,a4,c2))\n",
+ "sys.stdout.write(\"Difference between (%s %s) = %d\\n\"%(a5,a6,c3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Ascii Difference between two strings\n",
+ "Difference between (NAGPUR NAGPUR) = 0\n",
+ "Difference between (PANDHARPUR KOLHAPUR) = 5\n",
+ "Difference between (AURANGABAD HYDERABAD) = -7\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.41, Page number: 272<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sort city names alphabetically.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "city = [['0' for i in range(5)]for i in range(20)]\n",
+ "sys.stdout.write(\"Enter Names of Cities. \")\n",
+ "for i in range(5):\n",
+ " city[i] = raw_input(\"\")\n",
+ " \n",
+ "#Sorting & Result\n",
+ "sys.stdout.write(\"Sorted List of Cities.\\n\\n\")\n",
+ "for i in range(65,122+1):\n",
+ " for j in range(0,5):\n",
+ " if ord(city[j][0]) == i:\n",
+ " sys.stdout.write(\"\\n%s\"%(city[j]))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Names of Cities. "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MUMBAI\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NANED\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "BANGLORE\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "KANPUR\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "INDORE\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted List of Cities.\n",
+ "\n",
+ "\n",
+ "BANGLORE\n",
+ "INDORE\n",
+ "KANPUR\n",
+ "MUMBAI\n",
+ "NANED"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.42, Page number: 273<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sort city names alphabetically\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "city = [['0' for i in range(5)]for i in range(20)]\n",
+ "sys.stdout.write(\"Enter Names of Cities. \")\n",
+ "for i in range(5):\n",
+ " city[i] = raw_input(\"\")\n",
+ " \n",
+ "#Sorting & Result\n",
+ "sys.stdout.write(\"Sorted List of Cities.\\n\\n\")\n",
+ "for i in range(0,5):\n",
+ " for j in range(0,5):\n",
+ " if city[j-1] > city[j]:\n",
+ " temp = city[j-1]\n",
+ " city[j-1] = city[j]\n",
+ " city[j] = temp\n",
+ " \n",
+ "for i in range(0,5):\n",
+ " sys.stdout.write(\"\\n%s\"%(city[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Names of Cities. "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MUMBAI\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NANED\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "BANGLORE\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "KANPUR\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "INDORE\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorted List of Cities.\n",
+ "\n",
+ "\n",
+ "BANGLORE\n",
+ "INDORE\n",
+ "KANPUR\n",
+ "MUMBAI\n",
+ "NANED"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.43, Page number: 274<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find number of words in a given statement.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "count = 1 #Counts the starting word\n",
+ "i = 0\n",
+ "text = raw_input(\"Enter The Line of Text\\nGive One Space After Each Word\")\n",
+ "\n",
+ "#Calculation\n",
+ "while i < len(text): #There is no null terminating character in python\n",
+ " if ord(text[i]) == 32:\n",
+ " count += 1\n",
+ " i += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nThe Number of words in line = %d\"%(count))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter The Line of Text\n",
+ "Give One Space After Each WordRead Books\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The Number of words in line = 2"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.44, Page number: 275<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find number of words in a given statement.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "count = 0 \n",
+ "i = 0\n",
+ "text = raw_input(\"Enter Text Below :\")\n",
+ "\n",
+ "#Calculation\n",
+ "while i < len(text): #There is no null terminating character in python for strings\n",
+ " if ord(text[i]) >= 97 and ord(text[i]) <= 122 or ord(text[i]) >= 65 and ord(text[i]) <= 90:\n",
+ " i += 1\n",
+ " continue\n",
+ " if ord(text[i]) == 32:\n",
+ " count += 1\n",
+ " i += 1\n",
+ " continue\n",
+ "\n",
+ "if i == len(text):\n",
+ " count += 1\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"The Number of words in line = %d\"%(count))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text Below :Reading is a good Habit\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Number of words in line = 5"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.45, Page number: 276<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sort the last name of mobile customers alphabetically.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "fname = [['0' for i in range(20)] for i in range(10)]\n",
+ "sname = [['0' for i in range(20)] for i in range(10)]\n",
+ "surname = [['0' for i in range(20)] for i in range(10)]\n",
+ "name = [['0' for i in range(20)] for i in range(20)]\n",
+ "mobile = [['0' for i in range(20)] for i in range(10)]\n",
+ "temp = ['0' for i in range(20)]\n",
+ "\n",
+ "sys.stdout.write(\"Enter First Name, Second Name, surname and Mobile Number \")\n",
+ "for i in range(0,5):\n",
+ " fname[i] = raw_input(\"\")\n",
+ " sname[i] = raw_input(\"\")\n",
+ " surname[i] = raw_input(\"\")\n",
+ " mobile[i] = raw_input(\"\")\n",
+ " \n",
+ " name[i] = surname[i] + \" \" \n",
+ " temp[0] = fname[i][0]\n",
+ " name[i] = name[i] + temp[0] + \".\"\n",
+ " temp[0] = sname[i][0]\n",
+ " name[i] = name[i] + temp[0]\n",
+ " \n",
+ "for i in range(0,5):\n",
+ " for j in range(1,5-i):\n",
+ " if name[j-1] > name[j]:\n",
+ " temp = name[j-1]\n",
+ " name[j-1] = name[j]\n",
+ " name[j] = temp\n",
+ " temp = mobile[j-1]\n",
+ " mobile[j-1] = mobile[j]\n",
+ " mobile[j] = temp\n",
+ " \n",
+ "sys.stdout.write(\"List of Customers in alphanetical Order.\")\n",
+ "for i in range(0,5):\n",
+ " sys.stdout.write(\"\\n%-20s\\t %-10s\\n\"%(name[i],mobile[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter First Name, Second Name, surname and Mobile Number "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "K\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "S\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MORE\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "458454\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "J\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CHATE\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "658963\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "GORE\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "660585\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "K\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "JAIN\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "547855\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "J\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "J\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "JOSHI\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "354258\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "List of Customers in alphanetical Order.\n",
+ "CHATE J.M \t 658963 \n",
+ "\n",
+ "GORE M.M \t 660585 \n",
+ "\n",
+ "JAIN L.K \t 547855 \n",
+ "\n",
+ "JOSHI J.J \t 354258 \n",
+ "\n",
+ "MORE K.S \t 458454 \n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter9.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter9.ipynb new file mode 100755 index 00000000..4da93c8d --- /dev/null +++ b/Programming_in_C_using_ANSI_C/KamthaneChapter9.ipynb @@ -0,0 +1,1999 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 9: Pointers<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.1, Page number: 282<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the address of the variable\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "num = int(raw_input(\"Enter a Number = \"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Value of num = %d\\n\"%(num))\n",
+ "sys.stdout.write(\"Address of num = %d\\n\"%(id(num)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Number = 20\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of num = 20\n",
+ "Address of num = 19554932\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.2, Page number: 283<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the addresses of different variables together with their values.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "c = raw_input(\"Enter alphabet\")\n",
+ "i = int(raw_input(\"Enter number\"))\n",
+ "f = float(raw_input(\"Enter float\"))\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nAddress of (c) %c = %d\"%(c,id(c)))\n",
+ "sys.stdout.write(\"\\nAddress of (i) %d = %d\"%(i,id(i)))\n",
+ "sys.stdout.write(\"\\nAddress of (f) %.2f = %d\"%(f,id(f)))\n",
+ "#Memory address differs in different systems\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter alphabetC\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter float2.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address of (c) C = 48769192\n",
+ "Address of (i) 20 = 19554932\n",
+ "Address of (f) 2.50 = 44777808"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.3, Page number: 284<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Show pointer of any data type that occupies same space\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Result\n",
+ "#Garbage collector module is used for python memory management\n",
+ "sys.stdout.write(\"char %d byte & its pointer %d bytes\\n\"%(sys.getsizeof(chr),sys.getsizeof(id(chr))))\n",
+ "sys.stdout.write(\"int %d byte & its pointer %d bytes\\n\"%(sys.getsizeof(int),sys.getsizeof(id(int))))\n",
+ "sys.stdout.write(\"float %d byte & its pointer %d bytes\\n\"%(sys.getsizeof(float),sys.getsizeof(id(float))))\n",
+ "\n",
+ "#value tagged method is used in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "char 36 byte & its pointer 12 bytes\n",
+ "int 436 byte & its pointer 12 bytes\n",
+ "float 436 byte & its pointer 12 bytes\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.4, Page number: 284<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the value of variable and its location using pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "#There is no pointer concept in python\n",
+ "v = 10\n",
+ "p = v\n",
+ "#In python, variables of same value are tagged together instead of storing the value in different locations\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nAddress of v = %u\"%(id(v)))\n",
+ "sys.stdout.write(\"\\nValue of v = %d\"%(p))\n",
+ "sys.stdout.write(\"\\nAddress of p = %d\"%(id(p)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address of v = 29808764\n",
+ "Value of v = 10\n",
+ "Address of p = 29808764"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.5, Page number: 285<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the value of variable by different ways.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = int(raw_input(\"Enter Integer Value\"))\n",
+ "b = float(raw_input(\"Enter float Value\"))\n",
+ "\n",
+ "pa = id(a)\n",
+ "pb = id(b)\n",
+ "\n",
+ "#Result\n",
+ "#There is no pointer concept in python. content of memory location can't be accessed directly by user.\n",
+ "sys.stdout.write(\"\\nAddress of a = %u\"%(pa))\n",
+ "sys.stdout.write(\"\\nValue of a = %d\"%(a))\n",
+ "sys.stdout.write(\"\\nValue of a = %d\"%(a))\n",
+ "sys.stdout.write(\"\\nValue of a = %d\"%(a))\n",
+ "\n",
+ "sys.stdout.write(\"\\nAddress of b = %u\"%(pb))\n",
+ "sys.stdout.write(\"\\nValue of b = %.2f\"%(b))\n",
+ "sys.stdout.write(\"\\nValue of b = %.2f\"%(b))\n",
+ "sys.stdout.write(\"\\nValue of b = %.2f\"%(b))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Integer Value4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter float Value2.2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address of a = 19555124\n",
+ "Value of a = 4\n",
+ "Value of a = 4\n",
+ "Value of a = 4\n",
+ "Address of b = 44777792\n",
+ "Value of b = 2.20\n",
+ "Value of b = 2.20\n",
+ "Value of b = 2.20"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.6, Page number: 286<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print value of variable using different pointer notations.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "v = 10\n",
+ "p = id(v)\n",
+ "\n",
+ "#Result\n",
+ "#There is no pointer concept in python and can't access memory location directly by user\n",
+ "sys.stdout.write(\"\\nv = %d v = %d v = %d\"%(v,v,v))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "v = 10 v = 10 v = 10"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.7, Page number: 287<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print element and its address using pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = int(raw_input(\"Enter a number : \"))\n",
+ "k = id(i)\n",
+ "\n",
+ "#Result\n",
+ "#There is no pointer concept in python and can't access memory location directly by user\n",
+ "sys.stdout.write(\"\\nAddress of i is %u\"%(k))\n",
+ "sys.stdout.write(\"\\nValue of i is %d\"%(i))\n",
+ "#The memory address differs in different systems\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 15\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address of i is 19554992\n",
+ "Value of i is 15"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.8, Page number: 287<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Add two numbers through variables and their pointers\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = int(raw_input(\"Enter Two Numbers : \"))\n",
+ "b = int(raw_input(\"Enter Two Numbers : \"))\n",
+ "ap = a\n",
+ "bp = b\n",
+ "\n",
+ "#Calculation\n",
+ "c = a + b\n",
+ "d = ap + bp\n",
+ "\n",
+ "#Result\n",
+ "#There is no pointer concept in python and can't access memory location directly by user\n",
+ "sys.stdout.write(\"\\nSum of A & B Using Variable : %d\"%(c))\n",
+ "sys.stdout.write(\"\\nSum of A & B Using Pointer : %d\"%(d))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Two Numbers : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Two Numbers : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Sum of A & B Using Variable : 12\n",
+ "Sum of A & B Using Pointer : 12"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.9, Page number: 288<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Assign pointer value to another variable\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 5\n",
+ "c = id(a)\n",
+ "b = a\n",
+ "\n",
+ "#Result\n",
+ "#There is no pointer concept in python and can't access memory location directly by user\n",
+ "sys.stdout.write(\"\\nMemory location of 'a' = %u\"%(c))\n",
+ "sys.stdout.write(\"\\nThe value of a = %d & b = %d\"%(a,b))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Memory location of 'a' = 29808824\n",
+ "The value of a = 5 & b = 5"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.10, Page number: 289<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Assign value of 'b' to 'a' through pointers and add the values.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = int(raw_input(\"Enter Value of 'a' & 'b' : \"))\n",
+ "b = int(raw_input(\"Enter Value of 'a' & 'b' : \"))\n",
+ "pa = id(a)\n",
+ "pb = id(b)\n",
+ "\n",
+ "#Result\n",
+ "#There is no pointer concept in python and can't access memory location directly by user\n",
+ "sys.stdout.write(\"\\nValue of a = %d & b = %d\"%(a,b))\n",
+ "sys.stdout.write(\"\\nAddress of a = %u\"%(pa))\n",
+ "sys.stdout.write(\"\\nAddress of b = %u\"%(pb))\n",
+ "sys.stdout.write(\"\\n\\nAddition of 'a' & 'b' : %d\"%(a+b))\n",
+ "\n",
+ "a = b\n",
+ "pa = id(a)\n",
+ "#In python, variables of same value are tagged together instead of storing the value in different locations\n",
+ "\n",
+ "sys.stdout.write(\"\\n*pa = %d *pb = %d\"%(a,b))\n",
+ "sys.stdout.write(\"\\npa = %u pb = %u\"%(pa,pb))\n",
+ "sys.stdout.write(\"\\nAddition of *pa + *pb : %d\"%(a+b))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of 'a' & 'b' : 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of 'a' & 'b' : 4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Value of a = 8 & b = 4\n",
+ "Address of a = 19555076\n",
+ "Address of b = 19555124\n",
+ "\n",
+ "Addition of 'a' & 'b' : 12\n",
+ "*pa = 4 *pb = 4\n",
+ "pa = 19555124 pb = 19555124\n",
+ "Addition of *pa + *pb : 8"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.11, Page number: 290<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#The effect of increment on pointer variables. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = int(raw_input(\"Enter integer Value\"))\n",
+ "y = raw_input(\"Enter Character Value\")\n",
+ "z = float(raw_input(\"Enter float Value\"))\n",
+ "\n",
+ "x1 = id(x)\n",
+ "y1 = id(y)\n",
+ "z1 = id(z)\n",
+ "\n",
+ "#Result\n",
+ "#There is no pointer concept in python and can't access memory location directly by user\n",
+ "\n",
+ "sys.stdout.write(\"\\nAddress of x = %u\\n\"%(x1))\n",
+ "sys.stdout.write(\"\\nAddress of y = %u\\n\"%(y1))\n",
+ "sys.stdout.write(\"\\nAddress of z = %u\\n\"%(z1))\n",
+ "\n",
+ "x1 += 1\n",
+ "y1 += 1\n",
+ "z1 += 1\n",
+ "#In python, variables of same value are tagged together instead of storing the value in different locations\n",
+ "\n",
+ "sys.stdout.write(\"\\nAfter Increment in Pointers\\n\")\n",
+ "sys.stdout.write(\"\\nNow Address of x = %u\\n\"%(x1))\n",
+ "sys.stdout.write(\"Now Address of y = %u\\n\"%(y1))\n",
+ "sys.stdout.write(\"Now Address of z = %u\\n\"%(z1))\n",
+ "\n",
+ "sys.stdout.write(\"\\nSize of Integer : %d\"%(sys.getsizeof(x)))\n",
+ "sys.stdout.write(\"\\nSize of Character : %d\"%(sys.getsizeof(y)))\n",
+ "sys.stdout.write(\"\\nSize of Float : %d\"%(sys.getsizeof(z)))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter integer Value2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Character ValueA\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter float Value2.2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address of x = 19555148\n",
+ "\n",
+ "Address of y = 48769192\n",
+ "\n",
+ "Address of z = 44777728\n",
+ "\n",
+ "After Increment in Pointers\n",
+ "\n",
+ "Now Address of x = 19555149\n",
+ "Now Address of y = 48769193\n",
+ "Now Address of z = 44777729\n",
+ "\n",
+ "Size of Integer : 12\n",
+ "Size of Character : 22\n",
+ "Size of Float : 16"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.12, Page number: 291<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#The effect of increased and decreased operator used as prefix and suffix with pointer variable.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "i = int(raw_input(\"Enter Value of i = \"))\n",
+ "ii = id(i)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Address of i = %u\\n\"%(ii))\n",
+ "#There is no increment or decrement operator and pointer concept in python\n",
+ "ii += 1\n",
+ "sys.stdout.write(\"Address of i = %u\\n\"%(ii))\n",
+ "sys.stdout.write(\"Address of i = %u\\n\"%(ii))\n",
+ "ii += 1\n",
+ "ii -= 1\n",
+ "sys.stdout.write(\"Address of i = %u\\n\"%(ii))\n",
+ "sys.stdout.write(\"Address of i = %u\\n\"%(ii))\n",
+ "ii -= 1\n",
+ "sys.stdout.write(\"Address of i = %u\\n\"%(ii))\n",
+ "\n",
+ "#Memory address differs in different systems"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Value of i = 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of i = 19555076\n",
+ "Address of i = 19555077\n",
+ "Address of i = 19555077\n",
+ "Address of i = 19555077\n",
+ "Address of i = 19555077\n",
+ "Address of i = 19555076\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.13, Page number: 292<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Perform different arithmetic operations using pointers\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 25\n",
+ "b = 10\n",
+ "p = id(a)\n",
+ "j = id(b)\n",
+ "\n",
+ "#Result\n",
+ "#There is no pointer concept in python and user can't access memory contents directly\n",
+ "sys.stdout.write(\"\\nAddition a + b = %d\"%(a+b))\n",
+ "sys.stdout.write(\"\\nSubtraction a - b = %d\"%(a-b))\n",
+ "sys.stdout.write(\"\\nProduct a * b = %d\"%(a*b))\n",
+ "sys.stdout.write(\"\\nDivision a / b = %d\"%(a/b))\n",
+ "sys.stdout.write(\"\\na Mod b = %d\"%(a%b))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Addition a + b = 35\n",
+ "Subtraction a - b = 15\n",
+ "Product a * b = 250\n",
+ "Division a / b = 2\n",
+ "a Mod b = 5"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.14, Page number: 293<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare two pointers. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 2\n",
+ "j = id(a)\n",
+ "k = id(a)\n",
+ "\n",
+ "#Result\n",
+ "if j == k:\n",
+ " sys.stdout.write(\"\\nThe Tow Pointers have the same address.\")\n",
+ "else:\n",
+ " sys.stdout.write(\"\\nThe Pointers have the different address.\")\n",
+ " \n",
+ "sys.stdout.write(\"\\n\\nAddress of a (j) = %u\"%(j))\n",
+ "sys.stdout.write(\"\\nAddress of a (k) = %u\"%(k))\n",
+ "#Memory address differs in different systems"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The Tow Pointers have the same address.\n",
+ "\n",
+ "Address of a (j) = 30726364\n",
+ "Address of a (k) = 30726364"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.15, Page number: 294<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display elements of an array. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = [2,4,6,8,10]\n",
+ "k = 1\n",
+ "\n",
+ "#Result\n",
+ "while k <= 5:\n",
+ " sys.stdout.write(\"%3d\"%(x[k-1]))\n",
+ " k += 1\n",
+ " \n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 2 4 6 8 10"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.16, Page number: 295<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display array element with their addresses using array name as a pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = [2,4,6,8,10]\n",
+ "k = 0\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nElement No.\\tElement\\tAddress\")\n",
+ "\n",
+ "while k < 5:\n",
+ " sys.stdout.write(\"\\nx[%d] \\t%13d %10u\"%(k,x[k],id(x[k])))\n",
+ " k += 1\n",
+ " \n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Element No.\tElement\tAddress\n",
+ "x[0] \t 2 30726364\n",
+ "x[1] \t 4 30726340\n",
+ "x[2] \t 6 30726316\n",
+ "x[3] \t 8 30726292\n",
+ "x[4] \t 10 30726268"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.17, Page number: 296<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display array elements with their addresses using array name as a pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "num = [10,25,35,45]\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nElement\\t Address\\n\")\n",
+ "\n",
+ "for i in range(0,4):\n",
+ " sys.stdout.write(\"num[%d] = %d \"%(i,num[i]))\n",
+ " sys.stdout.write(\"%8u\\n\"%(id(num[i])))\n",
+ " \n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Element\t Address\n",
+ "num[0] = 10 30726268\n",
+ "num[1] = 25 30726088\n",
+ "num[2] = 35 30725968\n",
+ "num[3] = 45 30725848\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.18, Page number: 296<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Access elements of array through different ways using pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "arr = [10,20,30,40,50]\n",
+ "p = 0\n",
+ "\n",
+ "#Result\n",
+ "for p in range(0,5):\n",
+ " sys.stdout.write(\"Value of arr[%d] = \"%(p))\n",
+ " sys.stdout.write(\"%d | \"%(arr[p]))\n",
+ " sys.stdout.write(\"%d | \"%(arr[p]))\n",
+ " sys.stdout.write(\"%d | \"%(arr[p]))\n",
+ " sys.stdout.write(\"%d | \"%(arr[p]))\n",
+ " sys.stdout.write(\"address of arr[%d] = %u\\n\"%(p,id(arr[p])))\n",
+ " \n",
+ "#There is no pointer concept in python\n",
+ "#Memory address differs in different systems\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of arr[0] = 10 | 10 | 10 | 10 | address of arr[0] = 30726268\n",
+ "Value of arr[1] = 20 | 20 | 20 | 20 | address of arr[1] = 30726148\n",
+ "Value of arr[2] = 30 | 30 | 30 | 30 | address of arr[2] = 30726028\n",
+ "Value of arr[3] = 40 | 40 | 40 | 40 | address of arr[3] = 30725908\n",
+ "Value of arr[4] = 50 | 50 | 50 | 50 | address of arr[4] = 30725788\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.19, Page number: 297<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find sum of all the elements of an array.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "sum1 = 0 #Since sum is a built-in function in python, sum1 is used\n",
+ "i = 0\n",
+ "a = [1,2,3,4,5]\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Elements Values Address\\n\\n\")\n",
+ "\n",
+ "while i < 5:\n",
+ " sys.stdout.write(\"a[%d]\\t %5d\\t %8u\\n\"%(i,a[i],id(a[i])))\n",
+ " sum1 = sum1 + a[i]\n",
+ " i += 1\n",
+ " \n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Elements Values Address\n",
+ "\n",
+ "a[0]\t 1\t 30726376\n",
+ "a[1]\t 2\t 30726364\n",
+ "a[2]\t 3\t 30726352\n",
+ "a[3]\t 4\t 30726340\n",
+ "a[4]\t 5\t 30726328\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.20, Page number: 298<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sum of squares and cubes of array elements using pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "b = [1,2,3,4,5]\n",
+ "sumsq = 0\n",
+ "sumc = 0\n",
+ "\n",
+ "#Result\n",
+ "for j in range(0,5):\n",
+ " sumsq = sumsq + pow(b[j],2)\n",
+ " sumc = sumc + pow(b[j],3)\n",
+ " \n",
+ "sys.stdout.write(\"\\nSum of Squares of array elements : %d\"%(sumsq))\n",
+ "sys.stdout.write(\"\\nSum of Cubes of array elements : %d\"%(sumc))\n",
+ "\n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Sum of Squares of array elements : 55\n",
+ "Sum of Cubes of array elements : 225"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.21, Page number: 299<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy element of one array to another array using pointers.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "so = [10,20,30,40,50]\n",
+ "ds = [0 for i in range(0,5)]\n",
+ "\n",
+ "#Copying\n",
+ "for i in range(0,5):\n",
+ " ds[i] = so[i]\n",
+ " \n",
+ "sys.stdout.write(\"Original Array Duplicated Array\")\n",
+ "\n",
+ "for i in range(0,5):\n",
+ " sys.stdout.write(\"\\n\\t%d\\t\\t%d\"%(so[i],ds[i]))\n",
+ " \n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original Array Duplicated Array\n",
+ "\t10\t\t10\n",
+ "\t20\t\t20\n",
+ "\t30\t\t30\n",
+ "\t40\t\t40\n",
+ "\t50\t\t50"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.22, Page number: 299<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copy one array into another array. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "arr1 = [15,25,35,45,55]\n",
+ "arr2 = [0 for i in range(0,5)]\n",
+ "j = 4\n",
+ "\n",
+ "#Copying & Result\n",
+ "sys.stdout.write(\"\\nOriginal Array Duplicate Array\")\n",
+ "for i in range(0,5):\n",
+ " arr2[i] = arr1[j]\n",
+ " j -= 1\n",
+ " sys.stdout.write(\"\\n\\t%d\\t\\t%d\"%(arr1[i],arr2[i]))\n",
+ " \n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Original Array Duplicate Array\n",
+ "\t15\t\t55\n",
+ "\t25\t\t45\n",
+ "\t35\t\t35\n",
+ "\t45\t\t25\n",
+ "\t55\t\t15"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.23, Page number: 300<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display array elements and their address using pointers\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [[1,2,3],[4,5,6],[7,8,9]]\n",
+ "j = 1\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\tElements of An Array with their addresses\\n\\n\")\n",
+ "\n",
+ "p = id(a[0][0])\n",
+ "\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " sys.stdout.write(\"%5d [%5u]\"%(a[i][j],id(a[i][j])))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " \n",
+ "#There is no pointer concept in python\n",
+ "#Memory address differs in different systems\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\tElements of An Array with their addresses\n",
+ "\n",
+ " 1 [30726376] 2 [30726364] 3 [30726352]\n",
+ " 4 [30726340] 5 [30726328] 6 [30726316]\n",
+ " 7 [30726304] 8 [30726292] 9 [30726280]\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.24, Page number: 301<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display array elements and their address. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [[1,2,3],[4,5,6],[7,8,9]]\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nElements of An Array with their addresses.\\n\\n\")\n",
+ "\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " sys.stdout.write(\"%5d [%5u]\"%(a[i][j],id(a[i][j])))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ " \n",
+ "#There is no pointer concept in python\n",
+ "#Memory address differs in different systems\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Elements of An Array with their addresses.\n",
+ "\n",
+ " 1 [30726376] 2 [30726364] 3 [30726352]\n",
+ " 4 [30726340] 5 [30726328] 6 [30726316]\n",
+ " 7 [30726304] 8 [30726292] 9 [30726280]\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.25, Page number: 302<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Store addresses of different elements of an array using array of pointers\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "arrl = [5,10,15]\n",
+ "arrp = [0 for i in range(0,3)]\n",
+ "\n",
+ "for i in range(0,3):\n",
+ " arrp[i] = id(arrl[i])\n",
+ " \n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nAddress \\tElement\\n\")\n",
+ "\n",
+ "for k in range(0,3):\n",
+ " sys.stdout.write(\"%u\"%(arrp[k]))\n",
+ " sys.stdout.write(\"\\t%7d\\n\"%(arrl[k]))\n",
+ " \n",
+ "#There is no pointer concept in python\n",
+ "#Memory address differs in different systems\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Address \tElement\n",
+ "30726328\t 5\n",
+ "30726268\t 10\n",
+ "30726208\t 15\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.26, Page number: 303<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display address of elements and pointers\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [0,1,2,3,4]\n",
+ "p = [0 for i in range(0,5)]\n",
+ "\n",
+ "for i in range(0,5):\n",
+ " p[i] = id(a[i])\n",
+ " \n",
+ "#Result\n",
+ "for i in range(0,5):\n",
+ " sys.stdout.write(\"\\n%d at location\"%(a[i]))\n",
+ " sys.stdout.write(\"\\t%u at location\"%(id(a[i])))\n",
+ " sys.stdout.write(\" %u\"%(id(p[i])))\n",
+ " \n",
+ "#There is no pointer concept in python\n",
+ "#Memory address differs in different systems\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "0 at location\t30726388 at location 52456564\n",
+ "1 at location\t30726376 at location 52456360\n",
+ "2 at location\t30726364 at location 52456456\n",
+ "3 at location\t30726352 at location 52456420\n",
+ "4 at location\t30726340 at location 52456468"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.27, Page number: 304<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print value of a variable through pointer and pointer to pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = 2\n",
+ "p = id(a)\n",
+ "q = id(p)\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\n Value of a = %d Address of a = %u\"%(a,id(a)))\n",
+ "sys.stdout.write(\"\\nThrough *p Value of a = %d Address of a = %u\"%(a,p))\n",
+ "sys.stdout.write(\"\\nThrough **q Vallue of a = %d Address of a = %d\"%(a,p))\n",
+ "\n",
+ "#There is no pointer concept in python\n",
+ "#Memory address differs in different systems\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Value of a = 2 Address of a = 30726364\n",
+ "Through *p Value of a = 2 Address of a = 30726364\n",
+ "Through **q Vallue of a = 2 Address of a = 30726364"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.28, Page number: 305<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Different levels of array of pointer to pointer and display the elements\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "a = [1,2,3]\n",
+ "b = [0 for i in range(0,3)]\n",
+ "c = [0 for i in range(0,3)]\n",
+ "d = [0 for i in range(0,3)]\n",
+ "e = [0 for i in range(0,3)]\n",
+ "f = [0 for i in range(0,3)]\n",
+ "\n",
+ "for k in range(0,3):\n",
+ " b[k] = id(a[k])\n",
+ " c[k] = id(b[k])\n",
+ " d[k] = id(c[k])\n",
+ " e[k] = id(d[k])\n",
+ " f[k] = id(e[k])\n",
+ " \n",
+ "#Result\n",
+ "for k in range(0,3):\n",
+ " sys.stdout.write(\"%3d\"%(a[k]))\n",
+ " sys.stdout.write(\"%3d\"%(a[k]))\n",
+ " sys.stdout.write(\"%3d\"%(a[k]))\n",
+ " sys.stdout.write(\"%3d\"%(a[k]))\n",
+ " sys.stdout.write(\"%3d\\n\"%(a[k]))\n",
+ " \n",
+ "#There is no pointer concept in python\n",
+ "#Memory address differs in different systems\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1 1 1 1 1\n",
+ " 2 2 2 2 2\n",
+ " 3 3 3 3 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.29, Page number: 306<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display string using character pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "name = ['K','U','M','A','R']\n",
+ "ch = id(name)\n",
+ "i = 0\n",
+ "\n",
+ "#Result\n",
+ "while i < len(name): #There is no null terminating character in python string\n",
+ " sys.stdout.write(\"%c\"%(name[i]))\n",
+ " i += 1\n",
+ " \n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "KUMAR"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.30, Page number: 307<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Length of a given string including and excluding spaces using pointers\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "p = 0\n",
+ "q = 0\n",
+ "s = 0\n",
+ "str1 = ['P','O','I','N','T','E','R','S',' ','A','R','E',' ','E','A','S','Y']\n",
+ "\n",
+ "#Result\n",
+ "while s < len(str1): #There is no null termination character for python string\n",
+ " sys.stdout.write(\"%c\"%(str1[s]))\n",
+ " p += 1\n",
+ " if ord(str1[s]) == 32:\n",
+ " q += 1\n",
+ " s += 1\n",
+ "\n",
+ "sys.stdout.write(\"\\nLength of String including spaces : %d\"%(p))\n",
+ "sys.stdout.write(\"\\nLength of String excluding spaces : %d\"%(p-q))\n",
+ "\n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "POINTERS ARE EASY\n",
+ "Length of String including spaces : 17\n",
+ "Length of String excluding spaces : 15"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.31, Page number: 308<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Interchange elements of character array using pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "names = [\"kapil\",\"manoj\",\"amit\",\"amol\",\"pavan\",\"mahesh\"]\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"Original : %s %s\"%(names[3],names[4]))\n",
+ "\n",
+ "tmp = names[3]\n",
+ "names[3] = names[4]\n",
+ "names[4] = tmp\n",
+ "\n",
+ "sys.stdout.write(\"\\nNew : %s %s\"%(names[3],names[4]))\n",
+ "\n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original : amol pavan\n",
+ "New : pavan amol"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.32, Page number: 308<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#String comparison.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "c = 0\n",
+ "str1 = raw_input(\"Enter First String : \")\n",
+ "str2 = raw_input(\"Enter Second String : \")\n",
+ "a = 0\n",
+ "l = 0\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nSimilar Characters Found in Both String\")\n",
+ "\n",
+ "while a < len(str1):\n",
+ " if str1[a] == str2[a]:\n",
+ " sys.stdout.write(\"\\n\\t%c\\t%c\"%(str1[a],str2[a]))\n",
+ " l += 1\n",
+ " else:\n",
+ " c += 1\n",
+ " a += 1\n",
+ " \n",
+ "if c == 0:\n",
+ " sys.stdout.write(\"\\nThe Strings are Identical\")\n",
+ "else:\n",
+ " sys.stdout.write(\"\\nThe Strings are different at %d places.\"%(c))\n",
+ " sys.stdout.write(\"\\nThe String Characters are similar at %d places.\"%(l))\n",
+ " \n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter First String : SUNDAY\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Second String : MONDAY\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Similar Characters Found in Both String\n",
+ "\tN\tN\n",
+ "\tD\tD\n",
+ "\tA\tA\n",
+ "\tY\tY\n",
+ "The Strings are different at 2 places.\n",
+ "The String Characters are similar at 4 places."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.33, Page number: 310<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare three characters using pointers.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "x = raw_input(\"Enter Three Characters\")\n",
+ "y = raw_input(\"Enter Three Characters\")\n",
+ "z = raw_input(\"Enter Three Characters\")\n",
+ "\n",
+ "stat = 0\n",
+ "\n",
+ "stat = y > x\n",
+ "if x == y:\n",
+ " sys.stdout.write(\"\\n1st and 2nd Character are same\\n\")\n",
+ "else:\n",
+ " if stat < 0:\n",
+ " sys.stdout.write(\"\\n2nd Character appears after the 1st Character in Alphabetic\\n\")\n",
+ " else:\n",
+ " sys.stdout.write(\"2nd Character appears before the first Character in Alphabetic\\n\")\n",
+ " \n",
+ "stat = y > z\n",
+ "\n",
+ "if y == z:\n",
+ " sys.stdout.write(\"\\n2nd and 3rd Character are same.\")\n",
+ "else:\n",
+ " if stat > 0:\n",
+ " sys.stdout.write(\"\\n2nd Character appears after the 3rd Character in Alphabetic\")\n",
+ " else:\n",
+ " sys.stdout.write(\"\\n2nd Character appears before the 3rd Character in Alphabetic\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three CharactersC\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three CharactersC\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three CharactersA\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "1st and 2nd Character are same\n",
+ "\n",
+ "2nd Character appears after the 3rd Character in Alphabetic"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.34, Page number: 311<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare two strings irrespective of case. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "buf1 = \"computer\"\n",
+ "buf2 = \"computer\"\n",
+ "\n",
+ "#Comparison\n",
+ "stat = buf1 == buf2\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"The Characters upto 4th position are \")\n",
+ "if stat == 0:\n",
+ " sys.stdout.write(\"not \")\n",
+ "sys.stdout.write(\"same\")\n",
+ "\n",
+ "#There is no pointer concept in python and memicmp() function"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Characters upto 4th position are same"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.35, Page number: 311<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print the string upto the first occurrence of a character\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "\n",
+ "src = raw_input(\"Enter a String : \")\n",
+ "f = raw_input(\"Enter a Character to find in the text : \")\n",
+ "dest = ['0' for i in range(0,len(src))]\n",
+ "ptr = 0\n",
+ "\n",
+ "while ptr < len(src):\n",
+ " if src[ptr] == f:\n",
+ " dest[ptr] = src[ptr]\n",
+ " break\n",
+ " else:\n",
+ " dest[ptr] = src[ptr]\n",
+ " ptr += 1\n",
+ "\n",
+ "if ptr == len(src):\n",
+ " sys.stdout.write(\"The character wasn't found\\n\")\n",
+ "else:\n",
+ " sys.stdout.write(\"String upto that Character : %s\"%(dest[0:ptr+1]))\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a String : FUNCTIONS\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Character to find in the text : T\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "String upto that Character : ['F', 'U', 'N', 'C', 'T']"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.36, Page number: 312<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Replace the contents of second string with the first string. \n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "src = raw_input(\"Enter a Source String : \")\n",
+ "dest = raw_input(\"Enter a Destination String :\")\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\n\\nDestination before memcpy : %s\\n\"%(dest))\n",
+ "dest = src[:len(src)] + dest[len(src):]\n",
+ "\n",
+ "sys.stdout.write(\"Destination after memcpy : %s\\n\"%(dest))\n",
+ "\n",
+ "#There is no pointer concept in python and memcpy function"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Source String : Tomorrow\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Destination String :Today is Sunday\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "Destination before memcpy : Today is Sunday\n",
+ "Destination after memcpy : Tomorrowis Sunday\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.37, Page number: 313<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Display the string through their pointer\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization\n",
+ "c = \"Central Processing Unit\"\n",
+ "m = \"Math Co- Processor\"\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"'c' is pointing the string '%s'\\n\"%(c))\n",
+ "sys.stdout.write(\"'m' is pointing the string '%s'\\n\"%(m))\n",
+ "\n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "'c' is pointing the string 'Central Processing Unit'\n",
+ "'m' is pointing the string 'Math Co- Processor'\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.38, Page number: 314<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use void pointer to display the value of different variables.\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#Variable Initialization & Result\n",
+ "pt = 12\n",
+ "sys.stdout.write(\"\\nP = %d\"%(pt))\n",
+ "pt = 5.4\n",
+ "sys.stdout.write(\"\\nR = %.1f\"%(pt))\n",
+ "pt = 'S'\n",
+ "sys.stdout.write(\"\\nC = %c\"%(pt))\n",
+ "\n",
+ "#There is no pointer concept in python"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "P = 12\n",
+ "R = 5.4\n",
+ "C = S"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/README.txt b/Programming_in_C_using_ANSI_C/README.txt new file mode 100755 index 00000000..e5dfcad4 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/README.txt @@ -0,0 +1,10 @@ +Contributed By: Chithira G +Course: me +College/Institute/Organization: Lourdes Matha College of Science and Technology +Department/Designation: Computer Science +Book Title: Programming in C using ANSI C +Author: Ashok N Kamthane +Publisher: Pearson Education +Year of publication: 2006 +Isbn: 8131704378, 9788131704370 +Edition: 3
\ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/screenshots/screenshot1.png b/Programming_in_C_using_ANSI_C/screenshots/screenshot1.png Binary files differnew file mode 100755 index 00000000..61fbfcd0 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/screenshots/screenshot1.png diff --git a/Programming_in_C_using_ANSI_C/screenshots/screenshot1_1.png b/Programming_in_C_using_ANSI_C/screenshots/screenshot1_1.png Binary files differnew file mode 100755 index 00000000..61fbfcd0 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/screenshots/screenshot1_1.png diff --git a/Programming_in_C_using_ANSI_C/screenshots/screenshot2.png b/Programming_in_C_using_ANSI_C/screenshots/screenshot2.png Binary files differnew file mode 100755 index 00000000..df49d844 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/screenshots/screenshot2.png diff --git a/Programming_in_C_using_ANSI_C/screenshots/screenshot2_1.png b/Programming_in_C_using_ANSI_C/screenshots/screenshot2_1.png Binary files differnew file mode 100755 index 00000000..df49d844 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/screenshots/screenshot2_1.png diff --git a/Programming_in_C_using_ANSI_C/screenshots/screenshot3.png b/Programming_in_C_using_ANSI_C/screenshots/screenshot3.png Binary files differnew file mode 100755 index 00000000..42d9aec9 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/screenshots/screenshot3.png diff --git a/Programming_in_C_using_ANSI_C/screenshots/screenshot3_1.png b/Programming_in_C_using_ANSI_C/screenshots/screenshot3_1.png Binary files differnew file mode 100755 index 00000000..42d9aec9 --- /dev/null +++ b/Programming_in_C_using_ANSI_C/screenshots/screenshot3_1.png diff --git a/Structured_Programing_with_C++/Chapter1.ipynb b/Structured_Programing_with_C++/Chapter1.ipynb new file mode 100755 index 00000000..4a8d6e2e --- /dev/null +++ b/Structured_Programing_with_C++/Chapter1.ipynb @@ -0,0 +1,104 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c86efa8d98a193b995064bd56ef312e9a7c9cee5247409d33d46defcf953f275"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Introduction to Programming"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1, Page No 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Hello world\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello world\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page No 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "dblPrice = float(raw_input(\"Enter Price Per Unit : \"))\n",
+ "iNo = int(raw_input(\"Enter Quantity : \"))\n",
+ "dblTotal = dblPrice * iNo\n",
+ "print \"The Total Price Is : %d\" % dblTotal "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Price Per Unit : 100\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Quantity : 10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Total Price Is : 1000\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Structured_Programing_with_C++/Chapter2.ipynb b/Structured_Programing_with_C++/Chapter2.ipynb new file mode 100755 index 00000000..d373f52c --- /dev/null +++ b/Structured_Programing_with_C++/Chapter2.ipynb @@ -0,0 +1,288 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:8f653af2e0b44c81d67d541bdc64870a18188d9d1a401e0b96b1b859a01ca59f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapeter 2 : Variables"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1, Page No 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iNo = raw_input(\"Specify Quantity: \")\n",
+ "print iNo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specify Quantity: 10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2, Page No 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iNo = raw_input(\"Specify Quantity: \")\n",
+ "print \"You entered\", iNo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "specify quantity22\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You entered 22\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3, Page No 32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iNo = raw_input(\"specify quantity: \")\n",
+ "dPrice = raw_input(\"Specify unit Price: \")\n",
+ "print \"You entered the quantity \", iNo , \" and the price \" , dPrice"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "specify quantity: 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specify unit Price: 12.45\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You entered the quantity 5 and the price 12.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4, Page No 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "dTaxPerc = 25.0\n",
+ "iNo = int(raw_input(\"Specify Quantity: \"))\n",
+ "dUnitPr = float(raw_input(\"Specify Unit Price: \"))\n",
+ "dPriceExTax = dUnitPr * iNo\n",
+ "dTax = dPriceExTax * dTaxPerc / 100\n",
+ "dCustPrice = dPriceExTax + dTax\n",
+ "print \"INVOICE\"\n",
+ "print \"========\"\n",
+ "print \"Quantity: \", iNo\n",
+ "print \"Price per Unit: \", dUnitPr\n",
+ "print \"Total Price: \", dCustPrice\n",
+ "print \"Tax: \",dTax"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specify Quantity: 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specify Unit Price: 12.4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "INVOICE\n",
+ "========\n",
+ "Quantity: 5\n",
+ "Price per Unit: 12.4\n",
+ "Total Price: 77.5\n",
+ "Tax: 15.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5, Page No 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iNoOfSec = int(raw_input(\"Speicfy No. of Seconds: \"))\n",
+ "iNoOfMin = iNoOfSec / 60\n",
+ "iSecLeft = iNoOfSec % 60\n",
+ "iNoOfHours = iNoOfMin / 60\n",
+ "iMinLeft = iNoOfMin % 60\n",
+ "print \"Number of hours = \", iNoOfHours\n",
+ "print \"Number of Minutes = \", iNoOfMin\n",
+ "print \"Number of Seconds = \", iSecLeft"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Speicfy No. of Seconds: 10000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of hours = 2\n",
+ "Number of Minutes = 166\n",
+ "Number of Seconds = 40\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6, Page No 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import random\n",
+ "iNo = 5\n",
+ "iRoll1 = random.randint(0,100) % 6 + 1\n",
+ "iRoll2 = random.randint(0,100) % 6 + 1\n",
+ "iRoll3 = random.randint(0,100) % 6 + 1\n",
+ "iRoll4 = random.randint(0,100) % 6 + 1\n",
+ "iRoll5 = random.randint(0,100) % 6 + 1\n",
+ "dAverage = float(iRoll1 + iRoll2 + iRoll3 + iRoll4 + iRoll5) / iNo;\n",
+ "print \"Number of Rolls: \", iNo\n",
+ "print \"Average Score: \", dAverage"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of Rolls: 5\n",
+ "Average Score: 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Structured_Programing_with_C++/Chapter3.ipynb b/Structured_Programing_with_C++/Chapter3.ipynb new file mode 100755 index 00000000..bca740d6 --- /dev/null +++ b/Structured_Programing_with_C++/Chapter3.ipynb @@ -0,0 +1,540 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:16d6a5d7a0f2261d7c4bbdc27385a261d6311ef3eb7e569b90710460f45fff6c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : Selections and Loops"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1, Page No 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "dLimit = 500\n",
+ "iNo = int(raw_input(\"Specify Quantity : \"))\n",
+ "dUnitPrice = float(raw_input(\"Specify Unit Price : \"))\n",
+ "dGross = iNo * dUnitPrice\n",
+ "if(dGross > dLimit):\n",
+ " dDisc = 10\n",
+ "else:\n",
+ " dDisc = 0;\n",
+ "dNet = (100 - dDisc) * dGross / 100\n",
+ "print \"Total Price : %d\" % dNet"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specify Quantity : 100\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specify Unit Price : 10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Price : 900\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2, Page No 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "dNo1 = int(raw_input(\"Enter Number 1 : \"))\n",
+ "dNo2 = int(raw_input(\"Enter Number 2 : \"))\n",
+ "\n",
+ "print \"1. Greatest\"\n",
+ "print \"2. Least\"\n",
+ "print \"3. Average\"\n",
+ "\n",
+ "iOpt = int(raw_input(\"Select : \"))\n",
+ "\n",
+ "if iOpt == 1:\n",
+ " if dNo1 > dNo2:\n",
+ " print dNo1\n",
+ " else:\n",
+ " print dNo2\n",
+ " print \" is the greatest\"\n",
+ "elif iOpt == 2:\n",
+ " if dNo1 < dNo2:\n",
+ " print dNo1\n",
+ " else:\n",
+ " print dNo2\n",
+ " print \" is the least\"\n",
+ "elif iOpt == 3:\n",
+ " print \"The average is : \" , (dNo1 + dNo2)/2\n",
+ "else:\n",
+ " print \"wrong Choice\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number 1 : 10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Number 2 : 15\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1. Greatest\n",
+ "2. Least\n",
+ "3. Average\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Select : 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "15\n",
+ " is the greatest\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3, Page No 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iLimit = int(raw_input(\"Enter limit : \"))\n",
+ "iSum = 0\n",
+ "for i in range(1,iLimit+1):\n",
+ " iSum = iSum + i\n",
+ "\n",
+ "print \"The Sum Is : \" , iSum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Example 3.4, Page No 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Calculation Of Product\"\n",
+ "\n",
+ "for i in range(1,37):\n",
+ " for j in range(1,37):\n",
+ " if (i * j) == 36:\n",
+ " print i , \" and \" , j"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Calculation Of Product\n",
+ "1 and 36\n",
+ "2 and 18\n",
+ "3 and 12\n",
+ "4 and 9\n",
+ "6 and 6\n",
+ "9 and 4\n",
+ "12 and 3\n",
+ "18 and 2\n",
+ "36 and 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5, Page No 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import random\n",
+ "\n",
+ "iRoll = 0\n",
+ "iNoOfRolls = 0\n",
+ "\n",
+ "while iRoll != 6:\n",
+ " iRoll = random.randint(1,200) % 6 + 1\n",
+ " iNoOfRolls = iNoOfRolls + 1\n",
+ "\n",
+ "print iNoOfRolls"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6, Page No 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Do while concept is not in python thats way the program is implemented using WHILE\n",
+ "import random\n",
+ "\n",
+ "iRoll = 0\n",
+ "iNoOfRolls = 0\n",
+ "\n",
+ "while iRoll != 6:\n",
+ " iRoll = random.randint(1,200) % 6 +1\n",
+ " iNoOfRolls = iNoOfRolls + 1\n",
+ "\n",
+ "print iNoOfRolls"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7, Page No 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import random\n",
+ "\n",
+ "iCounter = 0\n",
+ "iRoll1 = random.randint(1,200) % 6 + 1\n",
+ "iRoll2 = random.randint(1,200) % 6 + 1\n",
+ " \n",
+ "\n",
+ "while iRoll1 != iRoll2:\n",
+ " iRoll1 = random.randint(1,200) % 6 + 1\n",
+ " iRoll2 = random.randint(1,200) % 6 + 1\n",
+ " iCounter = iCounter + 1\n",
+ "\n",
+ "print \"The rolls were = \" , iRoll1\n",
+ "print \"Number of attempts = \" , iCounter"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rolls were = 4\n",
+ "Number of attempts = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8, Page No 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iSum = 0\n",
+ "i = 0\n",
+ "iNo = raw_input(\"Enter a number : \")\n",
+ "\n",
+ "while iNo.isdigit():\n",
+ " iSum = iSum + int(iNo)\n",
+ " i = i + 1\n",
+ " iNo = raw_input(\"Enter one more number : \")\n",
+ "\n",
+ "print \"Average = \" , (float)((iSum)/i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter one more number : 6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter one more number : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter one more number : c\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average = 5.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9, Page No 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import random\n",
+ "iNO = 0\n",
+ "for i in range(1,14):\n",
+ " iNo = random.randint(1,200) % 3\n",
+ " if iNo == 0:\n",
+ " print \"1\"\n",
+ " elif iNo == 1:\n",
+ " print \"X\"\n",
+ " elif iNO == 2:\n",
+ " print \"2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X\n",
+ "X\n",
+ "X\n",
+ "X\n",
+ "1\n",
+ "1\n",
+ "X\n",
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10, Page No 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iNo = 0\n",
+ "iRoot = 1\n",
+ "while iNo < 2 and iRoot <=100:\n",
+ " LP = iRoot * (iRoot - 6) * (iRoot + 8)\n",
+ " if LP == 0:\n",
+ " iNo = iNo + 1\n",
+ " print iRoot\n",
+ " iRoot = iRoot + 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11, Page No 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "while 1 == 1:\n",
+ " dNo = int(raw_input(\"Enter a number : \"))\n",
+ " if dNo <= 0:\n",
+ " break\n",
+ " print \"The square root of the number is \",math.sqrt(dNo)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 100\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The square root of the number is 10.0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number : 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Structured_Programing_with_C++/Chapter4.ipynb b/Structured_Programing_with_C++/Chapter4.ipynb new file mode 100755 index 00000000..aff2c5eb --- /dev/null +++ b/Structured_Programing_with_C++/Chapter4.ipynb @@ -0,0 +1,563 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a27de4c3e22de467837d62cdd94a3b4f20a866984babfe11880e076feb1374ad"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Arrays"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1, Page No 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Declarations\n",
+ "\n",
+ "iNoOfDays = 31\n",
+ "dSum = 0\n",
+ "dblTempApr=[[0 for col in range(31)] for row in range(31)]\n",
+ "\n",
+ "\n",
+ "#Entry and calculation\n",
+ "\n",
+ "for i in range(1,iNoOfDays):\n",
+ " dblTempApr[i] = raw_input(\"Temperature Day %d: \" % i)\n",
+ " dSum += dblTempApr[i]\n",
+ "\n",
+ "dAvg = dSum / iNoOfDays\n",
+ "\n",
+ "#Printout\n",
+ "\n",
+ "print \"Average temperature: %f\" % dAvg\n",
+ "print \"Temperatures exceeding average: \"\n",
+ "\n",
+ "for i in range(1,iNoOfDays):\n",
+ " if (dblTempApr[i] > dAvg):\n",
+ " print \"Day no.: %d\" % i,\n",
+ " print \" temp: %d\" % dblTempApr[i]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 1: 32\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 2: 33\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 3: 35\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 4: 36\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 5: 34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 6: 32\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 7: 31\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 8: 29\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 9: 28\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 10: 27\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 11: 25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 12: 26\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 13: 35\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 14: 36\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 15: 35\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 16: 50\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 17: 40\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 18: 42\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 19: 44\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 20: 43\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 21: 41\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 22: 38\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 23: 37\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 24: 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 25: 36\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 26: 35\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 27: 45\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 28: 32\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 29: 21\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Day 30: 15\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average temperature: 32.000000\n",
+ "Temperatures exceeding average: \n",
+ "Day no.: 2 temp: 33\n",
+ "Day no.: 3 temp: 35\n",
+ "Day no.: 4 temp: 36\n",
+ "Day no.: 5 temp: 34\n",
+ "Day no.: 13 temp: 35\n",
+ "Day no.: 14 temp: 36\n",
+ "Day no.: 15 temp: 35\n",
+ "Day no.: 16 temp: 50\n",
+ "Day no.: 17 temp: 40\n",
+ "Day no.: 18 temp: 42\n",
+ "Day no.: 19 temp: 44\n",
+ "Day no.: 20 temp: 43\n",
+ "Day no.: 21 temp: 41\n",
+ "Day no.: 22 temp: 38\n",
+ "Day no.: 23 temp: 37\n",
+ "Day no.: 25 temp: 36\n",
+ "Day no.: 26 temp: 35\n",
+ "Day no.: 27 temp: 45\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2, Page No 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Declaration\n",
+ "\n",
+ "iMaxNo = 100\n",
+ "dLimit = 5000\n",
+ "perc1 = 0.1\n",
+ "perc2 = 0.15\n",
+ "sales = [[0 for col in range(1)] for row in range(iMaxNo)]\n",
+ "\n",
+ "#Initialize array\n",
+ "\n",
+ "for i in range(0,iMaxNo):\n",
+ " sales[i] = 0\n",
+ "\n",
+ "#Enter Salesman info\n",
+ "nr=input(\"Enter Salesman no. : \")\n",
+ "dAmount=input(\"Enter sales amount: \")\n",
+ "\n",
+ "while (nr and dAmount):\n",
+ " if(nr<1 or nr>iMaxNo or dAmount<0):\n",
+ " print \"Input error\"\n",
+ " break;\n",
+ " else:\n",
+ " sales[nr-1]+= dAmount\n",
+ " nr=int(raw_input(\"Enter Salesman no. : \"))\n",
+ " dAmount=float(raw_input(\"Enter sales amount: \"))\n",
+ "\n",
+ "#Print summary\n",
+ "\n",
+ "print \"Number Amount Fee\"\n",
+ "print \"====== ====== ===\"\n",
+ "\n",
+ "for i in range(0,iMaxNo):\n",
+ " if (sales[i] > 0):\n",
+ " if(sales[i] <= dLimit):\n",
+ " dFee = perc1 * sales[i]\n",
+ " else:\n",
+ " dFee = perc1 * dLimit + perc2*(sales[i] - dLimit)\n",
+ " j=i;\n",
+ " j=j+1;\n",
+ " print \"%4d\" % j,\n",
+ " print \"%13d\" % sales[i],\n",
+ " print \"%10.0f\" % dFee"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Salesman no. : 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter sales amount: 1000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Salesman no. : 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter sales amount: 2000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Salesman no. : 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter sales amount: 3000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Salesman no. : 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter sales amount: 4000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Salesman no. : 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter sales amount: 5000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Salesman no. : 6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter sales amount: 00\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number Amount Fee\n",
+ "====== ====== ===\n",
+ " 1 1000 100\n",
+ " 2 2000 200\n",
+ " 3 3000 300\n",
+ " 4 4000 400\n",
+ " 5 5000 500\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3, Page No 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Declaration\n",
+ "l=0\n",
+ "r=30\n",
+ "iFound=0\n",
+ "# Array is in sorted form\n",
+ "iProdid= [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]\n",
+ "\n",
+ "iSrch = raw_input(\"Enter the searched product id: \")\n",
+ "\n",
+ "if(iSrch == iProdid[0]):\n",
+ " iPos = 0\n",
+ " iFound= 1\n",
+ "\n",
+ "if (iSrch == iProdid[30]):\n",
+ " iPos = 30\n",
+ " iFound = 1\n",
+ "\n",
+ "while not (iFound):\n",
+ " iMid = (int)(l + ((r-l)/2))\n",
+ " if(iSrch == iProdid[iMid]):\n",
+ " iFound = 1\n",
+ " iPos = iMid\n",
+ "\n",
+ " if(iSrch > iProdid[iMid]):\n",
+ " l=iMid\n",
+ " else:\n",
+ " r=iMid"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the searched product id: 15\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Structured_Programing_with_C++/Chapter5.ipynb b/Structured_Programing_with_C++/Chapter5.ipynb new file mode 100755 index 00000000..bf5b3697 --- /dev/null +++ b/Structured_Programing_with_C++/Chapter5.ipynb @@ -0,0 +1,745 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:708386728a0ddd9fd0fa033f85042eb5d454abc98a33806d4ca4cc0500a010f0"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Strings"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1, Page No. 97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Menu\"\n",
+ "print \"=====\"\n",
+ "print \"A. Order\"\n",
+ "print \"B. Invoice\"\n",
+ "print \"C. Warehouse\"\n",
+ "print \"D. Finance\"\n",
+ "cSel = raw_input(\"Select: \")\n",
+ "if cSel=='A' :\n",
+ " print \"You Selected Order\"\n",
+ "elif cSel=='B' :\n",
+ " print \"You Selected Invoice\"\n",
+ "elif cSel=='C':\n",
+ " print \"You Selected Warehouse\"\n",
+ "elif cSel=='D' :\n",
+ " print \"You Selected Finance\"\n",
+ "else :\n",
+ " print \"Erroneous Choice\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Menu\n",
+ "=====\n",
+ "A. Order\n",
+ "B. Invoice\n",
+ "C. Warehouse\n",
+ "D. Finance\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Select: A\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You Selected Order\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2, Page No.99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import sys\n",
+ "cSal = 'A'\n",
+ "while cSal!='X':\n",
+ " print \"Menu\"\n",
+ " print \"=====\"\n",
+ " print \"A. Order\"\n",
+ " print \"B. Invoice\"\n",
+ " print \"C. Warehouse\"\n",
+ " print \"D. Finance\"\n",
+ " print \"X. Exit\"\n",
+ " cSel = raw_input(\"Select: \")\n",
+ "\n",
+ " \n",
+ " if cSel=='A' :\n",
+ " print \"You Selected Order\"\n",
+ " elif cSel=='B' :\n",
+ " print \"You Selected Invoice\"\n",
+ " elif cSel=='C':\n",
+ " print \"You Selected Warehouse\"\n",
+ " elif cSel=='D' :\n",
+ " print \"You Selected Finance\"\n",
+ " elif cSel=='X':\n",
+ " sys.exit()\n",
+ " else :\n",
+ " print \"Erroneous Choice\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Menu\n",
+ "=====\n",
+ "A. Order\n",
+ "B. Invoice\n",
+ "C. Warehouse\n",
+ "D. Finance\n",
+ "X. Exit\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Select: A\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You Selected Order\n",
+ "Menu\n",
+ "=====\n",
+ "A. Order\n",
+ "B. Invoice\n",
+ "C. Warehouse\n",
+ "D. Finance\n",
+ "X. Exit\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Select: B\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You Selected Invoice\n",
+ "Menu\n",
+ "=====\n",
+ "A. Order\n",
+ "B. Invoice\n",
+ "C. Warehouse\n",
+ "D. Finance\n",
+ "X. Exit\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Select: X\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3, Page No. 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "x = 'X' \n",
+ "blank = ' '\n",
+ "for i in range(10, -1, -1):\n",
+ " for j in range(i):\n",
+ " print blank,\n",
+ " print x,\n",
+ " for j in range(10-i):\n",
+ " print x, x,\n",
+ " print ''\n",
+ "for i in range(2):\n",
+ " for j in range(10):\n",
+ " print blank,\n",
+ " print x"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " X \n",
+ " X X X \n",
+ " X X X X X \n",
+ " X X X X X X X \n",
+ " X X X X X X X X X \n",
+ " X X X X X X X X X X X \n",
+ " X X X X X X X X X X X X X \n",
+ " X X X X X X X X X X X X X X X \n",
+ " X X X X X X X X X X X X X X X X X \n",
+ " X X X X X X X X X X X X X X X X X X X \n",
+ "X X X X X X X X X X X X X X X X X X X X X \n",
+ " X\n",
+ " X\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4, Page No. 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import sys\n",
+ "cName = raw_input(\"Enter your name: \")\n",
+ "print \"Your name is \" , cName\n",
+ "print \"Your name is \" , len(cName), \" Characters long\"\n",
+ "print \"Your entire string is \" , sys.getsizeof(cName), \" characters long\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: John Smith\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your name is John Smith\n",
+ "Your name is 10 Characters long\n",
+ "Your entire string is 31 characters long\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5, Page No. 106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "cName=range(30)\n",
+ "cName = raw_input(\"Enter your name in lower case: \")\n",
+ "iLen = len(cName)\n",
+ "for ltr in cName:\n",
+ " print ltr.lower(),\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name in lower case: ABCD\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a b c d\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6, Page No. 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "cName = raw_input(\"Enter your name: \")\n",
+ "iLen = len(cName)\n",
+ "cInt = []\n",
+ "cInt.append(cName[0])\n",
+ "for i in range(1, iLen):\n",
+ " if cName[i] == ' ':\n",
+ " cInt.append(cName[i+1])\n",
+ "print \"Your Initials are \", ''.join(cInt)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: Kjell Backman\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your Initials are KB\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7, Page No. 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "cName1 = raw_input(\"Enter a Name: \")\n",
+ "cName2 = raw_input(\"Enter another Name: \")\n",
+ "if cName1 > cName2 :\n",
+ " print cName1 , cName2\n",
+ "else :\n",
+ " print cName2 , cName1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a Name: abcd\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter another Name: abcx\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "abcx abcd\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8, Page No. 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter 5 names: \"\n",
+ "names = []\n",
+ "for i in range(5):\n",
+ " names.append(raw_input(\"name \" + str(i+1) + \": \"))\n",
+ "names.sort()\n",
+ "for i in range(5):\n",
+ " print names[i]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter 5 names: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "name 1: hardik\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "name 2: Parth\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "name 3: Nikunj\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "name 4: Vaibhav\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "name 5: Chirag\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Chirag\n",
+ "Nikunj\n",
+ "Parth\n",
+ "Vaibhav\n",
+ "hardik\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.9, Page No.113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "cName = raw_input(\"Enter Your Name: \")\n",
+ "for i in range(29):\n",
+ " if cName[i] == ' ':\n",
+ " break\n",
+ "cFirst=cName[0:i]\n",
+ "print cFirst\n",
+ "cSur=cName[i+1:]\n",
+ "print cSur\n",
+ "cSur=cSur+\" \"\n",
+ "cSur=cSur+cFirst\n",
+ "print cSur\n",
+ "cSur=cSur[::-1]\n",
+ "print cSur"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Name: John Smith\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "John\n",
+ "Smith\n",
+ "Smith John\n",
+ "nhoJ htimS\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.10, Page No.115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "cEncrypt = []\n",
+ "cName = []\n",
+ "cName = raw_input(\"Enter Your Name: \")\n",
+ "iLen = len(cName)\n",
+ "for i in range(iLen):\n",
+ " asc=ord(cName[i])\n",
+ " asc=asc+1\n",
+ " cEncrypt.append(chr(asc))\n",
+ "print ''.join(cEncrypt)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Your Name: JohnSmith\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "KpioTnjui\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.11, Page No. 116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import random\n",
+ "iLen = random.randint(0,100)%3+5\n",
+ "cPw=[]\n",
+ "for i in range(iLen):\n",
+ " val=random.randint(0,122)%26+65\n",
+ " cPw.append(chr(val))\n",
+ "print ''.join(cPw)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ZXZUOY\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.12, Page No. 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "cText=[]\n",
+ "cEncrypt=[]\n",
+ "cTemp1=[]\n",
+ "cText=raw_input(\"\\nWrite a text in upper case: \")\n",
+ "iLen= len(cText)\n",
+ "for i in range(iLen):\n",
+ " print cText[i]\n",
+ " car=ord(cText[i])\n",
+ " cEncrypt.append(car)\n",
+ "print ''.join(str(cEncrypt))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Write a text in upper case: hellow\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "h\n",
+ "e\n",
+ "l\n",
+ "l\n",
+ "o\n",
+ "w\n",
+ "[104, 101, 108, 108, 111, 119]\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import random\n",
+ "cKey=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n",
+ "cKey=list(cKey)\n",
+ "cEncrypt=range(50)\n",
+ "for i in range(26):\n",
+ " j=random.randint(0,100)%26\n",
+ " cTemp=cKey[i]\n",
+ " cKey[i]=cKey[j]\n",
+ " cKey[j]=cTemp\n",
+ "cKey=\"\".join(map(str,cKey))\n",
+ "cText=raw_input(\"\\nWrite a text in upper case: \")\n",
+ "iLen= len(cText)\n",
+ "for i in range(iLen):\n",
+ " cEncrypt[i]=cKey[ord(cText[i])-65]\n",
+ "cEncrypt=cEncrypt[::iLen]\n",
+ "print \"\".join(map(str,cEncrypt))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Write a text in upper case: JOHNSMITH\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R918273645\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Structured_Programing_with_C++/Chapter6.ipynb b/Structured_Programing_with_C++/Chapter6.ipynb new file mode 100755 index 00000000..6ee5ccef --- /dev/null +++ b/Structured_Programing_with_C++/Chapter6.ipynb @@ -0,0 +1,549 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3541583e6368ad0fd94057f7e595031de565be72b75fadedd8abb1168ccd2728"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Functions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page No 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def dAverage(x1,x2):\n",
+ " av = (x1+x2)/2\n",
+ " return av\n",
+ "\n",
+ "print \"Enter two numbers:\"\n",
+ "dNo1= float(raw_input(\"\"))\n",
+ "dNo2= float(raw_input(\"\"))\n",
+ "dAvg= dAverage(dNo1,dNo2)\n",
+ "print \"The average is: \",dAvg"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter two numbers:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average is: 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2, Page No 127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def min(x,y):\n",
+ " if (x<y):\n",
+ " return x\n",
+ " else:\n",
+ " return y\n",
+ " \n",
+ "print \"Enter Three integer: \"\n",
+ "a=int(raw_input(\"\"))\n",
+ "b=int(raw_input(\"\"))\n",
+ "c=int(raw_input(\"\"))\n",
+ "m=min(a,b)\n",
+ "m=min(m,c)\n",
+ "print m"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Three integer: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page No 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def min(x,y):\n",
+ " if(x<y):\n",
+ " return x\n",
+ " else:\n",
+ " return y\n",
+ "t=0\n",
+ "iNos=range(5)\n",
+ "for t in range(5):\n",
+ " print \"Enter integer no\",t+1,\":\"\n",
+ " iNos[t]=int(raw_input(\"\"))\n",
+ "\n",
+ "m=iNos[0]\n",
+ "\n",
+ "for t in range(5):\n",
+ " m=min(iNos[t],m)\n",
+ "\n",
+ "print m,\"is the least integer\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter integer no 1 :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter integer no 2 :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter integer no 3 :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter integer no 4 :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter integer no 5 :\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3 is the least integer\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page No 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def iLgth(s):\n",
+ " n=0\n",
+ " while(s[n] != '\\0'):\n",
+ " n=n+1\n",
+ " return n\n",
+ "\n",
+ "cWord=range(30)\n",
+ "cWord=raw_input(\"Enter a word:\")\n",
+ "cWord=cWord + '\\0' #by default string array don't appen NULL character hence, it is manually appended\n",
+ "iLen=iLgth(cWord)\n",
+ "print \"Length of the word is: \",iLen"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a word:bhavin mehta\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of the word is: 12\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page No 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def dDiscount(iQty,dLinePrice):\n",
+ " if(dLinePrice>1000):\n",
+ " return 0.15\n",
+ " elif(dLinePrice>500 or iQty>10):\n",
+ " return 0.10\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "def dPrice(iNo,dUnitPrice):\n",
+ " dTax=0.25\n",
+ " dLinePr=iNo*dUnitPrice\n",
+ " dDiscPerc=dDiscount(iNo,dLinePr)\n",
+ " return dLinePr*(1-dDiscPerc)*(1+dTax)\n",
+ "\n",
+ "print \"Enter quantity and unit price: \"\n",
+ "iQuantity=int(raw_input(\"\"))\n",
+ "dUnitPrice=float(raw_input(\"\"))\n",
+ "\n",
+ "print \"To be paid\", dPrice(iQuantity,dUnitPrice)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter quantity and unit price: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "To be paid 1593.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page No 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def replace1(s,c,cnew):\n",
+ " n=0\n",
+ " s = list(s)\n",
+ " while(s[n]!='\\0'):\n",
+ " if(s[n]==c):\n",
+ " s[n]=cnew\n",
+ " n=n+1\n",
+ " print \"\".join(map(str,s))\n",
+ "a=\"C:/Mydocumnets/Sheets\\0\"\n",
+ "print a\n",
+ "replace1(a,'/','-')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C:/Mydocumnets/Sheets\u0000\n",
+ "C:-Mydocumnets-Sheets\u0000\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.7, Page No 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def word(s):\n",
+ " i=0\n",
+ " j=len(s)\n",
+ " while(i<j):\n",
+ " if((s[i]>='a' and s[i]<='z')or(s[i]>='A' and s[i]<='Z')):\n",
+ " i=i+1\n",
+ " else:\n",
+ " return 0;\n",
+ " return 1;\n",
+ "\n",
+ "str=range(100)\n",
+ "str=raw_input(\"Enter word: \")\n",
+ "while(str):\n",
+ " if(word(str)):\n",
+ " print \"A word\"\n",
+ " else:\n",
+ " print \"No word\"\n",
+ " str=raw_input(\"Enter word: \")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter word: john\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A word\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter word: smith\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A word\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter word: john smith\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No word\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter word: \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.8, Page No 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#import myfunc we have created this header file and its going to work as header file user has to make it\n",
+ "print \"To be paid: \" + str(dPrice(10,700))\n",
+ "\n",
+ "# Code for myfunc Header file is here\n",
+ "\n",
+ "\"\"\"\n",
+ "def underline(n):\n",
+ " for i in range(n):\n",
+ " print \"=\",\n",
+ "def dDiscount(iQty,dLinePrice):\n",
+ " if(dLinePrice > 1000):\n",
+ " return 0.15\n",
+ " elif(dLinePrice>500 or iQty>10):\n",
+ " return 0.10\n",
+ " else:\n",
+ " return 0\n",
+ "def dPrice(iNo,dUnitPrice):\n",
+ " dTax = 0.25\n",
+ " dLinePr = iNo * dUnitPrice\n",
+ " dDiscPerc = dDiscount(iNo,dLinePr)\n",
+ " return dLinePr * (1-dDiscPerc) * (1+dTax)\n",
+ "\"\"\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Structured_Programing_with_C++/Chapter7.ipynb b/Structured_Programing_with_C++/Chapter7.ipynb new file mode 100755 index 00000000..c4850700 --- /dev/null +++ b/Structured_Programing_with_C++/Chapter7.ipynb @@ -0,0 +1,478 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:81ebacbcf46be2a85cdba0d8109c34324595901036a67c9025bbb5cab58aa894"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Files"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page No 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "outfile = open(\"prodfile1.txt\",\"w\")\n",
+ "cProd = raw_input(\"Enter product, (only Enter to exit:\")\n",
+ "while (len(cProd) > 0):\n",
+ " outfile.writelines(cProd)\n",
+ " outfile.writelines(\"\\n\")\n",
+ " cProd = raw_input(\"Enter product, (only Enter to exit:\")\n",
+ "outfile.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product, (only Enter to exit:wheel\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product, (only Enter to exit:handlebars\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product, (only Enter to exit:saddle\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product, (only Enter to exit:bike\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product, (only Enter to exit:moped\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product, (only Enter to exit:\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Examle 7.2 Page No 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "infile = open(\"prodfile1.txt\",\"r\")\n",
+ "while (1):\n",
+ " cProd = infile.readline()\n",
+ " if(cProd):\n",
+ " print cProd\n",
+ " else:\n",
+ " break\n",
+ "infile.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wheel\n",
+ "\n",
+ "handlebars\n",
+ "\n",
+ "saddle\n",
+ "\n",
+ "bike\n",
+ "\n",
+ "moped\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page No 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "cProd = raw_input(\"Enter new product \")\n",
+ "outfile = open(\"prodfile.txt1\",\"a\")\n",
+ "outfile.writelines(cProd)\n",
+ "outfile.close() "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter new product Spoke\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4, Page No 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iProdId = 1\n",
+ "outfile = open(\"prodfile.txt\",\"w\")\n",
+ "while (iProdId != 0):\n",
+ " iProdId = int(raw_input(\"Enter product id: \"))\n",
+ " dPrice = float(raw_input(\"...and price: \"))\n",
+ " if(iProdId > 0):\n",
+ " outfile.writelines(str(iProdId) + '\\n' + str(dPrice) + '\\n')\n",
+ "outfile.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product id: 2345\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "...and price: 245.5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product id: 4512\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "...and price: 450.2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product id: 3902\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "...and price: 320.7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product id: 2478\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "...and price: 75.9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product id: 0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "...and price: 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5, Page No 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iFound = 0\n",
+ "infile = open(\"prodfile.txt\",\"r\")\n",
+ "iSrch = int(raw_input(\"Enter product id: \"))\n",
+ "while(1):\n",
+ " iProdId = infile.readline()\n",
+ " if(iProdId == \"\"):\n",
+ " break\n",
+ " iProdId = int(iProdId)\n",
+ " dPrice = float(infile.readline())\n",
+ " if(iProdId == iSrch):\n",
+ " print \"The price is:\" , dPrice\n",
+ " iFound = 1\n",
+ " break\n",
+ "if(not iFound):\n",
+ " print \"Product missing\"\n",
+ "infile.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter product id: 1234\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Product missing\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6, Page No 166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def sort(cList,n):\n",
+ " for v in range(0,n-1):\n",
+ " for h in range(v+1,n):\n",
+ " if(cList[h]<cList[v]):\n",
+ " temp = cList[v]\n",
+ " cList[v] = cList[h]\n",
+ " cList[h] = temp\n",
+ "i = 0\n",
+ "infile = open(\"prodfile1.txt\",\"r\")\n",
+ "cProd = infile.readlines()\n",
+ "infile.close()\n",
+ "while(i < len(cProd)):\n",
+ " i = i + 1\n",
+ "iNo = i\n",
+ "sort(cProd,iNo)\n",
+ "for j in range(0,iNo):\n",
+ " print cProd[j]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bike\n",
+ "\n",
+ "Handlebars\n",
+ "\n",
+ "Moped\n",
+ "\n",
+ "Saddle\n",
+ "\n",
+ "Spoke\n",
+ "\n",
+ "Wheel\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.7, Page No 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "infile = open(\"prodfile.txt\",\"r\")\n",
+ "outfile = open(\"temp.txt\",\"w\")\n",
+ "iSrch = int(raw_input(\"Specify product id: \"))\n",
+ "while(1):\n",
+ " iProdId = infile.readline()\n",
+ " if(iProdId == \"\"):\n",
+ " break\n",
+ " iProdId = int(iProdId)\n",
+ " dPrice = float(infile.readline())\n",
+ " if(iProdId == iSrch):\n",
+ " dPrice = float(raw_input(\"Specify the new price: \"))\n",
+ " outfile.writelines(str(iProdId) + '\\n' + str(dPrice) + '\\n')\n",
+ "infile.close()\n",
+ "outfile.close()\n",
+ "os.remove(\"prodfile.txt\")\n",
+ "os.rename(\"temp.txt\",\"prodfile.txt\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specify product id: 2345\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specify the new price: 33.33\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.8, Page No 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import os\n",
+ "cNewName = raw_input(\"Specify new file name: \")\n",
+ "infile = open(\"prodfile.txt\",\"r\")\n",
+ "outfile = open(cNewName,\"w\")\n",
+ "if(not os.path.exists(cNewName)):\n",
+ " print \"The file could not be created\"\n",
+ "outfile.writelines(infile.readlines())\n",
+ "infile.close()\n",
+ "outfile.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specify new file name: tryal.txt\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Structured_Programing_with_C++/Chapter8.ipynb b/Structured_Programing_with_C++/Chapter8.ipynb new file mode 100755 index 00000000..0d779089 --- /dev/null +++ b/Structured_Programing_with_C++/Chapter8.ipynb @@ -0,0 +1,352 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:95ddab2248de9e7055a4dff19cd18b277d7ba7ab8ace5be6bff568b621024b03"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Chapter 8 : Pointers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1, Page No 179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from ctypes import *\n",
+ "\n",
+ "iNo=c_int\n",
+ "pNo = id(iNo)\n",
+ "dPrice=dTotal=float\n",
+ "pPrice=id(dPrice)\n",
+ "pTotal=id(dTotal)\n",
+ "cName=range(20)\n",
+ "pName=id(cName)\n",
+ "pName = raw_input(\"Enter your name: \")\n",
+ "pNo = int(raw_input(\"Enter quantity: \"))\n",
+ "pPrice = float(raw_input(\"and price: \"))\n",
+ "pTotal = pNo * pPrice\n",
+ "print \"Dear \" + pName + \", your price is \" + str(pTotal) + \" kr.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: chirag\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter quantity: 10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "and price: 100\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dear chirag, your price is 1000.0 kr.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2, Page No 182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iSal=[14000,15000,16000,17000,18000,19000]\n",
+ "pSal = id(iSal)\n",
+ "dTax=[0.32,0.34,0.35,0.36,0.365,0.37]\n",
+ "pTax=id(dTax)\n",
+ "print \"Salary Tax\"\n",
+ "for i in range(6):\n",
+ " print str(iSal[i])+\" \",str(iSal[i]*dTax[i])\n",
+ " i=i+1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Salary Tax\n",
+ "14000 4480.0\n",
+ "15000 5100.0\n",
+ "16000 5600.0\n",
+ "17000 6120.0\n",
+ "18000 6570.0\n",
+ "19000 7030.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3, Page No 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def find(s):\n",
+ " for p in range(len(s)):\n",
+ " if(s[p]=='@'):\n",
+ " print \"It is an email address\"\n",
+ " p=p+1\n",
+ "\n",
+ "#cString=range(9)\n",
+ "pString=id(cString)\n",
+ "cString=raw_input(\"Enter A text: \")\n",
+ "find(cString)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter A text: hello@gmail.com\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "It is an email address\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4, Page No 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iNumber=int(raw_input(\"How many product will be entered? \"))\n",
+ "\n",
+ "for i in range(iNumber):\n",
+ " pNo = id(iNumber)\n",
+ " print pNo\n",
+ " pNO = pNo + 1\n",
+ "pNo = pNo - iNumber\n",
+ "for i in range(iNumber):\n",
+ " print id(pNO)\n",
+ " pNo = pNO + 1\n",
+ "pNo = pNo - iNumber\n",
+ "del pNo "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many product will be entered? 5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3848360\n",
+ "3848360\n",
+ "3848360\n",
+ "3848360\n",
+ "3848360\n",
+ "51980880\n",
+ "51980880\n",
+ "51980880\n",
+ "51980880\n",
+ "51980880\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5, Page No 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "iNo = 5\n",
+ "cName = range(iNo)\n",
+ "print \"Enter the name of 5 course mates: \"\n",
+ "for i in range(iNo):\n",
+ " print \"Mate no. \" ,i+1\n",
+ " temp = raw_input(\"Mate name: \")\n",
+ " cName.append(temp)\n",
+ "for j in range(iNo):\n",
+ " print cName[j]\n",
+ "for k in range(iNo):\n",
+ " del cName[k] "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the name of 5 course mates: \n",
+ "Mate no. 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mate name: a\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mate no. 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mate name: b\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mate no. 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mate name: c\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mate no. 4\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mate name: d\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mate no. 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mate name: e\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n",
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Structured_Programing_with_C++/Chapter9.ipynb b/Structured_Programing_with_C++/Chapter9.ipynb new file mode 100755 index 00000000..724e3c4e --- /dev/null +++ b/Structured_Programing_with_C++/Chapter9.ipynb @@ -0,0 +1,274 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3c26b0f763ca451c03b73133e1c2db791af8fb7ada7862c248f0876f5e8843fe"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Structures"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page No 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "class Prod:\n",
+ " def __init__(self, cName, iId, dPrice, iNo, cSupp):\n",
+ " self.cName = cName\n",
+ " self.iId = iId\n",
+ " self.dPrice = dPrice\n",
+ " self.iNo = iNo\n",
+ " self.cSupp = cSupp\n",
+ " def println(self):\n",
+ " print self.cName + \"\\t \",\n",
+ " print str(self.iId) + \"\\t \",\n",
+ " print str(self.dPrice) + \"\\t \",\n",
+ " print str(self.iNo) + \"\\t \",\n",
+ " print self.cSupp + \"\\t\\n\",\n",
+ "if __name__ == '__main__':\n",
+ " prodOne = Prod(\"Olive Oil\",1001,120.50,250,\"Frescati Oil S/A\")\n",
+ " print \"Enter information for product\"\n",
+ " cName = raw_input(\"Start with the product name: \")\n",
+ " iId = int(raw_input(\"The product id: \"))\n",
+ " dPrice = float(raw_input(\"The price: \"))\n",
+ " iNo = int(raw_input(\"How many items are there in stock: \"))\n",
+ " cSupp = raw_input(\"Who supplies the product: \")\n",
+ " prodTwo = Prod(cName,iId,dPrice,iNo,cSupp)\n",
+ " print \"Productname \\t Product id \\t Price \\t Quantity \\t Supplier\\n\"\n",
+ " prodOne.println()\n",
+ " prodTwo.println()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter information for product\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Start with the product name: Coconut Oil\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The product id: 1002\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The price: 120.50\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many items are there in stock: 230\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Who supplies the product: Frescati Oil S/A\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Productname \t Product id \t Price \t Quantity \t Supplier\n",
+ "\n",
+ "Olive Oil\t 1001\t 120.5\t 250\t Frescati Oil S/A\t\n",
+ "Coconut Oil\t 1002\t 120.5\t 230\t Frescati Oil S/A\t\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page No 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "class Prod:\n",
+ " def __init__(self, cName, iId, dPrice, iNo, cSupp):\n",
+ " self.cName = cName\n",
+ " self.iId = iId\n",
+ " self.dPrice = dPrice\n",
+ " self.iNo = iNo\n",
+ " self.cSupp = cSupp\n",
+ "def printOnScreen(prodOne1):\n",
+ " print prodOne1.cName + \"\\t \",\n",
+ " print str(prodOne1.iId) + \"\\t \",\n",
+ " print str(prodOne1.dPrice) + \"\\t \",\n",
+ " print str(prodOne1.iNo) + \"\\t \",\n",
+ " print prodOne1.cSupp + \"\\t\\n\",\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " prodOne = Prod(\"Olive Oil\",1001,120.50,250,\"Frescati Oil S/A\")\n",
+ " printOnScreen(prodOne)\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Olive Oil\t 1001\t 120.5\t 250\t Frescati Oil S/A\t\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3, Page No 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "class Prod:\n",
+ " def __init__(self, cName, iId, dPrice, iNo, cSupp):\n",
+ " self.cName = cName\n",
+ " self.iId = iId\n",
+ " self.dPrice = dPrice\n",
+ " self.iNo = iNo\n",
+ " self.cSupp = cSupp\n",
+ "def printOnScreen(p,n):\n",
+ " for i in range(n):\n",
+ " print p[i].cName + \"\\t \",\n",
+ " print str(p[i].iId) + \"\\t \",\n",
+ " print str(p[i].dPrice) + \"\\t \",\n",
+ " print str(p[i].iNo) + \"\\t \",\n",
+ " print p[i].cSupp + \"\\t\\n\",\n",
+ "if __name__ == '__main__':\n",
+ " sProds = []\n",
+ " sProds.append(Prod(\"Food Oil\",101,12.50,100,\"Felix Ltd\"))\n",
+ " sProds.append(Prod(\"Baby Oil\",102,23.75,25,\"Baby Prod\"))\n",
+ " sProds.append(Prod(\"Boiler Oil\",103,6100,123000,\"Shell\"))\n",
+ " printOnScreen(sProds,3)\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Food Oil\t 101\t 12.5\t 100\t Felix Ltd\t\n",
+ "Baby Oil\t 102\t 23.75\t 25\t Baby Prod\t\n",
+ "Boiler Oil\t 103\t 6100\t 123000\t Shell\t\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4, Page No 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "class Prod:\n",
+ " def __init__(self, cName, iId, dPrice, iNo, cSupp):\n",
+ " self.cName = cName\n",
+ " self.iId = iId\n",
+ " self.dPrice = dPrice\n",
+ " self.iNo = iNo\n",
+ " self.cSupp = cSupp\n",
+ "def printOnScreen(p,n):\n",
+ " for i in range(n):\n",
+ " print p[i].cName + \"\\t \",\n",
+ " print str(p[i].iId) + \"\\t \",\n",
+ " print str(p[i].dPrice) + \"\\t \",\n",
+ " print str(p[i].iNo) + \"\\t \",\n",
+ " print p[i].cSupp + \"\\t\\n\",\n",
+ "if __name__ == '__main__':\n",
+ " sProds = []\n",
+ " sProds.append(Prod(\"Food Oil\",101,12.50,100,\"Felix Ltd\"))\n",
+ " sProds.append(Prod(\"Baby Oil\",102,23.75,25,\"Baby Prod\"))\n",
+ " sProds.append(Prod(\"Boiler Oil\",103,6100,123000,\"Shell\"))\n",
+ " pProds = id(sProds)\n",
+ " printOnScreen(sProds,3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Food Oil\t 101\t 12.5\t 100\t Felix Ltd\t\n",
+ "Baby Oil\t 102\t 23.75\t 25\t Baby Prod\t\n",
+ "Boiler Oil\t 103\t 6100\t 123000\t Shell\t\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Structured_Programing_with_C++/README.txt b/Structured_Programing_with_C++/README.txt new file mode 100755 index 00000000..ac28cf27 --- /dev/null +++ b/Structured_Programing_with_C++/README.txt @@ -0,0 +1,10 @@ +Contributed By: Chirag Kotak +Course: mca +College/Institute/Organization: Shri Brahmanand Institute of Management and Computer Science +Department/Designation: Computer Science +Book Title: Structured Programing with C++ +Author: Kjell Backman +Publisher: Ventus Publishing ApS +Year of publication: 2012 +Isbn: 978-87-403-0099-4 +Edition: 1st Edition
\ No newline at end of file diff --git a/Structured_Programing_with_C++/screenshots/1.png b/Structured_Programing_with_C++/screenshots/1.png Binary files differnew file mode 100755 index 00000000..7040411e --- /dev/null +++ b/Structured_Programing_with_C++/screenshots/1.png diff --git a/Structured_Programing_with_C++/screenshots/2.png b/Structured_Programing_with_C++/screenshots/2.png Binary files differnew file mode 100755 index 00000000..667e163b --- /dev/null +++ b/Structured_Programing_with_C++/screenshots/2.png diff --git a/Structured_Programing_with_C++/screenshots/3.png b/Structured_Programing_with_C++/screenshots/3.png Binary files differnew file mode 100755 index 00000000..1ab51d18 --- /dev/null +++ b/Structured_Programing_with_C++/screenshots/3.png diff --git a/Surveying_Volume_3/Chapter1.ipynb b/Surveying_Volume_3/Chapter1.ipynb index 015050ae..3327643c 100755 --- a/Surveying_Volume_3/Chapter1.ipynb +++ b/Surveying_Volume_3/Chapter1.ipynb @@ -1,6 +1,6 @@ { "metadata": { - "name": "S3-C1" + "name": "Chapter 1" }, "nbformat": 3, "nbformat_minor": 0, @@ -9,72 +9,1466 @@ "cells": [ { "cell_type": "heading", - "level": 1, + "level": 2, "metadata": {}, - "source": "Electronic Distance Measurement" + "source": "FIELD ASTRONOMY" }, { "cell_type": "heading", - "level": 2, + "level": 3, + "metadata": {}, + "source": "Example 1.1, Page 30" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding difference of longitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\n#part1\na =40; # longitude of A\nb =73; # longitude of B\n\n#calculation\ndol =b-a; # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees\",round(dol);\n\n#part2\na =20; # longitude of A\nb =150; # longitude of B\n\n#calculation\ndol =b-a; # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees \",round(dol);\n\n#part3\na =-20; # longitude of A\nb =50; # longitude of B\n\n#calculation\ndol =b-a; # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees\",round(dol);\n\n#part4\na =-40; # longitude of A\nb =150; # longitude of B\n\n#calculation\ndol =360-(b-a); # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees\",round(dol);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " difference of longitude is 33.0\n difference of longitude is 130.0\n difference of longitude is 70.0\n difference of longitude is 170.0\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, "metadata": {}, - "source": "Example 1.1,Page 22" + "source": "Example 1.2.1,Page 31" }, { "cell_type": "code", "collapsed": false, - "input": "#initialisation of variable\nT=273+25.0#temperature \np=752.0;#pressure mm Hg\nNo=294.0e-6;\nns=1.000284;\nD1=1438.254;#recorded distance in m\nh=263.42-243.25;#height difference in m\nR=6370e3;#radius of earth in m\n\n#calculation\nn=1+No*(273/T)*(p/760);\nD=D1*ns/n;\ncg=-h**2/2/D;\nHm=263.42/2+243.25/2;\nD=D+cg;\nch=-D*Hm/R\nEL=D+ch;\n\n#result\nprint \"equivalent length in m\",round(EL,3)", + "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos\nlatA =28.0+42.0/60.0; # latitude of A\nlonA =31.0*60.0+12.0; # longitude of A\nlatB =28.0+42.0/60.0; # latitude of B\nlonB =47.0*60.0+24.0; # longitude of B\n\n#calculation\nd=( lonB - lonA )*cos( latA /180* pi);\n\n#result\nprint \" distance between A & B in (km) \",round(d *1.852,3)", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "equivalent length in m 1438.081\n" + "text": " distance between A & B in (km) 1578.989\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.2.2,Page 31" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos\nlatA =12.0+36.0/60.0; # latitude of A\nlonA =115.0*60.0+6.0; # longitude of A\nlatB =12.0+36.0/60.0; # latitude of B\nlonB =-150.0*60.0-24.0; # longitude of B\n\n#calculation\nd=( 360*60+lonB - lonA )*cos( latA /180* pi);\n\n#result\nprint \" distance between A & B in (km) \",round(d *1.852,3) ", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " distance between A & B in (km) 10247.946\n" } ], "prompt_number": 2 }, { "cell_type": "heading", - "level": 2, + "level": 3, "metadata": {}, - "source": "Example 1.2,Page 22" + "source": "Example 1.3,Page 31" }, { "cell_type": "code", "collapsed": false, - "input": "#initialisation of variable\nT=273+18.8;#temperature\np=713;\ne=3;\nc=299792.5e3;#speed of light in km/s\nf=11e6;#frequency in Hz\n\n#calculation\nn=1+(103.49/T*(p-e)+86.26/T*(1+5748.0/T)*e)/1e6;\nV=c/n;\nl=V/f;\n\n#result\nprint \"wavelenght of light in m\",round(l,3)", + "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nlatA =15;\nlatB =12.0+6.0/60.0;\nlonA =50.0+12.0/60.0;\nlonB =54.0;\nRe =6370.0; # radius of earth\n\n#calculation\nb=(90 - latA )*pi /180;\na=(90 - latB )*pi /180;\nP=( lonB - lonA )*pi /180;\np= acos ( cos (P)*sin(a)* sin (b)+ cos (a)*cos(b)); #spherical triangle law\nx= atan ( cos (a/2-b/2)/ cos (a/2+b /2) * tan (pi /2-P /2) );#spherical triangle law \ny= atan ( sin (a/2-b/2)/ sin (a/2+b /2) * tan (pi /2-P /2) ); #spherical triangle law\ndol =pi -x-y;\ndol=dol*180/pi;\na= dol *3600 %60;\nb= ((dol *3600 -a)%3600) /60;\nc=( dol *3600 - b*60 -a) /3600;\n\n#result\nprint \" distance from A to B in (km) \",round(p*Re,3);\nprint \" direction of B from A towards east of south \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "27.247 wavelenght of light in m\n" + "text": " distance from A to B in (km) 522.104\n direction of B from A towards east of south 35.16 seconds 19.0 minutes 52.0 degrees\n" } ], "prompt_number": 4 }, { "cell_type": "heading", - "level": 2, + "level": 3, + "metadata": {}, + "source": "Example 1.4,Page 33" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nlatA =45.0;\na1=45.0+13.108/60;\np =(300.0/60.0) *pi /180; # side AB\nb=(90 - latA )*pi /180; # side PA\n\n# calculation\na= acos ( cos (p)*cos(b)); # side BP\nBC=a *180/ pi - latA ;\nd=BC *1.852*60;\nB=asin(sin(latA*pi/180)/sin(a1*pi/180));\nB=deg_to_dms(B*180/pi);\n\n\n#result\nprint \" distance of BC in (km)\",round(d,3)\nprint \"the angle in deg,min,sec is\",B", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " distance of BC in (km) 24.181\nthe angle in deg,min,sce is [85, 0, 33.27]\n" + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.6.1,Page 37" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =42+15.0/60; # declination of star\ntheta =26+40.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta -90+ delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\n#a= zend *3600 %60;\nb= ((zend *3600 )%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\na= alt *3600 %60;\nb= ((alt *3600 -a)%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " zenith distance 0.0 seconds 35.0 minutes 15.0 degrees\n altitude of star 0.0 seconds 25.0 minutes 74.0 degrees\n" + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.6.2,Page 36" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =23+20.0/60; # declination of star\ntheta =26+40.0/60; # lattude of star\n\n#caculation\nzend =90.0 + theta -90- delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\na= zend *3600 %60;\nb= ((zend *3600 -a)%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\n\nb= ((alt *3600 )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " zenith distance 0.0 seconds 20.0 minutes 3.0 degrees\n altitude of star 0.0 seconds 40.0 minutes 86.0 degrees\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.6.3,Page 37" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =65+40.0/60; # declination of star\ntheta =26+40.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta -90+ delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\na= zend *3600 %60;\nb= ((zend *3600 -a)%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\na= alt *3600 %60;\nb= ((alt *3600 -a)%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " zenith distance 0.0 seconds 0.0 minutes 39.0 degrees\n altitude of star 0.0 seconds 0.0 minutes 51.0 degrees\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.7,Page 37" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =85+20.0/60; # declination of star\ntheta =46+50.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta +90- delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\n\nb= ((zend *3600 )%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\na= alt *3600 %60;\nb= ((alt *3600 -a)%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " zenith distance 0.0 seconds 50.0 minutes 47.0 degrees\n altitude of star 0.0 seconds 10.0 minutes 42.0 degrees\n" + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.8,Page 38" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =56+10.0/60; # declination of star\ntheta =56+10.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta +90- delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\na= zend *3600 %60;\nb= ((zend *3600-a )%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\n#a= alt *3600 %60;\nb= ((alt *3600 )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " zenith distance 0.0 seconds 40.0 minutes 67.0 degrees\n altitude of star 0.0 seconds 20.0 minutes 22.0 degrees\n" + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.9,Page 38" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude and declination \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nimport numpy as np\na=np.array([[1.0,-1.0],[1.0,1.0]])\nb=np.array([59.0/3,332.0/3])\n\n#calculation\nx=np.linalg.solve(a,b);\n\n#result\nprint\"declination of star in (degrees)\",round(x[0],3);\nprint\"latitude of the place of observation (degrees)\",x[1];", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "declination of star in (degrees) 65.167\nlatitude of the place of observation (degrees) 45.5\n" + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.10,Page 39" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding azimuth and altitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ntheta =20+30.0/60;\nH =42+6.0/60; # hour angle\ndelta =50.0;\n\n\n# in triangle ZPM\n\n#calculation\nPZ =(90 - delta )*pi /180;\nH=H*pi /180;\nPM =(90 - theta )*pi /180;\nZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));\nalpha =pi /2- ZM;\nalpha = alpha *180/ pi;\nA =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));\n\nif A <0:\n A=-A;\n A=acos(A)\n A=180-A*180/pi;\n \n\n#for altitude\nalt=alpha;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n\n#for azimuth \na= A *3600 %60;\nb= ((A *3600-a )%3600) /60;\nc=( A *3600 - b*60 -a) /3600;\nprint\" azimuth of star in (degrees ) westwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " altitude of star 36.75 seconds 38.0 minutes 45.0 degrees\n azimuth of star in (degrees ) westwards 25.551 seconds 4.0 minutes 116.0 degrees\n" + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.11,Page 40" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding azimuth and altitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ntheta = -8 -30.0/60;\nH =322.0; # hour angle\ndelta =50;\n\n\n# in triangle ZPM\n\n#calculation\nPZ =(90 - delta )*pi /180;\nH =2* pi -H*pi /180;\nPM =(90 - theta )*pi /180;\nZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));\nalpha =pi /2- ZM;\nalpha=alpha*180/pi;\nA =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));\n\nif A <0:\n A=-A;\n A=acos(A)\n A=180-A*180/pi;\n \n#result\n#for altitude\nalt=alpha;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n\n#for azimuth \na= A *3600 %60;\nb= ((A *3600-a )%3600) /60;\nc=( A *3600 - b*60 -a) /3600;\nprint\" azimuth of star in (degrees ) eastwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " altitude of star 48.256 seconds 48.0 minutes 22.0 degrees\n azimuth of star in (degrees ) eastwards 22.798 seconds 39.0 minutes 138.0 degrees\n" + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.12,Page 42" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nalpha =22+36.0/60; # altitude of star\nA =42.0 # azimuth angle\ndelta =40.0; # latitude of observer\n\n# in triangle ZPM\n\n#calculation\nPZ =(90 - delta )*pi /180;\nA=A*pi /180;\nZM =(90 - alpha )*pi /180;\nPM= acos (( cos (PZ)* cos (ZM)+sin(ZM)*sin(PZ)* cos (A)));\ntheta =pi /2- PM\ntheta=theta*180/pi;\nH =(( cos(ZM)-cos (PZ)* cos (PM))/ sin (PZ)/sin(PM));\nif H <0:\n H=-H;\n H=acos(H)\n H=180-H*180/pi;\n \n\n#result\n#for declination \nalt=theta;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" declination of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for hour angle\na= H *3600 %60;\nb= ((H *3600-a )%3600) /60;\nc=( H *3600 - b*60 -a) /3600;\nprint\" hour angle of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " declination of star 12.44 seconds 35.0 minutes 50.0 degrees\n hour angle of star 5.342 seconds 21.0 minutes 103.0 degrees\n" + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.13,Page 42" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nalpha =21+30.0/60; # a l t i t u d e o f s t a r\nA =140.0 # azimuth a n g l e\ndelta =48.0; # l a t i t u d e o f o b s e r v e r\n\n#calculation\nPZ =(90 - delta )*pi /180;\nA=A*pi /180;\nZM =(90 - alpha )*pi /180;\nPM =( cos(PZ)*cos(ZM)+ sin (ZM)* sin (PZ)* cos (A));\n\nif PM <0:\n PM=-PM\n PM=acos(PM)\n PM=180-PM*180/pi;\n\nH= acos (( cos (ZM)-cos(PZ)*cos(PM*pi /180) )/ sin (PZ)/sin (PM*pi /180) );\nH =2* pi -H;\nH=H*180/pi;\n\n#result\n#for declination \nalt=PM-90;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" declination of star southwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for hour angle\na= H *3600 %60;\nb= ((H *3600-a )%3600) /60;\nc=( H *3600 - b*60 -a) /3600;\nprint\" hour angle of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " declination of star southwards 12.098 seconds 48.0 minutes 11.0 degrees\n hour angle of star 22.619 seconds 20.0 minutes 322.0 degrees\n" + } + ], + "prompt_number": 44 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.14,Page 43" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\n# part 1\ndelta =22+12.0/60;\ntheta =42+30.0/60;\n\n#calculation\nZP =(90 - theta )*pi /180;\nPM =(90 - delta )*pi /180;\nA= acos ( cos (PM)/sin(ZP));\nH=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\nA=deg_to_dms(A*180/ pi);\nH=deg_to_dms(H/15);\n\n#result\nprint \" azimuth of setting sun in ( degrees,min,second) \",A\nprint \" suns hour angle in ( hr,min,second ) : \",H\n\n#part 2\ndelta = -22 -12/60;\ntheta =42+30.0/60;\n\n#calculation\nZP =(90 - theta )*pi /180;\nPM =(90 - delta )*pi /180;\nA= acos ( cos (PM)/sin(ZP));\nH=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\nA=deg_to_dms(A*180/ pi);\nH=deg_to_dms(H/15);\n\n#result\nprint \" azimuth of setting sun in ( degrees,min,second) \",A\nprint \" suns hour angle in ( hr,min,second ) : \",H", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " azimuth of setting sun in ( degrees,min,second) [59, 10, 14.72]\n suns hour angle in ( hr,min,second ) : [7, 27, 50.23]\n azimuth of setting sun in ( degrees,min,second) [120, 32, 13.17]\n suns hour angle in ( hr,min,second ) : [4, 33, 4.97]\n" + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.15,Page 44" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =22+12.0/60;\ntheta =42+30.0/60;\nef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\n\n#calculation\nZP =(90 - theta )*pi /180;\nPM =(90 - delta )*pi /180;\nA= acos ( cos (PM)/sin(ZP));\nH=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\nA=deg_to_dms(180-A*180/ pi);\nH=deg_to_dms(H/15);\n\n#result\nprint \" azimuth of setting sun in ( degrees,min,second) \",A\nprint \" suns hour angle in ( hr,min,second ) : \",H\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " azimuth of setting sun in ( degrees,min,second) [120, 49, 45.28]\n suns hour angle in ( hr,min,second ) : [7, 27, 50.23]\n" + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.16,Page 61" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding error in time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ntime = -3 -28.41/60; # greenwich time at july 1 1951\nchange = -11.82/60;\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\n\n#calculation\nc12 = change/24*12 # change of time in 12 hours\ntch =time +c12;\ntch=deg_to_dms(tch/60);\n\n#result\nprint \" greenwich mean time error in 12 th hour(-ve) in( deg,min,sec) \",tch\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " greenwich mean time error in 12 th hour(-ve) in( deg,min,sec) [0, 3, 34.32]\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.17,Page 61" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding GAT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n return [d, m, sd]\n#printing result in degree minute and seconds respectively \nGMN = -14*60 -10;\nchangeET =1*1.5;\n\n#calculation\nneterr =GMN+ changeET ;\nGAT = time + neterr ;\nGAT=GAT+10*3600+30*60;\nhr= round ( GAT /3600) ;\nb=GAT -hr *3600;\nmi= round (b /60 -1);\nc=GAT -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of GAT\"", + "language": "python", "metadata": {}, - "source": "Example 1.3,Page 23" + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "10.0 hour 15.0 minutes 48.0265 seconds of GAT\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.18,Page 62" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding time\n\n#part1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n return [d, m, sd]\nA =50+12.0/60+48.0/3600;\ntime =A /15*3600\n\n#calculation\nhr= round ( time /3600) ;\nb=time -hr *3600;\nmi= round (b /60 -1);\nc=time -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"\n\n#part 2\n#initialisation of variable\nA =8+18.0/60+6.0/3600;\ntime =A /15*3600\n\n#calculation\nhr= round ( time /3600-1) ;\nb=time -hr *3600;\nmi= round (b /60 );\nc=time -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"\n\n#part 3\n#initialisation of variable\nA =258+36.0/60+30.0/3600;\ntime =A /15*3600\n\n#calculation\nhr= round ( time /3600) ;\nb=time -hr *3600;\nmi= round (b /60 );\nc=time -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "3.0 hour 20.0 minutes 51.2 seconds of angles\n-0.0 hour 33.0 minutes 12.4 seconds of angles\n17.0 hour 14.0 minutes 26.0 seconds of angles\n" + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.19,Page 62" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding angle\n\n#part1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nA =4+34.0/60+13.0/3600;\n\n#calculation\nangle =A *15;\nangle=deg_to_dms(angle);\n\n#result\nprint \"angle in degree,minute,second respectively\",angle\n\n#part 2\n#initialisation of variable\nA =18+11.0/60+38.0/3600;\n\n#calculation\nangle =A *15;\nangle=deg_to_dms(angle);\n\n#result\nprint \"angle in degree,minute,second respectively\",angle\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "angle in degree,minute,second respectively [68, 33, 15.0]\nangle in degree,minute,second respectively [272, 54, 30.0]\n" + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.20.a,Page 64" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding local mean time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =20 # longitude of the place\nlongSM =82+30.0/60; # longitude of standard meridion\n\n#calculation\ndolong =longSM - longP ; # difference in longitude\ndot = dolong /15.0; # difference in time\nLMT =20+24.0/60+6.0/3600 - dot ;\nLMT=deg_to_dms(LMT)\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[16, 14, 6.0] Local mean time in hours,minute,second respectively\n" + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.20.b,Page 64" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding local mean time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =-20 # longitude of the place\nlongSM =82+30.0/60; # longitude of standard meridion\n\n#calculation\ndolong =longSM - longP ; # difference in longitude\ndot = dolong /15.0; # difference in time\nLMT =20+24.0/60+6.0/3600 - dot ;\nLMT=deg_to_dms(LMT)\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[13, 34, 6.0] Local mean time in hours,minute,second respectively\n" + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.21.a,Page 64" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding GMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =9+40.0/60+12.0/3600;\nlongP = -42 -36.0/60;\n\n#calculation\ndot = longP /15;\nGMT =LMT -dot;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hours,minute,second respectively\",GMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[12, 30, 36.0] GMT in hours,minute,second respectively\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.21.b,Page 64" }, { "cell_type": "code", "collapsed": false, - "input": "#initialisation of variable\nT=273.0+30.0;#temperature\nl=0.85;#wavelength in m\np=752.4;\nc=299792.5e3;#speed of light in km/s\nf=24e6;#frequency in Hz\n\n#calculation\nno=1+(287.604+4.8864/l**2+0.068/l**4)/1e6;\nns=1+(no-1)*273/T*p/760;\nV=c/ns;\nl=V/f;\n\n#result\nprint \"wavelength of light in m\",round(l,3)", + "input": "#finding GMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =4+32.0/60+10.0/3600;\nlongP = -56 -32.0/60;\n\n#calculation\ndot = longP /15;\nGMT =LMT +dot;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hours,minute,second respectively\",GMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "wavelenght of light in m 12.488\n" + "text": "[0, 46, 2.0] GMT in hours,minute,second respectively\n" + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.22,Page 65" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\n#part1\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGCT =18+40.0/60+12.0/3600; # greenwich civil time\nlongP =72+30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15.0;\nLMT = GCT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\n\n#part 2\n#initiallisation of variable\nGCT =18+40.0/60+12.0/3600; # greenwich civil time\nlongP =-72-30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15.0;\nLMT = GCT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\n\n#part 3\n#initialisation of variable\ndef deg_to_dms(deg):\n d = int(deg);\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d-24, m, sd]\nGCT =18+40.0/60+12.0/3600; # greenwich civil time\nlongP =110+32.0/60; # longitude of the place\n\n#calculation\ndot = longP /15.0;\nLMT = GCT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT of next day in hours,minute,second respectively\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hours,minute,second respectively [23, 30, 12.0]\nLMT in hours,minute,second respectively [13, 50, 12.0]\nLMT of next day in hours,minute,second respectively [2, 2, 20.0]\n" } ], "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.23,Page 66" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =10+20.0/60+30.0/3600; # local mean time\nlongP =102+30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15;\nGMT =LMT -dot;\nmGMN =12 - GMT ; #mean time interval\ni= mGMN *0.32/3600; # increase in mGMN\nETGMN =5.0/60+4.35/3600;\nch=i+ ETGMN ; # change in GMT\nGMT =ch+GMT;\nLMT = GMT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[10, 25, 37.07] LMT in hours,minute,second respectively\n" + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.24,Page 67" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =15+12.0/60+40.0/3600; # local mean time\nlongP = -20 -30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15;\nGMT =LMT -dot;\nmGMN =12 - GMT ; #mean time interval\ni= mGMN *0.32/3600; # increase in mGMN\nETGMN =5.0/60+4.35/3600;\nch=i+ ETGMN ; # change in GMT\nGMT =ch+GMT;\nLMT = GMT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[15, 17, 42.89] LMT in hours,minute,second respectively\n" + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.25,Page 70" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding sidereal time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ntime =4+20.0/60+30.0/3600;\n\n#calculation\naccn = time *9.8565/3600; # acceleration\nstime = time + accn ; # sidereal time\nstime=deg_to_dms(stime);\n\n#result\nprint \"sidereal time in hours,minute,second respectively\",stime", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[4, 21, 12.79] sidereal time in hours,minute,second respectively\n" + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.26,Page 71" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding mean time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nstime =8+40.0/60+50.0/3600;\n\n#calcculation\naccn =-time *9.8565/3600; # acceleration\nmtime = stime + accn ; # mean time\nmtime=deg_to_dms(mtime);\n\n#result\nprint \"mean time in hours,minute,second respectively\",mtime", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[8, 40, 7.21] mean time in hours,minute,second respectively\n" + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 1.27,Page 72" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LST on LMM\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP = -160 -30.0/60 -30.0/3600; # longitude of the place\nGST =16+30.0/60+12.0/3600; # standard time\n\n#calculation\ndot = longP /15; # difference in time\ni= dot *9.8565/3600; # error\nLST =GST -i;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of LMM in hours,minute,second respectively\",LST\n\n#part 2\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP = 160 +30.0/60 +30.0/3600; # longitude of the place\nGST =16+30.0/60+12.0/3600; # standard time\n\n#calculation\ndot = longP /15; # difference in time\ni= dot *9.8565/3600; # error\nLST =GST -i;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of LMM in hours,minute,second respectively\",LST\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[16, 31, 57.47] LST of LMM in hours,minute,second respectively\n[16, 28, 26.53] LST of LMM in hours,minute,second respectively\n" + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.28,Page 73" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LST \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =85+20.0/60; # longitude of the place\nGST =6+30.0/60; # standard time\nGMN =6+32.0/60+12.0/3600;\n\n#calculation\ndot = longP /15; # difference in time\ni= dot *9.8565/3600; # error\nLST =GMN -i; #LST at L .M.N\ni2=GST *9.8565/3600; # error in GST\nLST2 =GST+i2;\nLST = LST + LST2 # lst at L .M.N\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hours,minute,second respectively\",LST", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[13, 2, 19.99] LST in hours,minute,second respectively\n" + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.29,Page 75" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =112+20.0/60+15.0/3600; # longitude of the place\nGST =8+10.0/60+28.0/3600; #GST at GMM\nlst =18+28.0/60+12.0/3600; \n\n#calculation\ndot = longP /15; \ni= dot *9.8565/3600; # error\nLST = GST +i; #LST at L .M.N\nLMM =lst -LST;\ni2=LMM *9.8565/3600; # error in LMM\nLMT =LMM -i2; # local mean time\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[10, 14, 48.91] LMT in hours,minute,second respectively\n" + } + ], + "prompt_number": 40 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.30,Page 76" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LST\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =85+20.0/60; # longitude of the place\nGST =18+30.0/60; # standard time\ngst =6+32.0/60+12.0/3600; #GST at GMN\n\n#calculation\ndot = longP /15; \nGMT =GST -dot -12;\ni= GMT *9.8565/3600; # error\nGMT = GMT +i; # SI time\nLST = GMT +dot+ gst ; #LST at LMT\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hours,minute,second respectively\",LST", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[13, 2, 19.99] LST in hours,minute,second respectively\n" + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.31,Page 78" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =112+20.0/60+15.0/3600; # longitude of the place\nGST =8+10.0/60+28.0/3600; #GST at GMM\nlst =18+28.0/60+12.0/3600; # local sidereal time\n\n#clculation\ndot = longP /15; \ngmm = lst +dot - GST ; # SI at GMM\ni= gmm *9.8565/3600; # error\ngmm =gmm -i; #LST at L .M.N\nLMT =gmm -dot; # local mean time\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[10, 14, 48.7] LMT in hours,minute,second respectively\n" + } + ], + "prompt_number": 44 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.32,Page 79" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =162+30.0/60+15.0/3600; # longitude of the place\nGST =10+30.0/60+15.0/3600; #GST at GMM\nRA =22+11.0/60+30.0/3600; # local sidereal time\n\n#calculation\ndot = longP /15; \ni= dot *9.8565/3600; # e r r o r\ngmm = GST +i; #LST at L .M.N\nlmn =RA -gmm; # SI o f LMN\ni2=lmn *9.8565/3600; # error 2\nLMT =lmn -i2;\nLMT1=deg_to_dms(LMT);\n\n#result\nprint \"LMT observed at upper transit in hours,minute,second respectively\",LMT1\n\n#part 2\n#initialisation of variable\ni3 =12*9.8565/3600; # retardation\n\n#calculation\nLMT = LMT +12 - i3;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT observed at lower transit in hours,minute,second respectively\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT observed at upper transit in hours,minute,second respectively [11, 37, 33.31]\nLMT observed at lower transit in hours,minute,second respectively [23, 35, 35.04]\n" + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.33,Page 80" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =60+30.0/60; # longitude of the place\nGST =7+30.0/60+48.6/3600; #GST at GMM\nRA =17+28.0/60 +40.0/1600;\n\n#calculation\ndot = longP /15; \ni= dot *9.8565/3600; # error\ngmm =GST -i; #LST at L .M.N\nLMT =RA -gmm; # local mean time\ni2=LMT*9.8296/3600;\nGMT=LMT-i2-longP/15;\nLMT=deg_to_dms(LMT);\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\nprint \"GMT in hours,minute,second respectively\",GMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hours,minute,second respectively [9, 59, 21.15]\nGMT in hours,minute,second respectively [5, 55, 42.96]\n" + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.34,Page 82" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding correct time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT=13+21.0/60+54.0/3600; #GMT of the place\nLongA=40+30.0/60; #longitude of A\nLongB=-40-30.0/60; #longitude of B\n\n#calculation\ndelA=LongA/15.0*9.8296/3600;#error\ndelB=LongB/15.0*9.8296/3600;#error\nGA=GMT+delA;\nGA=deg_to_dms(GA);\nGB=GMT+delB;\nGB=deg_to_dms(GB);\n\n#result\nprint \"corected time of A in hours,minute,second respectively\",GA\nprint \"corected time of B in hours,minute,second respectively\",GB", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "corected time of A in hours,minute,second respectively [13, 22, 20.54]\ncorected time of B in hours,minute,second respectively [13, 21, 27.46]\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.35,Page 83" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT=7+12.0/60+28.0/3600; #GMT of the place\nLong=50+30.0/60; #longitude \nLMT=11+30.0/60+12.0/3600; \n\n#calculation\ndelA=LongA/15.0*9.8296/3600;#error\ndelB=LMT*9.8296/3600;#error\nLA=GMT+delA; #LMT at transit\nLMT=LMT-delB;\nLMT=LMT+LA;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hours,minute,second respectively [18, 41, 13.47]\n" + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.36,Page 84" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGST=8+25.0/60+25.0/3600;\n\n#calculation\nGMT=24-GST;\ni=GMT*9.8296/3600;\nGMT=GMT-i;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hours,minute,second respectively\",GMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "GMT in hours,minute,second respectively [15, 32, 1.89]\n" + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.37,Page 85" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT on July 2\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT=12+03.0/60+46.09/3600; #GMT of the place\nLongA=-130.0; #longitude of A\nLongB=49.0; #longitude of B\n\n#calculation\ndelA=LongA/15.0*11.71/24/3600;\ndelB=LongB/15.0*11.71/24/3600;\nLMTA=GMT+delA;\nLMTA=deg_to_dms(LMTA);\nLMTB=GMT+delB;\nLMTB=deg_to_dms(LMTB);\n\n#result\nprint \"LMT at A on July 2 in hours,minute,second respectively\",LMTA\nprint \"LMT at B on July 2 in hours,minute,second respectively\",LMTB", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[12, 3, 41.86] LMT at A in hours,minute,second respectively\n[12, 3, 47.68] LMT at B in hours,minute,second respectively\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.38,Page 86" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LST\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLat=50+30.0/60; # latitude of place\nDec=74+22/60; #declination of place\nRA=14+50.0/60+52.0/3600;\n\n#calculation\nH=acos(tan(Lat*pi/180)/tan(Dec*pi/180));\nH=H*180/pi;\nH=H/15.0;\nLST=H+RA;\nLST=deg_to_dms(LST);\n\n#result \nprint \"LST in hours,minute,second respectively\",LST", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[19, 29, 26.59] LST in hours,minute,second respectively\n" + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.39,Page 87" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding HA\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong=120+30.0/60; #langitude\nGST=14+30.0/60+28.25/3600;\nGMT=2+5.0/60;\nLMN=12.0;\nLST=14+31.0/60+47.43/3600;\nRA=23+20.0/60+20.0/3600;\n\n#calculation\ne1=Long*15.0*9.8565/3600;\nGST=GST+e1;\nLMT=GMT+24-8-2.0/60;\nLMM=LMN+24-LMT; #mean LMN\ne2=LMM*9.8565/3600;\nLMM=LMM+e2;\nLST=LST+24-LMM;\nHA=LST-RA+24;\nHA=deg_to_dms(HA);\n\n#result\nprint \"HA in hours,minutes,seconds respectively\",HA", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[21, 11, 30.51] HA in hours,minutes,seconds respectively\n" + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.40,Page 86" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding HA\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong=75+28.0/60; #langitude\nLMT=5+30.0/60;\nGST=20+15.0/60+32.58/3600;\n\n#calculation\ne1=Long/15.0*9.8565/3600;\nGST=GST+e1;\ne2=LMT*9.8565/3600;\nLMT=LMT+e2;\nHA=GST+LMT;\nHAMS=HA-LMT-12+e2;\nHA=deg_to_dms(HA);\nHAMS=deg_to_dms(HAMS);\n\n#result\nprint \"HA in hours,minutes,seconds respectively\",HA\nprint \"HAMS in hours,minutes,seconds respectively\",HAMS\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "HA in hours,minutes,seconds respectively [25, 47, 16.38]\nHAMS in hours,minutes,seconds respectively [8, 17, 16.38]\n" + } + ], + "prompt_number": 40 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.41,Page 90" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding sun's declination\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong=45.0; #langitude\ndel1=1067.2/3600;\ndel2=1083.9/3600;\ndel3=1100.3/3600;\nf0=-16-14.0/60-24.0/3600;\n\n#calculation\nn=(10-Long/15)/24.0;\nDel0=del2-del1;\nDel1=del3-del2;\nfn=-f0+n*del2+n*(n-1)/4*(Del0+Del1)\nfn=deg_to_dms(fn);\n\n#result\nprint \"sun's declination in hours,minutes,seconds respectively\",fn", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "sun's declination in hours,minutes,seconds respectively [16, 19, 38.43]\n" + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.42,Page 101" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding azimuth of A & B and vertical difference\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\naziA =32+41.0/60+30.0/3600; # azimuth o f A\naziB =110+28.0/60+42.0/3600; # azimuth o f B\nvaA =10+21.0/60+12.0/3600; # vertical angle of A\nvaB = -2 -18.0/60 -30.0/3600; # vertical angle o f B\nlA1 =11;\nlB1 =11.5;\nrA1 =7.5;\nrB1 =7;\nlB2 =10;\nlA2 =10.5;\nrB2 =7.5;\nrA2 =8;\nd =20;\n# partA\n#calculation\nsigl =lA1+ lA2 ;\nsigr =rA1+ rA2 ;\nb= sigl /4*d- sigr /4*d;\ni= tan( vaA );\ncaziA = aziA +i *29.95/3600;\ncaziA1=deg_to_dms(caziA);\n\n#result\nprint \"corrected azimuth of A in (degrees,minutes,seconds)\",caziA1\n\n#part2 \n#calculation\ni= tan( vaB );\ncaziB = aziB +i*b /3600;\nha=caziB - caziA;\ncaziB=deg_to_dms(caziB);\nha=deg_to_dms(ha);\n\n#result\nprint \"corrected azimuth of B in (degrees,minutes,seconds)\",caziB\nprint \"horizontal difference of angle between A & B in (degrees,minutes,seconds)\",ha\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "corrected azimuth of A in (degrees,minutes,seconds) [32, 42, 10.04]\ncorrected azimuth of B in (degrees,minutes,seconds) [110, 29, 15.02]\nhorizontal difference of angle between A & B in (degrees,minutes,seconds) [77, 47, 4.98]\n" + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.43,Page 102" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding altitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nv1 =18+36.0/60+48.0/3600; # vertical angle 1\nv2 =18+35.0/60+56.0/3600; # vertical angle 2\nslm =28+36.0/60+20.0/3600; # altitude of sun measured\nds =15.0/60+59.35/3600; # dia of sun\n\n#calculation\nmv =( v1+v2) /2; #mean vertical angle\ni=v1 -v2; # error\nsl=slm+i; #new altitude of sun\nsl=sl+ds;\nir = -57.0/3600/( tan( slm *pi /180+26* pi /180/3600) );#error due to refraction\nsl=sl+ir;\nip =8.8/3600* cos( slm *pi /180+26* pi /180/3600);# error due to parallex\nsl=sl+ip;\nsl=deg_to_dms(sl);\n\n#result\nprint \"corrected altitude in (deg,min,sec) respectively\",sl", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[28, 51, 34.59] corrected altitude in (deg,min,sec) respectively\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.44,Page 115" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlong =4+30.0/60;\ni= long *9.8565/3600; # longitude\ngst =14+38.0/60+12.0/3600; #GST on GMM\nlst =gst -i; #LST on LMM\nRA =7+36.0/60+21.24/3600;\n\n#calculation\nLST =RA;\nSI=LST - lst +24;\nLCT =17+56.0/60+8.86/3600 -1; # local chronometer time\ni2=SI *9.8296/3600;\nLMM =SI -i2;\nce=LCT - LMM ;\n\n#result\nprint \" chronometer error in (s)\",round(ce *3600,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "2.19 chronometer error in (s)\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Exampe 1.45,Page 116" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nc =90 -36 -30.0/60 -30.0/3600; # co latitude\np =90 -16 -12.0/60 -18.4/3600; # co declination\nz =90 -30 -12.0/60 -30.0/3600; # co altitude\ns=(p+z+c) /2;\n\n#calculation\ns1=s-c;\ns2=s-p;\ns3=s-z;\nH =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin (s*pi/180) / sin (s3*pi /180) ));\nH=H *180/ pi;\nH=24 -H /15;\nLST =H +5+18.0/60+12.45/3600 -24;\nce =1+2.0/60+5.25/3600 - LST ;\n\n#result\nprint \" chronometer error in (s)\",round (ce *3600+2,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "19.34 chronometer error in (s)\n" + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 1.46,Page 118" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nc =90 -36 -40.0/60 -30.0/3600; # co latitude\np =90 -17 -26.0/60 -42.1/3600; # co declination\nz =90 -36 -14.0/60 -16.8/3600; # co altitude\n\n#calculation\ns=(p+z+c) /2;\ns1=s-c;\ns2=s-p;\ns3=s-z;\nH =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin(s*pi/180) / sin (s3*pi /180) ));\nH=H *180/ pi;\nH=H /15;\ni =12 -11 -56.0/60 -22.8/3600; # error in time\nLAT =15+49.0/60+40.6/3600; # local actual time\nGAT =LAT -H;\nGMT =GAT -i;\nLMT = GMT +H;\nce =15+49.0/60+12.6/3600 - LMT;\nce=deg_to_dms(ce)\n\n#result\nprint \" chronometer error in (s)\",ce", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " chronometer error in (s) [0, 3, 9.2]\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.47,Page 119" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nRA =17+12.0/60+48.0/3600;\ngst =9+26.0/60+12.0/3600; #GST on GMN\nlong =138.0/15+45.0/15/60; # l o n g i t u d e\nlst =- long *9.85645/3600+9+26.0/60+12.0/3600; #LST on LMN\nLST =17+12.0/60+48.0/3600; # local sidereal time\n\n#calculation\nSI=LST - lst ;\nMI=-SI *9.8296/3600+ SI;\nLCT =7+47.0/60+2.0/3600; # local chronometer time\nce=LCT -MI;\n\n#result\nprint \" chronometer error in (s)\",round(ce *3600,2) ", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " chronometer error in (s) 11.52\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.48,Page 145" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding azimuth,latitude,LMT\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ntheta =54+30.0/60; # l o g i t u d e\ndelta =62+12.0/60+21.0/3600; # d e c l i n a t i o n\n\n#calculation\nlat = asin (sin( theta *pi /180) /sin( delta *pi /180) );\nlat = lat *180/ pi;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;\n\n#part 2\n#initialisation of variable\nA =53+25.0/60; # azimuth of star\nh =65+18.0/60+42.0/3600; # horizontal angle\n\n#calculation\nA=A+h;\nA=360-A;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\n\n#part 3 \n#initialisation of variable\nlst =4+39.0/60+6.5/3600; #LST o f LMN\nLST =10+58.0/60+38.0/3600+2+49.0/60+25.3/3600; #LST of observation\n\n#calculation\nLMN =LST -lst;\ni= LMN *9.8565/3600; # e r r o r\nLMT =LMN -i;\nLMT=deg_to_dms(LMT)\n\n#results\nprint \"LMT in (hr,min,sec)\",LMT;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[66, 58, 7.13] Latitude in (deg,min,sec)\n[241, 16, 18.0] Azimuth in (deg,min,sec)\n[9, 7, 26.62] LMT in (hr,min,sec)\n" + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.49,Page 148" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding azimuth,latitude,LMT\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ntheta =53+32.0/60; # logitude\ndelta =56+42.0/60+53.2/3600; # declination\nlat = asin (sin ( theta *pi /180) /sin( delta *pi /180) );\nlat = lat *180/ pi;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;\n\n#part 2\n#initialisation of variable\nAs= asin ( cos ( delta *pi /180) /cos ( theta *pi /180) ); #azimuth of star\nh =75+18.0/60+20.0/3600; # angle between line and star\n\n#calculation\nA=h-As *180/ pi;\nA=360 -A;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\n\n#part 3\n#initialisation of variable\nLST =10+58.0/60+3.9/3600+22+10.0/60+38.5/3600 -24; #LST of observation\nlong =5+40.0/60+18.0/3600; # longitude\n\n#calculation\ni= long *9.8565/3600; # error\nlst =4+58.0/60+23.84/3600+ i; #LST on LMN\nLMM =LST -lst;\ni2=LMM *9.8565/3600; # error in LMM\nLMT =LMM -i2;\nLMT=deg_to_dms(LMT)\n\n#results\nprint \"LMT in (hr,min,sec)\",LMT;\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Latitude in (deg,min,sec) [74, 9, 33.08]\nAzimuth in (deg,min,sec) [352, 7, 3.66]\nLMT in (hr,min,sec) [4, 8, 41.69]\n" + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.50,Page 151" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong =(15.0+30.0/60); \nGMT =19+12.0/60+28.6/3600;\nGST=10+12.0/60+36.2/3600;\nRA=10 +12.0/60 +6.3/3600;\ntheta=35.0;\ndelta=20+6.0/60+48.4/3600;\n\n#calculation\ni= Long/15.0 *9.8656/3600; \nLSTofLMM=GST-i;\nLMT = GMT + Long/15.0 ;\ni2=LMT *9.8656/3600; # error in LMT\nSI = LMT +i2;\nLST =LSTofLMM+ SI ;\nH=LST-RA ; # hour angle\nH=H *15;\nH=360 -H;\nB=atan(tan(delta*pi/180)/cos(H*pi/180));\nB=B*180/pi;\nx=B-theta; #defined as 'B-theta'\nAs= atan ( tan ((H) *pi /180) * cos((B) *pi /180) / sin ((x)*pi /180) );#calculating azimuth \nh =36+28.0/60+18.0/3600; # angle between line and star\nA =180+ As *180/ pi -h; #azimuth\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\nprint \"there is a miscalculation in the step of calculating As thus resulted in change in answer\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Azimuth in (deg,min,sec) [55, 16, 8.27]\nthere is a miscalculation in the step of calculating As thus resulted in change in answer\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.51,Page 153 " + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =33+35.0/60+10.0/3600; # altitude\nZM =90 - alpha ;\ndelta =22+5.0/60+35.0/3600; # declination\nPM =90 - delta ;\ntheta =52+30.0/60+20.0/3600; # latitude\nZP =90 - theta ;\n\n#calculation\nAs= acos (( cos (PM*pi /180) -cos(ZP*pi /180) * cos (ZM*pi/180) )/( sin (ZP*pi /180) *sin(ZM*pi /180) ));\nh =18+20.0/60+30.0/3600; # angle between line and star\nA=As *180/ pi+h;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Azimuth in (deg,min,sec) [115, 27, 19.68]\n" + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.52,Page 154" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding declination,altitude\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGAT =5+17.0/60+6.0/60; #GAT \ndelta =17+46.0/60+52.0/3600; # declination\n\n#calculation\ni =37.0/3600* GAT ;\ndelta =delta -i;\ndelta1=deg_to_dms(delta);\n\n#result\nprint \"Declination in (deg,min,sec)\",delta1;\n\n#part 2\n#initialisation of variable\np=90 - delta ; # co declination\naltitude =23+15.0/60+20.0/3600; # altitude of sun\ni2 =2.0/60+12.0/3600; # error due to refraction\ni3 =8.0/3600; # error due to parallax\n\n#calculation\naltitude = altitude -i2+i3;\nc =90 -55 -46.0/60 -12.0/3600; # colatitude\nz=90 - altitude ; # co altitude\ns=(p+z+c) /2;\ns1=s-c;\ns2=s-p;\ns3=s-z;\nA =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));\nA=A *180/ pi;\nA=deg_to_dms(A);\n\n#result\nprint \"Altitude in (deg,min,sec)\",A;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Declination in (deg,min,sec) [17, 43, 32.82]\nAltitude in (deg,min,sec) [92, 23, 10.67]\n" + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.53,Page 156" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT =17+5.0/60+2.0/3600; \ni =9.8565/3600* GMT;\nGST =3+12.0/60+12.0/3600;\nwl =1+18.0/60; # west longitude\nRA =16+23.0/60+30.0/3600;\n\n#calculation\nH= GMT +i+ GST +wl -RA; # hour angle\nH=H *15;\np =90 -29 -52.0/60;\nc =90 -52 -8.0/60;\nz= acos ( cos (H*pi /180) * sin (p*pi /180) *sin(c*pi /180) + cos(p*pi /180) * cos (c*pi /180) );\nA= asin ( sin (p*pi /180) * sin (H*pi /180) /sin(z));\nA=A *180/ pi\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Azimuth in (deg,min,sec) [78, 38, 33.24]\n" + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.54,Page 157" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nc2 =24+30.0/60+20.0/3600;\nd2 =24+30.0/60+40.0/3600;\nc3 =25;\nd3 =25+1.0/60;\n\n#calculation\nalt =( c2+c3+d3+d2)/4;#mean observed altitude\nil =(10.6 -9.4) /4*15.0/3600; # error \nalt = alt +il;\nir = -57.0/3600/ tan (( alt *pi /180) ); # correction of refraction\nip =8.0/3600* cos (alt*pi /180) ; # correction of parallax\nalt =alt -ir+ip;#altitude corrected\nz=90 - alt;#ZM\ndelta =1+32.0/60+16.8/3600 -56.2/3600*(3.0/60+1.86/3600) ;#declination of sun\np=90 - delta ;#PM\nc =90 -36 -48.0/60 -30.0/3600;#ZP\ns=(p+z+c) /2;\ns1=s-c;\ns2=s-p;\ns3=s-z;\nA =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));#azimuth calculation\nA=A *180/ pi;\nA=A +81+59.0/60+10.0/3600;\nA=360 -A;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\nprint \"there is a miscalculation in the step of calculating Azimuth and error due to refrection thus resulted in change in answer\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Azimuth in (deg,min,sec) [170, 1, 36.93]\nthere is a miscalculation in the step of calculating Azimuth and error due to refrection thus resulted in change in answer\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.55,Page 178" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =65+40.0/60+18.0/3600; # altitude\ndelta =53+12.0/60+10.0/3600; # declination\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; \nalpha =alpha -i;\nz=90 - alpha ; # zenith distance\nlat =delta -z;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[28, 52, 2.23] Latitude in (deg,min,sec)\n" + } + ], + "prompt_number": 58 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.56,Page 178" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =64+36.0/60+20.0/3600; # altitude\ndelta =26+12.0/60+10.0/3600; # declination\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; # error\nalpha =alpha -i;\nz=90 - alpha ; # zenith distance\nlat = delta +z;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Latitude in (deg,min,sec) [51, 36, 17.06]\n" + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.57,Page 178" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =44+12.0/60+30.0/3600; # altitude\nlongP =75+20.0/60+15.0/3600; # longitude of place\ndelta =22+18.0/60+12.8/3600; # declination of sun\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; # error\ni2 =8.78/3600* cos( alpha ); #error due to parallax\ni3 =15.0/60+45.86/3600; #error due to semi diameter\nalpha =alpha -i+i2+i3;\nz=90 - alpha ; # zenith distance\ndelT = longP /15;\ni4 =6.82/3600* delT ; # error in time\ndelta =i4+ delta ;\nlat = delta +z;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[67, 51, 21.23] Latitude in (deg,min,sec)\n" + } + ], + "prompt_number": 62 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.58,Page 180" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding alpha1,alpha2\n\n#for alpha 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ntheta =80;\ndelta =46+45.0/60+30.0/3600;\n\n#calculation\nalpha1 =90 - theta + delta ;\nalpha1=deg_to_dms(alpha1);\n\n#result\nprint \"alpha1 to the north in (deg,min,sec)\",alpha1\n\n#for alpha2\n#calculation\nalpha2 = theta +delta -90;\nalpha2=deg_to_dms(alpha2)\n\n#result\nprint \"alpha2 to the south(deg,min,sec)\",alpha2", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[56, 45, 30.0] alpha1 to the north in (deg,min,sec)\n[36, 45, 30.0] lpha1 to the south(deg,min,sec)\n" + } + ], + "prompt_number": 69 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.59,Page 181" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ndelta1 =20+25.0/60+48.0/3600; # declination of star 1\ndelta2 =79+30.0/60+52.0/3600; # declination of star 2\nalpha1 =48+18.0/60+12.0/3600; #altitude of star 1\nalpha2 =47+54.0/60+6.0/3600; #altitude of star 2\n\n#calculation\nr1 =58.0/3600/ tan( alpha1 *pi /180) # error 1\nr2 =58.0/3600/ tan( alpha2 *pi /180) # error 2\nlat =90 -( alpha1 - alpha2 ) /2+( delta1 - delta2 ) /2+( r1 -r2)/2;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;\nprint \" there is a miscalculation in the step of calculating (delta1-delta2)/2 so there is a difference in the answer\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Latitude in (deg,min,sec) [60, 15, 24.63]\n there is a miscalculation in the step of calculating (delta1-delta2)/2 so there is a difference in the answer\n" + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.60,Page 182" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude,declination\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalphal =18+36.0/60+40.0/3600; #altitude at lower culmination\nalphau =59+48.0/60+20.0/3600; #altitude at upper culmination\nlat =( alphal + alphau )/2;\nlat1=deg_to_dms(lat);\ndelta =90+ lat - alphau ;\ndelta1=deg_to_dms(delta);\n\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat1;\nprint \"Declination of star in (deg,min,sec)\",delta1", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[39, 12, 30.0] Latitude of star in (deg,min,sec)\n[69, 24, 10.0] Declination of star in (deg,min,sec)\n" + } + ], + "prompt_number": 74 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.61,Page 183" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =40+36.0/60+30.0/3600; # altitude of star\ndelta =10+36.0/60+40.0/3600; # declination of star\nH =46+36.0/60+20.0/3600; # hour angle of star\n\n#calculation\nn= atan ( tan ( delta *pi /180) /cos(H*pi /180) );\nlat =n+ acos ( sin ( alpha *pi /180) *sin(n)/ sin ( delta *pi/180) );\nlat = lat *180/ pi;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[36, 49, 43.99] Latitude in (deg,min,sec)\n" + } + ], + "prompt_number": 75 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.62,Page 183" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =42+10.0/60+40.0/3600; # altitude o f sun\ndelta =23+12.0/60+18.6/3600; # declination of sun ' s angle\nLMT =14+50.0/60;\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; # error\ni2 =8.78/3600* cos( alpha ); # correction due to parallax\ni3 =15.0/60+45.86/3600; # coreection due to semi diamter\nlongP =108+30.0/60; # longitude of place\nalpha =alpha -i+i2+i3;\ndelT = longP /15; # change in time\nGMT = LMT + delT ;\ni4 =1.2/3600* GMT; # error in time\nH=( GMT -12+ i4 - delT ) *15; # hour angle\ni5 =10.6/3600* GMT; # error in declination\ndelta = delta +i5;\nZM =(90 - alpha )*pi /180;\nPM =(90+ delta )*pi /180;\nA= asin ( sin (PM)/sin(ZM)* sin (H*pi /180) );\nA=pi -A;\nZP =2* atan ( sin (A/2+ H*pi /360) / sin (A/2-H*pi /360) *tan(PM/2- ZM /2) );\nlat =pi /2- ZP;\nlat = lat *180/ pi +1+6.0/60;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[1, 19, 7.46] Latitude in (deg,min,sec)\n" + } + ], + "prompt_number": 78 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.63,Page 185" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ndelta =15+20.0/60+48.0/3600; # declination of star\nInt =9+22.0/60+6.0/3600; # interval\n\n#calculation\ndint =Int *9.8565/3600; # change in interval\nH=( Int+ dint ) *15/2; # hour angle\nlat = atan (tan( delta *pi /180) /cos(H*pi /180) );\nlat = lat *180/ pi +5.0/6*16.0/3600;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[39, 22, 1.79] Latitude in (deg,min,sec)\n" + } + ], + "prompt_number": 79 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.64,Page 186" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nRA =1+41.0/60+48.64/3600;\nlat =48+36.0/60+40/3600; # latitude\ndelta =88+58.0/60+28.26/3600; # declination of polaris\nGMM =16+48.0/60+20.86/3600;\nlongP =7+20.0/60; # longitude of place P\ni1 =51.0/3600; # error due to barometer\ni2 =1.0/3600; # error due to barometer\ni3 = -1.0/3600; # error due to temp\n\n#calculation\nlat =lat -i1+i2+i3;\ndelT = longP /15;\ni4= delT *9.8565/3600;\nlst = GMM +i4;\nLMT =20+24.0/60+50.0/3600;\ni6 =9.8565/3600* LMT ; # e r r o r i n LMT\nLST = LMT +i6+lst -24;\nH=LST -RA; # hour a n g l e\nH=H *15;\nlat =lat -(90 - delta )*cos(H*pi /180) +.5* sin (1/3600* pi/180) *(90 - delta ) **2*( sin (H*pi /180) )**2* tan ( lat *pi/180) ;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[49, 36, 18.45] Latitude in (deg,min,sec)\n" + } + ], + "prompt_number": 81 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 1.65,Page 187" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =120 -4 -20.0/60; # longitude of point\nGST =8+30.0/60+20.0/3600; #GST on GMM\ndelta =6+15.0/60+2.0/3600; # deflection\nalpha =39+20.0/60+30.0/3600; # altitude\ntheta =56+54.0/60+30.0/3600; # longitude\n\n#calculation\ndelT = longP /15;\ni= delT *9.8565/3600; # error in time\nlst = GST +i; #LST on LMM\nLST =19+52.0/60+16.0/3600;\nRA=LST;\nLMN =LST -lst;\ni2=LMN *9.8565/3600; # error in LMN\nLMN =LMN -i2;\nOSM =10+55.0/60+30.0/3600; #Observed mean time\ni3 =1.0/60+25.0/3600; # e r r o r i n obs e r v ed t ime\nOSM =OSM -i3;\nLMT = OSM +4.0/15+21.0/60.0/15;\nI=LMN - LMT ; # interval\ni4 =1.21/3600; # error in interval\nI=I+i4;\nH=I; # hour angle\nB= cos ( delta *pi /180) * cos ( theta *pi /180) / cos ( alpha *pi/180) ;\nm =225* H **2*3600**2/2.0/206265.0;\nlat = alpha +m*B /3600;\nlat =90 - lat +6+15.0/60+2.0/3600;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[56, 53, 17.77] Latitude in (deg,min,sec)\n" + } + ], + "prompt_number": 85 + }, + { + "cell_type": "code", + "collapsed": false, + "input": "", + "language": "python", + "metadata": {}, + "outputs": [] } ], "metadata": {} diff --git a/Surveying_Volume_3/Chapter2.ipynb b/Surveying_Volume_3/Chapter2.ipynb new file mode 100755 index 00000000..4be4bac6 --- /dev/null +++ b/Surveying_Volume_3/Chapter2.ipynb @@ -0,0 +1,448 @@ +{ + "metadata": { + "name": "Chapter 2" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "PHOTOGRAPHIC SURVEYING" + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.1, Page 215" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#Finding azimuth of a,b,c\n\n# Initialization of Variable\nfrom math import pi\nfrom math import atan\nf =120.80 # focal length\na = -35.52 # elevation of A\nb =8.48 # elevation of B\nc =48.26 # elevation of C\n\n#calculation\nalphaa = atan (a/f);\nalphab = atan (b/f);\nalphac = atan (c/f);\nphi =(354+30/60) *pi /180; # azimuth o f camera\nphia =phi - alphaa -360* pi /180; # azimuth o f a\nphib = phia + alphab; # azimuth o f b\nphic = phia + alphac ; # azimuth o f c\n\n#result\nprint \" azimuth of a in ( degrees ) \",round(phia /pi *180,2)\nprint \" azimuth of b in ( degrees ) \",round(phib /pi *180,2)\nprint \" azimuth of c in ( degrees ) \",round(phic /pi *180,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " azimuth of a in ( degrees ) 10.39\n azimuth of b in ( degrees ) 14.4\n azimuth of c in ( degrees ) 32.16\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.2,Page 216" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#Finding distance AP and AQ and reduced elevation of A\n\n#initialisation of variable\nfrom math import pi\nfrom math import atan,sin,sqrt\nf =150.0; # focal length of camera\nap =20.2 # elevation of a from p\naa1 =16.4; # distace to the right\naq =35.2 # elevation of a from q\nPQ =100.0; # distace of PQ\nRL =126.845; # r educed level of instrument\n\n#calculation\nalphap = atan (ap/f);\nalphaq = atan (aq/f);\nP=pi /3- alphap ; # angle P\nQ =40* pi /180 - alphaq ; # angle Q\nA=pi -P-Q; # angle A;\nAP=PQ* sin (Q)/sin(A);\nAQ=PQ* sin (P)/sin(A);\nPa1 = sqrt (ap **2+ f **2) ;\nAA1 = aa1 *AP/ Pa1 ;\nRLa =RL+AA1; # reduced level of A\n\n#result\nprint \" distance of AP (m) \",round(AP,2);\nprint \"distance of AQ (m) \",round(AQ,2);\nprint \" reduced level of A in (M) \",round(RLa,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " distance of AP (m) 45.9\ndistance of AQ (m) 80.6\n reduced level of A in (M) 131.82\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.3,Page 218" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding focal length\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\ntheta =(44+30/60) *pi /180; # angle b/w two points\nx1 =68.24; #distance of 1st point\nx2 =58.48; #distance of 2nd point\n\n#calculation\nf=( x1+x2)/ tan ( theta ) /2+ sqrt (( x1+x2) **2/4/( tan ( theta ))\n**2+ x1*x2);\n\n#result\nprint \" focal length of lens in (mm) \",round(f,2);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " focal length of lens in (mm) 156.69\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.4, Page 240" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding representative fraction\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\n# part 1\n\nH =1200.0;#altitude\nh =80.0; #elevation of hill\nf =15.0/100.0;\n\n#calculation\nR80 =f/(H-h);\nprint \" representative fraction of hill is ( time s) \",round(R80,5);\n\n# part 2\n#initialisation of variable\nh =300.0; #elevation of hill\n\n#calculation\nR300 =f/(H-h);\n\n#result\nprint \" representative fraction of hill is ( time s) \",round(R300,5) ;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " representative fraction of hill is ( time s) 0.00013\n representative fraction of hill is ( time s) 0.00017\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.5,Page 240" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding height above sea level\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nR =1.0/8000.0;\nh =1500.0;\nf =20.0/100.0;\n\n#calculation\nH=h+f/R;\n\n#result\nprint \" height above sea level in (m) \",round(H,3);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " height above sea level in (m) 3100.0\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.6,Page 241" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding height above sea level\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nh =500.0; #elevation of point\nf =20.0/100.0; # focal length\nv =8.65/100.0; # vertical distance of photograph\nho =2000.0; # horizontal distance of photograph\nR=v/ho; # representative fraction\nh1 =800;\n\n#calculation\nH=h+f/R;\nS=(H-h1)/f /100; # scale of photograph\n\nprint \" height above sea level in (m) \",round(H,2);\nprint \" 1cm in photograph represents centimetres \",round(S,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " height above sea level in (m) 5124.28\n 1cm in photograph represents centimetres 216.214\n" + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.7, Page 241" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding height above sea level\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nm =1.0/50000.0; #map scale\npd =10.16; # photo distance\nmd =2.54; #map distance\nf =16.0/100.0;\nh =200;\n\n#calculation\nR=pd/md*m; # representative fraction\nH=h+f/R;\n\n#result\nprint \" height above sea level in (m) \",round(H,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " height above sea level in (m) 2200.0\n" + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.8,Page 242" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding distance between A and B\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nf =20 # f o c a l l e n g t h\nxa =2.65; # x coordinate of a\nxb = -1.92; # x coordinate of b\nya =1.36; # x coordinate of a\nyb =3.65; # y coordinate of b\nH =2500.0;\nha =500.0; # elevation of a\nhb =300.0; # elevation of b\n\n#calculation\nXa =(H-ha)/f*xa;\nXb =(H-hb)/f*xb;\nYa =(H-ha)/f*ya;\nYb =(H-hb)/f*yb;\nAB= sqrt ((Xa -Xb) **2+( Ya -Yb)**2);\n\n#result\nprint \" distance between A & B in (m) \",round(AB,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " distance between A & B in (m) 545.213\n" + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.9,Page 243" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding flying distance between A and B\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nf =20.0 # focal length\nxa =2.65; # x coordinate of a\nxb = -1.92; # x coordinate of b\nya =1.36; # y coordinate of a\nyb =3.65; # y coordinate of b\nha =500.0; # elevation of a\nhb =300.0; # elevation of b\nABg =545.0;\nab =5.112;\n\n#calculation\nhab =ha /2+ hb /2;\nHapp =hab+ ABg *f/ab\nXa =( Happ -ha)/f*xa;\nXb =( Happ -hb)/f*xb;\nYa =( Happ -ha)/f*ya;\nYb =( Happ -hb)/f*yb;\nAB= sqrt ((Xa -Xb) **2+( Ya -Yb)**2);\nHact =ABg/AB *( Happ - hab )+ hab ;\n\n#result\nprint \" actual flying height of A & B in (m) \",round(Hact,3);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " actual flying height of A & B in (m) 2499.706\n" + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.10,Page 243" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding relief displacement\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\n\nf =20.0/100.0;\nSd =1.0/10000.0;\nh =250.0; # elevation\nr =6.44;\n\n#calculation\nH=f/Sd;\nd=r*h/H;\n\n#result\nprint \"relief displacement of the point in ( cm) \",round(d,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "relief displacement of the point in ( cm) 0.805\n" + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.11,Page 244" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding relief distance\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nh =50.0; # elevation\nH =2500.0 -1250.0;\nr =6.35;\n\n#calculation\nd=r*h/H;\n\n#result\nprint \"releif displacement of the point in ( cm) \",round(d,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "releif displacement of the point in ( cm) 0.254\n" + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.12,Page 244" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding height of tower\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nf =20.0/100.0; # focal length\nl =250; #length of line\nlp =8.5/100.0; #length of line in photograph\n\n#calculation\nH=l*f/lp; # height of camera above datum\nr =6.46; # distace of image of top o f the towe r\nd =0.46; # releif displacement\nh=d*H/r;\n\n#result\nprint \" height of tower above its base in (m) \",round(h,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "41.89 height of tower above its base in (m) \n" + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.13,Page 267" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding no. of photographs\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nl =20/100; # length of photograph\nw =20/100; # breadth of photograph\nPl =0.6; # longitudinal lap\nPw =0.3; # side lap\ns =100*20;\n\n#calculation\nL=(1 - Pl)*s;\nW=(1 - Pw)*s;\nAr=L*W /1000/1000;\nN =100/ Ar;\nA= round (N);\n\n#result\nprint \"no . o f photographs to be taken \",A+1;\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "no . o f photographs to be taken 90.0\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.14,Page 267" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding no. of photographs\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nPl =0.6; # longitudinal lap\nPw =0.3; # side lap\nL1 =10000.0;\ns =100.0*20.0;\n\n#calculation\nL2=L1;\nN1=L1 /((1 - Pl)*s) +1;\nA1= round (N1);\nif N1 -A1 <0:\n N1=A1;\nelse :\n N1=A1+1;\n\nN2=L2 /((1 - Pw)*s) +1;\nA2= round (N2);\nif N2 -A2 <0:\n N2=A2\nelse :\n N2=A2+1;\n\nN=N1*N2;\n\n#result\nprint \"no . of photographs to be taken \",N;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "no . of photographs to be taken 126.0\n" + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.15,Page 268" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding no. of photographs\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nPl =0.6; # longitudinal lap\nPw =0.3; # side lap\nL1 =12500.0;\ns =100.0*20.0;\nL2 =8000.0;\n\n#calculation\nN1=L1 /((1 - Pl)*s) +1;\nA1= round (N1);\nif N1 -A1 <0:\n N1=A1;\nelse :\n N1=A1+1;\n\nN2=L2 /((1 - Pw)*s) +1;\nA2= round (N2);\nif N2 -A2 <0:\n N2=A2\nelse :\n N2=A2+1;\n\nN=N1*N2;\n\n#result\nprint \"no . of photographs to be taken \",N;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "no . of photographs to be taken 119.0\n" + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.16,Page 268" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding no. of photographs,height of datum\n\n#initialisation of variable\n#part1\nfrom math import pi,tan,sqrt,sin\nf =30.0/100.0; # focal length\nh =400.0; #elevation of datum\nr =12000.0; # ratio\ns =120.0*20.0;\nL2 =24000.0;\nL1 =30000.0;\nPl =0.6; # longitudinal lap\nPw =0.3; # side lap\n\n#calculation\nH=h+r*f;\n\n#result\nprint \" height above datum in (m) \",round(H,2);\n\n# part 2\n#calculation\nW=(1 - Pw)*s;\n\n#result\nprint \" ground width covered in each photograph (m) \",round(W,2);\n\n# part 3\nN2=L2 /((1 - Pw)*s) +1;\nA2= round (N2);\nif N2 -A2 <0:\n N2=A2\nelse :\n N2=A2+1;\n\n#result\nprint \"no . of flights required \",N2;\n\n#part 4-9\n#calculation\nAsf =L2 /(N2 -1) ; # actual spacing between flights\nSfl = Asf /600; # spacing of flight lines\ngd =(1 - Pl)*s; # ground distance\nEi=gd /55.5; # exposure interval\nEi= round (Ei);\nAgs =55.56* Ei;# adgusted ground distance\nN1=L1/ Ags +1;\nA1= round (N1);\nif N1 -A1 <0:\n N1=A1;\nelse :\n N1=A1+1;\nN=N1*N2;\n\n#result\nprint \"actual spacing in m\",Asf\nprint \"spacing of flight lines in cm\",round(Sfl,2)\nprint \"exposure interval in s\",Ei\nprint \"adjusted ground distance in m\",round(Ags)\nprint \"no . of photographs to be taken per flight line\",N1\nprint \"no . of photographs to be taken \",N;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " height above datum in (m) 4000.0\n ground width covered in each photograph (m) 1680.0\nno . of flights required 16.0\nactual spacing in m 1600.0\nspacing of flight lines in cm 2.67\nexposure interval in s 17.0\nadjusted ground distance in m 945.0\nno . of photographs to be taken per flight line 33.0\nno . of photographs to be taken 528.0\n" + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.17,Page 301" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding error in height \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nf =150.0/1000.0; # focal length\nr =20000.0; #ratio\nPl =0.6; # longitudinal lap\nl =23.0/100.0; # l e n g t h\nw =23.0/100.0; # width\n\n#calculation\nB=(1 - Pl)*l*r; # base length\nH=f*r;\nh =0;\ndh =(H-h) **2/ B/f *0.1/1000;\n\n#result\nprint \" error in height in (m) \",round(dh,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " error in height in (m) 3.261\n" + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.18,Page 302" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding parallax height of the chimney\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nH =600.0;\nf =150.0/1000.0;\nb =6.375/100.0;\nh1 =0.0;\nh2 =120.0; # height of chimney\n\n#calculation\ns=H/f;\nB=s*b; # datum elevation\np1=B*f *1000/(H-h1);\np2=B*f *1000/(H-h2);\ndelp =p2 -p1;\ndelh =H* delp /1000/( b+ delp /1000) ;\n\n#result\nprint \" parallax height of the chimney in (m)\",round(delh,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " parallax height of the chimney in (m) 120.0\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.19,Page 303" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding difference in elevation \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nB =200.0;\nf =120.0;\np2 =52.52; # parallax for top pole\np1 =48.27; # parallax for bottom pole\n\n#calculation\ndelh =(p2 -p1)/p2/p1*B*f;\n\n#result\nprint \" difference in elevation of two points in (m) \",round(delh,3)\nprint \"there is again a miscalculation in the step of calculating elevation thus there is a change in the answer\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " difference in elevation of two points in (m) 40.234\nthere is again a miscalculation in the step of calculating elevation thus there is a change in the answer\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 2.20,Page 303" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding difference in elevation \n\n#initialisation of variable\n# part 1\ndelp =1.48/1000.0;\nH =5000.0;\nh =500.0;\nb =90.0/1000.0; #mean principal base\n\n#calculation\ndh =(H-h) **2* delp /((H-h)* delp +b*H);\n\n#result\nprint \" difference in height between two points in(m) \",round(dh,3)\n\n# part 2\n#variable decleration\ndelp =15.5/1000.0;\n\n#calculation\ndh =(H-h) **2* delp /((H-h)* delp +b*H);\n\n#result\nprint \" difference in height between two points in(m) \",round(dh,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": " difference in height between two points in(m) 65.629\n difference in height between two points in(m) 603.896\n" + } + ], + "prompt_number": 14 + }, + { + "cell_type": "code", + "collapsed": false, + "input": "", + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Surveying_Volume_3/README.txt b/Surveying_Volume_3/README.txt index 2c27e6c8..9e2e986b 100755 --- a/Surveying_Volume_3/README.txt +++ b/Surveying_Volume_3/README.txt @@ -1,10 +1,10 @@ -Contributed By: Tarun Kumar Das +Contributed By: Avik Kumar Das Course: btech -College/Institute/Organization: College of Engineering -Department/Designation: Industrial Engineering +College/Institute/Organization: Indian Institute of Technology Bombay +Department/Designation: Civil Engineering Book Title: Surveying Volume 3 -Author: A K Arora -Publisher: Lakshmi Publications, Chennai -Year of publication: 2011 -Isbn: 9788189401276 -Edition: 1
\ No newline at end of file +Author: B C Punmia +Publisher: Laxmi Publication, New Delhi +Year of publication: 1990 +Isbn: 81-7008-054-18 +Edition: 9
\ No newline at end of file diff --git a/Surveying_Volume_3/screenshots/Finding_Altitude_and_Zenith.png b/Surveying_Volume_3/screenshots/Finding_Altitude_and_Zenith.png Binary files differnew file mode 100755 index 00000000..d4197064 --- /dev/null +++ b/Surveying_Volume_3/screenshots/Finding_Altitude_and_Zenith.png diff --git a/Surveying_Volume_3/screenshots/Finding_distance.png b/Surveying_Volume_3/screenshots/Finding_distance.png Binary files differnew file mode 100755 index 00000000..b079ffed --- /dev/null +++ b/Surveying_Volume_3/screenshots/Finding_distance.png diff --git a/Surveying_Volume_3/screenshots/Finding_focal_length.png b/Surveying_Volume_3/screenshots/Finding_focal_length.png Binary files differnew file mode 100755 index 00000000..6d99e1fd --- /dev/null +++ b/Surveying_Volume_3/screenshots/Finding_focal_length.png |