% Script to plot results for pH
% Intrating transform
% Callum Kingstree
% Dec 2020

clc; clear all; close all

set(0,'DefaultTextFontName','Times',...
     'DefaultTextFontSize',15,...
     'DefaultAxesFontName','Times',...
     'DefaultAxesFontSize',15,...
     'DefaultLineLineWidth',4,...
     'DefaultLineMarkerSize',7.75,...
     'DefaultStairLineWidth',2)
 
%filename = {'combination_cH.mat','combination_cHsp.mat','combination_no_outer.mat','combination_no_outercH.mat'};
linetype = {':','--','-.','-.'};  
linewidth = [4, 3.5, 3, 2.5];

hotpink  = [0.8945    0.4102    0.5898];
peach    = [243/255 146/255 75/255];
coral  = [102/255 214/255 174/255];
lilac = [136/255 122/255 183/255];
orange = [204/255 68/255 10/255];
blue = [0 6/255 102/255];
red = [255/255 89/255 89/255];
lighterblue = [0/255 68/255 178/255];
darkpink = [229/255 57/255 143/255];
minty = [8/255 165/255 105/255];
purple = [59/255 40/255 96/255];
black = [38/255 38/255 38/255];
grey = [120/255 120/255 120/255];
%linecol  = [peach;hotpink; coral; lilac];
linecol  = [peach;hotpink; coral; lilac; blue; purple];


load('Integrating.mat')

figure(1)   
plot(t,T,'Color',linecol(5,:),'LineWidth',4)
set(gca,'TickLabelInterpreter','latex')
xlim([0 10000])
ylabel({'Reactor Temperature [K]'},'Interpreter','latex')
xlabel('Time [s]','Interpreter','latex')
hold on
plot(t,T_set_in,'Color',linecol(4,:),'LineWidth',4,'LineStyle','--')

lgd = legend('Temperature','Temperature Set-point','Interpreter','latex')
lgd.FontSize = 13;
x0=10;
y0=10;
width=450;
height=350;
set(gcf,'position',[x0,y0,width,height])


figure(2)
plot(t,valve,'Color',linecol(5,:),'LineWidth',4)
set(gca,'TickLabelInterpreter','latex')
xlim([0 10000])
ylabel('Valve Position [%]','Interpreter','latex')
xlabel('Time [s]','Interpreter','latex')
set(gcf,'position',[x0,y0,width,height])


figure(3)
plot(t,Tj,'Color',linecol(5,:),'LineWidth',4)
set(gca,'TickLabelInterpreter','latex')
xlim([0 10000])
ylabel('Jacket Temperature [K]','Interpreter','latex')
xlabel('Time [s]','Interpreter','latex')
set(gcf,'position',[x0,y0,width,height])


figure(4)
plot(t,error,'Color',linecol(5,:),'LineWidth',4)
set(gca,'TickLabelInterpreter','latex')
xlim([0 10000])
ylabel('Error [K]','Interpreter','latex')
xlabel('Time [s]','Interpreter','latex')
set(gcf,'position',[x0,y0,width,height])