from math import pi,log
#initialization of variables
Rat1 = (6.5/3)*(1-0.47)# as Rat = x0/y0
m = 0.14
H = (6.5*10**3)/3600. # Extract flow in g/sec
L = (3*10**3)/3600.# Solvent flow in g/sec
d= 10 # cm
A = 0.25*pi*d**2 # cm**2
l = 65 # cm
#Calculations and Results
Kya = ((H/(l*A))*(1/(1-((m*H)/L)))*(log((1-0.14*Rat1)/(0.47))))*10**3# kg/m**3-sec
print"The value of Kya is kg/m**3-sec",round(Kya,2)
Rat2 = (6.5/3)*(1-0.1)#For case B
l2 = l*(log(1/((1-0.14*Rat2)/(0.1))))/(log(1/((1-0.14*Rat1)/(0.47))))/100# m
print"\nThe length for 90 percent recovery is m",round(l2,1)
#Initialization of variables
m = 0.018
H = 450. # litres/hr
L = 37. # litres/hr
Ynplus1byY1 = 100.
from math import log
#Calculations
E =m*H/L
nplus1 = log((Ynplus1byY1*((1/E)-1))+1)/log(1/E)
n = nplus1 -1
print"The number of ideal stages are ",round(n,1)
N = 0.60#Murphree efficienct
E1 = (m*H/L) + (1/N) - 1
nplus1 = log((Ynplus1byY1*((1/E1)-1))+1)/log(1/E1)
n=nplus1-1
print"\nThe number of stages required if Murphree efficiency is 60 percent is ",round(n)
#initialization of variables
F = 5. #kg feed
S = 2. # kg solvent
E = F-S # kg extract
W = 1 # kg waste
EG = 80. # ppm
y0 = (100-99)/100. # mole fraction of gold left
y1 = y0*EG*W/S # concentration in raffinate
from math import log
#Calculations
xN = (EG*W - y1*S)/E # solvent concentration
xNminus1 = ((xN*(E+S)) - EG*W)/F#feed stage balance
N = 1 + ((log((xN-xNminus1)/(y1))/log(F/S)))#numner of stages including feed stage
#Results
print"The number of stages including feed stage is ",round(N,2)