import math
from numpy import *
# Initialization of Variable
a = 78./1000 #dV/dt
rho = 998. #density of water
rhoc = 2230. #density of china clay
rhod = 1324. #density of cowdung cake
mu = 1.003/1000
P2 = 3.23*1000 #pressure after 2 min.
P5 = 6.53*1000 #pressure after 5 min.
t = 30*60.
b = array([[P2],[P5]])
A = array([[(a**2)*120., a],[(a**2)*300., a]])
x = linalg.solve(A, b)
P = x[0]*a**2*t+x[1]*a
print "pressure drop at t = 30min in (kN/m**2):",P/1000
#part2
J = 0.0278 #mass fraction
l = 1.25
b1 = 0.7
A1 = l*b1*17*2 #area of filtering
V = a*30*60. #volume of filterate
e = 1-rhod/rhoc
nu = J*rho/((1-J)*(1-e)*rhoc-J*e*rho)
l1 = nu*V/A1
print "the thickness of filtercake formed after 30 min in (m): %.4f"%l1
#part3
r = x[0][0]/mu/nu*A1**2
L = x[1][0]*A1/r/mu
print "thickness of cake required in (m): %.4f"%L
#part 4
S = math.sqrt(r*e**3./5/(1-e)**2)
d = 6./S
print "average particle diameter in(10**-6m): %.4f"%(d*10**6)
import math
from numpy import *
# Initialization of Variable
P1 = 5.34*1000 #pressure after 3 min.
P2 = 9.31*1000 #pressure after 8 min.
a = 240./1000000 #dV/dt
P3 = 15.*10**3 #final pressure
#calculation
b = array([[P1],[P2]])
A = array([[a**2*180, a],[a**2*480, a]])
x = linalg.solve(A,b)
#part1
t = (P3-x[1][0]*a)/x[0][0]/a**2
print "time at which the required pressure drop have taken place in (s): %.4f"%t
#part 2
V1 = a*t
print "volume of filterate in (m**3): %.4f"%V1
#part 3
V2 = 0.75
t2 = t+x[0][0]/2/P3*(V2**2-V1**2)+x[1][0]/P3*(V2-V1)
print "the time required to collect 750dm**3 of filterate in (s): %.4f"%t2
#part 4
P4 = 12.*10**3
a = P4/(x[0][0]*V2+x[1][0])
t = 10./1000/a
print "time required to pass 10dm**3 volume in (s): %.4f"%t
import math
from numpy import *
# Initialization of Variable
a = 16./1000 #dV/dt
J = 0.0876 #mass fraction
rho = 999. #density of water
rhoc = 3470. #density of slurry
mu = 1.12/1000
rhos = 1922. #density of dry filter cake
t1 = 3*60.
t2 = 8*60.
V1 = 33.8/1000 #volume at t1
V2 = 33.8/1000+23.25/1000 #volume at t2
P = 12*1000. #pressure difference
Ap = 70.**2./10000*2*9
As = 650/10000.
#calculation
b = array([t1,t2])
A = array([[V1**2/2/P, V1/P],[V2**2/2/P, V2/P]])
x = linalg.solve(A, b)
K1p = x[0]*As**2/Ap**2
K2p = x[1]*As/Ap
P2 = 15*1000. #final pressure drop
t = (P2-K2p*a)/K1p/a**2 #time for filterate
V = a*t #volume of filterate
e = 1-rhos/rhoc
nu = J*rho/((1-J)*(1-e)*rhoc-J*e*rho)
l = (11.-1)/200.
Vf = Ap*l/nu
tf = t+K1p/2/P2*(Vf**2-V**2)+K2p/P2*(Vf-V)
r = K1p/mu/nu*Ap**2
L = K2p*Ap/r/mu
print "the thickness of filter which has resistance equal to resistance of filter medium in (m):%.5f"%L
import math
from numpy import *
# Initialization of Variable
t1 = 3*60. #time 3min
t2 = 12*60. #time 12min
t3 = 5*60. #time 5min
P = 45*1000. #pressure at t1&t2
P2 = 85*1000. #pres. at t3
a = 1.86 #area
mu = 1.29/1000.
c = 11.8
V1 = 5.21/1000 #volume at t1
V2 = 17.84/1000 #volume at t2
V3 = 10.57/1000 #volume at t3
#calculation
b = array([t1,t2])
A = array([[mu*c/2/a**2/P*V1**2, V1/P],[mu*c/2/a**2/P*V2**2, V2/P]])
x = linalg.solve(A,b)
r45 = x[0]
r85 = (t3-x[1]*V3/P2)*2*a**2*P2/V3**2/mu/c
n = math.log(r45/r85)/math.log(45./85)
rbar = r45/(1-n)/(45.*1000)**n
r78 = rbar*(1-n)*(78.*1000)**n
#part1
#polynomial in V as a1x**2+bx+c1 = 0
c1 = 90.*60 #time at 90
Pt = 78*1000. #Pt = pressure at time t = 90
r78 = round(r78/10.**12)*10.**12
a1 = r78*mu/a**2/Pt*c/2.
b = x[1]/Pt
y = poly1d([a1,b,-c1],False)
V1 = roots(y)
print "Volume at P = 90kPa in (m**3): %.4f"%V1[1]
#part2
Pt = 45.*1000
c1 = 90.*60
a1 = r45*mu/a**2/Pt*c/2
b = x[1]/Pt
y = poly1d([a1,b,-c1],False)
V1 = roots(y)
print "Volume at p = 45kPa in (m**3): %.4f"%V1[1]
from numpy import *
import math
# Initialization of Variable
t = 60*0.3/0.5 #time of 1 revollution
d = 34/1000000.
S = 6./d
e = 0.415
J = 0.154
P = 34.8*1000
mu = 1.17/1000
L = 2.35/1000
rho = 999. #density of water
rhos = 4430. #density of barium carbonate
#calculation
#part1
nu = J*rho/((1-J)*(1-e)*rhos-J*e*rho)
r = 5*S**2*(1-e)**2/e**3
#quadratic in l
#in the form of ax**2+bx+c = 0
c = -t
b = r*mu*L/nu/P
a = r*mu/2/nu/P
y = poly1d([a,b,c],False)
l = roots(y)
print "thickness of filter cake in (m): %.4f"%l[1]
#part2
d = 1.2
l1 = 2.6
pi = 3.1428
u = pi*d*0.5/60
Q = u*l1*l[1]
mnet = Q*(1-e)*rhos+Q*e*rho
print "rate at which wet cake will be scrapped in (kg/s): %.4f"%mnet
#part3
md = Q*(1-e)*rhos #rate at which solid scrapped from the drum
r = md/0.154
print "rate of which slurry is treated is (kg/h): %.4f"%(r*3600)
import math
# Initialization of Variable
mu = 0.224
rho = 1328.
K = 5.
b = 3*.5 #radius
h = 2.5
pi = 3.1428
x = 2.1*.5
rhos = 1581. #density of sucrose
e = 0.435 #void ratio
J = 0.097 #mass fraction
m = 3500. #mass flowing
a = 85/10.**6 #side length
L = 48./1000 #thickness
omega = 2*pi*325./60.
#calculation
bi = b**2-m/pi/h/(1-e)/rhos #inner radius
bi = math.sqrt(bi)
bi = round(bi*1000)/1000.
nu = J*rho/((1-J)*(1-e)*rhos-J*e*rho)
S = 6./a
r = 5*S**2*(1-e)**2/e**3
t = ((b**2-bi**2)*(1+2*L/b)+2*bi**2*math.log(bi/b))/(2*nu*rho*omega**2/r/mu*(b**2-x**2))
print "time taken to collect sucrose crystal in (s): %.4f"%t
#part2
vl = pi*(b**2-bi**2)*h*e
vs = pi*(b**2-bi**2)*h/nu-vl
print "volume of liquid separated as filterate i (m**3): %.4f"%vs