#Initialization of variables
N1 = 1.6*10**-10 # mol/cm**2-sec
c1star = 0 # mol/cc
c1 = 2.7*10**-4/1000 # mol/cc
#Calculations
K = N1/(c1-c1star)# cm/sec
#Results
print"The mass transfer co efficient is cm/sec",round(K,4)
#Initialization of variables
d = 400*10**-4 # cm
D = 10**-5 # cm**2/sec
v = 1. # cm/sec
l = 30. # cm
nu = 0.01 # cm**2/sec
#Calculations
k1 = (D/d)*1.62*(((d**2)*v/D*l)**(1/3))+0.0003# Mass transfer co efficient inside the hollow fibers in cm/sec
k2 = (D/d)*0.8*((d*v/nu)**0.47)*((nu/D)**(1/3))#Mass transfer co efficient outside the hollow fibers in cm/sec
#Results
print"Mass transfer co efficient inside the hollow fibers cm/sec",round(k1,2)
print"\nMass transfer co efficient outside the hollow fibers cm/sec",round(k2,5)
#initialization of variables
phi = 0.2
d = 200*10**-4 # cm
dia = 3.8 # cm
Q = 4.1 # blood flow in cc/sec
k = 3.6*10**-4 # cm/sec
l = 30 # cm
from math import pi
from math import exp
#Calculations
a = 4*phi/d # cm**2/cm**3
B = Q/((pi*dia**2)/4) # cm/sec
ratio1 = 1/(1+(k*a*l/B))# D equals B
percent1 = (1-ratio1)*100 # percentage of toxins removed when dialystate flow equals blood flow
D = 2*B # in second case
ratio2 =1/(((1/(exp(-k*a*l/D)))-0.5)*2) # when D =2B
percent2 = (1-ratio2)*100 # percentage of toxins removed when dialystate flow is twice the blood flow
ratio3 = exp(-k*a*l/B)# when dialystate flow is very large
percent3 = (1-ratio3)*100 # percentage of toxins removed when dialystate flow is very large
#Results
print"The percentage of toxins removed when dialystate flow equals blood flow is ",round(percent1)
print"\nThe percentage of toxins removed when dialystate flow is twice the blood flow is ",round(percent2)
print"\nThe percentage of toxins removed when dialystate flow is very large is ",round(percent3)