# Chapter 2: Pressure

### Example 2.1, Page Number: 116

In [1]:
x=10000.0*10.0            #equivalnt to 10kg/cm^2

#result
print('(a)\n 10kg/cm^2 = %.0f mmWG' %x)

#(b)

#variable declaration
onemm_Hg=13.546                #pressure  of 1 mm Hg

#calculation
y=10.0**5/onemm_Hg
y=y/10.0**3

#result
print('\n(b)\n10kg/cm^2 = 10^5 mmWG = %.2f * 10^3 mmHg' %y)

#(c)

#variable declaration
onebar=1.03                   # 1 Bar presssure in kg/cm^2
#calculation
z=10.0/onebar

#result
print('\n(c)\n10kg/cm^2 = %.2f bars' %z)

(a)
10kg/cm^2 = 100000 mmWG

(b)
10kg/cm^2 = 10^5 mmWG = 7.38 * 10^3 mmHg

(c)
10kg/cm^2 = 9.71 bars

### Example 2.2, Page Number: 116

In [2]:
#(a)

#variable Declaration
gamm=1000.0               # density of water
d=35.0                    # depth of water
dens_Hg=13.546            # density of Hg

#calculation
press_in_kg_cm=gamm*d*10**-4
press_in_mmHg=gamm*d/dens_Hg
press_in_mmHg=press_in_mmHg/10**3

#result
print('(a)\nThe pressure at depth of %d meters in a water tank=%.1f kg/cm^2 = %.2f*10^3 mmHg'%(d, press_in_kg_cm, press_in_mmHg))

#(b)

#varible declaration
press_atm=1.03            #atmospheric pressure

#calculation
abspress=press_in_kg_cm+press_atm
abspress_mmHg=press_in_mmHg*1000.0+760.0
abspress_mmHg=abspress_mmHg/1000.0

#result
print('\n(b)\nAbsolute Pressure= %.2f kg/cm^2 Abs = %.2f*10^3 mmHg Abs'%(abspress, abspress_mmHg))

(a)
The pressure at depth of 35 meters in a water tank=3.5 kg/cm^2 = 2.58*10^3 mmHg

(b)
Absolute Pressure= 4.53 kg/cm^2 Abs = 3.34*10^3 mmHg Abs

### Example 2.3, Page Number:116

In [3]:
#varible declaration
egp=260.0                  # equivalent gauge pressure

#calculation
abspress=760.0-egp

#result
print('Absolute Presssure = %d mmHg' %abspress)

Absolute Presssure = 500 mmHg

### Example 2.4,Page Number:117

In [4]:
#(a)

#variable declaration
p_diff=500.0                #pressure difference in mmHg

#calculations
pdiff=p_diff*13.546/10000

#Result
print('(a)\np1-p2 = %.3f kg/cm^2' %pdiff)

#(b)

#variable declaration
p1=6770.0                  # Gauge pressure in mmWG
p_atm=10300.0              # atmospheric pressure

#calculation
abs_p1=p1+p_atm

#result
print('\n(b)If p2 is open to atmosphere:\nAbsolute Pressure P1 = %d mmWG abs.' %abs_p1)

#(c)

#variable declaration
P1=500.0                 #mmHg absolute pressure

#calculations
P1_gauge=P1-760.0

#result
print('\n(c)If p2 is evacuated and sealed:\np1= %d mmHg gauge Pressure' %P1_gauge)

(a)
p1-p2 = 0.677 kg/cm^2

(b)If p2 is open to atmosphere:
Absolute Pressure P1 = 17070 mmWG abs.

(c)If p2 is evacuated and sealed:
p1= -260 mmHg gauge Pressure

### Example 2.5, Page Number: 117

In [5]:
#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)

Weight Density of X = 2000 kg/m^3

### Example 2.6, Page Number: 117

In [6]:
#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)')

(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)

### Example 2.7, Page Number: 119

In [7]:
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)

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

### Example 2.8, Page Number: 120

In [8]:
#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))

(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

### Example 2.9, Page Number: 120

In [1]:
import math
#variable Declaration
R=120.0                        #resistance
l=122.0                        #length
a=0.1                          #area
R1=140.0                       #resistance in ohm

#calculation
rho=R*a/l
l1=math.sqrt(R1*a*l/rho)
l1=round(l1,0)

#Result
print('Length l1 = %d meters' %l1)
A1=a*l/l1
print('\nArea A1 = %.4f mm^2' %A1)

Length l1 = 132 meters

Area A1 = 0.0924 mm^2

### Example 2.10, Page Number: 121

In [10]:
c=0.57                   #Constant

#(a)

#variable declaration
d=0.1                    #distance between plates
di1=100.0                #Dielectric constant
di2=1000.0               #Dielectric constant

#calculation
c1=c*di1*10.0/d
c1=round(c1,0)

#result
print('(a)\nC1=%d pf' %c1)

#(b)

#calculation
c2=c*di2*10/d

#result
print('\n(b)\nC2=%d pf' %c2)

#(c)

#calculation
ds=0.09
c11=c*di1*10/ds
c12=c*di2*10/ds

#result
print('\n(c)\nC1 = %.1f pf\nC2 = %d pf'%(c11,c12))

(a)
C1=5700 pf

(b)
C2=57000 pf

(c)
C1 = 6333.3 pf
C2 = 63333 pf

### Example 2.11, Page Number: 121

In [11]:
#variable Declaration
A=1.0                       #area
p1=10.0                     #pressure

#calculation
W1=A*p1

#Result
print('W1 = %d kg' %W1)
print('\nWith the 4 standard weights of 10kg, 20kg, 30kg and 40kg')

W1 = 10 kg

With the 4 standard weights of 10kg, 20kg, 30kg and 40kg

### Example 2.12, Page Number: 122

In [12]:
#varable declaration
p1=10**-2                 #pressure in torr
h1=20.0                   #height in mm

#xalculation
K=p1/h1**2
p2=K*30**2
p2=p2*100.0

#Result
print('The unknown pressure p2 = %.2f * 10^-2 torr' %p2)

The unknown pressure p2 = 2.25 * 10^-2 torr