% function to compute f(x)
% for water-gas shift equilibrium
% set up with external arguments
function ferr = fx(x,T,FeedH2,FeedCO2,FeedH2O,FeedCO)
TK = T + 273.15;
Keq = exp(-3.112+3317/TK);
ferr = (FeedH2+x).*(FeedCO2+x)./(FeedH2O-x)./(FeedCO-x)-Keq;
