diff options
author | Trupti Kini | 2015-12-30 23:30:19 +0600 |
---|---|---|
committer | Trupti Kini | 2015-12-30 23:30:19 +0600 |
commit | 21407db382650dbf5b654c402b376baf29ba2b50 (patch) | |
tree | d95c01874215206e2a20e37ff2fa401b34f10f60 | |
parent | bb0e389dff459a56b491a1262aecccb294a13f99 (diff) | |
download | Python-Textbook-Companions-21407db382650dbf5b654c402b376baf29ba2b50.tar.gz Python-Textbook-Companions-21407db382650dbf5b654c402b376baf29ba2b50.tar.bz2 Python-Textbook-Companions-21407db382650dbf5b654c402b376baf29ba2b50.zip |
Added(A)/Deleted(D) following books
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter1.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter10.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter11.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter12.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter13.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter14.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter15.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter16.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter17.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter18.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter19.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter2.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter4.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter5.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter7.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter8.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter9.ipynb
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap11.png
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap14.png
A Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap7.png
A Principles_Of_Electric_Machines_And_Power_Electronics_by_P._C._Sen/README.txt
A sample_notebooks/PrashantSahu/Chapter-2-Molecular_Diffusion_-_Principles_of_Mass_Transfer_and_Separation_Process_by_Binay_K_Dutta_1.ipynb
A "sample_notebooks/S PRASHANTHS PRASHANTH/Chapter_1_5.ipynb"
23 files changed, 13786 insertions, 0 deletions
diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter1.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter1.ipynb new file mode 100644 index 00000000..53149a6f --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter1.ipynb @@ -0,0 +1,703 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1 - General Introduction" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 11" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.1\n", + "The Work done is (MJ) = 0.98\n" + ] + } + ], + "source": [ + "#pg 11\n", + "#calculate the work done\n", + "print 'Example 1.1'\n", + "\n", + "# Given values\n", + "P = 700.; #pressure,[kN/m**2]\n", + "V1 = .28; #initial volume,[m**3]\n", + "V2 = 1.68; #final volume,[m**3]\n", + "\n", + "#solution\n", + "\n", + "W = P*(V2-V1);# # Formula for work done at constant pressure is, [kJ]\n", + "\n", + "#results\n", + "print 'The Work done is (MJ) = ',W*10**-3\n", + "\n", + "#End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 13" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.2\n", + "The new volume of the gas is (m^3) = 0.0355\n" + ] + } + ], + "source": [ + "#pg 13\n", + "#calculate the new volume\n", + "print 'Example 1.2'\n", + "\n", + "#Given values\n", + "P1 = 138.; # initial pressure,[kN/m**2]\n", + "V1 = .112; #initial volume,[m**3]\n", + "P2 = 690; # final pressure,[kN/m**2]\n", + "Gama=1.4; # heat capacity ratio\n", + "\n", + "# solution\n", + "\n", + "# since gas is following, PV**1.4=constant,hence\n", + "\n", + "V2 =V1*(P1/P2)**(1/Gama); # final volume, [m**3] \n", + "\n", + "#results\n", + "print 'The new volume of the gas is (m^3) = ',round(V2,4)\n", + "\n", + "#End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 15" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.3\n", + "Final Volume (m^3) = 0.077\n", + "The Work done by gas during expansion is (kJ) = 37.2\n" + ] + } + ], + "source": [ + "#pg 15\n", + "#calculate the work done by gas\n", + "print 'Example 1.3'\n", + "\n", + "# Given values\n", + "P1 = 2070; # initial pressure, [kN/m^2]\n", + "V1 = .014; # initial volume, [m^3]\n", + "P2 = 207.; # final pressure, [kN/m^2]\n", + "n=1.35; # polytropic index\n", + "\n", + "# solution\n", + "\n", + "# since gas is following PV^n=constant\n", + "# hence \n", + "\n", + "V2 = V1*(P1/P2)**(1/n); # final volume, [m^3]\n", + "\n", + "# calculation of workdone\n", + "\n", + "W=(P1*V1-P2*V2)/(1.35-1); # using work done formula for polytropic process, [kJ]\n", + "\n", + "#results\n", + "print 'Final Volume (m^3) = ',round(V2,3)\n", + "print 'The Work done by gas during expansion is (kJ) = ',round(W,1)\n", + "\n", + "#End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 17" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.4\n", + " The final pressure (kN/m^2) = 800.0\n", + " Work done on the gas (kJ) = -11.64\n" + ] + } + ], + "source": [ + "#pg 17\n", + "#calculate the final pressure and work done\n", + "print 'Example 1.4'\n", + "import math\n", + "\n", + "# Given values\n", + "P1 = 100; # initial pressure, [kN/m^2]\n", + "V1 = .056; # initial volume, [m^3]\n", + "V2 = .007; # final volume, [m^3]\n", + "\n", + "# To know P2\n", + "# since process is hyperbolic so, PV=constant\n", + "# hence\n", + "\n", + "P2 = P1*V1/V2; # final pressure, [kN/m^2]\n", + "\n", + "# calculation of workdone\n", + "W = P1*V1*math.log(V2/V1); # formula for work done in this process, [kJ]\n", + "\n", + "#results\n", + "print ' The final pressure (kN/m^2) = ',P2\n", + "print ' Work done on the gas (kJ) = ',round(W,2)\n", + "\n", + "#End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 21" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.5\n", + "The heat required (kJ) = 191.25\n" + ] + } + ], + "source": [ + "#pg 21\n", + "#calculate the heat required\n", + "print 'Example 1.5'\n", + "\n", + "# Given values\n", + "m = 5.; # mass, [kg]\n", + "t1 = 15.; # inital temperature, [C]\n", + "t2 = 100.; # final temperature, [C]\n", + "c = 450.; # specific heat capacity, [J/kg K]\n", + "\n", + "# solution\n", + "\n", + "# using heat transfer equation,[1]\n", + "Q = m*c*(t2-t1); # [J]\n", + "#results\n", + "print 'The heat required (kJ) = ',round(Q*10**-3,2)\n", + "\n", + "#End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 22" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.6\n", + "Required heat transfer to accomplish the change (kJ) = 1814.4\n" + ] + } + ], + "source": [ + "#pg 22\n", + "print 'Example 1.6'\n", + "\n", + "#Calculate the required heat transfer \n", + "# Given values\n", + "m_cop = 2.; # mass of copper vessel, [kg]\n", + "m_wat = 6.; # mass of water, [kg]\n", + "c_wat = 4.19; # specific heat capacity of water, [kJ/kg K]\n", + "\n", + "t1 = 20.; # initial temperature, [C]\n", + "t2 = 90.; # final temperature, [C]\n", + "\n", + "# From the table of average specific heat capacities\n", + "c_cop = .390; # specific heat capacity of copper,[kJ/kg k]\n", + "\n", + "# solution\n", + "Q_cop = m_cop*c_cop*(t2-t1); # heat required by copper vessel, [kJ]\n", + "\n", + "Q_wat = m_wat*c_wat*(t2-t1); # heat required by water, [kJ]\n", + "\n", + "# since there is no heat loss,so total heat transfer is sum of both\n", + "Q_total = Q_cop+Q_wat ; # [kJ]\n", + "\n", + "#results\n", + "print 'Required heat transfer to accomplish the change (kJ) = ',Q_total\n", + "\n", + "#End" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7: pg 22" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.7\n", + "The final temperature is (C) = 56.9\n" + ] + } + ], + "source": [ + "#pg 22\n", + "print('Example 1.7');\n", + "#calculate the final temperature\n", + "\n", + "# Given values\n", + "m = 10.; # mass of iron casting, [kg]\n", + "t1 = 200.; # initial temperature, [C]\n", + "Q = -715.5; # [kJ], since heat is lost in this process\n", + "\n", + "# From the table of average specific heat capacities\n", + "c = .50; # specific heat capacity of casting iron, [kJ/kg K]\n", + "\n", + "# solution\n", + "# using heat equation\n", + "# Q = m*c*(t2-t1)\n", + "\n", + "t2 = t1+Q/(m*c); # [C]\n", + "\n", + "#results\n", + "print 'The final temperature is (C) = ',t2\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8: pg 23" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.8\n", + "The specific heat capacity of the liquid is (kJ/kg K) = 2.1\n" + ] + } + ], + "source": [ + "#pg 23\n", + "#calculate the specific heat capacity\n", + "print('Example 1.8');\n", + "# Given values\n", + "m = 4.; # mass of the liquid, [kg]\n", + "t1 = 15.; # initial temperature, [C]\n", + "t2 = 100.; # final temperature, [C]\n", + "Q = 714.; # [kJ],required heat to accomplish this change\n", + "\n", + "# solution\n", + "# using heat equation\n", + "# Q=m*c*(t2-t1)\n", + "\n", + "# calculation of c\n", + "c=Q/(m*(t2-t1)); # heat capacity, [kJ/kg K] \n", + "\n", + "#results\n", + "print 'The specific heat capacity of the liquid is (kJ/kg K) = ',c\n", + "\n", + "#End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9: pg 27" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.9\n", + "The power output of the engine is (kJ) = 48.7\n", + "The energy rejected by the engine is (MJ/min) = 11.7\n" + ] + } + ], + "source": [ + "#pg 27\n", + "#calculate the energy rejected by the engine\n", + "print('Example 1.9');\n", + "\n", + "\n", + "# Given values\n", + "m_dot = 20.4; # mass flowrate of petrol, [kg/h]\n", + "c = 43.; # calorific value of petrol, [MJ/kg]\n", + "n = .2; # Thermal efficiency of engine\n", + "\n", + "# solution\n", + "m_dot = 20.4/3600; # [kg/s]\n", + "c = 43*10**6; # [J/kg]\n", + "\n", + "# power output\n", + "P_out = n*m_dot*c; # [W]\n", + "\n", + " \n", + "# power rejected\n", + "\n", + "P_rej = m_dot*c*(1-n); # [W]\n", + "P_rej = P_rej*60*10**-6; # [MJ/min]\n", + "\n", + "#results\n", + "print 'The power output of the engine is (kJ) = ',round(P_out*10**-3,1)\n", + "print 'The energy rejected by the engine is (MJ/min) = ',round(P_rej,1)\n", + "\n", + "#End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10: pg 28" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.10\n", + "Thermal efficiency of the plant = 0.173\n" + ] + } + ], + "source": [ + "#pg 28\n", + "print('Example 1.10');\n", + "#calculate the thermal efficiency\n", + "\n", + "\n", + "# Given values\n", + "m_dot = 3.045; # use of coal, [tonne/h]\n", + "c = 28; # calorific value of the coal, [MJ/kg]\n", + "P_out = 4.1; # output of turbine, [MW]\n", + "\n", + "# solution\n", + "m_dot = m_dot*10**3/3600; # [kg/s]\n", + "\n", + "P_in = m_dot*c; # power input by coal, [MW]\n", + "\n", + "n = P_out/P_in; # thermal efficiency formula\n", + "\n", + "#results\n", + "print 'Thermal efficiency of the plant = ',round(n,3)\n", + "\n", + "#End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11: pg 29" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.11\n", + "The power output of the engine (kW) = 12.5\n" + ] + } + ], + "source": [ + "#pg 29\n", + "#calculate the power output of the engine\n", + "print('Example 1.11');\n", + "\n", + "\n", + "# Given values\n", + "v = 50.; # speed, [km/h]\n", + "F = 900.; # Resistance to the motion of a car\n", + "\n", + "# solution\n", + "v = v*10**3/3600; # [m/s]\n", + "Power = F*v; # Power formula, [W]\n", + "\n", + "print 'The power output of the engine (kW) = ',Power*10**-3\n", + " \n", + "# End" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12: pg 31" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.12\n", + "The power output from the engine (kW) = 15.79\n" + ] + } + ], + "source": [ + "#pg 31\n", + "#calculate the power output from the engine\n", + "\n", + "print('Example 1.12');\n", + "\n", + "# Given values\n", + "V = 230.; # volatage, [volts]\n", + "I = 60.; # current, [amps]\n", + "n_gen = .95; # efficiency of generator\n", + "n_eng = .92; # efficiency of engine\n", + "\n", + "# solution\n", + "\n", + "P_gen = V*I; # Power delivered by generator, [W]\n", + "P_gen=P_gen*10**-3; # [kW]\n", + "\n", + "P_in_eng=P_gen/n_gen;#Power input from engine,[kW]\n", + "\n", + "P_out_eng=P_in_eng/n_eng;#Power output from engine,[kW]\n", + "\n", + "#results\n", + "print 'The power output from the engine (kW) = ',round(P_out_eng,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13: pg 32" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.13\n", + "The current taken by heater (amps) = 17.4\n" + ] + } + ], + "source": [ + "#pg 32\n", + "#calculate the current taken by heater\n", + "print('Example 1.13');\n", + "\n", + "\n", + "\n", + "# Given values\n", + "V = 230.; # Voltage, [volts]\n", + "W = 4.; # Power of heater, [kW]\n", + "\n", + "# solution\n", + "\n", + "# using equation P=VI\n", + "I = W/V; # current, [K amps]\n", + "#results\n", + "print 'The current taken by heater (amps) = ',round(I*10**3,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14: pg 32" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 1.14\n", + "Mass of coal burnt by the power station in 1 hour (tonne) = 218.0\n" + ] + } + ], + "source": [ + "#pg 32\n", + "#calculate the mass of coal burnt\n", + "print('Example 1.14');\n", + "\n", + "# Given values\n", + "P_out = 500.; # output of power station, [MW]\n", + "c = 29.5; # calorific value of coal, [MJ/kg]\n", + "r=.28; \n", + "\n", + "# solution\n", + "\n", + "# since P represents only 28 percent of energy available from coal\n", + "P_coal = P_out/r; # [MW]\n", + " \n", + "m_coal = P_coal/c; # Mass of coal used, [kg/s]\n", + "m_coal = m_coal*3600; # [kg/h]\n", + "\n", + "#After one hour\n", + "m_coal = m_coal*1*10**-3; # [tonne]\n", + "#results\n", + "print 'Mass of coal burnt by the power station in 1 hour (tonne) = ',round(m_coal,0)\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter10.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter10.ipynb new file mode 100644 index 00000000..47e12831 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter10.ipynb @@ -0,0 +1,781 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10 - Steam Plant" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 292" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The equivalent evaporation, from and at 100 C is (kg steam/kg coal) = 8.96\n" + ] + } + ], + "source": [ + "#pg 292\n", + "# determine the equivalent evaporation\n", + "\n", + "# Given\n", + "P = 1.4;# [MN/m^2]\n", + "m = 8.;# mass of water,[kg]\n", + "T1 = 39.;# entering temperature,[C]\n", + "T2 = 100.;# [C]\n", + "x = .95;#dryness fraction \n", + "\n", + "# solution\n", + "hf = 830.1;# [kJ/kg]\n", + "hfg = 1957.7;# [kJ/kg]\n", + "# steam is wet so specific enthalpy of steam is\n", + "h = hf+x*hfg;# [kJ/kg]\n", + "\n", + "# at 39 C\n", + "h1 = 163.4;# [kJ/kg]\n", + "# hence\n", + "q = h-h1;# [kJ/kg]\n", + "Q = m*q;# [kJ]\n", + "\n", + "evap = Q/2256.9;# equivalent evaporation[kg steam/(kg coal)]\n", + "\n", + "#results\n", + "\n", + "print 'The equivalent evaporation, from and at 100 C is (kg steam/kg coal) = ',round(evap,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 292" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The mass of oil used per hour is (kg) = 395.4\n", + " The fraction of the enthalpy drop through the turbine that is converted into useful work is = 0.841\n", + " The heat transfer available in exhaust steam above 49.4 C is (kJ/kg) = 2450.4\n" + ] + } + ], + "source": [ + "#pg 292\n", + "#aim : To determine the mass of oil used per hour and the fraction of enthalpy drop through the turbine\n", + "# heat transfer available per kilogram of exhaust steam\n", + "\n", + "# Given values\n", + "ms_dot = 5000.;# generation of steam, [kg/h]\n", + "P1 = 1.8;# generated steam pressure, [MN/m^2]\n", + "T1 = 273.+325;# generated steam temperature, [K]\n", + "Tf = 273+49.4;# feed temperature, [K]\n", + "neta = .8;# efficiency of boiler plant \n", + "c = 45500.;# calorific value, [kJ/kg]\n", + "P = 500.;# turbine generated power, [kW]\n", + "Pt = .18;# turbine exhaust pressure, [MN/m^2]\n", + "x = .98;# dryness farction of steam\n", + "\n", + "# solution\n", + "# using steam table at 1.8 MN/m^2\n", + "hf1 = 3106.;# [kJ/kg]\n", + "hg1 = 3080.;# [kJ/kg]\n", + "# so\n", + "h1 = hf1-neta*(hf1-hg1);# [kJ/kg]\n", + "# again using steam table specific enthalpy of feed water is\n", + "hwf = 206.9;# [kJ/kg]\n", + "h_rais = ms_dot*(h1-hwf);# energy to raise steam, [kJ]\n", + "\n", + "h_fue = h_rais/neta;# energy from fuel per hour, [kJ]\n", + "m_oil = h_fue/c;# mass of fuel per hour, [kg]\n", + "\n", + "# from steam table at exhaust\n", + "hf = 490.7;# [kJ/kg]\n", + "hfg = 2210.8;# [kJ/kg]\n", + "# hence\n", + "h = hf+x*hfg;# [kJ/kg]\n", + "# now\n", + "h_drop = (h1-h)*ms_dot/3600;# specific enthalpy drop in turbine [kJ]\n", + "f = P/h_drop;# fraction ofenthalpy drop converted into work\n", + "# heat transfer available in exhaust is\n", + "Q = h-hwf;# [kJ/kg]\n", + "#results\n", + "print ' The mass of oil used per hour is (kg) = ',round(m_oil,1)\n", + "print ' The fraction of the enthalpy drop through the turbine that is converted into useful work is = ',round(f,3)\n", + "print ' The heat transfer available in exhaust steam above 49.4 C is (kJ/kg) = ',round(Q,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 293" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 10.3\n", + " (a) The thermal efficiency of the boiler is (percent) = 66.3\n", + " (b) The equivalent evaporation of boiler is (kg/kg coal) = 9.11\n", + " (c) Mass of coal used in new condition is (kg) = 563.0\n", + " The saving in coal per hour is (kg) = 107.0\n" + ] + } + ], + "source": [ + "#pg 293\n", + "print('Example 10.3');\n", + "\n", + "# aim : To determine\n", + "# (a) the thermal efficiency of the boiler\n", + "# (b) the equivalent evaporation of the boiler\n", + "# (c) the new coal consumption \n", + "\n", + "# given values\n", + "ms_dot = 5400.;# steam feed rate, [kg/h]\n", + "P = 750;# steam pressure, [kN/m**2]\n", + "x = .98;# steam dryness fraction\n", + "Tf1 = 41.5;# feed water temperature, [C]\n", + "CV = 31000.;# calorific value of coal used in the boiler, [kJ/kg]\n", + "mc1 = 670.;# rate of burning of coal/h, [kg]\n", + "Tf2 = 100.;# increased water temperature, [C]\n", + "\n", + "# solution\n", + "# (a)\n", + "SRC = ms_dot/mc1;# steam raised/kg coal, [kg]\n", + "hf = 709.3;# [kJ/kg]\n", + "hfg = 2055.5;# [kJ/kg]\n", + "h1 = hf+x*hfg;# specific enthalpy of steam raised, [kJ/kg]\n", + "# from steam table \n", + "hfw = 173.9;# specific enthalpy of feed water, [kJ/kg]\n", + "EOB = SRC*(h1-hfw)/CV;# efficiency of boiler\n", + "print ' (a) The thermal efficiency of the boiler is (percent) = ',round(EOB*100,1)\n", + "\n", + "# (b)\n", + "he = 2256.9;# specific enthalpy of evaporation, [kJ/kg]\n", + "Ee = SRC*(h1-hfw)/he;# equivalent evaporation[kg/kg coal]\n", + "print ' (b) The equivalent evaporation of boiler is (kg/kg coal) = ',round(Ee,2)\n", + "# (c)\n", + "hw = 419.1;# specific enthalpy of feed water at 100 C, [kJ/kg]\n", + "Eos = ms_dot*(h1-hw);# energy of steam under new condition, [kJ/h]\n", + "neb = EOB+.05;# given condition new efficiency of boiler if 5%more than previous\n", + "Ec = Eos/neb;# energy from coal, [kJ/h]\n", + "mc2 = Ec/CV;# mass of coal used per hour in new condition, [kg]\n", + "print ' (c) Mass of coal used in new condition is (kg) = ',round(mc2)\n", + "print ' The saving in coal per hour is (kg) = ',round(mc1-mc2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 294" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 10.4\n", + " (a) The heat transfer/h in producing wet steam in the boiler is (MJ) = 1776396.0\n", + " (b) The heat transfer/h in superheater is (MJ) = 777924.0\n", + " (c) The volume of gas used/h is (m^3) = 73064.0\n", + "There is calculation mistake in the book so our answer is not matching\n" + ] + } + ], + "source": [ + "#pg 294\n", + "print('Example 10.4');\n", + "\n", + "# aim : To determine the\n", + "# (a) Heat transfer in the boiler\n", + "# (b) Heat transfer in the superheater\n", + "# (c) Gas used\n", + "\n", + "# given values\n", + "P = 100.;# boiler operating pressure, [bar]\n", + "Tf = 256.;# feed water temperature, [C]\n", + "x = .9;# steam dryness fraction.\n", + "Th = 450.;# superheater exit temperature, [C]\n", + "m = 1200.;# steam generation/h, [tonne]\n", + "TE = .92;# thermal efficiency\n", + "CV = 38.;# calorific value of fuel, [MJ/m^3]\n", + "\n", + "# solution\n", + "# (a)\n", + "# from steam table\n", + "hw = 1115.4;# specific enthalpy of feed water, [kJ/kg]\n", + "# for wet steam\n", + "hf = 1408.;# specific enthalpy, [kJ/kg]\n", + "hg = 2727.7;# specific enthalpy, [kJ/kg]\n", + "# so\n", + "h = hf+x*(hg-hf);# total specific enthalpy of wet steam, [kJ/kg]\n", + "# hence\n", + "Qb = m*(h-hw);# heat transfer/h for wet steam, [MJ]\n", + "print ' (a) The heat transfer/h in producing wet steam in the boiler is (MJ) = ',Qb\n", + "\n", + "# (b)\n", + "# again from steam table\n", + "# specific enthalpy of superheated stem at given condition is,\n", + "hs = 3244;# [kJ/kg]\n", + "\n", + "Qs = m*(hs-h);# heat transfer/h in superheater, [MJ]\n", + "print ' (b) The heat transfer/h in superheater is (MJ) = ',Qs\n", + "\n", + "# (c)\n", + "V = (Qb+Qs)/(TE*CV);# volume of gs used/h, [m^3]\n", + "print ' (c) The volume of gas used/h is (m^3) = ',round(V)\n", + "\n", + "print 'There is calculation mistake in the book so our answer is not matching'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 300" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 10.5\n", + "The flow rate of the cooling water is = 27.5 tonne/h\n" + ] + } + ], + "source": [ + "#pg 300\n", + "print('Example 10.5');\n", + "\n", + "#aim : To determine \n", + "# the flow rate of cooling water\n", + "\n", + "#Given values\n", + "P=24;#pressure, [kN/m^2]\n", + "ms_dot=1.8;#steam condense rate,[tonne/h]\n", + "x=.98;#dryness fraction\n", + "T1=21.;#entrance temperature of cooling water,[C]\n", + "T2=57.;#outlet temperature of cooling water,[C]\n", + "\n", + "#solution\n", + "#at 24 kN/m^2, for steam\n", + "hfg=2616.8;#[kJ/kg]\n", + "hf1=268.2;#[kJ/kg]\n", + "#hence\n", + "h1=hf1+x*(hfg-hf1);#[kJ/kg]\n", + "\n", + "#for cooling water\n", + "hf3=238.6;#[kJ/kg]\n", + "hf2=88.1;#[kJ/kg]\n", + "\n", + "#using equation [3]\n", + "#ms_dot*(hf3-hf2)=mw_dot*(h1-hf1),so\n", + "mw_dot=ms_dot*(h1-hf1)/(hf3-hf2);#[tonne/h]\n", + "#results\n", + "print 'The flow rate of the cooling water is =',round(mw_dot,1),'tonne/h'\n", + "\n", + "#End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 306" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 10.6\n", + " (a) The energy supplied in boiler/kg steam is (kJ/kg) = 2914.2\n", + " (b) The dryness fraction of steam entering the condenser is = 0.804\n", + " (c) The Rankine efficiency is (percent) = 34.0\n" + ] + } + ], + "source": [ + "#pg 306\n", + "print('Example 10.6');\n", + "\n", + "# aim : To determine\n", + "# (a) the energy supplied in the boiler\n", + "# (b) the dryness fraction of the steam entering the condenser\n", + "# (c) the rankine efficiency\n", + "\n", + "# given values\n", + "P1 = 3.5;# steam entering pressure, [MN/m^2]\n", + "T1 = 273+350;# entering temperature, [K]\n", + "P2 = 10;#steam exhaust pressure, [kN/m^2]\n", + "\n", + "# solution\n", + "# (a)\n", + "# from steam table, at P1 is,\n", + "hf1 = 3139;# [kJ/kg]\n", + "hg1 = 3095;# [kJ/kg]\n", + "h1 = hf1-1.5/2*(hf1-hg1);\n", + "# at Point 3\n", + "h3 = 191.8;# [kJ/kg]\n", + "Es = h1-h3;# energy supplied, [kJ/kg]\n", + "print ' (a) The energy supplied in boiler/kg steam is (kJ/kg) = ',Es\n", + "\n", + "# (b)\n", + "# at P1\n", + "sf1 = 6.960;# [kJ/kg K]\n", + "sg1 = 6.587;# [kJ/kg K]\n", + "s1 = sf1-1.5/2*(sf1-sg1);# [kJ/kg K]\n", + "# at P2\n", + "sf2 = .649;# [kJ/kg K] \n", + "sg2 = 8.151;# [kJ/kg K]\n", + "# s2=sf2+x2(sg2-sf2)\n", + "# theoretically expansion through turbine is isentropic so s1=s2\n", + "# hence\n", + "s2 = s1;\n", + "x2 = (s2-sf2)/(sg2-sf2);# dryness fraction\n", + "print ' (b) The dryness fraction of steam entering the condenser is = ',round(x2,3)\n", + "\n", + "# (c)\n", + "# at point 2\n", + "hf2 = 191.8;# [kJ/kg]\n", + "hfg2 = 2392.9;# [kJ/kg]\n", + "h2 = hf2+x2*hfg2;# [kJ/kg]\n", + "Re = (h1-h2)/(h1-h3);# rankine efficiency\n", + "print ' (c) The Rankine efficiency is (percent) = ',round(Re*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7: pg 307" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 10.7\n", + " (a) The Rankine efficiency is (percent) = 26.9\n", + " (b) The specific work done is (kJ/kg) = 592.6\n", + " The specific work done (from rankine) is (kJ/kg) = 687.2\n", + "there is calculation mistake in the book so our answer is not matching\n" + ] + } + ], + "source": [ + "#pg 307\n", + "print('Example 10.7');\n", + "\n", + "# aim : To determine\n", + "# the specific work done and compare this with that obtained when determining the rankine effficiency\n", + "\n", + "# given values\n", + "P1 = 1000;# steam entering pressure, [kN/m^2]\n", + "x1 = .97;# steam entering dryness fraction\n", + "P2 = 15;#steam exhaust pressure, [kN/m^2]\n", + "n = 1.135;# polytropic index\n", + "\n", + "# solution\n", + "# (a)\n", + "# from steam table, at P1 is\n", + "hf1 = 762.6;# [kJ/kg]\n", + "hfg1 = 2013.6;# [kJ/kg]\n", + "h1 = hf1+hfg1; # [kJ/kg]\n", + "\n", + "sf1 = 2.138;# [kJ/kg K]\n", + "sg1 = 6.583;# [kJ/kg K]\n", + "s1 = sf1+x1*(sg1-sf1);# [kJ/kg K]\n", + "\n", + "# at P2\n", + "sf2 = .755;# [kJ/kg K] \n", + "sg2 = 8.009;# [kJ/kg K]\n", + "# s2 = sf2+x2(sg2-sf2)\n", + "# since expansion through turbine is isentropic so s1=s2\n", + "# hence\n", + "s2 = s1;\n", + "x2 = (s2-sf2)/(sg2-sf2);# dryness fraction\n", + "\n", + "# at point 2\n", + "hf2 = 226.0;# [kJ/kg]\n", + "hfg2 = 2373.2;# [kJ/kg]\n", + "h2 = hf2+x2*hfg2;# [kJ/kg]\n", + "\n", + "# at Point 3\n", + "h3 = 226.0;# [kJ/kg]\n", + "\n", + "# (a)\n", + "Re = (h1-h2)/(h1-h3);# rankine efficiency\n", + "print ' (a) The Rankine efficiency is (percent) = ',round(Re*100,1)\n", + "\n", + "# (b)\n", + "vg1 = .1943;# specific volume at P1, [m^3/kg]\n", + "vg2 = 10.02;# specific volume at P2, [m^3/kg]\n", + "V1 = x1*vg1;# [m^3/kg]\n", + "V2 = x2*vg2;# [m^3/kg]\n", + "\n", + "W1 = n/(n-1)*(P1*V1-P2*V2);# specific work done, [kJ/kg]\n", + "\n", + "# from rankine cycle\n", + "W2 = h1-h2;# [kJ/kg]\n", + "print ' (b) The specific work done is (kJ/kg) = ',round(W1,1)\n", + "print ' The specific work done (from rankine) is (kJ/kg) = ',round(W2,1)\n", + "\n", + "print 'there is calculation mistake in the book so our answer is not matching'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8: pg 309" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 10.8\n", + " (a) The rankine efficiency is (percent) = 16.0\n", + " (b) The specific steam consumption is (kJ/kWh) = 8.51\n", + " (c) The carnot efficiency of the cycle is (percent) = 33.9\n" + ] + } + ], + "source": [ + "#pg 309\n", + "print('Example 10.8');\n", + "\n", + "# aim : To determine\n", + "# (a) the rankine fficiency\n", + "# (b) the specific steam consumption\n", + "# (c) the carnot efficiency of the cycle\n", + "\n", + "# given values\n", + "P1 = 1100.;# steam entering pressure, [kN/m^2]\n", + "T1 = 273.+250;# steam entering temperature, [K]\n", + "P2 = 280.;# pressure at point 2, [kN/m^2]\n", + "P3 = 35.;# pressure at point 3, [kN/m^2]\n", + "\n", + "# solution\n", + "# (a)\n", + "# from steam table, at P1 and T1 is\n", + "hf1 = 2943.;# [kJ/kg]\n", + "hg1 = 2902.;# [kJ/kg]\n", + "h1 = hf1-.1*(hf1-hg1); # [kJ/kg]\n", + "\n", + "sf1 = 6.926;# [kJ/kg K]\n", + "sg1 = 6.545;# [kJ/kg K]\n", + "s1 = sf1-.1*(sf1-sg1);# [kJ/kg K]\n", + "\n", + "# at P2\n", + "sf2 = 1.647;# [kJ/kg K] \n", + "sg2 = 7.014;# [kJ/kg K]\n", + "# s2=sf2+x2(sg2-sf2)\n", + "# since expansion through turbine is isentropic so s1=s2\n", + "# hence\n", + "s2 = s1;\n", + "x2 = (s2-sf2)/(sg2-sf2);# dryness fraction\n", + "\n", + "# at point 2\n", + "hf2 = 551.4;# [kJ/kg]\n", + "hfg2 = 2170.1;# [kJ/kg]\n", + "h2 = hf2+x2*hfg2;# [kJ/kg]\n", + "vg2 = .646;# [m^3/kg]\n", + "v2 = x2*vg2;# [m^3/kg]\n", + "\n", + "# by Fig10.20.\n", + "A6125 = h1-h2;# area of 6125, [kJ/kg]\n", + "A5234 = v2*(P2-P3);# area 5234, [kJ/kg]\n", + "W = A6125+A5234;# work done \n", + "hf = 304.3;# specific enthalpy of water at condenser pressuer, [kJ/kg]\n", + "ER = h1-hf;# energy received, [kJ/kg]\n", + "Re = W/ER;# rankine efficiency\n", + "print ' (a) The rankine efficiency is (percent) = ',round(Re*100)\n", + "\n", + "# (b)\n", + "kWh = 3600;# [kJ]\n", + "SSC = kWh/W;# specific steam consumption, [kJ/kWh]\n", + "print ' (b) The specific steam consumption is (kJ/kWh) = ',round(SSC,2)\n", + "\n", + "# (c)\n", + "# from steam table \n", + "T3 = 273+72.7;# temperature at point 3\n", + "CE = (T1-T3)/T1;# carnot efficiency\n", + "print ' (c) The carnot efficiency of the cycle is (percent) = ',round(CE*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9: pg 311" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 10.9\n", + " (a) The theoretical power/kg steam/s is (kW) = 1332.0\n", + " (b) The thermal efficiency of the cycle is (percent) = 35.9\n", + " (c) The thermal efficiency of the cycle if there is no heat is (percent) = 35.7\n" + ] + } + ], + "source": [ + "#pg 311\n", + "print('Example 10.9');\n", + "\n", + "# aim : To determine\n", + "# (a) the theoretical power of steam passing through the turbine\n", + "# (b) the thermal efficiency of the cycle\n", + "# (c) the thermal efficiency of the cycle assuming there is no reheat\n", + "\n", + "# given values\n", + "P1 = 6;# initial pressure, [MN/m^2]\n", + "T1 = 450;# initial temperature, [C]\n", + "P2 = 1;# pressure at stage 1, [MN/m^2]\n", + "P3 = 1;# pressure at stage 2, [MN/m^2]\n", + "T3 = 370;# temperature, [C]\n", + "P4 = .02;# pressure at stage 3, [MN/m^2]\n", + "P5 = .02;# pressure at stage 4, [MN/m^2]\n", + "T5 = 320;# temperature, [C]\n", + "P6 = .02;# pressure at stage 5, [MN/m^2]\n", + "P7 = .02;# final pressure , [MN/m^2]\n", + "\n", + "# solution\n", + "# (a) \n", + "# using Fig 10.21\n", + "h1 = 3305.;# specific enthalpy, [kJ/kg]\n", + "h2 = 2850.;# specific enthalpy, [kJ/kg]\n", + "h3 = 3202.;# specific enthalpy, [kJ/kg]\n", + "h4 = 2810.;# specific enthalpy, [kJ/kg]\n", + "h5 = 3115.;# specific enthalpy, [kJ/kg]\n", + "h6 = 2630.;# specific enthalpy, [kJ/kg]\n", + "h7 = 2215.;# specific enthalpy, [kJ/kg]\n", + "W = (h1-h2)+(h3-h4)+(h5-h6);# specific work through the turbine, [kJ/kg]\n", + "print ' (a) The theoretical power/kg steam/s is (kW) = ',W\n", + "\n", + "# (b)\n", + "# from steam table\n", + "hf6 = 251.5;# [kJ/kg]\n", + "\n", + "TE1 = ((h1-h2)+(h3-h4)+(h5-h6))/((h1-hf6)+(h3-h2)+(h5-h4));# thermal efficiency\n", + "print ' (b) The thermal efficiency of the cycle is (percent) = ',round(TE1*100,1)\n", + "\n", + "# (c)\n", + "# if there is no heat\n", + "hf7 = hf6;\n", + "TE2 = (h1-h7)/(h1-hf7);# thermal efficiency\n", + "print ' (c) The thermal efficiency of the cycle if there is no heat is (percent) = ',round(TE2*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10: pg 313" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 10.10\n", + " (a) The mass of steam bled in feed heater 1 is (kg/kg supply steam) = 0.109\n", + " The mass of steam bled in feed heater 2 is (kg/kg supply steam) = 0.106\n", + " (b) The thermal efficiency of the arrangement is (percent) = 31.6\n", + " The thermal efficiency if there is no feed heating is (percent) = 27.8\n" + ] + } + ], + "source": [ + "#pg 313\n", + "print('Example 10.10');\n", + "\n", + "# aim : To determine\n", + "# (a) the mass of steam bled to each feed heater in kg/kg of supply steam\n", + "# (b) the thermal efficiency of the arrangement\n", + "\n", + "# given values\n", + "P1 = 7.;# steam initial pressure, [MN/m^2]\n", + "T1 = 273.+500;# steam initil temperature, [K]\n", + "P2 = 2.;# pressure at stage 1, [MN/m^2]\n", + "P3 = .5;# pressure at stage 2, [MN/m^2]\n", + "P4 = .05;# condenser pressure,[MN/m^2]\n", + "SE = .82;# stage efficiency of turbine\n", + "\n", + "# solution\n", + "# from the enthalpy-entropy chart(Fig10.23) values of specific enthalpies are\n", + "h1 = 3410.;# [kJ/kg]\n", + "h2_prim = 3045.;# [kJ/kg]\n", + "# h1-h2=SE*(h1-h2_prim), so\n", + "h2 = h1-SE*(h1-h2_prim);# [kJ/kg]\n", + "\n", + "h3_prim = 2790.;# [kJ/kg]\n", + "# h2-h3=SE*(h2-h3_prim), so\n", + "h3 = h2-SE*(h2-h3_prim);# [kJ/kg]\n", + "\n", + "h4_prim = 2450;# [kJ/kg]\n", + "# h3-h4 = SE*(h3-h4_prim), so\n", + "h4 = h3-SE*(h3-h4_prim);# [kJ/kg]\n", + "\n", + "# from steam table\n", + "# @ 2 MN/m^2\n", + "hf2 = 908.6;# [kJ/kg]\n", + "# @ .5 MN/m^2\n", + "hf3 = 640.1;# [kJ/kg] \n", + "# @ .05 MN/m^2\n", + "hf4 = 340.6;# [kJ/kg]\n", + "\n", + "# (a) \n", + "# for feed heater1\n", + "m1 = (hf2-hf3)/(h2-hf3);# mass of bled steam, [kg/kg supplied steam]\n", + "# for feed heater2\n", + "m2 = (1-m1)*(hf3-hf4)/(h3-hf4);# \n", + "print ' (a) The mass of steam bled in feed heater 1 is (kg/kg supply steam) = ',round(m1,3)\n", + "print ' The mass of steam bled in feed heater 2 is (kg/kg supply steam) = ',round(m2,3)\n", + "\n", + "# (b)\n", + "W = (h1-h2)+(1-m1)*(h2-h3)+(1-m1-m2)*(h3-h4);# theoretical work done, [kJ/kg]\n", + "Eb = h1-hf2;# energy input in the boiler, [kJ/kg]\n", + "TE1 = W/Eb;# thermal efficiency\n", + "print ' (b) The thermal efficiency of the arrangement is (percent) = ',round(TE1*100,1)\n", + "\n", + "# If there is no feed heating\n", + "hf5 = hf4;\n", + "h5_prim = 2370;# [kJ/kg]\n", + "# h1-h5 = SE*(h1-h5_prim), so\n", + "h5 = h1-SE*(h1-h5_prim);# [kJ/kg]\n", + "Ei = h1-hf5;#energy input, [kJ/kg]\n", + "W = h1-h5;# theoretical work, [kJ/kg]\n", + "TE2 = W/Ei;# thermal efficiency\n", + "print ' The thermal efficiency if there is no feed heating is (percent) = ',round(TE2*100,1)\n", + "\n", + "# End \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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter11.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter11.ipynb new file mode 100644 index 00000000..6707db42 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter11.ipynb @@ -0,0 +1,678 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11 - The steam engine" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 326" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 11.1\n", + " (a) The bore of the cylinder is (mm) = 239.0\n", + " (b) The piston stroke is (mm) = 299.0\n", + " (c) The speed of the engine is (rev/min) = 301.1\n" + ] + } + ], + "source": [ + "#pg 326\n", + "print('Example 11.1')\n", + "import math\n", + "# aim : To determine the \n", + "# (a) bore of the cylinder\n", + "# (b) piston stroke\n", + "# (c) speed of the engine\n", + "\n", + "# Given values\n", + "P_req = 60.;# power required to develop, [kW]\n", + "P = 1.25;# boiler pressure, [MN/m^2]\n", + "Pb = .13;# back pressure, [MN/m^2]\n", + "cut_off = .3;# [stroke]\n", + "k = .82;# diagram factor\n", + "n = .78;# mechanical efficiency\n", + "LN = 3.;# mean piston speed, [m/s]\n", + "\n", + "# solution\n", + "# (a)\n", + "r = 1/cut_off;# expansion ratio\n", + "Pm = P/r*(1+math.log(r))-Pb;# mean effective pressure, [MN/m^2]\n", + "P_ind = P_req/n;# Actual indicated power developed, [kW]\n", + "P_the = P_ind/k;# Theoretical indicated power developed, [kW]\n", + "\n", + "# using indicated_power=Pm*LN*A\n", + "# Hence\n", + "A = P_the/(Pm*LN)*10**-3;# piston area,[m^2]\n", + "d = math.sqrt(4*A/math.pi)*10**3;# bore ,[mm]\n", + "print ' (a) The bore of the cylinder is (mm) = ',round(d)\n", + "\n", + "# (b)\n", + "# given that stroke is 1.25 times bore\n", + "L = 1.25*d;# [mm]\n", + "print ' (b) The piston stroke is (mm) = ',round(L)\n", + "\n", + "# (c)\n", + "# LN=mean piston speed, where L is stroke in meter and N is 2*rev/s,(since engine is double_acting)\n", + "# hence\n", + "rev_per_sec = LN/(2*L*10**-3);# [rev/s]\n", + "\n", + "rev_per_min = rev_per_sec*60;# [rev/min]\n", + "print ' (c) The speed of the engine is (rev/min) = ',round(rev_per_min,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 328" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 11.2\n", + " (a) The diameter of the cylinder is (mm) = 189.0\n", + " (b) The piston stroke is (mm) = 227.2\n", + " (c) The actual steam consumption/h is (kg) = 514.3\n", + " The indicated thermal efficiency is (percent) = 6.8\n", + "The answers are a bit different due to rounding off error in textbook\n" + ] + } + ], + "source": [ + "#pg 328\n", + "print('Example 11.2')\n", + "import math\n", + "# aim : To determine the \n", + "# (a) the diameter of the cylinder\n", + "# (b) piston stroke\n", + "# (c) actual steam consumption and indicated thermal efficiency\n", + "\n", + "# Given values\n", + "P = 900.;# inlet pressure, [kN/m^2]\n", + "Pb = 140.;# exhaust pressure, [kN/m^2]\n", + "cut_off =.4;# [stroke]\n", + "k = .8;# diagram factor\n", + "rs = 1.2;# stroke to bore ratio\n", + "N = 4.;# engine speed, [rev/s]\n", + "ip = 22.5;# power output from the engine, [kW]\n", + "\n", + "# solution\n", + "# (a)\n", + "r = 1/cut_off;# expansion ratio\n", + "Pm = P/r*(1+math.log(r))-Pb;# mean effective pressure, [kN/m^2]\n", + "Pm = Pm*k;# actual mean effective pressure, [kN/m^2]\n", + "\n", + "# using ip=Pm*L*A*N\n", + "# and L=r*d; where L is stroke and d is bore\n", + "d = (ip/(Pm*rs*math.pi/4.*2*N))**(1./3);# diameter of the cylinder, [m]\n", + "\n", + "print ' (a) The diameter of the cylinder is (mm) = ',round(d*1000)\n", + "\n", + "# (b)\n", + "L = rs*d;# stroke, [m]\n", + "print ' (b) The piston stroke is (mm) = ',round(L*1000,1)\n", + "\n", + "# (c)\n", + "SV = math.pi/4*d**2*L;# stroke volume, [m^3]\n", + "V = SV*cut_off*2*240*60;# volume of steam consumed per hour, [m^3]\n", + "v = .2148;# specific volume at 900 kN/m^2, [m^3/kg]\n", + "SC = V/v;# steam consumed/h, [kg]\n", + "ASC = 1.5*SC;# actual steam consumption/h, [kg]\n", + "print ' (c) The actual steam consumption/h is (kg) = ',round(ASC,1)\n", + "\n", + "m_dot = ASC/3600.;# steam consumption,[kg/s] \n", + "# from steam table\n", + "hg = 2772.1;# specific enthalpy of inlet steam, [kJ/kg]\n", + "hfe = 458.4;# specific liquid enthalpy at exhaust pressure, [kJ/kg]\n", + "\n", + "ITE = ip/(m_dot*(hg-hfe));# indicated thermal efficiency\n", + "print ' The indicated thermal efficiency is (percent) = ',round(ITE*100,1)\n", + "\n", + "print 'The answers are a bit different due to rounding off error in textbook'\n", + "# End\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 330" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 11.3\n", + " (a) The diagram factor is = 0.85\n", + " (b) The indicated thermal efficiency is (percent) = 15.0\n" + ] + } + ], + "source": [ + "#pg 330\n", + "print('Example 11.3');\n", + "\n", + "# aim : To determine\n", + "# (a) the diagram factor\n", + "# (b) the indicated thermal efficiency of the engine\n", + "import math\n", + "# given values\n", + "d = 250.*10**-3;# cylinder diameter, [m]\n", + "L = 375.*10**-3;# length of stroke, [m]\n", + "P = 1000.;# steam pressure , [kPa]\n", + "x = .96;# dryness fraction of steam\n", + "Pb = 55;# exhaust pressure, [kPa]\n", + "r = 6.;# expansion ratio\n", + "ip = 45.;# indicated power developed, [kW]\n", + "N = 3.5;# speed of engine, [rev/s]\n", + "m = 460.;# steam consumption, [kg/h]\n", + "\n", + "# solution\n", + "# (a)\n", + "Pm = P/r*(1+math.log(r))-Pb;# [kN/m**3]\n", + "A = math.pi*(d)**2/4;# area, [m**2]\n", + "tip = Pm*L*A*N*2;# theoretical indicated power, [kW]\n", + "k = ip/tip;# diagram factor\n", + "print ' (a) The diagram factor is = ',round(k,2)\n", + "\n", + "# (b)\n", + "# from steam table at 1 MN/m**2\n", + "hf = 762.6;# [kJ/kg]\n", + "hfg = 2013.6;# [kJ/kg]\n", + "# so \n", + "h1 = hf+x*hfg;# specific enthalpy of steam at 1MN/m**2, [kJ/kg]\n", + "# minimum specific enthalpy in engine at 55 kPa \n", + "hf = 350.6;# [kJ/kg]\n", + "# maximum energy available in engine is\n", + "h = h1-hf;# [kJ/kg]\n", + "ITE = ip/(m*h/3600)*100;# indicated thermal efficiency\n", + "print ' (b) The indicated thermal efficiency is (percent) = ',round(ITE)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 333" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 11.4\n", + "The steam consumption is (kg/h) = 213.0\n" + ] + } + ], + "source": [ + "#pg 333\n", + "print('Example 11.4');\n", + "\n", + "# aim : To determine\n", + "# steam consumption\n", + "\n", + "# given values\n", + "P1 = 11.;# power, [kW]\n", + "m1 = 276.;# steam use/h when developing power P1,[kW]\n", + "ip = 8.;# indicated power output, [kW]\n", + "B = 45.;# steam used/h at no load, [kg]\n", + "\n", + "# solution\n", + "# using graph of Fig.11.9 \n", + "A = (m1-B)/P1;# slop of line, [kg/kWh]\n", + "W = A*ip+B;# output, [kg/h]\n", + "#results\n", + "print 'The steam consumption is (kg/h) = ',W\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 338" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 11.5\n", + " (a) The intermediate pressure is (kN/m^2) = 455.0\n", + " (b) The indicated power is (kW) = 110.5\n", + " (c) The steam consumption of the engine is (kg/h) = 1016.0\n" + ] + } + ], + "source": [ + "#pg 338\n", + "print('Example 11.5');\n", + "from scipy.optimize import brentq\n", + "# aim : To determine\n", + "# (a) the intermediate pressure\n", + "# (b) the indicated power output\n", + "# (c) the steam consumption of the engine\n", + "import math\n", + "# given values\n", + "P1 = 1400.;# initial pressure, [kN/m**2]\n", + "x = .9;# dryness fraction\n", + "P5 = 35.;# exhaust pressure\n", + "k = .8;# diagram factor of low-pressure cylindaer\n", + "L = 350.*10**-3;# stroke of both the cylinder, [m]\n", + "dhp = 200.*10**-3;# diameter of high pressure cylinder, [m]\n", + "dlp = 300.*10**-3;# diameter of low-pressure cylinder, [m]\n", + "N = 300.;# engine speed, [rev/min]\n", + "\n", + "# solution\n", + "# taking reference Fig.11.13\n", + "Ahp = math.pi/4*dhp**2;# area of high-pressure cylinder, [m**2]\n", + "Alp = math.pi/4*dlp**2;# area of low-pressure cylinder, [m**2]\n", + "# for equal initial piston loads\n", + "# (P1-P7)Ahp=(P7-P5)Alp\n", + "def f(P7):\n", + "\treturn (P1-P7)*Ahp - (P7-P5)*Alp\n", + "#deff('[x]=f(P7)','x=(P1-P7)*Ahp-(P7-P5)*Alp');\n", + "P7 = brentq(f,0,1000);# intermediate pressure, [kN/m**2]\n", + "print ' (a) The intermediate pressure is (kN/m^2) = ',P7\n", + "\n", + "# (b)\n", + "V6 = Ahp*L;# volume of high-pressure cylinder, [m**3]\n", + "P2 = P1;\n", + "P6 = P7;\n", + "# using P2*V2=P6*V6\n", + "V2 = P6*V6/P2; # [m**3]\n", + "V1 = Alp*L;# volume of low-pressure cylinder, [m**3]\n", + "R = V1/V2;# expansion ratio\n", + "Pm = P1/R*(1+math.log(R))-P5;# effective pressure of low-pressure cylinder, [kn/m**2]\n", + "Pm = k*Pm;# actual effective pressure, [kN/m**2]\n", + "ip = Pm*L*Alp*N*2/60.;# indicated power, [kW]\n", + "print ' (b) The indicated power is (kW) = ',round(ip,1)\n", + "\n", + "# (c) \n", + "COV = V1/ R;# cut-off volume in high-pressure cylinder, [m**3]\n", + "V = COV*N*2*60;# volume of steam admitted/h\n", + "# from steam table\n", + "vg = .1407;# [m**3/kg]\n", + "AV = x*vg;# specific volume of admission steam, [m**3/kg]\n", + "m = V/AV;# steam consumption, [kg/h]\n", + "print ' (c) The steam consumption of the engine is (kg/h) = ',round(m)\n", + "\n", + "# End \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 340" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 11.6\n", + " (a) The indicated power is (kW) = 440.0\n", + " (b) The diameter of high-pressure cylinder is (mm) = 383.0\n", + " (c) The intermediate opressure is (kN/m^2) = 338.0\n" + ] + } + ], + "source": [ + "#pg 340\n", + "print('Example 11.6');\n", + "\n", + "# aim : To determine\n", + "# (a) the indicated power output\n", + "# (b) the diameter of high-pressure cylinder of the engine\n", + "# (c) the intermediate pressure\n", + "import math\n", + "from math import sqrt, exp, log, pi\n", + "# given values\n", + "P = 1100.;# initial pressure, [kN/m**2]\n", + "Pb = 28.;# exhaust pressure\n", + "k = .82;# diagram factor of low-pressure cylindaer\n", + "L = 600.*10**-3;# stroke of both the cylinder, [m]\n", + "dlp = 600.*10**-3;# diameter of low-pressure cylinder, [m]\n", + "N = 4.;# engine speed, [rev/s]\n", + "R = 8.;# expansion ratio\n", + "\n", + "# solution\n", + "# taking reference Fig.11.13\n", + "# (a)\n", + "Pm = P/R*(1+log(R))-Pb;# effective pressure of low-pressure cylinder, [kn/m**2]\n", + "Pm = k*Pm;# actual effective pressure, [kN/m**2]\n", + "Alp = pi/4*dlp**2;# area of low-pressure cylinder, [m**2]\n", + "ip = Pm*L*Alp*N*2;# indicated power, [kW]\n", + "print ' (a) The indicated power is (kW) = ',round(ip)\n", + "\n", + "# (b)\n", + "# work done by both cylinder is same as area of diagram\n", + "w = Pm*Alp*L;# [kJ]\n", + "W = w/2;# work done/cylinder, [kJ]\n", + "V2 = Alp*L/8;# volume, [m63]\n", + "P2 = P;# [kN/m**2]\n", + "# using area A1267=P2*V2*log(V6/V2)=W\n", + "V6 = V2*exp(W/(P2*V2));# intermediate volume, [m**3]\n", + "# using Ahp*L=%pi/4*dhp**2*L=V6\n", + "dhp = sqrt(V6*4/L/pi);# diameter of high-pressure cylinder, [m]\n", + "print ' (b) The diameter of high-pressure cylinder is (mm) = ',round(dhp*1000)\n", + "\n", + "# (c)\n", + "# using P2*V2=P6*V6\n", + "P6 = P2*V2/V6; # intermediate pressure, [kN/m**2]\n", + "print ' (c) The intermediate opressure is (kN/m^2) = ',round(P6)\n", + "\n", + "# End \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7: pg 342" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 11.7\n", + " (a) The engine speed is (rev/s) = 6.52\n", + " (b) The diameter of the high pressure cylinder is (mm) = 179.0\n" + ] + } + ], + "source": [ + "#pg 342\n", + "print('Example 11.7');\n", + "\n", + "# aim : To determine\n", + "# (a) The speed of the engine\n", + "# (b) the diameter of the high pressure cylinder\n", + "import math\n", + "from math import sqrt,log, exp,pi\n", + "# given values\n", + "ip = 230.;# indicated power, [kW]\n", + "P = 1400.;# admission pressure, [kN/m**2]\n", + "Pb = 35.;# exhaust pressure, [kN/m**2]\n", + "R = 12.5;# expansion ratio\n", + "d1 = 400.*10**-3;# diameter of low pressure cylinder, [m]\n", + "L = 500.*10**-3;# stroke of both the cylinder, [m]\n", + "k = .78;# diagram factor\n", + "rv = 2.5;# expansion ratio of high pressure cylinder\n", + "\n", + "# solution\n", + "# (a)\n", + "Pm = P/R*(1+log(R))-Pb;# mean effective pressure in low pressure cylinder, [kN/m**2]\n", + "ipt = ip/k;# theoretical indicated power, [kw]\n", + "# using ip=Pm*L*A*N\n", + "A = pi/4*d1**2;# area , [m**2]\n", + "N = ipt/(Pm*L*A*2);# speed, [rev/s]\n", + "print ' (a) The engine speed is (rev/s) = ',round(N,2)\n", + "\n", + "# (b)\n", + "Vl = A*L;# volume of low pressure cylinder, [m**3]\n", + "COV = Vl/R;# cutt off volume of hp cylinder, [m**3]\n", + "V = COV*rv;# total volume, [m**3]\n", + "\n", + "# V = %pi/4*d**2*L, so\n", + "d = sqrt(4*V/pi/L);# diameter of high pressure cylinder, [m]\n", + "print ' (b) The diameter of the high pressure cylinder is (mm) = ',round(d*1000)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8: pg 344" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 11.8\n", + " (a) The actual mean effective pressure referred to LP cylinder is (kN/m^2) = 234.1\n", + " The hypothetical mean effective pressure referred to LP cylinder is (kN/m^2) = 287.0\n", + " (b) The overall diagram factor is = 0.814\n", + " (c) The indicated power is (kW) = 143.0\n" + ] + } + ], + "source": [ + "#pg 344\n", + "print('Example 11.8');\n", + "\n", + "# aim : To determine\n", + "# (a) the actual and hypothetical mean effective pressures referred to the low-pressure cylinder\n", + "# (b) the overall diagram factor\n", + "# (c) the indicated power \n", + "import math\n", + "from math import pi,sqrt,log\n", + "# given values\n", + "P = 1100.;# steam supply pressure, [kN/m**2]\n", + "Pb = 32.;# back pressure, [kN/m**2]\n", + "d1 = 300.*10**-3;# cylinder1 diameter, [m]\n", + "d2 = 600.*10**-3;# cylinder2 diameter, [m]\n", + "L = 400.*10**-3;# common stroke of both cylinder, [m]\n", + "\n", + "A1 = 12.5;# average area of indicated diagram for HP, [cm**2]\n", + "A2 = 11.4;# average area of indicated diagram for LP, [cm**2]\n", + "\n", + "P1 = 270.;# indicator calibration, [kN/m**2/ cm]\n", + "P2 = 80.;# spring calibration, [kN/m**2/ cm]\n", + "N = 2.7;# engine speed, [rev/s]\n", + "l = .75;# length of both diagram, [m]\n", + "\n", + "# solution\n", + "# (a)\n", + "# for HP cylinder\n", + "Pmh = P1*A1/7.5;# [kN/m**2]\n", + "F = Pmh*pi/4*d1**2;# force on HP, [kN]\n", + "PmH = Pmh*(d1/d2)**2;# pressure referred to LP cylinder, [kN/m**2]\n", + "PmL = P2*A2/7.5;# pressure for LP cylinder, [kN/m**2]\n", + "PmA = PmH+PmL;# actual effective pressure referred to LP cylinder, [kN/m**2]\n", + "\n", + "Ah = pi/4*d1**2;# area of HP cylinder, [m**2]\n", + "Vh = Ah*L;# volume of HP cylinder, [m**3]\n", + "CVh = Vh/3;# cut-off volume of HP cylinder, [m**3]\n", + "Al = pi/4*d2**2;# area of LP cylinder, [m**2]\n", + "Vl = Al*L;# volume of LP cylinder, [m**3]\n", + "\n", + "R = Vl/CVh;# expansion ratio\n", + "Pm = P/R*(1+log(R))-Pb;# hypothetical mean effective pressure referred to LP cylinder, [kN/m**2]\n", + "\n", + "print ' (a) The actual mean effective pressure referred to LP cylinder is (kN/m^2) = ',PmA\n", + "print ' The hypothetical mean effective pressure referred to LP cylinder is (kN/m^2) = ',round(Pm)\n", + "\n", + "# (a)\n", + "ko = PmA/Pm;# overall diagram factor\n", + "print ' (b) The overall diagram factor is = ',round(ko,3)\n", + "\n", + "# (c) \n", + "ip = PmA*L*Al*N*2;# indicated power, [kW]\n", + "print ' (c) The indicated power is (kW) = ',round(ip)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9: pg 345" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 11.9\n", + " (a) The actual mean effective pressure referred to LP cylinder is (kN/m^2) = 219.6\n", + " The hypothetical mean effective pressure referred to LP cylinder is (kN/m^2) = 326.0\n", + " (b) The overall diagram factor is = 0.673\n", + " (c) The pecentage of the total indicated power developed in HP cylinder is (percent) = 29.9\n", + " The pecentage of the total indicated power developed in IP cylinder is (percent) = 30.1\n", + " The pecentage of the total indicated power developed in LP cylinder is (percent) = 40.1\n" + ] + } + ], + "source": [ + "#pg 345\n", + "print('Example 11.9');\n", + "\n", + "# aim : To determine\n", + "# (a) the actual and hypothetical mean effective pressures referred to the low-pressure cylinder\n", + "# (b) the overall diagram factor\n", + "# (c) the pecentage of the total indicated power developed in each cylinder\n", + "from math import pi,log,sqrt\n", + "# given values\n", + "P = 1400.;# steam supply pressure, [kN/m**2]\n", + "Pb = 20.;# back pressure, [kN/m**2]\n", + "Chp = .6;# cut-off in HP cylinder, [stroke]\n", + "dh = 300.*10**-3;# HP diameter, [m]\n", + "di = 500.*10**-3;# IP diameter, [m]\n", + "dl = 900.*10**-3;# LP diameter, [m]\n", + "\n", + "Pm1 = 590.;# actual pressure of HP cylinder, [kN/m**2]\n", + "Pm2 = 214.;# actual pressure of IP cylinder, [kN/m**2]\n", + "Pm3 = 88.;# actual pressure of LP cylinder, [kN/m**2]\n", + "\n", + "# solution\n", + "# (a)\n", + "# for HP cylinder\n", + "PmH = Pm1*(dh/dl)**2;# PmH referred to LP cylinder, [kN/m**2]\n", + "# for IP cylinder\n", + "PmI = Pm2*(di/dl)**2;# PmI referred to LP cylinder, [kN/m**2]\n", + "PmA = PmH+PmI+Pm3;# actual mean effective pressure referred to LP cylinder, [kN/m**2]\n", + "\n", + "R = dl**2/(dh**2*Chp);# expansion ratio\n", + "Pm = P/R*(1+log(R))-Pb;# hypothetical mean effective pressure referred to LP cylinder, [kN/m**2]\n", + "\n", + "print ' (a) The actual mean effective pressure referred to LP cylinder is (kN/m^2) = ',round(PmA,2)\n", + "print ' The hypothetical mean effective pressure referred to LP cylinder is (kN/m^2) = ',round(Pm)\n", + "\n", + "# (b)\n", + "ko = PmA/Pm;# overall diagram factor\n", + "print ' (b) The overall diagram factor is = ',round(ko,3)\n", + "\n", + "# (c)\n", + "HP = PmH/PmA*100;# %age of indicated power developed in HP\n", + "IP = PmI/PmA*100; # %age of indicated power developed in IP\n", + "LP = Pm3/PmA*100; # %age of indicated power developed in LP\n", + "print ' (c) The pecentage of the total indicated power developed in HP cylinder is (percent) = ',round(HP,1)\n", + "print ' The pecentage of the total indicated power developed in IP cylinder is (percent) = ',round(IP,1)\n", + "print ' The pecentage of the total indicated power developed in LP cylinder is (percent) = ',round(LP,1)\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter12.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter12.ipynb new file mode 100644 index 00000000..a3a87a85 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter12.ipynb @@ -0,0 +1,315 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12 - Nozzles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 361" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 12.1\n", + " (a) The throat area is (mm^2) = 255.0\n", + " (b) The exit area is (mm^2) = 344.0\n", + " (c) The Mach number at exit is = 1.49\n" + ] + } + ], + "source": [ + "#pg 361\n", + "print('Example 12.1');\n", + "\n", + "# aim : To determine the\n", + "# (a) throat area\n", + "# (b) exit area\n", + "# (c) Mach number at exit\n", + "from math import sqrt\n", + "# Given values\n", + "P1 = 3.5;# inlet pressure of air, [MN/m**2]\n", + "T1 = 273+500;# inlet temperature of air, [MN/m**2]\n", + "P2 = .7;# exit pressure, [MN/m**2]\n", + "m_dot = 1.3;# flow rate of air, [kg/s]\n", + "Gamma = 1.4;# heat capacity ratio\n", + "R = .287;# [kJ/kg K]\n", + "\n", + "# solution\n", + "# given expansion may be considered to be adiabatic and to follow the law PV**Gamma=constant\n", + "# using ideal gas law\n", + "v1 = R*T1/P1*10**-3;# [m**3/kg]\n", + "Pt = P1*(2/(Gamma+1))**(Gamma/(Gamma-1));# critical pressure, [MN/m**2]\n", + "\n", + "# velocity at throat is\n", + "Ct = sqrt(2*Gamma/(Gamma-1)*P1*10**6*v1*(1-(Pt/P1)**(((Gamma-1)/Gamma))));# [m/s]\n", + "vt = v1*(P1/Pt)**(1/Gamma);# [m**3/kg]\n", + "# using m_dot/At=Ct/vt\n", + "At = m_dot*vt/Ct*10**6;# throat area, [mm**2]\n", + "print ' (a) The throat area is (mm^2) = ',round(At)\n", + "\n", + "# (b)\n", + "# at exit\n", + "C2 = sqrt(2*Gamma/(Gamma-1)*P1*10**6*v1*(1-(P2/P1)**(((Gamma-1)/Gamma))));# [m/s]\n", + "v2 = v1*(P1/P2)**(1/Gamma);# [m**3/kg]\n", + "A2 = m_dot*v2/C2*10**6;# exit area, [mm**2]\n", + "\n", + "print ' (b) The exit area is (mm^2) = ',round(A2)\n", + "\n", + "# (c)\n", + "M = C2/Ct;\n", + "print ' (c) The Mach number at exit is = ',round(M,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 362" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 12.2\n", + " The increase in pressure is (MN/m^2) = 2.44\n", + " Increase in temperature is (K) = 358.0\n", + " Increase in internal energy is (kJ/kg) = 257.0\n", + "there is minor variation in result due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 362\n", + "print('Example 12.2');\n", + "\n", + "# aim : To determine the increases in pressure, temperature and internal energy per kg of air\n", + "\n", + "# Given values\n", + "T1 = 273.;# [K]\n", + "P1 = 140.;# [kN/m**2]\n", + "C1 = 900.;# [m/s]\n", + "C2 = 300.;# [m/s]\n", + "cp = 1.006;# [kJ/kg K]\n", + "cv =.717;# [kJ/kg K]\n", + "\n", + "# solution\n", + "R = cp-cv;# [kJ/kg K]\n", + "Gamma = cp/cv;# heat capacity ratio\n", + "# for frictionless adiabatic flow, (C2**2-C1**2)/2=Gamma/(Gamma-1)*R*(T1-T2)\n", + "\n", + "T2 =T1-((C2**2-C1**2)*(Gamma-1)/(2*Gamma*R))*10**-3; # [K]\n", + "T_inc = T2-T1;# increase in temperature [K]\n", + "\n", + "P2 = P1*(T2/T1)**(Gamma/(Gamma-1));# [MN/m**2]\n", + "P_inc = (P2-P1)*10**-3;# increase in pressure,[MN/m**2]\n", + "\n", + "U_inc = cv*(T2-T1);# Increase in internal energy per kg,[kJ/kg]\n", + "#results\n", + "print ' The increase in pressure is (MN/m^2) = ',round(P_inc,2)\n", + "print ' Increase in temperature is (K) = ',round(T_inc)\n", + "print ' Increase in internal energy is (kJ/kg) = ',round(U_inc)\n", + "\n", + "print 'there is minor variation in result due to rounding off error'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 364" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 12.3\n", + " (a) The throat area is (mm^2) = 2888.0\n", + " The exit area is (mm^2) = 4282.0\n", + " (b) The Degree of undercooling at exit is (C) = 10.3\n", + " There is some rounding mistake in the book so answer is not matching\n" + ] + } + ], + "source": [ + "#pg 364\n", + "print('Example 12.3');\n", + "from math import sqrt\n", + "# aim : To determine the \n", + "# (a) throat and exit areas\n", + "# (b) degree of undercooling at exit\n", + "# Given values\n", + "P1 = 2.;# inlet pressure of air, [MN/m**2]\n", + "T1 = 273.+325;# inlet temperature of air, [MN/m**2]\n", + "P2 = .36;# exit pressure, [MN/m**2]\n", + "m_dot = 7.5;# flow rate of air, [kg/s]\n", + "n = 1.3;# polytropic index\n", + "\n", + "# solution\n", + "# (a)\n", + "# using steam table\n", + "v1 = .132;# [m**3/kg]\n", + "# given expansion following law PV**n=constant\n", + "\n", + "Pt = P1*(2/(n+1))**(n/(n-1));# critical pressure, [MN/m**2]\n", + "\n", + "#velocity at throat is\n", + "Ct = sqrt(2*n/(n-1)*P1*10**6*v1*(1-(Pt/P1)**(((n-1)/n))));# [m/s]\n", + "vt = v1*(P1/Pt)**(1/n);# [m**3/kg]\n", + "# using m_dot/At=Ct/vt\n", + "At = m_dot*vt/Ct*10**6;# throat area, [mm**2]\n", + "print ' (a) The throat area is (mm^2) = ',round(At)\n", + "\n", + "# at exit\n", + "C2 = sqrt(2*n/(n-1)*P1*10**6*v1*(1-(P2/P1)**(((n-1)/n))));# [m/s]\n", + "v2 = v1*(P1/P2)**(1/n);# [m**3/kg]\n", + "A2 = m_dot*v2/C2*10**6;# exit area, [mm**2]\n", + "\n", + "print ' The exit area is (mm^2) = ',round(A2)\n", + "\n", + "# (b)\n", + "T2 = T1*(P2/P1)**((n-1)/n);#outlet temperature, [K]\n", + "t2 = T2-273;#[C]\n", + "# at exit pressure saturation temperature is\n", + "ts = 139.9;# saturation temperature,[C]\n", + "Doc = ts-t2;# Degree of undercooling,[C]\n", + "print ' (b) The Degree of undercooling at exit is (C) = ',round(Doc,1)\n", + "\n", + "print' There is some rounding mistake in the book so answer is not matching'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 365" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 12.4\n", + " (a) The throat velocity is (m/s) = 548.0\n", + " The exit velocity is (m/s) = 800.0\n", + " (b) The throat area is (mm^2) = 3213.0\n", + " The throat area is (mm^2) = 6050.0\n" + ] + } + ], + "source": [ + "#pg 365\n", + "print('Example 12.4');\n", + "from math import sqrt\n", + "# aim : To determine the \n", + "# (a) throat and exit velocities\n", + "# (b) throat and exit areas\n", + "\n", + "# Given values\n", + "P1 = 2.2;# inlet pressure, [MN/m^2]\n", + "T1 = 273+260;# inlet temperature, [K]\n", + "P2 = .4;# exit pressure,[MN/m^2]\n", + "eff = .85;# efficiency of the nozzle after throat\n", + "m_dot = 11;# steam flow rate in the nozzle, [kg/s]\n", + "\n", + "# solution\n", + "# (a)\n", + "# assuming steam is following same law as previous question 12.3\n", + "Pt = .546*P1;# critical pressure,[MN/m^2]\n", + "# from Fig. 12.6\n", + "h1 = 2940;# [kJ/kg]\n", + "ht = 2790;# [kJ/kg]\n", + "\n", + "Ct = sqrt(2*(h1-ht)*10**3);# [m/s]\n", + "\n", + "# again from Fig. 12.6\n", + "h2_prime = 2590;# [kJ/kg]\n", + "# using eff = (ht-h2)/(ht-h2_prime)\n", + "\n", + "h2 = ht-eff*(ht-h2_prime); # [kJ/kg]\n", + "\n", + "C2 = sqrt(2*(h1-h2)*10**3);# [m/s]\n", + "\n", + "# (b)\n", + "# from chart\n", + "vt = .16;# [m^3/kg]\n", + "v2 = .44;# [m^3/kg]\n", + "# using m_dot*v=A*C\n", + "At = m_dot*vt/Ct*10**6;# throat area, [mm^2]\n", + "\n", + "A2 = m_dot*v2/C2*10**6;# throat area, [mm^2]\n", + "#results\n", + "print ' (a) The throat velocity is (m/s) = ',round(Ct)\n", + "print ' The exit velocity is (m/s) = ',C2\n", + "print ' (b) The throat area is (mm^2) = ',round(At)\n", + "print ' The throat area is (mm^2) = ',A2\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter13.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter13.ipynb new file mode 100644 index 00000000..72959a8f --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter13.ipynb @@ -0,0 +1,330 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 13 - Steam turbines" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 380" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 13.1\n", + " The power developed for a steam flow of 1 kg/s is (kW) = 52.8\n", + " The energy of steam finally leaving the wheel is (kW/kg) = 8.778\n" + ] + } + ], + "source": [ + "#pg 380\n", + "print('Example 13.1');\n", + "\n", + "# aim : To determine \n", + "# the power developed for a steam flow of 1 kg/s at the blades and the kinetic energy of the steam finally leaving the wheel\n", + "\n", + "# Given values\n", + "alfa = 20;# blade angle, [degree]\n", + "Cai = 375;# steam exit velocity in the nozzle,[m/s]\n", + "U = 165;# blade speed, [m/s]\n", + "loss = .15;# loss of velocity due to friction\n", + "\n", + "# solution\n", + "# using Fig13.12,\n", + "Cvw = 320;# change in velocity of whirl, [m/s]\n", + "cae = 132.5;# absolute velocity at exit, [m/s]\n", + "Pds = U*Cvw*10**-3;# Power developed for steam flow of 1 kg/s, [kW]\n", + "Kes = cae**2/2*10**-3;# Kinetic energy change of steam, [kW/kg] \n", + "\n", + "#results\n", + "print ' The power developed for a steam flow of 1 kg/s is (kW) = ',Pds\n", + "print ' The energy of steam finally leaving the wheel is (kW/kg) = ',round(Kes,3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 382" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 13.2\n", + " (a) The angle of blades is (degree) = 41.5\n", + " (b) The work done on the blade is (kW/kg) = 150.45\n", + " (c) The diagram efficiency is (percent) = 83.6\n", + " (d) The End-thrust is (N/kg) = -90\n" + ] + } + ], + "source": [ + "#pg 382\n", + "print('Example 13.2');\n", + "\n", + "# aim : To determine\n", + "# (a) the entry angle of the blades\n", + "# (b) the work done per kilogram of steam per second\n", + "# (c) the diagram efficiency\n", + "# (d) the end-thrust per kilogram of steam per second\n", + "\n", + "# given values\n", + "Cai = 600.;# steam velocity, [m/s]\n", + "sia = 25.;# steam inlet angle with blade, [degree]\n", + "U = 255.;# mean blade speed, [m/s]\n", + "sea = 30.;# steam exit angle with blade,[degree] \n", + "\n", + "# solution\n", + "# (a)\n", + "# using Fig.13.13(diagram for example 13.2)\n", + "eab = 41.5;# entry angle of blades, [degree]\n", + "print ' (a) The angle of blades is (degree) = ',eab\n", + "\n", + "# (b)\n", + "Cwi_plus_Cwe = 590;# velocity of whirl, [m/s]\n", + "W = U*(Cwi_plus_Cwe);# work done on the blade,[W/kg]\n", + "print ' (b) The work done on the blade is (kW/kg) = ',W*10**-3\n", + "\n", + "# (c)\n", + "De = 2*U*(Cwi_plus_Cwe)/Cai**2;# diagram efficiency \n", + "print ' (c) The diagram efficiency is (percent) = ',round(De*100,1)\n", + "\n", + "# (d)\n", + "# again from the diagram\n", + "Cfe_minus_Cfi = -90;# change invelocity of flow, [m/s]\n", + "Eth = Cfe_minus_Cfi;# end-thrust, [N/kg s]\n", + "print ' (d) The End-thrust is (N/kg) = ',Eth\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 384" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 13.3\n", + " (a) The power of turbine is (kW) = 806.625\n", + " (b) The diagram efficiency is (percent) = 78.7\n" + ] + } + ], + "source": [ + "#pg 384\n", + "print('Example 13.3');\n", + "\n", + "# aim : To determine\n", + "# (a) the power output of the turbine\n", + "# (b) the diagram efficiency\n", + "\n", + "# given values\n", + "U = 150.;# mean blade speed, [m/s]\n", + "Cai1 = 675.;# nozzle speed, [m/s]\n", + "na = 20.;# nozzle angle, [degree]\n", + "m_dot = 4.5;# steam flow rate, [kg/s]\n", + "\n", + "# solution\n", + "# from Fig. 13.15(diagram 13.3)\n", + "Cw1 = 915.;# [m/s]\n", + "Cw2 = 280.;# [m/s]\n", + "\n", + "# (a)\n", + "P = m_dot*U*(Cw1+Cw2);# power of turbine,[W]\n", + "print ' (a) The power of turbine is (kW) = ',P*10**-3\n", + "\n", + "# (b)\n", + "De = 2*U*(Cw1+Cw2)/Cai1**2;# diagram efficiency\n", + "print ' (b) The diagram efficiency is (percent) = ',round(De*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 386" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 13.4\n", + " (a) The power output of the stage is (MW) = 11.6\n", + " (b) The specific enthalpy drop in the stage is (kJ/kg) = 82.0\n", + " (c) The increase in relative velocity is (percent) = 52.2\n" + ] + } + ], + "source": [ + "#pg 386\n", + "print('Example 13.4');\n", + "import math\n", + "# aim : To determine\n", + "# (a) the power output of the stage\n", + "# (b) the specific enthalpy drop in the stage\n", + "# (c) the percentage increase in relative velocity in the moving blades due to expansion in the bladse\n", + "\n", + "# given values\n", + "N = 50.;# speed, [m/s]\n", + "d = 1.;# blade ring diameter, [m]\n", + "nai = 50.;# nozzle inlet angle, [degree]\n", + "nae = 30.;# nozzle exit angle, [degree]\n", + "m_dot = 600000.;# steam flow rate, [kg/h]\n", + "se = .85;# stage efficiency\n", + "\n", + "# solution\n", + "# (a)\n", + "U = math.pi*d*N;# mean blade speed, [m/s]\n", + "# from Fig. 13.17(diagram 13.4)\n", + "Cwi_plus_Cwe = 444;# change in whirl speed, [m/s]\n", + "P = m_dot*U*Cwi_plus_Cwe/3600;# power output of the stage, [W]\n", + "print ' (a) The power output of the stage is (MW) = ',round(P*10**-6,1)\n", + "\n", + "# (b)\n", + "h = U*Cwi_plus_Cwe/se;# specific enthalpy,[J/kg]\n", + "print ' (b) The specific enthalpy drop in the stage is (kJ/kg) = ',round(h*10**-3)\n", + "\n", + "# (c)\n", + "# again from diagram\n", + "Cri = 224.;# [m/s]\n", + "Cre = 341;# [m/s]\n", + "Iir = (Cre-Cri)/Cri;# increase in relative velocity\n", + "print ' (c) The increase in relative velocity is (percent) = ',round(Iir*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 389" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 13.5\n", + " (a) The blade height at this stage is (mm) = 65.0\n", + " (b) The power developed is (kW) = 218.7\n", + " (a) The specific enthalpy drop in the stage is (kJ/kg) = 19.059\n" + ] + } + ], + "source": [ + "#pg 389\n", + "print('Example 13.5');\n", + "\n", + "# aim : To determine\n", + "# (a) the blade height of the stage\n", + "# (b) the power developed in the stage\n", + "# (c) the specific enthalpy drop at the stage\n", + "from math import sqrt,pi\n", + "# given values\n", + "U = 60.;# mean blade speed, [m/s]\n", + "P = 350.;# steam pressure, [kN/m**2]\n", + "T = 175.;# steam temperature, [C]\n", + "nai = 30.;# stage inlet angle, [degree]\n", + "nae = 20.;# stage exit angle, [degree] \n", + "\n", + "# solution\n", + "# (a)\n", + "m_dot = 13.5;# steam flow rate, [kg/s]\n", + "# at given T and P\n", + "v = .589;# specific volume, [m**3/kg]\n", + "# given H=d/10, so\n", + "H = sqrt(m_dot*v/(pi*10*60));# blade height, [m]\n", + "print ' (a) The blade height at this stage is (mm) = ',round(H*10**3)\n", + "\n", + "# (b)\n", + "Cwi_plus_Cwe = 270;# change in whirl speed, [m/s]\n", + "P = m_dot*U*(Cwi_plus_Cwe);# power developed, [W]\n", + "print ' (b) The power developed is (kW) = ',P*10**-3\n", + "\n", + "# (c)\n", + "s = .85;# stage efficiency\n", + "h = U*Cwi_plus_Cwe/s;# specific enthalpy,[J/kg]\n", + "print ' (a) The specific enthalpy drop in the stage is (kJ/kg) = ',round(h*10**-3,3)\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter14.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter14.ipynb new file mode 100644 index 00000000..93b514ee --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter14.ipynb @@ -0,0 +1,552 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14 - Air and gas compressors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 400" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Example 14.1\n", + " (a) The free air delivered is (m^3/min) = 3.814\n", + " (b) The volumetric efficiency is (percent) = 80.9\n", + " (c) The air delivery temperature is (C) = 164.3\n", + " (d) The cycle power is (kW) = 14.0\n", + " (e) The isothermal efficiency neglecting clearence is (percent) = 81.3\n" + ] + } + ], + "source": [ + "#pg 400\n", + "print(' Example 14.1');\n", + "\n", + "# aim : To determine \n", + "# (a) the free air delivered\n", + "# (b) the volumetric efficiency\n", + "# (c) the air delivery temperature\n", + "# (d) the cycle power\n", + "# (e) the isothermal efficiency\n", + "from math import pi,log\n", + "# given values\n", + "d = 200.*10**-3;# bore, [m]\n", + "L = 300.*10**-3;# stroke, [m]\n", + "N = 500.;# speed, [rev/min]\n", + "n = 1.3;# polytropic index\n", + "P1 = 97.;# intake pressure, [kN/m**2]\n", + "T1 = 273.+20;# intake temperature, [K]\n", + "P3 = 550.;# compression pressure, [kN/m**2]\n", + "\n", + "# solution\n", + "# (a)\n", + "P4 = P1;\n", + "P2 = P3;\n", + "Pf = 101.325;# free air pressure, [kN/m**2]\n", + "Tf = 273+15;# free air temperature, [K]\n", + "SV = pi/4*d**2*L;# swept volume, [m**3]\n", + "V3 = .05*SV;# [m**3]\n", + "V1 = SV+V3;# [m**3]\n", + "V4 = V3*(P3/P4)**(1/n);# [m**3]\n", + "ESV = (V1-V4)*N;# effective swept volume/min, [m**3]\n", + "# using PV/T=constant\n", + "Vf = P1*ESV*Tf/(Pf*T1);# free air delivered, [m**3/min]\n", + "print ' (a) The free air delivered is (m^3/min) = ',round(Vf,3)\n", + "\n", + "# (b)\n", + "VE = Vf/(N*(V1-V3));# volumetric efficiency\n", + "print ' (b) The volumetric efficiency is (percent) = ',round(VE*100,1)\n", + "\n", + "# (c)\n", + "T2 = T1*(P2/P1)**((n-1)/n);# free air temperature, [K]\n", + "print ' (c) The air delivery temperature is (C) = ',round(T2-273,1)\n", + "\n", + "# (d)\n", + "CP = n/(n-1)*P1*(V1-V4)*((P2/P1)**((n-1)/n)-1)*N/60;# cycle power, [kW]\n", + "print ' (d) The cycle power is (kW) = ',round(CP)\n", + "\n", + "# (e)\n", + "# neglecting clearence\n", + "W = n/(n-1)*P1*V1*((P2/P1)**((n-1)/n)-1)\n", + "Wi = P1*V1*log(P2/P1);# isothermal efficiency\n", + "IE = Wi/W;# isothermal efficiency\n", + "print ' (e) The isothermal efficiency neglecting clearence is (percent) = ',round(IE*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 408" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Example 14.2\n", + " (a) The intermediate pressure is (MN/m^2) = 0.265\n", + " (b) The total volume of the HP cylinder is (litres) = 7.6\n", + " (c) The cycle power is (MW) = 43.0\n", + " there is rounding mistake in the book so answer is not matching\n" + ] + } + ], + "source": [ + "#pg 408\n", + "print(' Example 14.2');\n", + "\n", + "# aim : To determine \n", + "# (a) the intermediate pressure\n", + "# (b) the total volume of each cylinder\n", + "# (c) the cycle power\n", + "from math import sqrt\n", + "# given values\n", + "v1 = .2;# air intake, [m^3/s]\n", + "P1 = .1;# intake pressure, [MN/m^2]\n", + "T1 = 273.+16;# intake temperature, [K]\n", + "P3 = .7;# final pressure, [MN/m^2]\n", + "n = 1.25;# compression index\n", + "N = 10;# speed, [rev/s]\n", + "\n", + "# solution\n", + "# (a)\n", + "P2 = sqrt(P1*P3);# intermediate pressure, [MN/m^2]\n", + "print ' (a) The intermediate pressure is (MN/m^2) = ',round(P2,3)\n", + "\n", + "# (b)\n", + "V1 = v1/N;# total volume,[m^3]\n", + "# since intercooling is perfect so 2 lie on the isothermal through1, P1*V1=P2*V2\n", + "V2 = P1*V1/P2;# volume, [m^3]\n", + "print ' (b) The total volume of the HP cylinder is (litres) = ',round(V2*10**3,1)\n", + "\n", + "# (c)\n", + "CP = 2*n/(n-1)*P1*v1*((P2/P1)**((n-1)/n)-1);# cycle power, [MW]\n", + "print ' (c) The cycle power is (MW) = ',round(CP*10**3)\n", + "\n", + "print ' there is rounding mistake in the book so answer is not matching'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 409" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Example 14.3\n", + " (a) The intermediate pressure is P2 (bar) = 2.466\n", + " The intermediate pressure is P3 (bar) = 6.082\n", + " (b) The effective swept volume of the LP cylinder is (litres) = 45.32\n", + " (c) The delivery temperature is (C) = 85.4\n", + " The delivery volume is (litres) = 3.72\n", + " (d) The work done per kilogram of air is (kJ) = 254.1\n", + "The answer is a bit different due to rounding off error in textbook\n" + ] + } + ], + "source": [ + "#pg 409\n", + "print(' Example 14.3');\n", + "\n", + "# aim : To determine \n", + "# (a) the intermediate pressures\n", + "# (b) the effective swept volume of the LP cylinder\n", + "# (c) the temperature and the volume of air delivered per stroke at 15 bar\n", + "# (d) the work done per kilogram of air\n", + "import math\n", + "# given values\n", + "d = 450.*10**-3;# bore , [m]\n", + "L = 300.*10**-3;# stroke, [m]\n", + "cl = .05;# clearence\n", + "P1 = 1.; # intake pressure, [bar]\n", + "T1 = 273.+18;# intake temperature, [K]\n", + "P4 = 15.;# final delivery pressure, [bar]\n", + "n = 1.3;# compression and expansion index\n", + "R = .29;# gas constant, [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "k=(P4/P1)**(1./3); \n", + "# hence\n", + "P2 = k*P1;# intermediare pressure, [bar]\n", + "P3 = k*P2;# intermediate pressure, [bar]\n", + "\n", + "print ' (a) The intermediate pressure is P2 (bar) = ',round(P2,3)\n", + "print ' The intermediate pressure is P3 (bar) = ',round(P3,3)\n", + "\n", + "# (b)\n", + "SV = math.pi*d**2/4*L;# swept volume of LP cylinder, [m**3]\n", + "# hence\n", + "V7 = cl*SV;# volume, [m**3]\n", + "V1 = SV+V7;# volume, [m**3]\n", + "# also\n", + "P7 = P2;\n", + "P8 = P1;\n", + "V8 = V7*(P7/P8)**(1/n);# volume, [m**3]\n", + "ESV = V1-V8;# effective swept volume of LP cylinder, [m**3]\n", + "\n", + "print ' (b) The effective swept volume of the LP cylinder is (litres) = ',round(ESV*10**3,2)\n", + "\n", + "# (c)\n", + "T9 = T1;\n", + "P9 = P3;\n", + "T4 = T9*(P4/P9)**((n-1)/n);# delivery temperature, [K]\n", + "# now using P4*(V4-V5)/T4=P1*(V1-V8)/T1\n", + "V4_minus_V5 = P1*T4*(V1-V8)/(P4*T1);# delivery volume, [m**3]\n", + " \n", + "print ' (c) The delivery temperature is (C) = ',round(T4-273,1)\n", + "print ' The delivery volume is (litres) = ',round(V4_minus_V5*10**3,2)\n", + "\n", + "# (d)\n", + "\n", + "W = 3*n*R*T1*((P2/P1)**((n-1)/n)-1)/(n-1);# work done/kg ,[kJ]\n", + "print ' (d) The work done per kilogram of air is (kJ) = ',round(W,1)\n", + " \n", + "print 'The answer is a bit different due to rounding off error in textbook'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 416" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Example 14.4\n", + " (a) The final temperature is (C) = 221.0\n", + " (b) The final pressure is (kN/m^2) = 500.0\n", + " (b) The energy required to drive the compressor is (kW) = -2023.0\n", + "The negative sign indicates energy input\n", + "The answer is a bit different due to rounding off error in textbook\n" + ] + } + ], + "source": [ + "#pg 416\n", + "print(' Example 14.4');\n", + "\n", + "# aim : To determine \n", + "# (a) the final pressure and temperature\n", + "# (b) the energy required to drive the compressor\n", + "\n", + "# given values\n", + "rv = 5.;# pressure compression ratio\n", + "m_dot = 10.;# air flow rate, [kg/s]\n", + "P1 = 100.;# initial pressure, [kN/m**2]\n", + "T1 = 273.+20;# initial temperature, [K]\n", + "n_com = .85;# isentropic efficiency of compressor\n", + "Gama = 1.4;# heat capacity ratio\n", + "cp = 1.005;# specific heat capacity, [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "T2_prim = T1*(rv)**((Gama-1)/Gama);# temperature after compression, [K]\n", + "# using isentropic efficiency=(T2_prim-T1)/(T2-T1)\n", + "T2 = T1+(T2_prim-T1)/n_com;# final temperature, [K]\n", + "P2 = rv*P1;# final pressure, [kN/m**2]\n", + "print ' (a) The final temperature is (C) = ',round(T2-273)\n", + "print ' (b) The final pressure is (kN/m^2) = ',P2\n", + "\n", + "# (b)\n", + "E = m_dot*cp*(T1-T2);# energy required, [kW]\n", + "print ' (b) The energy required to drive the compressor is (kW) = ',round(E)\n", + "if(E<0):\n", + " print('The negative sign indicates energy input');\n", + "else:\n", + " print('The positive sign indicates energy output');\n", + "\n", + "print 'The answer is a bit different due to rounding off error in textbook'\n", + " # End\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 417" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Example 14.5\n", + " The power absorbed by compressor is (kW) = 12.64\n" + ] + } + ], + "source": [ + "#pg 417\n", + "print(' Example 14.5');\n", + "\n", + "# aim : To determine \n", + "# the power absorbed in driving the compressor\n", + "\n", + "# given values\n", + "FC = .68;# fuel consumption rate, [kg/min]\n", + "P1 = 93.;# initial pressure, [kN/m^2]\n", + "P2 = 200.;# final pressure, [kN/m^2]\n", + "T1 = 273.+15;# initial temperature, [K]\n", + "d = 1.3;# density of mixture, [kg/m^3]\n", + "n_com = .82;# isentropic efficiency of compressor\n", + "Gama = 1.38;# heat capacity ratio\n", + "\n", + "# solution\n", + "R = P1/(d*T1);# gas constant, [kJ/kg K]\n", + "# for mixture\n", + "cp = Gama*R/(Gama-1);# heat capacity, [kJ/kg K]\n", + "T2_prim = T1*(P2/P1)**((Gama-1)/Gama);# temperature after compression, [K]\n", + "# using isentropic efficiency=(T2_prim-T1)/(T2-T1)\n", + "T2 = T1+(T2_prim-T1)/n_com;# final temperature, [K]\n", + "m_dot = FC*15/60.;# given condition, [kg/s]\n", + "P = m_dot*cp*(T2-T1);# power absorbed by compressor, [kW]\n", + "#results\n", + "print ' The power absorbed by compressor is (kW) = ',round(P,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 418" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Example 14.6\n", + " The power required to drive the blower is (kW) = 99.5\n" + ] + } + ], + "source": [ + "#pg 418\n", + "print(' Example 14.6');\n", + "\n", + "# aim : To determine \n", + "# the power required to drive the blower\n", + "\n", + "# given values\n", + "m_dot = 1;# air capacity, [kg/s]\n", + "rp = 2;# pressure ratio\n", + "P1 = 1*10**5;# intake pressure, [N/m^2]\n", + "T1 = 273+70.;# intake temperature, [K]\n", + "R = .29;# gas constant, [kJ/kg k]\n", + "\n", + "# solution\n", + "V1_dot = m_dot*R*T1/P1*10**3;# [m^3/s]\n", + "P2 = rp*P1;# final pressure, [n/m^2]\n", + "P = V1_dot*(P2-P1);# power required, [W]\n", + "#results\n", + "print ' The power required to drive the blower is (kW) = ',round(P*10**-3,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7: pg 418" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Example 14.7\n", + " The power required to drive the vane pump is (kW) = 78.0\n" + ] + } + ], + "source": [ + "#pg 418\n", + "print(' Example 14.7');\n", + "\n", + "# aim : To determine \n", + "# the power required to drive the vane pump\n", + "\n", + "# given values\n", + "m_dot = 1;# air capacity, [kg/s]\n", + "rp = 2;# pressure ratio\n", + "P1 = 1*10**5;# intake pressure, [N/m^2]\n", + "T1 = 273.+70;# intake temperature, [K]\n", + "Gama = 1.4;# heat capacity ratio\n", + "rv = .7;# volume ratio\n", + "\n", + "# solution\n", + "V1 = .995;# intake pressure(as given previous question),[m^3/s] \n", + "# using P1*V1^Gama=P2*V2^Gama, so\n", + "P2 = P1*(1/rv)**Gama;# pressure, [N/m^2]\n", + "V2 = rv*V1;# volume,[m^3/s]\n", + "P3 = rp*P1;# final pressure, [N/m^2]\n", + "P = Gama/(Gama-1)*P1*V1*((P2/P1)**((Gama-1)/Gama)-1)+V2*(P3-P2);# power required,[W]\n", + "#results\n", + "print ' The power required to drive the vane pump is (kW) = ',round(P*10**-3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8: pg 420" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Example 14.8\n", + " The power required to drive compressor is (kW) = 54.6\n", + " The temperature in the engine is (C) = 109.19\n", + " The pressure in the engine cylinder is (kN/m^2) = 160.5\n" + ] + } + ], + "source": [ + "#pg 420\n", + "print(' Example 14.8');\n", + "\n", + "# aim : To determine \n", + "# the total temperature and pressure of the mixture\n", + "\n", + "# given values\n", + "rp = 2.5;# static pressure ratio\n", + "FC = .04;# fuel consumption rate, [kg/min]\n", + "P1 = 60.;# inilet pressure, [kN/m^2]\n", + "T1 = 273.+5;# inilet temperature, [K]\n", + "n_com = .84;# isentropic efficiency of compressor\n", + "Gama = 1.39;# heat capacity ratio\n", + "C2 = 120.;#exit velocity from compressor, [m/s]\n", + "rm = 13.;# air-fuel ratio\n", + "cp = 1.005;# heat capacity ratio\n", + "\n", + "# solution\n", + "P2 = rp*P1;# given condition, [kN/m^2]\n", + "T2_prim = T1*(P2/P1)**((Gama-1)/Gama);# temperature after compression, [K]\n", + "# using isentropic efficiency=(T2_prim-T1)/(T2-T1)\n", + "T2 = T1+(T2_prim-T1)/n_com;# final temperature, [K]\n", + "m_dot = FC*(rm+1);# mass of air-fuel mixture, [kg/s]\n", + "P = m_dot*cp*(T2-T1);# power to drive compressor, [kW]\n", + "print ' The power required to drive compressor is (kW) = ',round(P,1)\n", + "\n", + "Tt2 = T2+C2**2/(2*cp*10**3);# total temperature,[K]\n", + "Pt2 = P2*(Tt2/T2)**(Gama/(Gama-1));# total pressure, [kN/m^2]\n", + "print ' The temperature in the engine is (C) = ',round(Tt2-273,2)\n", + "print ' The pressure in the engine cylinder is (kN/m^2) = ',round(Pt2,1)\n", + "\n", + "print ' There is rounding mistake in the book'\n", + "\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter15.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter15.ipynb new file mode 100644 index 00000000..31dadb42 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter15.ipynb @@ -0,0 +1,1424 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 15 - Ideal gas power cycles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 436" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.1\n", + " The thermal efficiency of the cycle is (percent) = 49.0\n" + ] + } + ], + "source": [ + "#pg 436\n", + "print('Example 15.1');\n", + "\n", + "# aim : To determine \n", + "# the thermal efficiency of the cycle\n", + "\n", + "# given values\n", + "T1 = 273.+400;# temperature limit, [K]\n", + "T3 = 273.+70;# temperature limit, [K]\n", + "\n", + "# solution\n", + "# using equation [15] of section 15.3\n", + "n_the = (T1-T3)/T1*100;# thermal efficiency \n", + "#results\n", + "print ' The thermal efficiency of the cycle is (percent) = ',round(n_the)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 437" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.2\n", + " (a) The volume ratio of the adiabatic process is = 4.425\n", + " The volume ratio of the isothermal process is = 3.39\n", + " (b) The thermal efficiency of the cycle is (percent) = 44.8\n" + ] + } + ], + "source": [ + "#pg 437\n", + "print('Example 15.2');\n", + "\n", + "# aim : To determine\n", + "# (a) the volume ratios of the isothermal and adiabatic processes\n", + "# (b) the thermal efficiency of the cycle\n", + "\n", + "# given values\n", + "T1 = 273.+260;# temperature, [K]\n", + "T3 = 273.+21;# temperature, [K]\n", + "er = 15.;# expansion ratio\n", + "Gama = 1.4;# heat capacity ratio\n", + "\n", + "# solution\n", + "# (a)\n", + "T2 = T1;\n", + "T4 = T3;\n", + "# for adiabatic process\n", + "rva = (T1/T4)**(1/(Gama-1));# volume ratio of adiabatic\n", + "rvi = er/rva;# volume ratio of isothermal\n", + "print ' (a) The volume ratio of the adiabatic process is = ',round(rva,3)\n", + "print ' The volume ratio of the isothermal process is = ',round(rvi,2)\n", + "\n", + "# (b)\n", + "n_the = (T1-T4)/T1*100;# thermal efficiency\n", + "print ' (b) The thermal efficiency of the cycle is (percent) = ',round(n_the,1)\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 438" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.3\n", + "(a) At line 1\n", + " V1 = 0.096 m^3, t1 = 300.0 C, P1 = 1730.0 kN/m^2 \n", + "At line 2\n", + " V2 = 0.288 m^3, t2 = 300.0 C, P2 = 576.7 kN/m^2\n", + "At line 3\n", + " V3 = 0.576 m^3, t3 = 161.0 C, P3 = 218.5 kN/m^2\n", + "At line 4\n", + " V4 = 0.192 m^3, t4 = 161.3 C, P4 = 655.5 kN/m^2\n", + " (b) The thermal efficiency of the cycle (percent) = 24.0\n", + " (c) The work done per cycle is (kJ) = 44.2\n", + " (d) The work ratio is = 0.156\n", + "there is calculation mistake in the book so answer is not matching\n" + ] + } + ], + "source": [ + "#pg 438\n", + "print('Example 15.3');\n", + "\n", + "# aim : To determine\n", + "# (a) the pressure, volume and temperature at each corner of the cycle\n", + "# (b) the thermal efficiency of the cycle\n", + "# (c) the work done per cycle\n", + "# (d) the work ratio\n", + "from math import log\n", + "# given values\n", + "m = 1;# mass of air, [kg]\n", + "P1 = 1730.;# initial pressure of carnot engine, [kN/m^2]\n", + "T1 = 273.+300;# initial temperature, [K]\n", + "R = .29;# [kJ/kg K]\n", + "Gama = 1.4;# heat capacity ratio\n", + "\n", + "# solution\n", + "# taking reference Fig. 15.15\n", + "# (a)\n", + "# for the isothermal process 1-2\n", + "# using ideal gas law\n", + "V1 = m*R*T1/P1;# initial volume, [m^3]\n", + "T2 = T1;\n", + "V2 = 3.*V1;# given condition\n", + "# for isothermal process, P1*V1=P2*V2, so\n", + "P2 = P1*(V1/V2);# [MN/m^2]\n", + "# for the adiabatic process 2-3\n", + "V3 = 6.*V1;# given condition\n", + "T3 = T2*(V2/V3)**(Gama-1);\n", + "# also for adiabatic process, P2*V2^Gama=P3*V3^Gama, so\n", + "P3 = P2*(V2/V3)**Gama;\n", + "# for the isothermal process 3-4\n", + "T4 = T3;\n", + "# for both adiabatic processes, the temperataure ratio is same, \n", + "# T1/T4 = T2/T3=(V4/V1)^(Gama-1)=(V3/V2)^(Gama-1), so\n", + "V4 = 2*V1;\n", + "# for isothermal process, 3-4, P3*V3=P4*V4, so\n", + "P4 = P3*(V3/V4);\n", + "print '(a) At line 1'\n", + "print ' V1 = ',round(V1,3),' m^3, t1 = ',T1-273,' C, P1 = ',P1,' kN/m^2 '\n", + "\n", + "print 'At line 2'\n", + "print ' V2 = ',round(V2,3),' m^3, t2 = ',T2-273,' C, P2 = ',round(P2,1),' kN/m^2'\n", + "\n", + "print 'At line 3'\n", + "print ' V3 = ',round(V3,3),' m^3, t3 = ',round(T3-273),' C, P3 = ',round(P3,1),' kN/m^2'\n", + "\n", + "\n", + "print 'At line 4'\n", + "print ' V4 = ',round(V4,3),' m^3, t4 = ',round(T4-273,1),' C, P4 = ',round(P4,1),' kN/m^2'\n", + "\n", + "\n", + "# (b)\n", + "n_the = (T1-T3)/T1;# thermal efficiency\n", + "print ' (b) The thermal efficiency of the cycle (percent) = ',round(n_the*100)\n", + "\n", + "# (c)\n", + "W = m*R*T1*log(V2/V1)*n_the;# work done, [J]\n", + "print ' (c) The work done per cycle is (kJ) = ',round(W,1)\n", + "\n", + "# (d)\n", + "wr = (T1-T3)*log(V2/V1)/(T1*log(V2/V1)+(T1-T3)/(Gama-1));# work ratio\n", + "print ' (d) The work ratio is = ',round(wr,3)\n", + "\n", + "print 'there is calculation mistake in the book so answer is not matching'\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 446" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.4\n", + " (a) P1 = 100.0 kN/m^2, V1 = 0.084 m^3, t1 = 28.0 C,\n", + " P2 = 1229.0 kN/m^2, V2 = 0.014 m^3, t2 = 343.0 C,\n", + " P3 = 1229.0 kN/m^2, V3 = 0.019 m^3, t3 = 549.0 C,\n", + " P4 = 100.0 kN/m^2, V4 = 0.112 m^3, t4 = 128.0 C\n", + " (b) The heat received is (kJ) = 20.07\n", + " (c) The work done is (kJ) = 10.27\n", + " (d) The thermal efficiency is (percent) = 51.2\n", + " (e) The carnot efficiency is (percent) = 63.4\n", + " (f) The work ratio is = 0.293\n", + " (g) The mean effective pressure is (kN/m^2) = 104.77\n", + " there is minor variation in answer reported in the book due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 446\n", + "print('Example 15.4');\n", + "\n", + "# aim : To determine\n", + "# (a) the pressure, volume and temperature at cycle state points\n", + "# (b) the heat received\n", + "# (c) the work done \n", + "# (d) the thermal efficiency\n", + "# (e) the carnot efficiency\n", + "# (f) the work ration\n", + "# (g) the mean effective pressure\n", + "\n", + "# given values\n", + "ro = 8.;# overall volume ratio;\n", + "rv = 6.;# volume ratio of adiabatic compression\n", + "P1 = 100.;# initial pressure , [kN/m^2]\n", + "V1 = .084;# initial volume, [m^3]\n", + "T1 = 273.+28;# initial temperature, [K]\n", + "Gama = 1.4;# heat capacity ratio\n", + "cp = 1.006;# specific heat capacity, [kJ/kg K]\n", + "\n", + "# solution\n", + "# taking reference Fig. 15.18\n", + "# (a)\n", + "V2 = V1/rv;# volume at stage2, [m^3] \n", + "V4 = ro*V2;# volume at stage 4;[m^3]\n", + "# using PV^(Gama)=constant for process 1-2\n", + "P2 = P1*(V1/V2)**(Gama);# pressure at stage2,. [kN/m^2]\n", + "T2 = T1*(V1/V2)**(Gama-1);# [K]\n", + "\n", + "P3 = P2;# pressure at stage 3, [kN/m^2]\n", + "V3 = V4/rv;# volume at stage 3, [m^3]\n", + "# since pressure is constant in process 2-3 , so using V/T=constant, so\n", + "T3 = T2*(V3/V2);# temperature at stage 3, [K]\n", + "\n", + "# for process 1-4\n", + "T4 = T1*(V4/V1);# temperature at stage4, [K\n", + "P4 = P1;# pressure at stage4, [kN/m^2]\n", + "\n", + "print ' (a) P1 = ',P1,' kN/m^2, V1 = ',V1,' m^3, t1 = ',T1-273,' C,\\n P2 = ',round(P2),' kN/m^2, V2 = ',V2,' m^3, t2 = ',round(T2-273),' C,\\n P3 = ',round(P3),' kN/m^2, V3 = ',round(V3,3),' m^3, t3 = ',round(T3-273),' C,\\n P4 = ',P4,' kN/m^2, V4 = ',V4,' m^3, t4 = ',round(T4-273),' C'\n", + "\n", + "# (b)\n", + "R = cp*(Gama-1)/Gama;# gas constant, [kJ/kg K]\n", + "m = P1*V1/(R*T1);# mass of gas, [kg]\n", + "Q = m*cp*(T3-T2);# heat received, [kJ]\n", + "print ' (b) The heat received is (kJ) = ',round(Q,2)\n", + "\n", + "# (c) \n", + "W = P2*(V3-V2)-P1*(V4-V1)+((P3*V3-P4*V4)-(P2*V2-P1*V1))/(Gama-1);# work done, [kJ]\n", + "print ' (c) The work done is (kJ) = ',round(W,2)\n", + "\n", + "# (d)\n", + "TE = 1-T1/T2;# thermal efficiency\n", + "print ' (d) The thermal efficiency is (percent) = ',round(TE*100,1)\n", + "\n", + "# (e)\n", + "CE = (T3-T1)/T3;# carnot efficiency\n", + "print ' (e) The carnot efficiency is (percent) = ',round(CE*100,1)\n", + "\n", + "# (f)\n", + "PW = P2*(V3-V2)+(P3*V3-P4*V4)/(Gama-1);# positive work done, [kj]\n", + "WR = W/PW;# work ratio\n", + "print ' (f) The work ratio is = ',round(WR,3)\n", + "\n", + "# (g)\n", + "Pm = W/(V4-V2);# mean effective pressure, [kN/m^2]\n", + "print ' (g) The mean effective pressure is (kN/m^2) = ',round(Pm,2)\n", + "\n", + "print ' there is minor variation in answer reported in the book due to rounding off error'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 450" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.5\n", + " (a) The actual thermal efficiency of the turbine is (percent) = 26.88\n", + " (b) The specific fuel consumption of the turbine is (kg/kWh) = 0.311\n" + ] + } + ], + "source": [ + "#pg 450\n", + "print('Example 15.5');\n", + "\n", + "# aim : To determine\n", + "# (a) the actual thermal efficiency of the turbine\n", + "# (b) the specific fuel consumption of the turbine in kg/kWh\n", + "\n", + "# given values\n", + "P2_by_P1 = 8;\n", + "n_tur = .6;# ideal turbine thermal efficiency\n", + "c = 43.*10**3;# calorific value of fuel, [kJ/kg]\n", + "Gama = 1.4;# heat capacity ratio\n", + "\n", + "# solution\n", + "# (a)\n", + "rv = P2_by_P1;\n", + "n_tur_ide = 1-1/(P2_by_P1)**((Gama-1)/Gama);# ideal thermal efficiency\n", + "ate = n_tur_ide*n_tur;# actual thermal efficiency\n", + "print ' (a) The actual thermal efficiency of the turbine is (percent) = ',round(ate*100,2)\n", + "\n", + "# (b)\n", + "ewf = c*ate;# energy to work fuel, [kJ/kg]\n", + "kWh = 3600.;# energy equivalent ,[kJ]\n", + "sfc = kWh/ewf;# specific fuel consumption, [kg/kWh]\n", + "print ' (b) The specific fuel consumption of the turbine is (kg/kWh) = ',round(sfc,3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 456" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.6\n", + " The relative efficiency of the engine is (percent) = 38.8\n" + ] + } + ], + "source": [ + "#pg 456\n", + "print('Example 15.6');\n", + "\n", + "# aim : To determine\n", + "# the relative efficiency of the engine\n", + "import math\n", + "# given values\n", + "d = 80;# bore, [mm]\n", + "l = 85;# stroke, [mm]\n", + "V1 = .06*10**6;# clearence volume, [mm^3]\n", + "ate = .22;# actual thermal efficiency of the engine\n", + "Gama = 1.4;# heat capacity ratio\n", + "\n", + "# solution\n", + "sv = math.pi*d**2/4*l;# stroke volume, [mm^3]\n", + "V2 = sv+V1;# [mm^3]\n", + "rv = V2/V1;\n", + "ite = 1-(1/rv)**(Gama-1);# ideal thermal efficiency\n", + "re = ate/ite;# relative thermal efficiency\n", + "#results\n", + "print ' The relative efficiency of the engine is (percent) = ',round(re*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7: pg 457" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.7\n", + " (a) P1 = 103.0 kN/m^2, V1 = 1.039 m^3, t1 = 100.0 C,\n", + " P2 = 1265.0 kN/m^2, V2 = 0.173 m^3, t2 = 491.0 C,\n", + " P3 = 3450.0 kN/m^2, V3 = 0.173 m^3, t3 = 1809.0 C,\n", + " P4 = 280.8 kN/m^2, V4 = 1.039 m^3, t4 = 744.0 C\n", + " (b) The heat transferred to the air is (kJ) = 946.0\n", + " (c) The heat rejected by the air is (kJ) = 462.0\n", + " (d) The ideal thermal efficiency is (percent) = 51.2\n", + " (e) The work done is (kJ) = 484.0\n", + " (f) The mean effective pressure is (kN/m^2) = 558.85\n", + "The answers are a bit different due to rounding off error in textbook\n" + ] + } + ], + "source": [ + "#pg 457\n", + "print('Example 15.7');\n", + "\n", + "# aim : To determine\n", + "# (a) the pressure, volume and temperature at each cycle process change points\n", + "# (b) the heat transferred to air\n", + "# (c) the heat rejected by the air\n", + "# (d) the ideal thermal efficiency\n", + "# (e) the work done \n", + "# (f) the mean effective pressure\n", + "\n", + "# given values\n", + "m = 1.;# mass of air, [kg]\n", + "rv = 6.;# volume ratio of adiabatic compression\n", + "P1 = 103.;# initial pressure , [kN/m^2]\n", + "T1 = 273.+100;# initial temperature, [K]\n", + "P3 = 3450.;# maximum pressure, [kN/m^2]\n", + "Gama = 1.4;# heat capacity ratio\n", + "R = .287;# gas constant, [kJ/kg K]\n", + "\n", + "# solution\n", + "# taking reference Fig. 15.20\n", + "# (a)\n", + "# for point 1\n", + "V1 = m*R*T1/P1;# initial volume, [m^3]\n", + "\n", + "# for point 2\n", + "V2 = V1/rv;# volume at point 2, [m^3] \n", + "# using PV^(Gama)=constant for process 1-2\n", + "P2 = P1*(V1/V2)**(Gama);# pressure at point 2,. [kN/m^2]\n", + "T2 = T1*(V1/V2)**(Gama-1);# temperature at point 2,[K]\n", + "\n", + "# for point 3\n", + "V3 = V2;# volume at point 3, [m^3]\n", + "# since volume is constant in process 2-3 , so using P/T=constant, so\n", + "T3 = T2*(P3/P2);# temperature at stage 3, [K]\n", + "\n", + "# for point 4\n", + "V4 = V1;# volume at point 4, [m^3]\n", + "P4 = P3*(V3/V4)**Gama;# pressure at point 4, [kN/m^2] \n", + "# again since volume is constant in process 4-1 , so using P/T=constant, so\n", + "T4 = T1*(P4/P1);# temperature at point 4, [K]\n", + "\n", + "print ' (a) P1 = ',P1,' kN/m^2, V1 = ',round(V1,3),' m^3, t1 = ',T1-273,' C,\\n P2 = ',round(P2),' kN/m^2, V2 = ',round(V2,3),' m^3, t2 = ',round(T2-273),' C,\\n P3 = ',round(P3),' kN/m^2, V3 = ',round(V3,3),' m^3, t3 = ',round(T3-273),' C,\\n P4 = ',round(P4,1),' kN/m^2, V4 = ',round(V4,3),' m^3, t4 = ',round(T4-273),' C'\n", + "\n", + "# (b)\n", + "cv = R/(Gama-1);# specific heat capacity, [kJ/kg K]\n", + "Q23 = m*cv*(T3-T2);# heat transferred, [kJ]\n", + "print ' (b) The heat transferred to the air is (kJ) = ',round(Q23)\n", + "\n", + "# (c) \n", + "Q34 = m*cv*(T4-T1);# heat rejected by air, [kJ]\n", + "print ' (c) The heat rejected by the air is (kJ) = ',round(Q34,1)\n", + "\n", + "# (d)\n", + "TE = 1-Q34/Q23;# ideal thermal efficiency\n", + "print ' (d) The ideal thermal efficiency is (percent) = ',round(TE*100,1)\n", + "\n", + "# (e)\n", + "W = Q23-Q34;# work done ,[kJ]\n", + "print ' (e) The work done is (kJ) = ',round(W,1)\n", + "# (f)\n", + "Pm = W/(V1-V2);# mean effective pressure, [kN/m^2]\n", + "print ' (f) The mean effective pressure is (kN/m^2) = ',round(Pm,2)\n", + "\n", + "print 'The answers are a bit different due to rounding off error in textbook'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8: pg 460" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.8\n", + " (a) P1 = 101.0 kN/m^2, V1 = 0.003 m^3, t1 = 18.0 C,\n", + " P2 = 2213.0 kN/m^2, V2 = 0.0 m^3, t2 = 436.0 C,\n", + " P3 = 4500.0 kN/m^2, V3 = 0.0 m^3, t3 = 1168.0 C,\n", + " P4 = 205.3 kN/m^2, V4 = 0.003 m^3, t4 = 319.0 C\n", + " (b) The thermal efficiency is (percent) = 59.0\n", + " (c) The theoretical output is (kW) = 55.5\n", + " (g) The mean effefctive pressure is (kN/m^2) = 415.9\n", + " (e) The carnot efficiency is (percent) = 79.8\n" + ] + } + ], + "source": [ + "#pg 460\n", + "print('Example 15.8');\n", + "\n", + "# aim : To determine\n", + "# (a) the pressure, volume and temperature at cycle state points\n", + "# (b) the thermal efficiency\n", + "# (c) the theoretical output\n", + "# (d) the mean effective pressure\n", + "# (e) the carnot efficiency\n", + "\n", + "# given values\n", + "rv = 9.;# volume ratio\n", + "P1 = 101.;# initial pressure , [kN/m^2]\n", + "V1 = .003;# initial volume, [m^3]\n", + "T1 = 273.+18;# initial temperature, [K]\n", + "P3 = 4500.;# maximum pressure, [kN/m^2]\n", + "N = 3000.;\n", + "cp = 1.006;# specific heat capacity at constant pressure, [kJ/kg K]\n", + "cv = .716;# specific heat capacity at constant volume, [kJ/kg K]\n", + "\n", + "# solution\n", + "# taking reference Fig. 15.20\n", + "# (a)\n", + "# for process 1-2\n", + "Gama = cp/cv;# heat capacity ratio\n", + "R = cp-cv;# gas constant, [kJ/kg K]\n", + "V2 = V1/rv;# volume at stage2, [m^3] \n", + "# using PV^(Gama)=constant for process 1-2\n", + "P2 = P1*(V1/V2)**(Gama);# pressure at stage2,. [kN/m^2]\n", + "T2 = T1*(V1/V2)**(Gama-1);# [K]\n", + "\n", + "# for process 2-3\n", + "V3 = V2;# volume at stage 3, [m^3]\n", + "# since volume is constant in process 2-3 , so using P/T=constant, so\n", + "T3 = T2*(P3/P2);# temperature at stage 3, [K]\n", + "\n", + "# for process 3-4\n", + "V4 = V1;# volume at stage 4\n", + "# using PV^(Gama)=constant for process 3-4\n", + "P4 = P3*(V3/V4)**(Gama);# pressure at stage2,. [kN/m^2]\n", + "T4 = T3*(V3/V4)**(Gama-1);# temperature at stage 4,[K]\n", + "\n", + "print ' (a) P1 = ',P1,' kN/m^2, V1 = ',round(V1,3),' m^3, t1 = ',T1-273,' C,\\n P2 = ',round(P2),' kN/m^2, V2 = ',round(V2,3),' m^3, t2 = ',round(T2-273),' C,\\n P3 = ',round(P3),' kN/m^2, V3 = ',round(V3,3),' m^3, t3 = ',round(T3-273),' C,\\n P4 = ',round(P4,1),' kN/m^2, V4 = ',round(V4,3),' m^3, t4 = ',round(T4-273),' C'\n", + "\n", + "# (b)\n", + "TE = 1-(T4-T1)/(T3-T2);# thermal efficiency\n", + "print ' (b) The thermal efficiency is (percent) = ',round(TE*100)\n", + "\n", + "# (c)\n", + "m = P1*V1/(R*T1);# mass os gas, [kg] \n", + "W = m*cv*((T3-T2)-(T4-T1));# work done, [kJ]\n", + "Wt = W*N/60;# workdone per minute, [kW]\n", + "print ' (c) The theoretical output is (kW) = ',round(Wt,1)\n", + "\n", + "# (d)\n", + "Pm = W/(V1-V2);# mean effective pressure, [kN/m^2]\n", + "print ' (g) The mean effefctive pressure is (kN/m^2) = ',round(Pm,1)\n", + "\n", + "# (e)\n", + "CE = (T3-T1)/T3;# carnot efficiency\n", + "print ' (e) The carnot efficiency is (percent) = ',CE*100\n", + "\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9: pg 467" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.9\n", + " (a) P1 = 90.0 kN/m^2, V1 = 0.998 m^3, t1 = 40.0 C,\n", + " P2 = 4365.0 kN/m^2, V2 = 0.062 m^3, t2 = 676.0 C,\n", + " P3 = 4365.0 kN/m^2, V3 = 0.11 m^3, t3 = 1400.0 C,\n", + " P4 = 199.1 kN/m^2, V4 = 0.998 m^3, t4 = 419.0 C\n", + " (b) The work done is (kJ) = 454.959974156\n", + " (c) The thermal efficiency is (percent) = 62.6\n", + " (d) The work ratio is = 0.318\n", + " (e) The mean effefctive pressure is (kN/m^2) = 486.4\n", + " (f) The carnot efficiency is (percent) = 81.3\n", + "value of t2 printed in the book is incorrect\n" + ] + } + ], + "source": [ + "#pg 467\n", + "print('Example 15.9');\n", + "\n", + "# aim : To determine\n", + "# (a) the pressure and temperature at cycle process change points\n", + "# (b) the work done \n", + "# (c) the thermal efficiency\n", + "# (d) the work ratio\n", + "# (e) the mean effective pressure\n", + "# (f) the carnot efficiency\n", + "\n", + "\n", + "# given values\n", + "rv = 16.;# volume ratio of compression\n", + "P1 = 90.;# initial pressure , [kN/m^2]\n", + "T1 = 273.+40;# initial temperature, [K]\n", + "T3 = 273.+1400;# maximum temperature, [K]\n", + "cp = 1.004;# specific heat capacity at constant pressure, [kJ/kg K]\n", + "Gama = 1.4;# heat capacoty ratio\n", + "\n", + "# solution\n", + "cv = cp/Gama;# specific heat capacity at constant volume, [kJ/kg K]\n", + "R = cp-cv;# gas constant, [kJ/kg K]\n", + "# for one kg of gas\n", + "V1 = R*T1/P1;# initial volume, [m^3]\n", + "# taking reference Fig. 15.22\n", + "# (a)\n", + "# for process 1-2\n", + "# using PV^(Gama)=constant for process 1-2\n", + "# also rv = V1/V2\n", + "P2 = P1*(rv)**(Gama);# pressure at stage2,. [kN/m^2]\n", + "T2 = T1*(rv)**(Gama-1);# temperature at stage 2, [K]\n", + "\n", + "# for process 2-3\n", + "P3 = P2;# pressure at stage 3, [kN/m^2]\n", + "V2 = V1/rv;#[m^3]\n", + "# since pressure is constant in process 2-3 , so using V/T=constant, so\n", + "V3 = V2*(T3/T2);# volume at stage 3, [m^3]\n", + "\n", + "# for process 1-4\n", + "V4 = V1;# [m^3]\n", + "P4 = P3*(V3/V4)**(Gama)\n", + "# since in stage 1-4 volume is constant, so P/T=constant, \n", + "T4 = T1*(P4/P1);# temperature at stage 4,[K]\n", + "\n", + "print ' (a) P1 = ',P1,' kN/m^2, V1 = ',round(V1,3),' m^3, t1 = ',T1-273,' C,\\n P2 = ',round(P2),' kN/m^2, V2 = ',round(V2,3),' m^3, t2 = ',round(T2-273),' C,\\n P3 = ',round(P3),' kN/m^2, V3 = ',round(V3,3),' m^3, t3 = ',round(T3-273),' C,\\n P4 = ',round(P4,1),' kN/m^2, V4 = ',round(V4,3),' m^3, t4 = ',round(T4-273),' C'\n", + "\n", + "# (b)\n", + "W = cp*(T3-T2)-cv*(T4-T1);# work done, [kJ]\n", + "print ' (b) The work done is (kJ) = ',W\n", + "\n", + "# (c) \n", + "TE = 1-(T4-T1)/((T3-T2)*Gama);# thermal efficiency\n", + "print ' (c) The thermal efficiency is (percent) = ',round(TE*100,1)\n", + "\n", + "# (d)\n", + "PW = cp*(T3-T2)+R*(T3-T4)/(Gama-1);# positive work done\n", + "WR = W/PW;# work ratio\n", + "print ' (d) The work ratio is = ',round(WR,3)\n", + "\n", + "# (e)\n", + "Pm = W/(V1-V2);# mean effective pressure, [kN/m^2]\n", + "print ' (e) The mean effefctive pressure is (kN/m^2) = ',round(Pm,1)\n", + "\n", + "# (f)\n", + "CE = (T3-T1)/T3;# carnot efficiency\n", + "print ' (f) The carnot efficiency is (percent) = ',round(CE*100,1)\n", + "\n", + "print 'value of t2 printed in the book is incorrect'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10: pg 470" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 10\n", + " (a) The maximum temperature during the cycle is (C) = 1595.4\n", + " (b) The thermal efficiency of the cycle is (percent) = 60.3\n" + ] + } + ], + "source": [ + "#pg 470\n", + "print('Example 10');\n", + "\n", + "# aim : To determine\n", + "# (a) the maximum temperature attained during the cycle\n", + "# (b) the thermal efficiency of the cycle\n", + "\n", + "# given value\n", + "rva =7.5;# volume ratio of adiabatic expansion\n", + "rvc =15.;# volume ratio of compression\n", + "P1 = 98.;# initial pressure, [kn/m^2]\n", + "T1 = 273.+44;# initial temperature, [K]\n", + "P4 = 258.;# pressure at the end of the adiabatic expansion, [kN/m^2]\n", + "Gama = 1.4;# heat capacity ratio\n", + "\n", + "# solution\n", + "# by seeing diagram\n", + "# for process 4-1, P4/T4=P1/T1\n", + "T4 = T1*(P4/P1);# [K]\n", + "# for process 3-4\n", + "T3 = T4*(rva)**(Gama-1);\n", + "print ' (a) The maximum temperature during the cycle is (C) = ',round(T3-273,1)\n", + "\n", + "# (b)\n", + "\n", + "# for process 1-2,\n", + "T2 = T1*(rvc)**(Gama-1);# [K]\n", + "n_the = 1-(T4-T1)/((Gama)*(T3-T2));# thermal efficiency\n", + "print ' (b) The thermal efficiency of the cycle is (percent) = ',round(n_the*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11: pg 471" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.11\n", + " (a) the thermal efficiency of the cycle is (percent) = 55.1\n", + " (c) The indicated power of the cycle is (kW) = 26.59\n" + ] + } + ], + "source": [ + "#pg 471\n", + "print('Example 15.11');\n", + "\n", + "# aim : To determine\n", + "# (a) the thermal efficiency of the cycle\n", + "# (b) the indicared power of the cycle\n", + "\n", + "# given values\n", + "# taking basis one second\n", + "rv = 11.;# volume ratio\n", + "P1 = 96.;# initial pressure , [kN/m^2]\n", + "T1 = 273.+18;# initial temperature, [K]\n", + "Gama = 1.4;# heat capacity ratio\n", + "\n", + "# solution\n", + "# taking reference Fig. 15.24\n", + "# (a)\n", + "Beta = 2;# ratio of V3 and V2\n", + "TE = 1-(Beta**(Gama)-1)/((rv**(Gama-1))*Gama*(Beta-1));# thermal efficiency\n", + "print ' (a) the thermal efficiency of the cycle is (percent) = ',round(TE*100,1)\n", + "\n", + "# (b) \n", + "# let V1-V2=.05, so\n", + "V2 = .05*.1;# [m^3]\n", + "# from this\n", + "V1 = rv*V2;# [m^3]\n", + "V3 = Beta*V2;# [m^3]\n", + "V4 = V1;# [m^3]\n", + "P2 = P1*(V1/V2)**(Gama);# [kN/m^2]\n", + "P3 = P2;# [kn/m^2]\n", + "P4=P3*(V3/V4)**(Gama);# [kN/m^2]\n", + "# indicated power\n", + "W = P2*(V3-V2)+((P3*V3-P4*V4)-(P2*V2-P1*V1))/(Gama-1);# indicated power, [kW]\n", + "print ' (c) The indicated power of the cycle is (kW) = ',round(W,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12: pg 477" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.12\n", + " (a) The pressure at the end of compression is (MN/m^2) = 5.0\n", + " The temperature at the end of compression is (C) = 621.0\n", + " (b) The pressure at the end of constant volume process is (MN/m^2) = 6.9\n", + " The temperature at the end of constant volume process is (C) = 962.0\n", + " (c) The temperature at the end of constant pressure process is (C) = 1517.0\n" + ] + } + ], + "source": [ + "#pg 477\n", + "print('Example 15.12');\n", + "# aim : To determine\n", + "# (a) the pressure and temperature at the end of compression\n", + "# (b) the pressure and temperature at the end of the constant volume process\n", + "# (c) the temperature at the end of constant pressure process\n", + "\n", + "# given values\n", + "P1 = 103.;# initial pressure, [kN/m^2]\n", + "T1 = 273.+22;# initial temperature, [K]\n", + "rv = 16.;# volume ratio of the compression\n", + "Q = 244.;#heat added, [kJ/kg]\n", + "Gama = 1.4;# heat capacity ratio\n", + "cv = .717;# heat capacity, [kJ/kg k]\n", + "\n", + "# solution\n", + "# taking reference as Fig.15.26\n", + "# (a)\n", + "# for compression\n", + "# rv = V1/V2\n", + "P2 = P1*(rv)**Gama;# pressure at end of compression, [kN/m^2]\n", + "T2 = T1*(rv)**(Gama-1);# temperature at end of compression, [K]\n", + "print ' (a) The pressure at the end of compression is (MN/m^2) = ',round(P2*10**-3)\n", + "print ' The temperature at the end of compression is (C) = ',round(T2-273)\n", + "\n", + "# (b)\n", + "# for constant volume process, \n", + "# Q = cv*(T3-T2), so\n", + "T3 = T2+Q/cv;# temperature at the end of constant volume, [K]\n", + "\n", + "# so for constant volume, P/T=constant, hence\n", + "P3 = P2*(T3/T2);# pressure at the end of constant volume process, [kN/m^2]\n", + "print ' (b) The pressure at the end of constant volume process is (MN/m^2) = ',round(P3*10**-3,1)\n", + "print ' The temperature at the end of constant volume process is (C) = ',round(T3-273)\n", + "\n", + "# (c)\n", + "S = rv-1;# stroke\n", + "# assuming \n", + "V3 = 1;# [volume]\n", + "#so\n", + "V4 = V3+S*.03;# [volume]\n", + "# also for constant process V/T=constant, hence\n", + "T4 = T3*(V4/V3);# temperature at the end of constant presure process, [k] \n", + "print ' (c) The temperature at the end of constant pressure process is (C) = ',round(T4-273)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13: pg 479" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.13\n", + " (a) P1 = 0.097 kN/m^2, V1 = 0.084 m^3, t1 = 28.0 C,\n", + " P2 = 4.0 kN/m^2, V2 = 0.0056 m^3, t2 = 620.0 C,\n", + " P3 = 6.0 kN/m^2, V3 = 0.0056 m^3, t3 = 1010.0 C,\n", + " P4 = 6.2 kN/m^2, V4 = 0.006955 m^3, t4 = 1320.0 C \n", + " P5 = 0.2 kN/m^2, V5 = 0.084 m^3, t5 = 313.0 C\n", + " (b) The net work done is (kJ) = 36.4\n", + " (c) The thermal efficiency is (percent) = 65.5\n", + " (d) The heat received is (kJ) = 55.6\n", + " (f) The work ratio is = 0.477\n", + " (e) The mean effective pressure is (kN/m^2) = 464.0\n", + " (f) The carnot efficiency is (percent) = 81.0\n" + ] + } + ], + "source": [ + "#pg 479\n", + "print('Example 15.13');\n", + "\n", + "# aim : To determine\n", + "# (a) the pressure, volume and temperature at cycle process change points\n", + "# (b) the net work done \n", + "# (c) the thermal efficiency\n", + "# (d) the heat received\n", + "# (e) the work ratio\n", + "# (f) the mean effective pressure\n", + "# (g) the carnot efficiency\n", + "\n", + "\n", + "# given values\n", + "rv = 15.;# volume ratio\n", + "P1 = 97.*10**-3;# initial pressure , [MN/m^2]\n", + "V1 = .084;# initial volume, [m^3]\n", + "T1 = 273.+28;# initial temperature, [K]\n", + "T4 = 273.+1320;# maximum temperature, [K]\n", + "P3 = 6.2;# maximum pressure, [MN/m^2]\n", + "cp = 1.005;# specific heat capacity at constant pressure, [kJ/kg K]\n", + "cv = .717;# specific heat capacity at constant volume, [kJ/kg K]\n", + "\n", + "# solution\n", + "# taking reference Fig. 15.27\n", + "# (a)\n", + "R = cp-cv;# gas constant, [kJ/kg K]\n", + "Gama = cp/cv;# heat capacity ratio\n", + "# for process 1-2\n", + "V2 = V1/rv;# volume at stage2, [m^3] \n", + "# using PV^(Gama)=constant for process 1-2\n", + "P2 = P1*(V1/V2)**(Gama);# pressure at stage2,. [MN/m^2]\n", + "T2 = T1*(V1/V2)**(Gama-1);# temperature at stage 2, [K]\n", + "\n", + "# for process 2-3\n", + "# since volumee is constant in process 2-3 , so using P/T=constant, so\n", + "T3 = T2*(P3/P2);# volume at stage 3, [K]\n", + "V3 = V2;# volume at stage 3, [MN/m^2]\n", + "\n", + "# for process 3-4\n", + "P4 = P3;# pressure at stage 4, [m^3]\n", + "# since in stage 3-4 P is constant, so V/T=constant, \n", + "V4 = V3*(T4/T3);# temperature at stage 4,[K]\n", + "\n", + "# for process 4-5\n", + "V5 = V1;# volume at stage 5, [m^3]\n", + "P5 = P4*(V4/V5)**(Gama);# pressure at stage5,. [MN/m^2]\n", + "T5 = T4*(V4/V5)**(Gama-1);# temperature at stage 5, [K]\n", + "\n", + "print ' (a) P1 = ',P1,' kN/m^2, V1 = ',round(V1,3),' m^3, t1 = ',T1-273,' C,\\n P2 = ',round(P2),' kN/m^2, V2 = ',round(V2,6),' m^3, t2 = ',round(T2-273),' C,\\n P3 = ',round(P3),' kN/m^2, V3 = ',round(V3,6),' m^3, t3 = ',round(T3-273),' C,\\n P4 = ',round(P4,1),' kN/m^2, V4 = ',round(V4,6),' m^3, t4 = ',round(T4-273),' C \\n P5 = ',round(P5,1),' kN/m^2, V5 = ',round(V5,3),' m^3, t5 = ',round(T5-273),' C'\n", + "\n", + "\n", + "# (b)\n", + "W = (P3*(V4-V3)+((P4*V4-P5*V5)-(P2*V2-P1*V1))/(Gama-1))*10**3;# work done, [kJ]\n", + "print ' (b) The net work done is (kJ) = ',round(W,1)\n", + "\n", + "# (c) \n", + "TE = 1-(T5-T1)/((T3-T2)+Gama*(T4-T3));# thermal efficiency\n", + "print ' (c) The thermal efficiency is (percent) = ',round(TE*100,1)\n", + "\n", + "# (d)\n", + "Q = W/TE;# heat received, [kJ]\n", + "print ' (d) The heat received is (kJ) = ',round(Q,1)\n", + "\n", + "# (e)\n", + "PW = P3*(V4-V3)+(P4*V4-P5*V5)/(Gama-1)\n", + "WR = W*10**-3/PW;# work ratio\n", + "print ' (f) The work ratio is = ',round(WR,3)\n", + "\n", + "# (e)\n", + "Pm = W/(V1-V2);# mean effective pressure, [kN/m^2]\n", + "print ' (e) The mean effective pressure is (kN/m^2) = ',round(Pm,1)\n", + "\n", + "# (f)\n", + "CE = (T4-T1)/T4;# carnot efficiency\n", + "print ' (f) The carnot efficiency is (percent) = ',round(CE*100)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14: pg 487" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.14\n", + " (a) The thermal efficiency is (percent) = 52.6\n", + " (b) The heat received is (kJ/cycle) = 6.22\n", + " (c) The heat rejected is (kJ/cycle) = 2.95\n", + " (d) The net work is (kJ/cycle) = 3.27\n", + " (e) The work ratio is = 0.347\n", + " (f) The mean effefctive pressure is (kN/m^2) = 167.32\n", + " (g) The carnot efficiency is (percent) = 72.7\n", + "there is minor variation in answer reported in the book due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 487\n", + "print('Example 15.14');\n", + "\n", + "# aim : To determine\n", + "# (a) the thermal efficiency\n", + "# (b) the heat received\n", + "# (c) the heat rejected\n", + "# (d) the net work \n", + "# (e) the work ratio\n", + "# (f) the mean effective pressure\n", + "# (g) the carnot efficiency\n", + "\n", + "\n", + "# given values\n", + "P1 = 101.;# initial pressure , [kN/m**2]\n", + "V1 = 14.*10**-3;# initial volume, [m**3]\n", + "T1 = 273.+15;# initial temperature, [K]\n", + "P3 = 1850.;# maximum pressure, [kN/m**2]\n", + "V2 = 2.8*10**-3;# compressed volume, [m**3]\n", + "Gama = 1.4;# heat capacity\n", + "R = .29;# gas constant, [kJ/kg k]\n", + "\n", + "# solution\n", + "# taking reference Fig. 15.29\n", + "# (a)\n", + "# for process 1-2\n", + "# using PV**(Gama)=constant for process 1-2\n", + "P2 = P1*(V1/V2)**(Gama);# pressure at stage2,. [MN/m**2]\n", + "T2 = T1*(V1/V2)**(Gama-1);# temperature at stage 2, [K]\n", + "\n", + "# for process 2-3\n", + "# since volumee is constant in process 2-3 , so using P/T=constant, so\n", + "T3 = T2*(P3/P2);# volume at stage 3, [K]\n", + "\n", + "# for process 3-4\n", + "P4 = P1;\n", + "T4 = T3*(P4/P3)**((Gama-1)/Gama);# temperature\n", + "\n", + "TE = 1-Gama*(T4-T1)/(T3-T2);# thermal efficiency\n", + "print ' (a) The thermal efficiency is (percent) = ',round(TE*100,1)\n", + "\n", + "# (b)\n", + "cv = R/(Gama-1);# heat capacity at copnstant volume, [kJ/kg k]\n", + "m = P1*V1/(R*T1);# mass of gas, [kg]\n", + "Q1 = m*cv*(T3-T2);# heat received, [kJ/cycle]\n", + "print ' (b) The heat received is (kJ/cycle) = ',round(Q1,2)\n", + "\n", + "# (c)\n", + "cp = Gama*cv;# heat capacity at constant at constant pressure, [kJ/kg K]\n", + "Q2 = m*cp*(T4-T1);# heat rejected, [kJ/cycle]\n", + "print ' (c) The heat rejected is (kJ/cycle) = ',round(Q2,2)\n", + "\n", + "# (d)\n", + "W = Q1-Q2;# net work , [kJ/cycle]\n", + "print ' (d) The net work is (kJ/cycle) = ',round(W,2)\n", + "\n", + "# (e)\n", + "# pressure is constant for process 1-4, so V/T=constant\n", + "V4 = V1*(T4/T1);# volume, [m**3]\n", + "V3 = V2;# for process 2-3\n", + "P4 = P1;# for process 1-4\n", + "PW = (P3*V3-P1*V1)/(Gama-1);# positive work done, [kJ/cycle]\n", + "WR = W/PW;# work ratio\n", + "print ' (e) The work ratio is = ',round(WR,3)\n", + "\n", + "# (f)\n", + "Pm = W/(V4-V2);# mean effective pressure, [kN/m**2]\n", + "print ' (f) The mean effefctive pressure is (kN/m^2) = ',round(Pm,2)\n", + "\n", + "# (g)\n", + "CE = (T3-T1)/T3;# carnot efficiency\n", + "print ' (g) The carnot efficiency is (percent) = ',round(CE*100,1)\n", + "\n", + "print 'there is minor variation in answer reported in the book due to rounding off error'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15: pg 492" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.15\n", + " (a) The net work done is (kJ) = 28.0\n", + " (b) The ideal thermal efficiency is (percent) = 68.9\n", + " (c) the thermal efficiency if the process of regeneration is not included is (percent) = 39.5\n" + ] + } + ], + "source": [ + "#pg 492\n", + "print('Example 15.15');\n", + "\n", + "# aim : To determine\n", + "# (a) the net work done\n", + "# (b) the ideal thermal efficiency\n", + "# (c) the thermal efficiency if the process of generation is not included\n", + "from math import log\n", + "# given values\n", + "P1 = 110.;# initial pressure, [kN/m^2)\n", + "T1 = 273.+30;# initial temperature, [K]\n", + "V1 = .05;# initial volume, [m^3]\n", + "V2 = .005;# volume, [m^3]\n", + "T3 = 273.+700;# temperature, [m^3]\n", + "R = .289;# gas constant, [kJ/kg K]\n", + "cv = .718;# heat capacity, [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "m = P1*V1/(R*T1);# mass , [kg]\n", + "W = m*R*(T3-T1)*log(V1/V2);# work done, [kJ]\n", + "print ' (a) The net work done is (kJ) = ',round(W)\n", + "\n", + "# (b)\n", + "n_the = (T3-T1)/T3;# ideal thermal efficiency\n", + "print ' (b) The ideal thermal efficiency is (percent) = ',round(n_the*100,1)\n", + "\n", + "# (c)\n", + "V4 = V1;\n", + "V3 = V2;\n", + "T4 = T3;\n", + "T2 = T1;\n", + "\n", + "Q_rej = m*cv*(T4-T1)+m*R*T1*log(V1/V2);# heat rejected\n", + "Q_rec = m*cv*(T3-T2)+m*R*T3*log(V4/V3);# heat received\n", + "\n", + "n_th = (1-Q_rej/Q_rec);# thermal efficiency\n", + "print ' (c) the thermal efficiency if the process of regeneration is not included is (percent) = ',round(n_th*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16: pg 493" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.16\n", + " (a) The maximum temperature is (C) = 313.0\n", + " (b) The net work done is (kJ) = 12.88\n", + " (c) The ideal thermal efficiency is (percent) = 50.0\n", + " (d) the thermal efficiency if the process of regeneration is not included is (percent) = 24.0\n" + ] + } + ], + "source": [ + "#pg 493\n", + "print('Example 15.16');\n", + "from math import log\n", + "# aim : To determine\n", + "# (a) the maximum temperature\n", + "# (b) the net work done\n", + "# (c) the ideal thermal efficiency\n", + "# (d) the thermal efficiency if the process of regeneration is not included\n", + "\n", + "# given values\n", + "P1 = 100.;# initial pressure, [kN/m^2)\n", + "T1 = 273.+20;# initial temperature, [K]\n", + "V1 = .08;# initial volume, [m^3]\n", + "rv = 5;# volume ratio\n", + "R = .287;# gas constant, [kJ/kg K]\n", + "cp = 1.006;# heat capacity, [kJ/kg K]\n", + "V3_by_V2 = 2;\n", + "\n", + "# solution\n", + "# (a)\n", + "# using Fig.15.33\n", + "# process 1-2 is isothermal\n", + "T2 = T1;\n", + "# since process 2-3 isisobaric, so V/T=constant\n", + "T3 = T2*(V3_by_V2);# maximumtemperature, [K]\n", + "print ' (a) The maximum temperature is (C) = ',T3-273\n", + "\n", + "# (b)\n", + "m = P1*V1/(R*T1);# mass , [kg]\n", + "W = m*R*(T3-T1)*log(rv);# work done, [kJ]\n", + "print ' (b) The net work done is (kJ) = ',round(W,2)\n", + "\n", + "# (c)\n", + "TE = (T3-T1)/T3;# ideal thermal efficiency\n", + "print ' (c) The ideal thermal efficiency is (percent) = ',TE*100\n", + "\n", + "# (d)\n", + "T4 = T3;\n", + "T2 = T1;\n", + "\n", + "Q_rej = m*cp*(T4-T1)+m*R*T1*log(rv);# heat rejected\n", + "Q_rec = m*cp*(T3-T2)+m*R*T3*log(rv);# heat received\n", + "\n", + "n_th = (1-Q_rej/Q_rec);# thermal efficiency\n", + "print ' (d) the thermal efficiency if the process of regeneration is not included is (percent) = ',round(n_th*100)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17: pg 495" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.17\n", + " (a) The net work done is (kJ) = 44.7\n", + " (b) The thermal efficiency is (percent) = 56.7\n" + ] + } + ], + "source": [ + "#pg 495\n", + "print('Example 15.17');\n", + "\n", + "# aim : To determine \n", + "# (a) the net work done\n", + "# (b) thethermal efficiency\n", + "from math import log\n", + "# given values\n", + "m = 1.;# mass of air, [kg]\n", + "T1 = 273.+230;# initial temperature, [K]\n", + "P1 = 3450.;# initial pressure, [kN/m^2]\n", + "P2 = 2000.;# pressure, [kN/m^2]\n", + "P3 = 140.;# pressure, [kN/m^2]\n", + "P4 = P3;\n", + "Gama = 1.4; # heat capacity ratio\n", + "cp = 1.006;# heat capacity, [kJ/kg k]\n", + "\n", + "# solution\n", + "T2 =T1;# isothermal process 1-2\n", + "# process 2-3 and 1-4 are adiabatic so\n", + "T3 = T2*(P3/P2)**((Gama-1)/Gama);# temperature, [K] \n", + "T4 = T1*(P4/P1)**((Gama-1)/Gama);# [K]\n", + "R = cp*(Gama-1)/Gama;# gas constant, [kJ/kg K]\n", + "Q1 = m*R*T1*log(P1/P2);# heat received, [kJ]\n", + "Q2 = m*cp*(T3-T4);# heat rejected\n", + "\n", + "#hence\n", + "W = Q1-Q2;# work done\n", + "print ' (a) The net work done is (kJ) = ',round(W,1)\n", + "\n", + "# (b)\n", + "TE = 1-Q2/Q1;# thermal efficiency\n", + "print ' (b) The thermal efficiency is (percent) = ',round(TE*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18: pg 497" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 15.18\n", + " The thermal efficiency is (percent) = 31.0\n", + " The carnot efficiency is = 73.7\n" + ] + } + ], + "source": [ + "#pg 497\n", + "print('Example 15.18');\n", + "\n", + "# aim : To determine \n", + "# thermal eficiency\n", + "# carnot efficiency\n", + "from math import log\n", + "# given values\n", + "rv = 5.;# volume ratio\n", + "Gama = 1.4;# heat capacity ratio\n", + "\n", + "# solution\n", + "# under given condition\n", + "\n", + "TE = 1-(1/Gama*(2-1/rv**(Gama-1)))/(1+2*((Gama-1)/Gama)*log(rv/2));# thermal efficiency\n", + "print ' The thermal efficiency is (percent) = ',round(TE*100)\n", + "\n", + "CE = 1-1/(2*rv**(Gama-1));# carnot efficiency\n", + "print ' The carnot efficiency is = ',round(CE*100,1)\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter16.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter16.ipynb new file mode 100644 index 00000000..7490fa12 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter16.ipynb @@ -0,0 +1,546 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 16 - Internal combustion engines" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 553" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 16.1\n", + " (a) The net power output is (kW) = 1014.0\n", + " (b) The thermal efficiency of the plant is (percent) = 32.0\n", + " (c) The work ratio is = 0.446\n" + ] + } + ], + "source": [ + "#pg 553\n", + "print('Example 16.1');\n", + "\n", + "# aim : To determine \n", + "# (a) the net power output of the turbine plant if the turbine is coupled to the compresser\n", + "# (b) the thermal efficiency of the plant\n", + "# (c) the work ratio\n", + "\n", + "# Given values\n", + "P1 = 100.;# inlet pressure of compressor, [kN/m^2]\n", + "T1 = 273.+18;# inlet temperature, [K]\n", + "P2 = 8*P1;# outlet pressure of compressor, [kN/m^2]\n", + "n_com = .85;# isentropic efficiency of compressor\n", + "T3 = 273.+1000;#inlet temperature of turbine, [K]\n", + "P3 = P2;# inlet pressure of turbine, [kN/m^2]\n", + "P4 = 100.;# outlet pressure of turbine, [kN/m^2]\n", + "n_tur = .88;# isentropic efficiency of turbine\n", + "m_dot = 4.5;# air mass flow rate, [kg/s]\n", + "cp = 1.006;# [kJ/kg K]\n", + "Gamma = 1.4;# heat capacity ratio\n", + "\n", + "# (a)\n", + "# For the compressor\n", + "T2_prime = T1*(P2/P1)**((Gamma-1)/Gamma);# [K]\n", + "T2 = T1+(T2_prime-T1)/n_com;# exit pressure of compressor, [K]\n", + "\n", + "# for turbine\n", + "T4_prime = T3*(P4/P3)**((Gamma-1)/Gamma);# [K]\n", + "T4 = T3-(T3-T4_prime)*n_tur;# exit temperature of turbine, [K]\n", + "\n", + "P_output = m_dot*cp*((T3-T4)-(T2-T1));# [kW]\n", + "print ' (a) The net power output is (kW) = ',round(P_output)\n", + "\n", + "# (b)\n", + "n_the = ((T3-T4)-(T2-T1))/(T3-T2)*100;# thermal efficiency\n", + "print ' (b) The thermal efficiency of the plant is (percent) = ',round(n_the)\n", + "\n", + "# (c)\n", + "P_pos = m_dot*cp*(T3-T4);# Positive cycle work, [kW]\n", + "\n", + "W_ratio = P_output/P_pos;# work ratio\n", + "print ' (c) The work ratio is = ',round(W_ratio,3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 554" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 16.2\n", + " (a) The pressure ratio which give the maximum network output is = 14.74\n", + " (b) The maximum net specific work output is (kJ/kg) = 401.0\n", + " (c) The thermal efficiency at maximum work output is (percent) = 54.0\n", + " (d) The work ratio at maximum work output is = 0.54\n", + " (e) The carnot efficiency within the cycle temperature limits is (percent) = 79.0\n" + ] + } + ], + "source": [ + "#pg 554\n", + "print('Example 16.2');\n", + "\n", + "# aim : To determine\n", + "# (a) the pressure ratiowhich will give the maximum net work output\n", + "# (b) the maximum net specific work output\n", + "# (c) the thermal efficiency at maximum work output\n", + "# (d) the work ratio at maximum work output\n", + "# (e) the carnot efficiency within the cycle temperature limits\n", + "from math import sqrt\n", + "# Given values\n", + "# taking the refrence as Fig.16.35\n", + "T3 = 273.+1080;# [K]\n", + "T1 = 273.+10;# [K]\n", + "cp = 1.007;# [kJ/kg K]\n", + "Gamma = 1.41;# heat capacity ratio\n", + "\n", + "# (a)\n", + "r_pmax = (T3/T1)**((Gamma)/(Gamma-1));# maximum pressure ratio\n", + "# for maximum net work output\n", + "r_p = sqrt(r_pmax);\n", + "print ' (a) The pressure ratio which give the maximum network output is = ',round(r_p,2)\n", + "\n", + "# (b)\n", + "T2 = T1*(r_p)**((Gamma-1)/Gamma);# [K]\n", + "# From equation [23]\n", + "T4 = T2;\n", + "W_max = cp*((T3-T4)-(T2-T1));# Maximum net specific work output, [kJ/kg]\n", + "\n", + "print ' (b) The maximum net specific work output is (kJ/kg) = ',round(W_max)\n", + "\n", + "# (c)\n", + "W = cp*(T3-T2);\n", + "n_the = W_max/W;# thermal efficiency\n", + "print ' (c) The thermal efficiency at maximum work output is (percent) = ',round(n_the*100)\n", + "\n", + "# (d)\n", + "# From the equation [26]\n", + "W_ratio = n_the;# Work ratio\n", + "print ' (d) The work ratio at maximum work output is = ',round(W_ratio,2)\n", + "\n", + "# (e)\n", + "n_carnot = (T3-T1)/T3*100;# carnot efficiency\n", + "print ' (e) The carnot efficiency within the cycle temperature limits is (percent) = ',round(n_carnot)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 558" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 16.3\n", + " (a) The net power output of the plant is (kW) = 562.0\n", + " (b) The exhaust temperature from the heat exchanger is (C) = 333.0\n", + " (c) The thermal efficiency of the plant is (percent) = 30.5\n", + " (d) The thermal efficiency of the plant if there wereno heat exchanger is (percent) = 22.3\n", + " (e) The work ratio is = 0.38\n" + ] + } + ], + "source": [ + "#pg 558\n", + "print('Example 16.3');\n", + "\n", + "# aim : To determine\n", + "# (a) the net power output of the plant\n", + "# (b) the exhaust temperature from the heat exchanger\n", + "# (c) the thermal efficiency of the plant\n", + "# (d) the thermal efficiency of the plant if there were no heat exchanger\n", + "# (e) the work ratio\n", + "\n", + "# Given values\n", + "T1 = 273.+15;# temperature, [K]\n", + "P1 = 101.;# pressure, [kN/m^2]\n", + "P2 = 6*P1; # [kN/m^2]\n", + "eff = .65;# effectiveness of the heat exchanger, \n", + "T3 = 273.+870;# temperature, [K]\n", + "P4 = 101.;# [kN/m^2]\n", + "n_com = .85;# efficiency of compressor, \n", + "n_tur = .80;# efficiency of turbine\n", + "m_dot = 4.;# mass flow rate, [kg/s]\n", + "Gama = 1.4;# heat capacity ratio\n", + "cp = 1.005;# [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "# For compressor\n", + "T2_prim = T1*(P2/P1)**((Gama-1)/Gama);# [K]\n", + "\n", + "# using n_com = (T2_prim-T1)/(T2-T1)')\n", + "\n", + "T2 = T1+(T2_prim-T1)/n_com\n", + "# For turbine\n", + "P3 = P2;\n", + "T4_prim = T3*(P4/P3)**((Gama-1)/Gama);# [K]\n", + "\n", + "T4=T3-n_tur*(T3-T4_prim); # [K]\n", + "P_out = m_dot*cp*((T3-T4)-(T2-T1));# net power output, [kW]\n", + "print ' (a) The net power output of the plant is (kW) = ',round(P_out)\n", + "\n", + "# (b)\n", + "mtd = T4-T2;# maximum temperature drop for heat transfer, [K]\n", + "atd = eff*mtd;# actual temperature, [K]\n", + "et = T4-atd;# Exhaust temperature from heat exchanger, [K]\n", + "t6 = et-273;# [C]\n", + "print ' (b) The exhaust temperature from the heat exchanger is (C) = ',round(t6)\n", + "\n", + "# (c)\n", + "T5 = T2+atd;# [K]\n", + "n_the = ((T3-T4)-(T2-T1))/(T3-T5)*100;# thermal effficiency \n", + "print ' (c) The thermal efficiency of the plant is (percent) = ',round(n_the,1)\n", + "\n", + "# (d)\n", + "# with no heat exchanger\n", + "n_the = ((T3-T4)-(T2-T1))/(T3-T2)*100;# thermal efficiency without heat exchanger\n", + "print ' (d) The thermal efficiency of the plant if there wereno heat exchanger is (percent) = ',round(n_the,1)\n", + "\n", + "# (e)\n", + "P_pos = m_dot*cp*(T3-T4);# positive cycle work;# [kW]\n", + "w_rat = P_out/P_pos;# work ratio\n", + "print ' (e) The work ratio is = ',round(w_rat,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 562" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 16.4\n", + " (a) The temperature as the air leaves the compressor turbine is (C) = 701.0\n", + " The pressure as the air leaves the compressor turbine is (kN/m^2) = 288.0\n", + " (b) The power output from the free power turbine is (kW) = 1541.0\n", + " (c) The thermal efficiency of the plant is (percent) = 32.0\n", + " (d) The work ratio is = 0.44\n", + " (e) The carnot efficiency is (percent) = 77.0\n", + "The answers are a bit different due to rounding off error in textbook\n" + ] + } + ], + "source": [ + "#pg 562\n", + "print('Example 16.4');\n", + "\n", + "# aim : To determine\n", + "# (a) the pressure and temperature as the air leaves the compressor turbine\n", + "# (b) the power output from the free power turbine\n", + "# (c) the thermal efficiency of the plant\n", + "# (d) the work ratio\n", + "# (e) the carnot efficiency within the cycle temperature limits\n", + "\n", + "# Given values\n", + "T1 = 273.+19;# temperature, [K]\n", + "P1 = 100.;# pressure, [kN/m^2]\n", + "P2 = 8*P1; # [kN/m^2]\n", + "P3 = P2;# [kN/m^2]\n", + "T3 = 273.+980;# temperature, [K]\n", + "n_com = .85;# efficiency of rotary compressor\n", + "P5 = 100.;# [kN/m^2]\n", + "n_cum = .88;# isentropic efficiency of combustion chamber compressor, \n", + "n_tur = .86;# isentropic efficiency of turbine\n", + "m_dot = 7.;# mass flow rate of air, [kg/s]\n", + "Gama = 1.4;# heat capacity ratio\n", + "cp = 1.006;# [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "# For compressor\n", + "T2_prim = T1*(P2/P1)**((Gama-1)/Gama);# [K]\n", + "\n", + "T2 = T1+(T2_prim-T1)/n_com;# temperature, [K]\n", + "\n", + "# for compressor turbine\n", + "# T3-T4 = T2-T1,because compressor turbine power=compressor power so\n", + "T4 = T3-(T2-T1);#turbine exit temperature, [K]\n", + "T4_prim = T3-(T3-T4)/n_cum;# [K]\n", + "\n", + "# For turbine\n", + "# T4_prim = T3*(P4/P3)^((Gama-1)/Gama)\n", + "P4 = P3*(T4_prim/T3)**(Gama/(Gama-1));# exit air pressure of air, [kN/m^2]\n", + "\n", + "print ' (a) The temperature as the air leaves the compressor turbine is (C) = ',round(T4-273)\n", + "print ' The pressure as the air leaves the compressor turbine is (kN/m^2) = ',round(P4)\n", + "\n", + "# (b)\n", + "T5_prim = T4*(P5/P4)**((Gama-1)/Gama);# [K]\n", + "\n", + "\n", + "T5 = T4-n_tur*(T4-T5_prim);# temperature, [K]\n", + "\n", + "PO = m_dot*cp*(T4-T5);# power output\n", + "print ' (b) The power output from the free power turbine is (kW) = ',round(PO)\n", + "\n", + "# (c)\n", + "\n", + "n_the = (T4-T5)/(T3-T2)*100;# thermal effficiency \n", + "print ' (c) The thermal efficiency of the plant is (percent) = ',round(n_the)\n", + "\n", + "# (d)\n", + "\n", + "WR = (T4-T5)/(T3-T5);# work ratio\n", + "print ' (d) The work ratio is = ',round(WR,2)\n", + "\n", + "# (e)\n", + "CE = (T3-T1)/T3;# carnot efficiency\n", + "print ' (e) The carnot efficiency is (percent) = ',round(CE*100)\n", + "\n", + "print 'The answers are a bit different due to rounding off error in textbook'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 564" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 16.5\n", + " (a) The pressure of the air after compression is (bar) = 14100.0\n", + " The temperature of the air after compression is (C) = 469.6\n", + " (b) The power developed by the gas turbine is (MW) = 51.66\n", + " (c) The air pressure as it leaves the gas turbine is (bar) = 714.0\n", + "Result in the book is not matching because they have taken pressure in mbar but in in question it is given in bar\n" + ] + } + ], + "source": [ + "#pg 564\n", + "print('Example 16.5');\n", + "\n", + "# aim : To determine\n", + "# (a) the pressure and temperature of the air compression \n", + "# (b) the power developed by the gas turbine\n", + "# (c) the temperature and pressure of the airentering the exhaust jet as it leaves the gas turbine \n", + "from math import log\n", + "# Given values\n", + "T1 = 273-22.4;# temperature, [K]\n", + "P1 = 470.;# pressure, [bar]\n", + "P2 = 30*P1; # [kN/m**2]\n", + "P3 = P2;# [kN/m**2]\n", + "T3 = 273.+960;# temperature, [K]\n", + "r = 1.25;# ratio of turbine power to compressor power\n", + "n_tur = .86;# isentropic efficiency of turbine\n", + "m_dot = 80.;# mass flow rate of air, [kg/s]\n", + "Gama = 1.41;# heat capacity ratio\n", + "cp = 1.05;# [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "# For compressor\n", + "T2_prim = T1*(P2/P1)**((Gama-1)/Gama);# [K]\n", + "# using n_tur=(T2_prim-T1)/(T2-T1)\n", + "T2 = T1+(T2_prim-T1)/n_tur;# temperature, [K]\n", + "\n", + "print ' (a) The pressure of the air after compression is (bar) = ',P2\n", + "\n", + "print ' The temperature of the air after compression is (C) = ',round(T2-273,1)\n", + "\n", + "# (b)\n", + "Td = r*(T2-T1);# temperature drop in turbine, [K]\n", + "PO = m_dot*cp*Td;# power output, [kW]\n", + "print ' (b) The power developed by the gas turbine is (MW) = ',round(PO*10**-3,2)\n", + "\n", + "# (c)\n", + "t3 = T3-273;# [C]\n", + "t4 = t3-Td;# temeprerature of air leaving turbine,[K]\n", + "Tdi = Td/n_tur;# isentropic temperature drop, [K]\n", + "T4_prim = t3-Tdi+273;# temperature, [K]\n", + "# using T4_prim=T3*(P4/P3)**((Gama-1)/Gama)\n", + "P4 = P3*(T4_prim/T3)**(Gama/(Gama-1));# exit air pressure of air, [kN/m**2]\n", + "\n", + "print ' (c) The air pressure as it leaves the gas turbine is (bar) = ',round(P4,0)\n", + "\n", + "print 'Result in the book is not matching because they have taken pressure in mbar but in in question it is given in bar'\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 566" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 16.6\n", + " (a) The mass of fuel oil used by the gas is (tonne/h) = 35.9\n", + " (b) The mass flow rate of steam from the boiler is (tonne/h) = 252.4\n", + " (c) The theoretical output from the steam turbine is (MW) = 40.06\n", + " (d) The overall thermal efficiency is (percent) = 44.3\n" + ] + } + ], + "source": [ + "#pg 566\n", + "print('Example 16.6');\n", + "\n", + "# aim : To determine\n", + "# (a) the mass of fuel oil used by the gas turbine\n", + "# (b) the mass flow of steam from the boiler \n", + "# (c) the theoretical output from the steam turbine\n", + "# (d) the overall theoretical thermal efficiency of the plant\n", + "\n", + "# given values\n", + "Po = 150.;# generating plant output, [MW]\n", + "n_the1 = .35;# thermal efficiency\n", + "CV = 43.;# calorific value of fuel, [MJ]\n", + "me = 400.;# flow rate of exhaust gas, [kg/s]\n", + "T = 90.;# boiler exit temperature, [C]\n", + "T1 = 550.;# exhaust gas temperature, [C]\n", + "P2 = 10.;# steam generation pressure, [MN/m**2]\n", + "T2 = 450.;# boiler exit temperature, [C]\n", + "Tf = 140.;# feed water temperature, [C]\n", + "n_tur = .86;# turbine efficiency\n", + "P3 = .5;# exhaust temperature, [MN/m**2]\n", + "n_boi = .92;# boiler thermal efficiency\n", + "cp = 1.1;# heat capacity, [kJ/kg]\n", + "\n", + "\n", + "# solution\n", + "# (a)\n", + "ER = Po*3600/n_the1;# energy requirement from the fuel, [MJ/h]\n", + "mf = ER/CV*10**-3;# fuel required, [tonne/h]\n", + "print ' (a) The mass of fuel oil used by the gas is (tonne/h) = ',round(mf,1)\n", + "\n", + "# (b) \n", + "\n", + "ET = me*cp*(T1-T)*3600*n_boi;# energy transferred to steam,[kJ/h]\n", + "# from steam table\n", + "h1 = 3244;# specific enthalpy, [kJ/kg]\n", + "hf = 588.5;# specific enthalpy, [kJ/kg]\n", + "ERR = h1-hf;# energy required to raise steam, [kJ/kg]\n", + "ms = ET/ERR*10**-3;# mass flow of steam, [tonne/h]\n", + "print ' (b) The mass flow rate of steam from the boiler is (tonne/h) = ',round(ms,1)\n", + "\n", + "# again from steam table\n", + "s1 = 6.424;# specific entropy, [kJ/kg K]\n", + "sf2 = 1.86;# specific entropy, [kJ/kg K\n", + "sg2 = 6.819;# specific entropy, [kJ/kg K]\n", + "\n", + "hf2 = 640.1;# specific enthalpy,[kJ/kg]\n", + "hg2 = 2747.5;# specific enthalpy, [kJ/kg]\n", + "# for ths process s1=s2=sf2+x2*(sg2-sf2)\n", + "s2 = s1;\n", + "# hence\n", + "x2 = (s2-sf2)/(sg2-sf2);# dryness fraction\n", + "\n", + "h2_prim = hf2+x2*(hg2-hf2);# specific enthalpy of steam, [kJ/kg]\n", + "\n", + "TO = n_tur*(h1-h2_prim);#theoretical steam turbine output, [kJ/kg]\n", + "TOt = TO*ms/3600.;# total theoretical steam turbine output, [MW]\n", + "\n", + "print ' (c) The theoretical output from the steam turbine is (MW) = ',round(TOt,2)\n", + "\n", + "# (d)\n", + "n_tho = (Po+TOt)*n_the1/Po;# overall theoretical thermal efficiency\n", + "print ' (d) The overall thermal efficiency is (percent) = ',round(n_tho*100,1)\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter17.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter17.ipynb new file mode 100644 index 00000000..69177875 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter17.ipynb @@ -0,0 +1,543 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 17 - Engine and plant trails" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 589 " + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 17.1\n", + " The Indicated power is (kW) = 26.2\n", + " The Brake power is (kW) = 22.0\n", + " The mechanical efficiency is (percent) = 837.0\n", + "Energy can be tabulated as :-\n", + "----------------------------------------------------------------------------------------------------\n", + " kJ/s Percentage \n", + "----------------------------------------------------------------------------------------------------\n", + " Energy from fuel 88.0 100.0 \n", + " Energy to brake power 22.0 25.0 \n", + " Energy to coolant 20.7 23.5 \n", + " Energy to exhaust 33.6 38.2 \n", + " Energy to suroundings,etc. 11.8 13.4\n" + ] + } + ], + "source": [ + "#pg 589\n", + "print('Example 17.1');\n", + "\n", + "# aim : To determine\n", + "# the indicated and brake output and the mechanicl efficiency\n", + "# draw up an overall energy balance and as % age\n", + "import math\n", + "# given values\n", + "h = 21;# height of indicator diagram, [mm]\n", + "ic = 27;# indicator calibration, [kN/m**2 per mm]\n", + "sv = 14*10**-3;# swept volume of the cylinder;,[m**3]\n", + "N = 6.6;# speed of engine, [rev/s]\n", + "ebl = 77;# effective brake load, [kg]\n", + "ebr = .7;# effective brake radious, [m]\n", + "fc = .002;# fuel consumption, [kg/s]\n", + "CV = 44000;# calorific value of fuel, [kJ/kg]\n", + "cwc = .15;# cooling water circulation, [kg/s]\n", + "Ti = 38;# cooling water inlet temperature, [C]\n", + "To = 71;# cooling water outlet temperature, [C]\n", + "c = 4.18;# specific heat capacity of water, [kJ/kg]\n", + "eeg = 33.6;# energy to exhaust gases, [kJ/s]\n", + "g = 9.81;# gravitational acceleration, [m/s**2]\n", + "\n", + "# solution\n", + "PM = ic*h;# mean effective pressure, [kN/m**2]\n", + "LA = sv;# swept volume of the cylinder, [m**3]\n", + "ip = PM*LA*N/2;# indicated power,[kW]\n", + "T = ebl*g*ebr;# torque, [N*m]\n", + "bp = 2*math.pi*N*T;# brake power, [W]\n", + "n_mech = bp/ip;# mechanical efficiency\n", + "print ' The Indicated power is (kW) = ',round(ip,2)\n", + "print ' The Brake power is (kW) = ',round(bp*10**-3)\n", + "print ' The mechanical efficiency is (percent) = ',round(n_mech)\n", + "\n", + "ef = CV*fc;# energy from fuel, [kJ/s]\n", + "eb = bp*10**-3;# energy to brake power,[kJ/s]\n", + "ec = cwc*c*(To-Ti);# energy to coolant,[kJ/s]\n", + "es = ef-(eb+ec+eeg);# energy to surrounding,[kJ/s]\n", + "\n", + "print('Energy can be tabulated as :-');\n", + "print('----------------------------------------------------------------------------------------------------');\n", + "print(' kJ/s Percentage ')\n", + "print('----------------------------------------------------------------------------------------------------');\n", + "print ' Energy from fuel ',ef,' ',ef/ef*100,'\\n Energy to brake power ',round(eb),' ',round(eb/ef*100),'\\n Energy to coolant ',round(ec,1),' ',round(ec/ef*100,1),' \\n Energy to exhaust ',eeg,' ',round(eeg/ef*100,1),'\\n Energy to suroundings,etc. ',round(es,1),' ',round(es/ef*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 591" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 17.2\n", + " (a) The brake power is (kW) = 14.657\n", + " (b) The indicated power is (kW) = 18.2\n", + " (c) The mechanical efficiency is (percent) = 80.4\n", + " (d) The indicated thermal efficiency is (percent) = 12.94\n", + " (e) The brake steam consumption is (kg/kWh) = 13.75\n", + " (f) Energy supplied/min is (kJ) = 9092.0\n", + " Energy to bp/min is (kJ) = 879.0\n", + " Energy to condenser cooling water/min is (kJ) = 5196.0\n", + " Energy to condensate/min is (kJ) = 534.0\n", + " Energy to surrounding, etc/min is (kJ) = 2483.0\n", + "answer in the book is misprinted for Es\n" + ] + } + ], + "source": [ + "#pg 591\n", + "print('Example 17.2');\n", + "import math\n", + "# aim : To determine\n", + "# (a) bp\n", + "# (b) ip\n", + "# (c) mechanical efficiency\n", + "# (d) indicated thermal efficiency\n", + "# (e) brake specific steam consumption\n", + "# (f) draw up complete energy account for the test one-minute basis taking 0 C as datum\n", + "\n", + "# given values\n", + "d = 200.*10**-3;# cylinder diameter, [mm]\n", + "L = 250.*10**-3;# stroke, [mm]\n", + "N = 5.;# speed, [rev/s]\n", + "r = .75/2;# effective radious of brake wheel, [m]\n", + "Ps = 800.;# stop valve pressure, [kN/m**2]\n", + "x = .97;# dryness fraction of steam\n", + "BL = 136.;# brake load, [kg]\n", + "SL = 90.;# spring balance load, [N]\n", + "PM = 232.;# mean effective pressure, [kN/m**2]\n", + "Pc = 10.;# condenser pressure, [kN/m**2]\n", + "m_dot = 3.36;# steam consumption, [kg/min]\n", + "CC = 113.;# condenser cooling water, [kg/min]\n", + "Tr = 11.;# temperature rise of condenser cooling water, [K]\n", + "Tc = 38.;# condensate temperature, [C]\n", + "C = 4.18;# heat capacity of water, [kJ/kg K]\n", + "g = 9.81;# gravitational acceleration, [m/s**2]\n", + "\n", + "# solution\n", + "# from steam table\n", + "# at 800 kN/m**2\n", + "tf1 = 170.4;# saturation temperature, [C]\n", + "hf1 = 720.9;# [kJ/kg]\n", + "hfg1 = 2046.5;# [kJ/kg]\n", + "hg1 = 2767.5;# [kJ/kg]\n", + "vg1 = .2403;# [m**3/kg]\n", + "\n", + "# at 10 kN/m**2\n", + "tf2 = 45.8;# saturation temperature, [C]\n", + "hf2 = 191.8;# [kJ/kg]\n", + "hfg2 = 2392.9;# [kJ/kg]\n", + "hg2 = 2584.8;# [kJ/kg]\n", + "vg2 = 14.67;# [m**3/kg]\n", + "\n", + "# (a)\n", + "T = (BL*g-SL)*r;# torque, [Nm]\n", + "bp = 2*math.pi*N*T*10**-3;# brake power,[W]\n", + "print ' (a) The brake power is (kW) = ',round(bp,3)\n", + "\n", + "# (b)\n", + "A = math.pi*d**2/4;# area, [m**2]\n", + "ip = PM*L*A*N*2;# double-acting so*2, [kW]\n", + "print ' (b) The indicated power is (kW) = ',round(ip,1)\n", + "\n", + "# (c)\n", + "n_mec = bp/ip;# mechanical efficiency\n", + "print ' (c) The mechanical efficiency is (percent) = ',round(n_mec*100,1)\n", + "\n", + "# (d)\n", + "h = hf1+x*hfg1;# [kJ/kg]\n", + "hf = hf2;\n", + "ITE = ip/((m_dot/60)*(h-hf));# indicated thermal efficiency\n", + "print ' (d) The indicated thermal efficiency is (percent) = ',round(ITE*100,2)\n", + "# (e)\n", + "Bsc=m_dot*60/bp;# brake specific steam consumption, [kg/kWh]\n", + "print ' (e) The brake steam consumption is (kg/kWh) = ',round(Bsc,2)\n", + "\n", + "# (f)\n", + "# energy balanvce reckoned from 0 C\n", + "Es = m_dot*h;# energy supplied, [kJ]\n", + "Eb = bp*60;# energy to bp, [kJ]\n", + "Ecc = CC*C*Tr;# energy to condensate cooling water, [kJ]\n", + "Ec = m_dot*C*Tc;# energy to condensate, [kJ]\n", + "Ese = Es-Eb-Ecc-Ec;# energy to surrounding,etc, [kJ]\n", + "\n", + "print ' (f) Energy supplied/min is (kJ) = ',round(Es)\n", + "\n", + "print ' Energy to bp/min is (kJ) = ',round(Eb)\n", + "print ' Energy to condenser cooling water/min is (kJ) = ',round(Ecc)\n", + "print ' Energy to condensate/min is (kJ) = ',round(Ec)\n", + "print ' Energy to surrounding, etc/min is (kJ) = ',round(Ese)\n", + "\n", + "print 'answer in the book is misprinted for Es'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 593" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 17.3\n", + " (a) The Brake power is (kW) = 60.5\n", + " (b) The brake specific fuel consumption is (kg/kWh) = 0.309\n", + " (c) The indicated thermal efficiency is (percent) = 33.2\n", + " (d) Energy from fuel is (kJ) = 13184.0\n", + " Energy to brake power is (kJ) = 3629.0\n", + " Energy to cooling water is (kJ) = 4038.0\n", + " Energy to exhaust is (kJ) = 3739.0\n", + " Energy to surrounding, etc is (kJ) = 1778.0\n", + "The answer is a bit different due to rounding off error in textbook\n" + ] + } + ], + "source": [ + "#pg 593\n", + "print('Example 17.3');\n", + "\n", + "# aim : To determine\n", + "# (a) the brake power\n", + "# (b) the brake specific fuel consumption\n", + "# (c) the indicated thermal efficiency\n", + "# (d) the energy balance, expressing the various items\n", + "import math\n", + "# given values\n", + "t = 30.;# duration of trial, [min]\n", + "N = 1750.;# speed of engine, [rev/min]\n", + "T = 330.;# brake torque, [Nm]\n", + "mf = 9.35;# fuel consumption, [kg]\n", + "CV = 42300.;# calorific value of fuel, [kJ/kg]\n", + "cwc = 483.;# jacket cooling water circulation, [kg]\n", + "Ti = 17.;# inlet temperature, [C]\n", + "To = 77.;# outlet temperature, [C]\n", + "ma = 182.;# air consumption, [kg]\n", + "Te = 486.;# exhaust temperature, [C]\n", + "Ta = 17.;# atmospheric temperature, [C]\n", + "n_mec = .83;# mechanical efficiency\n", + "c = 1.25;# mean specific heat capacity of exhaust gas, [kJ/kg K]\n", + "C = 4.18;# specific heat capacity, [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "bp = 2*math.pi*N*T/60*10**-3;# brake power, [kW]\n", + "print ' (a) The Brake power is (kW) = ',round(bp,1)\n", + "\n", + "# (b)\n", + "bsf = mf*2/bp;#brake specific fuel consumption, [kg/kWh]\n", + "print ' (b) The brake specific fuel consumption is (kg/kWh) = ',round(bsf,3)\n", + "\n", + "# (c)\n", + "ip = bp/n_mec;# indicated power, [kW]\n", + "ITE = ip/(2*mf*CV/3600);# indicated thermal efficiency\n", + "print ' (c) The indicated thermal efficiency is (percent) = ',round(ITE*100,1)\n", + "\n", + "# (d)\n", + "# taking basis one minute \n", + "ef = CV*mf/30;# energy from fuel, [kJ]\n", + "eb = bp*60;# energy to brake power,[kJ]\n", + "ec = cwc/30*C*(To-Ti);# energy to cooling water,[kJ]\n", + "ee = (ma+mf)/30*c*(Te-Ta);# energy to exhaust, [kJ]\n", + "es = ef-(eb+ec+ee);# energy to surrounding,etc,[kJ]\n", + "\n", + "print ' (d) Energy from fuel is (kJ) = ',round(ef)\n", + "print ' Energy to brake power is (kJ) = ',round(eb)\n", + "print ' Energy to cooling water is (kJ) = ',round(ec)\n", + "print ' Energy to exhaust is (kJ) = ',round(ee)\n", + "print ' Energy to surrounding, etc is (kJ) = ',round(es)\n", + " \n", + "print 'The answer is a bit different due to rounding off error in textbook'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 594" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 17.4\n", + " (a) The indicated power of the engine is (kW) = 69.9\n", + " (b) The mechanical efficiency of the engine is (percent) = 74.4\n" + ] + } + ], + "source": [ + "#pg 594\n", + "print('Example 17.4');\n", + "\n", + "# aim : To determine\n", + "# (a) the indicated power of the engine\n", + "# (b) the mechanical efficiency of the engine\n", + "\n", + "# given values\n", + "bp = 52;# brake power output, [kW]\n", + "bp1 = 40.5;# brake power of cylinder cut1, [kW]\n", + "bp2 = 40.2;# brake power of cylinder cut2, [kW]\n", + "bp3 = 40.1;# brake power of cylinder cut3, [kW]\n", + "bp4 = 40.6;# brake power of cylinder cut4, [kW]\n", + "bp5 = 40.7;# brake power of cylinder cut5, [kW]\n", + "bp6 = 40.0;# brake power of cylinder cut6, [kW]\n", + "\n", + "# sollution\n", + "ip1 = bp-bp1;# indicated power of cylinder cut1, [kW]\n", + "ip2 = bp-bp2;# indicated power of cylinder cut2, [kW]\n", + "ip3 = bp-bp3;# indicated power of cylinder cut3, [kW]\n", + "ip4 = bp-bp4;# indicated power of cylinder cut4, [kW]\n", + "ip5 = bp-bp5;# indicated power of cylinder cut5, [kW]\n", + "ip6 = bp-bp6;# indicated power of cylinder cut6, [kW]\n", + "\n", + "ip = ip1+ip2+ip3+ip4+ip5+ip6;# indicated power of engine,[kW]\n", + "print ' (a) The indicated power of the engine is (kW) = ',ip\n", + "\n", + "# (b)\n", + "n_mec = bp/ip;# mechanical efficiency\n", + "print ' (b) The mechanical efficiency of the engine is (percent) = ',round(n_mec*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 595" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 17.5\n", + " The Brake power is (kW) = 29.3\n", + " The Indicated power is (kW) = 37.3\n", + " The mechanical efficiency is (percent) = 78.8\n", + "Energy can be tabulated as :-\n", + "----------------------------------------------------------------------------------------------------\n", + " kJ/s Percentage \n", + "----------------------------------------------------------------------------------------------------\n", + " Energy from fuel 135.3 100.0 \n", + " Energy to brake power 29.3 21.7 \n", + " Energy to exhaust 35.4 26.0 \n", + " Energy to coolant 44.5 32.9 \n", + " Energy to suroundings,etc. 26.1 19.3\n", + "there is minor variation in the result reported in the book due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 595\n", + "print('Example 17.5');\n", + "\n", + "# aim : To determine\n", + "# the brake power,indicated power and mechanicl efficiency\n", + "# draw up an energy balance and as % age of the energy supplied\n", + "\n", + "# given values\n", + "N = 50.;# speed, [rev/s]\n", + "BL = 267.;# break load.,[N]\n", + "BL1 = 178.;# break load of cylinder cut1, [N]\n", + "BL2 = 187.;# break load of cylinder cut2, [N]\n", + "BL3 = 182.;# break load of cylinder cut3, [N]\n", + "BL4 = 182.;# break load of cylinder cut4, [N]\n", + "\n", + "FC = .568/130;# fuel consumption, [L/s]\n", + "s = .72;# specific gravity of fuel\n", + "CV = 43000;# calorific value of fuel, [kJ/kg]\n", + "\n", + "Te = 760;# exhaust temperature, [C]\n", + "c = 1.015;# specific heat capacity of exhaust gas, [kJ/kg K]\n", + "Ti = 18;# cooling water inlet temperature, [C]\n", + "To = 56;# cooling water outlet temperature, [C]\n", + "mw = .28;# cooling water flow rate, [kg/s]\n", + "Ta = 21;# ambient tempearture, [C]\n", + "C = 4.18;# specific heat capacity of cooling water, [kJ/kg K]\n", + "\n", + "# solution\n", + "bp = BL*N/455;# brake power of engine, [kW]\n", + "bp1 = BL1*N/455;# brake power of cylinder cut1, [kW]\n", + "i1 = bp-bp1;# indicated power of cylinder cut1, [kW]\n", + "bp2 = BL2*N/455;# brake power of cylinder cut2, [kW]\n", + "i2 = bp-bp2;# indicated power of cylinder cut2, [kW]\n", + "bp3 = BL3*N/455;# brake power of cylinder cut3, [kW]\n", + "i3 = bp-bp3;# indicated power of cylinder cut3, [kW]\n", + "bp4 = BL4*N/455;# brake power of cylinder cut4, [kW]\n", + "i4 = bp-bp4;# indicated power of cylinder cut4, [kW]\n", + "\n", + "ip = i1+i2+i3+i4;# indicated power of engine, [kW]\n", + "n_mec = bp/ip;# mechanical efficiency\n", + "\n", + "print ' The Brake power is (kW) = ',round(bp,1)\n", + "print ' The Indicated power is (kW) = ',round(ip,1)\n", + "print ' The mechanical efficiency is (percent) = ',round(n_mec*100,1)\n", + "\n", + "mf = FC*s;# mass of fuel/s, [kg]\n", + "ef = CV*mf;# energy from fuel/s, [kJ]\n", + "me = 15*mf;# mass of exhaust/s,[kg],(given in condition)\n", + "ee = me*c*(Te-Ta);# energy to exhaust/s,[kJ]\n", + "ec = mw*C*(To-Ti);# energy to cooling water/s,[kJ]\n", + "es = ef-(ee+ec+bp);# energy to surrounding,etc/s,[kJ]\n", + "\n", + "print('Energy can be tabulated as :-');\n", + "print('----------------------------------------------------------------------------------------------------');\n", + "print(' kJ/s Percentage ')\n", + "print('----------------------------------------------------------------------------------------------------');\n", + "print ' Energy from fuel ',round(ef,1),' ',ef/ef*100,'\\n Energy to brake power ',round(bp,1),' ',round(bp/ef*100.,1),'\\n Energy to exhaust ',round(ee,1),' ',round(ee/ef*100),'\\n Energy to coolant ',round(ec,1),' ',round(ec/ef*100,1),'\\n Energy to suroundings,etc. ',round(es,1),' ',round(es/ef*100,1)\n", + "\n", + "print 'there is minor variation in the result reported in the book due to rounding off error'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 596" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 17.6\n", + " (a) The brake power is (MW) = 23.719\n", + " (b) The fuel consumption is (tonne/h) = 4.74\n", + " (c) The brake thermal efficiency is (percent) = 42.0\n" + ] + } + ], + "source": [ + "#pg 596\n", + "print('Example 17.6');\n", + "\n", + "# aim : To determine \n", + "# (a) the break power of engine\n", + "# (b) the fuel consumption of the engine\n", + "# (c) the brake thermal efficiency of the engine\n", + "import math\n", + "# given values\n", + "d = 850*10**-3;# bore , [m]\n", + "L = 2200*10**-3;# stroke, [m]\n", + "PMb = 15;# BMEP of cylinder, [bar]\n", + "N = 95./60;# speed of engine, [rev/s]\n", + "sfc = .2;# specific fuel oil consumption, [kg/kWh]\n", + "CV = 43000;# calorific value of the fuel oil, [kJ/kg]\n", + "\n", + "# solution\n", + "# (a)\n", + "A = math.pi*d**2/4;# area, [m**2]\n", + "bp = PMb*L*A*N*8/10;# brake power,[MW]\n", + "print ' (a) The brake power is (MW) = ',round(bp,3)\n", + "\n", + "# (b)\n", + "FC = bp*sfc;# fuel consumption, [kg/h]\n", + "print ' (b) The fuel consumption is (tonne/h) = ',round(FC,2)\n", + "\n", + "# (c)\n", + "mf = FC/3600;# fuel used, [kg/s]\n", + "n_the = bp/(mf*CV);# brake thermal efficiency\n", + "print ' (c) The brake thermal efficiency is (percent) = ',round(n_the*100)\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter18.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter18.ipynb new file mode 100644 index 00000000..696c7fa6 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter18.ipynb @@ -0,0 +1,205 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 18 - Refrigeration" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 612" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 18.1\n", + " (a) The coefficient of performance of the refrigerator is = 4.49\n", + " (b) The mass flow of refrigerant/h is (kg) = 166.94\n", + " (c) The mass flow of water required is (kg/h) = 579.74\n", + "The answer is a bit different due to rounding off error in textbook\n" + ] + } + ], + "source": [ + "#pg 612\n", + "print('Example 18.1');\n", + "\n", + "# aim : To determine\n", + "# (a) the coefficient of performance\n", + "# (b) the mass flow of the refrigerant\n", + "# (c) the cooling water required by the condenser\n", + "import math\n", + "from math import log\n", + "# given values\n", + "P1 = 462.47;# pressure limit, [kN/m**2]\n", + "P3 = 1785.90;# pressure limit, [kN/m**2]\n", + "T2 = 273.+59;# entering saturation temperature, [K]\n", + "T5 = 273.+32;# exit temperature of condenser, [K]\n", + "d = 75*10**-3;# bore, [m]\n", + "L = d;# stroke, [m]\n", + "N = 8;# engine speed, [rev/s]\n", + "VE = .8;# olumetric efficiency\n", + "cpL = 1.32;# heat capacity of liquid, [kJ/kg K]\n", + "c = 4.187;# heat capacity of water, [kj/kg K]\n", + "\n", + "# solution\n", + "# from given table\n", + "# at P1\n", + "h1 = 231.4;# specific enthalpy, [kJ/kg]\n", + "s1 = .8614;# specific entropy,[ kJ/kg K\n", + "v1 = .04573;# specific volume, [m**3/kg]\n", + "\n", + "# at P3\n", + "h3 = 246.4;# specific enthalpy, [kJ/kg]\n", + "s3 = .8093;# specific entropy,[ kJ/kg K\n", + "v3 = .04573;# specific volume, [m**3/kg]\n", + "T3= 273+40;# saturation temperature, [K]\n", + "h4 = 99.27;# specific enthalpy, [kJ/kg]\n", + "# (a)\n", + "s2 = s1;# specific entropy, [kJ/kg k]\n", + "# using s2=s3+cpv*log(T2/T3)\n", + "cpv = (s2-s3)/log(T2/T3);# heat capacity, [kj/kg k]\n", + "\n", + "# from Fig.18.8\n", + "T4 = T3;\n", + "h2 = h3+cpv*(T2-T3);# specific enthalpy, [kJ/kg]\n", + "h5 = h4-cpL*(T4-T5);# specific enthalpy, [kJ/kg]\n", + "h6 = h5;\n", + "COP = (h1-h6)/(h2-h1);# coefficient of performance\n", + "print ' (a) The coefficient of performance of the refrigerator is = ',round(COP,2)\n", + "\n", + "# (b)\n", + "SV = math.pi/4*d**2*L;# swept volume of compressor/rev, [m**3]\n", + "ESV = SV*VE*N*3600;# effective swept volume/h, [m**3]\n", + "m = ESV/v1;# mass flow of refrigerant/h,[kg]\n", + "print ' (b) The mass flow of refrigerant/h is (kg) = ',round(m,2)\n", + "\n", + "# (c)\n", + "dT = 12;# temperature limit, [C]\n", + "Q = m*(h2-h5);# heat transfer in condenser/h, [kJ]\n", + "# using Q=m_dot*c*dT, so\n", + "m_dot = Q/(c*dT);# mass flow of water required, [kg/h]\n", + "print ' (c) The mass flow of water required is (kg/h) = ',round(m_dot,2)\n", + "\n", + "print 'The answer is a bit different due to rounding off error in textbook'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 614" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 18.2\n", + " (a) The mass flow of R401 is (kg/h) = 592.6\n", + " (b) The dryness fraction of R401 at the entry to the evaporator is = 0.244\n", + " (c) The power to driving motor is (kW) = 5.86\n", + " (d) The ratio of heat transferred from condenser to the power required to the motor is = 4.74 :1\n" + ] + } + ], + "source": [ + "#pg 614\n", + "print('Example 18.2');\n", + "\n", + "# aim : To determine\n", + "# (a) the mass flow of R401\n", + "# (b) the dryness fraction of R401 at the entry to the evaporator\n", + "# (c) the power of driving motor\n", + "# (d) the ratio of heat transferred from condenser to the power required to the motor\n", + "from math import log\n", + "# given values\n", + "P1 = 411.2;# pressure limit, [kN/m^2]\n", + "P3 = 1118.9;# pressure limit, [kN/m^2]\n", + "Q = 100*10**3;# heat transfer from the condenser,[kJ/h]\n", + "T2 = 273+60;# entering saturation temperature, [K]\n", + "\n", + "# given\n", + "# from given table\n", + "# at P1\n", + "h1 = 409.3;# specific enthalpy, [kJ/kg]\n", + "s1 = 1.7431;# specific entropy,[ kJ/kg K\n", + "\n", + "# at P3\n", + "h3 = 426.4;# specific enthalpy, [kJ/kg]\n", + "s3 = 1.7192;# specific entropy,[ kJ/kg K\n", + "T3 = 273.+50;# saturation temperature, [K]\n", + "h4 = 265.5;# specific enthalpy, [kJ/kg]\n", + "# (a)\n", + "s2 = s1;# specific entropy, [kJ/kg k]\n", + "# using s2=s3+cpv*log(T2/T3)\n", + "cpv = (s2-s3)/log(T2/T3);# heat capacity, [kj/kg k]\n", + "\n", + "# from Fig.18.8\n", + "h2 = h3+cpv*(T2-T3);# specific enthalpy, [kJ/kg]\n", + "Qc = h2-h4;# heat transfer from condenser, [kJ/kg]\n", + "mR401 = Q/Qc;# mass flow of R401, [kg]\n", + "print ' (a) The mass flow of R401 is (kg/h) = ',round(mR401,1)\n", + "\n", + "# (b)\n", + "hf1 = 219;# specific enthalpy, [kJ/kg]\n", + "h5 = h4;\n", + "# using h5=hf1+s5*(h1-hf1),so\n", + "x5 = (h5-hf1)/(h1-hf1);# dryness fraction\n", + "print ' (b) The dryness fraction of R401 at the entry to the evaporator is = ',round(x5,3)\n", + "\n", + "# (c)\n", + "P = mR401*(h2-h1)/3600/.7;# power to driving motor, [kW]\n", + "print ' (c) The power to driving motor is (kW) = ',round(P,2)\n", + "\n", + "# (d)\n", + "r = Q/3600./P;# ratio\n", + "print ' (d) The ratio of heat transferred from condenser to the power required to the motor is = ',round(r,2),\":1\"\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter19.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter19.ipynb new file mode 100644 index 00000000..a351bd14 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter19.ipynb @@ -0,0 +1,353 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 19 - Psychrometry" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 625" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 19.1\n", + " (a) The mass of water vapor in the humid air is (kg) = 0.0087\n", + " The specific volume of humid air is (m^3/kg) = 0.811\n", + " (b) The mass of water vapor in the humid air is (kg) = 0.029\n", + " The specific volume of humid air is (m^3/kg) = 0.881\n", + " On the warm day the air contains 2.5 times the mass of water vapor as on the cool day \n", + "\n" + ] + } + ], + "source": [ + "#pg 625\n", + "print('Example 19.1');\n", + "\n", + "# aim : To compare the moisture content and the true specific volumes of atmosphere air \n", + "# (a) temperature is 12 C and the air is saturaded\n", + "# (b) temperature is 31 C and air is .75 saturated\n", + "\n", + "# Given values\n", + "P_atm = 101.4;# atmospheric pressure, [kN/m^2]\n", + "R = .287;# [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "T = 273+12;# air temperature, [K]\n", + "# From steam table at 12 C\n", + "p = 1.4;# [kN/m^2]\n", + "vg = 93.9;# [m^3/kg]\n", + "pa = P_atm-p;# partial pressure of the dry air, [kN/m^2]\n", + "va = R*T/pa;# [m^3/kg]\n", + "\n", + "mw = va/vg;# mass of water vapor in the air,[kg]\n", + "v = va/(1+mw);# specific volume of humid air, [m^3/kg]\n", + "\n", + "print ' (a) The mass of water vapor in the humid air is (kg) = ',round(mw,4)\n", + "print ' The specific volume of humid air is (m^3/kg) = ',round(v,3)\n", + "\n", + "# (b)\n", + "x = .75;# dryness fraction\n", + "T = 273.+31;# air temperature, [K]\n", + "# From steam table\n", + "p = 4.5;# [kN/m^2]\n", + "vg = 31.1;# [m^3/kg]\n", + "pa = P_atm-p;# [kN/m^2]\n", + "va = R*T/pa;# [m^3/kg]\n", + "mw1= va/vg;# mass of water vapor in the air, [kg]\n", + "mw_actual = mw1*x;# actual mass of vapor, [kg]\n", + "v = va/(1+mw_actual);# true specific volume of humid air,[m^3/kg] \n", + "\n", + "print ' (b) The mass of water vapor in the humid air is (kg) = ',round(mw1,4)\n", + "print ' The specific volume of humid air is (m^3/kg) = ',round(v,3)\n", + "\n", + "ewv = mw_actual/mw ;\n", + "print ' On the warm day the air contains ',round(ewv,1),' times the mass of water vapor as on the cool day \\n'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 626" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 19.2\n", + " (a) The partial pressure of vapor is (kN/m^2) = 1.521\n", + " The partial pressure of dry air is (kN/m^2) = 98.479\n", + " (b) The specific humidity of the mixture is (kg/kg dry air) = 0.0096\n", + " (c) The composition of the mixture is = 0.99\n" + ] + } + ], + "source": [ + "#pg 626\n", + "print('Example 19.2');\n", + "\n", + "# aim : To determine\n", + "# (a) the partial pressures of the vapor and the dry air\n", + "# (b) the specific humidity of the mixture\n", + "# (c) the composition of the mixture\n", + "\n", + "# Given values\n", + "phi = .65;# Relative humidity\n", + "T = 273.+20;# temperature, [K]\n", + "p = 100.;# barometric pressure, [kN/m^2]\n", + "\n", + "# solution\n", + "# (a)\n", + "# From the steam table at 20 C\n", + "pg = 2.34;# [kN/m^2]\n", + "ps = phi*pg;# partial pressure of vapor, [kN/m^2]\n", + "pa = p-ps;# partial pressure of dry air, [kN/m^2]\n", + "print ' (a) The partial pressure of vapor is (kN/m^2) = ',ps\n", + "print ' The partial pressure of dry air is (kN/m^2) = ',pa\n", + "\n", + "# (b)\n", + "# from equation [15]\n", + "omega = .622*ps/(p-ps);# specific humidity of the mixture\n", + "print ' (b) The specific humidity of the mixture is (kg/kg dry air) = ',round(omega,4)\n", + "\n", + "# (c)\n", + "# using eqn [1] from section 19.2\n", + "y = 1/(1+omega);# composition of the mixture\n", + "print ' (c) The composition of the mixture is = ',round(y,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 627" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 19.3\n", + " (a) The specific humidity is (kg/kg air) = 0.0119\n", + " (b) The dew point is (C) = 10.08\n", + " (c) The degree of superheat is (C) = 14.92\n", + " (d) The mass of condensate is (kg/kg dry air) = 0.003\n", + "there is calculation mistake in the book so answer is no matching\n" + ] + } + ], + "source": [ + "#pg 627\n", + "print('Example 19.3');\n", + "\n", + "# aim : To determine\n", + "# (a) the specific humidity\n", + "# (b) the dew point\n", + "# (c) the degree of superheat of the superheated vapor\n", + "# (d) the mass of condensate formed per kg of dry air if the moist air is cooled to 12 C\n", + "\n", + "# Given values\n", + "t = 25.;# C\n", + "T = 273.+25;# moist air temperature, [K]\n", + "phi = .6;# relative humidity\n", + "p = 101.3;# barometric pressure, [kN/m^2]\n", + "R = .287;# [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "# From steam table at 25 C\n", + "pg = 3.17;# [kN/m^2]\n", + "ps = phi*pg;# partial pressure of the vapor, [kN/m^2]\n", + "omega = .622*ps/(p-ps);# the specific humidity of air\n", + "\n", + "print ' (a) The specific humidity is (kg/kg air) = ',round(omega,4)\n", + "\n", + "# (b)\n", + "# Dew point is saturated temperature at ps is,\n", + "t_dew = 16.+2*(1.092-1.817)/(2.062-1.817);# [C]\n", + "print ' (b) The dew point is (C) = ',round(t_dew,2)\n", + "\n", + "# (c)\n", + "Dos = t-t_dew;# degree of superheat, [C]\n", + "print ' (c) The degree of superheat is (C) = ',round(Dos,2)\n", + "\n", + "# (d)\n", + "# at 25 C\n", + "pa = p-ps;# [kN/m^2]\n", + "va = R*T/pa;# [m^3/kg]\n", + "# at 16.69 C\n", + "vg = 73.4-(73.4-65.1)*.69/2;# [m^3/kg]\n", + "ms1= va/vg; \n", + "# at 12 C\n", + "vg = 93.8;# [m^3/kg]\n", + "ms2 = va/vg;\n", + "\n", + "m = ms1-ms2;# mas of condensate\n", + "print ' (d) The mass of condensate is (kg/kg dry air) = ',round(m,4)\n", + "\n", + "print 'there is calculation mistake in the book so answer is no matching'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 630" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Example 19.4\n", + " (a) The volume of air required is (m^3/h) = 107057.0\n", + " (b) The mass of water added is (kg/h) = 276.7\n", + " (c) The heat transfer required by dry air is (MJ/h) = 458.226\n", + " (d) The heat transferred required for vapor+supply water is (MJ/h) = 721.688\n", + " there is minor variation in the answer reported in the book due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 630\n", + "print(' Example 19.4');\n", + "\n", + "# aim : To determine\n", + "# (a) the volume of external saturated air\n", + "# (b) the mass of air\n", + "# (c) the heat transfer\n", + "# (d) the heat transfer required by the combind water vapour\n", + "\n", + "# given values\n", + "Vb = 56000.;# volume of building, [m^3]\n", + "T2 = 273.+20;# temperature of air in thebuilding, [K]\n", + "phi = .6;# relative humidity\n", + "T1 = 8+273.;# external air saturated temperature, [K]\n", + "p0 = 101.3;# atmospheric pressure, [kN/m^2]\n", + "cp = 2.093;# heat capacity of saturated steam, [kJ/kg K]\n", + "R = .287;# gas constant, [kJ/kg K]\n", + "\n", + "# solution\n", + "# from steam table at 20 C saturation pressure of steam is,\n", + "pg = 2.34;# [kN/m^2]\n", + "\n", + "# (a)\n", + "pvap = phi*pg;# partial pressure of vapor, [kN/m^2] \n", + "P = p0-pvap;# partial pressure of air, [kN/m^2]\n", + "V = 2*Vb;# air required, [m^3]\n", + "# at 8 C saturation pressure ia\n", + "pvap = 1.072;# [kN/m^2]\n", + "P2 = p0-pvap;# partial pressure of entry at 8 C, [kN/m^2]\n", + "\n", + "# using P1*V1/T1=P2*V2/T2;\n", + "V2 = P*V*T1/(T2*P2);# air required at 8 C, [m^3/h]\n", + "print ' (a) The volume of air required is (m^3/h) = ',round(V2)\n", + "\n", + "# (b)\n", + "# assuming\n", + "pg = 1.401;# pressure, [kN/m^2]\n", + "Tg = 273.+12;# [K]\n", + "vg = 93.8;# [m^3/kg]\n", + "# at constant pressure\n", + "v = vg*T2/Tg;# volume[m^3/kg]\n", + "mv = V/v;# mass of vapor in building at 20 C, [kg/h]\n", + "# from steam table at 8 C\n", + "vg2 = 121.;# [m^3/kg]\n", + "mve = V2/vg2;# mass of vapor supplied with saturated entry air, [kg/h]\n", + "mw = mv-mve;# mass of water added, [kg/h]\n", + "print ' (b) The mass of water added is (kg/h) = ',round(mw,1)\n", + "\n", + "# (c)\n", + "# for perfect gas\n", + "m = P2*V2/(R*T1);# [kg/h]\n", + "Cp = .287;# heat capacity, [kJ/kg K]\n", + "Q = m*Cp*(T2-T1);# heat transfer by dry air,[kJ/h]\n", + "print ' (c) The heat transfer required by dry air is (MJ/h) = ',round(Q*10**-3,3)\n", + "\n", + "# (d)\n", + "# from steam table\n", + "h1 = 2516.2;# specific enthalpy of saturated vapor at 8 C,[kJ/kg]\n", + "hs = 2523.6;# specific enthalpy of saturated vapor at 20 C, [kJ/kg]\n", + "h2 = hs+cp*(T2-T1);# specific enthalpy of vapor at 20 c, [kJ/kg]\n", + "Q1 = mve*(h2-h1);# heat transfer required for vapor, [kJ]\n", + "\n", + "# again from steam table\n", + "hf1 = 33.6;# [kJ/kg]\n", + "hg3 = 2538.2;# [kJ/kg]\n", + "Q2 = mw*(hg3-hf1);# heat transfer required for water, [kJ/h]\n", + "Qt = Q1+Q2;# total heat transfer, [kJ/h]\n", + "print ' (d) The heat transferred required for vapor+supply water is (MJ/h) = ',round(Qt*10**-3,3)\n", + "\n", + "print ' there is minor variation in the answer reported in the book due to rounding off error'\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter2.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter2.ipynb new file mode 100644 index 00000000..fa065c44 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter2.ipynb @@ -0,0 +1,365 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2 - Systems" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 39" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 2.1\n", + "The Change in total energy is, del_E (kJ) = 1100\n", + "Since del_E is positive, so there is an increase in total energy\n", + "There is mistake in the book's results unit\n" + ] + } + ], + "source": [ + "print 'Example 2.1'\n", + "#calculate the Change in total energy\n", + "\n", + "# Given values\n", + "Q = 2500; # Heat transferred into the system, [kJ]\n", + "W = 1400; # Work transferred from the system, [kJ]\n", + "\n", + "# solution\n", + "\n", + "# since process carried out on a closed system, so using equation [4]\n", + "del_E = Q-W; # Change in total energy, [kJ]\n", + "\n", + "# results\n", + "\n", + "print 'The Change in total energy is, del_E (kJ) = ',del_E\n", + "\n", + "if del_E >= 0:\n", + " print 'Since del_E is positive, so there is an increase in total energy'\n", + "else:\n", + " print 'Since del_E is negative, so there is an decrease in total energy'\n", + "\n", + "\n", + "print \"There is mistake in the book's results unit\"\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 39" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 2.2\n", + "The Heat transfer is, Q (kJ) = -700.0\n", + "Since Q < 0, so heat is transferred from the system\n" + ] + } + ], + "source": [ + "print 'Example 2.2'\n", + "#calculate the heat transfer\n", + "\n", + "# Given values\n", + "del_E = 3500.; # Increase in total energy of the system, [kJ]\n", + "W = -4200.; # Work transfer into the system, [kJ]\n", + "\n", + "# solution\n", + "# since process carried out on a closed system, so using equation [3]\n", + "Q = del_E+W;# [kJ]\n", + "\n", + "# results\n", + "print 'The Heat transfer is, Q (kJ) = ',Q\n", + "\n", + "if Q >=0:\n", + " print 'Since Q > 0, so heat is transferred into the system'\n", + "else:\n", + " print 'Since Q < 0, so heat is transferred from the system'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 40" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 2.3\n", + "The Work done is, W (kJ/kg) = 250\n", + "Since W > 0, so Work done by the engine per kilogram of working substance\n" + ] + } + ], + "source": [ + "print 'Example 2.3'\n", + "#calculate the Work done\n", + "\n", + "\n", + "# Given values\n", + "Q = -150; # Heat transferred out of the system, [kJ/kg]\n", + "del_u = -400; # Internal energy decreased ,[kJ/kg]\n", + "\n", + "# solution\n", + "# using equation [3],the non flow energy equation\n", + "# Q=del_u+W\n", + "W = Q-del_u; # [kJ/kg]\n", + "\n", + "# results\n", + "print 'The Work done is, W (kJ/kg) = ',W\n", + "\n", + "if W >=0:\n", + " print 'Since W > 0, so Work done by the engine per kilogram of working substance'\n", + "else:\n", + " print 'Since W < 0, so Work done on the engine per kilogram of working substance'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 44" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 2.4\n", + "workdone is, W (kJ/kg) = 550.6875\n", + "Since W>0, so Power is output from the system\n", + "The power output from the system is (kW) = 2202.75\n" + ] + } + ], + "source": [ + "print 'Example 2.4'\n", + "#calculate the power output and workdone\n", + "# Given values\n", + "m_dot = 4.; # fluid flow rate, [kg/s]\n", + "Q = -40.; # Heat loss to the surrounding, [kJ/kg]\n", + "\n", + "# At inlet \n", + "P1 = 600.; # pressure ,[kn/m**2]\n", + "C1 = 220.; # velocity ,[m/s]\n", + "u1 = 2200.; # internal energy, [kJ/kg]\n", + "v1 = .42; # specific volume, [m**3/kg]\n", + "\n", + "# At outlet\n", + "P2 = 150.; # pressure, [kN/m**2]\n", + "C2 = 145.; # velocity, [m/s]\n", + "u2 = 1650.; # internal energy, [kJ/kg]\n", + "v2 = 1.5; # specific volume, [m**3/kg]\n", + "\n", + "# solution\n", + "# for steady flow energy equation for the open system is given by\n", + "# u1+P1*v1+C1**2/2+Q=u2+P2*v2+C2**2/2+W\n", + "# hence\n", + "\n", + "W = (u1-u2)+(P1*v1-P2*v2)+(C1**2/2-C2**2/2)*10**-3+Q; # [kJ/kg]\n", + "\n", + "P_out = W*m_dot; # power out put from the system, [kW]\n", + "\n", + "# results\n", + "print 'workdone is, W (kJ/kg) = ',W\n", + "\n", + "if W >= 0:\n", + " print 'Since W>0, so Power is output from the system'\n", + "else:\n", + " print 'Since W<0, so Power is input to the system'\n", + "\n", + "# Hence\n", + "\n", + "print 'The power output from the system is (kW) = ',P_out\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 45" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 2.5\n", + "The temperature rise of the lead is (C) = 104.6\n" + ] + } + ], + "source": [ + "print 'Example 2.5'\n", + "#calculate the temperature rise\n", + "\n", + "\n", + "# Given values\n", + "del_P = 154.45; # pressure difference across the die, [MN/m**2]\n", + "rho = 11360.; # Density of the lead, [kg/m**3]\n", + "c = 130; # specific heat capacity of the lead, [J/kg*K]\n", + "\n", + "# solution\n", + "# since there is no cooling and no externel work is done, so energy balane becomes\n", + "# P1*V1+U1=P2*V2+U2 ,so\n", + "# del_U=U2-U1=P1*V1-P2*V2\n", + "\n", + "# also, for temperature rise, del_U=m*c*t, where, m is mass; c is specific heat capacity; and t is temperature rise\n", + "\n", + "# Also given that lead is incompressible, so V1=V2=V and assuming one m**3 of lead\n", + "\n", + "# using above equations\n", + "t = del_P/(rho*c)*10**6 ;# temperature rise [C]\n", + "\n", + "# results \n", + "print 'The temperature rise of the lead is (C) = ',round(t,1)\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 46" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 2.6\n", + "(a) The inlet area is, A1 (m^2) = 0.0425\n", + "(b) The exit velocity is, C2 (m/s) = 171.71\n", + "(c) The power developed by the turbine system is (kW) = 671.88\n" + ] + } + ], + "source": [ + "print 'Example 2.6'\n", + "#calculate the power developed, exit velocity and inlet area\n", + "\n", + "# Given values\n", + "m_dot = 4.5; # mass flow rate of air, [kg/s]\n", + "Q = -40.; # Heat transfer loss, [kJ/kg]\n", + "del_h = -200.; # specific enthalpy reduce, [kJ/kg]\n", + "\n", + "C1 = 90; # inlet velocity, [m/s]\n", + "v1 = .85; # inlet specific volume, [m**3/kg]\n", + "\n", + "v2 = 1.45; # exit specific volume, [m**3/kg]\n", + "A2 = .038; # exit area of turbine, [m**2]\n", + "\n", + "# solution\n", + "\n", + "# part (a)\n", + "# At inlet, by equation[4], m_dot=A1*C1/v1\n", + "A1 = m_dot*v1/C1;#inlet area, [m**2]\n", + "print '(a) The inlet area is, A1 (m^2) = ',A1\n", + "\n", + "# part (b), \n", + "# At outlet, since mass flow rate is same, so m_dot=A2*C2/v2, hence\n", + "C2 = m_dot*v2/A2; # Exit velocity,[m/s]\n", + "print '(b) The exit velocity is, C2 (m/s) = ',round(C2,2)\n", + "\n", + "# part (c)\n", + "# using steady flow equation, h1+C1**2/2+Q=h2+C2**2/2+W\n", + "W = -del_h+(C1**2/2-C2**2/2)*10**-3+Q; # [kJ/kg]\n", + "\n", + "# Hence power developed is\n", + "P = W*m_dot;# [kW]\n", + "print '(c) The power developed by the turbine system is (kW) = ',round(P,2)\n", + "\n", + "# End\n", + "\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/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter4.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter4.ipynb new file mode 100644 index 00000000..72f19875 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter4.ipynb @@ -0,0 +1,1296 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Steam and two phase systems" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 61" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.1\n", + "The specific liquid enthalpy (kJ/kg) = 640.1\n", + "The specific enthalpy of evaporation (kJ/kg) = 2107.4\n", + "The specific enthalpy of dry saturated steam (kJ/kg) = 2747.5\n" + ] + } + ], + "source": [ + "#pg 61\n", + "#calculate the specific liquid enthalpy of evaporation and dry saturated steam\n", + "print('Example 4.1');\n", + "\n", + "# aim : To determine\n", + "# the enthalpy\n", + "\n", + "# Given values\n", + "P = .50;# Pressure, [MN/m^2]\n", + "\n", + "# solution\n", + "\n", + "# From steam tables, at given pressure\n", + "hf = 640.1;# specific liquid enthalpy ,[kJ/kg]\n", + "hfg = 2107.4;# specific enthalpy of evaporation ,[kJ/kg]\n", + "hg = 2747.5; # specific enthalpy of dry saturated steam ,[kJ/kg]\n", + "tf = 151.8; # saturation temperature,[C]\n", + "#results\n", + "print 'The specific liquid enthalpy (kJ/kg) = ',hf\n", + "print 'The specific enthalpy of evaporation (kJ/kg) = ',hfg\n", + "print 'The specific enthalpy of dry saturated steam (kJ/kg) = ',hg\n", + "\t\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 61" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.2\n", + "The Saturation temperature (C) = 212.4\n", + "The Specific liquid enthalpy (kJ/kg) = 908.6\n", + "The Specific enthalpy of evaporation (kJ/kg) = 1888.6\n", + "The Specific enthalpy of dry saturated steam (kJ/kg) = 2797.2\n", + "The answers in the textbook are a bit different due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 61\n", + "#calculate the saturation temperature, specific enthalpy\n", + "print('Example 4.2');\n", + "import numpy\n", + "# aim : To determine \n", + "# saturation temperature and enthalpy\n", + "\n", + "# Given values\n", + "P = 2.04;# pressure, [MN/m^2]\n", + "\n", + "# solution\n", + "# since in the steam table values of enthalpy and saturation temperature at 2 and 2.1 MN?m^2 are given, so for knowing required values at given pressure,there is need to do interpolation\n", + "\n", + "# calculation of saturation temperature and results\n", + "# from steam table\n", + "# P in [MN/m^2] and tf in [C]\n", + "Table_P_tf_x=[2.1,2.0]\n", + "Table_P_tf_y=[214.9,212.4]\n", + "# using interpolation\n", + "tf = numpy.interp(P,Table_P_tf_x,Table_P_tf_y);# saturation temperature at given condition\n", + "print 'The Saturation temperature (C) = ',tf\n", + "\n", + "# calculation of specific liquid enthalpy\n", + "# from steam table\n", + "Table_P_hf_y = [920.0,908.6];# P in [MN/m^2] and hf in [kJ/kg]\n", + "Table_P_hf_x=[2.1,2.0]\n", + "# using interpolation\n", + "hf = numpy.interp(P,Table_P_hf_x,Table_P_hf_y); # enthalpy at given condition, [kJ/kg]\n", + "print 'The Specific liquid enthalpy (kJ/kg) = ',hf\n", + "\n", + "# calculation of specific enthalpy of evaporation\n", + "# from steam table\n", + "Table_P_hfg_x = [2.1,2.0];# P in [MN/m^2] and hfg in [kJ/kg]\n", + "Table_P_hfg_y=[1878.2,1888.6]\n", + "# using interpolation \n", + "hfg = numpy.interp(P,Table_P_hfg_x,Table_P_hfg_y); # enthalpy at given condition, [kJ/kg]\n", + "print 'The Specific enthalpy of evaporation (kJ/kg) = ',hfg\n", + "\n", + "# calculation of specific enthalpy of dry saturated steam\n", + "# from steam table\n", + "Table_P_hg_y = [2798.2,2797.2];#P in [MN/m^2] and hg in [kJ/kg]\n", + "Table_P_hg_x=[2.1,2.0]\n", + "# using interpolation\n", + "hg = numpy.interp(P,Table_P_hg_x,Table_P_hg_y); # enthalpy at given condition, [kJ/kg]\n", + "print 'The Specific enthalpy of dry saturated steam (kJ/kg) = ',hg\n", + "\n", + "print'The answers in the textbook are a bit different due to rounding off error'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 63" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.3\n", + "The specific enthalpy of steam at 2 MN/m^2 with temperature 250 C (kJ/kg) = 2902\n", + "The specific enthalpy at given T and P by alternative path (kJ/kg) = 2875.9\n" + ] + } + ], + "source": [ + "#pg 63\n", + "#calculate the specific enthalpy\n", + "print('Example 4.3');\n", + "\n", + "# aim : To determine\n", + "# the specific enthalpy\n", + "\n", + "# given values\n", + "P = 2; # pressure ,[MN/m^2]\n", + "t = 250; # Temperature, [C]\n", + "cp = 2.0934; # average value of specific heat capacity, [kJ/kg K]\n", + "\n", + "# solution\n", + "\n", + "# looking up steam table it shows that at given pressure saturation temperature is 212.4 C,so\n", + "tf = 212.4; # [C]\n", + "# hence,\n", + "Degree_of_superheat = t-tf;# [C]\n", + "# from table at given temperature 250 C\n", + "h = 2902; # specific enthalpy of steam at 250 C ,[kJ/kg]\n", + "\n", + "# Also from steam table enthalpy at saturation temperature is\n", + "hf = 2797.2 ;# [kJ/kg]\n", + "# so enthalpy at given temperature is\n", + "h2 = hf+cp*(t-tf);# [kJ/kg]\n", + "#results\n", + "print 'The specific enthalpy of steam at 2 MN/m^2 with temperature 250 C (kJ/kg) = ',h\n", + "print 'The specific enthalpy at given T and P by alternative path (kJ/kg) = ',round(h2,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 63" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.4\n", + " The estimated specific enthalpy (kJ/kg) = 3002.08\n", + " The accurate specific enthalpy of steam at pressure of 2.5 MN/m^2 and with a temperature 320 C (kJ/kg) = 3025.0\n", + " The answer is a bit different from textbook due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 63\n", + "#calculate the estimated and accurate specific enthalpy\n", + "print('Example 4.4');\n", + "import numpy\n", + "# aim : To determine\n", + "# the specific enthalpy of steam\n", + "\n", + "# Given values\n", + "P = 2.5;# pressure, [MN/m^2]\n", + "t = 320; # temperature, [C]\n", + "\n", + "# solution\n", + "# from steam table at given condition the saturation temperature of steam is 223.9 C, therefore steam is superheated\n", + "tf = 223.9;# [C]\n", + "\n", + "# first let's calculate estimated enthalpy\n", + "# again from steam table \n", + "\n", + "hg = 2800.9;# enthalpy at saturation temp, [kJ/kg]\n", + "cp =2.0934;# specific heat capacity of steam,[kJ/kg K]\n", + "\n", + "# so enthalpy at given condition is\n", + "h = hg+cp*(t-tf);# [kJ/kg]\n", + "print ' The estimated specific enthalpy (kJ/kg) = ',round(h,2)\n", + "\n", + "# calculation of accurate specific enthalpy\n", + "# we need double interpolation for this\n", + "\n", + "# first interpolation w.r.t. to temperature\n", + "# At 2 MN/m^2\n", + "Table_t_h_x = [325.,300.];# where, t in [C] and h in [kJ/kg]\n", + "Table_t_h_y=[3083.,3025.]\n", + "h1 = numpy.interp(320.,Table_t_h_x,Table_t_h_y); # [kJ/kg]\n", + "\n", + "# at 4 MN/m^2\n", + "Table_t_h_x = [325.,300.]; # t in [C] and h in [kJ/kg]\n", + "Table_t_h_y=[3031.,2962.]\n", + "h2 = numpy.interp(320.,Table_t_h_x,Table_t_h_y); # [kJ/kg]\n", + "\n", + "# now interpolation w.r.t. pressure\n", + "Table_P_h_x = [4.,2.]; # where P in NM/m^2 and h1,h2 in kJ/kg\n", + "Table_P_h_y=[h2,h1]\n", + "h = numpy.interp(2.5,Table_P_h_x,Table_P_h_y);# [kJ/kg]\n", + "print ' The accurate specific enthalpy of steam at pressure of 2.5 MN/m^2 and with a temperature 320 C (kJ/kg) = ',h\n", + "\n", + "# End\n", + "print ' The answer is a bit different from textbook due to rounding off error'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 65" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.5\n", + " The specific enthalpy of wet steam (kJ/kg) = 2317.605\n" + ] + } + ], + "source": [ + "#pg 65\n", + "#calculate the specific enthalpy\n", + "print('Example 4.5');\n", + "\n", + "# aim : To determine \n", + "# the specific enthalpy \n", + "\n", + "# Given values\n", + "P = 70; # pressure, [kn/m^2]\n", + "x = .85; # Dryness fraction\n", + "\n", + "# solution\n", + "\n", + "# from steam table, at given pressure \n", + "hf = 376.8;# [kJ/kg]\n", + "hfg = 2283.3;# [kJ/kg]\n", + "\n", + "# now using equation [2]\n", + "h = hf+x*hfg;# specific enthalpy of wet steam,[kJ/kg]\n", + "\n", + "#results\n", + "print ' The specific enthalpy of wet steam (kJ/kg) = ',h\n", + "\n", + "# There is minor variation in the book's answer\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8: pg 68" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.8\n", + "The specific volume of wet steam (m^3/kg) = 0.14121\n" + ] + } + ], + "source": [ + "#pg 68\n", + "#calculate the specific volume\n", + "print('Example 4.8');\n", + "\n", + "# aim : To determine \n", + "# the specific volume of wet steam\n", + "\n", + "# Given values\n", + "P = 1.25; # pressure, [MN/m^2]\n", + "x = .9; # dry fraction\n", + "\n", + "# solution\n", + "# from steam table at given pressure\n", + "vg = .1569;# [m^3/kg]\n", + "# hence\n", + "v = x*vg; # [m^3/kg]\n", + "#results\n", + "print 'The specific volume of wet steam (m^3/kg) = ',v\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9: pg 69" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.9\n", + " The specific volume of steam at pressure of 2 MN/m^2 and with temperature 325 C (m^3/kg) = 0.1321\n", + " The degree of superheat (C) = 112.6\n" + ] + } + ], + "source": [ + "#pg 69\n", + "#calculate the specific volume and degree of superheat\n", + "print('Example 4.9');\n", + "\n", + "# aim : To determine\n", + "# the specific volume \n", + "\n", + "# Given values\n", + "t = 325; # temperature, [C]\n", + "P = 2; # pressure, [MN/m^2]\n", + "\n", + "# solution\n", + "# from steam table at given t and P\n", + "vf = .1321; # [m^3/kg]\n", + "tf = 212.4; # saturation temperature, [C]\n", + "doh= t-tf; # degree of superheat, [C]\n", + "#results\n", + "print ' The specific volume of steam at pressure of 2 MN/m^2 and with temperature 325 C (m^3/kg) = ',vf\n", + "print ' The degree of superheat (C) = ',doh\n", + "\n", + "# End \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10: pg 69" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example .10\n", + " (a) The mass of steam entering the heater (kg/h) = 81.8\n", + " (b) The mass of water entering the heater (kg/h) = 628.23\n" + ] + } + ], + "source": [ + "#pg 69\n", + "#calculate the mass of steam and water\n", + "print('Example .10');\n", + "import math\n", + "# aim : To determine\n", + "# (a) the mass of steam entering the heater\n", + "# (b) the mass of water entering the heater\n", + "\n", + "# Given values\n", + "x = .95;# Dryness fraction\n", + "P = .7;# pressure,[MN/m**2]\n", + "d = 25;# internal diameter of heater,[mm]\n", + "C = 12; # steam velocity in the pipe,[m/s]\n", + "\n", + "# solution\n", + "# from steam table at .7 MN/m**2 pressure\n", + "hf = 697.1;# [kJ/kg]\n", + "hfg = 2064.9;# [kJ/kg]\n", + "hg = 2762.0; # [kJ/kg]\n", + "vg = .273; # [m**3/kg]\n", + "\n", + "# (a)\n", + "v = x*vg; # [m**3/kg]\n", + "ms_dot = math.pi*(d*10**-3)**2*C*3600/(4*v);# mass of steam entering, [kg/h]\n", + "\n", + "# (b)\n", + "h = hf+x*hfg;# specific enthalpy of steam entering heater,[kJ/kg]\n", + "# again from steam tables\n", + "hf1 = 376.8;# [kJ/kg] at 90 C\n", + "hf2 = 79.8;# [kJ/kg] at 19 C\n", + "\n", + "# using energy balance,mw_dot*(hf1-hf2)=ms_dot*(h-hf1)\n", + "mw_dot = ms_dot*(h-hf1)/(hf1-hf2);# mass of water entering to heater,[kg/h]\n", + "#results\n", + "print ' (a) The mass of steam entering the heater (kg/h) = ',round(ms_dot,1)\n", + "print ' (b) The mass of water entering the heater (kg/h) = ',round(mw_dot,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11: pg 72" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.11\n", + " The change in internal energy (kJ) = -486.753\n" + ] + } + ], + "source": [ + "#pg 72\n", + "#calculate the change in internal energy\n", + "print('Example 4.11');\n", + "\n", + "# aim: To determine\n", + "# the change of internal energy\n", + "\n", + "# Given values\n", + "m = 1.5;# mass of steam,[kg]\n", + "P1 = 1;# initial pressure, [MN/m**2]\n", + "t = 225;# temperature, [C]\n", + "P2 = .28;# final pressure, [MN/m**2]\n", + "x = .9;# dryness fraction of steam at P2\n", + "\n", + "# solution\n", + "\n", + "# from steam table at P1\n", + "h1 = 2886;# [kJ/kg]\n", + "v1 = .2198; # [m**3/kg]\n", + "# hence\n", + "u1 = h1-P1*v1*10**3;# internal energy [kJ/kg]\n", + "\n", + "# at P2\n", + "hf2 = 551.4;# [kJ/kg]\n", + "hfg2 = 2170.1;# [kJ/kg]\n", + "vg2 = .646; # [m**3/kg]\n", + "# so\n", + "h2 = hf2+x*hfg2;# [kj/kg]\n", + "v2 = x*vg2;# [m**3/kg]\n", + "\n", + "# now\n", + "u2 = h2-P2*v2*10**3;# [kJ/kg]\n", + "\n", + "# hence change in specific internal energy is\n", + "del_u = u2-u1;# [kJ/kg]\n", + "\n", + "del_u = m*del_u;# [kJ];\n", + "#results\n", + "print ' The change in internal energy (kJ) = ',del_u\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12: pg 74" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.12\n", + " Dryness fraction of steam after throttling is = 0.787\n" + ] + } + ], + "source": [ + "#pg 74\n", + "#calculate the dryness fraction\n", + "print('Example 4.12');\n", + "\n", + "# aim : To determine \n", + "# the dryness fraction of steam after throttling\n", + "\n", + "# given values\n", + "P1 = 1.4;# pressure before throttling, [MN/m^2]\n", + "x1 = .7;# dryness fraction before throttling\n", + "P2 = .11;# pressure after throttling, [MN/m^2]\n", + "\n", + "# solution\n", + "# from steam table\n", + "hf1 = 830.1;# [kJ/kg]\n", + "hfg1 = 1957.7;# [kJ/kg]\n", + "h1 = hf1 + x1*hfg1; # [kJ/kg]\n", + "\n", + "hf2 = 428.8;# [kJ/kg]\n", + "hfg2 = 2250.8;# [kJ/kg]\n", + "\n", + "# now for throttling,\n", + "# hf1+x1*hfg1=hf2+x2*hfg2; where x2 is dryness fraction after throttling\n", + "\n", + "x2=(h1-hf2)/hfg2; # final dryness fraction\n", + "#results\n", + "print ' Dryness fraction of steam after throttling is = ',round(x2,3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13: pg 75" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.13\n", + " (a) The condition of the resulting mixture is dry with dryness fraction = 0.965\n", + " (b) The internal diameter of the pipe (mm) = 145.96\n" + ] + } + ], + "source": [ + "#pg 75\n", + "#calculate the dryness fraction and internal diameter\n", + "print('Example 4.13');\n", + "import math\n", + "# aim : To determine \n", + "# the dryness fraction of steam \n", + "# and the internal diameter of the pipe\n", + "\n", + "# Given values\n", + "\n", + "# steam1\n", + "P1 = 2.;# pressure before throttling, [MN/m^2]\n", + "t = 300.;# temperature,[C]\n", + "ms1_dot = 2.;# steam flow rate, [kg/s]\n", + "P2 = 800.;# pressure after throttling, [kN/m^2]\n", + "\n", + "# steam2\n", + "P = 800.;# pressure, [N/m^2]\n", + "x2 = .9;# dryness fraction\n", + "ms2_dot = 5; # [kg/s]\n", + "\n", + "# solution\n", + "# (a)\n", + "# from steam table specific enthalpy of steam1 before throttling is\n", + "hf1 = 3025;# [kJ/kg]\n", + "# for throttling process specific enthalpy will same so final specific enthalpy of steam1 is\n", + "hf2 = hf1;\n", + "# hence\n", + "h1 = ms1_dot*hf2;# [kJ/s]\n", + "\n", + "# calculation of specific enthalpy of steam2\n", + "hf2 = 720.9;# [kJ/kg]\n", + "hfg2 = 2046.5;# [kJ/kg]\n", + "# hence\n", + "h2 = hf2+x2*hfg2;# specific enthalpy, [kJ/kg]\n", + "h2 = ms2_dot*h2;# total enthalpy, [kJ/s]\n", + "\n", + "# after mixing\n", + "m_dot = ms1_dot+ms2_dot;# total mass of mixture,[kg/s]\n", + "h = h1+h2;# Total enthalpy of the mixture,[kJ/s]\n", + "h = h/7;# [kJ/kg]\n", + "\n", + "# At pressure 800 N/m^2 \n", + "hf = 720.9;# [kJ/kg]\n", + "hfg = 2046.5;# [kJ/kg]\n", + "# so total enthalpy is,hf+x*hfg, where x is dryness fraction of mixture and which is equal to h\n", + "# hence\n", + "x = (h-hf)/hfg;# dryness fraction after mixing\n", + "\n", + "# (b)\n", + "# Given\n", + "C = 15;# velocity, [m/s]\n", + "# from steam table\n", + "v = .1255;# [m^/kg]\n", + "A = ms1_dot*v/C;# area, [m^2]\n", + "# using ms1_dot = A*C/v, where A is cross section area in m^2 and\n", + "# A = %pi*d^2/4, where d is diameter of the pipe \n", + "\n", + "# calculation of d\n", + "d = math.sqrt(4*A/math.pi); # diameter, [m]\n", + "#results\n", + "print ' (a) The condition of the resulting mixture is dry with dryness fraction = ',round(x,3)\n", + "print ' (b) The internal diameter of the pipe (mm) = ',round(d*1000,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14: pg 78" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.14\n", + " The dryness fraction of the steam entering seprating calorimeter is = 0.9\n" + ] + } + ], + "source": [ + "#pg 78\n", + "#calculate the dryness fraction\n", + "print('Example 4.14');\n", + "\n", + "# aim : To estimate \n", + "# the dryness fraction\n", + "\n", + "# Given values\n", + "M = 1.8;# mass of condensate, [kg]\n", + "m = .2;# water collected, [kg]\n", + "\n", + "# solution\n", + "x = M/(M+m);# formula for calculation of dryness fraction using seprating calorimeter\n", + "#results\n", + "print ' The dryness fraction of the steam entering seprating calorimeter is = ',x\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15: pg 80" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.15\n", + " The dryness fraction of steam is = 0.928\n", + "There is a calculation mistake in book so answer is not matching\n" + ] + } + ], + "source": [ + "#pg 80\n", + "#calculate the dryness fraction\n", + "print('Example 4.15');\n", + "import numpy\n", + "# aim : To determine\n", + "# the dryness fraction of the steam at 2.2 MN/m^2\n", + "\n", + "# Given values\n", + "P1 = 2.2;# [MN/m^2]\n", + "P2 = .13;# [MN/m^2]\n", + "t2 = 112;# [C]\n", + "tf2 = 150;# temperature, [C]\n", + "\n", + "# solution\n", + "# from steam table, at 2.2 MN/m^2\n", + "# saturated steam at 2 MN/m^2 Pressure\n", + "hf1 = 931;# [kJ/kg]\n", + "hfg1 = 1870;# [kJ/kg]\n", + "hg1 = 2801;# [kJ/kg]\n", + "\n", + "# for superheated steam\n", + "# at .1 MN/m^2\n", + "hg2 = 2675;# [kJ/kg]\n", + "hg2_150 = 2777;# specific enthalpy at 150 C, [kJ/kg]\n", + "tf2 = 99.6;# saturation temperature, [C]\n", + "\n", + "# at .5 MN/m^2\n", + "hg3 = 2693;# [kJ/kg]\n", + "hg3_150 = 2773;# specific enthalpy at 150 C, [kJ/kg]\n", + "tf3 = 111.4;# saturation temperature, [C]\n", + "\n", + "Table_P_h1_x = [.1,.5];# where, P in MN/m^2 and h in [kJ/kg]\n", + "Table_P_h1_y=[hg2,hg3]\n", + "hg = numpy.interp(.13,Table_P_h1_x,Table_P_h1_y);# specific entahlpy at .13 MN/m^2, [kJ/kg]\n", + "\n", + "Table_P_h2_x = [.1,.5];# where, P in MN/m^2 and h in [kJ/kg]\n", + "Table_P_h2_y =[hg2_150,hg3_150];\n", + "hg_150 = numpy.interp(.13,Table_P_h2_x,Table_P_h2_y);# specific entahlpy at .13 MN/m^2 and 150 C, [kJ/kg]\n", + "\n", + "Table_P_tf_x = [.1,.5];# where, P in MN/m^2 and h in [kJ/kg]\n", + "Table_P_tf_y = [tf2,tf3]\n", + "tf = numpy.interp(.13,Table_P_tf_x,Table_P_tf_y);# saturation temperature, [C]\n", + "\n", + "# hence\n", + "h2 = hg+(hg_150-hg)/(t2-tf)/(tf2-tf);# specific enthalpy at .13 MN/m^2 and 112 C, [kJ/kg]\n", + "\n", + "# now since process is throttling so h2=h1\n", + "# and h1 = hf1+x1*hfg1, so\n", + "x1 = (h2-hf1)/hfg1;# dryness fraction\n", + "#results\n", + "print ' The dryness fraction of steam is = ',round(x1,3)\n", + "\n", + "print 'There is a calculation mistake in book so answer is not matching'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16: pg 82" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.16\n", + " The minimum dryness fraction of steam is x = 0.939\n" + ] + } + ], + "source": [ + "#pg 82\n", + "#calculate the minimum dryness fraction\n", + "print('Example 4.16');\n", + "\n", + "# aim : To determine \n", + "# the minimum dryness fraction of steam\n", + "\n", + "# Given values\n", + "P1 = 1.8;# testing pressure,[MN/m^2]\n", + "P2 = .11;# pressure after throttling,[MN/m^2]\n", + "\n", + "# solution\n", + "# from steam table\n", + "# at .11 MN/m^2 steam is completely dry and specific enthalpy is\n", + "hg = 2680;# [kJ/kg]\n", + "\n", + "# before throttling steam is wet, so specific enthalpy is=hf+x*hfg, where x is dryness fraction\n", + "# from steam table\n", + "hf = 885.;# [kJ/kg]\n", + "hfg = 1912.;# [kJ/kg]\n", + "\n", + "# now for throttling process,specific enthalpy will same before and after\n", + "# hence\n", + "x = (hg-hf)/hfg;\n", + "#results\n", + "print ' The minimum dryness fraction of steam is x = ',round(x,3)\n", + "\n", + "# End" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17: pg 83" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.17\n", + " (a) The mass of steam in the vessel (kg) = 1.569\n", + " (b) The final dryness fraction of the steam = 0.576\n", + " (c) The amount of heat transferred during cooling process (kJ) = -1377.1\n" + ] + } + ], + "source": [ + "#pg 83\n", + "#calculate the mass of steam, final dryness and amount of heat\n", + "print('Example 4.17');\n", + "\n", + "# aim : To determine the\n", + "# (a) mass of steam in the vessel\n", + "# (b) final dryness of the steam\n", + "# (c) amount of heat transferrred during the cooling process\n", + "\n", + "# Given values\n", + "V1 = .8;# [m^3]\n", + "P1 = 360.;# [kN/m^2]\n", + "P2 = 200.;# [kN/m^2]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# at 360 kN/m^2\n", + "vg1 = .510;# [m^3]\n", + "m = V1/vg1;# mass of steam,[kg]\n", + "\n", + "# (b)\n", + "# at 200 kN/m^2\n", + "vg2 = .885;# [m^3/kg]\n", + "# the volume remains constant so\n", + "x = vg1/vg2;# final dryness fraction\n", + "\n", + "# (c)\n", + "# at 360 kN/m^2\n", + "h1 = 2732.9;# [kJ/kg]\n", + "# hence\n", + "u1 = h1-P1*vg1;# [kJ/kg]\n", + "\n", + "# at 200 kN/m^2\n", + "hf = 504.7;# [kJ/kg]\n", + "hfg=2201.6;#[kJ/kg]\n", + "# hence\n", + "h2 = hf+x*hfg;# [kJ/kg]\n", + "# now\n", + "u2 = h2-P2*vg1;# [kJ/kg]\n", + "# so\n", + "del_u = u2-u1;# [kJ/kg]\n", + "# from the first law of thermodynamics del_U+W=Q, \n", + "W = 0;# because volume is constant\n", + "del_U = m*del_u;# [kJ]\n", + "# hence\n", + "Q = del_U;# [kJ]\n", + "#results\n", + "print ' (a) The mass of steam in the vessel (kg) = ',round(m,3)\n", + "print ' (b) The final dryness fraction of the steam = ',round(x,3)\n", + "print ' (c) The amount of heat transferred during cooling process (kJ) = ',round(Q,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18: pg 84" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.18\n", + " The heat received by the steam (kJ/kg) = 380.3\n" + ] + } + ], + "source": [ + "#pg 84\n", + "#calculate the heat received by steam\n", + "print('Example 4.18');\n", + "\n", + "# aim : To determine\n", + "# the heat received by the steam per kilogram\n", + "\n", + "# Given values\n", + "# initial\n", + "P1 = 4;# pressure, [MN/m^2]\n", + "x1 = .95; # dryness fraction\n", + "\n", + "# final\n", + "t2 = 350;# temperature,[C]\n", + "\n", + "# solution\n", + "\n", + "# from steam table, at 4 MN/m^2 and x1=.95\n", + "hf = 1087.4;# [kJ/kg]\n", + "hfg = 1712.9;# [kJ/kg]\n", + "# hence\n", + "h1 = hf+x1*hfg;# [kJ/kg]\n", + "\n", + "# since pressure is kept constant ant temperature is raised so at this condition\n", + "h2 = 3095;# [kJ/kg]\n", + "\n", + "# so by energy balance\n", + "Q = h2-h1;# Heat received,[kJ/kg]\n", + "#results\n", + "print ' The heat received by the steam (kJ/kg) = ',round(Q,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19: pg 85" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.19\n", + " (a) The Quantity of steam present (kg) = 3.0\n", + " Dryness fraction is = 0.5\n", + " The enthalpy (kJ) = 5451.9\n", + " The heat loss (kJ) = 2917.8\n", + " (b) The dryness fraction is = 0.989\n", + " The enthalpy (kJ) = 8346.3\n" + ] + } + ], + "source": [ + "#pg 85\n", + "#calculate the condition after the given cases\n", + "print('Example 4.19');\n", + "\n", + "# aim : To determine the condition of the steam after \n", + "# (a) isothermal compression to half its initial volume,heat rejected\n", + "# (b) hyperbolic compression to half its initial volume\n", + "\n", + "# Given values\n", + "V1 = .3951;# initial volume,[m^3]\n", + "P1 = 1.5;# initial pressure,[MN/m^2]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# from steam table, at 1.5 MN/m^2 \n", + "hf1 = 844.7;# [kJ/kg]\n", + "hfg1 = 1945.2;# [kJ/kg]\n", + "hg1 = 2789.9;# [kJ/kg]\n", + "vg1 = .1317;# [m^3/kg]\n", + "\n", + "# calculation\n", + "m = V1/vg1;# mass of steam,[kg]\n", + "vg2b = vg1/2;# given,[m^3/kg](vg2b is actual specific volume before compression)\n", + "x1 = vg2b/vg1;# dryness fraction\n", + "h1 = m*(hf1+x1*hfg1);# [kJ]\n", + "Q = m*x1*hfg1;# heat loss,[kJ]\n", + "print ' (a) The Quantity of steam present (kg) = ',m\n", + "print ' Dryness fraction is = ',x1\n", + "print ' The enthalpy (kJ) = ',h1\n", + "print ' The heat loss (kJ) = ',Q\n", + "\n", + "# (b)\n", + "V2 = V1/2;\n", + "# Given compression is according to the law PV=Constant,so\n", + "P2 = P1*V1/V2;# [MN/m^2]\n", + "# from steam table at P2\n", + "hf2 = 1008.4;# [kJ/kg]\n", + "hfg2 = 1793.9;# [kJ/kg]\n", + "hg2 = 2802.3;# [kJ/kg]\n", + "vg2 = .0666;# [m^3/kg]\n", + "\n", + "# calculation\n", + "x2 = vg2b/vg2;# dryness fraction\n", + "h2 = m*(hf2+x2*hfg2);# [kJ]\n", + "\n", + "print ' (b) The dryness fraction is = ',round(x2,3)\n", + "print ' The enthalpy (kJ) = ',round(h2,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20: pg 88" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.20\n", + " (a) The mass of steam present (kg) = 5.0\n", + " (b) The work transfer (kJ) = 708.0\n", + " (c) The change in internal energy (kJ) = -1611.0\n", + "since del_U<0,so this is loss of internal energy\n", + " (d) The heat exchange between the steam and surrounding (kJ) = -903.0\n", + "since Q<0,so this is loss of heat energy to surrounding\n", + "there are minor vairations in the values reported in the book due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 88\n", + "#calculate the mass of steam, work transfer, change of internal energy, heat exchange\n", + "print('Example 4.20');\n", + "\n", + "# aim : To determine the\n", + "# (a) mass of steam \n", + "# (b) work transfer\n", + "# (c) change of internal energy\n", + "# (d) heat exchange b/w the steam and surroundings\n", + "\n", + "# Given values\n", + "P1 = 2.1;# initial pressure,[MN/m**2]\n", + "x1 = .9;# dryness fraction\n", + "V1 = .427;# initial volume,[m**3]\n", + "P2 = .7;# final pressure,[MN/m**2]\n", + "# Given process is polytropic with\n", + "n = 1.25; # polytropic index\n", + "\n", + "# solution\n", + "# from steam table\n", + "\n", + "# at 2.1 MN/m**2\n", + "hf1 = 920.0;# [kJ/kg]\n", + "hfg1=1878.2;# [kJ/kg]\n", + "hg1=2798.2;# [kJ/kg]\n", + "vg1 = .0949;# [m**3/kg]\n", + "\n", + "# and at .7 MN/m**2\n", + "hf2 = 697.1;# [kJ/kg]\n", + "hfg2 = 2064.9;# [kJ/kg]\n", + "hg2 = 2762.0;# [kJ/kg]\n", + "vg2 = .273;# [m**3/kg]\n", + "\n", + "#calculations and results\n", + "# (a)\n", + "v1 = x1*vg1;# [m**3/kg]\n", + "m = V1/v1;# [kg]\n", + "print ' (a) The mass of steam present (kg) = ',round(m)\n", + "\n", + "# (b)\n", + "# for polytropic process\n", + "v2 = v1*(P1/P2)**(1/n);# [m**3/kg]\n", + "\n", + "x2 = v2/vg2;# final dryness fraction\n", + "# work transfer\n", + "W = m*(P1*v1-P2*v2)*10**3/(n-1);# [kJ]\n", + "print ' (b) The work transfer (kJ) = ',round(W)\n", + "\n", + "# (c)\n", + "# initial\n", + "h1 = hf1+x1*hfg1;# [kJ/kg]\n", + "u1 = h1-P1*v1*10**3;# [kJ/kg]\n", + "\n", + "# final\n", + "h2 = hf2+x2*hfg2;# [kJ/kg]\n", + "u2 = h2-P2*v2*10**3;# [kJ/kg]\n", + "\n", + "del_U = m*(u2-u1);# [kJ]\n", + "print ' (c) The change in internal energy (kJ) = ',round(del_U)\n", + "if(del_U<0):\n", + " print('since del_U<0,so this is loss of internal energy')\n", + "else:\n", + " print('since del_U>0,so this is gain in internal energy')\n", + "\n", + "\n", + "# (d)\n", + "Q = del_U+W;# [kJ]\n", + "print ' (d) The heat exchange between the steam and surrounding (kJ) = ',round(Q,1)\n", + "if(Q<0):\n", + " print('since Q<0,so this is loss of heat energy to surrounding')\n", + "else:\n", + " print('since Q>0,so this is gain in heat energy to the steam')\n", + "\n", + "print 'there are minor vairations in the values reported in the book due to rounding off error'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21: pg 91" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 4.21\n", + " (a) The volume occupied by 1 kg of steam (m^3/kg) = 0.22\n", + " (b)(1) The final dryness fraction of the steam = 0.887\n", + " (2) The change in internal energy of the steam during expansion is (kJ/kg) (This is a loss of internal energy) = -243.0\n", + " There are minor variation in the answer due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 91\n", + "#calculate the volume, dryness fraction and change in internal energy\n", + "print('Example 4.21');\n", + "\n", + "# aim : To determine the \n", + "# (a) volume occupied by steam\n", + "# (b)(1) final dryness fraction of steam\n", + "# (2) Change of internal energy during expansion\n", + "\n", + "# (a)\n", + "# Given values\n", + "P1 = .85;# [mN/m**2]\n", + "x1 = .97;\n", + "\n", + "# solution\n", + "# from steam table, at .85 MN/m**2,\n", + "vg1 = .2268;# [m**3/kg]\n", + "# hence\n", + "v1 = x1*vg1;# [m**3/kg]\n", + "print ' (a) The volume occupied by 1 kg of steam (m^3/kg) = ',round(v1,2)\n", + "\n", + "# (b)(1)\n", + "P2 = .17;# [MN/m**2]\n", + "# since process is polytropic process with\n", + "n = 1.13; # polytropic index\n", + "# hence\n", + "v2 = v1*(P1/P2)**(1/n);# [m**3/kg]\n", + "\n", + "# from steam table at .17 MN/m**2\n", + "vg2 = 1.031;# [m**3/kg]\n", + "# steam is wet so\n", + "x2 = v2/vg2;# final dryness fraction\n", + "print ' (b)(1) The final dryness fraction of the steam = ',round(x2,3)\n", + "\n", + "# (2)\n", + "W = (P1*v1-P2*v2)*10**3/(n-1);# [kJ/kg]\n", + "# since process is adiabatic, so\n", + "del_u = -W;# [kJ/kg]\n", + "print ' (2) The change in internal energy of the steam during expansion is (kJ/kg) (This is a loss of internal energy) = ',round(del_u)\n", + "print' There are minor variation in the answer due to rounding off error'\n", + "\n", + "# End\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/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter5.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter5.ipynb new file mode 100644 index 00000000..9ba6689d --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter5.ipynb @@ -0,0 +1,1627 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5 - Gases and Single Phase systems" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 98" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.1\n", + " The new pressure exerted on the air (mmHg) = 900.0\n", + " The difference in the two mercury column level (mm) = 135.0\n" + ] + } + ], + "source": [ + "#pg 98\n", + "#calculate the new pressure and difference in two levels\n", + "print('Example 5.1');\n", + "\n", + "# aim : To determine \n", + "# new pressure exerted on the air and the difference in two mercury column level\n", + "\n", + "# Given values\n", + "P1 = 765.;# atmospheric pressure, [mmHg]\n", + "V1 = 20000.;# [mm^3]\n", + "V2 = 17000.;# [mm^3]\n", + "\n", + "# solution\n", + "\n", + "# using boyle's law P*V=constant\n", + "# hence\n", + "P2 = P1*V1/V2;# [mmHg]\n", + "\n", + "del_h = P2-P1;# difference in Height of mercury column level\n", + "#results\n", + "print ' The new pressure exerted on the air (mmHg) = ',P2\n", + "print ' The difference in the two mercury column level (mm) = ',del_h\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 99" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.2\n", + " The new volume after expansion (m^3) = 0.7\n" + ] + } + ], + "source": [ + "#pg 99\n", + "#calculate the new volume\n", + "print('Example 5.2');\n", + "\n", + "# aim : To determine \n", + "# the new volume\n", + "\n", + "# Given values\n", + "P1 = 300;# original pressure,[kN/m^2]\n", + "V1 = .14;# original volume,[m^3]\n", + "\n", + "P2 = 60.;# new pressure after expansion,[kn/m^2]\n", + "\n", + "# solution\n", + "# since temperature is constant so using boyle's law P*V=constant\n", + "V2 = V1*P1/P2;# [m^3]\n", + "\n", + "#results\n", + "print ' The new volume after expansion (m^3) = ',V2\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 101" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.3\n", + " The new volume of the gas trapped in the apparatus (mm^3) = 12302.0\n" + ] + } + ], + "source": [ + "#pg 101\n", + "#calculate the new volume\n", + "print('Example 5.3');\n", + "\n", + "# aim : To determine \n", + "# the new volume of the gas\n", + "\n", + "# Given values\n", + "V1 = 10000;# [mm^3]\n", + "T1 = 273.+18;# [K]\n", + "T2 = 273.+85;# [K]\n", + "\n", + "# solution\n", + "# since pressure exerted on the apparatus is constant so using charle's law V/T=constant\n", + "# hence\n", + "V2 = V1*T2/T1;# [mm^3]\n", + "\n", + "#results\n", + "print ' The new volume of the gas trapped in the apparatus (mm^3) = ',round(V2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 102" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.4\n", + " The final temperature of the gas (C) = 15.0\n" + ] + } + ], + "source": [ + "#pg 102\n", + "#calculate the final temperature\n", + "print('Example 5.4');\n", + "\n", + "# aim : To determine \n", + "# the final temperature\n", + "\n", + "# Given values\n", + "V1 = .2;# original volume,[m^3]\n", + "T1 = 273+303;# original temperature, [K]\n", + "V2 = .1;# final volume, [m^3]\n", + "\n", + "# solution\n", + "# since pressure is constant, so using charle's law V/T=constant\n", + "# hence\n", + "T2 = T1*V2/V1;# [K]\n", + "t2 = T2-273;# [C]\n", + "#results\n", + "print ' The final temperature of the gas (C) = ',t2\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 106" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.5\n", + "The new volume of the gas (m^3) = 0.0223\n" + ] + } + ], + "source": [ + "#pg 106\n", + "#calculate the new volume\n", + "print('Example 5.5');\n", + "\n", + "# aim : To determine \n", + "# the new volume of the gas\n", + "\n", + "# Given values\n", + "\n", + "# initial codition\n", + "P1 = 140;# [kN/m^2]\n", + "V1 = .1;# [m^3]\n", + "T1 = 273+25;# [K]\n", + "\n", + "# final condition\n", + "P2 = 700.;# [kN/m^2]\n", + "T2 = 273.+60;# [K]\n", + "\n", + "# by charasteristic equation, P1*V1/T1=P2*V2/T2\n", + "\n", + "V2=P1*V1*T2/(T1*P2);# final volume, [m^3]\n", + "\n", + "#results\n", + "print 'The new volume of the gas (m^3) = ',round(V2,4)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 106" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.6\n", + " The mass of the gas present (kg) = 0.118\n", + " The new temperature of the gas (C) = 651\n" + ] + } + ], + "source": [ + "#pg 106\n", + "#calculate the new temperature and mass of gas\n", + "print('Example 5.6');\n", + "\n", + "# aim : To determine\n", + "# the mas of the gas and new temperature\n", + "\n", + "# Given values\n", + "P1 = 350;# [kN/m^2]\n", + "V1 = .03;# [m^3]\n", + "T1 = 273+35;# [K]\n", + "R = .29;# Gas constant,[kJ/kg K]\n", + "\n", + "# solution\n", + "# using charasteristic equation, P*V=m*R*T\n", + "m = P1*V1/(R*T1);# [Kg]\n", + "\n", + "# Now the gas is compressed\n", + "P2 = 1050;# [kN/m^2]\n", + "V2 = V1;\n", + "# since mass of the gas is constant so using, P*V/T=constant\n", + "# hence\n", + "T2 = T1*P2/P1# [K]\n", + "t2 = T2-273;# [C]\n", + "\n", + "#results\n", + "print ' The mass of the gas present (kg) = ',round(m,3)\n", + "print ' The new temperature of the gas (C) = ',t2\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7: pg 111" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.7\n", + " The heat transferred to the gas (kJ) = 172.8\n", + " The final pressure of the gas (kN/m^2) = 338.06\n" + ] + } + ], + "source": [ + "#pg 111\n", + "#calculate the final pressure and heat transferred\n", + "print('Example 5.7');\n", + "\n", + "# aim : To determine \n", + "# the heat transferred to the gas and its final pressure\n", + "\n", + "# Given values\n", + "m = 2;# masss of the gas, [kg]\n", + "V1 = .7;# volume,[m^3]\n", + "T1 = 273+15;# original temperature,[K]\n", + "T2 = 273+135;# final temperature,[K]\n", + "cv = .72;# specific heat capacity at constant volume,[kJ/kg K]\n", + "R = .29;# gas law constant,[kJ/kg K]\n", + "\n", + "# solution\n", + "Q = m*cv*(T2-T1);# Heat transferred at constant volume,[kJ]\n", + "\n", + "# Now,using P1*V1=m*R*T1\n", + "P1 = m*R*T1/V1;# [kN/m^2]\n", + "\n", + "# since volume of the system is constant, so P1/T1=P2/T2\n", + "# hence\n", + "P2 = P1*T2/T1;# final pressure,[kN/m^2]\n", + "#results\n", + "print ' The heat transferred to the gas (kJ) = ',Q\n", + "print ' The final pressure of the gas (kN/m^2) = ',round(P2,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8: pg 114" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.8\n", + " The heat transferred to the gas (kJ) = -31.84\n", + " Work done on the gas during the process (kJ) = -9.19\n" + ] + } + ], + "source": [ + "#pg 114\n", + "#calculate the heat transferred and work done\n", + "print('Example 5.8');\n", + "\n", + "# aim : To determine \n", + "# the heat transferred from the gas and the work done on the gas\n", + "\n", + "# Given values\n", + "P1 = 275;# pressure, [kN/m^2]\n", + "V1 = .09;# volume,[m^3]\n", + "T1 = 273+185;# initial temperature,[K]\n", + "T2 = 273+15;# final temperature,[K]\n", + "cp = 1.005;# specific heat capacity at constant pressure,[kJ/kg K]\n", + "R = .29;# gas law constant,[kJ/kg K]\n", + "\n", + "# solution\n", + "# using P1*V1=m*R*T1\n", + "m = P1*V1/(R*T1);# mass of the gas\n", + "\n", + "# calculation of heat transfer\n", + "Q = m*cp*(T2-T1);# Heat transferred at constant pressure,[kJ]\n", + "\n", + "# calculation of work done\n", + "# Now,since pressure is constant so, V/T=constant\n", + "# hence\n", + "V2 = V1*T2/T1;# [m^3]\n", + "\n", + "W = P1*(V2-V1);# formula for work done at constant pressure,[kJ]\n", + "#results\n", + "print ' The heat transferred to the gas (kJ) = ',round(Q,2)\n", + "print ' Work done on the gas during the process (kJ) = ',round(W,2)\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9: pg 117" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.9\n", + " The new pressure of the gas (kN/m^2) = 1299.0\n" + ] + } + ], + "source": [ + "#pg 117\n", + "#calculate the new pressure\n", + "print('Example 5.9');\n", + "\n", + "# aim : To determine\n", + "# the new pressure of the gas\n", + "\n", + "# Given values\n", + "P1 = 300.;# original pressure,[kN/m**2]\n", + "T1 = 273.+25;# original temperature,[K]\n", + "T2 = 273.+180;# final temperature,[K]\n", + "\n", + "# solution\n", + "# since gas compressing according to the law,P*V**1.4=constant\n", + "# so,for polytropic process,T1/T2=(P1/P2)**((n-1)/n),here n=1.4\n", + "\n", + "# hence\n", + "P2 = P1*(T2/T1)**((1.4)/(1.4-1));# [kN/m**2]\n", + "\n", + "#results\n", + "print ' The new pressure of the gas (kN/m^2) = ',round(P2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10: pg 118" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.10\n", + " The new temperature of the gas (C) = 25.0\n", + " there is minor error in book answer due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 118\n", + "#calculate the new temperature\n", + "print('Example 5.10');\n", + "\n", + "# aim : To determine\n", + "# the new temperature of the gas\n", + "\n", + "# Given values\n", + "V1 = .015;# original volume,[m**3]\n", + "T1 = 273.+285;# original temperature,[K]\n", + "V2 = .09;# final volume,[m**3]\n", + "\n", + "# solution \n", + "# Given gas is following the law,P*V**1.35=constant\n", + "# so process is polytropic with\n", + "n = 1.35; # polytropic index\n", + "\n", + "# hence\n", + "T2 = T1*(V1/V2)**(n-1);# final temperature, [K]\n", + "\n", + "t2 = T2-273;# [C]\n", + "\n", + "#results\n", + "print ' The new temperature of the gas (C) = ',round(t2,1)\n", + "\n", + "print ' there is minor error in book answer due to rounding off error'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11: pg 119" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.11\n", + " (a) The original volume of the gas (m^3) = 0.0765\n", + " and The final volume of the gas (m^3) = 0.306\n", + " (b) The final pressure of the gas (kN/m^2) = 231.0\n", + " (c) The final temperature of the gas (C) = 92.0\n" + ] + } + ], + "source": [ + "#pg 119\n", + "#calculate the final pressure, temperature and volume of gas\n", + "print('Example 5.11');\n", + "\n", + "# aim : To determine the\n", + "# (a) original and final volume of the gas\n", + "# (b) final pressure of the gas\n", + "# (c) final temperature of the gas\n", + "\n", + "# Given values\n", + "m = .675;# mass of the gas,[kg]\n", + "P1 = 1.4;# original pressure,[MN/m**2]\n", + "T1 = 273+280;# original temperature,[K]\n", + "R = .287;#gas constant,[kJ/kg K]\n", + "\n", + "# solution and results\n", + "\n", + "# (a)\n", + "# using characteristic equation, P1*V1=m*R*T1\n", + "V1 = m*R*T1*10**-3/P1;# [m**3]\n", + "# also Given \n", + "V2 = 4*V1;# [m**3]\n", + "print ' (a) The original volume of the gas (m^3) = ',round(V1,4)\n", + "print ' and The final volume of the gas (m^3) = ',round(V2,3)\n", + "\n", + "# (b)\n", + "# Given that gas is following the law P*V**1.3=constant\n", + "# hence process is polytropic with \n", + "n = 1.3; # polytropic index\n", + "P2 = P1*(V1/V2)**n;# formula for polytropic process,[MN/m**2]\n", + "print ' (b) The final pressure of the gas (kN/m^2) = ',round(P2*10**3)\n", + "\n", + "# (c)\n", + "# since mass is constant so,using P*V/T=constant\n", + "# hence\n", + "T2 = P2*V2*T1/(P1*V1);# [K]\n", + "t2 = T2-273;# [C]\n", + "print ' (c) The final temperature of the gas (C) = ',round(t2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12: pg 120" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.12\n", + " (a) The change in internal energy of the air is del_U (kJ) = 30.73\n", + "since del_U>0, so it is gain of internal energy to the air\n", + " (b) The work done is (kJ) = -49.1\n", + "since W<0, so the work is done on the air\n", + " (c) The heat transfer is Q (kJ) = -18.4\n", + "since Q<0, so the heat is rejected by the air\n", + "The answer is a bit different from textbook due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 120\n", + "#calculate the change in internal energy, work done and heat transfer\n", + "print('Example 5.12');\n", + "\n", + "# aim : T0 determine \n", + "# (a) change in internal energy of the air\n", + "# (b) work done\n", + "# (c) heat transfer\n", + "\n", + "# Given values\n", + "m = .25;# mass, [kg]\n", + "P1 = 140;# initial pressure, [kN/m**2]\n", + "V1 = .15;# initial volume, [m**3]\n", + "P2 = 1400;# final volume, [m**3]\n", + "cp = 1.005;# [kJ/kg K]\n", + "cv = .718;# [kJ/kg K]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# assuming ideal gas\n", + "R = cp-cv;# [kJ/kg K]\n", + "# also, P1*V1=m*R*T1,hence\n", + "T1 = P1*V1/(m*R);# [K]\n", + "\n", + "# given that process is polytropic with \n", + "n = 1.25; # polytropic index\n", + "T2 = T1*(P2/P1)**((n-1)/n);# [K]\n", + "\n", + "# Hence, change in internal energy is,\n", + "del_U = m*cv*(T2-T1);# [kJ]\n", + "print ' (a) The change in internal energy of the air is del_U (kJ) = ',round(del_U,2)\n", + "if(del_U>0):\n", + " print('since del_U>0, so it is gain of internal energy to the air')\n", + "else:\n", + " print('since del_U<0, so it is gain of internal energy to the surrounding')\n", + "# (b)\n", + "W = m*R*(T1-T2)/(n-1);# formula of work done for polytropic process,[kJ]\n", + "print ' (b) The work done is (kJ) = ',round(W,1)\n", + "if(W>0):\n", + " print('since W>0, so the work is done by the air')\n", + "else:\n", + " print('since W<0, so the work is done on the air')\n", + "\n", + "\n", + "# (c)\n", + "Q = del_U+W;# using 1st law of thermodynamics,[kJ]\n", + "print ' (c) The heat transfer is Q (kJ) = ',round(Q,2)\n", + "if(Q>0):\n", + " print('since Q>0, so the heat is received by the air')\n", + "else:\n", + " print('since Q<0, so the heat is rejected by the air')\n", + "\n", + "print 'The answer is a bit different from textbook due to rounding off error'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13: pg 123" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.13\n", + "\n", + " The final volume of the gas is V2 (m^3) = 0.048\n", + "\n", + " The work done by the gas is (kJ) = 9.77\n", + "\n", + " The change of internal energy is (kJ) = -9.77\n", + "since del_U<0, so this is a loss of internal energy from the gas\n", + "The answer is a bit different from textbook due to rounding off error\n" + ] + } + ], + "source": [ + "#pg 123\n", + "#calculate the final volume, work done and the change in internal energy\n", + "print('Example 5.13');\n", + "\n", + "# aim : To determine the\n", + "# final volume, work done and the change in internal energy\n", + "\n", + "# Given values\n", + "P1 = 700.;# initial pressure,[kN/m^2]\n", + "V1 = .015;# initial volume, [m^3]\n", + "P2 = 140.;# final pressure, [kN/m^2]\n", + "cp = 1.046;# [kJ/kg K]\n", + "cv = .752; # [kJ/kg K]\n", + "\n", + "# solution\n", + "\n", + "Gamma = cp/cv;\n", + "# for adiabatic expansion, P*V^gamma=constant, so\n", + "V2 = V1*(P1/P2)**(1/Gamma);# final volume, [m^3]\n", + "print '\\n The final volume of the gas is V2 (m^3) = ',round(V2,3)\n", + "\n", + "# work done\n", + "W = (P1*V1-P2*V2)/(Gamma-1);# [kJ]\n", + "print '\\n The work done by the gas is (kJ) = ',round(W,2)\n", + "\n", + "# for adiabatic process\n", + "del_U = -W;# [kJ]\n", + "print '\\n The change of internal energy is (kJ) = ',round(del_U,2)\n", + "if(del_U>0):\n", + " print 'since del_U>0, so the the gain in internal energy of the gas '\n", + "else:\n", + " print 'since del_U<0, so this is a loss of internal energy from the gas'\n", + "\n", + "print 'The answer is a bit different from textbook due to rounding off error'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14: pg 125" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.14\n", + "\n", + " (a) The heat transferred during compression is Q (kJ) = -60.0\n", + "\n", + " (b) The change of the internal energy during the expansion is,del_U (kJ) = -45.2\n", + "\n", + " (c) The mass of the gas is,m (kg) = 0.478\n", + " There is calculation mistake in the book\n" + ] + } + ], + "source": [ + "#pg 125\n", + "#calculate the heat transfer, change of internal energy and mass of gas\n", + "print('Example 5.14');\n", + "import math\n", + "# aim : To determine the\n", + "# (a)heat transfer\n", + "# (b)change of internal energy\n", + "# (c)mass of gas\n", + "\n", + "# Given values\n", + "V1 = .4;# initial volume, [m^3]\n", + "P1 = 100.;# initial pressure, [kN/m^2]\n", + "T1 = 273.+20;# temperature, [K]\n", + "P2 = 450.;# final pressure,[kN/m^2]\n", + "cp = 1.0;# [kJ/kg K]\n", + "Gamma = 1.4; # heat capacity ratio\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# for the isothermal compression,P*V=constant,so\n", + "V2 = V1*P1/P2;# [m^3]\n", + "W = P1*V1*math.log(P1/P2);# formula of workdone for isothermal process,[kJ]\n", + "\n", + "# for isothermal process, del_U=0;so\n", + "Q = W;\n", + "print '\\n (a) The heat transferred during compression is Q (kJ) = ',round(Q)\n", + "\n", + "\n", + "# (b)\n", + "V3 = V1;\n", + "# for adiabatic expansion\n", + "# also\n", + "\n", + "P3 = P2*(V2/V3)**Gamma;# [kN/m^2]\n", + "W = -(P3*V3-P2*V2)/(Gamma-1);# work done formula for adiabatic process,[kJ]\n", + "# also, Q=0,so using Q=del_U+W\n", + "del_U = -W;# [kJ]\n", + "print '\\n (b) The change of the internal energy during the expansion is,del_U (kJ) = ',round(del_U,1)\n", + "\n", + "# (c)\n", + "# for ideal gas\n", + "# cp-cv=R, and cp/cv=gamma, hence\n", + "R = cp*(1-1/Gamma);# [kj/kg K]\n", + "\n", + "# now using ideal gas equation\n", + "m = P1*V1/(R*T1);# mass of the gas,[kg]\n", + "print '\\n (c) The mass of the gas is,m (kg) = ',round(m,3)\n", + "\n", + "print' There is calculation mistake in the book'\n", + "\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15: pg 128" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.15\n", + " The heat received or rejected by the gas during this process is Q (kJ) = 1.03\n", + "since Q>0, so heat is received by the gas\n", + "\n", + " The polytropic specific heat capacity is cn (kJ/kg K) = 0.239\n" + ] + } + ], + "source": [ + "#pg 128\n", + "#calculate the the heat transferred and polytropic specific heat capacity\n", + "print('Example 5.15');\n", + "\n", + "# aim : To determine \n", + "# the heat transferred and polytropic specific heat capacity\n", + "\n", + "# Given values\n", + "P1 = 1;# initial pressure, [MN/m^2]\n", + "V1 = .003;# initial volume, [m^3]\n", + "P2 = .1;# final pressure,[MN/m^2]\n", + "cv = .718;# [kJ/kg*K]\n", + "Gamma=1.4;# heat capacity ratio\n", + "\n", + "# solution\n", + "# Given process is polytropic with\n", + "n = 1.3;# polytropic index\n", + "# hence\n", + "V2 = V1*(P1/P2)**(1/n);# final volume,[m^3]\n", + "W = (P1*V1-P2*V2)*10**3/(n-1);# work done,[kJ]\n", + "# so\n", + "Q = (Gamma-n)*W/(Gamma-1);# heat transferred,[kJ]\n", + "\n", + "print ' The heat received or rejected by the gas during this process is Q (kJ) = ',round(Q,2)\n", + "if(Q>0):\n", + " print 'since Q>0, so heat is received by the gas'\n", + "else:\n", + " print 'since Q<0, so heat is rejected by the gas'\n", + "\n", + "# now\n", + "cn = cv*(Gamma-n)/(n-1);# polytropic specific heat capacity,[kJ/kg K]\n", + "print '\\n The polytropic specific heat capacity is cn (kJ/kg K) = ',round(cn,3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16: pg 129" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.16\n", + "\n", + " (a) The initial partial pressure of the steam is (kN/m^2) = 7\n", + "\n", + " The initial partial pressure of the air is (kN/m^2) = 93.0\n", + " \n", + "(b) The final partial pressure of the steam is (kN/m^2) = 200.0\n", + "\n", + " The final partial pressure of the air is (kN/m^2) = 117.2\n", + "\n", + " (c) The total pressure after heating is (kN/m^2) = 317.2\n" + ] + } + ], + "source": [ + "#pg 129\n", + "\n", + "print('Example 5.16');\n", + "\n", + "# To determine the \n", + "# (a) initial partial pressure of the steam and air\n", + "# (b) final partial pressure of the steam and air\n", + "# (c) total pressure in the container after heating\n", + "\n", + "# Given values\n", + "T1 = 273.+39;# initial temperature,[K]\n", + "P1 = 100.;# pressure, [MN/m^2]\n", + "T2 = 273.+120.2;# final temperature,[K]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# from the steam tables, the pressure of wet steam at 39 C is\n", + "Pw1 = 7;# partial pressure of wet steam,[kN/m^2]\n", + "# and by Dalton's law\n", + "Pa1 = P1-Pw1;# initial pressure of air, [kN/m^2]\n", + "\n", + "print '\\n (a) The initial partial pressure of the steam is (kN/m^2) = ',Pw1\n", + "print '\\n The initial partial pressure of the air is (kN/m^2) = ',Pa1\n", + "\n", + "# (b)\n", + "# again from steam table, at 120.2 C the pressure of wet steam is\n", + "Pw2 = 200.;# [kN/m^2]\n", + "\n", + "# now since volume is constant so assuming air to be ideal gas so for air P/T=contant, hence\n", + "Pa2 = Pa1*T2/T1 ;# [kN/m^2]\n", + "\n", + "print ' \\n(b) The final partial pressure of the steam is (kN/m^2) = ',Pw2\n", + "print '\\n The final partial pressure of the air is (kN/m^2) = ',round(Pa2,2)\n", + "\n", + "# (c)\n", + "Pt = Pa2+Pw2;# using dalton's law, total pressure,[kN/m^2]\n", + "print '\\n (c) The total pressure after heating is (kN/m^2) = ',round(Pt,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17: pg 130" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.17\n", + "\n", + " The partial pressure of the air in the condenser is (kN/m^2) = 6.0\n", + "\n", + " The partial pressure of the steam in the condenser is (kN/m^2) = 8\n", + "\n", + " The mass of air which will associated with this steam is (kg) = 1430.5\n", + " There is misprint in book\n" + ] + } + ], + "source": [ + "#pg 130\n", + "print('Example 5.17');\n", + "\n", + "# aim : To determine \n", + "# the partial pressure of the air and steam, and the mass of the air\n", + "\n", + "# Given values\n", + "P1 = 660.;# vaccum gauge pressure on condenser [mmHg]\n", + "P = 765.;# atmospheric pressure, [mmHg]\n", + "x = .8;# dryness fraction \n", + "T = 273.+41.5;# temperature,[K]\n", + "ms_dot = 1500.;# condense rate of steam,[kg/h]\n", + "R = .29;# [kJ/kg]\n", + "\n", + "# solution\n", + "Pa = (P-P1)*.1334;# absolute pressure,[kN/m^2]\n", + "# from steam table, at 41.5 C partial pressure of steam is\n", + "Ps = 8;# [kN/m^2]\n", + "# by dalton's law, partial pressure of air is\n", + "Pg = Pa-Ps;# [kN/m^2]\n", + "\n", + "print '\\n The partial pressure of the air in the condenser is (kN/m^2) = ',round(Pg)\n", + "print '\\n The partial pressure of the steam in the condenser is (kN/m^2) = ',Ps\n", + "\n", + "# also\n", + "vg = 18.1;# [m^3/kg]\n", + "# so\n", + "V = x*vg;# [m^3/kg]\n", + "# The air associated with 1 kg of the steam will occupiy this same volume\n", + "# for air, Pg*V=m*R*T,so\n", + "m = Pg*V/(R*T);# [kg/kg steam]\n", + "# hence\n", + "ma = m*ms_dot;# [kg/h]\n", + "\n", + "print '\\n The mass of air which will associated with this steam is (kg) = ',round(ma,1)\n", + "\n", + "print' There is misprint in book'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18: pg 130" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.18\n", + " (a) The final pressure in the cylinder is (kN/m^2) = 707.1\n", + " (b) The final dryness fraction of the steam is = 0.83\n" + ] + } + ], + "source": [ + "#pg 130\n", + "print('Example 5.18');\n", + "\n", + "# aim : To determine the\n", + "# (a) final pressure\n", + "# (b) final dryness fraction of the steam\n", + "\n", + "# Given values\n", + "P1 = 130.;# initial pressure, [kN/m^2]\n", + "T1 = 273.+75.9;# initial temperature, [K]\n", + "x1 = .92;# initial dryness fraction\n", + "T2 = 273.+120.2;# final temperature, [K]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# from steam table, at 75.9 C\n", + "Pws = 40.;# partial pressure of wet steam[kN/m^2]\n", + "Pa = P1-Pws;# partial pressure of air, [kN/m^2]\n", + "vg = 3.99# specific volume of the wet steam, [m^3/kg]\n", + "# hence\n", + "V1 = x1*vg;# [m^3/kg]\n", + "V2 = V1/5;# [m^3/kg]\n", + "# for air, mass is constant so, Pa*V1/T1=P2*V2/T2,also given ,V1/V2=5,so\n", + "P2 = Pa*V1*T2/(V2*T1);# final pressure,[kN/m^2]\n", + "\n", + "# now for steam at 120.2 C\n", + "Ps = 200.;# final partial pressure of steam,[kN/m^2]\n", + "# so by dalton's law total pressure in cylindert is\n", + "Pt = P2+Ps;# [kN/m^2]\n", + "print ' (a) The final pressure in the cylinder is (kN/m^2) = ',round(Pt,1)\n", + "\n", + "# (b)\n", + "# from steam table at 200 kN/m^2 \n", + "vg = .885;# [m^3/kg]\n", + "# hence\n", + "x2 = V2/vg;# final dryness fraction of the steam\n", + "print ' (b) The final dryness fraction of the steam is = ',round(x2,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19: pg 131" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.19\n", + " (a) The value of adiabatic index Gamma is = 1.426\n", + " (b) The change in internal energy during the adiabatic expansion is U2-U1 (This is loss of internal energy) (kJ) = -55.97\n" + ] + } + ], + "source": [ + "#pg 131\n", + "print('Example 5.19')\n", + "\n", + "# aim : To determine the \n", + "# (a) Gamma,\n", + "# (b) del_U\n", + "import math\n", + "# Given Values\n", + "P1 = 1400.;# [kN/m^2]\n", + "P2 = 100.;# [kN/m^2]\n", + "P3 = 220.;# [kN/m^2]\n", + "T1 = 273.+360;# [K]\n", + "m = .23;# [kg]\n", + "cp = 1.005;# [kJ/kg*K]\n", + "\n", + "# Solution\n", + "T3 = T1;# since process 1-3 is isothermal\n", + "\n", + "# (a)\n", + "# for process 1-3, P1*V1=P3*V3,so\n", + "V3_by_V1 = P1/P3;\n", + "# also process 1-2 is adiabatic,so P1*V1^(Gamma)=P2*V2^(Gamma),hence\n", + "# and process process 2-3 is iso-choric so,V3=V2 and\n", + "V2_by_V1 = V3_by_V1;\n", + "# hence,\n", + "Gamma = math.log(P1/P2)/math.log(P1/P3); # heat capacity ratio\n", + "\n", + "print ' (a) The value of adiabatic index Gamma is = ',round(Gamma,3)\n", + "\n", + "# (b)\n", + "cv = cp/Gamma;# [kJ/kg K]\n", + "# for process 2-3,P3/T3=P2/T2,so\n", + "T2 = P2*T3/P3;# [K]\n", + "\n", + "# now\n", + "del_U = m*cv*(T2-T1);# [kJ]\n", + "print ' (b) The change in internal energy during the adiabatic expansion is U2-U1 (This is loss of internal energy) (kJ) = ',round(del_U,2)\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20: pg 133" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.20\n", + " The mass of oxygen used (kg) = 5.5\n", + " The amount of heat transferred through the cylinder wall is (kJ) = 13.28\n" + ] + } + ], + "source": [ + "#pg 133\n", + "print('Example 5.20');\n", + "\n", + "# aim : To determine \n", + "# the mass of oxygen and heat transferred\n", + "\n", + "# Given values\n", + "V1 = 300.;# [L]\n", + "P1 = 3.1;# [MN/m^2]\n", + "T1 = 273.+18;# [K]\n", + "P2 = 1.7;# [MN/m^2]\n", + "T2 = 273.+15;# [K]\n", + "Gamma = 1.4; # heat capacity ratio\n", + "# density condition\n", + "P = .101325;# [MN/m^2]\n", + "T = 273.;# [K]\n", + "V = 1.;# [m^3]\n", + "m = 1.429;# [kg]\n", + "\n", + "# hence\n", + "R = P*V*10**3/(m*T);# [kJ/kg*K]\n", + "# since volume is constant\n", + "V2 = V1;# [L]\n", + "# for the initial conditions in the cylinder,P1*V1=m1*R*T1\n", + "m1 = P1*V1/(R*T1);# [kg]\n", + "\n", + "# after some of the gas is used\n", + "m2 = P2*V2/(R*T2);# [kg]\n", + "# The mass of oxygen remaining in cylinder is m2 kg,so\n", + "# Mass of oxygen used is\n", + "m_used = m1-m2;# [kg]\n", + "print ' The mass of oxygen used (kg) = ',round(m_used,1)\n", + "\n", + "# for non-flow process,Q=del_U+W\n", + "# volume is constant so no external work is done so,Q=del_U\n", + "cv = R/(Gamma-1);# [kJ/kg*K]\n", + "\n", + "# heat transfer is\n", + "Q = m2*cv*(T1-T2);# (kJ)\n", + "print ' The amount of heat transferred through the cylinder wall is (kJ) = ',round(Q,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21: pg 134" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.21\n", + " (a) The work transferred during the compression is (kJ) = -28.1\n", + " (b) The change in internal energy is (kJ) = 14.2\n", + " (c) The heat transferred during the compression is (kJ) = -14.0\n" + ] + } + ], + "source": [ + "#pg 134\n", + "print('Example 5.21');\n", + "\n", + "# aim : To determine the\n", + "# (a) work transferred during the compression\n", + "# (b) change in internal energy\n", + "# (c) heat transferred during the compression\n", + "\n", + "# Given values\n", + "V1 = .1;# initial volume, [m^3]\n", + "P1 = 120.;# initial pressure, [kN/m^2]\n", + "P2 = 1200.; # final pressure, [kN/m^2]\n", + "T1 = 273.+25;# initial temperature, [K]\n", + "cv = .72;# [kJ/kg*K]\n", + "R = .285;# [kJ/kg*K]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# given process is polytropic with\n", + "n = 1.2; # polytropic index\n", + "# hence\n", + "V2 = V1*(P1/P2)**(1/n);# [m^3]\n", + "W = (P1*V1-P2*V2)/(n-1);# workdone formula, [kJ]\n", + "print ' (a) The work transferred during the compression is (kJ) = ',round(W,1)\n", + "\n", + "# (b)\n", + "# now mass is constant so,\n", + "T2 = P2*V2*T1/(P1*V1);# [K]\n", + "# using, P*V=m*R*T\n", + "m = P1*V1/(R*T1);# [kg]\n", + "\n", + "# change in internal energy is\n", + "del_U = m*cv*(T2-T1);# [kJ]\n", + "print ' (b) The change in internal energy is (kJ) = ',round(del_U,1)\n", + "\n", + "# (c)\n", + "Q = del_U+W;# [kJ]\n", + "print ' (c) The heat transferred during the compression is (kJ) = ',round(Q,0)\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22: pg 135" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.22\n", + " (a) The new pressure of the air in the receiver is (kN/m^2) = 442.0\n", + " (b) The specific enthalpy of the air at 15 C is (kJ/kg) = 15.075\n" + ] + } + ], + "source": [ + "#pg 135\n", + "print('Example 5.22');\n", + "\n", + "# aim : To determine the\n", + "# (a) new pressure of the air in the receiver\n", + "# (b) specific enthalpy of air at 15 C\n", + "\n", + "# Given values\n", + "V1 = .85;# [m^3]\n", + "T1 = 15.+273;# [K]\n", + "P1 = 275.;# pressure,[kN/m^2]\n", + "m = 1.7;# [kg]\n", + "cp = 1.005;# [kJ/kg*K]\n", + "cv = .715;# [kJ/kg*K]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "\n", + "R = cp-cv;# [kJ/kg*K]\n", + "# assuming m1 is original mass of the air, using P*V=m*R*T\n", + "m1 = P1*V1/(R*T1);# [kg]\n", + "m2 = m1+m;# [kg]\n", + "# again using P*V=m*R*T\n", + "# P2/P1=(m2*R*T2/V2)/(m1*R*T1/V1); and T1=T2,V1=V2,so\n", + "P2 = P1*m2/m1;# [kN/m^2]\n", + "print ' (a) The new pressure of the air in the receiver is (kN/m^2) = ',round(P2)\n", + "\n", + "# (b)\n", + "# for 1 kg of air, h2-h1=cp*(T1-T0)\n", + "# and if 0 is chosen as the zero enthalpy, then\n", + "h = cp*(T1-273);# [kJ/kg]\n", + "print ' (b) The specific enthalpy of the air at 15 C is (kJ/kg) = ',h\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23: pg 136" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.23\n", + " (a) The characteristic gas constant of the gas is R (kJ/kg K) = 0.185\n", + " (b) The specific heat capacity of the gas at constant pressure cp (kJ/kg K) = 0.827\n", + " (c) The specific heat capacity of the gas at constant volume cv (kJ/kg K) = 0.642\n", + " (d) The change in internal energy is (kJ) = 136.0\n", + " (e) The work transfer is W (kJ) = 39.0\n" + ] + } + ], + "source": [ + "#pg 136\n", + "print('Example 5.23');\n", + "\n", + "# aim : T determine the\n", + "# (a) characteristic gas constant of the gas\n", + "# (b) cp,\n", + "# (c) cv,\n", + "# (d) del_u \n", + "# (e) work transfer\n", + "\n", + "# Given values\n", + "P = 1.;# [bar] \n", + "T1 = 273.+15;# [K]\n", + "m = .9;# [kg]\n", + "T2 = 273.+250;# [K]\n", + "Q = 175.;# heat transfer,[kJ]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# using, P*V=m*R*T, given,\n", + "m_by_V = 1.875;\n", + "# hence\n", + "R = P*100/(T1*m_by_V);# [kJ/kg*K]\n", + "print ' (a) The characteristic gas constant of the gas is R (kJ/kg K) = ',round(R,3)\n", + "\n", + "# (b)\n", + "# using, Q=m*cp*(T2-T1)\n", + "cp = Q/(m*(T2-T1));# [kJ/kg K]\n", + "print ' (b) The specific heat capacity of the gas at constant pressure cp (kJ/kg K) = ',round(cp,3)\n", + "\n", + "# (c)\n", + "# we have, cp-cv=R,so\n", + "cv = cp-R;# [kJ/kg*K]\n", + "print ' (c) The specific heat capacity of the gas at constant volume cv (kJ/kg K) = ',round(cv,3)\n", + "\n", + "# (d)\n", + "del_U = m*cv*(T2-T1);# [kJ]\n", + "print ' (d) The change in internal energy is (kJ) = ',round(del_U)\n", + "\n", + "# (e)\n", + "# using, Q=del_U+W\n", + "W = Q-del_U;# [kJ]\n", + "print ' (e) The work transfer is W (kJ) = ',round(W)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 24: pg 136" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.24\n", + " (a) The work transfer is W (kJ) = 198.2\n", + " (b) The change of internal energy is del_U (kJ) = -157.3\n", + " (c) The heat transfer Q (kJ) = 40.8\n", + "The answer is a bit different due to rounding off error in textbook\n" + ] + } + ], + "source": [ + "#pg 136\n", + "print('Example 5.24');\n", + "\n", + "# aim : To determine the\n", + "# (a) work transfer,\n", + "# (b)del_U and,\n", + "# (c)heat transfer\n", + "\n", + "# Given values\n", + "V1 = .15;# [m^3]\n", + "P1 = 1200.;# [kN/m^2]\n", + "T1 = 273.+120;# [K]\n", + "P2 = 200.;# [kN/m^2]\n", + "cp = 1.006;#[kJ/kg K]\n", + "cv = .717;# [kJ/kg K]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# Given, PV^1.32=constant, so it is polytropic process with\n", + "n = 1.32;# polytropic index\n", + "# hence\n", + "V2 = V1*(P1/P2)**(1./n);# [m^3]\n", + "# now, W\n", + "W = (P1*V1-P2*V2)/(n-1);# [kJ]\n", + "print ' (a) The work transfer is W (kJ) = ',round(W,1)\n", + "\n", + "# (b)\n", + "R = cp-cv;# [kJ/kg K]\n", + "m = P1*V1/(R*T1);# gas law,[kg]\n", + "# also for polytropic process\n", + "T2 = T1*(P2/P1)**((n-1)/n);# [K]\n", + "# now for gas,\n", + "del_U = m*cv*(T2-T1);# [kJ]\n", + "print ' (b) The change of internal energy is del_U (kJ) = ',round(del_U,1)\n", + "\n", + "# (c)\n", + "Q = del_U+W;# first law of thermodynamics,[kJ]\n", + "print ' (c) The heat transfer Q (kJ) = ',round(Q,1)\n", + "\n", + "print 'The answer is a bit different due to rounding off error in textbook'\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 26: pg 141" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 5.26\n", + "heat transfer from the gas (kJ) = -248.2\n", + " The volume of gas before transfer is (m^3) = 0.145\n", + " The volume of pressure vessel is (m^3) = 0.27\n" + ] + } + ], + "source": [ + "#pg 141\n", + "print('Example 5.26');\n", + "\n", + "# aim : To determine\n", + "# the volume of the pressure vessel and the volume of the gas before transfer\n", + "\n", + "# Given values\n", + "\n", + "P1 = 1400.;# initial pressure,[kN/m^2]\n", + "T1 = 273.+85;# initial temperature,[K]\n", + "\n", + "P2 = 700.;# final pressure,[kN/m^2]\n", + "T2 = 273.+60;# final temperature,[K]\n", + "\n", + "m = 2.7;# mass of the gas passes,[kg]\n", + "cp = .88;# [kJ/kg]\n", + "cv = .67;# [kJ/kg]\n", + "\n", + "# solution\n", + "\n", + "# steady flow equation is, u1+P1*V1+C1^2/2+Q=u2+P2*V2+C2^2/2+W [1], \n", + "# given, there is no kinetic energy change and neglecting potential energy term\n", + "W = 0;# no external work done\n", + "# so final equation is,u1+P1*v1+Q=u2 [2]\n", + "# also u2-u1=cv*(T2-T1)\n", + "# hence Q=cv*(T2-T1)-P1*v1 [3]\n", + "# and for unit mass P1*v1=R*T1=(cp-cv)*T1 [4]\n", + "# so finally\n", + "Q = cv*(T2-T1)-(cp-cv)*T1;# [kJ/kg]\n", + "# so total heat transferred is\n", + "Q2 = m*Q;# [kJ] \n", + "\n", + "# using eqn [4]\n", + "v1 = (cp-cv)*T1/P1;# [m^3/kg]\n", + "# Total volume is\n", + "V1 = m*v1;# [m^3]\n", + "\n", + "# using ideal gas equation P1*V1/T1=P2*V2/T2\n", + "V2 = P1*T2*V1/(P2*T1);# final volume,[m^3]\n", + "\n", + "print 'heat transfer from the gas (kJ) = ',round(Q2,1)\n", + "print ' The volume of gas before transfer is (m^3) = ',round(V1,3)\n", + "print ' The volume of pressure vessel is (m^3) = ',round(V2,2)\n", + " \n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter7.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter7.ipynb new file mode 100644 index 00000000..fceaae2b --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter7.ipynb @@ -0,0 +1,622 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7 - Entropy" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 159" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 7.1\n", + " The specific entropy of water is (kJ/kg K) = 1.304\n", + " From table The accurate value of sf in this case is (kJ/kg K) = 1.307\n", + "There is small error in book's final value of sf\n" + ] + } + ], + "source": [ + "#pg 159\n", + "print('Example 7.1');\n", + "import math\n", + "# aim : To determine\n", + "# the specific enthalpy of water\n", + "\n", + "# Given values\n", + "Tf = 273.+100;# Temperature,[K]\n", + "\n", + "# solution\n", + "# from steam table\n", + "cpl = 4.187;# [kJ/kg K]\n", + "# using equation [8]\n", + "sf = cpl*math.log(Tf/273.16);# [kJ/kg*K]\n", + "print ' The specific entropy of water is (kJ/kg K) = ',round(sf,3)\n", + "\n", + "# using steam table\n", + "sf = 1.307;# [kJ/kg K]\n", + "print ' From table The accurate value of sf in this case is (kJ/kg K) = ',sf\n", + "\n", + "print \"There is small error in book's final value of sf\"\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 160" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 7.2\n", + " (a) The specific entropy of wet steam is (kJ/kg K) = 5.52\n", + " (b) The specific entropy using steam table is (kJ/kg K) = 5.559\n" + ] + } + ], + "source": [ + "#pg 160\n", + "print('Example 7.2');\n", + "\n", + "# aim : To determine\n", + "# the specific entropy\n", + "import math\n", + "# Given values\n", + "P = 2.;# pressure,[MN/m^2]\n", + "x = .8;# dryness fraction\n", + "\n", + "# solution\n", + "# from steam table at given pressure\n", + "Tf = 485.4;# [K]\n", + "cpl = 4.187;# [kJ/kg K]\n", + "hfg = 1888.6;# [kJ/kg]\n", + "\n", + "# (a) finding entropy by calculation\n", + "s = cpl*math.log(Tf/273.16)+x*hfg/Tf;# formula for entropy calculation\n", + "\n", + "print ' (a) The specific entropy of wet steam is (kJ/kg K) = ',round(s,2)\n", + "\n", + "# (b) calculation of entropy using steam table\n", + "# from steam table at given pressure\n", + "sf = 2.447;# [kJ/kg K]\n", + "sfg = 3.89;# [kJ/kg K]\n", + "# hence\n", + "s = sf+x*sfg;# [kJ/kg K]\n", + "\n", + "print ' (b) The specific entropy using steam table is (kJ/kg K) = ',s\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 161" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 7.3\n", + " (a) The specific entropy of steam is (kJ/kg K) = 6.822\n", + " (b) The accurate value of specific entropy from steam table is (kJ/kg K) = 6.919\n" + ] + } + ], + "source": [ + "#pg 161\n", + "print('Example 7.3');\n", + "import math\n", + "# aim : To determine\n", + "# the specific entropy of steam\n", + "\n", + "# Given values\n", + "P = 1.5;#pressure,[MN/m^2]\n", + "T = 273.+300;#temperature,[K]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# from steam table\n", + "cpl = 4.187;# [kJ/kg K]\n", + "Tf = 471.3;# [K]\n", + "hfg = 1946.;# [kJ/kg]\n", + "cpv = 2.093;# [kJ/kg K]\n", + "\n", + "# usung equation [2]\n", + "s = cpl*math.log(Tf/273.15)+hfg/Tf+cpv*math.log(T/Tf);# [kJ/kg K]\n", + "print ' (a) The specific entropy of steam is (kJ/kg K) = ',round(s,3)\n", + "\n", + "# (b)\n", + "# from steam tables\n", + "s = 6.919;# [kJ/kg K]\n", + "print ' (b) The accurate value of specific entropy from steam table is (kJ/kg K) = ',s\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 164" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 7.4\n", + " The final dryness fraction of steam is x2 = 0.989\n" + ] + } + ], + "source": [ + "#pg 164\n", + "print('Example 7.4');\n", + "\n", + "# aim : To determine\n", + "# the dryness fraction of steam\n", + "\n", + "# Given values\n", + "P1 = 2.;# initial pressure, [MN/m^2]\n", + "t = 350.;# temperature, [C]\n", + "P2 = .28;# final pressure, [MN/m^2]\n", + "\n", + "# solution\n", + "# at 2 MN/m^2 and 350 C,steam is superheated because the saturation temperature is 212.4 C\n", + "# From steam table\n", + "s1 = 6.957;# [kJ/kg K]\n", + "\n", + "# for isentropic process\n", + "s2 = s1;\n", + "# also\n", + "sf2 = 1.647;# [kJ/kg K]\n", + "sfg2 = 5.368;# [kJ/kg K]\n", + "\n", + "# using\n", + "# s2 = sf2+x2*sfg2, where x2 is dryness fraction of steam\n", + "# hence\n", + "x2 = (s2-sf2)/sfg2;\n", + "print ' The final dryness fraction of steam is x2 = ',round(x2,3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 165" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 7.5\n", + " (a) From steam table at .06 MN/m^2 steam is superheated and has temperature of 100 C with specific volume is (m^3/kg) = 2.83\n", + " (b) The change in specific entropy during the hyperbolic process is (kJ/kg K) = 0.679\n" + ] + } + ], + "source": [ + "#pg 165\n", + "print('Example 7.5');\n", + "\n", + "# aim : To determine\n", + "# the final condition of steam...\n", + "# the change in specific entropy during hyperbolic process\n", + "\n", + "# Given values\n", + "P1 = 2;# pressure, [MN/m^2]\n", + "t = 250.;# temperature, [C]\n", + "P2 = .36;# pressure, [MN/m^2]\n", + "P3 = .06;# pressure, [MN/m^2]\n", + "\n", + "# solution\n", + "\n", + "# (a)\n", + "# from steam table\n", + "s1 = 6.545;# [kJ/kg K]\n", + "# at .36 MN/m^2\n", + "sg = 6.930;# [kJ/kg*K]\n", + "\n", + "sf2 = 1.738;# [kJ/kg K]\n", + "sfg2 = 5.192;# [kJ/kg K]\n", + "vg2 = .510;# [m^3]\n", + "\n", + "# so after isentropic expansion, steam is wet\n", + "# hence, s2=sf2+x2*sfg2, where x2 is dryness fraction\n", + "# also\n", + "s2 = s1;\n", + "# so\n", + "x2 = (s2-sf2)/sfg2;\n", + "# and\n", + "v2 = x2*vg2;# [m^3]\n", + "\n", + "# for hyperbolic process\n", + "# P2*v2=P3*v3\n", + "# hence\n", + "v3 = P2*v2/P3;# [m^3]\n", + "\t\n", + "print ' (a) From steam table at .06 MN/m^2 steam is superheated and has temperature of 100 C with specific volume is (m^3/kg) = ',round(v3,2)\n", + "\n", + "# (b)\n", + "# at this condition\n", + "s3 = 7.609;# [kJ/kg*K]\n", + "# hence\n", + "change_s23 = s3-sg;# change in specific entropy during the hyperblic process[kJ/kg*K]\n", + "print ' (b) The change in specific entropy during the hyperbolic process is (kJ/kg K) = ',change_s23\n", + "\n", + "# In the book they have taken sg instead of s2 for part (b), so answer is not matching\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 166" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 7.6\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEZCAYAAABmTgnDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYnFWd9vHvHXaEhLBDgLCvskPYhDQkBBkUmHFkAAeR\niDOjzisjLyNkFBMcFeOr4zLiMg4y4IZxRAFFSSJpNglLCGvCTkIIkAAJIRACWX7vH+cUVRRVXZWu\nrq7q7vtzXX2l6qmnzvOrpqm7znPOc0oRgZmZWVcGtboAMzNrfw4LMzOryWFhZmY1OSzMzKwmh4WZ\nmdXksDAzs5ocFgOQpB9I+nyr6+gOSUdKekzSq5JObnU9vUHSSEnzWl0HgKQTJF3T6jrKSVpX0mxJ\nm7W6lv7KYdHPSJojaZmkJZIWSbpN0j9KUmGfiPhkRHyllXU24EvAdyNicERc1+pielG3LoiSdIOk\npTlcX5X0pqT7u9h/A0nfl/SipMWSOst2+TJwqaTtS9pdKmm1pNdKth3VnXq7KyLeAi4HxvXmcQeS\ntVtdgPW4AE6KiGmSNgZGAt8FDgPGNvPAktaKiFXNPAYwHJjVnSf2Un1tJSL+qvS+pGnA1C6e8mPS\nh8g9gMXAASXPPQQYHBF3500blzy2Ctg3Ip7uodK745fAfZLGRcSKFtbRL7ln0T8JICKWRsTvgb8D\nzpa0N4CkKyR9Kd/eRNL1khZKejnf3vbthqQdJd2ceyqT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b0TsD3we+GlJe/uSeiZHAuMlbQ1cTlp6o/C9E0cAfygtUNKOwKKIWFG2/VTg\nc8CJ5WuYSdoMeKuwNEOV/b+TX8v+pMUGq/U+1gN+C5waEY+XPTYDOLrK88yqclhYX7Msv/EfmP8t\nXX75t/nfGcCOXbRR+pz3kQMiIqaRvl+ksEz5tRHxVl4R+CZgRETcAuya39zPIH151eqy9rcBylf6\nHEV64z+pypdIjQEm19j/CNIKtAC/6OL1rQD+QvqegnILgW27eK5ZRQ4L60/ezP+uouvxuNdLbnc1\nNlD6mEruXwWcReph/KTC894A1i/b9iRp0bk9qhzrRN552qrS/uX1VLMKOA0YIWlc2WPr5/rM1ojD\nwvqaNV0OeilpwLiaW4G/B5DUAbxUsnLoKZLWzb2IkcDdefuVwL+QVvB8pEKbj5G+7a7UHNI4xlWS\n9qrwnP0i4v4a+08H/jbfPr2L16SIWA6cBJwpaWzJY7sDD3XxXLOKHBbW16xfNmbx1by9Wg/heuCv\nCwPcFfa7BDhY0v3AV8nfsZA9AHSSTul8KSJeAIiIhaTvHak4qyh/IdcTknYu2/4Y8BHg15J2IvV+\n3pR0MPCu5bkr7P9Z4HxJ9wG7ANWWJI/8/MWkHsvnJX0gP3YUMKXK88yq8hLlZhVIGg8sjYj/qPDY\nhqTvwD6odEC6bJ9TgIMj4otdHOMa0vTag4AnImJSjZo2yDOakPR3wOkR8ddr8JoOIH3ny9n1Pses\nwNdZmK2BfO3C5cA3qwUFQERcm09fVWvnAeARYHJEvGuKbRUH5y8MErAYGFtj/3KbARev4XPMAPcs\nzMysDh6zMDOzmhwWZmZWk8PCzMxqcliYmVlNDgszM6vJYWFmZjX9f7Gf2fKqaz20AAAAAElFTkSu\nQmCC\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0xa5a7fd0>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " (a) The heat transfer during the expansion is (kJ) (received) = 1224.986976\n", + " (b) The work done during the expansion is (kJ) = 2705.234976\n" + ] + } + ], + "source": [ + "#pg 166\n", + "print('Example 7.6');\n", + "\n", + "# aim : To determine the\n", + "# (a) heat transfer during the expansion and\n", + "# (b) work done durind the expansion\n", + "%matplotlib inline\n", + "import matplotlib\n", + "from matplotlib import pyplot\n", + "# given values\n", + "m = 4.5; # mass of steam,[kg]\n", + "P1 = 3.; # initial pressure,[MN/m^2]\n", + "T1 = 300.+273; # initial temperature,[K]\n", + "\n", + "P2 = .1; # final pressure,[MN/m^2]\n", + "x2 = .96; # dryness fraction at final stage\n", + "\n", + "# solution\n", + "# for state point 1,using steam table\n", + "s1 = 6.541;# [kJ/kg/K]\n", + "u1 = 2751;# [kJ/kg]\n", + "\n", + "# for state point 2\n", + "sf2 = 1.303;# [kJ/kg/K]\n", + "sfg2 = 6.056;# [kJ/kg/k]\n", + "T2 = 273+99.6;# [K]\n", + "hf2 = 417;# [kJ/kg]\n", + "hfg2 = 2258;# [kJ/kg]\n", + "vg2 = 1.694;# [m^3/kg]\n", + "\n", + "# hence\n", + "s2 = sf2+x2*sfg2;# [kJ/kg/k]\n", + "h2 = hf2+x2*hfg2;# [kJ/kg]\n", + "u2 = h2-P2*x2*vg2*10**3;# [kJ/kg]\n", + "\n", + "# Diagram of example 7.6\n", + "x = ([s1, s2]);\n", + "y = ([T1, T2]);\n", + "pyplot.plot(x,y);\n", + "pyplot.title('Diagram for example 7.6(T vs s)');\n", + "pyplot.xlabel('Entropy (kJ/kg K)');\n", + "pyplot.ylabel('Temperature (K)');\n", + "x = ([s1,s1]);\n", + "y = ([0,T1]);\n", + "pyplot.plot(x,y);\n", + "x = ([s2,s2]);\n", + "y = ([0,T2]);\n", + "pyplot.plot(x,y);\n", + "pyplot.show()\n", + "# (a)\n", + "# Q_rev is area of T-s diagram\n", + "Q_rev = (T1+T2)/2*(s2-s1);# [kJ/kg]\n", + "# so total heat transfer is\n", + "Q_rev = m*Q_rev;# [kJ]\n", + "\n", + "# (b)\n", + "del_u = u2-u1;# change in internal energy, [kJ/kg]\n", + "# using 1st law of thermodynamics\n", + "W = Q_rev-m*del_u;# [kJ]\n", + "\n", + "print ' (a) The heat transfer during the expansion is (kJ) (received) = ',Q_rev\n", + "\n", + "print ' (b) The work done during the expansion is (kJ) = ',W\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7: pg 176" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 7.7\n", + " (a) The change of entropy is (kJ/K) = -0.046\n", + " (b) The approximate change of entropy obtained by dividing the heat transferred by the gas by the mean absolute temperature during the compression (kJ/K) = -0.0448\n" + ] + } + ], + "source": [ + "#pg 176\n", + "print('Example 7.7');\n", + "\n", + "# aim : To determine the \n", + "# (a) change of entropy\n", + "# (b) The approximate change of entropy obtained by dividing the heat transferred by the gas by the mean absolute temperature during the compression\n", + "import math\n", + "# Given values\n", + "P1 = 140.;# initial pressure,[kN/m^2]\n", + "V1 = .14;# initial volume, [m^3]\n", + "T1 = 273.+25;# initial temperature,[K]\n", + "P2 = 1400.;# final pressure [kN/m^2]\n", + "n = 1.25; # polytropic index\n", + "cp = 1.041;# [kJ/kg K]\n", + "cv = .743;# [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "R = cp-cv;# [kJ/kg/K]\n", + "# using ideal gas equation \n", + "m = P1*V1/(R*T1);# mass of gas,[kg]\n", + "# since gas is following law P*V^n=constant ,so \n", + "V2 = V1*(P1/P2)**(1./n);# [m^3]\n", + "\n", + "# using eqn [9]\n", + "del_s = m*(cp*math.log(V2/V1)+cv*math.log(P2/P1));# [kJ/K]\n", + "print ' (a) The change of entropy is (kJ/K) = ',round(del_s,3)\n", + "\n", + "# (b)\n", + "W = (P1*V1-P2*V2)/(n-1);# polytropic work,[kJ]\n", + "Gamma = cp/cv;# heat capacity ratio\n", + "Q = (Gamma-n)/(Gamma-1)*W;# heat transferred,[kJ]\n", + "\n", + "# Again using polytropic law\n", + "T2 = T1*(V1/V2)**(n-1);# final temperature, [K]\n", + "T_avg = (T1+T2)/2;# mean absolute temperature, [K]\n", + "\n", + "# so approximate change in entropy is\n", + "del_s = Q/T_avg;# [kJ/K]\n", + "\n", + "print ' (b) The approximate change of entropy obtained by dividing the heat transferred by the gas by the mean absolute temperature during the compression (kJ/K) = ',round(del_s,4)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8: pg 179" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 7.8\n", + " The change of entropy in constant volume process is (kJ/kg K) = 0.149\n", + " The change of entropy in constant pressure process is (kJ/kg K) = 0.332\n", + "there is misprint in the book's result\n" + ] + } + ], + "source": [ + "#pg 179\n", + "print('Example 7.8');\n", + "\n", + "# aim : To determine\n", + "# the change of entropy\n", + "import math\n", + "# Given values\n", + "m = .3;# [kg]\n", + "P1 = 350.;# [kN/m^2]\n", + "T1 = 273.+35;# [K]\n", + "P2 = 700.;# [kN/m^2]\n", + "V3 = .2289;# [m^3]\n", + "cp = 1.006;# [kJ/kg K]\n", + "cv = .717;# [kJ/kg K]\n", + "\n", + "# solution\n", + "# for constant volume process\n", + "R = cp-cv;# [kJ/kg K]\n", + "# using PV=mRT\n", + "V1 = m*R*T1/P1;# [m^3]\n", + "\n", + "# for constant volume process P/T=constant,so\n", + "T2 = T1*P2/P1;# [K]\n", + "s21 = m*cv*math.log(P2/P1);# formula for entropy change for constant volume process\n", + "print ' The change of entropy in constant volume process is (kJ/kg K) = ',round(s21,3)\n", + "\n", + "# 'For the above part result given in the book is wrong\n", + "\n", + "V2 = V1;\n", + "# for constant pressure process\n", + "T3 = T2*V3/V2;# [K]\n", + "s32 = m*cp*math.log(V3/V2);# [kJ/kg K]\n", + "\n", + "print ' The change of entropy in constant pressure process is (kJ/kg K) = ',round(s32,3)\n", + "\n", + "print \"there is misprint in the book's result\"\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9: pg 181" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 7.9\n", + " The change of entropy is (kJ/kg K) = 0.04151\n" + ] + } + ], + "source": [ + "#pg 181\n", + "print('Example 7.9');\n", + "import math\n", + "# aim : To determine\n", + "# the change of entropy\n", + "\n", + "# Given values\n", + "P1 = 700.;# initial pressure, [kN/m^2]\n", + "T1 = 273.+150;# Temperature ,[K]\n", + "V1 = .014;# initial volume, [m^3]\n", + "V2 = .084;# final volume, [m^3]\n", + "\n", + "# solution\n", + "# since process is isothermal so\n", + "T2 = T1;\n", + "# and using fig.7.10\n", + "del_s = P1*V1*math.log(V2/V1)/T1 ;# [kJ/K]\n", + "#results\n", + "print ' The change of entropy is (kJ/kg K) = ',round(del_s,5)\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter8.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter8.ipynb new file mode 100644 index 00000000..9280416c --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter8.ipynb @@ -0,0 +1,1584 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8 - Combustion" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 198" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.1\n", + " The stoichiometric mass of air required to burn 1 kg the fuel should be (kg/kg fuel) = 14.8\n" + ] + } + ], + "source": [ + "#pg 198\n", + "print('Example 8.1');\n", + "\n", + "# aim : To determine\n", + "# the stoichiometric mass of air required to burn 1 kg the fuel \n", + "\n", + "# Given values\n", + "C = .72;# mass fraction of C; [kg/kg]\n", + "H2 = .20;# mass fraction of H2;, [kg/kg]\n", + "O2 = .08;# mass fraction of O2, [kg/kg]\n", + "aO2=.232;# composition of oxygen in air\n", + "\n", + "# solution\n", + "# for 1kg of fuel\n", + "mO2 = 8./3*C+8*H2-O2;# mass of O2, [kg]\n", + "\n", + "# hence stoichiometric mass of O2 required is\n", + "msO2 = mO2/aO2;# [kg]\n", + "\n", + "#results\n", + "print ' The stoichiometric mass of air required to burn 1 kg the fuel should be (kg/kg fuel) = ',round(msO2,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 198" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.2\n", + " The stoichiometric mass of air required to burn 1 kg the fuel should be (kg/kg fuel) = 15.18\n" + ] + } + ], + "source": [ + "#pg 198\n", + "print('Example 8.2');\n", + "\n", + "# aim : To determine\n", + "# the stoichiometric mass of air required to burn 1 kg of heptane\n", + "\n", + "# Given values\n", + "C = .84;# mass fraction of C; [kg/kg]\n", + "H2 = .16;# mass fraction of H2;, [kg/kg]\n", + "x1 = 11.5;# mass fraction of O2, [kg/kg]\n", + "x2 = 34.5;# composition of oxygen in air\n", + "\n", + "# solution\n", + "# for 1kg of fuel\n", + "mO2 = x1*C + x2*H2 ;# mass of O2, [kg]\n", + "\n", + "mO22 = ((11*32)+100)/100\n", + "mO2x = (mO22-1)/.232\n", + "#results\n", + "print ' The stoichiometric mass of air required to burn 1 kg the fuel should be (kg/kg fuel) = ',round(mO2,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 199" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.3\n", + " The stoichiometric mass of air is (kg/kg fuel) = 13.52\n", + " CO2 produced = 3.01 kg/kg fuel, percentage composition = 20.7 ,\n", + " H2O produced = 1.08 kg/kg fuel, percentage composition = 7.43 ,\n", + " SO2 produced = 0.02 kg/kg fuel, percentage composition = 0.14 ,\n", + " N2 produced = 10.43 kg/kg fuel, percentage composition = 71.74\n" + ] + } + ], + "source": [ + "#pg 199\n", + "print('Example 8.3');\n", + "\n", + "# aim : To determine \n", + "# the stoichiometric mass of air\n", + "# the products of combustion both by mass and as percentage \n", + "\n", + "# Given values\n", + "C = .82;# mass composition C\n", + "H2 = .12;# mass composition of H2\n", + "O2 = .02;# mass composition of O2\n", + "S = .01;# mass composition of S\n", + "N2 = .03;# mass composition of N2\n", + "\n", + "# solution\n", + "# for 1kg fuel\n", + "mo2 = 8./3*C+8*H2-O2+S*1;# total mass of O2 required, [kg]\n", + "sa = mo2/.232;# stoichimetric air, [kg]\n", + "print ' The stoichiometric mass of air is (kg/kg fuel) = ',round(sa,2)\n", + "\n", + "# for one kg fuel\n", + "mCO2 = C*11/3;# mass of CO2 produced, [kg]\n", + "mH2O = H2*9;# mass of H2O produced, [kg]\n", + "mSO2 = S*2;# mass of SO2 produce, [kg]\n", + "mN2 = C*8.84+H2*26.5-O2*.768/.232+S*3.3+N2;# mass of N2 produced, [kg]\n", + "\n", + "mt = mCO2+mH2O+mSO2+mN2;# total mass of product, [kg]\n", + "\n", + "x1 = mCO2/mt*100;# %age mass composition of CO2 produced\n", + "x2 = mH2O/mt*100;# %age mass composition of H2O produced\n", + "x3 = mSO2/mt*100;# %age mass composition of SO2 produced\n", + "x4 = mN2/mt*100;# %age mass composition of N2 produced\n", + "\n", + "print ' CO2 produced = ',round(mCO2,2),' kg/kg fuel, percentage composition = ',round(x1,1),',\\n H2O produced = ',mH2O,' kg/kg fuel, percentage composition = ',round(x2,2),',\\n SO2 produced = ',mSO2,' kg/kg fuel, percentage composition = ',round(x3,2),',\\n N2 produced = ',round(mN2,2),' kg/kg fuel, percentage composition = ',round(x4,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 202" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.4\n", + " The stoichiometric volume of air required for complete combustion is (m^3/m^3 fuel) = 0.952\n" + ] + } + ], + "source": [ + "#pg 202\n", + "print('Example 8.4');\n", + "\n", + "# aim : To determine \n", + "# the stoichiometric volume of air required for complete combution of 1 m^3 of the gas\n", + "\n", + "# Given values\n", + "H2 = .14;# volume fraction of H2\n", + "CH4 = .02;# volume fraction of CH4\n", + "CO = .22;# volume fraction of CO\n", + "CO2 = .05;# volume fraction of CO2\n", + "O2 = .02;# volume fraction of O2\n", + "N2 = .55;# volume fraction of N2\n", + "\n", + "# solution\n", + "# for 1 m^3 of fuel\n", + "Va = .5*H2+2*CH4+.5*CO-O2;# [m^3]\n", + "\n", + "# stoichiometric air required is\n", + "Vsa = Va/.21;# [m^3]\n", + "#results\n", + "print ' The stoichiometric volume of air required for complete combustion is (m^3/m^3 fuel) = ',round(Vsa,3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 203" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.5\n", + " The volume of air required is(m^3/m^3 fuel) = 3.451\n", + "Result in the book is misprinted\n" + ] + } + ], + "source": [ + "#pg 203\n", + "print('Example 8.5');\n", + "\n", + "# aim : To determine\n", + "# the volume of the air required \n", + "\n", + "# Given values\n", + "H2 = .45;# volume fraction of H2\n", + "CO = .40;# volume fraction of CO\n", + "CH4 = .15;# volume fraction of CH4\n", + "\n", + "# solution\n", + "V = 2.38*(H2+CO)+9.52*CH4;# stoichimetric volume of air, [m^3]\n", + "#results\n", + "print ' The volume of air required is(m^3/m^3 fuel) = ',V\n", + "\n", + "print 'Result in the book is misprinted'\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 203" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.6\n", + " Stoichiometric volume of air required is (m^3/m^3 fuel) = 3.15\n", + " N2 in products = 2.516 m^3/m^3 fuel, percentage composition = 66.8 ,\n", + " CO2 in products = 0.561 m^3/m^3 fuel, percentage composition = 14.9 ,\n", + " H2O in products = 0.689 m^3/m^3 fuel, percentage composition = 18.3\n" + ] + } + ], + "source": [ + "#pg 203\n", + "print('Example 8.6');\n", + "\n", + "# aim : To determine\n", + "# the stoichiometric volume of air for the complete combustion\n", + "# the products of combustion\n", + "\n", + "# given values\n", + "CH4 = .142;# volumetric composition of CH4\n", + "CO2 = .059;# volumetric composition of CO2\n", + "CO = .360;# volumetric composition of CO\n", + "H2 = .405;# volumetric composition of H2\n", + "O2 = .005;# volumetric composition of O2\n", + "N2 = .029;# volumetric composition of N2\n", + "\n", + "aO2 = .21;# O2 composition into air by volume\n", + "\n", + "# solution\n", + "svO2 = CH4*2+CO*.5+H2*.5-O2;# stroichiometric volume of O2 required, [m^3/m^3 fuel]\n", + "svair = svO2/aO2;# stroichiometric volume of air required, [m^3/m^3 fuel]\n", + "print ' Stoichiometric volume of air required is (m^3/m^3 fuel) = ',svair\n", + "\n", + "# for one m^3 fuel\n", + "vN2 = CH4*7.52+CO*1.88+H2*1.88-O2*.79/.21+N2;# volume of N2 produced, [m^3]\n", + "vCO2 = CH4*1+CO2+CO*1;# volume of CO2 produced, [m^3]\n", + "vH2O = CH4*2+H2*1;# volume of H2O produced, [m^3]\n", + "\n", + "vt = vN2+vCO2+vH2O;# total volume of product, [m^3]\n", + "\n", + "x1 = vN2/vt*100;# %age composition of N2 in product,\n", + "x2 = vCO2/vt*100;# %age composition of CO2 in product\n", + "x3 = vH2O/vt*100;# %age composition of H2O in product\n", + "\n", + "print ' N2 in products = ',round(vN2,3),' m^3/m^3 fuel, percentage composition = ',round(x1,1),',\\n CO2 in products = ',vCO2,' m^3/m^3 fuel, percentage composition =',round(x2,1),',\\n H2O in products = ',vH2O,'m^3/m^3 fuel, percentage composition =',round(x3,1)\n", + "\n", + "# End \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7: pg 206" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.7\n", + " Mass percentage of CO2 is = 27.8 \n", + "\n", + " Mass percentage of N2 is = 62.0 \n", + "\n", + " Mass percentage of O2 is = 10.1\n" + ] + } + ], + "source": [ + "#pg 206\n", + "print('Example 8.7');\n", + "\n", + "# aim : To determine\n", + "# the percentage analysis of the gas by mass\n", + "\n", + "# Given values\n", + "CO2 = 20.;# percentage volumetric composition of CO2\n", + "N2 = 70.;# percentage volumetric composition of N2\n", + "O2 = 10.;# percentage volumetric composition of O2\n", + "\n", + "mCO2 = 44.;# moleculer mas of CO2\n", + "mN2 = 28.;# moleculer mass of N2\n", + "mO2 = 32.;# moleculer mass of O2\n", + "\n", + "# solution\n", + "mgas = CO2*mCO2+N2*mN2+O2*mO2;# moleculer mass of gas \n", + "m1 = CO2*mCO2/mgas*100;# percentage composition of CO2 by mass \n", + "m2 = N2*mN2/mgas*100;# percentage composition of N2 by mass \n", + "m3 = O2*mO2/mgas*100;# percentage composition of O2 by mass \n", + "#results\n", + "print ' Mass percentage of CO2 is = ',round(m1,1),' \\n\\n Mass percentage of N2 is = ',round(m2,1),' \\n\\n Mass percentage of O2 is = ',round(m3,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8: pg 206" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.8\n", + " The percentage composition of CO by volume is = 6.9 \n", + ",\n", + "The percentage composition of N2 by volume is = 4.6 \n", + "\n", + "The percentage composition of CH4 by volume is = 6.0 \n", + "\n", + "The percentage composition of H2 by volume is = 80.5 \n", + "\n", + "The percentage composition of O2by volume is= 2.0\n" + ] + } + ], + "source": [ + "#pg 206\n", + "print('Example 8.8');\n", + "\n", + "# aim : To determine\n", + "# the percentage composition of the gas by volume\n", + "\n", + "# given values\n", + "CO = 30.;# %age mass composition of CO\n", + "N2 = 20.;# %age mass composition of N2\n", + "CH4 = 15.;# %age mass composition of CH4\n", + "H2 = 25.;# %age mass composition of H2\n", + "O2 = 10.;# %age mass composition of O2\n", + "\n", + "mCO = 28.;# molculer mass of CO\n", + "mN2 = 28.;# molculer mass of N2\n", + "mCH4 = 16.;# molculer mass of CH4\n", + "mH2 = 2.;# molculer mass of H2\n", + "mO2 = 32.;# molculer mass of O2\n", + "\n", + "# solution\n", + "vg = CO/mCO+N2/mN2+CH4/mCH4+H2/mH2+O2/mO2;\n", + "v1 = CO/mCO/vg*100;# %age volume composition of CO\n", + "v2 = N2/mN2/vg*100;# %age volume composition of N2\n", + "v3 = CH4/mCH4/vg*100;# %age volume composition of CH4\n", + "v4 = H2/mH2/vg*100;# %age volume composition of H2\n", + "v5 = O2/mO2/vg*100;# %age volume composition of O2\n", + "#results\n", + "print ' The percentage composition of CO by volume is = ',round(v1,1),' \\n,\\nThe percentage composition of N2 by volume is =',round(v2,1), '\\n\\nThe percentage composition of CH4 by volume is = ',round(v3,1),'\\n\\nThe percentage composition of H2 by volume is = ',round(v4,1),' \\n\\nThe percentage composition of O2by volume is= ',round(v5,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 9: pg 209" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.9\n", + " The mass of air supplied per/kg of fuel burnt is (kg) = 21.1\n" + ] + } + ], + "source": [ + "#pg 209\n", + "print('Example 8.9');\n", + "\n", + "# aim : To determine\n", + "# the mass of air supplied per kilogram of fuel burnt\n", + "\n", + "# given values\n", + "CO2 = 8.85;# volume composition of CO2\n", + "CO = 1.2;# volume composition of CO\n", + "O2 = 6.8;# volume composition of O2\n", + "N2 = 83.15;# volume composition of N2 \n", + "\n", + "# composition of gases in the fuel oil\n", + "C = .84;# mass composition of carbon \n", + "H = .14;# mass composition of hydrogen\n", + "o2 = .02;# mass composition of oxygen\n", + "\n", + "mC = 12.;# moleculer mass of Carbon\n", + "mCO2 = 44.;# molculer mass of CO2\n", + "mCO = 28.;# molculer mass of CO\n", + "mN2 = 28.;# molculer mass of N2\n", + "mO2 = 32.;# molculer mass of O2\n", + "aO2 = .23;# mass composition of O2 in air\n", + "\n", + "# solution\n", + "ma = (8./3*C+8*H-o2)/aO2;# theoretical mass of air/kg fuel, [kg]\n", + "\n", + "mgas = CO2*mCO2+CO*mCO+N2*mN2+O2*mO2;# total mass of gas/kg fuel, [kg]\n", + "x1 = CO2*mCO2/mgas;# composition of CO2 by mass \n", + "x2 = CO*mCO/mgas;# composition of CO by mass\n", + "x3 = O2*mO2/mgas;# composition of O2 by mass \n", + "x4 = N2*mN2/mgas;# composition of N2 by mass \n", + "\n", + "m1 = x1*mC/mCO2+x2*mC/mCO;# mass of C/kg of dry flue gas, [kg]\n", + "m2 = C;# mass of C/kg fuel, [kg]\n", + "mf = m2/m1;# mass of dry flue gas/kg fuel, [kg]\n", + "mo2 = mf*x3;# mass of excess O2/kg fuel, [kg]\n", + "mair = mo2/aO2;# mass of excess air/kg fuel, [kg]\n", + "m = ma+mair;# mass of excess air supplied/kg fuel, [kg]\n", + "#results\n", + "print ' The mass of air supplied per/kg of fuel burnt is (kg) = ',round(m,1)\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10: pg 210" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.10\n", + "The percentage composition of CO2 by volume is = 10.98 \n", + ",\n", + "The percentage composition of H2O by volume is = 10.72 \n", + ",\n", + "The percentage composition of O2 by volume is = 3.27 \n", + ",\n", + "The percentage composition of N2 by volume is = 75.03\n" + ] + } + ], + "source": [ + "#pg 210\n", + "print('Example 8.10');\n", + "\n", + "# aim : To determine\n", + "# volumetric composition of the products of combustion\n", + "\n", + "# given values\n", + "C = .86;# mass composition of carbon\n", + "H = .14;# mass composition of hydrogen\n", + "Ea = .20;# excess air for combustion\n", + "O2 = .23;# mass composition of O2 in air \n", + "\n", + "MCO2 = 44.;# moleculer mass of CO2\n", + "MH2O = 18.;# moleculer mass of H2O\n", + "MO2 = 32.;# moleculer mass of O2\n", + "MN2 = 28.;# moleculer mass of N2,\n", + "\n", + "\n", + "# solution\n", + "sO2 = (8./3*C+8*H);# stoichiometric O2 required, [kg/kg petrol]\n", + "sair = sO2/O2;# stoichiometric air required, [kg/kg petrol]\n", + "# for one kg petrol\n", + "mCO2 = 11./3*C;# mass of CO2,[kg]\n", + "mH2O = 9*H;# mass of H2O, [kg]\n", + "mO2 = Ea*sO2;# mass of O2, [kg]\n", + "mN2 = 14.84*(1+Ea)*(1-O2);# mass of N2, [kg]\n", + "\n", + "mt = mCO2+mH2O+mO2+mN2;# total mass, [kg]\n", + "# percentage mass composition\n", + "x1 = mCO2/mt*100;# mass composition of CO2\n", + "x2 = mH2O/mt*100;# mass composition of H2O\n", + "x3 = mO2/mt*100;# mass composition of O2\n", + "x4 = mN2/mt*100;# mass composition of N2\n", + "\n", + "vt = x1/MCO2+x2/MH2O+x3/MO2+x4/MN2;# total volume of petrol\n", + "v1 = x1/MCO2/vt*100;# %age composition of CO2 by volume\n", + "v2 = x2/MH2O/vt*100;# %age composition of H2O by volume\n", + "v3 = x3/MO2/vt*100;# %age composition of O2 by volume\n", + "v4 = x4/MN2/vt*100;# %age composition of N2 by volume\n", + " #results\n", + "print 'The percentage composition of CO2 by volume is =',round(v1,2),'\\n,\\nThe percentage composition of H2O by volume is = ',round(v2,2),' \\n,\\nThe percentage composition of O2 by volume is = ',round(v3,2),'\\n,\\nThe percentage composition of N2 by volume is = ',round(v4,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11: pg 211" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.11\n", + " The energy carried away by the dry flue gas/kg is (kg) = 5000.0\n" + ] + } + ], + "source": [ + "#pg 211\n", + "print('Example 8.11');\n", + "\n", + "# aim : To determine\n", + "# the energy carried away by the dry flue gas/kg of fuel burned\n", + "\n", + "# given values\n", + "C = .78;# mass composition of carbon\n", + "H2 = .06;# mass composition of hydrogen\n", + "O2 = .09;# mass composition of oxygen\n", + "Ash = .07;# mass composition of ash\n", + "Ea = .50;# excess air for combustion\n", + "aO2 = .23;# mass composition of O2 in air \n", + "Tb = 273.+20;# boiler house temperature, [K]\n", + "Tf = 273.+320;# flue gas temperature, [K]\n", + "c = 1.006;# specific heat capacity of dry flue gas, [kJ/kg K]\n", + "\n", + "# solution\n", + "# for one kg of fuel\n", + "sO2 = (8./3*C+8*H2);# stoichiometric O2 required, [kg/kg fuel]\n", + "sO2a = sO2-O2;# stoichiometric O2 required from air, [kg/kg fuel]\n", + "sair = sO2a/aO2;# stoichiometric air required, [kg/kg fuel]\n", + "ma = sair*(1+Ea);# actual air supplied/kg of fuel, [kg]\n", + "# total mass of flue gas/kg fuel is\n", + "mf = ma+1;# [kg]\n", + "mH2 = 9*H2;#H2 produced, [kg] \n", + "# hence, mass of dry flue gas/kg coall is\n", + "m = mf-mH2;# [kg]\n", + "Q = m*c*(Tf-Tb);# energy carried away by flue gas, [kJ]\n", + "#results\n", + "print ' The energy carried away by the dry flue gas/kg is (kg) = ',round(Q)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12: pg 212" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.12\n", + " (a) The stoichiometric volume of air for the complete combustion (m^3/m^3 gas) = 9.702\n", + " (b) The percentage volumetric composition of CO2 in produced is = 9.6 \n", + ",\n", + " The percentage volumetric composition of H2O in produced is = 18.8 \n", + ",\n", + " The percentage volumetric composition of N2 in produced is = 71.6\n" + ] + } + ], + "source": [ + "#pg 212\n", + "print('Example 8.12');\n", + "\n", + "# aim : To determine\n", + "# (a) the stoichiometric volume of air for the complete combustion of 1 m^3\n", + "# (b) the percentage volumetric analysis of the products of combustion\n", + "\n", + "# given values\n", + "N2 = .018;# volumetric composition of N2\n", + "CH4 = .94;# volumetric composition of CH4\n", + "C2H6 = .035;# volumetric composition of C2H6\n", + "C3H8 = .007;# volumetric composition of C3H8\n", + "aO2 = .21;# O2 composition in air\n", + "\n", + "# solution\n", + "# (a)\n", + "# for CH4\n", + "# CH4 +2 O2= CO2 + 2 H2O\n", + "sva1 = 2./aO2;# stoichiometric volume of air, [m^3/m^3 CH4]\n", + "svn1 = sva1*(1-aO2);# stoichiometric volume of nitrogen in the air, [m^3/m^3 CH4]\n", + "\n", + "# for C2H6\n", + "# 2 C2H6 +7 O2= 4 CO2 + 6 H2O\n", + "sva2 = 7./2/aO2;# stoichiometric volume of air, [m^3/m^3 C2H6]\n", + "svn2 = sva2*(1-aO2);# stoichiometric volume of nitrogen in the air, [m^3/m^3 C2H6]\n", + "\n", + "# for C3H8\n", + "# C3H8 +5 O2=3 CO2 + 4 H2O\n", + "sva3 = 5/aO2;# stoichiometric volume of air, [m^3/m^3 C3H8]\n", + "svn3 = sva3*(1-aO2);# stoichiometric volume of nitrogen in the air, [m^3/m^3 C3H8]\n", + "\n", + "Sva = CH4*sva1+C2H6*sva2+C3H8*sva3;# stoichiometric volume of air required, [m^3/m^3 gas]\n", + "print ' (a) The stoichiometric volume of air for the complete combustion (m^3/m^3 gas) = ',round(Sva,3)\n", + "\n", + "# (b)\n", + "# for one m^3 of natural gas\n", + "vCO2 = CH4*1+C2H6*2+C3H8*3;# volume of CO2 produced, [m^3]\n", + "vH2O = CH4*2+C2H6*3+C3H8*4;# volume of H2O produced, [m^3]\n", + "vN2 = CH4*svn1+C2H6*svn2+C3H8*svn3+N2;# volume of N2 produced, [m^3]\n", + "\n", + "vg = vCO2+vH2O+vN2;# total volume of gas, [m^3]\n", + "x1 = vCO2/vg*100;# volume percentage of CO2 produced\n", + "x2 = vH2O/vg*100;# volume percentage of H2O produced\n", + "x3 = vN2/vg*100;# volume percentage of N2 produced\n", + "\n", + "print ' (b) The percentage volumetric composition of CO2 in produced is = ',round(x1,1),' \\n,\\n The percentage volumetric composition of H2O in produced is = ',round(x2,1),' \\n,\\n The percentage volumetric composition of N2 in produced is = ',round(x3,1)\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13: pg 214" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.13\n", + " (a) Volume of air taken by fan is (m^3/s) = 2.51\n", + " (b) Percentage mass composition of CO2 is (percent) = 18.77\n", + " Percentage mass composition of O2 is (percent) = 5.24\n", + " Percentage mass composition of N2 is (percent) = 75.99\n" + ] + } + ], + "source": [ + "#pg 214\n", + "print('Example 8.13');\n", + "\n", + "# aim : To determine\n", + "# (a) the volume of air taken by the fan\n", + "# (b) the percentage composition of dry flue gas\n", + "\n", + "# gien values\n", + "C = .82;# mass composition of carbon\n", + "H = .08;# mass composition of hydrogen\n", + "O = .03;# mass composition of oxygen\n", + "A = .07;# mass composition of ash\n", + "mc = .19;# coal uses, [kg/s] \n", + "ea = .3;# percentage excess air of oxygen in the air required for combustion\n", + "Oa = .23;# percentage of oxygen by mass in the air\n", + "\n", + "# solution\n", + "# (a)\n", + "P = 100.;# air pressure, [kN/m^2]\n", + "T = 18.+273;# air temperature, [K]\n", + "R = .287;# [kJ/kg K]\n", + "# basis one kg coal\n", + "sO2 = 8./3*C+8*H;# stoichiometric O2 required, [kg]\n", + "aO2 = sO2-.03;# actual O2 required, [kg]\n", + "tO2 = aO2/Oa;# theoretical O2 required, [kg]\n", + "Aa = tO2*(1+ea);# actual air supplied, [kg]\n", + "m = Aa*mc;# Air supplied, [kg/s]\n", + "\n", + "# now using P*V=m*R*T\n", + "V = m*R*T/P;# volume of air taken ,[m^3/s]\n", + "print ' (a) Volume of air taken by fan is (m^3/s) = ',round(V,2)\n", + "\n", + "# (b)\n", + "mCO2 = 11./3*C;# mass of CO2 produced, [kg]\n", + "mO2 = aO2*.3;# mass of O2 produces, [kg]\n", + "mN2 = Aa*.77;# mass of N2 produced, [[kg]\n", + "mt = mCO2+mO2+mN2;# total mass, [kg]\n", + "\n", + "print ' (b) Percentage mass composition of CO2 is (percent) = ',round(mCO2/mt*100,2)\n", + "print ' Percentage mass composition of O2 is (percent) = ',round(mO2/mt*100,2)\n", + "print ' Percentage mass composition of N2 is (percent) = ',round(mN2/mt*100,2)\n", + "\n", + "\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14: pg 215" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.14\n", + " (a) Mass of fuel used per cycle is (g) = 0.444\n", + " (b) The mass of air supplied per cycle is (kg) = 0.0136\n", + " (c) The volume of air taken in per cycle is (m^3) = 0.0114\n" + ] + } + ], + "source": [ + "#pg 215\n", + "print('Example 8.14');\n", + "\n", + "# aim : To determine \n", + "# (a) the mass of fuel used per cycle\n", + "# (b) the actual mass of air taken in per cycle\n", + "# (c) the volume of air taken in per cycle\n", + "\n", + "# given values\n", + "W = 15.;# work done, [kJ/s]\n", + "N = 5.;# speed, [rev/s]\n", + "C = .84;# mass composition of carbon\n", + "H = .16;# mass composition of hydrogen\n", + "ea = 1.;# percentage excess air supplied \n", + "CV = 45000.;# calorificvalue of fuel, [kJ/kg]\n", + "n_the = .3;# thermal efficiency\n", + "P = 100.;# pressuer, [kN/m^2]\n", + "T = 273.+15;# temperature, [K]\n", + "R = .29;# gas constant, [kJ/kg K]\n", + "\n", + "# solution\n", + "# (a)\n", + "E = W*2/N/n_the;# energy supplied, [kJ/cycle]\n", + "mf = E/CV;# mass of fuell used, [kg]\n", + "print ' (a) Mass of fuel used per cycle is (g) = ',round(mf*10**3,3)\n", + "\n", + "# (b)\n", + "# basis 1 kg fuel\n", + "mO2 = C*8./3+8*H;# mass of O2 requirea, [kg]\n", + "smO2 = mO2/.23;# stoichiometric mass of air, [kg]\n", + "ma = smO2*(1+ea);# actual mass of air supplied, [kg]\n", + "m = ma*mf;# mass of air supplied, [kg/cycle]\n", + "print ' (b) The mass of air supplied per cycle is (kg) = ',round(m,4)\n", + "\n", + "# (c)\n", + "V = m*R*T/P;# volume of air, [m^3]\n", + "print ' (c) The volume of air taken in per cycle is (m^3) = ',round(V,4)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15: pg 216" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.15\n", + " (a) The mass of coal used per hour is (kg) = 95.7\n", + " (b) The mass of air supplied per hour is (kg) = 1590.0\n", + " (c) The mass percentage composition of CO2 = 20.83 ,\n", + " The mass percentage composition of H2O = 3.08 ,\n", + " The mass percentage composition of O2 = 3.89 ,\n", + " The mass percentage composition of N2 = 72.2\n" + ] + } + ], + "source": [ + "#pg 216\n", + "print('Example 8.15');\n", + "\n", + "# aim : To determine\n", + "# (a) the mass of coal used per hour\n", + "# (b) the mass of air used per hour\n", + "# (c) the percentage analysis of the flue gases by mass\n", + "\n", + "# given values\n", + "m = 900.;# mass of steam boiler generate/h, [kg]\n", + "x = .96;# steam dryness fraction\n", + "P = 1400.;# steam pressure, [kN/m^2]\n", + "Tf = 52.;# feed water temperature, [C]\n", + "BE = .71;# boiler efficiency\n", + "CV = 33000.;# calorific value of coal, [kJkg[\n", + "ea = .22;# excess air supply\n", + "aO2 = .23;# oxygen composition in air\n", + "c = 4.187;# specific heat capacity of water, [kJ/kg K]\n", + "\n", + "# coal composition\n", + "C = .83;# mass composition of carbon\n", + "H2 = .05;# mass composition of hydrogen\n", + "O2 = .03;# mass composition of oxygen\n", + "ash = .09;# mass composition of ash\n", + "\n", + "# solution\n", + "# from steam table at pressure P\n", + "hf = 830.1;# specific enthalpy, [kJ/kg]\n", + "hfg = 1957.1;# specific enthalpy, [kJ/kg]\n", + "hg = 2728.8;# specific enthalpy, [kJ/kg]\n", + "\n", + "# (a)\n", + "h = hf+x*hfg;# specific enthalpy of steam generated by boiler, [kJ/kg]\n", + "hfw = c*Tf;# specific enthalpy of feed water, [kJ/kg]\n", + "Q = m*(h-hfw);# energy to steam/h, [kJ]\n", + "Qf = Q/BE;# energy required from fuel/h, [kJ]\n", + "mc = Qf/CV;# mass of coal/h,[kg]\n", + "print ' (a) The mass of coal used per hour is (kg) = ',round(mc,1)\n", + "\n", + "# (b)\n", + "# for one kg coal\n", + "mO2 = 8./3*C+8*H2-O2;# actual mass of O2 required, [kg]\n", + "mta = mO2/aO2;# theoretical mass of air, [kg]\n", + "ma = mta*(1+ea);# mass of air supplied, [kg]\n", + "mas = ma*116;# mass of air supplied/h, [kg]\n", + "print ' (b) The mass of air supplied per hour is (kg) = ',round(mas)\n", + "\n", + " \n", + "# (c)\n", + "# for one kg coal\n", + "mCO2 = 11./3*C;# mass of CO2 produced, [kg]\n", + "mH2O = 9*H2;# mass of H2O produced, [kg]\n", + "mO2 = mO2*ea;# mass of excess O2 in flue gas, [kg]\n", + "mN2 = ma*(1-aO2);# mass of N2 in flue gas, [kg]\n", + "\n", + "mt = mCO2+mH2O+mO2+mN2;# total mass of gas\n", + "x1 = mCO2/mt*100;# mass percentage composition of CO2\n", + "x2 = mH2O/mt*100;# mass percentage composition of H2O\n", + "x3 = mO2/mt*100;# mass percentage composition of O2\n", + "x4 = mN2/mt*100;# mass percentage composition of N2\n", + "\n", + "print ' (c) The mass percentage composition of CO2 = ',round(x1,2),' ,\\n The mass percentage composition of H2O = ',round(x2,2),' ,\\n The mass percentage composition of O2 = ',round(x3,2),' ,\\n The mass percentage composition of N2 =',round(x4,2)\n", + "# mass of coal taken in part (b) is wrong so answer is not matching\n", + "\n", + "# End\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16: pg 223" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.16\n", + " (a) The volume of the gas is (m^3) = 22.4\n", + " (b)(1) The average moleculer mass of air is (g/mol) = 28.84\n", + " (2) The value of R is (kJ/kg K) = 0.288\n", + " (3) The mass of one cubic metre of air at STP is (kg/m^3) = 1.287\n" + ] + } + ], + "source": [ + "#pg 223\n", + "print('Example 8.16');\n", + "\n", + "# aim : To determine\n", + "# (a) volume of gas\n", + "# (b) (1) the average molecular mass of air\n", + "# (2) the value of R\n", + "# (3) the mass of 1 m^3 of air at STP\n", + "\n", + "# given values\n", + "n = 1.;# moles of gas, [kmol]\n", + "P = 101.32;# standard pressure, [kN/m^2]\n", + "T = 273.;# gas tempearture, [K]\n", + "\n", + "O2 = 21.;# percentage volume composition of oxygen in air\n", + "N2 = 79.;# percentage volume composition of nitrogen in air\n", + "R = 8.3143;# molar gas constant, [kJ/kg K]\n", + "mO2 = 32.;# moleculer mass of O2\n", + "mN2 = 28.;# moleculer mass of N2\n", + "\n", + "# solution\n", + "# (a)\n", + "V = n*R*T/P;# volume of gas, [m^3]\n", + "print ' (a) The volume of the gas is (m^3) = ',round(V,1)\n", + "\n", + "# (b)\n", + "#(1)\n", + "Mav = (O2*mO2+N2*mN2)/(O2+N2);# average moleculer mass of air\n", + "print ' (b)(1) The average moleculer mass of air is (g/mol) = ',Mav\n", + "\n", + "# (2)\n", + "Rav = R/Mav;# characteristic gas constant, [kJ/kg k]\n", + "print ' (2) The value of R is (kJ/kg K) = ',round(Rav,3)\n", + "\n", + "# (3)\n", + "rho = Mav/V;# density of air, [kg/m^3]\n", + "print ' (3) The mass of one cubic metre of air at STP is (kg/m^3) = ',round(rho,3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17: pg 223" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.17\n", + " (a)The partial pressure of O2 is (kN/m^2) = 104.0 ,\n", + " The partial pressure of N2 is (kN/m^2) = 104.0 \n", + " The partial pressure of CO2 is (kN/m^2) = 208.0\n", + " (b) The volume of the container is (m^3) = 6.655\n", + " (c) The new total pressure in the vessel is (kN/m^2) = 626.0\n" + ] + } + ], + "source": [ + "#pg 223\n", + "print('Example 8.17');\n", + "\n", + "# aim : To determine\n", + "# (a) the partial pressure of each gas in the vessel\n", + "# (b) the volume of the vessel\n", + "# (c) the total pressure in the gas when temperature is raised to228 C\n", + "\n", + "# given values\n", + "MO2 = 8.;# mass of O2, [kg]\n", + "MN2 = 7.;# mass of N2, [kg]\n", + "MCO2 = 22.;# mass of CO2, [kg]\n", + "\n", + "P = 416.;# total pressure in the vessel, [kN/m^2]\n", + "T = 273.+60;# vessel temperature, [K]\n", + "R = 8.3143;# gas constant, [kJ/kmol K]\n", + "\n", + "mO2 = 32.;# molculer mass of O2 \n", + "mN2 = 28.;# molculer mass of N2\n", + "mCO2 = 44.;# molculer mass of CO2\n", + "\n", + "# solution\n", + "# (a)\n", + "n1 = MO2/mO2;# moles of O2, [kmol]\n", + "n2 = MN2/mN2;# moles of N2, [kmol]\n", + "n3 = MCO2/mCO2;# moles of CO2, [kmol]\n", + "\n", + "n = n1+n2+n3;# total moles in the vessel, [kmol]\n", + "# since,Partial pressure is proportinal, so\n", + "P1 = n1*P/n;# partial pressure of O2, [kN/m^2]\n", + "P2 = n2*P/n;# partial pressure of N2, [kN/m^2]\n", + "P3 = n3*P/n;# partial pressure of CO2, [kN/m^2]\n", + "\n", + "print ' (a)The partial pressure of O2 is (kN/m^2) = ',P1,',\\n The partial pressure of N2 is (kN/m^2) = ',P2,'\\n The partial pressure of CO2 is (kN/m^2) = ',P3\n", + "\n", + "# (b)\n", + "# assuming ideal gas \n", + "V = n*R*T/P;# volume of the container, [m^3]\n", + "print ' (b) The volume of the container is (m^3) = ',round(V,3)\n", + "\n", + "# (c)\n", + "T2 = 273.+228;# raised vessel temperature, [K]\n", + "# so volume of vessel will constant , P/T=constant\n", + "P2 = P*T2/T;# new pressure in the vessel , [kn/m62]\n", + "print ' (c) The new total pressure in the vessel is (kN/m^2) = ',round(P2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18: pg 225" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.18\n", + " The actual mass of air supplied is (kg/kg coal) = 13.64\n", + " The velocity of flue gas is (m/s) = 3.99\n" + ] + } + ], + "source": [ + "#pg 225\n", + "print('Example 8.18');\n", + "\n", + "# aim : To determine\n", + "# the actual mass of air supplied/kg coal\n", + "# the velocity of flue gas\n", + "\n", + "# given values\n", + "mc = 635;# mass of coal burn/h, [kg]\n", + "ea = .25;# excess air required\n", + "C = .84;# mass composition of carbon\n", + "H2 = .04;# mass composition of hydrogen\n", + "O2 = .05;# mass composition of oxygen\n", + "ash = 1-(C+H2+O2);# mass composition of ash\n", + "\n", + "P1 = 101.3;# pressure, [kJn/m^2]\n", + "T1 = 273;# temperature, [K]\n", + "V1 = 22.4;# volume, [m^3]\n", + "\n", + "T2 = 273.+344;# gas temperature, [K]\n", + "P2 = 100.;# gas pressure, [kN/m^2]\n", + "A = 1.1;# cross section area, [m^2]\n", + "aO2 = .23;# composition of O2 in air\n", + "\n", + "mCO2 = 44.;# moleculer mass of carbon\n", + "mH2O = 18.;# molecular mass of hydrogen\n", + "mO2 = 32.;# moleculer mas of oxygen\n", + "mN2 = 28.;# moleculer mass of nitrogen\n", + "\n", + "# solution\n", + "mtO2 = 8./3*C+8*H2-O2;# theoretical O2 required/kg coal, [kg]\n", + "msa= mtO2/aO2;# stoichiometric mass of air supplied/kg coal, [kg]\n", + "mas = msa*(1+ea);# actual mass of air supplied/kg coal, [kg]\n", + "\n", + "m1 = 11./3*C;# mass of CO2/kg coal produced, [kg]\n", + "m2 = 9*H2;# mass of H2/kg coal produced, [kg]\n", + "m3 = mtO2*ea;# mass of O2/kg coal produced, [kg]\n", + "m4 = mas*(1-aO2);# mass of N2/kg coal produced, [kg]\n", + "\n", + "mt = m1+m2+m3+m4;# total mass, [kg]\n", + "x1 = m1/mt*100;# %age mass composition of CO2 produced\n", + "x2 = m2/mt*100;# %age mass composition of H2O produced\n", + "x3 = m3/mt*100;# %age mass composition of O2 produced\n", + "x4 = m4/mt*100;# %age mass composition of N2 produced\n", + "\n", + "vt = x1/mCO2+x2/mH2O+x3/mO2+x4/mN2;# total volume\n", + "v1 = x1/mCO2/vt*100;# %age volume composition of CO2\n", + "v2 = x2/mH2O/vt*100;# %age volume composition of H2O\n", + "v3 = x3/mO2/vt*100;# %age volume composition of O2\n", + "v4 = x4/mN2/vt*100;# %age volume composition of N2\n", + "\n", + "Mav = (v1*mCO2+v2*mH2O+v3*mO2+v4*mN2)/(v1+v2+v3+v4);# average moleculer mass, [kg/kmol]\n", + "# since no of moles is constant so PV/T=constant\n", + "V2 = P1*V1*T2/(P2*T1);#volume, [m^3]\n", + "\n", + "mp = mt*mc/3600.;# mass of product of combustion/s, [kg]\n", + "\n", + "V = V2*mp/Mav;# volume of flowing gas /s,[m^3]\n", + "\n", + "v = V/A;# velocity of flue gas, [m/s]\n", + "print ' The actual mass of air supplied is (kg/kg coal) = ',round(mas,2)\n", + "print ' The velocity of flue gas is (m/s) = ',round(v,2)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19: pg 227" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.19\n", + " (a) The temperature of the gas after compression is (C) = 354.1\n", + " (b) The density of air-gas mixture is (kg/m^3) = 1.133\n" + ] + } + ], + "source": [ + "#pg 227\n", + "print('Example 8.19');\n", + "\n", + "# aim : To determine\n", + "# (a) the temperature of the gas after compression\n", + "# (b) the density of the air-gas mixture\n", + "\n", + "# given values\n", + "CO = 26.;# %age volume composition of CO \n", + "H2 = 16.;# %age volume composition of H2\n", + "CH4 = 7.;# %age volume composition of CH4 \n", + "N2 = 51.;# %age volume composition of N2\n", + "\n", + "P1 = 103.;# gas pressure, [kN/m^2]\n", + "T1 = 273.+21;# gas temperature, [K]\n", + "rv = 7.;# volume ratio\n", + "\n", + "aO2 = 21.;# %age volume composition of O2 in the air\n", + "c = 21.;# specific heat capacity of diatomic gas, [kJ/kg K]\n", + "cCH4 = 36.;# specific heat capacity of CH4, [kJ/kg K]\n", + "R = 8.3143;# gas constant, [kJ/kg K]\n", + "\n", + "mCO = 28.;# moleculer mass of carbon\n", + "mH2 = 2.;# molecular mass of hydrogen\n", + "mCH4 = 16.;# moleculer mas of methane\n", + "mN2 = 28.;# moleculer mass of nitrogen\n", + "mO2 = 32.;# moleculer mass of oxygen\n", + "\n", + "# solution\n", + "# (a)\n", + "Cav = (CO*c+H2*c+CH4*cCH4+N2*c+100*2*c)/(100.+200);# heat capacity, [kJ/kg K]\n", + "\n", + "Gama = (Cav+R)/Cav;# heat capacity ratio\n", + "# rv = V1/V2\n", + "# process is polytropic, so\n", + "T2 = T1*(rv)**(Gama-1);# final tempearture, [K]\n", + "print ' (a) The temperature of the gas after compression is (C) = ',round(T2-273.15,1)\n", + "\n", + "# (b)\n", + "\n", + "Mav = (CO*mCO+H2*mH2+CH4*mCH4+N2*mN2+42*mO2+158*mN2)/(100.+200)\n", + "\n", + "# for 1 kmol of gas\n", + "V = R*T1/P1;# volume of one kmol of gas, [m^3]\n", + "# hence\n", + "rho = Mav/V;# density of gas, [kg/m^3]\n", + "\n", + "print ' (b) The density of air-gas mixture is (kg/m^3) = ',round(rho,3)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20: pg 228" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.20\n", + "The required stoichiometric equation is = \n", + "2 H2+ O2+3.76 N2 = 2 H2O+3.76 N2\n" + ] + } + ], + "source": [ + "#pg 228\n", + "print('Example 8.20');\n", + "\n", + "# aim : to determine \n", + "# stoichiometric equation for combustion of hydrogen\n", + "\n", + "# solution\n", + "# equation with algebric coefficient is\n", + "# H2+aO2+79/21*aN2=bH2O+79/21*aN2\n", + "# by equating coefficients\n", + "b = 1;\n", + "a = b/2.;\n", + "# so equation becomes\n", + "# 2 H2+ O2+3.76 N2=2 H2O+3.76 N2\n", + "#results\n", + "print('The required stoichiometric equation is = ');\n", + "print('2 H2+ O2+3.76 N2 = 2 H2O+3.76 N2');\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22: pg 229" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.22\n", + " Percentage gravimetric composition of CO2 = 12.65 \n", + " ,\n", + " Percentage gravimetric composition of H2O = 11.7 \n", + "\n", + " Percentage gravimetric composition of O2 = 2.77 \n", + "\n", + " Percentage gravimetric composition of N2 = 72.89\n" + ] + } + ], + "source": [ + "#pg 229\n", + "print('Example 8.22');\n", + "\n", + "# aim : To determine\n", + "# the percentage gravimetric analysis of the total products of combustion\n", + "\n", + "# given values\n", + "CO = 12.;# %age volume composition of CO\n", + "H2 = 41.;# %age volume composition of H2\n", + "CH4 = 27.;# %age volume composition of CH4\n", + "O2 = 2.;# %age volume composition of O2\n", + "CO2 = 3.;# %age volume composition of CO2\n", + "N2 = 15.;# %age volume composition of N2\n", + "\n", + "mCO2 = 44.;# moleculer mass of CO2,[kg/kmol]\n", + "mH2O = 18.;# moleculer mass of H2O, [kg/kmol]\n", + "mO2 = 32.;# moleculer mass of O2, [kg/kmol]\n", + "mN2 = 28.;# moleculer mass of N2, [kg/kmol]\n", + " \n", + "ea = 15.;# %age excess air required\n", + "aO2 = 21.;# %age air composition in the air\n", + "\n", + "# solution\n", + "# combustion equation by no. of moles\n", + "# 12CO + 41H2 + 27CH4 + 2O2 + 3CO2 + 15N2 + aO2+79/21*aN2 = bCO2 + dH2O + eO2 + 15N2 +79/21*aN2\n", + "# equating C coefficient\n", + "b = 12.+27+3;# [mol]\n", + "# equatimg H2 coefficient\n", + "d = 41.+2*27;# [mol]\n", + "# O2 required is 15 % extra,so\n", + "# e/(e-a)=.15 so e=.13a\n", + "# equating O2 coefficient\n", + "# 2+3+a=b+d/2 +e\n", + "\n", + "a = (b+d/2.-5)/(1-.13);\n", + "e = .13*a;# [mol]\n", + "\n", + "# gravimetric analysis of product\n", + "v1 = b*mCO2;# gravimetric volume of CO2 \n", + "v2 = d*mH2O ;# gravimetric volume of H2O \n", + "v3 = e*mO2;# gravimetric volume of O2\n", + "v4 = 15*mN2 +79./21*a*mN2;# gravimetric volume of N2 \n", + "\n", + "vt = v1+v2+v3+v4;# total\n", + "x1 = v1/vt*100;# percentage gravimetric of CO2\n", + "x2 = v2/vt*100;# percentage gravimetric of H2O\n", + "x3 = v3/vt*100;# percentage gravimetric of O2\n", + "x4 = v4/vt*100;# percentage gravimetric of N2\n", + "#results\n", + "print ' Percentage gravimetric composition of CO2 = ',round(x1,2),' \\n ,\\n Percentage gravimetric composition of H2O = ',round(x2,2),' \\n\\n Percentage gravimetric composition of O2 = ',round(x3,2),' \\n\\n Percentage gravimetric composition of N2 = ',round(x4,2)\n", + "\n", + "# End \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23: pg 231" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.23\n", + " (a) The mass of actual air supplied per kg of fuel is (kg) = 31.2\n", + " (b) The volumetric efficiency of the engine is (percent) = 89.9\n" + ] + } + ], + "source": [ + "#pg 231\n", + "print('Example 8.23');\n", + "import math\n", + "# aim : To determine\n", + "# (a) the actual quantity of air supplied/kg of fuel\n", + "# (b) the volumetric efficiency of the engine\n", + "\n", + "# given values\n", + "d = 300.*10**-3;# bore,[m]\n", + "L = 460.*10**-3;# stroke,[m]\n", + "N = 200.;# engine speed, [rev/min]\n", + "\n", + "C = 87.;# %age mass composition of Carbon in the fuel\n", + "H2 = 13.;# %age mass composition of H2 in the fuel\n", + "\n", + "mc = 6.75;# fuel consumption, [kg/h]\n", + "\n", + "CO2 = 7.;# %age composition of CO2 by volume\n", + "O2 = 10.5;# %age composition of O2 by volume\n", + "N2 = 7.;# %age composition of N2 by volume\n", + "\n", + "mC = 12.;# moleculer mass of CO2,[kg/kmol]\n", + "mH2 = 2.;# moleculer mass of H2, [kg/kmol]\n", + "mO2 = 32.;# moleculer mass of O2, [kg/kmol]\n", + "mN2 = 28.;# moleculer mass of N2, [kg/kmol]\n", + "\n", + "T = 273.+17;# atmospheric temperature, [K]\n", + "P = 100;# atmospheric pressure, [kn/m**2]\n", + "R =.287;# gas constant, [kJ/kg k]\n", + "\n", + "# solution\n", + "# (a)\n", + "# combustion equation by no. of moles\n", + "# 87/12 C + 13/2 H2 + a O2+79/21*a N2 = b CO2 + d H2O + eO2 + f N2\n", + "# equating coefficient\n", + "b = 87./12;# [mol]\n", + "a = 22.7;# [mol]\n", + "e = 10.875;# [mol]\n", + "f = 11.8*b;# [mol]\n", + "# so fuel side combustion equation is\n", + "# 87/12 C + 13/2 H2 +22.7 O2 +85.5 N2\n", + "mair = ( 22.7*mO2 +85.5*mN2)/100;# mass of air/kg fuel, [kg]\n", + "print ' (a) The mass of actual air supplied per kg of fuel is (kg) = ',round(mair,2)\n", + "\n", + "# (b)\n", + "m = mair*mc/60;# mass of air/min, [kg]\n", + "V = m*R*T/P;# volumetric flow of air/min, [m**3]\n", + "SV = math.pi/4*d**2*L*N/2;# swept volume/min, [m**3]\n", + "\n", + "VE = V/SV;# volumetric efficiency\n", + "print ' (b) The volumetric efficiency of the engine is (percent) = ',round(VE*100,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 24: pg 232" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 8.24\n", + " The mass of air supplied per kg of fuel is (kg) = 21.07\n" + ] + } + ], + "source": [ + "#pg 232\n", + "print('Example 8.24');\n", + "\n", + "# aim : To determine\n", + "# the mass of air supplied/kg of fuel burnt\n", + "\n", + "# given values\n", + "# gas composition in the fuel\n", + "C = 84.;# %age mass composition of Carbon in the fuel\n", + "H2 = 14.;# %age mass composition of H2 in the fuel\n", + "O2f = 2.;# %age mass composition of O2 in the fuel\n", + "\n", + "# exhaust gas composition\n", + "CO2 = 8.85;# %age composition of CO2 by volume\n", + "CO = 1.2# %age composition of CO by volume\n", + "O2 = 6.8;# %age composition of O2 by volume\n", + "N2 = 83.15;# %age composition of N2 by volume\n", + "\n", + "mC = 12.;# moleculer mass of CO2,[kg/kmol]\n", + "mH2 = 2.;# moleculer mass of H2, [kg/kmol]\n", + "mO2 = 32.;# moleculer mass of O2, [kg/kmol]\n", + "mN2 = 28.;# moleculer mass of N2, [kg/kmol]\n", + "\n", + "# solution\n", + "# combustion equation by no. of moles\n", + "# 84/12 C + 14/2 H2 +2/32 O2 + a O2+79.3/20.7*a N2 = b CO2 + d CO2+ eO2 + f N2 +g H2\n", + "# equating coefficient and given condition\n", + "b = 6.16;# [mol]\n", + "a = 15.14;# [mol]\n", + "d = .836;# [mol]\n", + "f = 69.3*d;# [mol]\n", + "# so fuel side combustion equation is\n", + "# 84/12 C + 14/2 H2 +2/32 O2 + 15.14 O2 +85.5 N2\n", + "mair = ( a*mO2 +f*mN2)/100;# mass of air/kg fuel, [kg]\n", + "#results\n", + "print ' The mass of air supplied per kg of fuel is (kg) = ',round(mair,2)\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter9.ipynb b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter9.ipynb new file mode 100644 index 00000000..339b7e2c --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter9.ipynb @@ -0,0 +1,456 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9 - Heat Transfer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1: pg 256" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 9.1\n", + " The heat lost per hour is (kJ) = 10815.0\n", + " The interface temperature is (C) = 8.2\n" + ] + } + ], + "source": [ + "#pg 256\n", + "print('Example 9.1');\n", + "\n", + "# aim : To determine \n", + "# the heat loss per hour through the wall and interface temperature\n", + "\n", + "# Given values\n", + "x1 = .25;# thickness of brick,[m]\n", + "x2 = .05;# thickness of concrete,[m]\n", + "t1 = 30.;# brick face temperature,[C]\n", + "t3 = 5.;# concrete face temperature,[C]\n", + "l = 10.;# length of the wall, [m]\n", + "h = 5.;# height of the wall, [m]\n", + "k1 = .69;# thermal conductivity of brick,[W/m/K]\n", + "k2 = .93;# thermal conductivity of concrete,[W/m/K]\n", + "\n", + "# solution\n", + "A = l*h;# area of heat transfer,[m**2]\n", + "Q_dot = A*(t1-t3)/(x1/k1+x2/k2);# heat transferred, [J/s]\n", + "\n", + "# so heat loss per hour is\n", + "Q = Q_dot*3600*10**-3;# [kJ]\n", + "print ' The heat lost per hour is (kJ) = ',round(Q)\n", + "\n", + "# interface temperature calculation\n", + "# for the brick wall, Q_dot=k1*A*(t1-t2)/x1;\n", + "# hence\n", + "t2 = t1-Q_dot*x1/k1/A;# [C]\n", + "print ' The interface temperature is (C) = ',round(t2,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2: pg 258" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 9.2\n", + " The minimum thickness of the lagging required is (mm) = 38.8\n" + ] + } + ], + "source": [ + "#pg 258\n", + "print('Example 9.2');\n", + "\n", + "# aim : To determine\n", + "# the minimum \n", + "# thickness of the lagging required\n", + "import math\n", + "# Given values\n", + "r1 = 75./2;# external radious of the pipe,[mm]\n", + "L = 80.;# length of the pipe,[m]\n", + "m_dot = 1000.;# flow of steam, [kg/h]\n", + "P = 2.;# pressure, [MN/m**2]\n", + "x1 = .98;# inlet dryness fraction\n", + "x2 = .96;# outlet dryness fraction\n", + "k = .08;# thermal conductivity of of pipe, [W/m/K]\n", + "t2 = 27.;# outside temperature,[C]\n", + "\n", + "# solution\n", + "# using steam table at 2 MN/m**2 the enthalpy of evaporation of steam is,\n", + "hfg = 1888.6;# [kJ/kg]\n", + "# so heat loss through the pipe is\n", + "Q_dot = m_dot*(x1-x2)*hfg/3600;# [kJ]\n", + "\n", + "# also from steam table saturation temperature of steam at 2 MN/m**2 is,\n", + "t1 = 212.4;# [C]\n", + "# and for thick pipe, Q_dot=k*2*%pi*L*(t1-t2)/log(r2/r1)\n", + "# hence\n", + "r2 = r1*math.exp(k*2*math.pi*L*(t1-t2)*10**-3/Q_dot);# [mm]\n", + "\n", + "t = r2-r1;# thickness, [mm]\n", + "#results\n", + "print ' The minimum thickness of the lagging required is (mm) = ',round(t,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3: pg 260" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 9.3\n", + " (a) The heat lost per hour is (kJ) = 8770.0\n", + " (b) The interface temperature of the lagging is (C) = 71.5\n", + "There is some rounding off error in the book, so answer is not matching\n" + ] + } + ], + "source": [ + "#pg 260\n", + "print('Example 9.3');\n", + "\n", + "# aim : To determine the\n", + "# (a) heat loss per hour\n", + "# (b) interface temperature og lagging\n", + "import math\n", + "# Given values\n", + "r1 = 50.; # radious of steam main,[mm]\n", + "r2 = 90.;# radious with first lagging,[mm]\n", + "r3 = 115.;# outside radious os steam main with lagging,[mm]\n", + "k1 = .07;# thermal conductivity of 1st lagging,[W/m/K]\n", + "k2 = .1;# thermal conductivity of 2nd lagging, [W/m/K]\n", + "P = 1.7;# steam pressure,[MN/m^2]\n", + "t_superheat = 30.;# superheat of steam, [K]\n", + "t3 = 24.;# outside temperature of the lagging,[C]\n", + "L = 20.;# length of the steam main,[m]\n", + "\n", + "# solution\n", + "# (a)\n", + "# using steam table saturation temperature of steam at 1.7 MN/m^2 is\n", + "t_sat = 204.3;# [C]\n", + "# hence\n", + "t1 = t_sat+t_superheat;# temperature of steam,[C]\n", + "\n", + "Q_dot = 2*math.pi*L*(t1-t3)/(math.log(r2/r1)/k1+math.log(r3/r2)/k2);# heat loss,[W]\n", + "# heat loss in hour is\n", + "Q = Q_dot*3600*10**-3;# [kJ]\n", + "\n", + "print ' (a) The heat lost per hour is (kJ) = ',round(Q)\n", + "\n", + "# (b)\n", + "# using Q_dot=2*%pi*k1*(t1-t1)/log(r2/r1) \n", + "t2 = t1-Q_dot*math.log(r2/r1)/(2*math.pi*k1*L);# interface temperature of lagging,[C]\n", + "\n", + "print ' (b) The interface temperature of the lagging is (C) = ',round(t2,1)\n", + "\n", + "print 'There is some rounding off error in the book, so answer is not matching'\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: pg 265" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 9.4\n", + " The energy emitted from the surface is (kW) = 355.7\n" + ] + } + ], + "source": [ + "#pg 265\n", + "print('Example 9.4');\n", + "\n", + "# aim : To determine \n", + "# the energy emetted from the surface\n", + "\n", + "# Given values\n", + "h = 3.;# height of surface, [m]\n", + "b = 4.;# width of surface, [m]\n", + "epsilon_s = .9;# emissivity of the surface\n", + "T = 273.+600;# surface temperature ,[K]\n", + "sigma = 5.67*10**-8;# [W/m^2/K^4]\n", + "\n", + "# solution\n", + "As = h*b;# area of the surface, [m^2]\n", + "\n", + "Q_dot = epsilon_s*sigma*As*T**4*10**-3;# energy emitted, [kW]\n", + "#results\n", + "print ' The energy emitted from the surface is (kW) = ',round(Q_dot,1)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5: pg 265" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 9.5\n", + " The transfer of energy will be from furnace to sphere and transfer rate is (kW) = 703.0\n", + " There is some calculation mistake in the book, so answer is not matching\n" + ] + } + ], + "source": [ + "#pg 265\n", + "print('Example 9.5');\n", + "\n", + "# aim : To determine \n", + "# the rate of energy transfer between furnace and the sphere and its direction\n", + "import math\n", + "# Given values\n", + "l = 1.25;# internal side of cubical furnace, [m]\n", + "ti = 800.+273;# internal surface temperature of the furnace,[K]\n", + "r = .2;# sphere radious, [m]\n", + "epsilon = .6;# emissivity of sphere\n", + "ts = 300.+273;# surface temperature of sphere, [K]\n", + "sigma = 5.67*10**-8;# [W/m**2/K**4]\n", + "\n", + "# Solution\n", + "Af = 6*l**2;# internal surface area of furnace, [m**2]\n", + "As =4 *math.pi*r**2;# surface area of sphere, [m**2]\n", + "\n", + "# considering internal furnace to be black\n", + "Qf = sigma*Af*ti**4*10**-3;# [kW]\n", + "\n", + "# radiation emitted by sphere is\n", + "Qs = epsilon*sigma*As*ts**4*10**-3; # [kW]\n", + "\n", + "# Hence transfer of energy is\n", + "Q = Qf-Qs;# [kW]\n", + "#results\n", + "print ' The transfer of energy will be from furnace to sphere and transfer rate is (kW) = ',round(Q)\n", + "print' There is some calculation mistake in the book, so answer is not matching'\n", + "\n", + "# End\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6: pg 271" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 9.6\n", + " The overall heat transfer coefficient for the wall is (W/m**2 K) = 0.313\n", + " The heat loss per hour through the wall is (kJ) = 1148.0\n" + ] + } + ], + "source": [ + "#pg 271\n", + "print('Example 9.6');\n", + "\n", + "# aim : To determine\n", + "# the overall transfer coefficient and the heat loss per hour\n", + "\n", + "# Given values\n", + "x1 = 25*10**-3;# Thickness of insulating board, [m]\n", + "x2 = 75*10**-3;# Thickness of fibreglass, [m]\n", + "x3 = 110*10**-3;# Thickness of brickwork, [m]\n", + "k1 = .06;# Thermal conductivity of insulating board, [W/m K]\n", + "k2 = .04;# Thermal conductivity of fibreglass, [W/m K]\n", + "k3 = .6;# Thermal conductivity of brickwork, [W/m K]\n", + "Us1 = 2.5;# surface heat transfer coefficient of the inside wall,[W/m**2 K]\n", + "Us2 = 3.1;# surface heat transfer coefficient of the outside wall,[W/m**2 K]\n", + "ta1 = 27.;# internal ambient temperature, [C]\n", + "ta2 = 10.;# external ambient temperature, [C]\n", + "h = 6.;# height of the wall, [m]\n", + "l = 10.;# length of the wall, [m]\n", + "\n", + "# solution\n", + "U = 1/(1/Us1+x1/k1+x2/k2+x3/k3+1/Us2);# overall heta transfer coefficient,[W/m**2 K]\n", + "\n", + "A = l*h;# area ,[m**2]\n", + "\n", + "Q_dot = U*A*(ta1-ta2);# heat loss [W]\n", + "\n", + "# so heat loss per hour is\n", + "Q = Q_dot*3600*10**-3;# [kJ]\n", + "#results\n", + "print ' The overall heat transfer coefficient for the wall is (W/m**2 K) = ',round(U,3)\n", + "print ' The heat loss per hour through the wall is (kJ) = ',round(Q)\n", + "\n", + "# End\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7: pg 272" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Example 9.7\n", + " The heat loss per hour is (kJ) = 24533.0\n", + " The surface temperature of the lagging is (C) = 46.99\n", + "there is minor variation in the answer due to rounding off error in textbook\n" + ] + } + ], + "source": [ + "#pg 272\n", + "print('Example 9.7');\n", + "\n", + "# aim : To determine \n", + "# the heat loss per hour and the surface temperature of the lagging\n", + "import math\n", + "# Given values\n", + "r1 = 75.*10**-3;# External radiou of the pipe, [m]\n", + "t_l1 = 40.*10**-3;# Thickness of lagging1, [m]\n", + "t_l2 = t_l1;\n", + "k1 = .07;# thermal conductivity of lagging1, [W/m K]\n", + "k2 = .1;# thermal conductivity of lagging2, [W/m K]\n", + "Us = 7;# surface transfer coefficient for outer surface, [W/m**2 K]\n", + "L = 50.;# length of the pipe, [m]\n", + "ta = 27.;# ambient temperature, [C]\n", + "P = 3.6;# wet steam pressure, [MN/m**2]\n", + "\n", + "# solution\n", + "# from steam table saturation temperature of the steam at given pressure is,\n", + "t1 = 244.2;# [C]\n", + "r2 = r1+t_l1;# radious of pipe with lagging1,[m]\n", + "r3 = r2+t_l2;# radious of pipe with both the lagging, [m]\n", + "\n", + "R1 = math.log(r2/r1)/(2*math.pi*L*k1);# resistance due to lagging1,[C/W]\n", + "R2 = math.log(r3/r2)/(2*math.pi*L*k2);# resistance due to lagging2,[C/W]\n", + "R3 = 1/(Us*2*math.pi*r3*L);# ambient resistance, [C/W]\n", + "\n", + "# hence overall resistance is,\n", + "Req = R1+R2+R3;# [C/W]\n", + "tdf = t1-ta;# temperature driving force, [C]\n", + "Q_dot = tdf/Req;# rate of heat loss, [W]\n", + "# so heat loss per hour is,\n", + "Q = Q_dot*3600*10**-3;# heat loss per hour, [kJ]\n", + "\n", + "# using eqn [3]\n", + "t3 = ta+Q_dot*R3;# surface temperature of the lagging, [C]\n", + "#results\n", + "print ' The heat loss per hour is (kJ) = ',round(Q,0)\n", + "print ' The surface temperature of the lagging is (C) = ',round(t3,2)\n", + "\n", + "print 'there is minor variation in the answer due to rounding off error in textbook'\n", + "\n", + "# End\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap11.png b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap11.png Binary files differnew file mode 100644 index 00000000..e584539e --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap11.png diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap14.png b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap14.png Binary files differnew file mode 100644 index 00000000..9d016862 --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap14.png diff --git a/Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap7.png b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap7.png Binary files differnew file mode 100644 index 00000000..1e0d466a --- /dev/null +++ b/Basic_Engineering_Thermodynamics_by_Rayner_Joel/screenshots/chap7.png diff --git a/Principles_Of_Electric_Machines_And_Power_Electronics_by_P._C._Sen/README.txt b/Principles_Of_Electric_Machines_And_Power_Electronics_by_P._C._Sen/README.txt new file mode 100644 index 00000000..a6c9ca76 --- /dev/null +++ b/Principles_Of_Electric_Machines_And_Power_Electronics_by_P._C._Sen/README.txt @@ -0,0 +1,10 @@ +Contributed By: Meena Chandrupatla +Course: others +College/Institute/Organization: Vijaya Bank +Department/Designation: Accounts +Book Title: Principles Of Electric Machines And Power Electronics +Author: P. C. Sen +Publisher: John Wiley And Sons, Australia +Year of publication: 1989 +Isbn: 978-1-118-80434-6 +Edition: 3
\ No newline at end of file diff --git a/sample_notebooks/PrashantSahu/Chapter-2-Molecular_Diffusion_-_Principles_of_Mass_Transfer_and_Separation_Process_by_Binay_K_Dutta_1.ipynb b/sample_notebooks/PrashantSahu/Chapter-2-Molecular_Diffusion_-_Principles_of_Mass_Transfer_and_Separation_Process_by_Binay_K_Dutta_1.ipynb new file mode 100644 index 00000000..958c7769 --- /dev/null +++ b/sample_notebooks/PrashantSahu/Chapter-2-Molecular_Diffusion_-_Principles_of_Mass_Transfer_and_Separation_Process_by_Binay_K_Dutta_1.ipynb @@ -0,0 +1,789 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Chapter 2 Molecular Diffusion"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.1 pgno:10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Molar average velocity of gas mixture is: 0.0303 m/s\n",
+ "Mass average velocity of gas mixture is: 0.029 m/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculation of average velocities\n",
+ "\n",
+ "N2 = 0.05 #mole fraction of Nitrogen denoted as 1\n",
+ "H2 = 0.15 #mole fraction of Hydrogen denoted as 2\n",
+ "NH3 = 0.76 #mole fraction of Ammonia denoted as 3\n",
+ "Ar = 0.04 #mole fraction of Argon denoted as 4\n",
+ "u1 = 0.03\n",
+ "u2 = 0.035\n",
+ "u3 = 0.03\n",
+ "u4 = 0.02\n",
+ "#Calculating molar average velocity\n",
+ "U = N2*u1 + H2*u2 + NH3*u3 + Ar*u4\n",
+ "print 'Molar average velocity of gas mixture is: %.4f m/s'%U\n",
+ "#Calculating of mass average velocity\n",
+ "M1 = 28\n",
+ "M2 = 2\n",
+ "M3 = 17\n",
+ "M4 = 40\n",
+ "M = N2*M1 + H2*M2 + NH3*M3 + Ar*M4\n",
+ "u = (1/M)*(N2*M1*u1 + H2*M2*u2 + NH3*M3*u3 + Ar*M4*u4)\n",
+ "print 'Mass average velocity of gas mixture is: %.3f m/s'%u"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ " ##Example 2.2 pgno:16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a) Time for complete evaporation is: 15.93 hours\n",
+ "(b) Time for disappearance of water is: 8.87 hours\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Diffusion of A through non-diffusing B\n",
+ "\n",
+ "from math import log\n",
+ "from math import exp\n",
+ "import numpy as np\n",
+ "\n",
+ "#Calcualtion for (a) part\n",
+ "#calculating vapor pressure of water at 301K\n",
+ "pv = exp(13.8573 - (5160.2/301)) #in bar\n",
+ "#wet-bulb temperature is 22.5 degree centigrade\n",
+ "#calculating mean air-film temperature\n",
+ "Tm = ((28+22.5)/2)+273 #in kelvin\n",
+ "#calculating diffusion coefficient\n",
+ "Dab = ((0.853*(30.48**2))*((298.2/273)**1.75))/(3600*10000) #in m^2/s\n",
+ "l = 2.5e-3 #in m\n",
+ "P = 1.013 #in bar\n",
+ "R = 0.08317 #Gas constant\n",
+ "pAo = exp(13.8573 - (5160.2/295.2)) #vapor pressure of water at the wet-bulb temperature, 22.2C\n",
+ "pAl = 0.6*round(pv,4)\n",
+ "Na = (((round(Dab,7)*P)/(R*298.2*l))*log((P-pAl)/(P-round(pAo,3))))*18 #in kg/m^2s\n",
+ "#amount of water per m^2 of floor area is\n",
+ "thickness = 2e-3\n",
+ "Amount = thickness*1 #in m^3 \n",
+ "#density of water is 1000kg/m^3\n",
+ "#therefore in kg it is\n",
+ "amount = Amount*1000\n",
+ "Time_for_completion = amount/Na #in seconds\n",
+ "Time_for_completion_hours = Time_for_completion/3600\n",
+ "print '(a) Time for complete evaporation is: %.2f'%Time_for_completion_hours,'hours'\n",
+ "\n",
+ "#Calculation for (b) part\n",
+ "water_loss = 0.1 #in kg/m^2.h\n",
+ "water_loss_by_evaporation = Na*3600\n",
+ "total_water_loss = water_loss + water_loss_by_evaporation\n",
+ "time_for_disappearance = amount/total_water_loss\n",
+ "print '(b) Time for disappearance of water is: %0.2f'%time_for_disappearance,'hours'\n",
+ "#Answers may vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.3 pgno:17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a) The molar flux of Ammonia is:1.922E-05 gmol/cm^2.s\n",
+ "(b) and (c)\n",
+ "Velocity of A is 0.522 cm/s\n",
+ "Velocity of B is 0.000 cm/s\n",
+ "Mass average velocity of A is 0.439 cm/s\n",
+ "Molar average velocity of A is 0.47 cm/s\n",
+ "(d) Molar flux of NH3 is 3.062E-06 gmol/cm^2.s\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "<matplotlib.text.Text at 0xa3d70f0>"
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEPCAYAAABGP2P1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmUVOW19/HvthsURAXFSyIiGERABKeADIolojYoojGK\nOI8hGjRZud4Q9I329Zogid6oITGoiENENIqIE8SpNBBEJhFlCKAog68ag4g4gb3vH08B3W0P1d11\n6lRV/z5rndV1qp4+tT3SteuZzd0RERHZZqe4AxARkdyixCAiIhUoMYi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J3Xe0t0/MbOJwM7u\nfraZnQL8hbCR0hLCfuaXuPui1LXfBrq7++YY/tNE0qKmJJFvux14wd2fAvYpt8bOAOCRbefu/km5\n33ky9fNN4P+7+1sevnW9RdhpbJsPqLjSpUjOyZlF9ERyQWpv4HbufkUVLzvV7/XwdepnGfBVuefL\nqPh3ZhTmHiJSQFRjEEkxsyMI/Qfldz5bb2Z7ph6/CJyx7dzMWtXjbdpQxd4aIrlENQaRHX5CWMr8\npdRS5vOAmYRO5BnuvsTMfg28bGbfAAsIu+dBxVpA5RqBA5jZdwh7D6t/QXKaOp9FamBmCWCYu1+e\ngWv9CNjV3X/f4MBEIqSmJJEauHuSsFtYJiamDSNsxSqS01RjEBGRClRjEBGRCpQYRESkAiUGERGp\nQIlBREQqUGIQEZEKlBhERKSC/wMlMWMmKfP/ywAAAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xa257828>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#Calculation of flux and velocity\n",
+ "\n",
+ "%matplotlib inline\n",
+ "from math import log\n",
+ "from math import exp\n",
+ "import numpy as np\n",
+ "from matplotlib import pyplot as plt\n",
+ "#calculation for (a) part\n",
+ "l = 1 #thickness of air in cm\n",
+ "pAo = 0.9 #in atm\n",
+ "pAl = 0.1 #in atm\n",
+ "Dab = 0.214 #in cm^2/s\n",
+ "T = 298 #in K\n",
+ "P = 1 #in atm\n",
+ "R = 82.1 #in (cm^3)(atm)/(K)(gmol)\n",
+ "#calculating molar flux of ammonia\n",
+ "Na = ((Dab*P)/(R*T*l))*log((P-pAl)/(P-pAo))\n",
+ "print '(a) The molar flux of Ammonia is:%0.3E'%Na,'gmol/cm^2.s'\n",
+ "\n",
+ "#calculation for (b) and (c) part\n",
+ "Nb = 0 #air is non-diffusing\n",
+ "U = (Na/(P/(R*T))) #molar average velocity\n",
+ "yA = pAo/P\n",
+ "yB = pAl/P\n",
+ "uA = U/yA #\n",
+ "uB = 0 #since Nb=0\n",
+ "Ma = 17\n",
+ "Mb = 29\n",
+ "M = Ma*yA + Mb*yB\n",
+ "u = uA*yA*Ma/M #since u =(uA*phoA + uB*phoB)/pho\n",
+ "print '(b) and (c)'\n",
+ "print 'Velocity of A is %0.3f'%uA,'cm/s'\n",
+ "print 'Velocity of B is %0.3f'%uB,'cm/s'\n",
+ "print 'Mass average velocity of A is %0.3f'%u,'cm/s'\n",
+ "print 'Molar average velocity of A is %0.2f'%U,'cm/s'\n",
+ "\n",
+ "#calculation for (d) part\n",
+ "Ca = pAo/(R*T)\n",
+ "Ia = Ca*(uA - u) #molar flux of NH3 relative to an observer moving\n",
+ " #with the mass average velocity \n",
+ "print '(d) Molar flux of NH3 is %0.3E'%Ia,'gmol/cm^2.s'\n",
+ "\n",
+ "z = []\n",
+ "pa =[]\n",
+ "for i in np.arange(0,1,0.01):\n",
+ " z.append(i)\n",
+ " \n",
+ "for i in range(0,len(z)):\n",
+ " pa.append(1-(0.1*exp(2.197*z[i])))\n",
+ " \n",
+ "from matplotlib.pyplot import*\n",
+ "plot(z,pa);\n",
+ "plt.xlabel('z(cm)');\n",
+ "plt.ylabel('pA(atm)');\n",
+ "#Answers may vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 2.4 pgno:19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a) Rate of diffusion of oxygen 7.151E-10 kmol/s\n",
+ "(b) The partial pressure gradient of oxygen at midway in diffusion path is: -4.25 bar/m\n",
+ "(c)\n",
+ "Molar average velocity and diffusion velocities at \"midway\"\n",
+ "Molar average velocity in z-direction is 9.9E-05 m/s\n",
+ "The diffusion velocity of oxygen 7.9E-04 m/s\n",
+ "The diffusion velocity of Nitrogen -9.9E-05 m/s\n",
+ "Molar average velocity and diffusion velocities at \"top of tube\"\n",
+ "Molar average velocity in z-direction is 9.9E-05 m/s\n",
+ "The diffusion velocity of oxygen 3.72E-04 m/s\n",
+ "The diffusion velocity of Nitrogen -9.9E-05 m/s\n",
+ "Molar average velocity and diffusion velocities at \"bottom of tube\"\n",
+ "Molar average velocity in z-direction is 9.9E-05 m/s\n",
+ "The diffusion velocity of oxygen is not infinity\n",
+ "The diffusion velocity of Nitrogen -9.9E-05 m/s\n",
+ "(d)\n",
+ "New molar flux of (A) 4.95E-06 kmol/m^2.s\n",
+ "New molar flux of (B) 7.19E-06 kmol/m^2.s\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEKCAYAAAAMzhLIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHi1JREFUeJzt3XmUVNW59/HvI42CSDOIoAwCMqioiAM44NACKuLAvbnX\nqNFwxVl81USjETXCfZfG+Y3xGl1elWgS0TglKlEQ0HKIIoiKIoKgIIOKEyJBhIZ+3j92td1gd3V1\nd506p6p/n7X2qlOnTp/zcBZdT++9z97b3B0REZHabBV3ACIikmxKFCIikpEShYiIZKREISIiGSlR\niIhIRkoUIiKSUUncATSEmemZXhGRBnB3q+/PFGyNwt1V3Bk3blzsMSSl6F7oXuheZC4NVbCJQkRE\n8kOJQkREMlKiKHBlZWVxh5AYuhdVdC+q6F40njWm3SouZuaFGLeISJzMDG9KndkiIpIfShQiIpKR\nEoWIiGSkRCEiIhkpUYiISEZKFCIikpEShYiIZKREISIiGSlRiIhIRkoUIiKSkRKFiIhkpEQhIiIZ\nJTJRmNlwM5tvZgvN7NdxxyMi0pQlbvZYM2sGLACGASuAWcAp7v5+tWM0e6yISD0V0+yxg4BF7r7E\n3cuBh4GRWx70/fdQUZH32EREmpySuAOoQRdgWbX3y4EDtjyoTRvYsAFKSmCbbULZeuvw2qJF1b4W\nLeouLVtWvdZUtt02lOrb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6cPcUYSW1XAyUO4mw\ndK1IoqlGISIiGalGISIiGSlRiIhIRkoUIiKSkRKFiIhkpEQhIiIZKVGIiEhG/x/dtbi5bQDtAwAA\nAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xa506f60>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#Flux, velocity and pressure gradient\n",
+ "\n",
+ "#calculation of (a) part\n",
+ "#given data\n",
+ "from math import log\n",
+ "from math import pi\n",
+ "from math import exp\n",
+ "import numpy as np\n",
+ "from matplotlib import pyplot as plt\n",
+ "T = 298 #in kelvin\n",
+ "P = 1.013 #in bar\n",
+ "pAl = 0 #partial pressure of oxygen(A) at liquid surface\n",
+ "pAo = 0.21*1.013 #partial pressure of oxygen at open mouth\n",
+ "l = 0.05 #length of diffusion path in m\n",
+ "Dab = 2.1e-5 #diffusivity in m^2/s\n",
+ "R = 0.08317 #in m^3.bar.kmol.K\n",
+ "Na = Dab*P*log((P-pAl)/(P-pAo))/(R*T*l) #in kmol/m^2.s\n",
+ "area = (pi/4)*(0.015)**2\n",
+ "rate = area*Na\n",
+ "print '(a) Rate of diffusion of oxygen %0.3E'%rate,'kmol/s'\n",
+ "z = []\n",
+ "pa =[]\n",
+ "for i in np.arange(0,1,0.01):\n",
+ " z.append(i)\n",
+ " \n",
+ "for i in range(0,len(z)):\n",
+ " pa.append(P-(P-pAo)*exp((R*T*Na*z[i])/(Dab*P)))\n",
+ " \n",
+ "from matplotlib.pyplot import*\n",
+ "plot(z,pa);\n",
+ "plt.xlabel('z(cm)');\n",
+ "plt.ylabel('pA(atm)');\n",
+ "\n",
+ "#calculation of (b) part\n",
+ "z = 0.025 #diffusion path\n",
+ "pA = 0.113 #in bar\n",
+ "#we have to find partial pressure gradient of oxygen at mid way of diffusion path\n",
+ "#let dpA/dz = ppd\n",
+ "ppd = -(R*T*round(Na,8)*(P-pA))/(Dab*P)\n",
+ "print '(b) The partial pressure gradient of oxygen at midway in diffusion path is: %0.2f'%ppd,'bar/m'\n",
+ "\n",
+ "#calculation of (c) part\n",
+ "uA = Na*(R*T/pA) #velocity of oxygen\n",
+ "uB = 0 #since nitrogen is non-diffusing hence Nb = 0\n",
+ "U = pA*uA/P #since U=1/C*(uA*Ca + uB*Cb)\n",
+ "vAd = uA - U #diffusion velocity of oxygen\n",
+ "vBd = uB - U #diffusion velocity of nitrogen\n",
+ "print '(c)'\n",
+ "print 'Molar average velocity and diffusion velocities at \"midway\"'\n",
+ "print 'Molar average velocity in z-direction is %0.1E'%U,'m/s'\n",
+ "print 'The diffusion velocity of oxygen %0.1E'%vAd,'m/s'\n",
+ "print 'The diffusion velocity of Nitrogen %0.1E'%vBd,'m/s'\n",
+ "#at z=0(at top of tube)\n",
+ "uA = Na*(R*T/pAo)\n",
+ "uB = 0\n",
+ "U = pAo*uA/P\n",
+ "vAd = uA - U\n",
+ "vBd = uB - U\n",
+ "print 'Molar average velocity and diffusion velocities at \"top of tube\"'\n",
+ "print 'Molar average velocity in z-direction is %0.1E'%U,'m/s'\n",
+ "print 'The diffusion velocity of oxygen %0.2E'%vAd,'m/s'\n",
+ "print 'The diffusion velocity of Nitrogen %0.1E'%vBd,'m/s'\n",
+ "#at z=0.05(at bottom of tube)\n",
+ "#uA = inf\n",
+ "uB = 0\n",
+ "U = pAo*uA/P\n",
+ "vAd = uA - U\n",
+ "vBd = uB - U\n",
+ "print 'Molar average velocity and diffusion velocities at \"bottom of tube\"'\n",
+ "print 'Molar average velocity in z-direction is %0.1E'%U,'m/s'\n",
+ "print 'The diffusion velocity of oxygen is not infinity'\n",
+ "print 'The diffusion velocity of Nitrogen %0.1E'%vBd,'m/s'\n",
+ "\n",
+ "#calculation of (d) part\n",
+ "V = -2*U\n",
+ "pA = 0.113\n",
+ "Nad = round(Na,8) - V*(pA/(R*T))\n",
+ "Nbd = 0 - (P - pA)*V/(R*T)\n",
+ "print '(d)'\n",
+ "print 'New molar flux of (A) %0.2E'%Nad,'kmol/m^2.s'\n",
+ "print 'New molar flux of (B) %0.2E'%Nbd,'kmol/m^2.s'\n",
+ "#Answers may vary due to round off errors"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.5 pgno:21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a) The air-film thickness is :0.00193 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Diffusion with changing bulk concentration\n",
+ "\n",
+ "from math import log\n",
+ "#given data\n",
+ "area = 3*4 #in m^2\n",
+ "mperarea = 3.0/12 #in kg/m^2\n",
+ "#part (a)\n",
+ "P = 1.013 #in bar\n",
+ "Dab = 9.95e-6 #in m^2/s\n",
+ "R = 0.08317 #in m^3.bar./K.kmol\n",
+ "T = 273+27 #in K\n",
+ "#let d=1\n",
+ "d = 1 #in m\n",
+ "pAo = 0.065 #partial pressure of alcohol on liquid surface\n",
+ "pAd = 0 #partial pressure over d length of stagnant film of air\n",
+ "Na = (Dab*P*log((P-pAd)/(P-pAo)))/(R*T*d) #in kmol/m^2.s\n",
+ "Na = Na*60 #in kg/m^2.s\n",
+ "flux = mperarea/(5*60) #since the liquid evaporates completely in 5 minutes\n",
+ "#now we have to find the value of d\n",
+ "d = Na/flux\n",
+ "print '(a) The air-film thickness is :%0.5f'%d,'m'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.6 pgno:24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)\n",
+ "The steady-state flux is: 3.35E-06 kmol/m^2.s\n",
+ "The rate of transport of N2 from vessel 1 to 2: 6.6E-09 kmol/s\n",
+ "(b)\n",
+ "The flux and the rate of transport of oxygen is: -3.35E-06 kmol/m^2.s\n",
+ "(c)\n",
+ "Partial pressure at a point 0.05m from vessel 1 is: 1.2 atm\n",
+ "(d)\n",
+ "Net or total mass flux: -1.340E-05 kmol/m^2.s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Equimolar counterdiffusion\n",
+ "\n",
+ "from math import pi\n",
+ "#given data\n",
+ "#part (a)\n",
+ "Dab = 0.23e-4*0.5*(293.0/316)**1.75 #in m^2/s\n",
+ "pA1 = 2*0.8 #in atm\n",
+ "pA2 = 2*0.2 #in atm\n",
+ "l = 0.15 #in m\n",
+ "R = 0.0821 #in m^3.atm./K.kmol\n",
+ "T = 293 #in K\n",
+ "Ma = 28\n",
+ "Mb = 32\n",
+ "Na = Dab*(pA1-pA2)/(R*T*l) #in kmol/m^2.s\n",
+ "area = pi/4*(0.05)**2 #in m^2\n",
+ "rate = area*Na\n",
+ "print '(a)'\n",
+ "print 'The steady-state flux is: %0.2E'%Na,'kmol/m^2.s'\n",
+ "print 'The rate of transport of N2 from vessel 1 to 2: %0.1E'%rate,'kmol/s'\n",
+ "\n",
+ "#part (b)\n",
+ "Nb = -Na\n",
+ "print '(b)'\n",
+ "print 'The flux and the rate of transport of oxygen is: %0.2E'%Nb,'kmol/m^2.s'\n",
+ "\n",
+ "#part (c)\n",
+ "#let dpA/dz = ppg\n",
+ "dz = 0.05 #in m\n",
+ "ppg = (pA2 - pA1)/l #in atm/m\n",
+ "pA = pA1 + (ppg)*dz #in atm\n",
+ "print '(c)'\n",
+ "print 'Partial pressure at a point 0.05m from vessel 1 is: %0.1f'%pA,'atm'\n",
+ "\n",
+ "#part (d)\n",
+ "nt = Ma*Na + Mb*Nb\n",
+ "print '(d)'\n",
+ "print 'Net or total mass flux: %0.3E'%nt,'kmol/m^2.s'\n",
+ "#Answers may vary due to round off errors"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.7 pgno:25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Methanol flux: 4.64e-05 kmol/m^2.s\n",
+ "Water flux: -4.06e-05 kmol/m^2.s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Non-equimolar counterdiffusion in distillation of a binary mixture\n",
+ "\n",
+ "from math import log\n",
+ "#given data\n",
+ "Ha = 274.6*32 #molar latent heat of methanol(a)\n",
+ "Hb = 557.7*18 #molar latent heat of water(b)\n",
+ "yAl = 0.76 #mole fraction of methanol in the vapour\n",
+ "yAo = 0.825 #mole fraction of methanol in the vapour at the liquid-vapour interface\n",
+ "P = 1 #in atm\n",
+ "l = 1e-3 #in m\n",
+ "T =344.2 #in K\n",
+ "R = 0.0821 #m^3.atm./K.kmol\n",
+ "Dab = 1.816e-5 #in m^2/s\n",
+ "Na = Dab*P*log((1-0.1247*yAl)/(1-0.1247*yAo))/(0.1247*R*T*l)\n",
+ "print 'Methanol flux: %0.2e'%Na,'kmol/m^2.s'\n",
+ "Nb = -(Ha/Hb)*Na\n",
+ "print 'Water flux: %0.2e'%Nb,'kmol/m^2.s'\n",
+ "#Answers may vary due to round off errors"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.8 pgno:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Value of pA1 is 0.937 atm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Equimolar counterdiffusion in an interconnected system\n",
+ "\n",
+ "#given values\n",
+ "from math import exp\n",
+ "V1 = 3000 #in cm^3\n",
+ "V2 = 4000 #in cm^3\n",
+ "Dab = 0.23 #in cm^2/s\n",
+ "Dba = 0.23 #in cm^2/s\n",
+ "l1 = 4 #in cm\n",
+ "d1 = 0.5 #in cm\n",
+ "l2 = 2 #in cm\n",
+ "d2 = 0.3 #in cm\n",
+ "pA3 = 1 #in atm\n",
+ "#unknowns\n",
+ "# pA1 and pA2\n",
+ "# dpA1bydt = (Dab/V1*l1)*((pA1)-(pA2))*((math.pi*(d1**2))/4)\n",
+ "#on integrating using Laplace trandformation\n",
+ "# initial conditions\n",
+ "t=18000 #in seconds\n",
+ "pA1 = 1-0.57*(exp((-1.005)*(10**(-6))*t)-exp((-7.615)*(10**(-6))*t))\n",
+ "print 'Value of pA1 is %0.3f'%pA1,'atm'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 2.10 pgno:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Value of flux of water vapour: 2.96E-05 kmol/m^2.s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Diffusion of only one component in a three-component mixture\n",
+ "\n",
+ "#given values\n",
+ "from math import log\n",
+ "y1l = 0 #mol fraction of dry air\n",
+ "y10 = (17.53/760) #mol fraction of water\n",
+ "l = 1.5 #in mm\n",
+ "C = 0.0409 #in kmol/m^3 : calculated by P/RT\n",
+ "D12 = 0.923 #Diffusivity of hydrogen over water\n",
+ "D13 = 0.267 #Diffusivity of oxygen over water\n",
+ "y2 = 0.6 #mole fraction of hydrogen\n",
+ "y3 = 0.4 #mole fraction of oxygen\n",
+ "D1m = 1/((y2/D12)+(y3/D13)) #calculating mean diffusivity\n",
+ "Ni = (D1m*C*1000/(l*10000))*log((1-y1l)/(1-y10))\n",
+ "print 'Value of flux of water vapour: %0.2E'%Ni,'kmol/m^2.s'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.11 pgno:35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Flux of ethane 4.804E-05 gmol/cm^2.s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Multicomponent diffusion\n",
+ "\n",
+ "from math import log\n",
+ "#given data\n",
+ "y1 = 0.4 #mole fraction of ethane(1)\n",
+ "y2 = 0.3 #mole fraction of ethylene(2)\n",
+ "y3 = 0.3 #mole fraction of hydrogen(3)\n",
+ "#calculating D13\n",
+ "#The Lennard-Jones parameters are\n",
+ "sigma1 = 4.443 #in angstrom\n",
+ "sigma2 = 4.163 #in angstrom\n",
+ "sigma3 = 2.827 #in angstrom\n",
+ "e1byk = 215.7\n",
+ "e2byk = 224.7\n",
+ "e3byk = 59.7\n",
+ "sigma13 = (sigma1 + sigma3)/2 #in angstrom\n",
+ "e13byk = (e1byk*e3byk)**0.5\n",
+ "kTbye13 = 993/113.5\n",
+ "ohmD13 = 0.76 #from collision integral table\n",
+ "D13 = ((0.001858)*(993**1.5)*((1.0/30)+(1.0/2))**0.5)/((2)*(sigma13**2)*(ohmD13))\n",
+ "#calculating D23\n",
+ "sigma23 = (sigma2+sigma3)/2\n",
+ "kTbye23 = ((993/224.7)*(993/59.7))*0.5\n",
+ "ohmD23 = 0.762\n",
+ "D23 = (0.001858*(993**1.5)*((1.0/28)+(1.0/2))**0.5)/(2*(sigma23**2)*ohmD23)\n",
+ "D = (D13+D23)/2 #in cm^2/s\n",
+ "l = 0.15 #in cm\n",
+ "#at z=0 (bulk gas)\n",
+ "y10 = 0.6\n",
+ "y20 = 0.2\n",
+ "y30 = 0.2\n",
+ "#at z=l (catalyst surface)\n",
+ "y1l = 0.4\n",
+ "y2l = 0.3\n",
+ "y3l = 0.3\n",
+ "C = 2.0/(82.1*993) #calculated by P/RT\n",
+ "N1 = (D*C/l)*log((y10+y20)/(y1l+y2l))\n",
+ "print 'Flux of ethane %0.3E'%N1,'gmol/cm^2.s'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.12 pgno:43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The liquid-film thickness is: 0.0004 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Liquid-phase diffusion\n",
+ "\n",
+ "#given data\n",
+ "from math import pi\n",
+ "rc = 5e-4 #in m\n",
+ "D = 7e-10 #in m^2/s\n",
+ "Cab = 1 #in kmol/m^3\n",
+ "Na = 3.15e-6 #in kmol/m^2.s\n",
+ "W = 4*pi*(rc**2)*Na #the rate of reaction\n",
+ "#let (rc+delta)/delta = 1\n",
+ "w1 = 4*pi*D*Cab*rc*1 #flux of the reactant to the surface of the catalyst\n",
+ "rcplusdelta = W/w1\n",
+ "delta = rc/(rcplusdelta-1) #stagnant liquid-film thickness \n",
+ "print 'The liquid-film thickness is: ',delta,'m'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.13 pgno:46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Tortuosity factor is: 2.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Diffusivity determination--diaphragm cell\n",
+ "\n",
+ "#given data\n",
+ "from math import log\n",
+ "from math import pi\n",
+ "V1 = 60.2 #in cm^3; volume of compartment 1\n",
+ "V2 = 59.3 #volume of compartment 2 in cm^3\n",
+ "Ca1i = 0.3 #initial concentration of KCl in compartment 1\n",
+ "Ca2i = 0 #initial concentration of KCl in compartment 2\n",
+ "Ca1f = 0.215 #final concentration of KCl in compartment 1\n",
+ "Ca2f = 0.0863 #final concentration of KCl in compartment 2\n",
+ "D = 1.51e-5 #diffusivity of KCl in cm^2/s\n",
+ "tf = 55.2*3600 #time of the experiment in s\n",
+ "#calcutaling cell constant\n",
+ "beta = (1/(D*tf))*log((Ca1i - Ca2i)/(Ca1f - Ca2f))\n",
+ "#diffusion of propionic acid\n",
+ "Cpa1i = 0.4 #initial concentration of propionic acid in compartment 1\n",
+ "Cpa2i = 0 #initial concentration of propionic acid in compartment 2\n",
+ "Cpa1f = 0.32 #final concentration of propionic acid in compartment 1\n",
+ "Cpa2f = 0.0812 #final concentration of propionic acid in compartment 2 by mass balance\n",
+ "tfp = 56.4*3600 #time for the experiment\n",
+ "Dp = (1/(beta*tfp))*log((Cpa1i-Cpa2i)/(Cpa1f-Cpa2f)) #diffusivity of the propionic acid\n",
+ "#calculating tortusity factor\n",
+ "A= (pi/4)*(3.5**2) #area of the diaphragm\n",
+ "epsilon = 0.39 #average porosity of the diaphragm\n",
+ "l = 0.18 #thickness of hte diaphragm\n",
+ "tou = (A*epsilon/(beta*l))*(1/V1 + 1/V2)\n",
+ "print 'Tortuosity factor is: ',round(tou,1)"
+ ]
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/S PRASHANTHS PRASHANTH/Chapter_1_5.ipynb b/sample_notebooks/S PRASHANTHS PRASHANTH/Chapter_1_5.ipynb new file mode 100644 index 00000000..035b59eb --- /dev/null +++ b/sample_notebooks/S PRASHANTHS PRASHANTH/Chapter_1_5.ipynb @@ -0,0 +1,607 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: Circuit Configuration for Linear Integrated Ciruits"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 Page No:1.81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "adm= -1482.0\n",
+ "acm= -1.0\n",
+ "cmrr= 76.4838188131 db\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "rc=50000;#ohm\n",
+ "re=100000;#ohm\n",
+ "rs=10000;#ohm\n",
+ "rp=50000;#ohm\n",
+ "beta0=2000;\n",
+ "r0=400000;#ohm\n",
+ "\n",
+ "\n",
+ "\n",
+ "#determine adm,acm,cmrr\n",
+ "#calculation\n",
+ "rc1=(rc*r0)/(rc+r0);\n",
+ "adm=(-(beta0*rc1)/(rs+rp))#differential mode gain\n",
+ "acm=(-(beta0*rc1)/(rs+rp+2*re*(beta0+1)))#common mode gain\n",
+ "import math\n",
+ "cmrr=20*(math.log10((1+((2*re*(beta0+1))/(rs+rp)))))#common mode rejection ratio\n",
+ "\n",
+ "#result\n",
+ "print 'adm=',round(adm,3);\n",
+ "print 'acm=',round(acm,3);\n",
+ "print 'cmrr=',cmrr,'db'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 Page No:1.83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "maximum peak amplitude at 100khz 3.185 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=0.000001;#volt/sec\n",
+ "freq=100000;\n",
+ "vsat=12;\n",
+ "baw=100000;\n",
+ "#determine vx\n",
+ "\n",
+ "#calculation\n",
+ "vx=2*(1/(sr*2*3.14*freq))\n",
+ "\n",
+ "#result\n",
+ "print 'maximum peak amplitude at 100khz',round(vx,3),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 Page No: 1.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "slew rate= 5 volt/μsec\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "V=20;\n",
+ "t=4;\n",
+ "#determine slew rate\n",
+ "#calculation\n",
+ "w=V/t\n",
+ "#result\n",
+ "print'slew rate=',w,'volt/μsec'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 Page No: 1.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "max frequency of input is 79617.8343949 hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "a=50;\n",
+ "vi=20e-3;\n",
+ "sr=0.5e6;\n",
+ "#determine max frequency\n",
+ "#calculation\n",
+ "vm=a*vi;\n",
+ "freq=sr/(2*3.14*vm)\n",
+ "#result\n",
+ "print 'max frequency of input is ',freq,'hz'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 Page No: 1.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "max peak to peak input signal 0.398089171975 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=0.5e6;\n",
+ "freq=40e3;\n",
+ "a=10;\n",
+ "#determine max peak to peak input signal\n",
+ "#calculation\n",
+ "vm=sr/(2*3.14*freq);\n",
+ "vm=2*vm;\n",
+ "v1=vm/a\n",
+ "#result\n",
+ "print'max peak to peak input signal ',v1,'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "## Example 6 Page No: 1.85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "noise 0.0063247 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "adm=400;\n",
+ "cmrr=50;\n",
+ "vin1=50e-3;\n",
+ "vin2=60e-3;\n",
+ "vnoise=5e-3;\n",
+ "#calculation\n",
+ "v0=(vin2-vin1)*adm;\n",
+ "acm=adm/316.22;\n",
+ "v1=vnoise*acm\n",
+ "print'noise ',round(v1,7),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "time to change from 0 t0 15 4e-07 sec\n",
+ "slew rate 1.5 volt/μsec\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=35e6;#volt/sec\n",
+ "vsat=15;#volt\n",
+ "#determine time to change from 0 to 15V\n",
+ "#calculation\n",
+ "c=100e-12;#farad\n",
+ "i=150e-6;#A\n",
+ "w=vsat/sr\n",
+ "w1=i/c;\n",
+ "#result\n",
+ "print'time to change from 0 t0 15 ',round(w,7),'sec'\n",
+ "print'slew rate',w1/1000000,'volt/μsec'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "bandwidth 21231.4225053 hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=2e6;#v/sec\n",
+ "vsat=15;#volt\n",
+ "#determine bandwidth \n",
+ "#calculation\n",
+ "\n",
+ "bw=sr/(2*3.14*vsat)\n",
+ "#result\n",
+ "print'bandwidth ',bw,'hz'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 Page No: 1.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output offset 3.0 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "iin=30e-9;#A\n",
+ "a=1e5;\n",
+ "rin=1000;#ohm\n",
+ "#determine output offset voltage\n",
+ "#calculation\n",
+ "vid=iin*rin;\n",
+ "v0=a*vid\n",
+ "#result\n",
+ "print'output offset ',v0,'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input offset current 4e-06 A\n",
+ "input base current 2.4e-05 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "inb1=22e-6;#A\n",
+ "inb2=26e-6;#A\n",
+ "#determine input offset current input base current\n",
+ "#calculation\n",
+ "i1=inb2-inb1\n",
+ "i2=(inb2+inb1)/2\n",
+ "#result\n",
+ "print'input offset current ',i1,'A'\n",
+ "print'input base current ',i2,'A'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 11 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input base current 8e-08 A\n",
+ "input offset current 2e-08 A\n",
+ "input offset 2.0 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "inb2=90e-9;#A\n",
+ "inb1=70e-9;#A\n",
+ "a=1e5;\n",
+ "#determine input offset current\n",
+ "#calculation\n",
+ "i1=(inb2+inb1)/2\n",
+ "i2=inb2-inb1\n",
+ "v1=((inb2-inb1)*1000)*a\n",
+ "print'input base current ',i1,'A'\n",
+ "print'input offset current ',i2,'A'\n",
+ "print'input offset ',v1,'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 Page No: 1.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage cmrr 100 0.051 V\n",
+ "output voltage cmrr 200 0.051 V\n",
+ "output voltage cmrr 450 0.05 V\n",
+ "output voltage cmrr 105 0.051 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "vin1=150e-6;#volt\n",
+ "vin2=100e-6;#volt\n",
+ "a=1000;\n",
+ "from array import array\n",
+ "cmrr=array('i',[100,200,450,105])\n",
+ "#determine output voltage\n",
+ "#calculation\n",
+ "vc=(vin1+vin2)/2;\n",
+ "vd=(vin1-vin2);\n",
+ "j=0;\n",
+ "while j<=3 :v0=(a*vd*(1+(vc/(cmrr[j]*vd)))) ;print 'output voltage cmrr ',cmrr[j],' ',round(v0,3),'V';j=j+1;\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 Page No: 1.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 0.003 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "rin=100e3;#ohm\n",
+ "rf1=900e3;#ohm\n",
+ "vc=1;#volt\n",
+ "cmrr=70;\n",
+ "#determine the output voltage\n",
+ "#calculation\n",
+ "v0=(1+(rf1/rin))*vc/3160\n",
+ "print 'output voltage ',round(v0,3),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 Page No: 1.89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input voltage 0.08 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=0.5e6;#volt/sec\n",
+ "a=50;\n",
+ "freq=20e3;#hz\n",
+ "#determine max peak to peak voltage\n",
+ "#calculation\n",
+ "v1=sr/(2*3.14*freq*a)\n",
+ "print'input voltage ',round(v1,3),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 Page No: 1.90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "max frequency 26.539 Khz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=50e6;#volt/sec\n",
+ "rin=2;\n",
+ "vimax=10;\n",
+ "#determine max frequency\n",
+ "#calculation\n",
+ "vm=vimax*(1+rin);\n",
+ "freq=sr/(2*3.14*vm)/10e3;\n",
+ "print 'max frequency ',round(freq,3),'Khz'\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
|