"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#variable declaration\n",
"spe_grav_water=1.0 # specific gravity of water\n",
"\n",
"#calculation\n",
"spe_grav_X=spe_grav_water*100.0/50.0\n",
"wt_dens_water=1000.0\n",
"wt_dens_X=wt_dens_water*2.0\n",
"\n",
"#result\n",
"print('Weight Density of X = %d kg/m^3' %wt_dens_X)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Weight Density of X = 2000 kg/m^3"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 2.6, Page Number: 117
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#variable declaration\n",
"A=1.0/20.0 # Area ratio\n",
"p_diff=1500.0 # pressure difference in mmWG\n",
"\n",
"#result\n",
"print('(a)\\nAs Delta_h=A2/A1*h << h and normally negligible for well type manometer')\n",
"print('hence, p1-p2 = h = %d =111 mmHg' %p_diff)\n",
"print('\\n(b)\\nh measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg')\n",
"print('(Since area of both legs are same)')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)\n",
"As Delta_h=A2/A1*h << h and normally negligible for well type manometer\n",
"hence, p1-p2 = h = 1500 =111 mmHg\n",
"\n",
"(b)\n",
"h measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg\n",
"(Since area of both legs are same)"
]
}
],
"prompt_number": 6
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 2.7, Page Number: 119
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"print('1 kg/cm^2 = 10 mWG\\n')\n",
"\n",
"#(a)\n",
"\n",
"#variable declaration\n",
"press=10+2 #pressure read by the gauge\n",
"\n",
"#result\n",
"print('\\n(a)Bourdon Gauge is mounted 20 meters below water line:')\n",
"print('\\nPressure read by the Gauge = %d kg/cm^2'%press)\n",
"\n",
"\n",
"#(b)\n",
"\n",
"#variable declaration\n",
"press2=10-3 #pressure read by the gauge\n",
"\n",
"#result\n",
"print('\\n\\n(b)Bourdon Gauge is located 30 meters above the water line:')\n",
"print('\\nPressure read by the Gauge = %d kg/cm^2'%press2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"1 kg/cm^2 = 10 mWG\n",
"\n",
"\n",
"(a)Bourdon Gauge is mounted 20 meters below water line:\n",
"\n",
"Pressure read by the Gauge = 12 kg/cm^2\n",
"\n",
"\n",
"(b)Bourdon Gauge is located 30 meters above the water line:\n",
"\n",
"Pressure read by the Gauge = 7 kg/cm^2"
]
}
],
"prompt_number": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 2.8, Page Number: 120
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#Variable declaration\n",
"dens_water=1000.0 # water Density\n",
"h1=125.0 # height1 mm\n",
"h2=250.0 # height2 mm\n",
"d2=h1*dens_water/h2\n",
"\n",
"#result\n",
"\n",
"#a\n",
"print('(a)\\nDensity of Liquid = %d kg/m^3' %d2)\n",
"print('\\nSpecific Density of the liquid = %.1f' %(h1/h2))\n",
"\n",
"#(b)\n",
"print('\\n\\n(b)\\nIf Values of water and liquid interchanged:\\n')\n",
"d3=h2*dens_water/h1\n",
"print('\\nDensity of Liquid = %d kg/m^3' %d3)\n",
"print('\\nSpecific Density of the liquid = %.1f' %(h2/h1))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)\n",
"Density of Liquid = 500 kg/m^3\n",
"\n",
"Specific Density of the liquid = 0.5\n",
"\n",
"\n",
"(b)\n",
"If Values of water and liquid interchanged:\n",
"\n",
"\n",
"Density of Liquid = 2000 kg/m^3\n",
"\n",
"Specific Density of the liquid = 2.0"
]
}
],
"prompt_number": 8
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"