%script for reading and plotting the excel results

%results=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls',
%'sheet1','b7:bf35');


%Extracting results from the excel worksheet:
rv=xlsread('M:\Diplom\kaibel_42stages_reflux12_rv.xls','sheet1','b7:b15');
heatduty=xlsread('M:\Diplom\kaibel_42stages_reflux12_rv.xls','sheet1','as7:as15');
prodstreamD=xlsread('M:\Diplom\kaibel_42stages_reflux12_rv.xls','sheet1','at7:aw15');
prodstreamS1=xlsread('M:\Diplom\kaibel_42stages_reflux12_rv.xls','sheet1','ax7:ba15');
prodstreamS2=xlsread('M:\Diplom\kaibel_42stages_reflux12_rv.xls','sheet1','bb7:be15');
prodstreamB=xlsread('M:\Diplom\kaibel_42stages_reflux12_rv.xls','sheet1','bf7:bi15');
prodstream_frac_sum=xlsread('M:\Diplom\kaibel_42stages_reflux12_rv.xls','sheet1','bu7:bu15');

scale=0;
prodfrac=1;
scale2=0;

if scale==1;
    heatduty = heatduty./1e6;
end
    
if prodfrac==1;
    prodstreamD = prodstreamD(:,1);
    prodstreamS1 = prodstreamS1(:,2);
    prodstreamS2 = prodstreamS2(:,3);
    prodstreamB = prodstreamB(:,4);
end

if scale2==1;
    prodstream_frac_sum = prodstream_frac_sum./4;
end



figure
%hold on;
plot(rv,heatduty,'b'),xlabel('Vapour split (Rv)'),ylabel('Heat duty (V) [W]') %legend('Boil-up');
%plot(rv,prodstreamD,'b-'); %legend('Stream D');
%plot(rv,prodstreamS1,'k.-'); %legend('Stream S1');
%plot(rv,prodstreamS2,'g--'); %legend('Stream S2');
%plot(rv,prodstreamB,'r:'); %legend('Stream B');
%legend('Stream D','Stream S1','Stream S2','Stream B');
figure
plot(rv,prodstream_frac_sum,'b'),xlabel('Vapour split (Rv)'), ylabel('Sum x'),%legend('Sum of product fractions');
%legend('Sum of product fractions')
%hold off;


