% Script to plot results for tanks-in-series
% Comparing General, Integrating and Static Transforms
% Callum Kingstree
% Dec 2020

clc; clear all; close all

set(0,'DefaultTextFontName','Times',...
     'DefaultTextFontSize',20,...
     'DefaultAxesFontName','Times',...
     'DefaultAxesFontSize',20,...
     'DefaultLineLineWidth',4,...
     'DefaultLineMarkerSize',7.75,...
     'DefaultStairLineWidth',2)
 
filename = {'general','alternative','notrans'};
linetype = {':','--','-.'};  
linewidth = [6, 4, 3];

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];

black = [38/255 38/255 38/255];
grey = [120/255 120/255 120/255];
%linecol  = [peach;hotpink; coral; lilac];
linecol=[lighterblue; orange;grey];

for i =1:length(filename) % plot all saved results
     load(filename{i})
     
          figure(1) 
%      subplot(221)
     plot(t,T0,'Color',linecol(i,:),'LineStyle',linetype{i},...
         'LineWidth',linewidth(i))
     set(gca,'TickLabelInterpreter','latex')
     hold on    
     plot(t,T2,'Color',linecol(i,:),'LineWidth',linewidth(i))
     xlim([0 110])
     ylabel('Temperature [\textsuperscript{o}C]','Interpreter','latex')
     xlabel('Time [min]','Interpreter','latex')
     
end

hold on
plot(t,ysp,'Color',black,'LineStyle','--','LineWidth',2)

lgd = legend('$T_0$ (General)','$T_2$ (General)','$T_0$ (Alternative)',...
    '$T_2$ (Alternative)','$T_2$ (Feedback Only)','$T_0$ (Feedback Only)','$T_{2,sp}$',...
    'Interpreter','latex');
lgd.FontSize = 15;
