clear all
load Matlab_bif_data.mat;
load Matlab_ss_data.mat;
load OLGA_Bif_Data_w8;

% Production Choke Opening [%]
z_olga = 100*bifPlottingData(:,24);

% Pressure at Bottom Hole
y1_OLGA_max = bifPlottingData(:,9);
y1_OLGA_ss = bifPlottingData(:,17);
y1_OLGA_min = bifPlottingData(:,1);

% Mass Production Flow Rate
y2_OLGA_max = bifPlottingData(:,15);
y2_OLGA_ss = bifPlottingData(:,23);
y2_OLGA_min = bifPlottingData(:,7);

% Pressure at Bottom of Annulus
y3_OLGA_max = bifPlottingData(:,11);
y3_OLGA_ss = bifPlottingData(:,19);
y3_OLGA_min = bifPlottingData(:,3);

% Pressure at Top of Annulus
y4_OLGA_max = bifPlottingData(:,12);
y4_OLGA_ss = bifPlottingData(:,20);
y4_OLGA_min = bifPlottingData(:,4);

% Pressure at Top of Tubing
y5_OLGA_max = bifPlottingData(:,13);
y5_OLGA_ss = bifPlottingData(:,21);
y5_OLGA_min = bifPlottingData(:,5);

% Volume Production Flow Rate
c=1/86.4; %Conversion factor m3/d --> L/s
y6_OLGA_max = c*bifPlottingData(:,14);
y6_OLGA_ss = c*bifPlottingData(:,22);
y6_OLGA_min = c*bifPlottingData(:,6);

close all
titlesize=20;
gcaSize=16;
labelsize=16;
linesize=3;
figure(1)
clf
set(gcf,'Color',[1,1,1])
set(gca,'FontSize',gcaSize)

subplot(3,2,1)
%set(gca,'FontSize',8,'OuterPosition',[0  2/3  1/2  1/3])
plot(z_olga,y1_OLGA_max,'r','Linewidth',linesize);
hold on
plot(100*zs,y1min,'--k','Linewidth',linesize);
legend('OLGA- Model','Low-order Model')
plot(z_olga,y1_OLGA_ss,'r','Linewidth',linesize);
plot(100*zs,y1max,'--k','Linewidth',linesize);
plot(z_olga,y1_OLGA_min,'r','Linewidth',linesize);
plot(100*zss,y1ss,'--k','Linewidth',linesize);
title('a) Pressure at Bottom Hole (\itP\rm\bf_{bh})','FontSize',titlesize,'FontWeight','bold' );
ylabel('\itP\rm_{bh} [bar]','FontSize',labelsize )
xlabel('valve opening, \itZ\rm [%]','FontSize',labelsize )
xlim([0 100])
%ylim([270 300])
set(gca,'FontSize',gcaSize)

subplot(3,2,2)
%set(gca,'FontSize',8,'OuterPosition',[1/2  2/3  1/2  1/3])
plot(z_olga,y2_OLGA_max,'r','Linewidth',linesize);
hold on
plot(100*zs,y2min,'--k','Linewidth',linesize);
legend('OLGA- Model','Low-order Model')
plot(z_olga,y2_OLGA_ss,'r','Linewidth',linesize);
plot(100*zs,y2max,'--k','Linewidth',linesize);
plot(z_olga,y2_OLGA_min,'r','Linewidth',linesize);
plot(100*zss,y2ss,'--k','Linewidth',linesize);
title('b) Mass Production Flow Rate (\itw\rm\bf_{out})','FontSize',titlesize,'FontWeight','bold' );
ylabel('\itw\rm_{out} [kg/s]','FontSize',labelsize )
xlabel('valve opening, \itZ\rm [%]','FontSize',labelsize )
xlim([0 100])
%ylim([5 35])
set(gca,'FontSize',gcaSize)

subplot(3,2,3)
%set(gca,'FontSize',8,'OuterPosition',[0  1/3  1/2  1/3])
plot(z_olga,y3_OLGA_max,'r','Linewidth',linesize);
hold on
plot(100*zs,y3min,'--k','Linewidth',linesize);
legend('OLGA- Model','Low-order Model')
plot(z_olga,y3_OLGA_ss,'r','Linewidth',linesize);
plot(100*zs,y3max,'--k','Linewidth',linesize);
plot(z_olga,y3_OLGA_min,'r','Linewidth',linesize);
plot(100*zss,y3ss,'--k','Linewidth',linesize);
title('c) Pressure at Bottom of Annulus (\itP\rm\bf_{ab})','FontSize',titlesize,'FontWeight','bold' );
ylabel('\itP\rm_{ab} [bar]','FontSize',labelsize )
xlabel('valve opening, \itZ\rm [%]','FontSize',labelsize )
xlim([0 100])
%ylim([50 62])
set(gca,'FontSize',gcaSize)

subplot(3,2,4)
%set(gca,'FontSize',8,'OuterPosition',[1/2  1/3  1/2  1/3])
plot(z_olga,y4_OLGA_max,'r','Linewidth',linesize);
hold on
plot(100*zs,y4min,'--k','Linewidth',linesize);
legend('OLGA- Model','Low-order Model')
plot(z_olga,y4_OLGA_ss,'r','Linewidth',linesize);
plot(100*zs,y4max,'--k','Linewidth',linesize);
plot(z_olga,y4_OLGA_min,'r','Linewidth',linesize);
plot(100*zss,y4ss,'--k','Linewidth',linesize);
title('d) Pressure at Top of Annulus (\itP\rm\bf_{at})','FontSize',titlesize,'FontWeight','bold' );
ylabel('\itP\rm_{at} [bar]','FontSize',labelsize )
xlabel('valve opening, \itZ\rm [%]','FontSize',labelsize )
xlim([0 100])
%ylim([50 62])
set(gca,'FontSize',gcaSize)

subplot(3,2,5)
%set(gca,'FontSize',8,'OuterPosition',[0  0 1/2  1/3])
plot(z_olga,y5_OLGA_max,'r','Linewidth',linesize);
hold on
plot(100*zs,y5min,'--k','Linewidth',linesize);
legend('OLGA- Model','Low-order Model')
plot(z_olga,y5_OLGA_ss,'r','Linewidth',linesize);
plot(100*zs,y5max,'--k','Linewidth',linesize);
plot(z_olga,y5_OLGA_min,'r','Linewidth',linesize);
plot(100*zss,y5ss,'--k','Linewidth',linesize);
title('e) Pressure at Top of Tubing (\itP\rm\bf_{tt})','FontSize',titlesize,'FontWeight','bold' );
ylabel('\itP\rm_{tt} [bar]','FontSize',labelsize )
xlabel('valve opening, \itZ\rm [%]','FontSize',labelsize )
xlim([0 100])
%ylim([5 35])
set(gca,'FontSize',gcaSize)


subplot(3,2,6)
%set(gca,'FontSize',8,'OuterPosition',[1/2  0  1/2  1/3])
plot(z_olga,y6_OLGA_max,'r','Linewidth',linesize);
hold on
plot(100*zs,y6min,'--k','Linewidth',linesize);
legend('OLGA- Model','Low-order Model')
plot(z_olga,y6_OLGA_ss,'r','Linewidth',linesize);
plot(100*zs,y6max,'--k','Linewidth',linesize);
plot(z_olga,y6_OLGA_min,'r','Linewidth',linesize);
plot(100*zss,y6ss,'--k','Linewidth',linesize);
title('f) Outlet volumetric flow rate (\itQ\rm\bf_{out})','FontSize',titlesize,'FontWeight','bold' );
ylabel('\itQ\rm_{out} [litre/s]','FontSize',labelsize )
xlabel('valve opening, \itZ\rm [%]','FontSize',labelsize )
xlim([0 100])
%ylim([5 35])
set(gca,'FontSize',gcaSize)

