A(1) = HyCase.Flowsheet.MaterialStreams.Item('F').MolarFlowValue * 3600; %Feed flow rate
A(2) = HyCase.Flowsheet.MaterialStreams.Item('F').ComponentMolarFractionValue(1);
A(3) = HyCase.Flowsheet.MaterialStreams.Item('F').ComponentMolarFractionValue(2);
A(4) = HyCase.Flowsheet.MaterialStreams.Item('F').ComponentMolarFractionValue(3);
A(5) = HyCase.Flowsheet.MaterialStreams.Item('F').ComponentMolarFractionValue(4);
q_Feed = calcq(HyCase,HyCase.Flowsheet.MaterialStreams.Item('F').TemperatureValue);
A(6) = q_Feed;
A(7) = HyCase.Flowsheet.MaterialStreams.Item('F').pressure.value;
A(8) = Col.ColumnFlowsheet.Pressures.value(1);
A(9) = Col.ColumnFlowsheet.Pressures.value(end);
A(10) = Specs.Item('Boilup rate').CurrentValue * 3600;
A(11) = Specs.Item('Reflux Rate').CurrentValue * 3600;
A(12) = Specs.Item('Distillate Rate').CurrentValue * 3600;
A(13) = Specs.Item('Btms Prod Rate').CurrentValue * 3600;
xD = HyCase.Flowsheet.MaterialStreams.Item('D').ComponentMolarFractionValue;
xB = HyCase.Flowsheet.MaterialStreams.Item('B').ComponentMolarFractionValue;
A(14) = xD(1);
A(15) = xD(2);
A(16) = xD(3);
A(17) = xD(4);
A(18) = xB(1);
A(19) = xB(2);
A(20) = xB(3);
A(21) = xB(4); 
A(22) = sum((xD-xDs).^2 ./(xD).^2) + sum((xB-xBs).^2 ./(xB).^2);
T = Col.ColumnFlowsheet.TemperaturesValue; 
A(23:length(T)+22) = T;

fid = fopen('Fconv_all_final_pref.txt', 'r+');
fseek(fid, 0, 'eof');
fprintf(fid, ' \n ');
for i=1:length(A)
    fprintf(fid, '%1.7e \t   ',A(i));
end

fclose(fid);
