summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_F_P_Durham/chapter5.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Thermodynamics_by_F_P_Durham/chapter5.ipynb')
-rwxr-xr-xThermodynamics_by_F_P_Durham/chapter5.ipynb171
1 files changed, 171 insertions, 0 deletions
diff --git a/Thermodynamics_by_F_P_Durham/chapter5.ipynb b/Thermodynamics_by_F_P_Durham/chapter5.ipynb
new file mode 100755
index 00000000..bf944c6e
--- /dev/null
+++ b/Thermodynamics_by_F_P_Durham/chapter5.ipynb
@@ -0,0 +1,171 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:080ddee320ed2e8325a1bba2bf7e96e362906d7bc4b7f00bae6953ceccc830a0"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: The Second Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1, page no. 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#initilisation\n",
+ "Tr = 540.0 #R\n",
+ "Te = 2000.0 #R\n",
+ "m = 200.0 #B/lbm\n",
+ "\n",
+ "#calculation\n",
+ "eta = 1-(Tr/Te)\n",
+ "Qr = m*(1-eta)\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print \"Thermal efficiency is \", eta*100, \"%\"\n",
+ "print \"Heat rejected = %d B/lbm\" %Qr"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal efficiency is 73.0 %\n",
+ "Heat rejected = 54 B/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2, page no. 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#initilisation\n",
+ "cv=0.171 #B/lbm F\n",
+ "T2=580 #F\n",
+ "T1=520 #F\n",
+ "\n",
+ "#calculation\n",
+ "def fun(T):\n",
+ " cp=cv/T\n",
+ " return cp\n",
+ "\n",
+ "ds = scipy.integrate.quadrature(fun, T1, T2)[0]\n",
+ "\n",
+ "#result\n",
+ "print \"Change in entropy = %.4f B/lbm R\" %ds"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy = 0.0187 B/lbm R\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3, page no. 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#initilisation\n",
+ "\n",
+ "Q = 100.0 #B/lbm\n",
+ "Cp = 0.24 #B/lbm F\n",
+ "T1 = 70.0+460.0 #R\n",
+ "T2 = 550.0+460.0 #R\n",
+ "Ts = 50.0+460.0 #R\n",
+ "\n",
+ "#calculation\n",
+ "def fun(T):\n",
+ " cp = Cp/T\n",
+ " return cp\n",
+ " \n",
+ "ds1 = scipy.integrate.quadrature(fun, T1, T2)[0]\n",
+ "Tf = Q/Cp + T1\n",
+ "ds2 = scipy.integrate.quadrature(fun, T1, Tf)[0]\n",
+ "Qr = Ts*(ds2)\n",
+ "Qa = Q-Qr\n",
+ "Qun = Ts*(ds1)\n",
+ "Qa2 = Q-Qun\n",
+ "\n",
+ "#result\n",
+ "print \"Case 1\"\n",
+ "print \"Change in entropy = %.4f B/lbm R\" %ds1\n",
+ "print \"case 2\"\n",
+ "print \"Entropy change = %.4f B/lbm R\" %ds2\n",
+ "print \"Available energy = %.1f B/lbm\" %Qa\n",
+ "print \"case 3\"\n",
+ "print \"Available energy = %.1f B/lbm\" %Qa2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case 1\n",
+ "Change in entropy = 0.1548 B/lbm R\n",
+ "case 2\n",
+ "Entropy change = 0.1392 B/lbm R\n",
+ "Available energy = 29.0 B/lbm\n",
+ "case 3\n",
+ "Available energy = 21.1 B/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file