From 64d949698432e05f2a372d9edc859c5b9df1f438 Mon Sep 17 00:00:00 2001 From: kinitrupti Date: Fri, 12 May 2017 18:40:35 +0530 Subject: Revised list of TBCs --- .../Chapter2Electrostatics.ipynb | 281 ++++++++++++++++++++ .../Gopi KrishnaManchukonda/Chapter8.ipynb | 286 --------------------- .../Chapter_2_Electrostatics_.ipynb | 281 -------------------- .../Chapter8.ipynb | 286 +++++++++++++++++++++ 4 files changed, 567 insertions(+), 567 deletions(-) create mode 100755 sample_notebooks/Gopi KrishnaManchukonda/Chapter2Electrostatics.ipynb delete mode 100755 sample_notebooks/Gopi KrishnaManchukonda/Chapter8.ipynb delete mode 100755 sample_notebooks/Gopi KrishnaManchukonda/Chapter_2_Electrostatics_.ipynb create mode 100755 sample_notebooks/Gopi KrishnaManchukonda/Gopi KrishnaManchukonda_version_backup/Chapter8.ipynb (limited to 'sample_notebooks/Gopi KrishnaManchukonda') diff --git a/sample_notebooks/Gopi KrishnaManchukonda/Chapter2Electrostatics.ipynb b/sample_notebooks/Gopi KrishnaManchukonda/Chapter2Electrostatics.ipynb new file mode 100755 index 00000000..8ece860c --- /dev/null +++ b/sample_notebooks/Gopi KrishnaManchukonda/Chapter2Electrostatics.ipynb @@ -0,0 +1,281 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2 Electrostatics " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2_1 pgno:13" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resultant force acting on charge at C= N 12.72\n" + ] + } + ], + "source": [ + "from math import pi,sqrt,cos,sin\n", + "\n", + "epsilon=8.854e-12\n", + "r=sqrt(.1**2+.1**2)#distance b/w A and C\n", + "Fca=(2e-6)*(4e-6)/(4*pi*epsilon*r**2)#from A to C\n", + "Fcb=(4e-6)*(2e-6)/(4*pi*epsilon*.1**2)#from C to B\n", + "Fcd=(4e-6)*(4e-6)/(4*pi*epsilon*.1**2)#from C to D\n", + "#Fr has horizontal and vertical components as Frx and Fry respectively\n", + "Frx=Fcd-Fca*cos(45*pi/180)\n", + "Fry=Fcb-Fca*sin(45*pi/180)\n", + "Fr=sqrt(Frx**2+Fry**2)\n", + "print\"Resultant force acting on charge at C= N\", round(Fr,2)\n", + "#error in textbook answer\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2_ pgno:15" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resultant intensity on charge at C=*10**4 N/C at angle eegrees 25.44 37.0\n" + ] + } + ], + "source": [ + "from math import pi,cos,sin,sqrt,atan\n", + "epsilon=8.854e-12\n", + "E1=(4e-8)/(4*pi*epsilon*.05**2)#fiele intensity eue to charge at A,eirection is from e to A\n", + "r=sqrt(2*.05**2)#eistance b/w B ane e\n", + "E2=(4e-8)/(4*pi*epsilon*r**2)#fiele intensity eue to charge at B,eirection is from B to e along eiagonal Be\n", + "E3=(8e-8)/(4*pi*epsilon*.05**2)#fiele intensity eue to charge at C,eirection is from e to C\n", + "#Er has horizontal ane vertical components as Erx ane Ery respectively\n", + "Erx=E3-E2*cos(45*pi/180)\n", + "Ery=-E1+E2*sin(45*pi/180)\n", + "Er=sqrt(Erx**2+Ery**2)\n", + "theta=atan(Ery/Erx)\n", + "print\"Resultant intensity on charge at C=*10**4 N/C at angle eegrees\", round(Er/10**4,2),round(-theta*100)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2_3 pgno:15" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Potential at A eue to charges at B, C ane e= V 3.73\n" + ] + } + ], + "source": [ + "from math import pi,sqrt\n", + "epsilon=8.854e-12\n", + "AB=.05\n", + "BC=.07\n", + "AC=sqrt(.05**2+.07**2)\n", + "V1=2e-10/(4*pi*epsilon*.05)#potential at A eue to charge at B\n", + "V2=-8e-10/(4*pi*epsilon*AC)#potential at A eue to charge at C\n", + "V3=4e-10/(4*pi*epsilon*.07)#potential at A eue to charge at e\n", + "V=V1+V2+V3 \n", + "print\"Potential at A eue to charges at B, C ane e= V\", round(V,2)\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2_4 pgno:16" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Time constant T= sec\n", + "0.015\n", + "Initial current= A\n", + "0.2\n", + "Charge on the capacitor after 0.05 sec is C\n", + "0.003\n", + "Charging current after 0.05 sec is A\n", + "0.007\n", + "Charging current after 0.015 sec is A\n", + "0.074\n", + "Voltage across 500 ohm resistor after 0.05 sec is V 3.567\n" + ] + } + ], + "source": [ + "from math import exp\n", + "C=30e-6\n", + "R=500.\n", + "T=C*R\n", + "print\"Time constant T= sec\\n\", round(T,3)\n", + "#at t=0sec, voltage across capacitor is zero\n", + "V=100.#apliee voltage\n", + "I=V/R#Ohm's Law\n", + "print\"Initial current= A\\n\", round(I,3)\n", + "t=.05\n", + "Q=C*V\n", + "q=Q*(1-exp(-t/T))\n", + "print\"Charge on the capacitor after 0.05 sec is C\\n\", round(q,3)\n", + "i1=I*exp(-t/T)\n", + "print\"Charging current after 0.05 sec is A\\n\",round(i1,3)\n", + "t=.015\n", + "i2=I*exp(-t/T)\n", + "print\"Charging current after 0.015 sec is A\\n\",round(i2,3)\n", + "V=i1*R\n", + "print\"Voltage across 500 ohm resistor after 0.05 sec is V\", round(V,3)\n", + "#answers vary from the textbook eue to roune off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2_5 pgno:17" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P.e. across the combination = V\n", + "133.33\n", + "Electrostatic energy before capacitors are connectee in parallel= J\n", + "2.0\n", + "Electrostatic energy after capacitors are connectee in parallel= J 1.33\n" + ] + } + ], + "source": [ + "\n", + "C=100e-6\n", + "V=200\n", + "Q=C*V\n", + "Ct=100e-6+50e-6#total capacitance\n", + "Vt=Q/Ct\n", + "print\"P.e. across the combination = V\\n\", round(Vt,2)\n", + "EE1=100e-6*V**2/2\n", + "print\"Electrostatic energy before capacitors are connectee in parallel= J\\n\", EE1\n", + "EE2=Ct*Vt**2/2\n", + "print\"Electrostatic energy after capacitors are connectee in parallel= J\",round( EE2,2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2_6 pgno:18" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Three capacitors have capacitances microF, microF ane microF\n", + "80.0 100.0 120.0\n", + "Voltage across the combination = V 50.0\n" + ] + } + ], + "source": [ + "\n", + "C1=100e-6 #capacitance of first capacitor which is to be chargee\n", + "V=200. #voltage across C1\n", + "Q=C1*V\n", + "#Let Q1, Q2, Q3, Q4 be the charges on respective capacitors after connection\n", + "Q2=4000e-6\n", + "Q3=5000e-6\n", + "Q4=6000e-6\n", + "Q1=Q-(Q2+Q3+Q4)\n", + "C2=C1*(Q2/Q1)\n", + "C3=C1*(Q3/Q1)\n", + "C4=C1*(Q4/Q1)\n", + "print\"Three capacitors have capacitances microF, microF ane microF\\n\", C2*10**6,C3*10**6,C4*10**6\n", + "Vt=Q1/C1\n", + "print\"Voltage across the combination = V\", Vt\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/sample_notebooks/Gopi KrishnaManchukonda/Chapter8.ipynb b/sample_notebooks/Gopi KrishnaManchukonda/Chapter8.ipynb deleted file mode 100755 index c1c1744c..00000000 --- a/sample_notebooks/Gopi KrishnaManchukonda/Chapter8.ipynb +++ /dev/null @@ -1,286 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Chapter 8 - Thermal flow" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 1 - pg 168" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(a)Final velocity of steam is (m/s) = 636.38\n", - "(b)Percentage reduction in velocity is (percent) = 6.19\n" - ] - } - ], - "source": [ - "#calculate the Final velocity and percentage reduction in velocity\n", - "#Input data\n", - "P1=12.;#Pressure of Dry saturated steam entering a steam nozzle in bar\n", - "P2=1.5;#Discharge pressure of Dry saturated steam in bar\n", - "f=0.95;#Dryness fraction of the discharged steam\n", - "l=12.;#Heat drop lost in friction in percentage\n", - "hg1=2784.8;#Specific enthalpy of steam at 12 bar from steam tables in kJ/kg\n", - "hg2=2582.3;#Specific enthalpy of 0.95 dry steam at 1.5 bar from steam tables in kJ/kg\n", - "\n", - "#Calculations\n", - "hd=hg1-hg2;#Heat drop in kJ/kg\n", - "V1=44.72*(hd)**(0.5);#Velocity of steam at discharge from the nozzle in m/s\n", - "n=1-(l/100.);#Nozzle coefficient when 12 percent heat drop is lost in friction\n", - "V2=44.72*(n*hd)**(0.5);#Velocity of steam in m/s\n", - "percentV=((V1-V2)/V1)*100;#Percentage reduction in velocity\n", - "\n", - "#Output\n", - "print '(a)Final velocity of steam is (m/s) = ',round(V1 ,2)\n", - "print '(b)Percentage reduction in velocity is (percent) = ',round(percentV,2)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 2 - pg 174" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The mass of steam discharged,when the exit diameter of the nozzle is 12mm is (kg/hour) = 236.47\n" - ] - } - ], - "source": [ - "#calculate the mass of steam\n", - "#Input data\n", - "P1=12.;#Initial pressure of dry saturated steam expanded in a nozzle in bar\n", - "P2=0.95;#Final pressure of dry saturated steam expanded in a nozzle in bar\n", - "f=10.;#Frictional loss in the nozzle of the total heat drop in percentage\n", - "d=12.;#Exit diameter of the nozzle in mm\n", - "hd=437.1;#Heat drop in kJ/kg from steam tables\n", - "q=0.859;#Dryness fraction of steam at discharge pressure\n", - "vg=1.777;#Specific volume of dry saturated steam at 0.95 bar\n", - "\n", - "#Calculations\n", - "n=1-(f/100);#Nozzle coefficient from moiller chart\n", - "V2=44.72*(n*hd)**(0.5);#Velocity of steam at nozzle exit in m/s\n", - "A=(3.14/4)*(0.012)**(2);#Area of the nozzle at the exit in mm**2\n", - "m=((A*V2)/(q*vg))*3600;#Mass of steam discharged through the nozzle per hour in kg/hour\n", - "\n", - "#Output\n", - "print 'The mass of steam discharged,when the exit diameter of the nozzle is 12mm is (kg/hour) = ',round(m,2)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 3 - pg 176" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(a)Throat area of steam nozzle is (cm^2) = 1.67\n", - "(b)Exit area of steam nozzle is (cm^2) = 2.016\n", - "(c)Exit velocity of the nozzle is (m/s) = 831.62\n" - ] - } - ], - "source": [ - "#calculate the throat area of steam and exit area,exit velocity\n", - "#Input data\n", - "P1=12.;#Inlet pressure of steam nozzle in bar\n", - "T1=250.;#Inlet temperature of steam nozzle in degrees celcius\n", - "P2=2.;#Final pressure of the steam nozzle in bar\n", - "n=1.3;#Polytropic constant for superheated steam\n", - "St=6.831;#For isentropic expansion, entropy remains constant in kJ/kg\n", - "h1=2935.4#Enthalpy of steam at P1 from steam table in kJ/kg\n", - "ht=2860.;#Enthalpy of steam at pt in kJ/kg\n", - "vt=0.325;#Specific volume of steam at the throat conditions in m**3/kg\n", - "m=0.2;#Mass of steam discharged through the nozzle in kg/hour\n", - "q=0.947;#The dryness fraction of steam at exit from steam tables\n", - "hg=2589.6;#Enthalpy of steam at exit in kJ/kg\n", - "vs=0.8854;#Specific volume of saturated steam in m**3/kg\n", - "\n", - "#Calculations\n", - "pt=(P2/(n+1))**(n/(n-1))*P1;#Critical pressure ratio i.e.,Throat pressure in bar\n", - "Vt=(2*1000*(h1-ht))**(0.5);#Velocity of steam at throat in m/s\n", - "At=((m*vt)/Vt)*10**4;#Area of the throat in cm**2 from continuity equation\n", - "ve=q*vs;#Specific volume of steam at exit in m**3/kg\n", - "Ve=(2*1000*(h1-hg))**(0.5);#Velocity of steam at nozzle exit in m/s\n", - "Ae=((m*ve)/Ve)*10**4;#Exit area in cm**2\n", - "\n", - "#Output\n", - "print '(a)Throat area of steam nozzle is (cm^2) = ',round(At,2)\n", - "print '(b)Exit area of steam nozzle is (cm^2) = ',round(Ae,3)\n", - "print '(c)Exit velocity of the nozzle is (m/s) = ',round(Ve,2)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 4 - pg 177" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(a)Final exit velocity of steam is (m/s) = 785.246\n", - "(b)Cross sectional area of the nozzle at exit for maximum discharge is (mm^2) = 677.736\n" - ] - } - ], - "source": [ - "#calculate the Final exit velocity, Cross sectional area\n", - "#Input data\n", - "P1=10.;#Pressure of steam in bar\n", - "f=0.9;#Dryness fraction of steam\n", - "At=350.;#Throat area in mm**2\n", - "Pb=1.4;#Back pressure in bar\n", - "h1=2574.8;#Enthalpy of steam at nozzle inlet from steam tables in kJ/kg\n", - "ft=0.87;#Dryness fraction of steam at throat pressure\n", - "fe=0.81;#Dryness fraction of steam at exit pressure\n", - "ht=2481.;#Enthalpy of steam at throat pressure at ft in kJ/kg\n", - "vt=0.285;#Specific volume of steam at throat in m**3/kg\n", - "he=2266.2;#Enthalpy of steam at exit conditions in kJ/kg\n", - "ve=1.001;#Specific volume of steam at exit conditions in m**3/kg\n", - "\n", - "#Calculations\n", - "Pt=0.582*P1;#Steam pressure at the throat in bar\n", - "hd=h1-ht;#Enthalpy drop upto the throat in kJ/kg\n", - "Vt=44.7*(hd)**(0.5);#Velocity of steam at the throat in m/s\n", - "hde=h1-he;#Enthalpy drop from nozzle entrance to exit in kJ/kg\n", - "Ve=44.7*(hde)**(0.5);#Velocity of steam at nozzle exit in m/s\n", - "Ae=(At*Vt*ve)/(Ve*vt);#Exit area of nozzle from the mass rate of flow equation in mm**2\n", - "\n", - "#Output\n", - "print '(a)Final exit velocity of steam is (m/s) = ',round(Ve,3)\n", - "print '(b)Cross sectional area of the nozzle at exit for maximum discharge is (mm^2) = ',round(Ae,3)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 5 - pg 192" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(a)Velocity of steam at throat is (m/s) = 530.78\n", - "(b)Temperature of steam at the throat is (degrees celcius) = 202.8\n", - "(c)Cone angle of the divergent portion is (degrees) = 2.134\n" - ] - } - ], - "source": [ - "#calculate the Velocity of steam at throat, temperature and cone angle\n", - "#Input data\n", - "import math\n", - "P1=7.;#Inlet pressure of a convergent divergent steam nozzle in bar\n", - "T1=275.;#Inlet temperature of the nozzle in degrees celcius\n", - "P2=1.;#Discharge pressure of steam in bar\n", - "l=60.;#Length of diverging portion of the nozzle in mm\n", - "dt=6.;#Diameter of the throat in mm\n", - "f1=10.;#Percent of total available enthalpy drop lost in friction in the diverging portion in percentage\n", - "h1=3006.9;#Enthalpy of steam at 7bar pressure and 275 degrees celcius in kJ/kg\n", - "ht=2865.9;#Enthalpy at the throat from Moiller chart in kJ/kg\n", - "he=2616.7;#Enthalpy at the exit from moiller chart in kJ/kg\n", - "vt=0.555;#Specific volume of steam at throat in m**3/kg\n", - "Tt=202.8;#Temperature of steam at throat in degrees celcius from moiller chart\n", - "ve=1.65;#Volume of steam at exit in m**3/kg\n", - "\n", - "#Calculations\n", - "Pt=0.546*P1;#The throat pressure for maximum discharge in bar\n", - "hd=h1-ht;#Enthalpy drop upto throat in kJ/kg\n", - "Vt=44.7*(hd)**(0.5);#Velocity of steam at throat in m/s\n", - "hid=h1-he;#Total isentropic drop from 7 bar,275 degrees celcius to 1 bar in kJ/kg\n", - "hda=(1-(f1/100.))*(hid);#Actual heat drop in kJ/kg\n", - "Ve=44.7*(hda)**(0.5);#Velocity at exit in m/s\n", - "At=(3.14/4)*(6./1000)**(2);#Throat area of the nozzle in m**2\n", - "m=(At*Vt)/vt;#Mass flow rate at nozzle throat in kg/s\n", - "Ae=((m*ve)/Ve)*10**4;#Exit area of the nozzle in cm**2\n", - "de=(((Ae*4)/3.14)**(0.5))*10;#Diameter of the nozzle at exit in mm\n", - "alpha=math.atan((de-dt)/(2*60))*180/math.pi;#Half of the cone angle of the nozzle in degrees\n", - "alpha1=2*alpha;#Cone angle of the nozzle in degrees\n", - "\n", - "#Output\n", - "print '(a)Velocity of steam at throat is (m/s) = ',round(Vt,2)\n", - "print '(b)Temperature of steam at the throat is (degrees celcius) =',Tt\n", - "print '(c)Cone angle of the divergent portion is (degrees) =',round(alpha1,3)\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 2", - "language": "python", - "name": "python2" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 2 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.9" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/sample_notebooks/Gopi KrishnaManchukonda/Chapter_2_Electrostatics_.ipynb b/sample_notebooks/Gopi KrishnaManchukonda/Chapter_2_Electrostatics_.ipynb deleted file mode 100755 index 8ece860c..00000000 --- a/sample_notebooks/Gopi KrishnaManchukonda/Chapter_2_Electrostatics_.ipynb +++ /dev/null @@ -1,281 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Chapter 2 Electrostatics " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 2_1 pgno:13" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Resultant force acting on charge at C= N 12.72\n" - ] - } - ], - "source": [ - "from math import pi,sqrt,cos,sin\n", - "\n", - "epsilon=8.854e-12\n", - "r=sqrt(.1**2+.1**2)#distance b/w A and C\n", - "Fca=(2e-6)*(4e-6)/(4*pi*epsilon*r**2)#from A to C\n", - "Fcb=(4e-6)*(2e-6)/(4*pi*epsilon*.1**2)#from C to B\n", - "Fcd=(4e-6)*(4e-6)/(4*pi*epsilon*.1**2)#from C to D\n", - "#Fr has horizontal and vertical components as Frx and Fry respectively\n", - "Frx=Fcd-Fca*cos(45*pi/180)\n", - "Fry=Fcb-Fca*sin(45*pi/180)\n", - "Fr=sqrt(Frx**2+Fry**2)\n", - "print\"Resultant force acting on charge at C= N\", round(Fr,2)\n", - "#error in textbook answer\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 2_ pgno:15" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Resultant intensity on charge at C=*10**4 N/C at angle eegrees 25.44 37.0\n" - ] - } - ], - "source": [ - "from math import pi,cos,sin,sqrt,atan\n", - "epsilon=8.854e-12\n", - "E1=(4e-8)/(4*pi*epsilon*.05**2)#fiele intensity eue to charge at A,eirection is from e to A\n", - "r=sqrt(2*.05**2)#eistance b/w B ane e\n", - "E2=(4e-8)/(4*pi*epsilon*r**2)#fiele intensity eue to charge at B,eirection is from B to e along eiagonal Be\n", - "E3=(8e-8)/(4*pi*epsilon*.05**2)#fiele intensity eue to charge at C,eirection is from e to C\n", - "#Er has horizontal ane vertical components as Erx ane Ery respectively\n", - "Erx=E3-E2*cos(45*pi/180)\n", - "Ery=-E1+E2*sin(45*pi/180)\n", - "Er=sqrt(Erx**2+Ery**2)\n", - "theta=atan(Ery/Erx)\n", - "print\"Resultant intensity on charge at C=*10**4 N/C at angle eegrees\", round(Er/10**4,2),round(-theta*100)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 2_3 pgno:15" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Potential at A eue to charges at B, C ane e= V 3.73\n" - ] - } - ], - "source": [ - "from math import pi,sqrt\n", - "epsilon=8.854e-12\n", - "AB=.05\n", - "BC=.07\n", - "AC=sqrt(.05**2+.07**2)\n", - "V1=2e-10/(4*pi*epsilon*.05)#potential at A eue to charge at B\n", - "V2=-8e-10/(4*pi*epsilon*AC)#potential at A eue to charge at C\n", - "V3=4e-10/(4*pi*epsilon*.07)#potential at A eue to charge at e\n", - "V=V1+V2+V3 \n", - "print\"Potential at A eue to charges at B, C ane e= V\", round(V,2)\n", - " " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 2_4 pgno:16" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Time constant T= sec\n", - "0.015\n", - "Initial current= A\n", - "0.2\n", - "Charge on the capacitor after 0.05 sec is C\n", - "0.003\n", - "Charging current after 0.05 sec is A\n", - "0.007\n", - "Charging current after 0.015 sec is A\n", - "0.074\n", - "Voltage across 500 ohm resistor after 0.05 sec is V 3.567\n" - ] - } - ], - "source": [ - "from math import exp\n", - "C=30e-6\n", - "R=500.\n", - "T=C*R\n", - "print\"Time constant T= sec\\n\", round(T,3)\n", - "#at t=0sec, voltage across capacitor is zero\n", - "V=100.#apliee voltage\n", - "I=V/R#Ohm's Law\n", - "print\"Initial current= A\\n\", round(I,3)\n", - "t=.05\n", - "Q=C*V\n", - "q=Q*(1-exp(-t/T))\n", - "print\"Charge on the capacitor after 0.05 sec is C\\n\", round(q,3)\n", - "i1=I*exp(-t/T)\n", - "print\"Charging current after 0.05 sec is A\\n\",round(i1,3)\n", - "t=.015\n", - "i2=I*exp(-t/T)\n", - "print\"Charging current after 0.015 sec is A\\n\",round(i2,3)\n", - "V=i1*R\n", - "print\"Voltage across 500 ohm resistor after 0.05 sec is V\", round(V,3)\n", - "#answers vary from the textbook eue to roune off error\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 2_5 pgno:17" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "P.e. across the combination = V\n", - "133.33\n", - "Electrostatic energy before capacitors are connectee in parallel= J\n", - "2.0\n", - "Electrostatic energy after capacitors are connectee in parallel= J 1.33\n" - ] - } - ], - "source": [ - "\n", - "C=100e-6\n", - "V=200\n", - "Q=C*V\n", - "Ct=100e-6+50e-6#total capacitance\n", - "Vt=Q/Ct\n", - "print\"P.e. across the combination = V\\n\", round(Vt,2)\n", - "EE1=100e-6*V**2/2\n", - "print\"Electrostatic energy before capacitors are connectee in parallel= J\\n\", EE1\n", - "EE2=Ct*Vt**2/2\n", - "print\"Electrostatic energy after capacitors are connectee in parallel= J\",round( EE2,2)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 2_6 pgno:18" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Three capacitors have capacitances microF, microF ane microF\n", - "80.0 100.0 120.0\n", - "Voltage across the combination = V 50.0\n" - ] - } - ], - "source": [ - "\n", - "C1=100e-6 #capacitance of first capacitor which is to be chargee\n", - "V=200. #voltage across C1\n", - "Q=C1*V\n", - "#Let Q1, Q2, Q3, Q4 be the charges on respective capacitors after connection\n", - "Q2=4000e-6\n", - "Q3=5000e-6\n", - "Q4=6000e-6\n", - "Q1=Q-(Q2+Q3+Q4)\n", - "C2=C1*(Q2/Q1)\n", - "C3=C1*(Q3/Q1)\n", - "C4=C1*(Q4/Q1)\n", - "print\"Three capacitors have capacitances microF, microF ane microF\\n\", C2*10**6,C3*10**6,C4*10**6\n", - "Vt=Q1/C1\n", - "print\"Voltage across the combination = V\", Vt\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 2", - "language": "python", - "name": "python2" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 2 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.9" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/sample_notebooks/Gopi KrishnaManchukonda/Gopi KrishnaManchukonda_version_backup/Chapter8.ipynb b/sample_notebooks/Gopi KrishnaManchukonda/Gopi KrishnaManchukonda_version_backup/Chapter8.ipynb new file mode 100755 index 00000000..c1c1744c --- /dev/null +++ b/sample_notebooks/Gopi KrishnaManchukonda/Gopi KrishnaManchukonda_version_backup/Chapter8.ipynb @@ -0,0 +1,286 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8 - Thermal flow" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1 - pg 168" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Final velocity of steam is (m/s) = 636.38\n", + "(b)Percentage reduction in velocity is (percent) = 6.19\n" + ] + } + ], + "source": [ + "#calculate the Final velocity and percentage reduction in velocity\n", + "#Input data\n", + "P1=12.;#Pressure of Dry saturated steam entering a steam nozzle in bar\n", + "P2=1.5;#Discharge pressure of Dry saturated steam in bar\n", + "f=0.95;#Dryness fraction of the discharged steam\n", + "l=12.;#Heat drop lost in friction in percentage\n", + "hg1=2784.8;#Specific enthalpy of steam at 12 bar from steam tables in kJ/kg\n", + "hg2=2582.3;#Specific enthalpy of 0.95 dry steam at 1.5 bar from steam tables in kJ/kg\n", + "\n", + "#Calculations\n", + "hd=hg1-hg2;#Heat drop in kJ/kg\n", + "V1=44.72*(hd)**(0.5);#Velocity of steam at discharge from the nozzle in m/s\n", + "n=1-(l/100.);#Nozzle coefficient when 12 percent heat drop is lost in friction\n", + "V2=44.72*(n*hd)**(0.5);#Velocity of steam in m/s\n", + "percentV=((V1-V2)/V1)*100;#Percentage reduction in velocity\n", + "\n", + "#Output\n", + "print '(a)Final velocity of steam is (m/s) = ',round(V1 ,2)\n", + "print '(b)Percentage reduction in velocity is (percent) = ',round(percentV,2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2 - pg 174" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The mass of steam discharged,when the exit diameter of the nozzle is 12mm is (kg/hour) = 236.47\n" + ] + } + ], + "source": [ + "#calculate the mass of steam\n", + "#Input data\n", + "P1=12.;#Initial pressure of dry saturated steam expanded in a nozzle in bar\n", + "P2=0.95;#Final pressure of dry saturated steam expanded in a nozzle in bar\n", + "f=10.;#Frictional loss in the nozzle of the total heat drop in percentage\n", + "d=12.;#Exit diameter of the nozzle in mm\n", + "hd=437.1;#Heat drop in kJ/kg from steam tables\n", + "q=0.859;#Dryness fraction of steam at discharge pressure\n", + "vg=1.777;#Specific volume of dry saturated steam at 0.95 bar\n", + "\n", + "#Calculations\n", + "n=1-(f/100);#Nozzle coefficient from moiller chart\n", + "V2=44.72*(n*hd)**(0.5);#Velocity of steam at nozzle exit in m/s\n", + "A=(3.14/4)*(0.012)**(2);#Area of the nozzle at the exit in mm**2\n", + "m=((A*V2)/(q*vg))*3600;#Mass of steam discharged through the nozzle per hour in kg/hour\n", + "\n", + "#Output\n", + "print 'The mass of steam discharged,when the exit diameter of the nozzle is 12mm is (kg/hour) = ',round(m,2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3 - pg 176" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Throat area of steam nozzle is (cm^2) = 1.67\n", + "(b)Exit area of steam nozzle is (cm^2) = 2.016\n", + "(c)Exit velocity of the nozzle is (m/s) = 831.62\n" + ] + } + ], + "source": [ + "#calculate the throat area of steam and exit area,exit velocity\n", + "#Input data\n", + "P1=12.;#Inlet pressure of steam nozzle in bar\n", + "T1=250.;#Inlet temperature of steam nozzle in degrees celcius\n", + "P2=2.;#Final pressure of the steam nozzle in bar\n", + "n=1.3;#Polytropic constant for superheated steam\n", + "St=6.831;#For isentropic expansion, entropy remains constant in kJ/kg\n", + "h1=2935.4#Enthalpy of steam at P1 from steam table in kJ/kg\n", + "ht=2860.;#Enthalpy of steam at pt in kJ/kg\n", + "vt=0.325;#Specific volume of steam at the throat conditions in m**3/kg\n", + "m=0.2;#Mass of steam discharged through the nozzle in kg/hour\n", + "q=0.947;#The dryness fraction of steam at exit from steam tables\n", + "hg=2589.6;#Enthalpy of steam at exit in kJ/kg\n", + "vs=0.8854;#Specific volume of saturated steam in m**3/kg\n", + "\n", + "#Calculations\n", + "pt=(P2/(n+1))**(n/(n-1))*P1;#Critical pressure ratio i.e.,Throat pressure in bar\n", + "Vt=(2*1000*(h1-ht))**(0.5);#Velocity of steam at throat in m/s\n", + "At=((m*vt)/Vt)*10**4;#Area of the throat in cm**2 from continuity equation\n", + "ve=q*vs;#Specific volume of steam at exit in m**3/kg\n", + "Ve=(2*1000*(h1-hg))**(0.5);#Velocity of steam at nozzle exit in m/s\n", + "Ae=((m*ve)/Ve)*10**4;#Exit area in cm**2\n", + "\n", + "#Output\n", + "print '(a)Throat area of steam nozzle is (cm^2) = ',round(At,2)\n", + "print '(b)Exit area of steam nozzle is (cm^2) = ',round(Ae,3)\n", + "print '(c)Exit velocity of the nozzle is (m/s) = ',round(Ve,2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4 - pg 177" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Final exit velocity of steam is (m/s) = 785.246\n", + "(b)Cross sectional area of the nozzle at exit for maximum discharge is (mm^2) = 677.736\n" + ] + } + ], + "source": [ + "#calculate the Final exit velocity, Cross sectional area\n", + "#Input data\n", + "P1=10.;#Pressure of steam in bar\n", + "f=0.9;#Dryness fraction of steam\n", + "At=350.;#Throat area in mm**2\n", + "Pb=1.4;#Back pressure in bar\n", + "h1=2574.8;#Enthalpy of steam at nozzle inlet from steam tables in kJ/kg\n", + "ft=0.87;#Dryness fraction of steam at throat pressure\n", + "fe=0.81;#Dryness fraction of steam at exit pressure\n", + "ht=2481.;#Enthalpy of steam at throat pressure at ft in kJ/kg\n", + "vt=0.285;#Specific volume of steam at throat in m**3/kg\n", + "he=2266.2;#Enthalpy of steam at exit conditions in kJ/kg\n", + "ve=1.001;#Specific volume of steam at exit conditions in m**3/kg\n", + "\n", + "#Calculations\n", + "Pt=0.582*P1;#Steam pressure at the throat in bar\n", + "hd=h1-ht;#Enthalpy drop upto the throat in kJ/kg\n", + "Vt=44.7*(hd)**(0.5);#Velocity of steam at the throat in m/s\n", + "hde=h1-he;#Enthalpy drop from nozzle entrance to exit in kJ/kg\n", + "Ve=44.7*(hde)**(0.5);#Velocity of steam at nozzle exit in m/s\n", + "Ae=(At*Vt*ve)/(Ve*vt);#Exit area of nozzle from the mass rate of flow equation in mm**2\n", + "\n", + "#Output\n", + "print '(a)Final exit velocity of steam is (m/s) = ',round(Ve,3)\n", + "print '(b)Cross sectional area of the nozzle at exit for maximum discharge is (mm^2) = ',round(Ae,3)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5 - pg 192" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)Velocity of steam at throat is (m/s) = 530.78\n", + "(b)Temperature of steam at the throat is (degrees celcius) = 202.8\n", + "(c)Cone angle of the divergent portion is (degrees) = 2.134\n" + ] + } + ], + "source": [ + "#calculate the Velocity of steam at throat, temperature and cone angle\n", + "#Input data\n", + "import math\n", + "P1=7.;#Inlet pressure of a convergent divergent steam nozzle in bar\n", + "T1=275.;#Inlet temperature of the nozzle in degrees celcius\n", + "P2=1.;#Discharge pressure of steam in bar\n", + "l=60.;#Length of diverging portion of the nozzle in mm\n", + "dt=6.;#Diameter of the throat in mm\n", + "f1=10.;#Percent of total available enthalpy drop lost in friction in the diverging portion in percentage\n", + "h1=3006.9;#Enthalpy of steam at 7bar pressure and 275 degrees celcius in kJ/kg\n", + "ht=2865.9;#Enthalpy at the throat from Moiller chart in kJ/kg\n", + "he=2616.7;#Enthalpy at the exit from moiller chart in kJ/kg\n", + "vt=0.555;#Specific volume of steam at throat in m**3/kg\n", + "Tt=202.8;#Temperature of steam at throat in degrees celcius from moiller chart\n", + "ve=1.65;#Volume of steam at exit in m**3/kg\n", + "\n", + "#Calculations\n", + "Pt=0.546*P1;#The throat pressure for maximum discharge in bar\n", + "hd=h1-ht;#Enthalpy drop upto throat in kJ/kg\n", + "Vt=44.7*(hd)**(0.5);#Velocity of steam at throat in m/s\n", + "hid=h1-he;#Total isentropic drop from 7 bar,275 degrees celcius to 1 bar in kJ/kg\n", + "hda=(1-(f1/100.))*(hid);#Actual heat drop in kJ/kg\n", + "Ve=44.7*(hda)**(0.5);#Velocity at exit in m/s\n", + "At=(3.14/4)*(6./1000)**(2);#Throat area of the nozzle in m**2\n", + "m=(At*Vt)/vt;#Mass flow rate at nozzle throat in kg/s\n", + "Ae=((m*ve)/Ve)*10**4;#Exit area of the nozzle in cm**2\n", + "de=(((Ae*4)/3.14)**(0.5))*10;#Diameter of the nozzle at exit in mm\n", + "alpha=math.atan((de-dt)/(2*60))*180/math.pi;#Half of the cone angle of the nozzle in degrees\n", + "alpha1=2*alpha;#Cone angle of the nozzle in degrees\n", + "\n", + "#Output\n", + "print '(a)Velocity of steam at throat is (m/s) = ',round(Vt,2)\n", + "print '(b)Temperature of steam at the throat is (degrees celcius) =',Tt\n", + "print '(c)Cone angle of the divergent portion is (degrees) =',round(alpha1,3)\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} -- cgit