

%Total Methanol in D, S1, S2 & B

Methanol=sum(u([3 4 12 13]).*x([im_xS1(1) im_xS2(1) im_xt(1) im_xr(1)]))
%Total Ethanol in D, S1, S2 & B

Ethanol= sum(u([3 4 12 13]).*x([im_xS1(2) im_xS2(2) im_xt(2) im_xr(2)]))
%Total Propanol in D, S1, S2 & B

Propanol= sum(u([3 4 12 13]).*x([im_xS1(3) im_xS2(3) im_xt(3) im_xr(3)]))


%Total Butanol in D, S1, S2 & B

Butanol=sum([u(12)*(1-sum(x( im_xt))); u(13)*(1-sum(x(im_xr))); u(3)*(1-sum(x(im_xS1))); u(4)*(1-sum(x(im_xS2)));])


% Total Moles Agaiin

Total= Methanol+Ethanol+Propanol+Butanol



