summaryrefslogtreecommitdiff
path: root/Heat_And_Thermodynamics_by_A_Manna/5-Equations_of_state.ipynb
blob: 99daf9142d0bf3069c44851325ee8c75b07a148d (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
{
"cells": [
 {
		   "cell_type": "markdown",
	   "metadata": {},
	   "source": [
       "# Chapter 5: Equations of state"
	   ]
	},
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 5.1: The_values_of_constant_a_and_b_in_vanderwaal_equation.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"\n",
"//INPUT\n",
"t=304;//temperature of the gas in k\n",
"p=73;//pressure of the gas in atm\n",
"r=0.00366;//universal gas constant in j/K/mole\n",
"//ct=8a/27br;cp=a/27b^2\n",
"\n",
"//CALCULATIONS\n",
"b=(t*r/(8*p));\n",
"a=p*27*b^2;\n",
"\n",
"//OUTPUT\n",
"mprintf('the value of the constant b is %3.7f \n the value of the constant a is %3.5f',b,a)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 5.4: Vanderwaal_constants.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"\n",
"//INPUT\n",
"tc=132;//critical temperature in K\n",
"pc=37.2;//critical pressure in atm\n",
"r=82.07;//universal gas constant in cm^3atm/mole/K\n",
"\n",
"//CALCULATIONS\n",
"a=27*(r^2)*(tc^2)/(64*pc);//value of a in atm/cm^6/mol^2\n",
"b=r*tc/(8*pc);//value of b in cm^3/mol\n",
"\n",
"//OUTPUT\n",
"mprintf('the value of is %3.2f atm/cm^6/mol^2 \n the value of b is %3.2f cm^3/mol',a,b)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 5.5: Temperature_of_the_gas.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"\n",
"//INPUT\n",
"p=2.26*1.013*10^5;//critical pressure in N/m^2\n",
"v=4/69;//critical volume in m^3/kmol\n",
"r=8.31*10^3;//universal gas constant in J/kmol.K\n",
"\n",
"//CALCULATIONS\n",
"t=(8*p*v/(3*r));//critical temperature in K\n",
"\n",
"//OUTPUT\n",
"mprintf('critical temperature of the given problem is %3.2f K',t)"
   ]
   }
],
"metadata": {
		  "kernelspec": {
		   "display_name": "Scilab",
		   "language": "scilab",
		   "name": "scilab"
		  },
		  "language_info": {
		   "file_extension": ".sce",
		   "help_links": [
			{
			 "text": "MetaKernel Magics",
			 "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
			}
		   ],
		   "mimetype": "text/x-octave",
		   "name": "scilab",
		   "version": "0.7.1"
		  }
		 },
		 "nbformat": 4,
		 "nbformat_minor": 0
}