%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:
reflux=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','b7:b35');
tempprofilecolumn1=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','c7:ad35');
tempprofilecolumn2=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','ae7:ar35');
heatduty=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','as7:as35');
prodstreamD=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','at7:aw35');
prodstreamS1=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','ax7:ba35');
prodstreamS2=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','bb7:be35');
prodstreamB=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','bf7:bi35');
nstage=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','br7:br7');
prodstream_frac_sum=xlsread('M:\Diplom\kaibel_test_results_working_prefrac_split.xls','sheet1','bu7:bu35');



[runs,nstage1]=size(tempprofilecolumn1);
[runs,nstage2]=size(tempprofilecolumn2);

n1=(1:nstage1);
n2=(1:nstage2);

nsplittop=6;        %the plate where the TOP connect streams are connected (on column 1).
nsplittbottom=23;   %the plate where the BOTTOM connect streams are connected (on column 1).

n2stage_rel_to_1_temp=linspace(nsplittop+1,nsplittbottom-1,length(n2))+.6;
n2stage_rel_to_1=[(1:nsplittop) n2stage_rel_to_1_temp (nsplittbottom:nstage1)];

tempprofilecolumn2_1=[tempprofilecolumn1(:,1:nsplittop) tempprofilecolumn2 tempprofilecolumn1(:,nsplittbottom:nstage1)];



%figure

%plot(n1,tempprofilecolumn1,'b',n2stage_rel_to_1,tempprofilecolumn2_1,'y');
%hold on;
figure,plot(n1,tempprofilecolumn1(1,:),':b',n2stage_rel_to_1,tempprofilecolumn2_1(1,:),'-b'),xlabel('Stage number'),ylabel('Temperature [K]'),%legend(['reflux=',num2str(reflux(1)),'']);
figure,plot(n1,tempprofilecolumn1(2,:),':b',n2stage_rel_to_1,tempprofilecolumn2_1(2,:),'-b'),xlabel('Stage number'),ylabel('Temperature [K]'),%legend(['reflux=',num2str(reflux(2)),'']);
figure,plot(n1,tempprofilecolumn1(3,:),':b',n2stage_rel_to_1,tempprofilecolumn2_1(3,:),'-b'),xlabel('Stage number'),ylabel('Temperature [K]'),%legend(['reflux=',num2str(reflux(3)),'']);
%plot(n1,tempprofilecolumn1(3,:),'--y',n2stage_rel_to_1,tempprofilecolumn2_1(3,:),'--y');
%legend(['reflux=',num2str(reflux(1))],[],['reflux=',num2str(reflux(2))],[],[],[])
%legend(['reflux=',num2str(reflux(1)),', temp profile column 1'],['reflux=',num2str(reflux(1)),', temp profile column 2'],['reflux=',num2str(reflux(2)),', temp profile column 1'],['reflux=',num2str(reflux(2)),', temp profile column 2']);
%hold off;
%title(['temp profile of refluxes',num2str(x(1:i)),'plot'])

