function J = Goal_2est(xDs,xBs)
    global Col 
    D     = Col.Flowsheet.MaterialStreams.Item('D');
    B     = Col.Flowsheet.MaterialStreams.Item('B');
  
    xD = D.ComponentMolarFractionValue;
    xB = B.ComponentMolarFractionValue;

   % J = sum(abs(xD-xDs)) + sum(abs(xB-xBs));
%     index1 = find(xDi>1e-5); index2 = find(xBi>1e-5); 
%     xD = xDi(index1); xB = xBi(index2); xDs = xDsi(index1); xBs = xBsi(index2);
%     J = sum((xD-xDs).^2 ./(xD).^2) + sum((xB-xBs).^2 ./(xB).^2); 
    
    J = sum((xD-xDs).^2) + sum((xB-xBs).^2); 
