{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 2: Fundamental Thoughts"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.1"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Weight of person is: 9.75 N\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 2.1\n",
"'''What is the weight of a 1 kg mass at an altitude where the local acceleration of gravity is\n",
"9.75 m/s2?'''\n",
"\n",
"#Variable Declaration: \n",
"m = 1 \t\t#Mass in kg\n",
"g = 9.75 \t\t#Acc.due to gravity in m/s**2\n",
"\n",
"#Calculation:\n",
"F = m*g \t\t#Weight of 1 kg mass in N\n",
"\n",
"#Result\n",
"print \"Weight of person is:\",round(F,2),\"N\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.2"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Average specific volume is: 0.001325 m**3/kg\n",
"Overall density is: 755.0 kg/m**3\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 2.2\n",
"'''A1m3 container, shown in Fig. 2.9, is filled with 0.12 m3 of granite, 0.15 m3 of sand, and\n",
"0.2 m3 of liquid 25◦C water; the rest of the volume, 0.53 m3, is air with a density of 1.15\n",
"kg/m3. Find the overall (average) specific volume and density.'''\n",
"\n",
"#Variable Declaration: \n",
"Vliq = 0.2 \t\t #volume of liquid in m**3\n",
"dliq = 997 \t\t #density of liquid in kg/m**3\n",
"Vstone = 0.12 \t\t#volume of stone in m**3\n",
"Vsand = 0.15 \t\t#volume of sand in m**3\n",
"Vair = 0.53 \t\t#voume of air in m**3\n",
"dstone = 2750 \t\t#density of stone in kg/m**3\n",
"dsand = 1500 \t\t#density of sand in kg/m**3\n",
"Vtot = 1 \t\t #total volume in m**3\n",
"dair = 1.1 \t\t #density of air in kg/m**3\n",
"\n",
"#Calculation:\n",
"mliq = Vliq*dliq \t\t#mass of liquid in kg\n",
"mstone = Vstone*dstone #volume of stone in m**3\n",
"msand = Vsand*dsand \t#volume of sand in m**3\n",
"mair = Vair*dair \t\t#mass of air\n",
"mtot = mair+msand+mliq+mstone \t\t#total mass in kg\n",
"v = Vtot/mtot \t\t#specific volume in m**3/kg\n",
"d = 1/v \t\t #overall density in kg/m**3\n",
"\n",
"#Results:\n",
"print \"Average specific volume is: \",round(v ,6),\"m**3/kg\"\n",
"print \"Overall density is:\",round(d),\"kg/m**3\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.3"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Force that rod can push within the upward direction is: 932.9 N\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 2.3\n",
"'''The hydraulic piston/cylinder system shown in Fig. 2.11 has a cylinder diameter of D =\n",
"0.1 m with a piston and rod mass of 25 kg. The rod has a diameter of 0.01 m with an\n",
"outside atmospheric pressure of 101 kPa. The inside hydraulic fluid pressure is 250 kPa.\n",
"How large a force can the rod push within the upward direction?'''\n",
"from math import pi\n",
"\n",
"#Variable Declaration: \n",
"Dcyl = 0.1 \t\t#Cylinder diameter in m\n",
"Drod = 0.01 \t#Rod diameter in m\n",
"Pcyl = 250000 \t#Inside hydaulic pressure in Pa\n",
"Po = 101000 \t#Outside atmospheric pressure in kPa\n",
"g = 9.81 \t\t#Acc. due to gravity in m/s**2\n",
"mp = 25 \t\t#Mass of (rod+piston) in kg\n",
"\n",
"#Calculation:\n",
"Acyl = pi*Dcyl**2/4 \t\t#Cross sectional area of cylinder in m**2\n",
"Arod = pi*Drod**2/4 \t\t#Cross sectional area of rod in m**2\n",
"F = Pcyl*Acyl-Po*(Acyl-Arod)-mp*g \t#Force that rod can push within the upward direction in N\n",
"\n",
"#Result:\n",
"print \"Force that rod can push within the upward direction is:\",round(F,1),\"N\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.4"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Atmospheric pressure is: 99.54 KPa\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 2.4\n",
"'''A mercury barometer located in a room at 25◦C has a height of 750 mm. What is the\n",
"atmospheric pressure in kPa?'''\n",
"\n",
"#Variable Declaration: \n",
"dm = 13534 \t\t #Density of mercury in kg/m**3\n",
"H = 0.750 \t\t #Height difference between two columns in metres\n",
"g = 9.80665 \t\t #Acc. due to gravity in m/s**2\n",
"\n",
"#Calculation:\n",
"Patm = dm*H*g/1000 \t #Atmospheric pressure in kPa\n",
"\n",
"#Result:\n",
"print \"Atmospheric pressure is:\",round(Patm,2),\"KPa\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.5"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Absolute pressure inside vessel is: 1.3 atm\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 2.5\n",
"'''A mercury (Hg) manometer is used to measure the pressure in a vessel as shown in\n",
"Fig. 2.13. The mercury has a density of 13 590 kg/m3, and the height difference between the\n",
"two columns is measured to be 24 cm.We want to determine the pressure inside the vessel.'''\n",
"\n",
"#Variable Declaration: \n",
"dm = 13590 \t\t #Density of mercury in kg/m**3\n",
"H = 0.24 \t\t #Height difference between two columns in metres\n",
"g = 9.80665 \t\t#Acc. due to gravity in m/s**2\n",
"Patm = 13590*0.750*9.80665 #Atmospheric Pressure in Pa\n",
"\n",
"#Calculation:\n",
"dP = dm*H*g \t\t#Pressure difference in Pa\n",
"Pvessel = dP+Patm \t#Absolute Pressure inside vessel in Pa\n",
"\n",
"#Result:\n",
"print \"Absolute pressure inside vessel is:\",round(Pvessel/101325,2),\"atm\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.6"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Pressure at the bottom of storage tank if liquid is Gasoline: 156.2 Kpa\n",
"Pressure at the bottom of storage tank if liquid is R-134a: 1089.0 Kpa\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 2.6\n",
"'''What is the pressure at the bottom of the 7.5-m-tall storage tank of fluid at 25◦C shown\n",
"in Fig. 2.15? Assume that the fluid is gasoline with atmospheric pressure 101 kPa on the\n",
"top surface. Repeat the question for the liquid refrigerant R-134a when the top surface\n",
"pressure is 1 MPa.'''\n",
"\n",
"#Variable Declaration: \n",
"dg = 750 \t\t#Density of gaasoline in kg/m**3\n",
"dR = 1206 \t\t#Density of R-134a in kg/m**3\n",
"H = 7.5 \t\t#Height of storage tank in metres\n",
"g = 9.807 \t\t#Acc. due to gravity in m/s**2\n",
"Ptop1 = 101 \t#Atmospheric pressure in kPa\n",
"Ptop2 = 1000 \t\t#top surface pressure in kPa\n",
"\n",
"#Calculation:\n",
"dP1 = dg*g*H/1000\t#Pressure difference in kPa\n",
"P1 = dP1+Ptop1\n",
"dP2 = dR*g*H/1000#Pressure difference in kPa\n",
"P2 = dP2+Ptop2\n",
"\n",
"#Result:\n",
"print \"Pressure at the bottom of storage tank if liquid is Gasoline:\",round(P1,1),\"Kpa\"\n",
"print \"Pressure at the bottom of storage tank if liquid is R-134a:\",round(P2),\"Kpa\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.7"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Balancing force on second larger piston is: 122.3513 N\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 2.7\n",
"'''A piston/cylinder with a cross-sectional area of 0.01 m2 is connected with a hydraulic\n",
"line to another piston/cylinder with a cross-sectional area of 0.05 m2. Assume that both\n",
"chambers and the line are filled with hydraulic fluid of density 900 kg/m3 and the larger\n",
"second piston/cylinder is 6mhigher up in elevation. The telescope armand the buckets have\n",
"hydraulic piston/cylinders moving them, as seen in Fig. 2.16.With an outside atmospheric\n",
"pressure of 100 kPa and a net force of 25 kN on the smallest piston, what is the balancing\n",
"force on the second larger piston?'''\n",
"\n",
"#Variable Declaration: \n",
"Po = 100\t\t#Outside atmospheric pressure in kPa\n",
"F1 = 25 \t\t#Net force on the smallest piston in kN\n",
"A1 = 0.01 \t\t#Cross sectional area of lower piston in m**2\n",
"d = 900 \t\t#Density of fluid in kg/m**3\n",
"g = 9.81 \t\t#Acc. due to gravity in m/s**2\n",
"H = 6 \t\t#Height of second piston in comparison to first one in m\n",
"A2 = 0.05 \t\t#Cross sectional area of higher piston in m**3\n",
"\n",
"#Calculation:\n",
"P1 = Po+F1/A1 \t#Fluid pressure in kPa\n",
"P2 = P1-d*g*H/1000 #Pressure at higher elevation on piston 2 in kPa\n",
"F2 = (P2-Po)*A2 \t#Balancing force on second piston in kN\n",
"\n",
"#Result:\n",
"print \"Balancing force on second larger piston is:\",round(F2,4),\"N\""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}