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