Import the Sympy symbolic algebra package, and initialize printing of mathematics.
from IPython.display import display
from sympy import *
init_printing()
var('S1 W1 W2 S3 W3')
mbal = [Eq(0, S1 - S3),
Eq(0, W1 + W2 - W3 )]
Specify compositions of the inlet streams
comp = [Eq(S1, 0.77*(S1 + W1)),
Eq(S3, 0.186*(S3 + W3))]
prod = [Eq(S3 + W3, 200)]
eqns = mbal + comp + prod
for eq in eqns:
display(eq)
soln = solve(eqns)
soln
for (k,v) in soln.items():
print "{:s} = {:6.2f} kg/day".format(k,float(v))
S1 = 37.20 kg/day W3 = 162.80 kg/day W1 = 11.11 kg/day S3 = 37.20 kg/day W2 = 151.69 kg/day