from __future__ import division
from numpy import cos
print "Example 3.2 Page no. 25\n\n"
#given temperature(T),pressure(P),capilLary tube diameter(D),water density(rho),contact angle(ththetaeta)
sigma=0.0712#surface tension (sigma)of water at 30 degree C temperature in appendix A.4
D=0.008
R=D/2
theta=0
g=9.807
rho=1000
print "surface tension=%0.2fN/m\n Radius = %0.2e m\n theta = %0.f degree\n g=%0.2fm/s**2\n rho=%0.2fkg/m**3\n"%(sigma,R,theta,g,rho)
h=(2.0*sigma*cos(0))/(rho*g*R)#height rise of the liquid
print "height of liquid rise = %0.2e m\n"%(h)
from __future__ import division
from numpy import cos
print "Example 3.3 Page no. 26\n\n"
#given at 30 degree temerature
#properties of water from appendix A.2 density(rho),surface tension(sigma)
rho=996
sigma=0.071
print "rho=%0.2f\kg/m**3\n surface tension (sigma)=%0.2f N/m\n"%(rho,sigma)
theta=0#negligible angle of contact
g=9.807
h=0.001#less than one milimeter
print "theta=%0.2f degree \n g=%0.2f m/s**2\n h=%0.3f m\n"%(theta,g,h)
R=(2*sigma*cos(0))/(rho*g*h)#by capiilary rise equation
D=2*R
print "R=%0.3f m\n D=%0.3f m\n"%(R,D)
#if the tube diameter is greater than 0.029075 mm, then the capillary rise will be less than 1mm
from __future__ import division
from math import pi, sin,cos
print "Example 3.4 page no 28\n\n"#
S=2#surface area ft**2
F=10#magnitude of force,lbf
theta=pi/6#angle
F_p=F*cos(theta)#parallel comp. of force
print "\n F_p=%0.2f lbf"%(F_p)#
F_n=F*sin(theta)#normal comp. of force
print "\n F-n=%0.2f lbf"%(F_n)#
tou=F_p/S#shear stress
P=F_n/S#pressure
print "\n tou=%0.2f psf\n P=%0.2f psf"%(tou,P)#
from __future__ import division
print "Example 3.5 Page no. 30\n\n"
#determine potential energy of water
# given height,mass of water,g
m=1
g=9.8
Z1=0#at ground level
Z2=10#at 10 m above from ground level
print "m=%0.2f kg\n g=%0.2f m/s**2\n Z1=%0.2f m\n Z2=%0.2f m\n"%(m,g,Z1,Z2)
PE1=m*g*Z1#potential energy at ground level
PE2=m*g*Z2#potential energy at 10m height
PE= PE2-PE1
print "PE1=%0.fJ\n PE2=%0.2fJ\n PE=%0.2fJ\n"%(PE1,PE2,PE)