summaryrefslogtreecommitdiff
path: root/Thermodynamics:_From_concepts_to_applications/Chapter15-.ipynb
blob: 7474279a215c962e3eace40a121e26c656c780fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
 "metadata": {
  "name": "",
  "signature": "sha256:80d64855fab39260827744b179bb4ae70aaba7b386517244e3cbca404875a81d"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter15-multicomponet systems"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example1-pg332"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate volume of the phase\n",
      "##initialisation of variables\n",
      "m2= 50. ##gms\n",
      "M= 46. ##gms\n",
      "m1= 50. ##gms\n",
      "M1= 18. ##gms\n",
      "v1= 17402. ##cm^3/kmol\n",
      "v2= 56090. ##cm^3/kmol\n",
      "##CALCULATIONS\n",
      "x2= (m2/M)/((m2/M)+(m1/M1))\n",
      "V= (v1*(m1/M1)+v2*(m2/M))*math.pow(10,-3)\n",
      "##RESULTS\n",
      "print'%s %.1f %s'% ('volume of the phase=',V,'cm^3')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "volume of the phase= 109.3 cm^3\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example2-337"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calcualte difference in enthalpy and amount of heat removed\n",
      "##initialisation of variables\n",
      "nw= 9 ##kmol\n",
      "na= 1 ##kmol\n",
      "##CALCULATIONS\n",
      "dh= 75*nw*nw/math.pow(na+1.8*nw,2)\n",
      "Q= -75*na*nw/(nw+1.8*na)\n",
      "##RESULTS\n",
      "print'%s %.2f %s'%  ('difference in enthalpy=',dh,'kJ/kg')\n",
      "print'%s %.1f %s'% ('amount of heat removed=',Q,'kJ')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "difference in enthalpy= 20.53 kJ/kg\n",
        "amount of heat removed= -62.5 kJ\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}