% Plot dT/dd
%(Feed,dd1; composition zA, dd2; composition zB, dd3; Boilup, V, dd4; Vapor split
% ration, Rv, dd5)

stage=1:48;                            %stages in the main column
stage1=stage(13:36);            %stages in the prefractionator



load F1

%Plot F matrices for all disturbances
%Feed
figure (1)
%subplot(5,1,1)
F1f = F1(:,1);
Ffp = F1f(1:24);
plot(stage1,Ffp,'b','Linewidth',2.5)
xlim([1 50])
ylim([-300 150])
set(gca,'XTick',0:5:50);
set(gca,'YTick',-300:50:150);
xlabel('Stage','FontSize',12,'FontWeight','bold')
ylabel('F1 [Feed]','FontSize',12,'FontWeight','bold')
title('Optimal-sensitivity with respect to feed','FontSize',12,'FontWeight','bold')

hold on
Ffm=F1f(25:72);
plot(stage,Ffm,'r','Linewidth',2.5)
legend('Prefractionator','Main-column')
hold off

%zA
figure (2)
%subplot(5,1,2)

F1zA = F1(:,2);
FfzA = F1zA(1:24);
plot(stage1,FfzA,'b','Linewidth',2.5)
xlim([1 50])
ylim([-70 5])
set(gca,'XTick',0:5:50);
set(gca,'YTick',-70:7:5);
xlabel('Stage','FontSize',12,'FontWeight','bold')
ylabel('F1 [composition zA]','FontSize',12,'FontWeight','bold')
title('Optimal-sensitivity with respect to composition of  A in feed','FontSize',12,'FontWeight','bold')

hold on
FzAm=F1zA(25:72);
plot(stage,FzAm,'r','Linewidth',2.5)
legend('Prefractionator','Main-column')
hold off

%zB
figure(3)
%subplot(5,1,3)

F1zB = F1(:,3);
FzB = F1zB(1:24);
plot(stage1,FzB,'b','Linewidth',2.5)
xlim([1 50])
ylim([-150 200])
set(gca,'XTick',0:5:50);
set(gca,'YTick',-150:50:200);
xlabel('Stage','FontSize',12,'FontWeight','bold')
ylabel('F1 [composition zB]','FontSize',12,'FontWeight','bold')
title('Optimal-sensitivity with respect to composition of B in feed','FontSize',12,'FontWeight','bold')

hold on
FzBm=F1zB(25:72);
plot(stage,FzBm,'r','Linewidth',2.5)
legend('Prefractionator','Main-column')
hold off


%V
figure(4)
%subplot (5,1,4)

F1V = F1(:,4);
FVp = F1V(1:24);
plot(stage1,FVp,'b','Linewidth',2.5)
xlim([1 50])
ylim([-70 10])
set(gca,'XTick',0:5:50);
set(gca,'YTick',-70:10:10);
xlabel('Stage','FontSize',12,'FontWeight','bold')
ylabel('F1 [Boilup]','FontSize',12,'FontWeight','bold')
title('Optimal-sensitivity with respect to boilup','FontSize',12,'FontWeight','bold')
hold on
FVm=F1V(25:72);
plot(stage,FVm,'r','Linewidth',2.5)
legend('Prefractionator','Main-column')
hold off


% RV
figure(5)
%subplot(5,1,5)

F1RV = F1(:,5);
FRVp = F1RV(1:24);
plot(stage1,FRVp,'b','Linewidth',2.5)
xlim([1 50])
ylim([-7 1])
set(gca,'XTick',0:5:50);
set(gca,'YTick',-7:1:1);
xlabel('Stage','FontSize',12,'FontWeight','bold')
ylabel('F1 [Vapor split ratio]','FontSize',12,'FontWeight','bold')
title('Optimal-sensitivity with respect to vapor split ratio','FontSize',12,'FontWeight','bold')
hold on
FRVm=F1RV(25:72);
plot(stage,FRVm,'r','Linewidth',2.5)
legend('Prefractionator','Main-column')
hold off


