function Streams=LVMassBalance(X)
NT=41;
%Fixed prices
pf = 1 ;  pB = 2 ; pD = 1 ;

Steam = X(2*NT+1);
Feed  = X(2*NT+2);
pV    = X(2*NT+3);

%From cola_lv function in the original colA files: 
%            Inputs are reflux (LT) and boilup (VB). Disturbances
%            are feedrate and feed composition.
% P-Controllers for control of reboiler and condenser hold up.
KcB=10;  KcD=10;         % controller gains
MDs=0.5; MBs=0.5;        % Nominal holdups - these are rather small  
Ds=0.5; Bs=0.5;          % Nominal flows
MB=X(NT+1);  MD=X(2*NT); % Actual reboiler and condenser holdup
D=Ds+(MD-MDs)*KcD;       % Distillate flow
B=Bs+(MB-MBs)*KcB;       % Bottoms flow     

Jcol = pf*Feed + pV*Steam - pB*B - pD*D; 

Streams=[D; B;Jcol];
end