In [1]:

```
# Variables
p = 343350. #pressure at any point in pa
w = 9810. #gravitational consmath.tant
s1 = 1.
s2 = 13.6
# Calculations
h1 = (p/w)
h2 = h1*s1/s2
# Results
print "pressure in term of height of water(m)",h1
print "pressure in term of height of mercury(m)",round(h2,7)
```

In [4]:

```
# Variables
h1 = 0.75 #atm pressure in term of mercury
w = 9810.
w1 = 13.6*w #specific weight of mercury
w2 = 15000.
h2 = 3.
# Calculations
Patm = w1*h1
p = w2*h2 # gauge pressure
Pabs = Patm+p
# Results
print "gauge pressure(N/m2)",p
print "absolute pressure(N/m2)",Pabs
```

In [3]:

```
# Variables
h1 = 2.5
h2 = 1.5
s1 = 1
s2 = 0.8
w = 9810
# Calculations
p2 = s2*w*h2 #Pressure intensity at interface
p1 = s1*w*h1
p = p1+p2
# Results
print "pressure intensity at interface(N/m2)",p2
print "pressure intensity at bottom(N/m2)",p
```

In [4]:

```
# Variables
p = 71613. #gauge pressure
w = 9810
# Calculations
phead = p/w
patm = 10.33
pabs = patm+phead
# Results
print "absolute pressure in term of water height in meters",pabs
```

In [5]:

```
# Variables
h1 = 0.05
h2 = 0.1
s1 = 0.8
s2 = 13.6
w = 9810
# Calculations
p = s2*h2*w #pressure at balance line
p1 = s1*h1*w
pf = p-p1
# Results
print "pressure in pipe(N/m2)",pf
```

In [6]:

```
# Variables
h1 = 0.2
h2 = 0.5
s1 = 0.9
s2 = 13.6
# Calculations
h = -(h1*s1+h2*s2)
w = 9810
p = h*w
# Results
print "vacuum pressure (N/m2)",p
```

In [7]:

```
# Variables
s1 = 0.8
s2 = 13.6
dh = 0.4
# Calculations
h = dh*13.6-dh*0.8
w = 9810
pd = w*h
# Results
print "pressure difference in height of water()",h
print "presuure difference in N/m2",pd
```

In [8]:

```
# Variables
s1 = 0.8
s2 = 0.7
h1 = 1.5
h2 = 0.3
h3 = 0.7
s3 = 13.6
# Calculations
hd = h2*s2+h3*s3-h1*s1
w = 9810
pd = hd*w
# Results
print "diffrence in pressure in term of height of water(m)",hd
print "difference in pressure (N/m2)",pd
```

In [9]:

```
# Variables
s1 = 1.6
s2 = 0.8
s3 = 13.6
p1 = 98100.
p2 = 176580.
w = 9810.
# Calculations
h1 = p1/w
h2 = p2/w
h = (h2-h1+1.6*s2-4.1*s1)/(s3-s2)
# Results
print "difference in mercury level(cm)",h*100
```

In [10]:

```
# Variables
s1 = 1.2
s2 = 1
s3 = 0.7
# Calculations
h = (s1-s2)*0.3/(s2-s3)
# Results
print "difference in height(cm)",h*100
```

In [11]:

```
# Variables
s1 = 0.8
s2 = 13.6
z = 0.02
w = 9810
h2 = 0.2
h1 = 0.1
# Calculations
h = h2*s2-h1*s1+(z*h2*(s2-s1))
p = h*w
# Results
print "pressure of the oil in N/m2",p
```

In [12]:

```
# Variables
l = 4
b = 2
h = 3
w = 9810
s = 0.8
# Calculations
p1 = w*l*b*h*s
p2 = w*s*l*h*1.5
p3 = w*s*b*h*1.5
# Results
print "total pressure on horizontal base",p1
print "total pressure on larger vertical base",p2
print "total pressure on smaller vertical walls",p3
```

In [2]:

```
import math
# Variables
p = 490500.
w = 9810.
# Calculations
h = p/w
D = 0.15
A = math.pi*D*D*0.25
pt = w*A*h
h1 = (D*D)/(16*h)
# Results
print "total hydrostatic pressure in N",round(pt,2)
print "position of centre of pressure below the centre of pipe : %f"%h1
```

In [4]:

```
import math
# Variables
w = 9810.
h = 4.
d = 2.
# Calculations
a = d*d*0.25*math.pi
p = w*a*h
h1 = d*d/64
T = p*(h1)
# Results
print "torque required to keep the disc in vertical position in N.m %.4f"%T
```

In [6]:

```
# Variables
w = 9810.
h = 2.
l = 2.
b = 1.
# Calculations
a = l*b
p = w*a*h
h1 = h+(b*l*l*l/(12*b*l*l))
# Results
print "total pressure",p
print "location of its centre of pressure",round(h1,4)
```

In [7]:

```
# Variables
h1 = 8
w = 9810
wd = 6
# Calculations
p1 = 0.5*w*h1*h1*wd
h2 = 4
p2 = 0.5*h2*w*h2*wd
h11 = 0.66666*h1
h22 = 0.6666*h2
p = p1-p2
hf = (p1*(h1-h11)-p2*(h2-h22))/p
# Results
print "resultant force",p
print "position of its line of action",round(hf,5)
```

In [17]:

```
# Variables
z = 9810
w = 10
h = 2
# Calculations
p = 0.5*h*h*w*z
h1 = h*0.6666
# Results
print "total hydrostatic thrust",p
print "its point of application",h1
```

In [18]:

```
# Variables
a1 = 1.4*2.2*1.4
x1 = 1.6+0.7
x11 = (1.4*1.4/(12*2.3))+x1
x2 = 0.7
x22 = (1.4*1.4/(12*0.7))+x2
z = 9810
# Calculations
p1 = z*a1*x1
p2 = z*a1*x2/1.4
p = p1-p2
h = (p1*(3-x11)+p2*(1.4-x22))/p
f = (p1*(3-x11)-p2*(1.4-x22))/1.4
# Results
print "resultant force",p
print "force acting horizontally on the top of the gate",f
```

In [8]:

```
# Variables
s = 1.5
s1 = 0.9
w = 9810
h1 = 0.9
h2 = 0.6
# Calculations
p1 = 0.5*w*s*s1*h1*h1 #total pressure due to oil
p2 = w*h1*h2*s*s1 # total pressure due to oil above water
p3 = w*h2*h2*0.5*s #total pressure due to water
p = p1+p2+p3
h = ((p1*0.6666*h1)+(p2*(h1+0.5*h2))+(p3*(0.6666*h2+h1)))/p
# Results
print "resultant pressure on the wall in N/m2",p
print "position of centre of pressure from free surface",round(h,5)
```

In [20]:

```
# Variables
d = 2.4
h = 1.6
s = 1.2
# Calculations
a = d*s
w = 9810
p = w*a*h*s
h1 = ((2*s*s*s*d)/(12*a*h))+h
# Results
print "total pressure in N",p
print "its point of application",h1
```

In [6]:

```
import math
# Variables
x = 30.
d = 1.2
h = 1.5
w = 9810.
# Calculations
z = math.sin(x*math.pi/180)
h1 = (z*d*0.5)+h
a = 0.25*math.pi*d*d
p = a*w*h1
h11 = (d*d*z*z)/(16*h1)+h1
# Results
print "total pressure",round(p,3)
print "position of centre of pressure",round(h11,4)
```

In [9]:

```
import math
# Variables
d = 2
z = 0.5
# Calculations
h = z+0.5*d
w = 9810
a = math.pi*d*d*0.25
p = a*w*h
h11 = (1/(16*1.5))+1.5
# Results
print "total pressure on the plate %.3f N"%p
print "position of centre of pressure",round(h11,5)
```

In [10]:

```
import math
# Variables
x = 30.
z = math.sin(x*math.pi/180)
h = 6-(z*0.5)
l = 1.
b = 4.
a = l*b
w = 9810.
# Calculations
p = w*a*h
h11 = (z*z)/(12*h)+h
f = p*0.5072
# Results
print "force normal to the gate at point B",round(f,2),"N"
```

In [11]:

```
import math
# Variables
x = 30.
z = math.sin(math.pi*x/180)
d = 1.4
h = 3.
b = 1.5
# Calculations
h1 = z+d
a = 0.5*h*b
w = 9810
p = w*a*h1
h11 = ((z*z*h*h*h*b)/(36*a*h1))+h1
# Results
print "total pressure on the plate",round(p,2),"N"
print "position of centre of pressure",round(h11,4),"m"
```

In [15]:

```
import math
# Variables
d = 1.8
h = 2.4
w = 9810
s = 0.8
# Calculations
p1 = w*d*d*h*0.25*math.pi
h1 = ((d*d)/(16*h))+h
p = w*(s*1.5+2.4)
p2 = p*math.pi*d*d*0.25
p = p2-p1
ab = w*(s*1.5+1.5)
de = w*(s*1.5+3.3)
ce = de-ab
x = ((0.5*ce*d*0.3)/(0.5*(ab+de)*d))
h2 = x+h
h12 = h1-h2
# Results
print "change in total pressure",round(p,3)
print "position of centre of pressure",h2
print "change in position of centre of pressure",round(h12,6),"m"
```

In [18]:

```
import math
# Variables
l = 5.
r = 3.
a = l*r
h = r*0.5
w = 9810.
# Calculations
ph = w*a*h
pv = w*0.25*math.pi*r*r*l
p = math.sqrt((ph*ph)+(pv*pv))
z = ph/pv
theta = math.degrees(math.atan(z))
# Results
print "resultant pressure on the gate",round(p,2),"N"
print "angle of resultant force with vertical",round(theta,7)
# note : rounding off error.
```

In [19]:

```
import math
# Variables
s = 5.
z = math.sin(math.radians(45.))
a = 2*s*z
h = s*z
w = 9810.
# Calculations
ph = w*a*h
pv = w*((0.25*s*s*math.pi)-(0.5*a*h))
# Results
print "horizontal pressure",ph,"N"
print "vertical pressure",round(pv,1),"N"
```

In [ ]:

```
```