diff options
author | Trupti Kini | 2016-06-08 23:30:31 +0600 |
---|---|---|
committer | Trupti Kini | 2016-06-08 23:30:31 +0600 |
commit | 1f060863c0aa12f2de3872d294e55ac71a08a25e (patch) | |
tree | d261c09b9ddc3ae2127b10287a688f8b88fa133e /Introduction_to_flight_by_J_D_Anderson | |
parent | c780204350f8d08ea045ce039f993334e5a229af (diff) | |
download | Python-Textbook-Companions-1f060863c0aa12f2de3872d294e55ac71a08a25e.tar.gz Python-Textbook-Companions-1f060863c0aa12f2de3872d294e55ac71a08a25e.tar.bz2 Python-Textbook-Companions-1f060863c0aa12f2de3872d294e55ac71a08a25e.zip |
Added(A)/Deleted(D) following books
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter1.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter10.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter11.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter2.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter3.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter4.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter5.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter6.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter7.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter8.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/Chapter9.ipynb
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/screenshots/Chapter1.png
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/screenshots/Chapter3.png
A Energy_Management_by_W._R._Murphy_and_G._A._Mckay/screenshots/Chapter9.png
A Introduction_to_flight_by_J_D_Anderson/11._Hypersonic_vehicles.ipynb
A Introduction_to_flight_by_J_D_Anderson/2._Fundamental_Thoughts.ipynb
A Introduction_to_flight_by_J_D_Anderson/3._The_Standard_Atmosphere.ipynb
A Introduction_to_flight_by_J_D_Anderson/4._Aerodynamics.ipynb
A Introduction_to_flight_by_J_D_Anderson/5._Airfoils,_Wings_and_Other_Aerodynamic_shapes.ipynb
A Introduction_to_flight_by_J_D_Anderson/6._Elements_of_Airplane_Performance.ipynb
A Introduction_to_flight_by_J_D_Anderson/7._Principles_of_Stability_and_Control.ipynb
A Introduction_to_flight_by_J_D_Anderson/8._Space_Flight_(Astronautics).ipynb
A Introduction_to_flight_by_J_D_Anderson/9._Propulsion.ipynb
A Introduction_to_flight_by_J_D_Anderson/Appendix_A.ipynb
A Introduction_to_flight_by_J_D_Anderson/Appendix_B.ipynb
A Introduction_to_flight_by_J_D_Anderson/Appendix_C.ipynb
A Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb
A Introduction_to_flight_by_J_D_Anderson/Appendix_E.ipynb
A Introduction_to_flight_by_J_D_Anderson/README.txt
A Introduction_to_flight_by_J_D_Anderson/screenshots/1.png
A Introduction_to_flight_by_J_D_Anderson/screenshots/2.png
A Introduction_to_flight_by_J_D_Anderson/screenshots/3.png
A Modern_Compressible_Flow_with_historical_perspective_by_John_D_Anderson/1._Compressible_Flow-Some_History_and_Introductory_Thoughts.ipynb
A Modern_Compressible_Flow_with_historical_perspective_by_John_D_Anderson/3._One_Dimentional_Flow.ipynb
A Modern_Compressible_Flow_with_historical_perspective_by_John_D_Anderson/4._Oblique_Shock_and_Expansion_Waves.ipynb
A Modern_Compressible_Flow_with_historical_perspective_by_John_D_Anderson/5._Quasi-One-Dimensional_Flow.ipynb
A Modern_Compressible_Flow_with_historical_perspective_by_John_D_Anderson/README.txt
A Modern_Compressible_Flow_with_historical_perspective_by_John_D_Anderson/screenshots/1.png
A Modern_Compressible_Flow_with_historical_perspective_by_John_D_Anderson/screenshots/2.png
A Modern_Compressible_Flow_with_historical_perspective_by_John_D_Anderson/screenshots/3.png
Diffstat (limited to 'Introduction_to_flight_by_J_D_Anderson')
18 files changed, 5986 insertions, 0 deletions
diff --git a/Introduction_to_flight_by_J_D_Anderson/11._Hypersonic_vehicles.ipynb b/Introduction_to_flight_by_J_D_Anderson/11._Hypersonic_vehicles.ipynb new file mode 100644 index 00000000..7e82bf05 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/11._Hypersonic_vehicles.ipynb @@ -0,0 +1,510 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11: Hypersonic vehicles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Percentage efficiency: 30.3 %\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 11.1\n", + "'''Determine the efficiency of a Rankine cycle using steam as the working fluid in which the\n", + "condenser pressure is 10 kPa. The boiler pressure is 2 MPa. The steam leaves the boiler\n", + "as saturated vapor.\n", + "In solving Rankine-cycle problems, we let w p denote the work into the pump per\n", + "kilogram of fluid flowing and q L denote the heat rejected from the working fluid per\n", + "kilogram of fluid flowing.\n", + "To solve this problem we consider, in succession, a control surface around the pump,\n", + "the boiler, the turbine, and the condenser. For each, the thermodynamic model is the steam\n", + "tables, and the process is steady state with negligible changes in kinetic and potential\n", + "energies. First, consider the pump:\n", + "Control volume:\n", + "Inlet state:\n", + "Exit state:\n", + "Pump.\n", + "P 1 known, saturated liquid; state fixed.\n", + "P 2 known.'''\n", + "\n", + "#Variable Declaration: \n", + "P2 = 2000\t\t\t#Exit pressure in kPa\n", + "P1 = 10\t\t\t\t#Inlet pressure in kPa\n", + "v = 0.00101\t\t\t#specific weight of water in m**3/kg\n", + "h1 = 191.8\t\t\t#Enthalpy in kJ/kg from table\n", + "h3 = 2799.5\t\t\t#Enthalpy in kJ/kg\n", + "s4 = 6.3409\t\t\t#kJ/kg\n", + "sf = 0.6493\t\t\t#Entropy at liquid state in kJ/kg\n", + "sfg = 7.5009\t\t#Entropy difference for vapor and liquid state in kJ/kg\n", + "hfg = 2392.8\t\t#Enthalpy difference in kJ/kg for turbine\n", + "\n", + "#Calculations:\n", + "wp = v*(P2-P1)\t\t#work done in pipe in kJ/kg\n", + "h2 = h1+wp\t\t\t#enthalpy in kJ/kg\n", + "x4 = (s4-sf)/sfg\t#x-factor\n", + "h4 = h1+x4*hfg\t\t#Enthalpy in kJ/kg\n", + "nth = ((h3-h2)-(h4-h1))/(h3-h2)\n", + "\n", + "#Results:\n", + "print 'Percentage efficiency: ',round(nth*100,1),\"%\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.2" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Percentage efficiency: 35.3 %\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 11.2\n", + "''' In a Rankine cycle, steam leaves the boiler and enters the turbine at 4 MPa and 400\n", + "◦\n", + "C.\n", + "The condenser pressure is 10 kPa. Determine the cycle efficiency.\n", + "To determine the cycle efficiency, we must calculate the turbine work, the pump\n", + "work, and the heat transfer to the steam in the boiler. We do this by considering a control\n", + "surface around each of these components in turn. In each case the thermodynamic model\n", + "is the steam tables, and the process is steady state with negligible changes in kinetic and\n", + "potential energies.\n", + "Control volume:\n", + "Inlet state:\n", + "Exit state:\n", + "Pump.\n", + "P 1 known, saturated liquid; state fixed.\n", + "P 2 known.'''\n", + "\n", + "#Variable Declaration: \n", + "P2 = 4000\t\t\t#Exit pressure in kPa\n", + "P1 = 10\t\t\t\t#Inlet pressure in kPa\n", + "v = 0.00101\t\t\t#specific weight of water in m**3/kg\n", + "h1 = 191.8\t\t\t#Enthalpy in kJ/kg from table\n", + "h3 = 3213.6\t\t\t#Enthalpy in kJ/kg from table\n", + "s4 = 6.7690\t\t\t#Entropy in kJ/kg from table\n", + "sf = 0.6493\t\t\t#Entropy at liquid state in kJ/kg from table\n", + "sfg = 7.5009\t\t#Entropy difference for vapor and liquid state in kJ/kg from table\n", + "hfg = 2392.8\t\t#Enthalpy difference in kJ/kg for turbine\n", + "\n", + "#Calculations:\n", + "wp = v*(P2-P1)\t\t#work done in pipe in kJ/kg\n", + "h2 = h1+wp\t\t\t#Enthalpy in kJ/kg\n", + "x4 = (s4-sf)/sfg\t#x-factor\n", + "h4 = h1+x4*hfg\t\t#Enthalpy in kJ/kg\n", + "nth = ((h3-h2)-(h4-h1))/(h3-h2)\n", + "\n", + "#Results:\n", + "print 'Percentage efficiency: ',round(nth*100,1),'%'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Percentage efficiency: 35.9 %\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 11.3\n", + "''' Consider a reheat cycle utilizing steam. Steam leaves the boiler and enters the turbine at\n", + "4 MPa, 400\n", + "◦\n", + "C. After expansion in the turbine to 400 kPa, the steam is reheated to 400\n", + "◦\n", + "C\n", + "and then expanded in the low-pressure turbine to 10 kPa. Determine the cycle efficiency.\n", + "For each control volume analyzed, the thermodynamic model is the steam tables,\n", + "the process is steady state, and changes in kinetic and potential energies are negligible.\n", + "For the high-pressure turbine,\n", + "Control volume:\n", + "Inlet state:\n", + "Exit state:\n", + "High-pressure turbine.\n", + "P 3 , T 3 known; state fixed.\n", + "P 4 known.'''\n", + "\n", + "#Variable Declaration: \n", + "P2 = 4000\t\t\t#Exit pressure in kPa\n", + "P1 = 10\t\t\t\t#Inlet pressure in kPa\n", + "v = 0.00101\t\t\t#specific weight of water in m**3/kg\n", + "h1 = 191.8\t\t\t#Enthalpy in kJ/kg from table\n", + "h3 = 3213.6\t\t\t#Enthalpy in kJ/kg from table\n", + "s4 = 6.7690\t\t\t#Entropy in kJ/kg from table\n", + "sf1 = 1.7766\t\t#Entropy at liquid state in kJ/kg from table\n", + "sfg1 = 5.1193\t\t#Entropy difference for vapor and liquid state in kJ/kg from table\n", + "hf = 604.7\t\t\t#Enthalpy of liquid state in kJ/kg\n", + "hfg1 = 2133.8\t\t#Enthalpy difference in kJ/kg for turbine\n", + "sf = 0.6493\t\t\t#Entropy in liquid state in kJ/kg for turbine\n", + "h5 = 3273.4\t\t\t#Enthalpy in kJ/kg \n", + "s5 = 7.8985\t\t\t#Entropy in kJ/kg\n", + "sfg = 7.5009\t\t#Entropy diff in kJ/kg \n", + "hfg = 2392.8\t\t#Enthalpy difference for low pressure turbine in kj/kg\n", + "\n", + "#Calculations:\n", + "wp = round(v*(P2-P1))#Work done in pipe in kJ/kg\n", + "h2 = h1+wp\t\t\t#Enthalpy in kJ/kg\n", + "x4 = (s4-sf1)/sfg1\t#x-factor\n", + "h4 = hf+x4*hfg1\t\t#Enthalpy in kJ/kg\n", + "x6 = (s5-sf)/sfg\t#x-factor\n", + "h6 = h1+x6*hfg\t\t#Entropy in kg/kg\n", + "wt = (h3-h4)+(h5-h6)#Work output in kJ/kg\n", + "qh = (h3-h2)+(h5-h4)\n", + "nth = (wt-wp)/qh\n", + "\n", + "#Results:\n", + "print 'Percentage efficiency: ',round(nth*100,1),'%'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Refrigerator Efficiency: 37.5 %\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 11.4\n", + "''' Consider a regenerative cycle using steam as the working fluid. Steam leaves the boiler\n", + "and enters the turbine at 4 MPa, 400\n", + "◦\n", + "C. After expansion to 400 kPa, some of the steam is\n", + "extracted from the turbine to heat the feedwater in an open feedwater heater. The pressure\n", + "in the feedwater heater is 400 kPa, and the water leaving it is saturated liquid at 400 kPa.\n", + "The steam not extracted expands to 10 kPa. Determine the cycle efficiency.\n", + "The line diagram and T–s diagram for this cycle are shown in Fig. 11.12.\n", + "As in previous examples, the model for each control volume is the steam tables, the\n", + "process is steady state, and kinetic and potential energy changes are negligible.\n", + "From Examples 11.2 and 11.3 we have the following properties:\n", + "h 5 = 3213.6 h 6 = 2685.6\n", + "h 7 = 2144.1 h 1 = 191.8\n", + "For the low-pressure pump,\n", + "Control volume:\n", + "Inlet state:\n", + "Exit state:\n", + "Low-pressure pump.\n", + "P 1 known, saturated liquid; state fixed.\n", + "P 2 known.'''\n", + "\n", + "#Variable Declaration: \n", + "h1 = 191.8\t\t\t#kJ/kg\n", + "h5 = 3213.6\t\t\t#kg/kg\n", + "h6 = 2685.7\t\t\t#kJ/kg\n", + "h7 = 2144.1\t\t\t#kJ/kg\n", + "h3 = 604.7\t\t\t#kJ/kg\n", + "P2 = 400\t\t\t#Exit pressure in kPa\n", + "P1 = 10 \t\t\t#Inlet pressure in kPa\n", + "v = 0.00101\t\t\t#Specific weight of water in m**3/kg\n", + "h1 = 191.8\t\t\t#Enthalpy in kJ/kg from table\n", + "P3 = 400\t\t\t#KPa\n", + "P4 = 4000\t\t\t#KPa\n", + "v = 0.001084\t\t#Specific heat for 3-4 process in m**3/kg\n", + "\n", + "#Calculations:\n", + "wp1 = v*(P2-P1)\t\t#work done for low pressure pump in kJ/kg\n", + "h2 = h1+wp1\t\t\t#Enthalpy in kJ/kg\n", + "y = (h3-h2)/(h6-h2)\t#Extraction fraction\n", + "wt = (h5-h6)+(1-y)*(h6-h7)#Turbine work in kJ/kg\n", + "wp2 = v*(P4-P3)\t\t#Work done for high pressure pump\n", + "h4 = h3+wp2\t\t\t#Enthalpy in kJ/kg\n", + "wnet = wt-(1-y)*wp1-wp2\n", + "qh = h5-h4\t\t\t#Heat output in kJ/kg\n", + "nth = wnet/qh\n", + "\n", + "#Results:\n", + "print 'Refrigerator Efficiency: ',round(nth*100,1),'%'\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Cycle Efficiency: 29.2 %\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 11.5\n", + "''' A steam power plant operates on a cycle with pressures and temperatures as designated in\n", + "Fig. 11.17. The efficiency of the turbine is 86%, and the efficiency of the pump is 80%.\n", + "Determine the thermal efficiency of this cycle.'''\n", + "\n", + "#Variable Declaration: \n", + "h5 = 3169.1\t\t\t\t#kJ/kg\n", + "s5 = 6.7235\t\t\t\t#kJ/kg\n", + "sf = 0.6493\t\t\t\t#Entropy for liquid state in kJ/kg\n", + "sfg = 7.5009\t\t\t#Entropy difference in kJ/kg\n", + "hf = 191.8\t\t\t\t#kJ/kg\n", + "hfg = 2392.8\t\t\t#Enthalpy difference in kJ/kg\n", + "nt = 0.86\t\t\t\t#turbine efficiency given\n", + "np = 0.80\t\t\t\t#pump efficiency given\n", + "v = 0.001009\t\t\t#specific heat in m**3/kg\n", + "P2 = 5000\t\t\t\t#kPa\n", + "P1 = 10\t\t\t\t\t#kPa\n", + "h3 = 171.8\t\t#in kJ/kg from table\n", + "h4 = 3213.6\t\t#kJ/kg from table\n", + "\n", + "#Calculations:\n", + "s6s = s5\n", + "x6s = (s6s-sf)/sfg\t\t#x-factor\n", + "h6s = hf+x6s*hfg\t\t#kJ/Kg at state 6s\n", + "wt = nt*(h5-h6s)\n", + "wp = v*(P2-P1)/np\t\t#Work done in pump in kJ/kg\n", + "wnet = wt-wp\t\t\t#net work in kJ/kg\n", + "qh = h4-h3\n", + "nth = wnet/qh\n", + "\n", + "#Results:\n", + "print 'Cycle Efficiency: ',round(nth*100,1),'%'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Refrigeration Capacity: 3.89 KW\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 11.6\n", + "''' Consider an ideal refrigeration cycle that uses R-134a as the working fluid. The temperature\n", + "of the refrigerant in the evaporator is −20\n", + "◦\n", + "C, and in the condenser it is 40\n", + "◦\n", + "C. The refrigerant\n", + "is circulated at the rate of 0.03 kg/s. Determine the COP and the capacity of the plant in\n", + "rate of refrigeration.\n", + "The diagram for this example is shown in Fig. 11.21. For each control volume\n", + "analyzed, the thermodynamic model is as exhibited in the R-134a tables. Each process is\n", + "steady state, with no changes in kinetic or potential energy.\n", + "Control volume:\n", + "Inlet state:\n", + "Exit state:\n", + "Compressor.\n", + "T 1 known, saturated vapor; state fixed.\n", + "P 2 known (saturation pressure at T 3 ). \n", + "'''\n", + "\n", + "#Variable Declaration: \n", + "P2 = 1017\t\t\t#KJ/Kg\n", + "h1 = 386.1 \t\t\t#KJ/Kg\n", + "s1 = 1.7395 \t\t#KJ/Kg\n", + "T2 = 47.7 \t\t\t#°C\n", + "h2 = 428.4 \t\t\t#KJ/Kg\n", + "h3 = 256.5 \t\t\t#KJ/Kg\t\n", + "\n", + "#Calculations:\n", + "s2 = s1\n", + "wc = h2-h1\t\t\t\t#Work done by compressor in KJ/Kg\n", + "h4 = h3\n", + "qL = h1-h4 \t\t\t\t#From Energy equation in KJ/Kg\n", + "B = round(qL/wc)\n", + "RC = qL*B/100\t\t\t#Refrigeration capacity in KW\n", + "\n", + "#Results:\n", + "print 'Refrigeration Capacity: ', round(RC,2), 'KW'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "COP of refrigerator : 1.45\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 11.7\n", + "'''A refrigeration cycle utilizes R-134a as the working fluid. The following are the properties\n", + "\tat various points of the cycle designated in Fig. 11.22:\n", + "\tP 1 = 125 kPa,\n", + "\tP 2 = 1.2 MPa,\n", + "\tP 3 = 1.19 MPa,\n", + "\tP 4 = 1.16 MPa,\n", + "\tP 5 = 1.15 MPa,\n", + "\tP 6 = P 7 = 140 kPa,\n", + "\tP 8 = 130 kPa,\n", + "\tT 1 = −10 ◦C\n", + "\tT 2 = 100◦C\n", + "\tT 3 = 80◦C\n", + "\tT 4 = 45◦C\n", + "\tT 5 = 40◦C\n", + "\tx 6 = x 7\n", + "\tT 8 = −20◦C\n", + "\tThe heat transfer from R-134a during the compression process is 4 kJ/kg. Determine\n", + "\tthe COP of this cycle.\n", + "\tFor each control volume, the R-134a tables are the model. Each process is steady\n", + "\tstate, with no changes in kinetic or potential energy.\n", + "\tAs before, we break the process down into stages, treating the compressor, the\n", + "\tthrottling value and line, and the evaporator in turn.\n", + "\tControl volume:\n", + "\tInlet state:\n", + "\tExit state:\n", + "\tCompressor.\n", + "\tP 1 , T 1 known; state fixed.\n", + "\tP 2 , T 2 known; state fixed.\n", + "'''\n", + "\n", + "#Variable Declaration: \n", + "h1 = 394.9 \t\t\t#KJ/Kg\n", + "h2 = 480.9 \t\t\t#KJ/Kg\n", + "q = -4 \t\t\t\t#KJ/Kg\n", + "h5 = 256.4 \t\t\t#KJ/Kg\t\n", + "h8 = 386.6\t\t\t#KJ/Kg\n", + "\n", + "#Calculations:\n", + "wc = h2-h1-q\t\t#Work done by compressor in KJ/Kg\n", + "h6 = h5\n", + "h7 = h6\n", + "qL = h8-h7\n", + "B = qL/wc\t\t\t#Coefficient of performance\n", + "\n", + "#Results:\n", + "print 'COP of refrigerator : ', round(B,2)" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/2._Fundamental_Thoughts.ipynb b/Introduction_to_flight_by_J_D_Anderson/2._Fundamental_Thoughts.ipynb new file mode 100644 index 00000000..328a5430 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/2._Fundamental_Thoughts.ipynb @@ -0,0 +1,365 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Fundamental Thoughts" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight of person is: 9.75 N\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 2.1\n", + "'''What is the weight of a 1 kg mass at an altitude where the local acceleration of gravity is\n", + "9.75 m/s2?'''\n", + "\n", + "#Variable Declaration: \n", + "m = 1 \t\t#Mass in kg\n", + "g = 9.75 \t\t#Acc.due to gravity in m/s**2\n", + "\n", + "#Calculation:\n", + "F = m*g \t\t#Weight of 1 kg mass in N\n", + "\n", + "#Result\n", + "print \"Weight of person is:\",round(F,2),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Average specific volume is: 0.001325 m**3/kg\n", + "Overall density is: 755.0 kg/m**3\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 2.2\n", + "'''A1m3 container, shown in Fig. 2.9, is filled with 0.12 m3 of granite, 0.15 m3 of sand, and\n", + "0.2 m3 of liquid 25◦C water; the rest of the volume, 0.53 m3, is air with a density of 1.15\n", + "kg/m3. Find the overall (average) specific volume and density.'''\n", + "\n", + "#Variable Declaration: \n", + "Vliq = 0.2 \t\t #volume of liquid in m**3\n", + "dliq = 997 \t\t #density of liquid in kg/m**3\n", + "Vstone = 0.12 \t\t#volume of stone in m**3\n", + "Vsand = 0.15 \t\t#volume of sand in m**3\n", + "Vair = 0.53 \t\t#voume of air in m**3\n", + "dstone = 2750 \t\t#density of stone in kg/m**3\n", + "dsand = 1500 \t\t#density of sand in kg/m**3\n", + "Vtot = 1 \t\t #total volume in m**3\n", + "dair = 1.1 \t\t #density of air in kg/m**3\n", + "\n", + "#Calculation:\n", + "mliq = Vliq*dliq \t\t#mass of liquid in kg\n", + "mstone = Vstone*dstone #volume of stone in m**3\n", + "msand = Vsand*dsand \t#volume of sand in m**3\n", + "mair = Vair*dair \t\t#mass of air\n", + "mtot = mair+msand+mliq+mstone \t\t#total mass in kg\n", + "v = Vtot/mtot \t\t#specific volume in m**3/kg\n", + "d = 1/v \t\t #overall density in kg/m**3\n", + "\n", + "#Results:\n", + "print \"Average specific volume is: \",round(v ,6),\"m**3/kg\"\n", + "print \"Overall density is:\",round(d),\"kg/m**3\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Force that rod can push within the upward direction is: 932.9 N\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 2.3\n", + "'''The hydraulic piston/cylinder system shown in Fig. 2.11 has a cylinder diameter of D =\n", + "0.1 m with a piston and rod mass of 25 kg. The rod has a diameter of 0.01 m with an\n", + "outside atmospheric pressure of 101 kPa. The inside hydraulic fluid pressure is 250 kPa.\n", + "How large a force can the rod push within the upward direction?'''\n", + "from math import pi\n", + "\n", + "#Variable Declaration: \n", + "Dcyl = 0.1 \t\t#Cylinder diameter in m\n", + "Drod = 0.01 \t#Rod diameter in m\n", + "Pcyl = 250000 \t#Inside hydaulic pressure in Pa\n", + "Po = 101000 \t#Outside atmospheric pressure in kPa\n", + "g = 9.81 \t\t#Acc. due to gravity in m/s**2\n", + "mp = 25 \t\t#Mass of (rod+piston) in kg\n", + "\n", + "#Calculation:\n", + "Acyl = pi*Dcyl**2/4 \t\t#Cross sectional area of cylinder in m**2\n", + "Arod = pi*Drod**2/4 \t\t#Cross sectional area of rod in m**2\n", + "F = Pcyl*Acyl-Po*(Acyl-Arod)-mp*g \t#Force that rod can push within the upward direction in N\n", + "\n", + "#Result:\n", + "print \"Force that rod can push within the upward direction is:\",round(F,1),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Atmospheric pressure is: 99.54 KPa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 2.4\n", + "'''A mercury barometer located in a room at 25◦C has a height of 750 mm. What is the\n", + "atmospheric pressure in kPa?'''\n", + "\n", + "#Variable Declaration: \n", + "dm = 13534 \t\t #Density of mercury in kg/m**3\n", + "H = 0.750 \t\t #Height difference between two columns in metres\n", + "g = 9.80665 \t\t #Acc. due to gravity in m/s**2\n", + "\n", + "#Calculation:\n", + "Patm = dm*H*g/1000 \t #Atmospheric pressure in kPa\n", + "\n", + "#Result:\n", + "print \"Atmospheric pressure is:\",round(Patm,2),\"KPa\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Absolute pressure inside vessel is: 1.3 atm\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 2.5\n", + "'''A mercury (Hg) manometer is used to measure the pressure in a vessel as shown in\n", + "Fig. 2.13. The mercury has a density of 13 590 kg/m3, and the height difference between the\n", + "two columns is measured to be 24 cm.We want to determine the pressure inside the vessel.'''\n", + "\n", + "#Variable Declaration: \n", + "dm = 13590 \t\t #Density of mercury in kg/m**3\n", + "H = 0.24 \t\t #Height difference between two columns in metres\n", + "g = 9.80665 \t\t#Acc. due to gravity in m/s**2\n", + "Patm = 13590*0.750*9.80665 #Atmospheric Pressure in Pa\n", + "\n", + "#Calculation:\n", + "dP = dm*H*g \t\t#Pressure difference in Pa\n", + "Pvessel = dP+Patm \t#Absolute Pressure inside vessel in Pa\n", + "\n", + "#Result:\n", + "print \"Absolute pressure inside vessel is:\",round(Pvessel/101325,2),\"atm\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Pressure at the bottom of storage tank if liquid is Gasoline: 156.2 Kpa\n", + "Pressure at the bottom of storage tank if liquid is R-134a: 1089.0 Kpa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 2.6\n", + "'''What is the pressure at the bottom of the 7.5-m-tall storage tank of fluid at 25◦C shown\n", + "in Fig. 2.15? Assume that the fluid is gasoline with atmospheric pressure 101 kPa on the\n", + "top surface. Repeat the question for the liquid refrigerant R-134a when the top surface\n", + "pressure is 1 MPa.'''\n", + "\n", + "#Variable Declaration: \n", + "dg = 750 \t\t#Density of gaasoline in kg/m**3\n", + "dR = 1206 \t\t#Density of R-134a in kg/m**3\n", + "H = 7.5 \t\t#Height of storage tank in metres\n", + "g = 9.807 \t\t#Acc. due to gravity in m/s**2\n", + "Ptop1 = 101 \t#Atmospheric pressure in kPa\n", + "Ptop2 = 1000 \t\t#top surface pressure in kPa\n", + "\n", + "#Calculation:\n", + "dP1 = dg*g*H/1000\t#Pressure difference in kPa\n", + "P1 = dP1+Ptop1\n", + "dP2 = dR*g*H/1000#Pressure difference in kPa\n", + "P2 = dP2+Ptop2\n", + "\n", + "#Result:\n", + "print \"Pressure at the bottom of storage tank if liquid is Gasoline:\",round(P1,1),\"Kpa\"\n", + "print \"Pressure at the bottom of storage tank if liquid is R-134a:\",round(P2),\"Kpa\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.7" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Balancing force on second larger piston is: 122.3513 N\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 2.7\n", + "'''A piston/cylinder with a cross-sectional area of 0.01 m2 is connected with a hydraulic\n", + "line to another piston/cylinder with a cross-sectional area of 0.05 m2. Assume that both\n", + "chambers and the line are filled with hydraulic fluid of density 900 kg/m3 and the larger\n", + "second piston/cylinder is 6mhigher up in elevation. The telescope armand the buckets have\n", + "hydraulic piston/cylinders moving them, as seen in Fig. 2.16.With an outside atmospheric\n", + "pressure of 100 kPa and a net force of 25 kN on the smallest piston, what is the balancing\n", + "force on the second larger piston?'''\n", + "\n", + "#Variable Declaration: \n", + "Po = 100\t\t#Outside atmospheric pressure in kPa\n", + "F1 = 25 \t\t#Net force on the smallest piston in kN\n", + "A1 = 0.01 \t\t#Cross sectional area of lower piston in m**2\n", + "d = 900 \t\t#Density of fluid in kg/m**3\n", + "g = 9.81 \t\t#Acc. due to gravity in m/s**2\n", + "H = 6 \t\t#Height of second piston in comparison to first one in m\n", + "A2 = 0.05 \t\t#Cross sectional area of higher piston in m**3\n", + "\n", + "#Calculation:\n", + "P1 = Po+F1/A1 \t#Fluid pressure in kPa\n", + "P2 = P1-d*g*H/1000 #Pressure at higher elevation on piston 2 in kPa\n", + "F2 = (P2-Po)*A2 \t#Balancing force on second piston in kN\n", + "\n", + "#Result:\n", + "print \"Balancing force on second larger piston is:\",round(F2,4),\"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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/3._The_Standard_Atmosphere.ipynb b/Introduction_to_flight_by_J_D_Anderson/3._The_Standard_Atmosphere.ipynb new file mode 100644 index 00000000..368f5fbe --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/3._The_Standard_Atmosphere.ipynb @@ -0,0 +1,546 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: The Standard Atmosphere" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Theoretical question\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.1\n", + "''' Determine the phase for each of the following water states using the tables in Appendix\n", + "B and indicate the relative position in the P–v, T–v, and P–T diagrams. '''\n", + "\n", + "print 'Theoretical question';" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Theoretical question\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.2\n", + "'''Determine the phase for each of the following states using the tables in Appendix B and\n", + "indicate the relative position in the P–v, T–v, and P–T diagrams, as in Figs. 3.11 and\n", + "3.12.'''\n", + "\n", + "print 'Theoretical question';" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Theoretical question\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.3\n", + "'''Determine the temperature and quality (if defined) for water at a pressure of 300 kPa and\n", + "at each of these specific volumes:\n", + "a. 0.5 m3/kg\n", + "b. 1.0 m3/kg'''\n", + "\n", + "print 'Theoretical question';" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Vapor on mass basis: 22.12 %\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.4\n", + "'''A closed vessel contains 0.1 m3 of saturated liquid and 0.9 m3 of saturated vapor R-134a\n", + "in equilibrium at 30◦C. Determine the percent vapor on a mass basis.'''\n", + "\n", + "#Variable Declaration: \n", + "vliq = 0.1 \t\t#Volume of saturated liquid in m**3\n", + "vf = 0.000843 \t#in m**3/kg\n", + "vvap = 0.9 \t\t#Volume of saturated vapor R-134a in equilbrium\n", + "vg = 0.02671 \t#in m**3/kg\n", + "\n", + "#Calculation:\n", + "mliq = vliq/vf \t#Mass of liquid in kg \n", + "mvap = vvap/vg \t#Mass of vapor in kg\n", + "m = mliq+mvap \t#Total mass in kg\n", + "x = mvap/m \t\t#Percentage of vapor on mass basis\n", + "\n", + "#Result:\n", + "print 'Vapor on mass basis:',round(x*100,2),'%'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Final pressure is(by interpolation): 945 KPa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.5\n", + "'''A rigid vessel contains saturated ammonia vapor at 20◦C. Heat is transferred to the system\n", + "until the temperature reaches 40◦C. What is the final pressure?'''\n", + "\n", + "#Variable Declaration: \n", + "v1 = 0.14922 \t#specific volume of sautrated ammonia in m**3/kg\n", + "P2 = 945 \t\t#final pressure in kPa\n", + "\n", + "#Calculation:\n", + "v2 = v1 \t\t#in m**3/kg\n", + "\n", + "print 'Final pressure is(by interpolation):',P2,'KPa'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Pressure is: 779.2 Kpa\n", + "Quality is: 0.2201\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.6\n", + "'''Determine the missing property of P–v–T and x if applicable for the following states.\n", + "a. Nitrogen: −53.2◦C, 600 kPa\n", + "b. Nitrogen: 100 K, 0.008 m3/kg'''\n", + "\n", + "#Variable Declaration: \n", + "T1 = 273-53.2 \t#Given temperature in K\n", + "P1 = 600 \t\t#Given pressure in kPa\n", + "T2 = 100 \t\t#Given temp. in K\n", + "v2 = 0.008 \t\t#Given specific volume in m**3/kg\n", + "vf = 0.001452 \t#in m**3/kg\n", + "vg = 0.0312 \t#in m**3/kg\n", + "Psat = 779.2 \t#Saturation pressure in kPa\n", + "\n", + "#Calculation:\n", + "vfg = vg-vf \t#in m**3/kg\n", + "x = (v2-vf)/vfg \t#Quality\n", + "\n", + "#Result:\n", + "print \"Pressure is: \",round(Psat,2),\"Kpa\"\n", + "print \"Quality is: \",round(x,4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Pressure of water: 534.2 KPa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.7\n", + "'''Determine the pressure for water at 200◦C with v = 0.4 m3/kg.'''\n", + "\n", + "#Variable Declaration: \n", + "vg = 0.12736 \t#Specific volume in m**3/kg for water at 200C\n", + "v = 0.4 \t\t#Specific volume in m**3/kg\n", + "P1 = 500 \t\t#in kPa\n", + "v1 = 0.42492 \t#Specific volume at P1 in m**3/kg\n", + "P2 = 600 \t\t#in kPa\n", + "v2 = 0.35202 \t#Specific volume at P2 in m**3/kg\n", + "\n", + "#Calculation:\n", + "P = P1+(P2-P1)*(v-v1)/(v2-v1) #Calculating pressure by interplotation\n", + "\n", + "#Result:\n", + "print 'Pressure of water:',round(P,1),'KPa'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mass of air contained in room is: 280.43 Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.8\n", + "'''What is the mass of air contained in a room 6 m × 10 m × 4 m if the pressure is 100 kPa\n", + "and the temperature is 25◦C?'''\n", + "\n", + "#Variable Declaration: \n", + "P = 100 \t\t#Pressure in kPa\n", + "V = 6*10*4 \t\t#Volume of room in m**3\n", + "R = 0.287 \t\t#in kN-m/kg-K\n", + "T = 25 \t\t#Temperature in Celsius\n", + "\n", + "#Calculation:\n", + "m = P*V/(R*(T+273.2)) \t#Mass of air contained in room\n", + "\n", + "#Result:\n", + "print \"Mass of air contained in room is:\",round(m,2),\"Kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Pressure inside tank is: 2066.0 KPa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.9\n", + "'''A tank has a volume of 0.5 m3 and contains 10 kg of an ideal gas having a molecular mass\n", + "of 24. The temperature is 25◦C. What is the pressure?'''\n", + "\n", + "#Variable Declaration: \n", + "V = 0.5 \t\t#Volumr of tank in m**3\n", + "m = 10 \t\t#Mass of ideal gas in kg\n", + "T = 25 \t\t#Temperature of tank in Celsius\n", + "M = 24 \t\t#Molecular mass of gas in kg/kmol\n", + "Ru = 8.3145 \t#Vniversal gas constant in kN-m/kmol-K\n", + "\n", + "#Calculation:\n", + "R = Ru/M \t\t#Gas constant for given ideal gas in kN-m/kg-K\n", + "P = m*R*(T+273.2)/V#Pressure inside tank\n", + "\n", + "#Result:\n", + "print \"Pressure inside tank is: \",round(P),\"KPa\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.10" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Volume flow rate is: 0.004054 m**3/s\n", + "Mass flow rate is: 0.00766 Kg/s\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.10\n", + "'''A gas bell is submerged in liquid water, with its mass counterbalanced with rope and\n", + "pulleys, as shown in Fig. 3.20. The pressure inside is measured carefully to be 105 kPa,\n", + "and the temperature is 21◦C. A volume increase is measured to be 0.75 m3 over a period\n", + "of 185 s. What is the volume flow rate and the mass flow rate of the flow into the bell,\n", + "assuming it is carbon dioxide gas?'''\n", + "\n", + "#Variable Declaration: \n", + "dt = 185 \t\t#Time period in seconds over which there is incrrease in volume \n", + "dV = 0.75 \t\t#Increase in volume in 0.75 in m**3\n", + "P = 105 \t\t#Pressure inside gas bell kPa\n", + "T = 21 \t\t#Temperature in celsius\n", + "R = 0.1889 \t\t#Ideal gas constant in kJ/kg-K\n", + "\n", + "#Calculation:\n", + "V = dV/dt \t\t#Volume flow rate in m**3/s\n", + "m = P*V/(R*(T+273.15))#Mass flow rate of the flow in kg/s\n", + "\n", + "#Result:\n", + "print \"Volume flow rate is: \",round(V,6),\"m**3/s\"\n", + "print \"Mass flow rate is: \",round(m,5),\"Kg/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.12" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Specific volume for R-134a using R-134a tables is: 0.0065 m**3/kg\n", + "Specific volume for R-134a using R-134a the ideal gas laws is: 0.01011 m**3/kg\n", + "Specific volume for R-134a using the generalized chart is: 0.00677 m**3/kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.12\n", + "'''Determine the specific volume for R-134a at 100◦C, 3.0 MPa for the following models:'''\n", + "\n", + "#Variable Declaration: \n", + "T = 100 \t\t#Given temp.in 100 celsius\n", + "P = 3 \t\t#Given pressure in MPa\n", + "v1 = 0.0065 \t#Specific volume in m**3/kg using table\n", + "M = 102.3 \t\t#Molecular mass in kg\n", + "R = 8.3145 \t\t#in kJ/K\n", + "Tr = 373.2/374.2 \t#Reduced temperature using generalized chart\n", + "Pr = 3/4.06 \t#Reduced pressure using generalized chart\n", + "Z = 0.67 \t\t#Compressibility factor \n", + "\n", + "#Calculation:\n", + "Ru = R/M \t\t#in kJ/K-kg\n", + "v2 = Ru*(T+273)/(P*1000)#Specific volume assuming R-134a to be ideal gas in m**3/kg\n", + "v3 = Z*v2 \t\t#Specific volume using generalized chart in m**3/kg\n", + "\n", + "#Result:\n", + "print \"Specific volume for R-134a using R-134a tables is: \",round(v1,5),\"m**3/kg\"\n", + "print \"Specific volume for R-134a using R-134a the ideal gas laws is:\",round(v2,5),\"m**3/kg\"\n", + "print \"Specific volume for R-134a using the generalized chart is: \",round(v3,5),\"m**3/kg\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.13" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Pressure is P: 850.0 KPa\n", + "Total propane mass is: 13.66 Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 3.13\n", + "'''Propane in a steel bottle of volume 0.1 m3 has a quality of 10% at a temperature of 15◦C.\n", + "Use the generalized compressibility chart to estimate the total propane mass and to find\n", + "the pressure.'''\n", + "\n", + "#Variable Declaration: \n", + "Pc = 4250 \t\t#Critical pressure of propane in kPa\n", + "Tc = 369.8 \t\t#Critical temperature in K\n", + "T = 15 \t\t#Temperature of propane in celsius\n", + "Prsat = 0.2 \t#Reduced pressure \n", + "x = 0.1 \t\t#Given quality\n", + "Zf = 0.035 \t\t#from graph\n", + "Zg = 0.83 \t\t#from graph\n", + "V = 0.1 \t\t#Volume of steel bottle in m**3\n", + "R = 0.1887 \t\t#in kPa-m**3/kg-K\n", + "\n", + "#Calculation:\n", + "Tr = T/Tc \t\t#Reduced temperature\n", + "P = Prsat*Pc \t#Pressure in kPa\n", + "Z = (1-x)*Zf+x*Zg #Overall compressibility factor\n", + "m = P*V/(Z*R*(T+273))#Total propane mass in kg\n", + "\n", + "#Result:\n", + "print \"Pressure is P:\",round(P,2),\"KPa\"\n", + "print \"Total propane mass is: \",round(m,2),\"Kg\"\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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/4._Aerodynamics.ipynb b/Introduction_to_flight_by_J_D_Anderson/4._Aerodynamics.ipynb new file mode 100644 index 00000000..d2461f95 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/4._Aerodynamics.ipynb @@ -0,0 +1,229 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Aerodynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work done during the isobaric process is: 12.0 KJ\n", + "Work done in isothermal process is: 7.33 KJ\n", + "Work done during the described process is: 6.41 KJ\n", + "Work done in the isovolumic process is: 0.0 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 4.1\n", + "'''Consider as a system the gas in the cylinder shown in Fig. 4.7; the cylinder is fitted with\n", + "a piston on which a number of small weights are placed. The initial pressure is 200 kPa,\n", + "and the initial volume of the gas is 0.04 m3.'''\n", + "from math import log\n", + "\n", + "#Variable Declaration: \n", + "P1 = 200 \t\t#Initial pressure inside cylinder in kPa\n", + "V2 = 0.1 \t\t#in m**3\n", + "V1 = 0.04 \t\t#Initial volume of gas in m**3\n", + "W4 = 0 \t\t#Work done in isovolumic process\n", + "\n", + "#Calculation:\n", + "W1 = P1*(V2-V1) \t#Work done in isobaric process in kJ\n", + "W2 = P1*V1*log(V2/V1) #Work done in isothermal process in kJ\n", + "P2 = P1*(V1/V2)**(1.3)\t#Final pressure according to the given process\n", + "W3 = (P2*V2-P1*V1)/(1-1.3)\n", + "\n", + "#Result:\n", + "print \"Work done during the isobaric process is: \",round(W1,2),\"KJ\"\n", + "print \"Work done in isothermal process is: \",round(W2,2),\"KJ\"\n", + "print \"Work done during the described process is: \",round(W3,2),\"KJ\"\n", + "print \"Work done in the isovolumic process is: \",round(W4,2),\"KJ\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work produced by ammonia is: 12.71 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 4.3\n", + "'''The cylinder/piston setup of Example 4.2 contains 0.5 kg of ammonia at −20◦C with\n", + "a quality of 25%. The ammonia is now heated to +20◦C, at which state the volume\n", + "is observed to be 1.41 times larger. Find the final pressure and the work the ammonia\n", + "produced.'''\n", + "\n", + "#Variable Declaration: \n", + "Psat = 190.2 \t\t#in kPa\n", + "vf = 0.001504 \t\t#in m**3/kg\n", + "vfg = 0.62184 \t\t#in m**3/kg\n", + "x1 = 0.25 \t\t #Quality\n", + "P2 = 600 \t\t #Pressure in state 2 in kPa\n", + "m = 0.5 \t\t #Mass of ammonia in kg\n", + "\n", + "#Calculation:\n", + "P1 = Psat \t\t #Saturation pressure in state 1\n", + "v1 = vf+x1*vfg \t\t#Specific volume at state 1 in m**3/kg\n", + "v2 = 1.41*v1 \t\t#Specific volume at state 2 in m**3/kg\n", + "W = m*(P1+P2)*(v2-v1)/2#Work produced by ammonia in kJ\n", + "\n", + "#Result:\n", + "print \"Work produced by ammonia is: \",round(W,2),\"KJ\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.4" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work in the overall process is: -17.71 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 4.4\n", + "'''The piston/cylinder setup shown in Fig. 4.12 contains 0.1 kg of water at 1000 kPa, 500◦C.\n", + "The water is now cooled with a constant force on the piston until it reaches half the initial\n", + "volume. After this it cools to 25◦C while the piston is against the stops. Find the final water\n", + "pressure and the work in the overall process, and show the process in a P–v diagram.'''\n", + "\n", + "#Variable Declaration: \n", + "v1 = 0.35411 \t#Specific volume at state 1 in m**3/kg\n", + "m = 0.1 \t\t#Mass of water in kg\n", + "P1 = 1000 \t\t#Pressure inside cylinder in kPa\n", + "\n", + "#Calculation:\n", + "v2 = v1/2 \n", + "W = m*P1*(v2-v1) \t#in kJ\n", + "\n", + "#Result:\n", + "print \"Work in the overall process is: \",round(W,2),\"KJ\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rate of heat transfer in the glass and convective layer is: 1105.0 KW\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 4.7\n", + "'''Consider the constant transfer of energy from a warm room at 20◦C inside a house to the\n", + "colder ambient temperature of −10◦C through a single-pane window, as shown in Fig.\n", + "4.19. The temperature variation with distance from the outside glass surface is shown\n", + "by an outside convection heat transfer layer, but no such layer is inside the room (as a\n", + "simplification). The glass pane has a thickness of 5 mm (0.005 m) with a conductivity of\n", + "1.4W/mKand a total surface area of 0.5m2. The outside wind is blowing, so the convective\n", + "heat transfer coefficient is 100 W/m2 K.With an outer glass surface temperature of 12.1◦C,\n", + "we would like to know the rate of heat transfer in the glass and the convective layer'''\n", + "\n", + "#Variable Declaration: \n", + "k = 1.4 \t\t#Conductivity of glass pane in W/m-K\n", + "A = 0.5 \t\t#Total surface area of glass pane\n", + "dx = 0.005 \t\t#Thickness of glasspane in m\n", + "dT1 = 20-12.1 \t#Temperature difference between room air and outer glass surface temperature in celsius\n", + "h = 100 \t\t#Convective heat transfer coefficient in W/m**2-K \n", + "dT = 12.1-(-10) \t#Temperature difference between warm room and colder ambient in celsius\n", + "\n", + "#Calculation:\n", + "Q = -k*A*dT1/dx \t#Conduction through glass slab in W\n", + "Q2 = h*A*dT \t#Heat transfer in convective layer in W\n", + "\n", + "#Result:\n", + "print \"Rate of heat transfer in the glass and convective layer is: \",round(Q2,2),\"KW\"" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/5._Airfoils,_Wings_and_Other_Aerodynamic_shapes.ipynb b/Introduction_to_flight_by_J_D_Anderson/5._Airfoils,_Wings_and_Other_Aerodynamic_shapes.ipynb new file mode 100644 index 00000000..23c8b51f --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/5._Airfoils,_Wings_and_Other_Aerodynamic_shapes.ipynb @@ -0,0 +1,533 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Airfoils, Wings and Other Aerodynamic shapes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Required height of car: 37.1 m\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.1\n", + "''' A car of mass 1100 kg drives with a velocity such that it has a kinetic energy of 400 kJ (see\n", + "Fig. 5.4). Find the velocity. If the car is raised with a crane, how high should it be lifted in\n", + "the standard gravitational field to have a potential energy that equals the kinetic energy? '''\n", + "\n", + "#Variable Declaration: \n", + "m = 1100 \t\t#Mass of car in kg\n", + "ke = 400 \t\t#Kinetic energy of car in kJ\n", + "g = 9.807 \t\t#Acc. due to gravity in m/s**2\n", + "\n", + "#Calculations:\n", + "V = (2*ke*1000/m)**0.5 #Velocity of car in m/s\n", + "H = ke*1000/(m*g) \t#Height to which the car should be lifted so that its potential energy equals its kinetic energy\n", + "\n", + "#Results:\n", + "print \"Required height of car: \", round(H,1),\"m\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in internal energy is: 3590.0 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.2\n", + "'''A tank containing a fluid is stirred by a paddle wheel. The work input to the paddle wheel\n", + "is 5090 kJ. The heat transfer from the tank is 1500 kJ. Consider the tank and the fluid\n", + "inside a control surface and determine the change in internal energy of this control mass. '''\n", + "\n", + "#Variable Declaration: \n", + "W = -5090 \t\t#Work input to paddle wheel in kJ\n", + "Q = -1500 \t\t#Heat transfer from tank in kJ\n", + "\n", + "#Calculations:\n", + "dU = Q-W \t\t#Change in internal energy in kJ\n", + "\n", + "#Results:\n", + "print \"Change in internal energy is: \",round(dU),\"KJ\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "When stone is about to enter state 2, dKE: 1.0 KJ and dPE : -1.0 KJ\n", + "When stone has just come to rest in the bucket i.e. state 3, W = 0, dPE = 0, dKE1: -1.0 J and dU : 1.0 J\n", + "When stone has entered state 4, dPE = 0, W3 = 0,dKE = 0, dU: -1.0 J Q3: -1.0 J\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.3\n", + "''' Consider a stone having a mass of 10 kg and a bucket containing 100 kg of liquid water.\n", + "Initially the stone is 10.2 m above the water, and the stone and the water are at the same\n", + "temperature, state 1. The stone then falls into the water.\n", + "Determine \u0003U, \u0003KE, \u0003PE, Q, and W for the following changes of state, assuming\n", + "standard gravitational acceleration of 9.806 65 m/s2.\n", + "a. The stone is about to enter the water, state 2.\n", + "b. The stone has just come to rest in the bucket, state 3.\n", + "c. Heat has been transferred to the surroundings in such an amount that the stone and\n", + "water are at the same temperature, T1, state 4. '''\n", + "\n", + "#Variable Declaration: \n", + "g = 9.806 \t\t#Acceleration due to gravity in m/s**2\n", + "m = 10 \t\t#Mass of stone in kg\n", + "H1 = 10.2 \t\t#Initial height of stone above water in metres\n", + "H2 = 0 \t\t#Final height in metres\n", + "\n", + "#Calculations:\n", + "dKE1 = -m*g*(H2-H1) #Change in kinetic energy when stone enters state 2 in J\n", + "dPE1 = -1 \t\t#Change in potential energy when stone enters state 2 in J\n", + "dPE2 = 0 \t\t#Change in potential energy when stone enters state 3 in JQ2 = 0 \t\t#no heat transfer when stone enters state 3 in J\n", + "W2 = 0 \t\t#no work done when stone enters state 3 in J\n", + "dKE2 = -1 \t\t#Change in kinetic energy when stone enters state 3\n", + "dU2 = -dKE2 \t#Change in internal energy when stone enters state 3 in J\n", + "dKE3 = 0 \t\t#Change in kinetic energy when stone enters state 4\n", + "dPE = 0 \t\t#Change in potential energy when stone enters state 4 in J\n", + "W3 = 0 \t\t#No work done when stone enters state 4 in J\n", + "dU3 = -1 \t\t#Change in internal energy when stone enters state 4 in J\n", + "Q3 = dU3 \t\t#Heat transfer when stone enters state 4 in J\n", + "\n", + "#Results:\n", + "print \"When stone is about to enter state 2, dKE: \",round(dKE1/1000,2),\"KJ and dPE :\",round(dPE1,2),\"KJ\"\n", + "print \"When stone has just come to rest in the bucket i.e. state 3, W = 0, dPE = 0, dKE1:\",round(dKE2,2),\"J and dU :\",round(dU2,2),\"J\"\n", + "print \"When stone has entered state 4, dPE = 0, W3 = 0,dKE = 0, dU: \",round(dU3,2),\"J Q3: \",round(Q3,2),\"J\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Specific volume for water is: 0.06474 m**3/Kg\n", + "Therefore ,this state is in the two phase region with quality: 0.6456\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.4\n", + "'''Determine the missing property (P, T, or x) and v forwater at each of the following states:\n", + "a. T = 300◦C, u = 2780 kJ/kg\n", + "b. P = 2000 kPa, u = 2000 kJ/kg'''\n", + "\n", + "#Variable Declaration: \n", + "T1 = 300 \t\t#Given temp. in Celsius\n", + "u1 = 2780 \t\t#Given specific internal enrgy in kJ/kg\n", + "P2 = 2000 \t\t#Given pressure in kPa\n", + "u2 = 2000 \t\t#Given specific intrernal energy in kJ/kg\n", + "uf = 906.4 \t\t#in kJ/kg\n", + "ug = 2600.3 \t#in kJ/kg \n", + "vf = 0.001177 \t#in m**3/kg \n", + "vg = 0.099627 \t#in m**3/kg\n", + "\n", + "#Calculation:\n", + "x2 = (u2-906.4)/(ug-uf) \n", + "v2 = vf+x2*(vg-vf)#Specific volume for water in m**3/kg\n", + "\n", + "#Result:\n", + "print \"Specific volume for water is: \",round(v2,5),\"m**3/Kg\"\n", + "print \"Therefore ,this state is in the two phase region with quality: \",round(x2,4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "By interplotation we find that for steam, if vg = 0.09831 m**3/kg then pressure is 2.03 MPa\n", + "Heat transfer for the process is: 104932.6 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.5\n", + "'''A vessel having a volume of 5 m3 contains 0.05 m3 of saturated liquid water and 4.95 m3\n", + "of saturated water vapor at 0.1 MPa. Heat is transferred until the vessel is filled with\n", + "saturated vapor. Determine the heat transfer for this process.'''\n", + "\n", + "#Variable Declaration: \n", + "Vliq = 0.05 \t\t#Volume of saturated liquid in m**3\n", + "vf = 0.001043 \t\t#in m**3/kg\n", + "Vvap = 4.95 \t\t#Volume of saturated water vapour in m**3\n", + "vg = 1.6940 \t\t#in m**3/kg\n", + "u1liq = 417.36 \t\t#Specific internal energy of liquid in kJ/kg\n", + "u1vap = 2506.1 \t\t#Specific internal energy of vapors in kJ/kg\n", + "V = 5 \t\t #Total volume in m**3\n", + "u2 = 2600.5 \t\t#Specific internal energy at final state in kJ/kg\n", + "\n", + "#Calculation:\n", + "m1liq = Vliq/vf \t\t#Mass of liquid in kg\n", + "m1vap = Vvap/vg \t\t#Mass of vapors in kg\n", + "U1 = m1liq*u1liq+m1vap*u1vap #Total internal energy in kJ\n", + "m = m1liq+m1vap \t\t#Total mass in kg\n", + "v2 = V/m \t\t #Final specific volume in m**3/kg\n", + "U2 = m*u2 \t\t #Internal energy at final state in kJ\n", + "Q = U2-U1 \t\t #Heat transfer for the process in kJ\n", + "\n", + "print 'By interplotation we find that for steam, if vg = 0.09831 m**3/kg then pressure is 2.03 MPa'\n", + "print \"Heat transfer for the process is: \",round(Q,2),\"KJ\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work done for the process: 91.0 KJ\n", + "Heat transfer: 771.1 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.6\n", + "'''A cylinder fitted with a piston has a volume of 0.1 m3 and contains 0.5 kg of steam at 0.4\n", + "MPa. Heat is transferred to the steam until the temperature is 300◦C, while the pressure\n", + "remains constant.'''\n", + "\n", + "#Variable Declaration: \n", + "V1 = 0.1 \t\t #Volume of cylinder in m**3\n", + "m = 0.5 \t\t #Mass of steam in kg\n", + "vf = 0.001084 \t\t#m**3/kg\n", + "vfg = 0.4614 \t\t#m**3/kg\n", + "hf = 604.74 \t\t#kJ/kg\n", + "hfg = 2133.8\t\t#kJ/kg\n", + "h2 = 3066.8 \t\t#Final specific heat enthalpy in kJ/kg\n", + "P = 400 \t\t #Pressure inside cylinder in kPa\n", + "v2 = 0.6548 \t\t#Specific enthalpy in m**3/kg\n", + "\n", + "#Calculation:\n", + "v1 = V1/m \t\t #Specific volume of steam in m**3/kg\n", + "x1 = (v1-vf)/vfg \t\t#Quality\n", + "h1 = hf+x1*hfg \t\t#Initial specific enthalpy in kJ/kg\n", + "Q = m*(h2-h1) \t\t#Heat transfer for this process in kJ\n", + "W = m*P*(v2-v1) \t\t#Work done for the process in kJ\n", + "\n", + "#Result:\n", + "print \"Work done for the process: \",round(W), \"KJ\"\n", + "print \"Heat transfer: \",round(Q,1), \"KJ\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.8" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in specific heat enthalpy if ideal gas tables are used is: 1267.0 KJ/Kg\n", + "If empirical equations are used: 1241.64 KJ/Kg\n", + "If specific heat is assumed to be constant and using its value at T1: 1106.4 KJ/Kg\n", + "If specific heat is assumed to be constant at its value at (T1+T2)/2: 1292.0 KJ/Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.8\n", + "'''Calculate the change of enthalpy as 1 kg of oxygen is heated from 300 to 1500 K. Assume\n", + "ideal-gas behavior.'''\n", + "from sympy import symbols,integrate\n", + "\n", + "#Variable Declaration: \n", + "h1 = 273.2 \t\t#Specific heat enthalpy for oxygen at 300 K\n", + "h2 = 1540.2 \t#Specific heat enthalpy for oxygen at 1500 K\n", + "T1 = 300 \t\t#Initial temperature in K\n", + "T2 = 1500 \t\t#Final temparature in K\n", + "x = symbols('x')\n", + "\n", + "#Calculation:\n", + "Cp = 0.88-0.00001*x+0.54*x**2-0.33*x**3 #Expression for constant pressure specific heat enthalpy for oxygen\n", + "dh1 = h2-h1 \t#This change in specific heat enthalpy is calculated using ideal gas tables \n", + "dh2 = 1000*integrate(Cp,(x,T1/1000,T2/1000)) #Using empirical equation\n", + "dh3 = 0.922*(T2-T1) #It is claculated if we assume specific heat enthalpy to be constant and uses its value at 300K\n", + "dh4 = 1.0767*(T2-T1)#It is claculated if we assume specific heat enthalpy to be constant and uses its value at 900K i.e mean of initial and final temperature\n", + "\n", + "#Result:\n", + "print \"Change in specific heat enthalpy if ideal gas tables are used is: \",round( dh1,2),\"KJ/Kg\"\n", + "print \"If empirical equations are used: \",round( dh2,2),\"KJ/Kg\"\n", + "print \"If specific heat is assumed to be constant and using its value at T1: \",round(dh3,2),\"KJ/Kg\"\n", + "print \"If specific heat is assumed to be constant at its value at (T1+T2)/2: \",round(dh4),\"KJ/Kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.9" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Heat transfer for the above process is: -4.21 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.9\n", + "'''A cylinder fitted with a piston has an initial volume of 0.1 m3 and contains nitrogen at 150\n", + "kPa, 25◦C. The piston is moved, compressing the nitrogen until the pressure is 1 MPa and\n", + "the temperature is 150◦C. During this compression process heat is transferred from the\n", + "nitrogen, and the work done on the nitrogen is 20 kJ. Determine the amount of this heat\n", + "transfer.'''\n", + "\n", + "#Variable Declaration: \n", + "P = 150 \t\t#Pressure of nitrogen in cylinder in kPa\n", + "V = 0.1 \t\t#Initial volume of cylinder in m**3\n", + "T1 = 25 \t\t#Initial temperature of nitrogen in celsius\n", + "T2 = 150 \t\t#Final tempareture of nitrogen in celsius\n", + "R = 0.2968 \t\t#In kJ/kg-K\n", + "Cv = 0.745 \t\t#Constant volume specific heat for nitrogen in kJ/kg-K\n", + "W = -20 \t\t#Work done on nitrogen gas in kJ\n", + "\n", + "#Calculation:\n", + "m = P*V/(R*(T1+273))#Mass of nitrogen in kg\n", + "Q = m*Cv*(T2-T1)+W #Heat transfer during the process in kJ\n", + "\n", + "#Result:\n", + "print \"Heat transfer for the above process is: \",round( Q,2),\"KJ\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.10" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rate of increase of internal energy is: 246.0 J/s\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.10\n", + "'''During the charging of a storage battery, the current i is 20 A and the voltage e is 12.8\n", + "V. The rate of heat transfer from the battery is 10 W. At what rate is the internal energy\n", + "increasing?'''\n", + "\n", + "#Variable Declaration: \n", + "W = -12.8*20 \t#Power consumed in J/s\n", + "Q = -10 \t\t#Heat transfer rate from battery in J/s\n", + "\n", + "#Calculation:\n", + "r = Q-W \t\t#Rate of increase of internal energy\n", + "\n", + "#Result:\n", + "print \"Rate of increase of internal energy is: \",round( r,2),\"J/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.11" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rate of change of temperature is: 0.0828 K/s\n", + "Time taken to reach a temperature of T: 11.0 min\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 5.11\n", + "'''A 25-kg cast-iron wood-burning stove, shown in Fig. 5.12, contains 5 kg of soft pine wood\n", + "and 1 kg of air. All the masses are at room temperature, 20◦C, and pressure, 101 kPa. The\n", + "wood now burns and heats all the mass uniformly, releasing 1500W. Neglect any air flow\n", + "and changes in mass of wood and heat losses. Find the rate of change of the temperature\n", + "(dT/dt) and estimate the time it will take to reach a temperature of 75◦C.'''\n", + "\n", + "#Variable Declaration: \n", + "Q = 1500 \t\t#Power produced by burning wood in J/s\n", + "mair = 1 \t\t#Mass of air in kg\n", + "mwood = 5 \t\t#Mass of soft pine wood in kg \n", + "miron = 25 \t\t#Mass of cast iron in kg\n", + "Cvair = 0.717 \t#Constant volume specific heat for air in kJ/kg\n", + "Cwood = 1.38 \t#Constant volume specific heat for wood in kJ/kg\n", + "Ciron = 0.42 \t#Constant volume specific heat for iron in kJ/kg\n", + "\n", + "#Calculations:\n", + "dT = 75-20 \t\t#Increase in temperature in Celsius\n", + "T = (Q/1000)/(mair*Cvair+mwood*Cwood+miron*Ciron) \t#Rate of change of temperature in K/s\n", + "dt = (dT/T)/60 \t#in minutes\n", + "\n", + "#Results:\n", + "print \"Rate of change of temperature is: \",round(T,4),\"K/s\"\n", + "print \"Time taken to reach a temperature of T: \",round(dt),\"min\"" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/6._Elements_of_Airplane_Performance.ipynb b/Introduction_to_flight_by_J_D_Anderson/6._Elements_of_Airplane_Performance.ipynb new file mode 100644 index 00000000..b3942e06 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/6._Elements_of_Airplane_Performance.ipynb @@ -0,0 +1,677 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Elements of Airplane Performance" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The mass flow rate is: 0.0055 kg/s.\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.01\n", + "''' Air is flowing in a 0.2-m-diameter pipe at a uniform velocity of 0.1 m/s. The temperature\n", + "is 25◦C and the pressure is 150 kPa. Determine the mass flow rate. '''\n", + "from math import pi\n", + "\n", + "#Variable Declaration: \n", + "R = 0.287 \t\t#in kJ/kg-K\n", + "T = 25 \t\t#temperature in celsius\n", + "P = 150 \t\t#pressure in kPa\n", + "v = R*(T+273.2)/P#specific volume in m**3/kg\n", + "D = 0.2 \t\t#diameter of pipe in metre\n", + "V = 0.1 \t\t#velocity of air in m/s\n", + "\n", + "#Calculations:\n", + "A = pi*D**2/4 \t#cross sectional area in m**2\n", + "m = V*A/v \t\t#mass flow rate in kg/s\n", + "\n", + "#Results:\n", + "print \"The mass flow rate is:\",round(m,4),\"kg/s.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The work involved in this process is: 0.6 kJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.02\n", + "''' Assume we are standing next to the local city’s main water line. The liquid water inside\n", + "flows at a pressure of 600 kPa (6 atm) with a temperature of about 10◦C. We want to add\n", + "a smaller amount, 1 kg, of liquid to the line through a side pipe and valve mounted on the\n", + "main line. How much work will be involved in this process? '''\n", + "\n", + "#Variable Declaration: \n", + "P = 600 \t\t#pressure in kPa\n", + "m = 1 \t\t#in kg\n", + "v = 0.001 \t\t#specific volume in m**3/kg\n", + "\n", + "#Calculations:\n", + "W = P*m*v \t\t#necessary work in kJ for adding the fluid \n", + "\n", + "#Results:\n", + "print \"The work involved in this process is:\",round(W,2),\"kJ\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The rate at which cooling water flows thorugh the condenser is: 0.919 kg/s\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.03\n", + "''' Consider a water-cooled condenser in a large refrigeration system in which R-134a is the\n", + "refrigerant fluid. The refrigerant enters the condenser at 1.0 MPa and 60◦C, at the rate of\n", + "0.2 kg/s, and exits as a liquid at 0.95 MPa and 35◦C. Cooling water enters the condenser\n", + "at 10◦C and exits at 20◦C. Determine the rate at which cooling water flows through the\n", + "condenser.\n", + "Control volume: Condenser.\n", + "Sketch: Fig. 6.6\n", + "Inlet states: R-134a—fixed; water—fixed.\n", + "Exit states: R-134a—fixed; water—fixed.\n", + "Process: Steady-state.\n", + "Model: R-134a tables; steam tables. '''\n", + "\n", + "#Variable Declaration: \n", + "hir = 441.89 \t\t#in kJ/kg for refrigerant using steam table \n", + "her = 249.10 \t\t#in kJ/kg for refrigerant using steam table\n", + "hiw = 42 \t\t #in kJ/kg for water using steam table\n", + "hew = 83.95 \t #in kJ/kg for water using steam table\n", + "mr = 0.2 \t\t #the rate at which refrigerant enters the condenser in kg/s\n", + "\n", + "#Calculations:\n", + "mw = mr*(hir-her)/(hew-hiw) \t\t#rate of flow of water in kg/s\n", + "\n", + "#Results:\n", + "print \"The rate at which cooling water flows thorugh the condenser is:\",round( mw,3),\"kg/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The quality is: 0.99\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.04\n", + "''' Steam at 0.6 MPa and 200◦C enters an insulated nozzle with a velocity of 50 m/s. It leaves\n", + "at a pressure of 0.15 MPa and a velocity of 600 m/s. Determine the final temperature if\n", + "the steam is superheated in the final state and the quality if it is saturated.\n", + "Control volume: Nozzle.\n", + "Inlet state: Fixed (see Fig. 6.7).\n", + "Exit state: Pe known.\n", + "Process: Steady-state.\n", + "Model: Steam tables. '''\n", + "\n", + "#Variable Declaration: \n", + "hi = 2850.1 \t#initial specific heat enthalpy for steam in kJ/kg\n", + "Vi = 50 \t\t#initial velocity of steam in m/s\n", + "Ve = 600 \t\t#final velocity of steam in m/s\n", + "hf = 467.1 \t\t#at final state in kJ/kg\n", + "hfg = 2226.5 \t#at final state in kJ/kg\n", + "\n", + "#Calculations:\n", + "he = hi+Vi**2/(2*1000)-Ve**2/(2*1000) #final specific heat enthalpy for steam in kJ/kg\n", + "xe = (he-hf)/hfg \t#quality of steam in final state\n", + "\n", + "#Results:\n", + "print \"The quality is: \",round(xe,2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Quality of the ammonia leaving the expansion valve is: 16.38 %\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.05\n", + "''' Consider the throttling process across the expansion valve or through the capillary tube\n", + "in a vapor-compression refrigeration cycle. In this process the pressure of the refrigerant\n", + "drops from the high pressure in the condenser to the low pressure in the evaporator,\n", + "and during this process some of the liquid flashes into vapor. If we consider this\n", + "process to be adiabatic, the quality of the refrigerant entering the evaporator can be\n", + "calculated.\n", + "Consider the following process, in which ammonia is the refrigerant. The ammonia\n", + "enters the expansion valve at a pressure of 1.50MPa and a temperature of 35◦C. Its pressure\n", + "on leaving the expansion valve is 291 kPa. Calculate the quality of the ammonia leaving\n", + "the expansion valve.\n", + "Control volume: Expansion valve or capillary tube.\n", + "Inlet state: Pi, Ti known; state fixed.\n", + "Exit state: Pe known.\n", + "Process: Steady-state.\n", + "Model: Ammonia tables. '''\n", + "\n", + "#Variable Declaration: \n", + "hi = 346.8 \t\t#specific heat enthalpy for ammonia at initial state in kJ/kg\n", + "hf = 134.4 \t\t#at final state in kJ/kg\n", + "hfg = 1296.4\t#at final state in kJ/kg\n", + "\n", + "#Calculations:\n", + "he = hi \t\t#specific heat enthalpy for ammonia at final state will be equal that at initial state because it is a throttling process\n", + "xe = (he-hf)/hfg \t#quality at final state\n", + "\n", + "#Results:\n", + "print \"Quality of the ammonia leaving the expansion valve is:\",round(xe*100,2),\"%\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The power output of the turbine is: 678.2 kW\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example:\n", + "''' The mass rate of flow into a steam turbine is 1.5 kg/s, and the heat transfer from the\n", + "turbine is 8.5 kW. The following data are known for the steam entering and leaving the\n", + "turbine.\n", + " Inlet Conditions Exit Conditions\n", + "Pressure 2.0 MPa 0.1 MPa\n", + "Temperature 350◦C\n", + "Quality 100%\n", + "Velocity 50 m/s 100 m/s\n", + "Elevation above 6 m 3 m\n", + "reference plane\n", + "\n", + "g = 9.8066 m/s2\n", + "\n", + "Determine the power output of the turbine.\n", + "Control volume: Turbine (Fig. 6.9).\n", + "Inlet state: Fixed (above).\n", + "Exit state: Fixed (above).\n", + "Process: Steady-state.\n", + "Model: Steam tables. '''\n", + "\n", + "#Variable Declaration: \n", + "hi = 3137 \t\t#initial specific heat of enthalpy in kJ/kg\n", + "he = 2675.5 \t#final specific heat of enthalpy in kJ/kg\n", + "Vi = 50 \t\t#initial velocity of steam in m/s\n", + "Ve = 100 \t\t#final velocity of steam in m/s\n", + "Zi = 6 \t\t#height of inlet conditions in metres\n", + "Ze = 3 \t\t#height of exit conditions in metres\n", + "m = 1.5 \t\t#mass flow rate of steam in kg/s\n", + "g = 9.8066 \t\t#acc. due to gravity in m/s**2\n", + "Qcv = -8.5 \t\t#heat transfer rate from turbine in kW\n", + "\n", + "#Calculations:\n", + "Wcv = Qcv+m*(hi+Vi**2/(2*1000)+g*Zi/1000)-m*(he+Ve**2/(2*1000)+g*Ze/1000) \t#power output of turbine in kW\n", + "\n", + "#Results:\n", + "print \"The power output of the turbine is:\",round(Wcv,1),\"kW\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Heat transfer rate in the aftercooler is: 35.2 kW\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.07\n", + "''' The compressor in a plant (see Fig. 6.10) receives carbon dioxide at 100 kPa, 280 K,\n", + "with a low velocity. At the compressor discharge, the carbon dioxide exits at 1100 kPa,\n", + "500 K, with velocity of 25 m/s and then flows into a constant-pressure aftercooler (heat\n", + "exchanger) where it is cooled down to 350 K. The power input to the compressor is\n", + "50 kW. Determine the heat transfer rate in the aftercooler. '''\n", + "\n", + "#Variable Declaration: \n", + "V1 = 0 \t\t#we assume initial velocity to be zero because its given that it enters with a low velocity\n", + "V2 = 25 \t\t#final velocity with which carbon dioxide exits in m/s\n", + "h2 = 401.52 \t#final specific enthalpy of heat when carbon dioxide exits in kJ/kg\n", + "h1 = 198 \t\t#initial specific enthalpy of heat in kJ/kg\n", + "Wc = -50 \t\t#power input to the compressor in kW\n", + "h3 = 257.9 \t\t#final specific enthalpy of heat when carbon dioxide flows into a constant pressure aftercooler\n", + "\n", + "#Calculations:\n", + "w = h1-h2-V2**2/(2*1000)#in kJ/kg\n", + "m = Wc/w \t\t#mass flow rate of carbon dioxide in kg/s\n", + "Qcool = -m*(h3-h2) \t\t#heat transfer rate in the aftercooler in kW\n", + "\n", + "#Results:\n", + "print \"Heat transfer rate in the aftercooler is:\",round(Qcool,1),\"kW\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.8" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The pump requires power input of 840.0 W\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.08\n", + "''' A small liquid water pump is located 15 m down in a well (see Fig. 6.11), taking water\n", + "in at 10◦C, 90 kPa at a rate of 1.5 kg/s. The exit line is a pipe of diameter 0.04 m that\n", + "goes up to a receiver tank maintaining a gauge pressure of 400 kPa. Assume the process\n", + "is adiabatic with the same inlet and exit velocities and the water stays at 10◦C. Find the\n", + "required pump work. '''\n", + "\n", + "#Variable Declaration: \n", + "m = 1.5 \t\t#mass flow rate of water in kg/s\n", + "g = 9.807 \t\t#acceleration due to gravity in m/s**2\n", + "Zin = -15 \t\t#depth of water pump in well in metres\n", + "Zex = 0 \t\t#in metres\n", + "v = 0.001001 \t#specific volume in m**3/kg\n", + "Pin = 90 \t\t#in kPa\n", + "\n", + "#Calculations:\n", + "Pex = 400+101.3 \t#exit pressure in kPa\n", + "W = m*(g*(Zin-Zex)*0.001-(Pex-Pin)*v) \t\t#power input in kW\n", + "\n", + "#Results:\n", + "print \"The pump requires power input of\",-round(W,2)*1000,\"W\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.9" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Heat transfer in line between boiler and turbine is: -21.0 kJ/kg\n", + "Turbine work is: 640.7 kJ/kg\n", + "Heat transfer in condenser is: -2173.3 kJ/kg\n", + "Heat transfer in boiler is: 2831.0 kJ/kg. \n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.09\n", + "''' Consider the simple steam power plant, as shown in Fig. 6.12. The following data are for\n", + "such a power plant.\n", + "\n", + "Location Pressure Temperature or Quality\n", + "Leaving boiler 2.0 MPa 300◦C\n", + "Entering turbine 1.9 MPa 290◦C\n", + "Leaving turbine,entering condenser 15 kPa 90%\n", + "Leaving condenser,entering pump 14 kPa 45◦C\n", + "Pump work = 4 kJ/kg\n", + "\n", + "Determine the following quantities per kilogram flowing through the unit:\n", + "a. Heat transfer in the line between the boiler and turbine.\n", + "b. Turbine work.\n", + "c. Heat transfer in the condenser.\n", + "d. Heat transfer in the boiler. '''\n", + "\n", + "#Variable Declaration: \n", + "h1 = 3023.5 \t\t#specific heat of enthalpy of steam leaving boiler in kJ/kg\n", + "h2 = 3002.5 \t\t#specific heat of enthalpy of steam entering turbine in kJ/kg\n", + "x = 0.9 \t\t #quality of steam entering condenser\n", + "hf = 226 \t\t #in kJ/kg\n", + "hfg = 2373.1 \t\t#in kJ/kg\n", + "h4 = 188.5 \t\t #specific heat of enthalpy of steam entering pump in kJ/kg\n", + "w45 = -4 \t\t #pump work in kJ/kg\n", + "\n", + "#Calculations:\n", + "h3 = hf+x*hfg \t\t#specific heat of enthalpy of steam entering condenser in kJ/kg\n", + "q12 = h2-h1 \t\t#heat transfer in line between boiler and turbine in kJ/kg\n", + "w23 = h2-h3 \t\t#turbine work in kJ/kg\n", + "q34 = h4-h3 \t\t#heat transfer in condenser\n", + "h5 = h4-w45 \t\t#in kJ/kg\n", + "q51 = h1-h5 \t\t#heat transfer in boiler in kJ/kg\n", + "\n", + "#Results:\n", + "print \"Heat transfer in line between boiler and turbine is:\",round(q12,2),\"kJ/kg\"\n", + "print \"Turbine work is:\",round(w23,1),\"kJ/kg\"\n", + "print \"Heat transfer in condenser is:\",round(q34,1),\"kJ/kg\"\n", + "print \"Heat transfer in boiler is:\",round(q51,2),\"kJ/kg. \"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The quality at the evaporator inlet is: 0.345\n", + "The rate of heat transfer to the evaporator is: 14.54 kW. \n", + "Rate of heat transfer from the compressor is: -0.21 kW. \n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.10\n", + "''' The refrigerator shown in Fig. 6.13 uses R-134a as the working fluid. The mass flow rate\n", + "through each component is 0.1 kg/s, and the power input to the compressor is 5.0 kW. The\n", + "following state data are known, using the state notation of Fig. 6.13:\n", + "P1 = 100 kPa, T1 = −20◦C\n", + "P2 = 800 kPa, T2 = 50◦C\n", + "T3 = 30◦C, x3 = 0.0\n", + "T4 = −25◦C\n", + "\n", + "Determine the following:\n", + "a. The quality at the evaporator inlet.\n", + "b. The rate of heat transfer to the evaporator.\n", + "c. The rate of heat transfer from the compressor. '''\n", + "\n", + "#Variable Declaration: \n", + "hf4 = 167.4 \t#in kJ/kg\n", + "hfg4 = 215.6 \t#in kJ/kg\n", + "h3 = 241.8 \t\t#specific heat of enthalpy of R-134a entering expansion valve\n", + "h4 = h3 \t\t#specific heat of enthalpy of R-134a leaving expansion valve\n", + "h1 = 387.2 \t\t#in kJ/kg\n", + "h2 = 435.1 \t\t#in kJ/kg\n", + "m = 0.1 \t\t#mass flow rate in kg/s\n", + "Wcomp = -5 \t\t#power input to compressor in kW\n", + "\n", + "#Calculations:\n", + "x4 = (h3-hf4)/hfg4 #quality of R-134a at evaporator inlet\n", + "Qevap = m*(h1-h4) #rate of heat transfer to the evaporator\n", + "Qcomp = m*(h2-h1)+Wcomp #rate of heat transfer from compressor\n", + "\n", + "#Results:\n", + "print \"The quality at the evaporator inlet is:\",round(x4,3)\n", + "print \"The rate of heat transfer to the evaporator is:\",round(Qevap,2),\"kW. \"\n", + "print \"Rate of heat transfer from the compressor is:\",round(Qcomp,2),\"kW. \"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.12" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mass of the steam that flows into the tank is: 1.263 kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.12\n", + "''' Let the tank of the previous example have a volume of 0.4m3 and initially contain saturated\n", + "vapor at 350 kPa. The valve is then opened, and steam from the line at 1.4 MPa and 300◦C\n", + "flows into the tank until the pressure is 1.4 MPa.\n", + "Calculate the mass of steam that flows into the tank. '''\n", + "\n", + "#Variable Declaration: \n", + "V1 = 0.4 \t\t#initial volume fo tank in m**3\n", + "v1 = 0.5243 \t#initial specific volume in m**3/kg\n", + "h1 = 3040.4 \t#initial specific enthalpy in kJ/kg\n", + "u1 = 2548.9 \t#initial specific internal energy in kJ/kg\n", + "V2 = 0.4 \t\t#final volume in m**3\n", + "T2 = 342 \t\t#final temperature in Celsius by interpolation\n", + "v2 = 0.1974 \t#final specific volume in m**3/kg\n", + "\n", + "#Calculations:\n", + "m1 = V1/v1 \t\t#initial mass of steam in tank in kg\n", + "m2 = V2/v2 \t\t#final mass of the steam in the tank in kg\n", + "m = m2-m1 \t\t#mass of steam that flowsinto the tank\n", + "\n", + "#Results:\n", + "print \"Mass of the steam that flows into the tank is:\",round(m,3),\"kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.13" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mass of ammonia withdrawn is: 72.7 kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 6.13\n", + "''' A tank of 2 m3 volume contains saturated ammonia at a temperature of 40◦C. Initially the\n", + "tank contains 50% liquid and 50% vapor by volume. Vapor is withdrawn from the top of\n", + "the tank until the temperature is 10◦C. Assuming that only vapor (i.e., no liquid) leaves\n", + "and that the process is adiabatic, calculate the mass of ammonia that is withdrawn. '''\n", + "\n", + "#Variable Declaration: \n", + "vf1 = 0.001725 \t\t#in m**3/kg\n", + "vf2 = 0.0016 \t\t#in m**3/kg\n", + "uf1 = 368.7 \t\t#in kJ/kg\n", + "uf2 = 226 \t\t #in kJ/kg\n", + "vg1 = 0.08313 \t\t#in m**3/kg\n", + "vfg2 = 0.20381\n", + "ug1 = 1341 \t\t #in kJ/kg\n", + "ufg2 = 1099.7 \t\t#in kJ/kg\n", + "Vf = 1 \t\t #initial volume of liquid in m**3\n", + "Vg = 1 \t\t #initial volume of vapor in m**3\n", + "he = 1461.1 \t\t#in kJ/kg\n", + "V = 2 \t\t #volume of tank in m**3\n", + "\n", + "#Calculations:\n", + "mf1 = Vf/vf1 \t\t#initial mass of liquid in kg\n", + "mg1 = Vg/vg1 \t\t#initial mass of vapor in kg\n", + "m1 = mf1+mg1 \t\t#initial mass of liquid in kg\n", + "x2 = ((2*1461.1)-(2*226)-(0.00160*634706))/((634706*0.20381)+(2*1099.7)) \t\t#quality of ammonia\n", + "v2 = 0.00160+(0.20381*x2) #final specific volume in m**3/kg\n", + "m2 = V/v2 \t\t #final mass of ammonia in kg\n", + "m = m1-m2 \t\t #mass of ammonia withdrawn\n", + "\n", + "#Results:\n", + "print \"Mass of ammonia withdrawn is:\",round(m,1),\"kg\"" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/7._Principles_of_Stability_and_Control.ipynb b/Introduction_to_flight_by_J_D_Anderson/7._Principles_of_Stability_and_Control.ipynb new file mode 100644 index 00000000..2057ecdb --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/7._Principles_of_Stability_and_Control.ipynb @@ -0,0 +1,278 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Chapter 7: Principles of Stability and Control" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total rate of energy rejected is: 233.0 KW\n", + "Rate of fuel consumption is: 0.0095 Kg/s\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 7.1\n", + "'''An automobile engine produces 136 hp on the output shaft with a thermal efficiency of\n", + "30%. The fuel it burns gives 35 000 kJ/kg as energy release. Find the total rate of energy\n", + "rejected to the ambient and the rate of fuel consumption in kg/s.'''\n", + "\n", + "#Variable Declaration: \n", + "W = 136*0.7355 \t#Output of automobile engine in kW\n", + "neng = 0.3 \t\t#Thermal efficiency of automobile engine\n", + "qh = 35000 \t\t#Energy output of fuel in kJ/kg\n", + "\n", + "#Calculation:\n", + "Qh = W/neng \t#Energy output of fuel in kW\n", + "Ql = Qh-W \t\t#Total rate of energy rejected to the ambient\n", + "m = Qh/qh \t\t#Rate of fuel consumption in kg/s\n", + "\n", + "#Result:\n", + "print \"Total rate of energy rejected is: \",round(Ql),\"KW\" \n", + "print \"Rate of fuel consumption is: \",round(m,4),\"Kg/s\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rate of energy taken out of the cold space is: 250.0 W\n", + "Coefficient of performance of the refrigerator is: 1.67\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 7.2\n", + "'''The refrigerator in a kitchen shown in Fig. 7.7 receives electrical input power of 150 W\n", + "to drive the system, and it rejects 400 W to the kitchen air. Find the rate of energy taken\n", + "out of the cold space and the COP of the refrigerator.'''\n", + "\n", + "#Variable Declaration: \n", + "Qh = 400 \t\t#Heat rejected to kitchen air in W\n", + "W = 150 \t\t#Electrical input power in W\n", + "\n", + "#Calculation:\n", + "Ql = Qh-W \t\t#Rate of energy taken out to cold space in W\n", + "B = Ql/W \t\t#Coefficicent of performnace of refrigerator\n", + "\n", + "#Result:\n", + "print \"Rate of energy taken out of the cold space is: \",round(Ql,2),\"W\"\n", + "print \"Coefficient of performance of the refrigerator is: \",round(B,2)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Celcius temperature at which pressure go to zero: -273.15 °C\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 7.3\n", + "'''In a certain constant-volume ideal-gas thermometer, the measured pressure at the ice point\n", + "(see Section 2.11) of water, 0◦C, is 110.9 kPa and at the steam point, 100◦C, is 151.5 kPa.\n", + "Extrapolating, at what Celsius temperature does the pressure go to zero (i.e., zero absolute\n", + "temperature)?'''\n", + "\n", + "#Variable Declaration: \n", + "P1 = 110.9 #Pressure at 1 in Kpa\n", + "P2 = 151.5 #Pressure at 2 in Kpa\n", + "T1 = 0 #Temperature at 1 in °C\n", + "T2 = 100 #Temperature at 2 in °C\n", + "P = 0 #pressure at which temperature is to be found out(KPa)\n", + "\n", + "#Calculation:\n", + "C =P1 #y-intercept\n", + "m = (P2-P1)/(T2-T1)#Slope of P-T graph\n", + "T = (P-C)/m #Interpolating straight line P=mT+C and finding T in °C\n", + "\n", + "#Result:\n", + "print 'Celcius temperature at which pressure go to zero: ',round(T,2),\"°C\" " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Engine efficiency is: 0.635\n", + "Energy discarded to the ambient surroundings is: 365.0 KW\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 7.4\n", + "'''Let us consider the heat engine, shown schematically in Fig. 7.25, that receives a heattransfer\n", + "rate of 1 MW at a high temperature of 550◦C and rejects energy to the ambient\n", + "surroundings at 300 K. Work is produced at a rate of 450 kW. We would like to know\n", + "how much energy is discarded to the ambient surroundings and the engine efficiency and\n", + "compare both of these to a Carnot heat engine operating between the same two reservoirs.'''\n", + "\n", + "#Variable Declaration: \n", + "Qh = 1000 \t\t#Rate of heat transfer to heat engine in kW\n", + "W = 450 \t\t#Rate of production of work in kW\n", + "Tl = 300 \t\t#Temperature of surroundings in K\n", + "Th = 550 \t\t#Temperature of heat source in Celsius\n", + "\n", + "#Calculation:\n", + "Ql = Qh-W \t\t#Rate of heat rejected by heat engine in kW\n", + "nthermal = W/Qh \t#Efficiency from the definition of efficiency\n", + "ncarnot = 1-Tl/(Th+273)#Efficiency if heat engine is considered to be ideal carnot heat engine\n", + "W2 = ncarnot*Qh \t#Rate of work production if heat engine is assumed to be ideal carnot heat engine in kW\n", + "Ql2 = Qh-W2 \t#Rate of heat rejected by heat engine in kW if heat engine is assumed to be ideal carnot heat engine\n", + "\n", + "#Result:\n", + "print \"Engine efficiency is: \",round(ncarnot,3)\n", + "print \"Energy discarded to the ambient surroundings is: \",round(Ql2),\"KW\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnitude of reqiured work is: 0.15 KW\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 7.5\n", + "'''As one mode of operation of an air conditioner is the cooling of a room on a hot day, it\n", + "works as a refrigerator, shown in Fig. 7.26.Atotal of 4kWshould be removed from a room\n", + "at 24◦C to the outside atmosphere at 35◦C.We would like to estimate the magnitude of the\n", + "required work. To do this we will not analyze the processes inside the refrigerator, which\n", + "is deferred to Chapter 11, but we can give a lower limit for the rate of work, assuming it\n", + "is a Carnot-cycle refrigerator.'''\n", + "\n", + "#Variable Declaration: \n", + "Tl = 24+273 \t\t#Room temperature in Kelvins\n", + "Th = 35+273 \t\t#Atmospheric temperature in Kelvins\n", + "Ql = 4 \t\t #Rate of heat rejection from room\n", + "\n", + "#Calculation:\n", + "B = Tl/(Th-Tl) \t\t#Coefficient of performance of air conditioner\n", + "W = Ql/B \t\t #Required work in kW\n", + "\n", + "#Result:\n", + "print \"Magnitude of reqiured work is: \",round(W,2),\"KW\"" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/8._Space_Flight_(Astronautics).ipynb b/Introduction_to_flight_by_J_D_Anderson/8._Space_Flight_(Astronautics).ipynb new file mode 100644 index 00000000..85beaf65 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/8._Space_Flight_(Astronautics).ipynb @@ -0,0 +1,548 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Space Flight (Astronautics)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Pressure after compression is P2: 1487.1 KPa\n", + "Coefficient of performance of refrigerator: 5.55\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 8.1\n", + "''' Consider a Carnot-cycle heat pump with R-134a as the working fluid. Heat is absorbed\n", + "into the R-134a at 0◦C, during which process it changes from a two-phase state to saturated\n", + "vapor. The heat is rejected from the R-134a at 60◦C and ends up as saturated liquid. Find\n", + "the pressure after compression, before the heat rejection process, and determine the COP\n", + "for the cycle.'''\n", + "\n", + "#Variable Declaration: \n", + "Th = 60 \t\t\t#temperature at which heat is rejected from R-134a\n", + "Tl = 0 \t\t\t\t#temperature at which heat is absorbed into the R-134a \n", + "s1 = 1.7262 \t\t#specific entropy at 0 Celsius\n", + "s3 = 1.2857 \t\t#specific entropy at 60 celsius\n", + "s4 = s3 \t\t\t#process of state change from 3-4 is isentropic\n", + "\n", + "#Calculations:\n", + "s2 = s1 \t\t\t#process of state change from 1-2 is isentropic \n", + "P2 = 1400+(1600-1400)*(1.7262-1.736)/(1.7135-1.736) \t\t#pressure after compression in kPa\n", + "B = (Th+273)/(Th-Tl)#coefficient of performance of refrigerator\n", + "\n", + "#Results:\n", + "print \"Pressure after compression is P2: \",round(P2,1) ,'KPa'\n", + "print \"Coefficient of performance of refrigerator: \",round(B,2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work required to accomplish the process: 73.7 KJ\n", + "Heat transfer: 277.9 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 8.2\n", + "''' A cylinder/piston setup contains 1 L of saturated liquid refrigerant R-410a at 20◦C.\n", + "The piston now slowly expands, maintaining constant temperature to a final pressure of\n", + "400 kPa in a reversible process. Calculate the work and heat transfer required to accom-\n", + "plish this process'''\n", + "\n", + "#Variable Declaration: \n", + "u1 = 87.94 \t\t\t\t\t#specific internal energy of R-12 at state 1 in kJ/kg\n", + "u2 = 276.44 \t\t\t\t#specific internal energy of R-12 at state 2 in kJ/kg\n", + "s1 = 0.3357 \t\t\t\t#specific entropy at state 1 in kJ/kg-K\n", + "s2 = 1.2108 \t\t\t\t#specific entropy at state 2 in kJ/kg-K\n", + "V = 0.001 \t\t\t\t\t#volume of saturated liquid in m**3\n", + "v1 = 0.000923 \t\t\t\t#specific volume in m**3/kg\n", + "T = 20 \t\t\t\t\t\t#temperature of liquid in celsius\n", + "\n", + "#Calculations:\n", + "m = V/v1 \t\t\t\t\t#mass of saturated liquid in kg\n", + "Q12 = m*(T+273.15)*(s2-s1) \t#heat transfer in kJ to accomplish the process\n", + "W12 = m*(u1-u2)+Q12 \t\t#work required to accomplish the process\n", + "\n", + "#Results\n", + "print \"Work required to accomplish the process: \",round(W12,1),'KJ'\n", + "print \"Heat transfer: \",round(Q12,1),'KJ'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in entropy assuming constant specific heat: 0.8958 KJ/Kg-K\n", + "Using steam table: 0.8959 KJ/Kg-K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import log\n", + "#Example: 8.3\n", + "''' One kilogram of liquid water is heated from 20◦C to 90◦C. Calculate the entropy change,\n", + "assuming constant specific heat, and compare the result with that found when using the\n", + "steam tables.\n", + "Control mass: Water.\n", + "Initial and final states: Known.\n", + "Model: Constant specific heat, value at room temperature.'''\n", + "\n", + "#Variable Declaration: \n", + "C = 4.184 \t\t# specific heat of water in kJ/kg-K\n", + "T1 = 20 \t\t#initial temperature of water in celsius\n", + "T2 = 90 \t\t#final temperature of water in celsius\n", + "\n", + "#Calculations:\n", + "dS1 = C*log((T2+273.2)/(T1+273.2)) \t\t#change in entropy in kJ/kg-K\n", + "dS2 = 1.1925-0.2966 \t\t#in kJ/kg-K using steam tables\n", + "\n", + "#Results\n", + "print \"Change in entropy assuming constant specific heat: \",round(dS1,4),'KJ/Kg-K'\n", + "print \"Using steam table: \",round(dS2,4) ,'KJ/Kg-K'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in entropy using ideal gas tables: 1.7228 KJ/Kg-K\n", + "Change in entropy using empirical equation: 1.7058 KJ/Kg-K\n", + "Change in entropy using the value of specific heat at 300K: 1.5586 KJ/Kg-K\n", + "Change in entropy assuming specific heat is constant at its value at 900K: 1.8076 KJ/Kg-K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import log\n", + "from sympy import symbols, integrate\n", + "#Example: 8.4\n", + "''' Consider Example 5.7, in which oxygen is heated from 300 to 1500 K. Assume that during\n", + "this process the pressure dropped from 200 to 150 kPa. Calculate the change in entropy\n", + "per kilogram.'''\n", + "\n", + "#Variable Declaration: \n", + "T1 = 300 \t\t#initial temperature in kelvins\n", + "T2 = 1500 \t\t#final temperature in kelvins\n", + "P1 = 200 \t\t#initial pressure in kPa\n", + "P2 = 150 \t\t#final pressure in kPa\n", + "R = 0.2598 \t\t# in kJ/kg-K\n", + "Cp = 0.922 \t\t#specific heat in kJ/kg-K at constant pressure\n", + "dsT2 = 8.0649 \t#in kJ/kg-K\n", + "dsT1 = 6.4168 \t#in kJ/kg-K\n", + "x = symbols('x')#Symbolic representation of theta \n", + "\n", + "#Calculations:\n", + "dS1 = dsT2-dsT1-R*log(P2/P1) \t\t#entropy change calculated using ideal gas tables\n", + "dS2 = integrate(0.88/x-0.0001+0.54*x-0.33*x**2,(x,0.3,1.5))-R*log(P2/P1) \t\t#entropy change calculated using empirical equation \n", + "dS3 = Cp*log(T2/T1)-R*log(P2/P1) \t#entropy change assuming constant specific heat in kJ/kg-K\n", + "dS4 = 1.0767*log(T2/T1)+0.0747 \t\t#entropy change assuming specific heat is constant at its value at 990K\n", + "\n", + "#Results\n", + "print \"Change in entropy using ideal gas tables: \",round(dS1,4),'KJ/Kg-K'\n", + "print \"Change in entropy using empirical equation: \",round(dS2,4),'KJ/Kg-K'\n", + "print \"Change in entropy using the value of specific heat at 300K: \",round(dS3,4),'KJ/Kg-K'\n", + "print \"Change in entropy assuming specific heat is constant at its value at 900K: \",round(dS4,4),'KJ/Kg-K'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Entropy change assuming constant specific heat: 0.7785 KJ/Kg-K\n", + "Assuming variable specific heat: 0.7897 KJ/Kg-K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import log\n", + "#Example: 8.5\n", + "''' Calculate the change in entropy per kilogram as air is heated from 300 to 600 K while\n", + "pressure drops from 400 to 300 kPa. Assume:\n", + "1. Constant specific heat.\n", + "2. Variable specific heat.'''\n", + "\n", + "#Variable Declaration: \n", + "Cp = 1.004 \t\t\t#specific heat at constant pressure in kJ/kg-K\n", + "R = 0.287 \t\t\t#gas constant in kJ/kg-K\n", + "P1 = 400 \t\t\t#initial pressure in kPa\n", + "P2 = 300 \t\t\t#final pressure in kPa\n", + "T1 = 300 \t\t\t#initial temperature in K\n", + "T2 = 600 \t\t\t#final temperature in K\n", + "s1 = 6.8693 \t\t#specific entropy at T1\n", + "s2 = 7.5764 \t\t#specific entropy at T2\n", + "\n", + "#Calculations:\n", + "dS1 = Cp*log(T2/T1)-R*log(P2/P1)#entropy change assuming constant specific heat\n", + "dS2 = s2-s1-R*log(P2/P1) \t\t#entropy change assuming variable specific heat\n", + "\n", + "#Results\n", + "print \"Entropy change assuming constant specific heat: \",round(dS1,4),'KJ/Kg-K'\n", + "print \"Assuming variable specific heat: \",round(dS2,4),'KJ/Kg-K'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work done by air: 106.96 KJ/Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import log\n", + "#Example: 8.6\n", + "''' One kilogram of air is contained in a cylinder fitted with a piston at a pressure of 400\n", + "kPa and a temperature of 600 K. The air is expanded to 150 kPa in a reversible adiabatic\n", + "process. Calculate the work done by the air.\n", + "Control mass: Air.\n", + "Initial state: P 1 , T 1 ; state 1 fixed.\n", + "Final state: P 2 .\n", + "Process: Reversible and adiabatic.\n", + "Model: Ideal gas and air tables, Table A.7.'''\n", + "\n", + "#Variable Declaration: \n", + "T1 = 600 \t\t\t\t#initial temperature of air in K\n", + "P1 = 400 \t\t\t\t#intial pressure of air in kPa\n", + "P2 = 150 \t\t\t\t#final pressure in kPa\n", + "u1 = 435.10 \t\t\t#specific internal energy at temperature T1 in kJ/kg\n", + "sT1 = 7.5764 \t\t\t#specific entropy at temperature T1 in kJ/kg-K\n", + "R = 0.287 \t\t\t\t#gas constant in kJ/kg-K\n", + "ds = 0\n", + "T2 = 457 \t\t\t\t#final temperature in K\n", + "u2 = 328.14 \t\t\t#specific internal energy at temperature T2 in kJ/kg\n", + "\n", + "#Calculations:\n", + "sT2 = ds+sT1+R*log(P2/P1)#specific entropy at temperature T2 in kJ/kg-K\n", + "w = u1-u2 \t\t\t\t#work done by air in kJ/kg\n", + "\n", + "#Results\n", + "print \"Work done by air: \",round(w,2),'KJ/Kg'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.7" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work done is w12: -130.5 KJ/Kg\n", + "Heat transfer are: -32.2 KJ/Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 8.7\n", + "''' In a reversible process, nitrogen is compressed in a cylinder from 100 kPa and 20◦\n", + "C to 500 kPa. During this compression process, the relation between pressure and volume is\n", + "PV 1.3 = constant. Calculate the work and heat transfer per kilogram, and show this process\n", + "on P–v and T–s diagrams.\n", + "Control mass: Nitrogen.\n", + "Initial state: P 1 , T 1 ; state 1 known.\n", + "Final state: P 2 .\n", + "Process: Reversible, polytropic with exponent n < k.\n", + "Diagram: Fig. 8.14.\n", + "Model: Ideal gas, constant specific heat—value at 300 K.'''\n", + "\n", + "#Variable Declaration: \n", + "P2 = 500 \t\t\t\t\t#final pressure in cylinder in kPa\n", + "P1 = 100 \t\t\t\t\t#initial pressure in cylinder in kPa\n", + "T1 = 20+273.2 \t\t\t\t#initial temperature inside cylinder in Kelvins\n", + "n = 1.3 \n", + "R = 0.2968 \t\t\t\t\t#gas constant in kJ/kg-K\n", + "Cvo = 0.745 \t\t\t\t#specific heat at constant volume in kJ/kg-K\n", + "\n", + "#Calculations:\n", + "T2 = (T1)*(P2/P1)**((n-1)/n)#final temperature inside cylinder in K\n", + "w12 = R*(T2-T1)/(1-n) \t\t#work in kJ/kg\n", + "q12 = Cvo*(T2-T1)+w12 \t\t#heat transfer in kJ/kg\n", + "\n", + "#Results\n", + "print \"Work done is w12: \",round(w12,1),\"KJ/Kg\"\n", + "print \"Heat transfer are: \",round(q12,1),\"KJ/Kg\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.8" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Increase in entropy of water plus surr: 1.522 KJ/K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 8.8\n", + "'''Consider an electric space heater that converts 1 kW of electric power into a heat flux of\n", + "1 kW delivered at 600 K from the hot wire surface. Let us look at the process of the energy\n", + "conversion from electricity to heat transfer and find the rate of total entropy generation.\n", + "Control mass: The electric heater wire.\n", + "State: Constant wire temperature 600 K.'''\n", + "\n", + "#Variable Declaration: \n", + "m = 1 \t\t\t\t\t#mass of saturated water vapour\n", + "sfg = 6.0480 \t\t\t#in kJ/K\n", + "T = 25 \t\t\t\t\t#temperature of surrounding air in celsius\n", + "hfg = 2257.0 \t\t\t#in kJ/kg\n", + "\n", + "#Calculations:\n", + "dScm = -m*sfg \t\t\t#change in entropy of control mass in kJ/K\n", + "Qsurr = m*hfg \t\t\t#heat transferred to surr in kJ\n", + "dSsurr = Qsurr/(T+273.15)#in kJ/K\n", + "dSnet = dScm+dSsurr\t\t#net increase in entropy in kJ/K\n", + "\n", + "#Results:\n", + "print \"Increase in entropy of water plus surr:\",round(dSnet,4) ,'KJ/K'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.9" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Entropy generation is: 0.00167 KW/K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 8.9\n", + "''' Consider an electric space heater that converts 1 kW of electric power into a heat flux of\n", + "1 kW delivered at 600 K from the hot wire surface. Let us look at the process of the energy\n", + "conversion from electricity to heat transfer and find the rate of total entropy generation.\n", + "Control mass: The electric heater wire.\n", + "State: Constant wire temperature 600 K.'''\n", + "\n", + "#Variable Declaration: \n", + "Qout = 1 \t\t#value of heat flux generated by 1kW of electric power\n", + "T = 600 \t\t#temperature of hot wire surface in K\n", + "\n", + "#Calculations:\n", + "Sgen = Qout/T \t\t#entropy generation in kW/K\n", + "\n", + "#Results\n", + "print \"Entropy generation is: \",round(Sgen,5),'KW/K'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.10" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total entropy generated: 29.3 W/K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 8.10\n", + "''' Consider a modern air conditioner using R-410a working in heat pump mode, as shown in\n", + "Fig. 8.21. It has a COP of 4 with 10 kW of power input. The cold side is buried underground,\n", + "where it is 8◦C, and the hot side is a house kept at 21◦C. For simplicity, assume that the\n", + "cycle has a high temperature of 50◦C and a low temperature of −10◦C (recall Section\n", + "7.10). We would like to know where entropy is generated associated with the heat pump,\n", + "assuming steady-state operation.'''\n", + "\n", + "#Variable Declaration: \n", + "B = 4 \t\t\t\t\t#COP of air conditioner\n", + "W = 10 \t\t\t\t\t#power input of air conditioner in kW\n", + "Thigh = 323 \t\t\t#in Kelvin\n", + "Tlow = 263 \t\t\t\t#in Kelvin\n", + "Tl = 281 \t\t\t\t#in K\n", + "Th = 294 \t\t\t\t#in K\n", + "\n", + "#Calculations:\n", + "Qh = B*W \t\t\t\t#in kW\n", + "Ql = Qh-W \t\t\t\t#in kW\n", + "SgenHP = (Qh*1000/Thigh)-(Ql*1000/Tlow)\t#in W/K\n", + "SgenCV1 = Ql*1000/Tlow-Ql*1000/Tl \t\t#in W/K\n", + "SgenCV2 = Qh*1000/Th-Qh*1000/Thigh \t\t#in W/K\n", + "SgenTOT = SgenCV1+SgenCV2+SgenHP \t\t#in W/K\n", + "\n", + "#Results\n", + "print \"Total entropy generated: \",round(SgenTOT,1),'W/K'" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/9._Propulsion.ipynb b/Introduction_to_flight_by_J_D_Anderson/9._Propulsion.ipynb new file mode 100644 index 00000000..c24ed6eb --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/9._Propulsion.ipynb @@ -0,0 +1,585 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Propulsion" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work per kilogram of steam for this isentropic process: 377.5 KJ/Kg-K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 9.1\n", + "'''Steam enters a steam turbine at a pressure of 1 MPa, a temperature of 300\n", + "◦C, and avelocity of 50 m/s. The steam leaves the turbine at a pressure of 150 kPa and a velocity of\n", + "200 m/s. Determine the work per kilogram of steam flowing through the turbine, assuming\n", + "the process to be reversible and adiabatic.\n", + "Control volume: Turbine.\n", + "Sketch: Fig. 9.2.\n", + "Inlet state: Fixed (Fig. 9.2).\n", + "Exit state: P e , V e known.\n", + "Process: Steady state, reversible and adiabatic.\n", + "Model: Steam tables.'''\n", + "\n", + "#Variable Declaration: \n", + "hi = 3051.2 \t\t#initial specific heat of enthalpy of steam in kJ/kg\n", + "si = 7.1228 \t\t#initial specific entropy of steam in kJ/kg-K\n", + "Pe = 0.15 \t\t\t#final pressure in MPa\n", + "se = si \t\t\t#specific entropy in final state in kJ/kg-K\n", + "sf = 1.4335 \t\t#in kJ/kg-K\n", + "sfg = 5.7897 \t\t#in kJ/kg-K\n", + "vi = 50 \t\t\t#velocity with which steam enters turbine in m/s\n", + "ve = 200 \t\t\t#velocity with which steam leaves the turbine in m/s\n", + "hf = 467.1 \t\t\t#in kJ/kg\n", + "hfg = 2226.5 \t\t#in kJ/kg\n", + "\n", + "#Calculations:\n", + "xe = (se-sf)/sfg \t#quality of steam in final state\n", + "he = hf+xe*hfg \t\t#final specific heat of enthalpy of steam in kJ/kg\n", + "w = hi+vi**2/(2*1000)-he-ve**2/(2*1000) \t\t#work of steam for isentropic process in kJ/kg\n", + "\n", + "#Results\n", + "print \"Work per kilogram of steam for this isentropic process: \",round(w,1),\"KJ/Kg-K\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Exit velocity of the steam from the nozzle: 737.0 m/s\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 9.2\n", + "''' Consider the reversible adiabatic flow of steam through a nozzle. Steam enters the nozzle\n", + "at 1 MPa and 300◦C, with a velocity of 30 m/s. The pressure of the steam at the nozzle\n", + "exit is 0.3 MPa. Determine the exit velocity of the steam from the nozzle, assuming a\n", + "reversible, adiabatic, steady-state process.'''\n", + "\n", + "#Variable Declaration: \n", + "hi = 3051.2 \t\t#initial specific heat of enthalpy in kJ/kg\n", + "si = 7.1228 \t\t#initial specific entropy in kJ/kg-K\n", + "Pe = 0.3 \t\t\t#final pressure in MPa\n", + "he = 2780.2 \t\t#final specific heat of enthalpy in kJ/kg-K\n", + "Te = 159.1 \t\t\t#final temperature in celsius\n", + "vi = 30 \t\t\t#velocity with which steam enters the nozzle in m/s\n", + "\n", + "#Calculations:\n", + "se = si \t\t\t#final specific entropy \n", + "ve = ((2*(hi-he)+(vi**2/1000))*1000)**0.5 \t\t#final velocity of steam with which it exits in m/s\n", + "\n", + "#Results\n", + "print \"Exit velocity of the steam from the nozzle:\",round(ve),'m/s'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Specific work required: -271.0 KJ/Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 9.4\n", + "''' An air compressor in a gas station (see Fig. 9.4) takes in a flow of ambient air at 100 kPa,\n", + "290 K and compresses it to 1000 kPa in a reversible adiabatic process. We want to know\n", + "the specific work required and the exit air temperature.'''\n", + "\n", + "#Variable Declaration: \n", + "Cp = 1.004 \t\t#specific heat of air at constant pressure in kJ/kg-K\n", + "Ti = 290 \t\t#initial temperature in kelvins\n", + "Pi = 100 \t\t#initial pressure in kPa\n", + "Pe = 1000 \t\t#final pressure in kPa\n", + "k = 1.4 \n", + "\n", + "#Calculations:\n", + "Te = Ti*(Pe/Pi)**((k-1)/k) #final temperature in kelvins\n", + "we = Cp*(Ti-Te) \t\t#required specific work in kJ/kg\n", + "\n", + "#Results:\n", + "print \"Specific work required: \",round(we),'KJ/Kg'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.5" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Entropy generated in this process: 0.072 KW/K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 9.5\n", + "''' A de-superheater works by injecting liquid water into a flow of superheated steam. With\n", + "2 kg/s at 300 kPa, 200◦C, steam flowing in, what mass flow rate of liquid water at 20◦C\n", + "should be added to generate saturated vapor at 300 kPa? We also want to know the rate of\n", + "entropy generation in the process.'''\n", + "\n", + "#Variable Declaration: \n", + "h1 = 2865.54 \t\t#specific heat of enthalpy at state 1 in kJ/kg\n", + "h2 = 83.94 \t\t\t#specific heat of enthalpy at state 2 in kJ/kg\n", + "h3 = 2725.3 \t\t#specific heat of enthalpy at state 3 in kJ?kg\n", + "s1 = 7.3115 \t\t#specific entropy at state 1 in kJ/kg-K\n", + "s2 = 0.2966 \t\t#specific entropy at state 2 in kJ/kg-K\n", + "s3 = 6.9918 \t\t#specific entropy at state 3in kJ/kg-K\n", + "m1 = 2 \t\t\t\t#mass flow rate at state 1 in kg/s\n", + "\n", + "#Calculations:\n", + "m2 = m1*(h1-h3)/(h3-h2)\t#mass flow rate at state 2 in kg/s\n", + "m3 = m1+m2 \t\t\t\t#mass flow rate at state 3 in kg/s\n", + "Sgen = m3*s3-m1*s1-m2*s2#entropy generation in the process\n", + "\n", + "#Results:\n", + "print \"Entropy generated in this process: \",round(Sgen,3),'KW/K'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total amount of work required to fill the tank: -31.9 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import log\n", + "#Example: 9.6\n", + "'''Assume an air tank has 40 L of 100 kPa air at ambient temperature 17◦C. The adiabatic\n", + "and reversible compressor is started so that it charges the tank up to a pressure of 1000\n", + "kPa and then it shuts off. We want to know how hot the air in the tank gets and the total\n", + "amount of work required to fill the tank.'''\n", + "\n", + "#Variable Declaration: \n", + "T1 = 17+273 \t\t#initial temperature of tank in Kelvins\n", + "sT1 = 6.83521 \t\t#specific entropy in kJ/kg-K\n", + "R = 0.287 \t\t\t#gas constant in kJ/kg-K\n", + "P1 = 100 \t\t\t#initial pressure in kPa\n", + "P2 = 1000 \t\t\t#final pressure in kPa\n", + "T2 = 555.7 \t\t\t#from interplotation \n", + "V1 = 0.04 \t\t\t#volume of tank in m**3\n", + "V2 = V1 \t\t\t#final volume is equal to initial volume\n", + "u1 = 207.19 \t\t#initial specific heat of enthalpy in kJ/kg\n", + "u2 = 401.49 \t\t#final specific heat of enthalpy in kJ/kg\n", + "hin = 290.43 \t\t#in kJ/kg\n", + "\n", + "#Calculations:\n", + "sT2 = sT1+R*log(P2/P1)\t#specific entropy at temperature T2 in kJ/kg-K\n", + "m1 = P1*V1/(R*T1) \t#initial mass of air in tank in kg\n", + "m2 = P2*V2/(R*T2) \t#final mass of air in tank in kg\n", + "Min = m2-m1 \t\t#in kg\n", + "W12 = Min*hin+m1*u1-m2*u2 \t\t#work required to fill the tank in kJ\n", + "\n", + "#Results:\n", + "print \"Total amount of work required to fill the tank: \",round(W12,1),'KJ'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work required to pump water isentropically: 4.92 KJ/Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 9.7\n", + "''' Calculate the work per kilogram to pump water isentropically from 100 kPa, 30◦C to 5 MPa.'''\n", + "\n", + "#Variable Declaration: \n", + "P1 = 100 \t\t\t#initial pressure in kPa\n", + "P2 = 5000 \t\t\t#final pressure in kPa\n", + "v = 0.001004 \t\t#specific volume in m**3/kg\n", + "\n", + "#Calculations:\n", + "w = v*(P2-P1) \t\t#work required to pump water isentropically\n", + "\n", + "#Results:\n", + "print \"Work required to pump water isentropically: \",round(w,2),'KJ/Kg'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ideal nozzle can generate upto Ve = 20.0 m/s in the exit flow.\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 9.8\n", + "'''Consider a nozzle used to spray liquid water. If the line pressure is 300 kPa and the water\n", + "temperature is 20◦C, how high a velocity can an ideal nozzle generate in the exit flow?'''\n", + "\n", + "#Variable Declaration: \n", + "vf = 0.001002 \t#in m**3/kg\n", + "Pi = 300 \t\t#Line pressure in kPa\n", + "Po = 100 \t\t#in kPa\n", + "\n", + "#Calculations:\n", + "v = vf\n", + "Ve = (2*v*(Pi-Po)*1000)**0.5 \t\t#velocity in the exit flow\n", + "\n", + "#Results:\n", + "print \"Ideal nozzle can generate upto Ve = \",round(Ve),'m/s in the exit flow.'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rate of entropy generation for this process: 0.00166 KW/K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 9.9\n", + "'''Saturated vapor R-410a enters the uninsulated compressor of a home central air-\n", + "conditioning system at 5◦C. The flow rate of refrigerant through the compressor is 0.08\n", + "kg/s, and the electrical power input is 3 kW. The exit state is 65◦C, 3000 kPa. Any heat transfer from the compressor is with the ambient at 30◦C. Determine the rate of entropy\n", + "generation for this process.\n", + "Control volume: Compressor out to ambient T 0 .\n", + "Inlet state: T i , x i known; state fixed.\n", + "Exit state: P e , T e known; state fixed.\n", + "Process: Steady-state, single fluid flow.\n", + "Model: R-410a tables, B.4.'''\n", + "#Variable Declaration: \n", + "hi = 280.6 \t\t\t\t#in kJ/kg\n", + "he = 307.8 \t\t\t\t#in kJ/kg\n", + "si = 1.0272 \t\t\t#in kJ/kg\n", + "se = 1.0140 \t\t\t#in kJ/kg\n", + "m = 0.08 \t\t\t\t#flow rate of refrigerant in kg/s\n", + "P = 3 \t\t\t\t\t#electrical power input in kW\n", + "To = 30 \t\t\t\t#in °C\n", + "\n", + "#Calculations:\n", + "Qcv = m*(he-hi)-P \t\t#in kW\n", + "Sgen = m*(se-si)-Qcv/(To+273.2)\t#Rate of entropy generation \n", + "\n", + "#Results:\n", + "print \"Rate of entropy generation for this process: \",round(Sgen,5),'KW/K'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.10" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Efficiency of the turbine: 80.9 %\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 9.10\n", + "''' A steam turbine receives steam at a pressure of 1 MPa and a temperature of 300\n", + "◦C. The steam leaves the turbine at a pressure of 15 kPa. The work output of the turbine is measured\n", + "and is found to be 600 kJ/kg of steam flowing through the turbine. Determine the efficiency\n", + "of the turbine.\n", + "Control volume: Turbine.\n", + "Inlet state: P i , T i known; state fixed.\n", + "Exit state: P e known.\n", + "Process: Steady state.\n", + "Model: Steam tables.'''\n", + "\n", + "#Variable Declaration: \n", + "hi = 3051.2 \t\t#initial specific heat of enthalpy in kJ/kg\n", + "si = 7.1228 \t\t#initial specific entropy in kJ/kg-K\n", + "sf = 0.7548 \t\t#in kJ/kg-K\n", + "sfg = 7.2536 \t\t#in kJ/kg-K\n", + "hf = 225.9 \t\t#in kJ/kg\n", + "hfg = 2373.1 \t\t#in kJ/kg\n", + "wa = 600 \t\t#actual work output of turbine in kJ/kg\n", + "\n", + "#Calculations:\n", + "ses = si \t\t#final specific entropy is same as the initial\n", + "xes = (si-sf)/sfg \t\t#quality of steam when it leaves the turbine\n", + "hes = hf+xes*hfg \t\t#final specific heat of enthalpy in kJ/kg\n", + "ws = hi-hes \t\t#work output of turbine calculated ideally in kJ/kg\n", + "nturbine = wa/ws \t\t#efiiciency of turbine \n", + "\n", + "#Results:\n", + "print \"Efficiency of the turbine: \",round(nturbine*100,1),'%'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.11" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Turbine inlet pressure: 2995.0 Kpa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import e\n", + "#Example: 9.11\n", + "''' Air enters a gas turbine at 1600 K and exits at 100 kPa, 830 K.The turbine efficiency is\n", + "estimated to be 85%. What is the turbine inlet pressure?\n", + "Control volume: Turbine.\n", + "Inlet state: T i known.\n", + "Exit state: P e , T e known; state fixed.\n", + "Process: Steady state.\n", + "Model: Air tables, Table A.7.'''\n", + "\n", + "#Variable Declaration: \n", + "hi = 1757.3 \t\t#initial specific heat of enthalpy of air in kJ/kg\n", + "si = 8.6905 \t\t#initial specifc entropy of airin kJ/kg-K\n", + "he = 855.3 \t\t\t#final specific heat of enthalpy of air in kJ/kg\n", + "n = 0.85 \t\t\t#efficiency of turbine \n", + "Tes = 683.7 \t\t#final temperature in kelvins from air tables\n", + "ses = 7.7148 \t\t#in kJ/kg-K\n", + "R = 0.287 \t\t\t#gas constant in kJ/kg-K\n", + "\n", + "#Calculations:\n", + "w = hi-he \t\t\t#actual work done by turbine in kJ/kg\n", + "ws = w/n \t\t\t#ideal work done by turbine in kJ/kg\n", + "hes = hi-ws \t\t#from first law of isentropic process\n", + "Pi = 100/e**((si-ses)/-R) #turbine inlet pressure in kPa\n", + "\n", + "#Results:\n", + "print \"Turbine inlet pressure: \",round(Pi),'Kpa'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.12" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Required work input: -53.0 KJ/Kg\n", + "Exit temperature: 352.6 K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 9.12\n", + "'''Air enters an automotive supercharger at 100 kPa, 300 K and is compressed to 150 kPa.\n", + "The efficiency is 70%. What is the required work input per kilogram of air? What is the\n", + "exit temperature?\n", + "Control volume: Supercharger (compressor).\n", + "Inlet state: P i , T i known; state fixed.\n", + "Exit state: P e known.\n", + "Process: Steady state.\n", + "Model: Ideal gas, 300 K specific heat, Table A.5.'''\n", + "\n", + "#Variable Declaration: \n", + "Pe = 150 \t\t#final pressure of air in kPa\n", + "Pi = 100 \t\t#initial presure of air in kPa\n", + "k = 1.4\n", + "Ti = 300 \t\t#initial temperature of air in kelvis\n", + "n = 0.7 \t\t#efficiency of automotive supercharger \n", + "\n", + "#Calculations:\n", + "Tes = Ti*(Pe/Pi)**((k-1)/k) \t\t#from second law\n", + "ws = 1.004*(Ti-Tes) \t\t#from first law of isentropic process\n", + "w = ws/n \t\t#real work input in kJ/kg\n", + "Te = Ti-w/1.004 \t\t#temperature at supercharger exit in K\n", + "\n", + "#Results:\n", + "print \"Required work input: \",round(w),'KJ/Kg'\n", + "print \"Exit temperature: \",round(Te,1),'K'" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/Appendix_A.ipynb b/Introduction_to_flight_by_J_D_Anderson/Appendix_A.ipynb new file mode 100644 index 00000000..352d2566 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/Appendix_A.ipynb @@ -0,0 +1,517 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Appendix A" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('Temperature T2 = %.1f K', 556.4270854641527)\n", + "(' Compressor work = %.1f kJ/kg ', 269.2999938060093)\n", + "(' Temperature T3 = %.1f K', 1373.2)\n", + "(' Temperature T4 = %.1f K', 711.24546295203)\n", + "(' Turbine work = %.1f kJ/kg', 664.6023551961619)\n", + "(' Net work = %.1f kJ/kg', 395.30236139015256)\n", + "(' Thermal Efficiency of cycle = %.1f percent', 48.205253207687875)\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 12.1\n", + "''' '''\n", + "\n", + "#Variable Declaration: \n", + "\n", + "\n", + "\t\t#1-Inlet for compressor\n", + "\t\t#2-Exit for compressor\n", + "\t\t#T-Temperature at a state\n", + "\t\t#P-Pressure at a state\n", + "T1 = 288.2\t\t#K\n", + "P2 = 1000\t\t#kPa\n", + "P1 = 100\t\t#kPa\n", + "k = 1.4\n", + "T2 = T1*(P2/P1)**(1-1/k)\t\t#K\n", + "Cp = 1.004\t\t#Specific heat at constant pressure in kJ/kg\n", + "wc = Cp*(T2-T1)\t\t#compressor work in kJ/kg\n", + "print ('Temperature T2 = %.1f K',T2)\n", + "print (' Compressor work = %.1f kJ/kg ',wc)\n", + "\t\t#3-Turbine Inlet\n", + "\t\t#4-Turbine Exit\n", + "P4 = P1\n", + "P3 = P2\n", + "T3 = 1373.2\t\t#K\n", + "T4 = T3*(P4/P3)**(1-1/k)\t\t#K\n", + "wt = Cp*(T3-T4)\n", + "wnet = wt-wc\n", + "print (' Temperature T3 = %.1f K',T3)\n", + "print (' Temperature T4 = %.1f K',T4)\n", + "print (' Turbine work = %.1f kJ/kg',wt)\n", + "print (' Net work = %.1f kJ/kg',wt-wc)\n", + "\t\t#2-Also high temperature heat exchanger Inlet\n", + "\t\t#3-(-do-) Exit\n", + "qh = Cp*(T3-T2)\t\t#Heat of source in kJ/kg\n", + "\t\t#4-high temp heat exchanger inlet\n", + "\t\t#1-(-do-) Exit\n", + "ql = Cp*(T4-T1)\t\t#Heat of sink in kJ/kg\n", + "nth = wnet/qh\n", + "print (' Thermal Efficiency of cycle = %.1f percent',nth*100)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('Temperature T2 = %.1f K', 623.4838568301909)\n", + "(' Compressor work = %.1f kJ/kg ', 336.6249922575117)\n", + "(' Temperature T3 = %.1f K', 1373.2)\n", + "(' Temperature T4 = %.1f K', 810.5386435092256)\n", + "(' Turbine work = %.1f kJ/kg', 564.9120019167375)\n", + "(' Net work = %.1f kJ/kg', 228.28700965922582)\n", + "(' Thermal Efficiency of cycle = %.1f percent', 30.32847854912508)\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 12.2\n", + "''' '''\n", + "\n", + "#Variable Declaration: \n", + "\t\t#Standard brayton cycle\n", + "\n", + "\n", + "\t\t#Calculation mistake in book\n", + "\t\t#1-Inlet for compressor\n", + "\t\t#2-Exit for compressor\n", + "\t\t#T-Temperature at a state\n", + "\t\t#P-Pressure at a state\n", + "T1 = 288.2\t\t#K\n", + "P2 = 1000\t\t#kPa\n", + "P1 = 100\t\t#kPa\n", + "k = 1.4\n", + "T2s = T1*(P2/P1)**(1-1/k)\t\t#K\n", + "nc = .80\t\t#Compressor Efficiency\n", + "T2 = T1+(T2s-T1)/0.80\n", + "Cp = 1.004\t\t#Specific heat at constant pressure in kJ/kg\n", + "wc = Cp*(T2-T1)\t\t#compressor work in kJ/kg\n", + "print ('Temperature T2 = %.1f K',T2)\n", + "print (' Compressor work = %.1f kJ/kg ',wc)\n", + "\t\t#3-Turbine Inlet\n", + "\t\t#4-Turbine Exit\n", + "P4 = P1\n", + "P3 = P2\n", + "T3 = 1373.2\t\t#K\n", + "T4s = T3*(P4/P3)**(1-1/k)\t\t#K\n", + "nt = 0.85\t\t#turbine Efficiency\n", + "T4 = T3-(T3-T4s)*0.85\n", + "wt = Cp*(T3-T4)\n", + "wnet = wt-wc\n", + "print (' Temperature T3 = %.1f K',T3)\n", + "print (' Temperature T4 = %.1f K',T4)\n", + "print (' Turbine work = %.1f kJ/kg',wt)\n", + "print (' Net work = %.1f kJ/kg',wt-wc)\n", + "\t\t#2-Also high temperature heat exchanger Inlet\n", + "\t\t#3-(-do-) Exit\n", + "qh = Cp*(T3-T2)\t\t#Heat of source in kJ/kg\n", + "\t\t#4-high temp heat exchanger inlet\n", + "\t\t#1-(-do-) Exit\n", + "ql = Cp*(T4-T1)\t\t#Heat of sink in kJ/kg\n", + "nth = wnet/qh\n", + "print (' Thermal Efficiency of cycle = %.1f percent',nth*100)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('Thermal efficiency = %.1f percent', 59.42413919202417)\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 12.3\n", + "''' '''\n", + "\n", + "#Variable Declaration: \n", + "\n", + "\n", + "wnet = 395.2\t\t#kJ/kg from example no 1\n", + "\t\t#Tx = T4\n", + "Tx = 710.8\t\t#K from example no 1\n", + "T3 = 1373.2\t\t#K from example no 1\n", + "Cp = 1.004\t\t#specific heat in kJ/kg \n", + "qh = Cp*(T3-Tx)\n", + "nth = wnet/qh\n", + "print ('Thermal efficiency = %.1f percent',nth*100) " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('Isothermal work in compressor = %.1f kJ/kg ', -190.4546418308537)\n", + "(' Isothermal work in turbine = %.1f kJ/kg', 907.4681268637344)\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 12.4\n", + "''' '''\n", + "from math import log\n", + "#Variable Declaration: \n", + "\n", + "\n", + "R = 0.287\t\t#gas constant \n", + "T1 = 288.2\t\t#compressor temperature K\n", + "T2 = 1373.2\t\t#K turbine temperature K\n", + "\t\t#Pe/Pi = c = 10, Pi/Pe = 1/c from example 12.1\n", + "c = 10\n", + "wc = -R*T1*log(c)\n", + "print ('Isothermal work in compressor = %.1f kJ/kg ',wc)\n", + "wt = -R*T2*log(1/c)\n", + "print (' Isothermal work in turbine = %.1f kJ/kg',wt) " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('Velocity of air leaving the nozel = %.0f m/s', 889.4375751001304)\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 12.5\n", + "''' '''\n", + "from math import sqrt\n", + "#Variable Declaration: \n", + "\n", + "\n", + "\t\t#1-compressor inlet\n", + "\t\t#2-Compressor exit\n", + "\t\t#P-Pressure at given point\n", + "\t\t#T-Temperature at given point\n", + "P1 = 100\t\t#kPa\n", + "P2 = 1000\t\t#kPa\n", + "T1 = 288.2\t\t#K\n", + "T2 = 556.8\t\t#K\n", + "wc = 269.5\t\t#from ex 12.1 work done in compressor in kJ/kg\n", + "\t\t#2-Burner inlet\n", + "\t\t#3-Burner exit\n", + "P3 = 1000\t\t#kPa\n", + "T3 = 1373.2\t\t#K\n", + "\t\t#wc = wt\n", + "Cp = 1.004\t\t#specific enthalpy of heat at constant pressure in kJ/kg\n", + "k = 1.4\n", + "T4 = T3-wc/Cp\n", + "P4 = P3*(T4/T3)**(1-1/k)\n", + "\t\t#from s4 = s5 and h4 = h5+v2/2 we get\n", + "T5 = 710.8\t\t#K, from second law\n", + "v = sqrt(2*Cp*1000*(T4-T5))\t\t#m/s\n", + "print ('Velocity of air leaving the nozel = %.0f m/s',v)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('Coefficient of performance = %.3f ', 1.712857850240205)\n", + "(' Rate at which the air enter the compressor = %.3f kg/s ', 0.013985866348928795)\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 12.6\n", + "''' '''\n", + "\n", + "#Variable Declaration: \n", + "\n", + "\n", + "\t\t#1-compressor inlet\n", + "\t\t#2-compressor exit\n", + "P1 = 100\t\t#kPa\n", + "P2 = 500\t\t#kPa\n", + "k = 1.4\n", + "rp = P2/P1\n", + "cop = (rp**(1-1/k)-1)**-1\n", + "print ('Coefficient of performance = %.3f ',cop)\n", + "\t\t#3-Expander inlet\n", + "\t\t#4-Expander exit\n", + "P3 = P2\n", + "P4 = P1\n", + "T3 = 288.23\t\t#K, given and fixed\n", + "T4 = T3/(P3/P4)**(1-1/k)\n", + "T1 = 253.2\t\t#K, given\n", + "Cp = 1.004\t\t#Specific heat at cons pressure in kJ/kg\n", + "ql = Cp*(T1-T4)\t\t#heat released in kJ/kg\n", + "P = 1\t\t#power required in kW \n", + "ms = P/ql\t\t#kg/s\n", + "print (' Rate at which the air enter the compressor = %.3f kg/s ',ms) " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Temperature at compressor exit, T2 = %.1f K 723.925669561\n", + " Pressure at compressor exit, P2 = %.3f MPa 2.51188643151\n", + " Initial Temperature during heat additon process, T3 = %.0f K 3234.38592061\n", + " Initial pressure during heat addition process, P3 = %.3f MPa 11.222713118\n", + " Final temperature during heat addition process, T4 = %.1f K 1287.63222733\n", + " Final pressure during heat addition process, P4 = %.4f MPa 0.446784256534\n", + " Thermal efficiency = %.1f percent 96.0189282945\n", + " Mean effective pressure = %.0f kPa 1455.36957602\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 12.7\n", + "''' '''\n", + "\n", + "#Variable Declaration: \n", + "\n", + "\n", + "\t\t#1-compressor inlet\n", + "\t\t#2-compressor exit\n", + "P1 = 100\t\t#kPa\n", + "T1 = 288.2\t\t#K\n", + "R = 0.287\t\t#gas constant\n", + "v1 = R*T1/P1\t\t#specific volume at inlet in m**3/kg\n", + "rv = 10\t\t#compression ratio given\n", + "k = 1.4\t\t#constant\n", + "T2 = T1*rv**(k-1)\t\t#K\n", + "print 'Temperature at compressor exit, T2 = %.1f K ',T2\n", + "P2 = P1*rv**k\t\t#kPa\n", + "print ' Pressure at compressor exit, P2 = %.3f MPa ',P2/1000\n", + "v2 = v1/rv\t\t#specific heat at exit in m**3/kg\n", + "\t\t#23-heat addition process\n", + "\t\t#q23 = Cv*(T3-T2) = 1800 kJ/kg given\n", + "q23 = 1800\t\t#kJ/kg heat addition, given\n", + "Cv = 0.717\t\t#specific heat at constant volume in kJ/kg\n", + "T3 = T2+q23/Cv\t\t#K\n", + "print ' Initial Temperature during heat additon process, T3 = %.0f K ',T3\n", + "P3 = P2*(T3/T2)\t\t#kPa\n", + "print ' Initial pressure during heat addition process, P3 = %.3f MPa ',P3/1000\n", + "r = 10\t\t#k = V4/V3 = P3/P4\n", + "T4 = T3*(1/r)**(k-1)\n", + "print ' Final temperature during heat addition process, T4 = %.1f K ',T4\n", + "P4 = P3/r**k\t\t#kPa\n", + "print ' Final pressure during heat addition process, P4 = %.4f MPa ',P4/1000\n", + "nth = 1-1/r**k\t\t#thermal efficiency\n", + "print ' Thermal efficiency = %.1f percent ',nth*100\n", + "q41 = Cv*(T1-T4)\t\t#/heat for process 4-1 in kJ/kg\n", + "wnet = q23+q41\n", + "mep = wnet/(v1-v2)\t\t#effective mean pressure n kPa\n", + "print ' Mean effective pressure = %.0f kPa ',mep" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Temperature at compressor exit, T2 = %.1f K 955.225647797\n", + " Pressure at compressor exit, P2 = %.3f MPa 6.62890803468\n", + " Initial Temperature during heat addition process, T3 = %.0f K 2748.05433306\n", + " Final temperature during heat addition process, T4 = %.0f K 1265.26371322\n", + " Thermal efficiency = %.1f percent 61.0802954233\n", + " Mean effective pressure = %.0f kPa 1399.18182622\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 12.8\n", + "''' '''\n", + "\n", + "#Variable Declaration: \n", + "\n", + "\n", + "\t\t#1-compressor inlet\n", + "\t\t#2-compressor exit\n", + "P1 = 100\t\t#kPa\n", + "T1 = 288.2\t\t#K\n", + "R = 0.287\t\t#gas constant\n", + "v1 = R*T1/P1\t\t#specific volume at inlet in m**3/kg\n", + "rv = 20\t\t#compression ratio given\n", + "k = 1.4\t\t#constant\n", + "T2 = T1*rv**(k-1)\t\t#K\n", + "print 'Temperature at compressor exit, T2 = %.1f K ',T2\n", + "P2 = P1*rv**k\t\t#kPa\n", + "print ' Pressure at compressor exit, P2 = %.3f MPa ',P2/1000\n", + "v2 = v1/rv\t\t#specific heat at exit in m**3/kg\n", + "\t\t#23-heat addition process\n", + "\t\t#q23 = Cv*(T3-T2) = 1800 kJ/kg given\n", + "q23 = 1800\t\t#kJ/kg heat addition, given\n", + "Cv = .717\n", + "Cp = 1.004\t\t#specific heat at constant pressure in kJ/kg\n", + "T3 = T2+q23/Cp\t\t#K\n", + "print ' Initial Temperature during heat addition process, T3 = %.0f K ',T3\n", + "r = T3/T2\t\t#T3/T2 = V3/V2 = r\n", + "v3 = r*v2\n", + "T4 = T3/(v1/v3)**(k-1)\n", + "print ' Final temperature during heat addition process, T4 = %.0f K ',T4\n", + "q41 = Cv*(T1-T4)\t\t#/heat for process 4-1 in kJ/kg\n", + "wnet = q23+q41\n", + "mep = wnet/(v1-v2)\t\t#effective mean pressure in kPa\n", + "qh = 1800\t\t#heat transfer in kJ/kg\n", + "nth = wnet/qh\t\t#thermal efficiency\n", + "\n", + "print ' Thermal efficiency = %.1f percent ',nth*100\n", + "print ' Mean effective pressure = %.0f kPa ',mep" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/Appendix_B.ipynb b/Introduction_to_flight_by_J_D_Anderson/Appendix_B.ipynb new file mode 100644 index 00000000..283ba0a6 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/Appendix_B.ipynb @@ -0,0 +1,290 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Appendix B" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mass of vapour: 2.77 Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 13.3\n", + "'''Consider 100 m 3 of an air–water vapor mixture at 0.1 MPa, 35◦C, and 70% relative\n", + "humidity. Calculate the humidity ratio, dew point, mass of air, and mass of vapor.'''\n", + "\n", + "#Variable Declaration: \n", + "r = 0.70\t\t\t#relative humidity\n", + "Pg = 5.628\t\t\t#saturation pressure in kPa\n", + "P = 100\t\t\t\t#net pressure kPa \n", + "V = 100\t\t\t\t#volume in m**3\n", + "Ra = 0.287\t\t\t#gas constant for water vapour\n", + "T = 308.2\t\t\t#Temperature in K\n", + "\n", + "#Calculations:\n", + "Pv = r*Pg\t\t\t#vapour pressure in kPa\n", + "Pa = P-Pv\t\t\t#Partial pressure of air\n", + "w = 0.622*Pv/Pa\t\t#humidity ratio formula\n", + "ma = Pa*V/(Ra*T)\t#mass in kg\n", + "mv = w*ma\t\t\t#mass of vapour\n", + "\n", + "#Results:\n", + "print 'Mass of vapour: ', round(mv,2),'Kg'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mass of vapour condense 2.175 Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 13.4\n", + "'''Calculate the amount of water vapor condensed if the mixture of Example 13.3 is cooled\n", + "to 5◦C in a constant-pressure process.'''\n", + "\n", + "#Variable Declaration: \n", + "w1 = 0.0255\t\t#w1 = w, humidity ratio at initial temperature\n", + "ma = 108.6\t\t#mass of air in kg\n", + "P = 100\t\t\t#kPa net pressure\n", + "Pg2 = 0.8721\n", + "\n", + "#Calculations:\n", + "Pv2 = Pg2\n", + "w2 = 0.622*Pv2/(P-Pg2)\n", + "mc = ma*(w1-w2)\n", + "\n", + "#Results:\n", + "print 'Mass of vapour condense',round(mc,3) ,'Kg'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Heat transferred per unit mass: -41.65 kJ/kg of dry air\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 13.5\n", + "''' An air-conditioning unit is shown in Fig. 13.5, with pressure, temperature, and relative\n", + "humidity data. Calculate the heat transfer per kilogram of dry air, assuming that changes\n", + "in kinetic energy are negligible.'''\n", + "\n", + "#Variable Declaration: \n", + "r1 = 0.80\t\t\t\t#realtive humidity at state 1\n", + "Pg1 = 4.246\t\t\t\t#saturation pressure of vapour in kPa\n", + "P1 = 105\t\t\t\t#net pressure at state 1 in kPa\n", + "P2 = 100\t\t\t\t#net pressure at state 2 in kPa\n", + "r2 = 0.95\t\t\t\t#relative humidity at state 2\n", + "Pg2 = 1.7051\t\t\t#saturation pressure of vapour in kPa\n", + "T1 = 30\t\t\t\t\t#C\n", + "T2 = 15\t\t\t\t\t#C\n", + "Cp = 1.004\t\t\t\t#specific heat of water vapour in kJ/kg\n", + "hv2 = 2528.9\t\t\t#enthalpy of vapourisation of vapour in kJ/kg\n", + "hv1 = 2556.3\t\t\t#enthalpy of vapourisation of vapour in kJ/kg\n", + "hl2 = 62.99\t\t\t\n", + "\n", + "#Calculations:\n", + "Pv1 = r1*Pg1\t\t\t#partial pressure of vapour in kPa\n", + "w1 = 0.622*Pv1/(P1-Pv1)\t#humidity ratio at state 1\n", + "Pv2 = r2*Pg2\t\t\t#partial pressure of vapour in kPa\n", + "w2 = 0.622*Pv2/(P2-Pv2)\t#humidity ratio at state 2\n", + "q = Cp*(T2-T1)+w2*hv2-w1*hv1+hl2*(w1-w2)\t\t#kJ/kg\n", + "\n", + "#Results:\n", + "print 'Heat transferred per unit mass: ',round(q,2),' kJ/kg of dry air'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Heat transferred -339.1 kJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 13.6\n", + "''' A tank has a volume of 0.5 m 3 and contains nitrogen and water vapor. The temperature\n", + "of the mixture is 50◦C, and the total pressure is 2 MPa. The partial pressure of the water\n", + "vapor is 5 kPa. Calculate the heat transfer when the contents of the tank are cooled to\n", + "10◦C.'''\n", + "\n", + "#Variable Declaration: \n", + "Pn2 = 1995\t\t\t\t#Pressure of nitrogen in kPa\n", + "V = 0.5\t\t\t\t\t#Volume in m**3\n", + "Rn2 = 0.2968\t\t\t#Gas constant for nitrogen in kJ/kg.K\n", + "Rv = 0.4615\t\t\t\t#gas constant for vapour\n", + "T1 = 323.2\t\t\t\t#Temperature in K\n", + "T2 = 283.2\t\t\t\t#Temperature in K\n", + "Pv1 = 5\t\t\t\t\t#Pressure of water vapour in kPa at state 1\n", + "Pv2 = 1.2276\t\t\t#Pressure of water vapour in kPa at state 2\n", + "uv1 = 2443.1\t\t\t#specific internal energy of vapour in kJ/kg at state 1\n", + "uv2 = 2389.2\t\t\t#specific internal energy of vapour in kJ/kg at state 2\n", + "ul2 = 42.0\t\t\t\t#specific internal energy of liquid water in kJ/kg\n", + "Cv = 0.745\t\t\t\t#specific heat at constant volume in kJ/kg.K\n", + "\n", + "#Calculations:\n", + "mn2 = Pn2*V/(Rn2*T1)\t#mass of nitrogen\n", + "mv1 = Pv1*V/(Rv*T1)\t\t#mass of vapour in kg\n", + "mv2 = Pv2*V/(Rv*T2)\t\t#mass of vapour in kg\n", + "ml2 = mv1-mv2\t\t\t#mass of liquid condensed n kg\n", + "Q = mn2*Cv*(T2-T1)+mv2*uv2+ml2*ul2-mv1*uv1\n", + "\n", + "#Results:\n", + "print 'Heat transferred',round(Q,1),'kJ'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Relative humidity: 0.0107\n", + "Humidity ratio: 0.399\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 13.7\n", + "'''The pressure of the mixture entering and leaving the adiabatic saturator is 0.1 MPa, the\n", + "entering temperature is 30◦C, and the temperature leaving is 20◦C, which is the adiabatic\n", + "saturation temperature. Calculate the humidity ratio and relative humidity of the air–water\n", + "vapor mixture entering.'''\n", + "\n", + "#Variable Declaration: \n", + "P = 100\t\t\t\t#net pressure n kPa \n", + "Pg2 = 2.339\t\t\t#saturation pressure of vapour in kPa\n", + "Cpa = 1.004\t\t\t#specific heat n kJ/kg/K\n", + "T2 = 20\t\t\t\t#final temp in C\n", + "T1 = 30\t\t\t\t#initial temp in C\n", + "Hfg2 = 2454.1\t\t#specific heat difference at state 2 in kJ/kg\n", + "hv1 = 2556.3\t\t#enthalpy of water vapour at state 1 in kJ/kg\n", + "hl2 = 83.96\t\t\t#enthalpy of liquid water in kJ/kg\n", + "Pg1 = 4.246\t\t\t#saturation pressure at state 1 in kPa\n", + "\n", + "#Calculations:\n", + "Pv2 = Pg2\t\t\t#partial pressure of vapour\n", + "w2 = 0.622*Pv2/(P-Pg2)\n", + "w1 = (Cpa*(T2-T1)+w2*Hfg2)/(hv1-hl2)\n", + "Pv1 = 100*w1/(0.622+w1)\n", + "r = Pv1/Pg1\t\t\t#humidity ratio\n", + "\n", + "#Results:\n", + "print 'Relative humidity: ',round(w1,4)\n", + "print 'Humidity ratio: ',round(r,3)" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/Appendix_C.ipynb b/Introduction_to_flight_by_J_D_Anderson/Appendix_C.ipynb new file mode 100644 index 00000000..d2f0522f --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/Appendix_C.ipynb @@ -0,0 +1,352 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Appendix C" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sublimation Pressure: 0.00109 KPa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import exp\n", + "#Example: 14.1\n", + "'''Determine the sublimation pressure of water vapor at −60◦C using data available in the\n", + "steam tables.\n", + "Control mass: Water.'''\n", + "\n", + "#Variable Declaration: \n", + "#from table in appendix B.1.5\n", + "T1 = 213.2\t\t\t#K, Temperature at state 1\n", + "P2 = 0.0129\t\t\t#kPa, pressure at state 2\n", + "T2 = 233.2\t\t\t#K, Temperature at state 2\n", + "hig = 2838.9\t\t#kJ/kg, enthalpy of sublimation \n", + "R = .46152\t\t\t#Gas constant \n", + "\n", + "#Calculations:\n", + "P1 = P2*exp(-hig/R*(1/T1-1/T2)) #using relation log(P2/P1) = (hig/R)*(1/T1-1/T2) \n", + "\n", + "#Results:\n", + "print 'Sublimation Pressure: ',round(P1,5),'KPa'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in internal energy: -159.4 J/Kg\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 14.4\n", + "'''The pressure on a block of copper having a mass of 1 kg is increased in a reversible process\n", + "from 0.1 to 100 MPa while the temperature is held constant at 15◦C. Determine the work\n", + "done on the copper during this process, the change in entropy per kilogram of copper, the\n", + "heat transfer, and the change of internal energy per kilogram.\n", + "Over the range of pressure and temperature in this problem, the following data can\n", + "be used:\n", + "Volume expansivity = αP = 5.0 × 10−5 K−1\n", + "Isothermal compressibility = βT = 8.6 × 10−12 m2/N\n", + "Specific volume = 0.000 114 m3/kg'''\n", + "\n", + "#Variable Declaration: \n", + "#known data\n", + "ap = 5*10**-5\t\t\t\t#K**-1 Volume expansivity\n", + "bt = 8.6*10**-12\t\t\t#m**2/N, Isothermal compressibility\n", + "v = 0.000114\t\t\t\t#m**3/kg, specific volume\n", + "P2 = 100*10**6\t\t\t\t#pressure at state 2 in kPa\n", + "P1 = 100\t\t\t\t\t#pressure at state 1 in kPa\n", + "T = 288.2\t\t\t\t\t#Temperature in K\n", + "\n", + "#Calculations:\n", + "w = -v*bt*(P2**2-P1**2)/2\t#work done in J/kg\n", + "q = -T*v*ap*(P2-P1)\t\t\t#heat in J/kg\n", + "du = q-w\t\t\t\t\t#change in internal energy in J/kg\n", + "\n", + "#Results:\n", + "print 'Change in internal energy: ',round(du,1),'J/Kg'\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enthalpy change: 18.73 KJ/Kg\n", + "Temperature : 146.0 K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 14.5\n", + "'''Nitrogen is throttled from 20 MPa, −70◦C, to 2 MPa in an adiabatic, steady-state, steadyflow\n", + "process. Determine the final temperature of the nitrogen.\n", + "Control volume:\n", + "Inlet state:\n", + "Exit state:\n", + "Process:\n", + "Diagram:\n", + "Model:\n", + "Throttling valve.\n", + "P1, T1 known; state fixed.\n", + "P2 known.\n", + "Steady-state, throttling process.\n", + "Figure 14.8.\n", + "Generalized charts, Fig. D.2.'''\n", + "\n", + "#Variable Declaration: \n", + "#from table A.2\n", + "P1 = 20\t\t#pressure at state 1 in MPa\n", + "P2 = 2\t\t#pressure at state 2 in MPa\n", + "T1 = 203.2\t\t#Temperature at state 1 in K\n", + "Pr1 = P1/3.39\t\t#Reduced pressure at state 1\n", + "Pr2 = P2/3.39\t\t#Reduced pressure at state 2\n", + "Tr1 = T1/126.2\t\t#Reduced temperature\n", + "#from compressibility chart h1*-h1 = 2.1*R*Tc\n", + "#from zero pressure specific heat data h1*-h2* = Cp*(T1a-T2a)\n", + "#h2*-h2 = 0.5*R*Tc\n", + "#this gives dh = h1-h2 = -2.1*R*Tc+Cp*(T1a-T2a)+0.5*R*Tc\n", + "R = 0.2968\t\t#gas constant for given substance\n", + "Tc = 126.2\t\t#K, Constant temperature\n", + "Cp = 1.0416\t\t#heat enthalpy at constant pressure in kJ/kg\n", + "T2 = 146\t\t#temperature at state 2\n", + "\n", + "#Calculations:\n", + "dh = 0.5*R*Tc#\n", + "\n", + "#Results:\n", + "print 'Enthalpy change: ',round(dh,2),'KJ/Kg'\n", + "print 'Temperature :',round(T2,2),'K' " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enthalpy change: 61.98 kJ/kg\n", + "Entropy Change: 1.0782 kJ/kg.K\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import log\n", + "\n", + "#Example: 14.6\n", + "'''Nitrogen at 8 MPa, 150 K, is throttled to 0.5 MPa. After the gas passes through a short\n", + "length of pipe, its temperature is measured and found to be 125 K. Determine the heat\n", + "transfer and the change of entropy using the generalized charts. Compare these results\n", + "with those obtained by using the nitrogen tables.\n", + "Control volume:\n", + "Inlet state:\n", + "Exit state:\n", + "Process:\n", + "Diagram:\n", + "Model:\n", + "Throttle and pipe.\n", + "P1, T1 known; state fixed.\n", + "P2, T2 known; state fixed.\n", + "Steady state.\n", + "Figure 14.10.\n", + "Generalized charts, results to be compared with those\n", + "obtained with nitrogen tables.'''\n", + "\n", + "#Variable Declaration: \n", + "#from table A.2\n", + "P1 = 8\t\t\t\t\t#pressure at state 1 in MPa\n", + "P2 = 0.5\t\t\t\t#pressure at state 2 in MPa\n", + "T1 = 150\t\t\t\t#Temperature at state 1 in K\n", + "Pr1 = P1/3.39\t\t\t#Reduced pressure at state 1\n", + "Pr2 = P2/3.39\t\t\t#Reduced pressure at state 2\n", + "Tr1 = T1/126.2\t\t\t#Reduced temperature\n", + "T2 = 125\t\t\t\t#Temperature at state 2\n", + "R = 0.2968\t\t\t\t#gas constant for given substance\n", + "Tc = 126.2\t\t\t\t#K, Constant temperature\n", + "Cp = 1.0416\t\t\t\t#Heat enthalpy at constant pressure in kJ/kg\n", + "\n", + "#Calculations:\n", + "dh = (2.35)*R*Tc+Cp*(T2-T1)\t\t#\n", + "ds = 1.6*R-0.1*R+Cp*log(T2/T1)-R*log(P2/P1)\n", + "\n", + "#Results:\n", + "print 'Enthalpy change: ',round(dh,2),'kJ/kg'\n", + "print 'Entropy Change: ',round(ds,4),'kJ/kg.K'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Percentage deviation in specific volume using Kays rule: 4.8 %\n", + "Percentage deviation in specific volume using vander waals eqn: 6.4 %\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import sqrt\n", + "#Example: 14.7\n", + "'''A mixture of 80% CO2 and 20% CH4 (mass basis) is maintained at 310.94 K, 86.19 bar,\n", + "at which condition the specific volume has been measured as 0.006757 m3/kg. Calculate\n", + "the percent deviation if the specific volume had been calculated by (a) Kay’s rule and (b)\n", + "van der Waals’ equation of state.\n", + "Control mass:\n", + "State:\n", + "Model:\n", + "Gas mixture.\n", + "P, v, T known.\n", + "(a) Kay’s rule. (b) van der Waals’ equation.'''\n", + "#Keys:\n", + "#a-denotes C02\n", + "#b-denotes CH4\n", + "#c-denotes critical conditions\n", + "\n", + "#Variable Declaration: \n", + "T = 310.94\t\t\t\t#Temperature of mixture K\n", + "P = 86.19\t\t\t\t#Pressure of mixture in MPa\n", + "Tca = 304.1\t\t\t\t#K\n", + "Tcb = 190.4\t\t\t\t#K\n", + "Pca = 7.38\t\t\t\t#MPa\n", + "Pcb = 4.60\t\t\t\t#MPa\n", + "Ra = 0.1889\t\t\t\t#gas constant for a in kJ/kg.K\n", + "Rb = 0.5183\t\t\t\t#gas constant for b in kJ/kg.K\n", + "xa = 0.8\t\t\t\t#fraction of CO2\n", + "xb = 0.2\t\t\t\t#fraction of CH4\n", + "Ma = 44.01\t\t\t\t#molecular mass of a\n", + "Mb = 16.043\t\t\t\t#molecular mass of b\n", + "Zm = 0.7\t\t\t\t#Compressiblity from generalised compressibility chart\n", + "ve = 0.0006757\t\t\t#experimental specific volume in m**3/kg\n", + "\n", + "#Calculations:\n", + "Rm = xa*Ra+xb*Rb\t\t#mean gas constant in kJ/kg.K\n", + "ya = xa/Ma/(xa/Ma+xb/Mb)#mole fraction of a\n", + "yb = xb/Mb/(xa/Ma+xb/Mb)#mole fraction of b\n", + "Tcm = ya*Tca+yb*Tcb\t\t#mean critical temp in K\n", + "Pcm = ya*Pca+yb*Tcb\t\t#mean critical pressure n MPa\n", + "Trm = T/Tcm\n", + "Prm = P/Pcm\n", + "vc = Zm*Rm*T/P/1000\t\t#specific volume calculated in m**3/kg\n", + "pd1 = (ve-vc)/ve*100\t#percent deviation\n", + "Aa = 27*Ra**2*Tca**2/(64*Pca*1000)\n", + "Ba = Ra*Tca/(8*Pca*1000)\n", + "Ab = 27*Rb**2*Tcb**2/(64*Pcb*1000)\n", + "Bb = Rb*Tcb/(8*Pcb*1000)\n", + "Am = (xa*sqrt(Aa)+xb*sqrt(Ab))**2\n", + "Bm = (xa*Ba+xb*Bb)\n", + "vc = 0.0006326\t\t\t#calculated specific volume in m**3/kg\n", + "pd2 = (ve-vc)/ve*100\n", + "\n", + "#Results:\n", + "print 'Percentage deviation in specific volume using Kays rule: ',round(pd1,1),'%'\n", + "print 'Percentage deviation in specific volume using vander waals eqn: ',round(pd2,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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb b/Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb new file mode 100644 index 00000000..91a87652 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb @@ -0,0 +1,125 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Appendix D" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in gibbs free energy at 298K : 457.179 KJ\n", + "Change in gibbs free energy at 298K : 271.04 KJ\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 16.2\n", + "'''Determine the value of \u0002G0 for the reaction 2H2O \u0003\u0004 2H2 + O2 at 25◦C and at 2000 K,\n", + "with the water in the gaseous phase.'''\n", + "\n", + "#Keys:\n", + "#1-H2\n", + "#2-O2\n", + "#3-H2O\n", + "\n", + "#Variable Declaration: \n", + "def dG(T1,Hf1,Hf2,Hf3,Sf1,Sf2,sf3):\n", + "\tdH = 2*Hf1+Hf2-2*Hf3\t#Change in enthalpy in kJ\n", + "\tdS = 2*Sf1+Sf2-2*sf3 \t#Change in entropy in J/K\n", + "\tdG = dH-T1*dS/1000\t#change n gibbs free energy in kJ\n", + "\treturn dG\n", + "\n", + "#Results:\n", + "print 'Change in gibbs free energy at 298K :',round(dG(298,0, 0, -241.826, 130.678,205.148,188.834),3),\"KJ\"\n", + "print 'Change in gibbs free energy at 298K :',round(dG(2000,52.942, 59.176, -241.826+72.788,188.419,268.748,264.769),3),\"KJ\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Equilibrium constant at 298K: -184.51\n", + "Equilibrium constant at 2000K: -16.299\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 16.3\n", + "'''Determine the equilibrium constant K, expressed as ln K, for the reaction 2H2O <--->\n", + "2H2 + O2 at 25◦C and at 2000 K.'''\n", + "\n", + "#Variable Declaration: \n", + "dG1 = -457.166\t\t\t#change in gibbs free energy at temp 298 K from example2 in kJ\n", + "dG2 = -271.040\t\t\t#change in gibbs free energy at temp 2000 K from example2 n kJ\n", + "T1 = 298\t\t\t\t#K\n", + "T2 = 2000\t\t\t\t#K\n", + "R = 8.3145\t\t\t\t#gas constant\n", + "\n", + "#Calculations:\n", + "K1 = dG1*1000/(R*T1)\n", + "K2 = dG2*1000/(R*T2)\n", + "\n", + "#Results:\n", + "print 'Equilibrium constant at 298K: ',round(K1,2)\n", + "print 'Equilibrium constant at 2000K: ',round(K2,3)" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/Appendix_E.ipynb b/Introduction_to_flight_by_J_D_Anderson/Appendix_E.ipynb new file mode 100644 index 00000000..f6035999 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/Appendix_E.ipynb @@ -0,0 +1,421 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Appendix E" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Stagnation Temperature: 319.9 K\n", + "Stagnation Pressure: 187.9 KPa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 17.1\n", + "'''Air flows in a duct at a pressure of 150 kPa with a velocity of 200 m/s. The temperature\n", + "of the air is 300 K. Determine the isentropic stagnation pressure and temperature.'''\n", + "\n", + "#Variable Declaration: \n", + "T = 300\t\t\t\t\t#Temperature of air in K\n", + "P = 150\t\t\t\t\t#Pressure of air in kPa\n", + "v = 200\t\t\t\t\t#velocity of air flow n m/s\n", + "Cp = 1.004\t\t\t\t#specific heat at constant pressure in kJ/kg\n", + "\n", + "#Calculations:\n", + "To = v**2/(2000*Cp)+T\t#stagnation temperature in K\n", + "k = 1.4\t\t \t\t#constant\n", + "Po = P*(To/T)**(k/(k-1))#stagnation pressure in kPa\n", + "\n", + "#Results:\n", + "print 'Stagnation Temperature: ',round(To,1),'K'\n", + "print 'Stagnation Pressure:',round(Po,1),'KPa'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Thrust acting in x direction: 10.68 KN\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 17.3\n", + "'''A jet engine is being tested on a test stand (Fig. 17.5). The inlet area to the compressor is\n", + "0.2 m2, and air enters the compressor at 95 kPa, 100 m/s. The pressure of the atmosphere\n", + "is 100 kPa. The exit area of the engine is 0.1 m2, and the products of combustion leave the\n", + "exit plane at a pressure of 125 kPa and a velocity of 450 m/s. The air–fuel ratio is 50 kg\n", + "air/kg fuel, and the fuel enters with a low velocity. The rate of air flow entering the engine\n", + "is 20 kg/s. Determine the thrust, Rx, on the engine.'''\n", + "\n", + "#Keys\n", + "#i = inlet\n", + "#e = exit\n", + "\n", + "#Variable Declaration: \n", + "#using momentum equation on control surface in x direction\n", + "me = 20.4\t\t#mass exiting in kg\n", + "mi = 20\t\t\t#mass entering in kg\n", + "ve = 450\t\t#exit velocity in m/s\n", + "vi = 100\t\t#exit velocity in m/s\n", + "Pi = 95\t\t\t#Pressure at inlet in kPa\n", + "Pe = 125\t\t#Pressure at exit in kPa\n", + "Po = 100\t\t#surrounding pressure in kPa\n", + "Ai = 0.2\t\t#inlet area in m**2\n", + "Ae = 0.1\t\t#exit area in m**2\n", + "\n", + "#Calculations:\n", + "Rx = (me*ve-mi*vi)/1000-(Pi-Po)*Ai+(Pe-Po)*Ae\t\t#thrust in x direction in kN\n", + "\n", + "#Results:\n", + "print 'Thrust acting in x direction: ',Rx,'KN' " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Speed of sound at 300K: 347.2 m/s\n", + "Speed of sound at 1000K: 633.9 m/s\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import sqrt\n", + "#Example: 17.5\n", + "'''Determine the velocity of sound in air at 300 K and at 1000 K.'''\n", + "\n", + "#Variable Declaration: \n", + "k = 1.4\t\t\t#constant\n", + "R = 0.287\t\t#gas constant\n", + "#At 300K\n", + "T1 = 300\t\t#K\n", + "T2 = 1000\t\t#K\n", + "\n", + "#Calculations:\n", + "c1 = sqrt(k*R*T1*1000)\n", + "c2 = sqrt(k*R*T2*1000)\n", + "\n", + "#Results:\n", + "print 'Speed of sound at 300K: ',round(c1,1),'m/s'\n", + "print 'Speed of sound at 1000K: ',round(c2,1),'m/s'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mass flow rate at the throat section: 1.0646 Kg/s\n", + "Mass flow rate at the exit section: 0.8711 Kg/s\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import sqrt\n", + "#Example: 17.6\n", + "'''A convergent nozzle has an exit area of 500 mm2. Air enters the nozzle with a stagnation\n", + "pressure of 1000 kPa and a stagnation temperature of 360 K. Determine the mass rate of\n", + "flow for back pressures of 800 kPa, 528 kPa, and 300 kPa, assuming isentropic flow'''\n", + "\n", + "#Variable Declaration: \n", + "k = 1.4\t\t\t\t#constant\n", + "R = 0.287\t\t\t#gas constant\n", + "To = 360\t\t\t#stagnation Temperature in K \n", + "P = 528\t\t\t\t#stagnation pressure in kPa\n", + "A = 500*10**-6\t\t#area in m**2\n", + "Me = 0.573\t\t\t#Mach number\n", + "Pe = 800\t\t\t#exit pressure in kPa\n", + "\n", + "#Calculations:\n", + "T = To*0.8333\t\t#Temperature of air in K, 0.8333 stagnation ratio from table\n", + "v = sqrt(k*R*T*1000)#velocity in m/s\n", + "d = P/(R*T)\t\t\t#stagnation density in kg/m**3\n", + "ms = d*A*v\t\t\t#mass flow rate in kg/s\n", + "Te = To*0.9381\t\t#exit temperature in K, ratio from table\n", + "ce = sqrt(k*R*Te*1000)#exit velocity of sound in m/s\n", + "ve = Me*ce\n", + "de = Pe/R/Te\n", + "mse = de*A*ve\n", + "\n", + "#Results:\n", + "print 'Mass flow rate at the throat section: ',round(ms,4),'Kg/s'\n", + "print 'Mass flow rate at the exit section: ',round(mse,4),'Kg/s'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "__When diverging section act as a nozzle__\n", + "Exit pressure: 93.9 Kpa\n", + "Exit Temperature: 183.2 K\n", + "Exit velocity: 596.1 m/s\n", + "__When diverging section act as a diffuser__\n", + "Exit pressure: 93.6 Kpa\n", + "Exit Temperature: 353.2 K\n", + "Exit velocity: 116.0 m/s\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "from math import sqrt\n", + "#Example: 17.7\n", + "'''A converging-diverging nozzle has an exit area to throat area ratio of 2. Air enters this\n", + "nozzle with a stagnation pressure of 1000 kPa and a stagnation temperature of 360 K. The\n", + "throat area is 500 mm2. Determine the mass rate of flow, exit pressure, exit temperature,\n", + "exit Mach number, and exit velocity for the following conditions:\n", + "a. Sonic velocity at the throat, diverging section acting as a nozzle.\n", + "(Corresponds to point d in Fig. 17.13.)\n", + "b. Sonic velocity at the throat, diverging section acting as a diffuser.\n", + "(Corresponds to point c in Fig. 17.13.)'''\n", + "\n", + "#Variable Declaration: \n", + "Po = 1000\t\t \t#stagnation pressure in kPa\n", + "To = 360\t\t \t#stagnation temperature in K\n", + "#when diverging section acting as nozzle\n", + "Pe1 = 0.0939*Po\t\t\t#exit pressure of air in kPa\n", + "Te1 = 0.5089*To\t\t\t#exit temperature in K\n", + "k = 1.4\t\t \t\t#constant\n", + "R = 0.287\t\t \t#gas constant for air\n", + "Me = 2.197\t\t \t#mach number from table\n", + "#when diverging section act as diffuser\n", + "Me2 = 0.308\n", + "Pe2 = 0.0936*Po\t\t#exit pressure of air in kPa\n", + "Te2 = 0.9812*To\t\t#exit temperature in K\n", + "\n", + "#Calculations:\n", + "ce = sqrt(k*R*Te1*1000)\t#velocity of sound in exit section in m/s\n", + "ve1 = Me*ce\t\t\t\t#velocity of air at exit section in m/s\n", + "ce = sqrt(k*R*Te2*1000)\t\t#velocity of sound in exit section in m/s\n", + "ve2 = Me2*ce\n", + "\n", + "#Results:\n", + "print '__When diverging section act as a nozzle__'\n", + "print 'Exit pressure: ',round(Pe1,1),\"Kpa\"\n", + "print 'Exit Temperature: ',round(Te1,1),\"K\"\n", + "print 'Exit velocity: ',round(ve1,1),\"m/s\"\n", + "print '__When diverging section act as a diffuser__'\n", + "print 'Exit pressure: ',round(Pe2,1),\"Kpa\"\n", + "print 'Exit Temperature: ',round(Te2,1),\"K\"\n", + "print 'Exit velocity: ',round(ve2,1),\"m/s\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Static Pressure in downstream: 512.7 Kpa\n", + "Static Temperature in downstream: 339.7 K\n", + "Stagnation Pressure in downstream: 630.0 Kpa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 17.8\n", + "'''Consider the convergent-divergent nozzle of Example 17.7, in which the diverging section\n", + "acts as a supersonic nozzle (Fig. 17.16). Assume that a normal shock stands in the exit\n", + "plane of the nozzle. Determine the static pressure and temperature and the stagnation\n", + "pressure just downstream of the normal shock.'''\n", + "\n", + "#Variable Declaration:\n", + "Px = 93.9 \t\t\t#Static Pressure in Upstream(Kpa)\n", + "Tx = 183.2 \t\t\t#Static Temperature in Upstream(K)\n", + "Pox = 1000\t\t\t#Total Pressure in Upstream(Kpa)\n", + "Mx = 2.197\t\t\t#X-direction Mach No (Using table A.13)\n", + "My = 0.547\t\t\t#Y-direction Mach No (Using table A.13)\n", + "rP = 5.46\t\t\t#Py/Px (Using table A.13)\n", + "rT = 1.854\t\t\t#Ty/Tx (Using table A.13)\n", + "rPo = 0.63\t\t\t#Poy/Pox (Using table A.13)\n", + "\n", + "#Calculations:\n", + "Py = rP*Px\n", + "Ty = rT*Tx\n", + "Poy = rPo*Pox\n", + "\n", + "#Results:\n", + "print 'Static Pressure in downstream: ',round(Py,1),'Kpa'\n", + "print 'Static Temperature in downstream: ',round(Ty,1),'K'\n", + "print 'Stagnation Pressure in downstream: ',round(Poy,1),'Kpa'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Exit pressure: 669.6 Kpa\n", + "Exit temperature: 327.8 K\n", + "Exit stagnation pressure: 929.8 Kpa\n" + ] + } + ], + "source": [ + "# -*- coding: utf8 -*-\n", + "from __future__ import division\n", + "#Example: 17.9\n", + "'''Consider the convergent-divergent nozzle of Examples 17.7 and 17.8. Assume that there\n", + "is a normal shock wave standing at the point where M = 1.5. Determine the exit-plane\n", + "pressure, temperature, and Mach number. Assume isentropic flow except for the normal\n", + "shock (Fig. 17.18).'''\n", + "\n", + "#Key\n", + "#x = inlet\n", + "#y = exit\n", + "\n", + "#Variable Declaration: \n", + "Mx = 1.5\t\t\t\t#mach number for inlet\n", + "My = 0.7011\t\t\t\t#mach number for exit\n", + "Px = 272.4\t\t\t\t#inlet pressure in kPa\n", + "Tx = 248.3\t\t\t\t#inlet temperature in K\n", + "Pox = 1000\t\t\t\t#stagnation pressure for inlet\n", + "\n", + "#Calculations:\n", + "Py = 2.4583*Px\t\t\t#Exit Pressure in kPa\n", + "Ty = 1.320*Tx\t\t\t#Exit temperature in K\n", + "Poy = 0.9298*Pox\t\t#Exit pressure in kPa\n", + "\n", + "#Results:\n", + "print 'Exit pressure: ',round(Py,1),\"Kpa\"\n", + "print 'Exit temperature: ',round(Ty,1),\"K\"\n", + "print 'Exit stagnation pressure: ',round(Poy,1),\"Kpa\"" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Introduction_to_flight_by_J_D_Anderson/README.txt b/Introduction_to_flight_by_J_D_Anderson/README.txt new file mode 100644 index 00000000..990e4f2c --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/README.txt @@ -0,0 +1,10 @@ +Contributed By: Jay Chakra +Course: btech +College/Institute/Organization: IITB +Department/Designation: Aerospace +Book Title: Introduction to flight +Author: J D Anderson +Publisher: McGraw-Hill; 6th edition (February 1, 2008) +Year of publication: 2008 +Isbn: 978-0071263184 +Edition: 6
\ No newline at end of file diff --git a/Introduction_to_flight_by_J_D_Anderson/screenshots/1.png b/Introduction_to_flight_by_J_D_Anderson/screenshots/1.png Binary files differnew file mode 100644 index 00000000..d0a79efb --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/screenshots/1.png diff --git a/Introduction_to_flight_by_J_D_Anderson/screenshots/2.png b/Introduction_to_flight_by_J_D_Anderson/screenshots/2.png Binary files differnew file mode 100644 index 00000000..5ff8cc76 --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/screenshots/2.png diff --git a/Introduction_to_flight_by_J_D_Anderson/screenshots/3.png b/Introduction_to_flight_by_J_D_Anderson/screenshots/3.png Binary files differnew file mode 100644 index 00000000..48f6447a --- /dev/null +++ b/Introduction_to_flight_by_J_D_Anderson/screenshots/3.png |