summaryrefslogtreecommitdiff
path: root/Thermodynamics:_From_concepts_to_applications/Chapter_2.ipynb
blob: 1b24215151a20e09cbdba4003634d2c9b556b6a5 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:2df70ea24eb675b5df88544238cda98c7d9d4538b630227696b56b410ea0e81e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2 - Work"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2 pg 12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##calculate the mass of oxygen and density of oxygen and specific volume and molar specific volume\n",
      "##initialisation of variables\n",
      "n= 0.25 ## k mol\n",
      "M= 32 ##kg/kmol\n",
      "V= 0.5 ##m^3\n",
      "##CALCULATIONS\n",
      "m= n*M\n",
      "d= m/V\n",
      "v= 1/d\n",
      "v1= V/n\n",
      "##RESULTS\n",
      "print'%s %.0f %s'%(\"mass of oxygen=\",m,'kg')\n",
      "print'%s %.0f %s'%(\"density of oxygen=\",d,'kg/m^3')\n",
      "print'%s %.4f %s'%('specific volume=',v,'kg/m^3')\n",
      "print'%s %.0f %s'%('molar specific volume=',v1,'m^3/kmol')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "mass of oxygen= 8 kg\n",
        "density of oxygen= 16 kg/m^3\n",
        "specific volume= 0.0625 kg/m^3\n",
        "molar specific volume= 2 m^3/kmol\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}