![]() |
function hdif=mixe(s,t,in,out) % mixe - Energy balance mixer module % function hdif=mixe(s,t,in,out) % Argument List % Argument Gives % s the state of the exit stream: % 'v' for vapor, 'l' for liquid, 's' for solid. % t the temperature of the exit stream in Tdeg. % in the indices of inlet streams, % out the index of exit stream. % hdif: the answer is the enthalpy out % - the sum of the enthalpies in. % Ex. mixe('v',55,[2 3 4],6) % will mix streams 2, 3 and 4 to form stream 6. % Stream 6 will be a vapor at 55Tdeg. % For additional help and picture, see picmixe % OKB, TYLC global ns ne sne=size(ne); nc=sne(2)-3; if length(in)<2 ns=ne(in,4:(nc+3)); else ns=sum(ne(in,4:(nc+3))); end j=find(ns); setne(s,out,t,ns(j),j) hdif=ne(out,3)-sum(ne(in,3));
Also see The mixer function: mixe. Back to Chapter 5.