clear all; close all; clc;

%extracting values from 42 stages:
reflux42    = xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','b7:b35');
heatduty42  = xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','as7:as35');
sumx42      = xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','bu7:bu35');
    %nstage42    = xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','br7:br7');

%extracting values from 50 stages:
reflux50    = xlsread('M:\Diplom\kaibel_50stages_reflux12.xls','sheet1','b7:b28');
heatduty50  = xlsread('M:\Diplom\kaibel_50stages_reflux12.xls','sheet1','ba7:ba28');
sumx50      = xlsread('M:\Diplom\kaibel_50stages_reflux12.xls','sheet1','cb7:cb28');
    %nstage50    = xlsread('M:\Diplom\kaibel_50stages_reflux12.xls','sheet1','bz7:bz7');

%extracting values from 59 stages:
reflux59    = xlsread('M:\Diplom\kaibel_59stages_reflux12.xls','sheet1','b7:b20');
heatduty59  = xlsread('M:\Diplom\kaibel_59stages_reflux12.xls','sheet1','bj7:bj20');
sumx59      = xlsread('M:\Diplom\kaibel_59stages_reflux12.xls','sheet1','ck7:ck20');
    %nstage59    = xlsread('M:\Diplom\kaibel_59stages_reflux12.xls','sheet1','ci7:ci7');



%Scale the results so they all show for the same refluxes. Some results are
%not available for all refluxes.
scale = 1;

if scale==1;
    size(1)=length(reflux42);
    size(2)=length(reflux50);
    size(3)=length(reflux59);
    
    i = min(size);%Finds the largest common reflux value.
    
    reflux42 = reflux42(1:i); heatduty42 = heatduty42(1:i); sumx42 = sumx42(1:i);
    reflux50 = reflux50(1:i); heatduty50 = heatduty50(1:i); sumx50 = sumx50(1:i);
    reflux59 = reflux59(1:i); heatduty59 = heatduty59(1:i); sumx59 = sumx59(1:i);
end


figure(1)
plot(reflux42,heatduty42,'-b',reflux50,heatduty50,'-.k',reflux59,heatduty59,'--r'),xlabel('Reflux (L/D)'),ylabel('Heat duty (V) [W]'),legend('42 stages','50 stages','59 stages');

figure(2)
plot(reflux42,sumx42,'-b',reflux50,sumx50,'-.k',reflux59,sumx59,'--r'),xlabel('Reflux (L/D)'),ylabel('Sum x'),legend('42 stages','50 stages','59 stages');
