% Visualise the results

%% plot hot stream flow rates
f1=figure;
endTime = flowR1.time(end);
subplot(10,1,1)
    plot(flowR1.time,flowR1.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]')
    axis([0 endTime 0 0.05])
subplot(10,1,2)
    plot(flowR2.time,flowR2.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]') 
    axis([0 endTime 0 0.05])
subplot(10,1,3)
    plot(flowR3.time,flowR3.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]')
    axis([0 endTime 0 0.05])
subplot(10,1,4)
    plot(flowR4.time,flowR4.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]')
    axis([0 endTime 0 0.05])
subplot(10,1,5)
    plot(flowR5.time,flowR5.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]')
    axis([0 endTime 0 0.05])
subplot(10,1,6)
    plot(flowR6.time,flowR6.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]')  
    axis([0 endTime 0 0.05])
subplot(10,1,7)
    plot(flowR7.time,flowR7.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]')
    axis([0 endTime 0 0.05])
subplot(10,1,8)
    plot(flowR8.time,flowR8.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]')
    axis([0 endTime 0 0.05])
subplot(10,1,9)
    plot(flowR9.time,flowR9.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]') 
    axis([0 endTime 0 0.05])
subplot(10,1,10)
    plot(flowR10.time,flowR10.signals.values,'LineWidth',3)
    ylabel('[m^3/min]')
    xlabel('time [min]')  
    axis([0 endTime 0 0.05]) 
    
%print(f1,'-r80', '-depsc2','hotStreams.eps')
%print(f1,'-r80', '-dpdf' , 'hotStreams.pdf') 

%% Plot the cold stream temperatuere and flow rate
f2 = figure
subplot(2,1,1)
    plot(q0flow.time, q0flow.signals.values,'LineWidth',3)
    title('Total cold flow rate','FontSize',16)
    ylabel('[m^3/min]','FontSize',16)
    xlabel('time [min]','FontSize',16)
    set(gca,'FontSize',16)
    axis([0 endTime 0 0.1])
    
subplot(2,1,2)
    plot(T0.time,T0.signals.values,'LineWidth',3)
    title('Cold stream temperature','FontSize',16)
    ylabel('Temperature [^\circ C]','FontSize',16)
    xlabel('time','FontSize',16)
    axis([0 endTime 50 90])
    set(gca,'FontSize',16)
%% Plot the hot stream temperatures
f3 = figure
    title('Hot stream temperatures','FontSize',16)
    bar(BT,'LineWidth',3)
    ylabel('^\circ C','FontSize',16)
    xlabel('Hot stream','FontSize',16)
    axis([0 11 0 260]) 
    set(gca,'FontSize',16)
    
%% Plot the mixing temperature
f4 = figure
    plot(Tmix.time,Tmix.signals.values, 'LineWidth',3)
    title('Mixing temperature','FontSize',16)
    ylabel('Temperature [^\circ C]','FontSize',16)
    xlabel('time [min]','FontSize',16)
    axis([0 endTime 0 200])
    set(gca,'FontSize',16)   
%% split fraction
f5 = figure 
    plot(fractionfi.time, fractionfi.signals.values,'LineWidth',2)
    title('Cold stream split','FontSize',16)
    ylabel('','FontSize',16)
    xlabel('time [min]','FontSize',16)
    axis([0 endTime -0.2 1.2])
    set(gca,'FontSize',16) 
    %%  Qheater
f5 = figure 
    plot(Qheater.time, Qheater.signals.values,'LineWidth',2)
    title('Heater Duty','FontSize',16)
    ylabel('kW','FontSize',16)
    xlabel('time [min]','FontSize',16)
    axis([0 endTime 0 700])
    set(gca,'FontSize',16) 