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:882feb469ab957881db3b5f222288d33682abe4b2aecf80e0e5d8c61ca30e228"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 2 - Basic concepts "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2 pg 11"
]
},
{
"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": {}
}
]
}
|