figure;

set(gcf,'Color',[1,1,1])
% clf
rect = [0, 0, 14,10];
set(gcf,'Color',[1,1,1],'PaperUnits','centimeters','PaperSize',[14 10],'PaperPosition',rect)
set(gca,'FontSize',16,'FontName','Times')


subplot(2,1,1) 

set(gca,'FontSize',16,'OuterPosition',[0  1/2  1 1/2]) 

semilogy([-200; t],[(x(1,NI+im_xt(2))); (x(:,NI+im_xt(2)))],'r','DisplayName','x_B^D','LineWidth',1);hold on
semilogy([-200; t],[(x(1,NI+im_xS1(1))); (x(:,NI+im_xS1(1)))],'g--','DisplayName','x_A^S','LineWidth',1)
semilogy([-200; t],[1-sum(x(1,NI+im_xS1),2); 1-sum(x(:,NI+im_xS1),2)],'g','DisplayName','x_C^S','LineWidth',1)

% semilogy([-200; t],[1-sum(x(1,NI+im_x1([1 coldata.Nt(1)+1])),2); 1-sum(x(:,NI+im_x1([1 coldata.Nt(1)+1])),2)],'b','DisplayName','x_C^{C1Top}','LineWidth',1)
% semilogy([-200; t],[(x(1,NI+im_x2(coldata.Nt(2)))); (x(:,NI+im_x2(coldata.Nt(2))))],'b-.','DisplayName','x_A^{C1Bot}','LineWidth',1)

semilogy([-200; t],[(x(1,NI+im_xr(2))); (x(:,NI+im_xr(2)))],'k-.','DisplayName','x_B^B','LineWidth',1)

% xlabel('time, min','FontName','Times','FontSize',16);
ylabel('mole fraction','FontName','Times','FontSize',16);
set(gca,'FontName','Times','FontSize',16,'ytick',[10^-4 10^-3 10^-2 10^-1])
legend(gca,'Location','NorthEast','Orientation','horizontal')
legend(gca,'boxoff');
xlim([-200 2000])
ylim([10^-4 10^-1])

subplot(2,1,2)

set(gca,'FontSize',16,'OuterPosition',[0  0  1 1/2]) 

plot([-200; UU(:,1)],[UU(1,3); UU(:,3)],'DisplayName','V_B','LineWidth',1)
hold on
plot([-200; UU(:,1)],[UU(1,11); UU(:,11)],'r','DisplayName','D','LineWidth',1)
hold on
plot([-200; UU(:,1)],[UU(1,6); UU(:,6)],'g--','DisplayName','S','LineWidth',1)
plot([-200; UU(:,1)],[UU(1,12); UU(:,12)],'k-.','DisplayName','B','LineWidth',1)

% plot([-200; UU(:,1)],[UU(1,4); UU(:,4)],'b','DisplayName','R_L','LineWidth',1)
% hold on
% plot([-200; UU(:,1)],[UU(1,5); UU(:,5)],'--r','DisplayName','R_V','LineWidth',1)
set(gca,'FontSize',16,'FontName','Times')

legend(gca,'Location','East','Orientation','horizontal')
legend(gca,'boxoff');
xlabel('time, min','FontName','Times','FontSize',16);
ylabel('inputs, mol/min','FontName','Times','FontSize',16);

xlim([-200 2000])





% subplot(2,1,3)
% set(gca,'FontSize',16,'OuterPosition',[0  0  1/2 1/2]) 
% 
% set(gca,'FontSize',16,'FontName','Times')
% 
% 
% set(gca,'FontName','Times','FontSize',16,'linewidth',1)
% 
% legend(gca,'Orientation','vertical')
% legend(gca,'boxoff');
% xlim([-200 2000])
% 
% xlabel('time, min');
% ylabel('mol/min');
% 
% 
% 
% subplot(2,1,4)
% set(gca,'FontSize',16,'OuterPosition',[1/2  0  1/2 1/2]) 
% 
% 
% xlabel('time, min','FontName','Times','FontSize',16);
% ylabel('mol/mol','FontName','Times','FontSize',16);
% xlim([-200 2000])


% subplot(2,1,4)
% 
% plot([-200; t],[(x(1,NI+im_x2(coldata.Nt(2)))); (x(:,NI+im_x2(coldata.Nt(2))))],'r','DisplayName','x_AC1^{bot}','LineWidth',1);hold on
% 
% plot([-200; t],[(x(1,NI+im_xr(2))); (x(:,NI+im_xr(2)))],'k-.','DisplayName','x_BReboiler','LineWidth',1)
% 
% xlabel('time, min','FontName','Times','FontSize',16);
% ylabel('mole fraction','FontName','Times','FontSize',16);
% 
% 
% set(gca,'FontName','Times','FontSize',16,'linewidth',1)
% legend(gca,'Location','SouthEast','Orientation','vertical')
% legend(gca,'boxoff');
% xlim([-200 2000])


% 
% 
% load CS2_All20_Specs_zf_13_53_33 t x  UU  NI
% 
% 
% figure;subplot(2,1,1) 
% plot(t,(x(:,NI+im_xt(1))),'r','DisplayName','x_D','LineWidth',1);hold on
% plot(t,[(x(1,NI+im_xS1(2))) (x(:,NI+im_xS1(2)))],'g--','DisplayName','x_S','LineWidth',1)
% plot(t,[1-sum(x(1,NI+im_xr),2) 1-sum(x(:,NI+im_xr),2)],'k-.','DisplayName','x_r','LineWidth',1)
% 
% xlabel('time, min','FontName','Times','FontSize',16);
% ylabel('mole fraction','FontName','Times','FontSize',16);
% 
% set(gca,'FontName','Times','FontSize',16,'linewidth',1)
% legend(gca,'Location','SouthEast','Orientation','vertical')
% legend(gca,'boxoff');
% xlim([-200 2000])
% ylim([0.95 1.005])
% 
% subplot(2,1,2)
% plot([-200; UU(:,1)],[UU(1,3); UU(:,3)],'DisplayName','x_D','LineWidth',1,'DisplayName','x_D','LineWidth',1)
% 
% subplot(2,1,3)
% plot(UU(:,1),UU(:,[6 11 12]))
% 
% subplot(2,1,4)
% plot(UU(:,1),UU(:,[4 6]))
% 
% load CS2_All20_Specs_zf_13_33_53 t x  UU  NI
% 
% figure;subplot(2,1,1) 
% plot(t,(x(:,NI+im_xt(1))),'r','DisplayName','x_D','LineWidth',1);hold on
% plot(t,[(x(1,NI+im_xS1(2))) (x(:,NI+im_xS1(2)))],'g--','DisplayName','x_S','LineWidth',1)
% plot(t,[1-sum(x(1,NI+im_xr),2) 1-sum(x(:,NI+im_xr),2)],'k-.','DisplayName','x_r','LineWidth',1)
% 
% xlabel('time, min','FontName','Times','FontSize',16);
% ylabel('mole fraction','FontName','Times','FontSize',16);
% 
% set(gca,'FontName','Times','FontSize',16,'linewidth',1)
% legend(gca,'Location','SouthEast','Orientation','vertical')
% legend(gca,'boxoff');
% xlim([-200 2000])
% ylim([0.95 1.005])
% 
% 
% subplot(2,1,2)
% plot([-200; UU(:,1)],[UU(1,3); UU(:,3)],'DisplayName','x_D','LineWidth',1,'DisplayName','V_B','LineWidth',1)
% 
% xlabel('time, min','FontName','Times','FontSize',16);
% ylabel('mole fraction','FontName','Times','FontSize',16);
% set(gca,'FontName','Times','FontSize',16,'linewidth',1)
% legend(gca,'Location','SouthEast','Orientation','vertical')
% legend(gca,'boxoff');
% 
% subplot(2,1,3)
% plot(UU(:,1),UU(:,[6 11 12]))
% 
% subplot(2,1,4)
% plot(UU(:,1),UU(:,[4 6]))
% 
% 
% load CS2_All20_Specs_zf_33_13_53 t x  UU  NI
% 
% figure;subplot(2,1,1) 
% plot(t,(x(:,NI+im_xt(1))),'r','DisplayName','x_D','LineWidth',1);hold on
% plot(t,[(x(1,NI+im_xS1(2))) (x(:,NI+im_xS1(2)))],'g--','DisplayName','x_S','LineWidth',1)
% plot(t,[1-sum(x(1,NI+im_xr),2) 1-sum(x(:,NI+im_xr),2)],'k-.','DisplayName','x_r','LineWidth',1)
% 
% xlabel('time, min','FontName','Times','FontSize',16);
% ylabel('mole fraction','FontName','Times','FontSize',16);
% 
% 
% set(gca,'FontName','Times','FontSize',16,'linewidth',1)
% legend(gca,'Location','SouthEast','Orientation','vertical')
% legend(gca,'boxoff');
% xlim([-200 2000])
% ylim([0.95 1.005])
% 
% subplot(2,1,2)
% plot([-200; UU(:,1)],[UU(1,3); UU(:,3)],'DisplayName','x_D','LineWidth',1,'DisplayName','x_D','LineWidth',1)
% 
% subplot(2,1,3)
% plot(UU(:,1),UU(:,[6 11 12]))
% 
% 
% subplot(2,1,4)
% plot(UU(:,1),UU(:,[4 6]))
% 
% load CS2_All20_Specs_zf_53_33_13 t x  UU NI
% 
% figure;subplot(2,1,1) 
% plot(t,(x(:,NI+im_xt(1))),'r','DisplayName','x_D','LineWidth',1);hold on
% plot(t,[(x(1,NI+im_xS1(2))) (x(:,NI+im_xS1(2)))],'g--','DisplayName','x_S','LineWidth',1)
% plot(t,[1-sum(x(1,NI+im_xr),2) 1-sum(x(:,NI+im_xr),2)],'k-.','DisplayName','x_r','LineWidth',1)
% 
% xlabel('time, min','FontName','Times','FontSize',16);
% ylabel('mole fraction','FontName','Times','FontSize',16);
% 
% 
% set(gca,'FontName','Times','FontSize',16,'linewidth',1)
% legend(gca,'Location','SouthEast','Orientation','vertical')
% legend(gca,'boxoff');
% xlim([-200 2000])
% ylim([0.95 1.005])
% 
% 
% subplot(2,1,2)
% plot([-200; UU(:,1)],[UU(1,3); UU(:,3)],'DisplayName','x_D','LineWidth',1,'DisplayName','x_D','LineWidth',1)
% subplot(2,1,3)
% plot(UU(:,1),UU(:,[6 11 12]))
% 
% subplot(2,1,4)
% plot(UU(:,1),UU(:,[4 6]))
% 
