%%Experimental data
%Takes data in text file with columns for: (1) Fractional day of year
% (2) cumulative mol. (3) pressure (MPa) (4) cumulative V (mL)
expData=load('HVT0007depress.csv');
%Takes in data from text file with columns for (1) Frac. day of year
% (2) inlet P (3) outlet P (4) confining P (5) confining T (6) room T
% (7) box T
DAQ=load('HVT0007DAQ.csv');

%Show salinity lines
gasx=0:0.05:0.3;
for i=1:length(gasx)
    S0(i)=2.8605;   %Pressure at 0 salinity
    S3(i)=3.1121;   %Pressure at seawater salinity (0.3 wt.%)
    S6(i)=3.3453;   %Pressure at 0.6 wt. %
end

%% Plot time series of overall DAQ data and gas volume
figure(1)
%Pressure data
subplot(4,1,1)
plot(DAQ(:,1),DAQ(:,2),'k-','LineWidth',2)
ylim([0 1800])
xlim([287.5 292])
ylabel('Pressure (psi)','FontSize',15)
set(gca,'XTick',(287.5:1:291),'YTick',(0:500:2000))
set(gca,'FontSize',15,'LineWidth',1.5)
%Gas volume
subplot(4,1,2)
plot(expData(:,1),expData(:,4),'ko--')
ylim([0 5000])
xlim([287.5 292])
ylabel('Gas recovery (mL)','FontSize',15)
set(gca,'XTick',(287.5:1:292),'YTick',(0:1000:5000))
set(gca,'FontSize',15,'LineWidth',1.5)
%Confining temp
subplot(4,1,3)
plot(DAQ(:,1),DAQ(:,5),'b-','LineWidth',2)
ylim([0.5 1.5])
xlim([287.5 292])
ylabel('Confining T (\circC)','FontSize',15)
set(gca,'XTick',(287.5:1:292),'YTick',(0.5:0.5:1.5))
set(gca,'FontSize',15,'LineWidth',1.5)
%Room and box temp
subplot(4,1,4)
plot(DAQ(:,1),DAQ(:,6),'b:',DAQ(:,1),DAQ(:,7),'r-','LineWidth',2)
ylim([18 28])
xlim([287.5 292])
ylabel('Room and box T (\circC)','FontSize',15)
xlabel('Day of Year','FontSize',15)
set(gca,'XTick',(287.5:1:292),'YTick',(20:2:28))
set(gca,'FontSize',15,'LineWidth',1.5)
legend('Room','Box','Location','Southeast')

%%Plot overall experimental data
figure(2)
subplot(2,1,1)
plot(expData(:,4),expData(:,3),'ko--')
ylim([0 12])
xlim([0 5000])
ylabel('Pressure (MPa)','FontSize',15)
xlabel('Cumulative gas recovery (mL)','FontSize',15)
set(gca,'XTick',(0:500:5000),'YTick',(0:2:12))
set(gca,'FontSize',15,'LineWidth',1.5)
subplot(2,1,2)
plot(expData(:,2),expData(:,3),'ko--')
ylim([0 12.5])
xlim([0 0.2])
ylabel('Pressure (MPa)','FontSize',15)
xlabel('Cumulative gas recovery (mol)','FontSize',15)
set(gca,'XTick',(0:0.05:0.2),'YTick',(0:2:12.5))
set(gca,'FontSize',15,'LineWidth',1.5)

%Plot example pressure drops for high P regime of free gas
figure(3)
plot(DAQ(:,1),DAQ(:,2),'k.--','LineWidth',1)
ylim([400 1200])
xlim([287.636 287.643])
ylabel('Pressure (psi)','FontSize',15)
xlabel('Day of Year')
set(gca,'XTick',(287.636:0.005:287.643),'YTick',(400:200:1200))
set(gca,'FontSize',15,'LineWidth',1.5)

%Plot second example pressure drops for high P regime of free gas
%Overnight drop in P
figure(4)
plot(DAQ(:,1),DAQ(:,2),'k.--','LineWidth',1)
ylim([1000 1700])
xlim([304.6 305])
ylabel('Pressure(psi)','FontSize',15)
xlabel('Day of Year')
set(gca,'XTick',(304.5:0.1:305),'YTick',(1000:100:1700))
set(gca,'FontSize',15,'LineWidth',1.5)

%Plot example pressure drops for beginning of hydrate dissociation
figure(5)
plot(DAQ(:,1),DAQ(:,2),'k.--','LineWidth',1)
ylim([460 480])
xlim([309.465 309.55])
ylabel('Pressure (psi)','FontSize',15)
xlabel('Day of Year')
set(gca,'XTick',(304:0.025:317),'YTick',(400:5:500))
set(gca,'FontSize',15,'LineWidth',1.5)

%Plot example pressure drops for middle of hydrate dissociation
figure(6)
plot(DAQ(:,1),DAQ(:,2),'k.--','LineWidth',1)
ylim([400 450])
xlim([289.62 289.82])
ylabel('Pressure (psi)','FontSize',15)
xlabel('Day of Year')
set(gca,'XTick',(289.65:0.05:289.8),'YTick',(410:10:440))
set(gca,'FontSize',15,'LineWidth',1.5)

%Plot example pressure drops for low pressure free gas regime
figure(7)
plot(DAQ(:,1),DAQ(:,2),'k.--','LineWidth',1)
ylim([200 250])
xlim([291.7214 291.7245])
ylabel('Pressure (psi)','FontSize',15)
xlabel('Day of Year')
set(gca,'XTick',(291.7215:0.001:291.7245),'YTick',(200:10:250))
set(gca,'FontSize',15,'LineWidth',1.5)

%Plot high P free gas
figure(8)
plot(expData(:,2),expData(:,3),'ko--')
ylim([0 12])
xlim([0 0.02])
ylabel('Pressure (MPa)','FontSize',15)
xlabel('Cumulative gas recovery (mol)','FontSize',15)
set(gca,'XTick',(0:0.005:0.2),'YTick',(0:2:12))
set(gca,'FontSize',15,'LineWidth',1.5)

%Plot hydrate regime
figure(9)
plot(expData(:,2),expData(:,3),'ko--',gasx,S0,'r-',gasx,S6,'b-')
ylim([2 4])
xlim([0.026 0.129])
ylabel('Pressure (MPa)','FontSize',15)
xlabel('Cumulative gas recovery (mol)','FontSize',15)
set(gca,'XTick',(0:0.02:0.2),'YTick',(0:0.25:12))
set(gca,'FontSize',15,'LineWidth',1.5)

%Plot low P free gas
figure(10)
plot(expData(:,2),expData(:,3),'ko--')
ylim([0 5])
xlim([0.0 0.5])
ylabel('Pressure (MPa)','FontSize',15)
xlabel('Cumulative gas recovery (mol)','FontSize',15)
set(gca,'XTick',(0:0.01:0.5),'YTick',(0:0.5:12))
set(gca,'FontSize',15,'LineWidth',1.5)

