# Variables
a = 1.
b = 3.
c = 6.
#Initial concentrations
CAo = 100. # feed
CBo = 200. # feed
Cio = 100. # feed
#Final concentrations
CA = 40. # reacter exit
# Calculations
# Find CB,XA,XB
ea = (6.-4.)/4;
XA = (CAo-CA)/(CAo+ea*CA);
eb = (ea*CBo)/(b*CAo);
XB = b*CAo*XA/CBo;
CB = CBo*(1-XB)/(1+eb*XB);
# Results
print "The final concentration of BCB is %.f"%(CB)
print " XA and XB are %.2f ,%.2f"%(XA,XB)