%% This function evaluates composition for
%% given reac extent
function x = fcompm(nr,nc,mnu,n0,rext)
sm = zeros(1);
x  = zeros(1,nc);
ni = zeros(1,nc);
for i = 1 : nc
    for j = 1 : nr
        ni(i) = ni(i) + mnu(j,i)*rext(j);
    end
    ni(i) = n0(i) + ni(i);
end
sm = sum(ni);
for i=1:nc
    x(i) = ni(i) ./ sm;
end
end %% function
