close all

figWidth = 0.4;
figHeight = 0.4;
figX = 0.02;
figXIncr = 1.1 * figWidth;
figY = 0.5;
figYIncr = -1.1 * figHeight;

profile(8) = [];

fig = figure('Name','Hotel Power','NumberTitle','off');
for i = 1:length(profile)
    hold on
    fig.Units = 'normalized';
    fig.Position = [figX figY figWidth figHeight];
    title('Hotel Power')
    if(i == 1)
        startDT = 3;
    else
        startDT = 2;
    end
    
    clear x;
    for j=1:length(profile(i).hotelWattsDT)
        x(j) = profile(i).hotelWattsDT(startDT);
    end
        
    plot3(x(startDT:end), profile(i).hotelWattsDT(startDT:end) - profile(i).hotelWattsDT(startDT), profile(i).hotelWatts(startDT:end))
    set(gca, 'YDir', 'reverse')
    xlabel('Profile Start time');
    ylabel('Time from Profile Start')
    zlabel('Watts')
    grid
    view(3)
end

fig = figure('Name','Hotel Energy','NumberTitle','off');
for i = 1:length(profile)
    hold on
    fig.Units = 'normalized';
    fig.Position = [figX + figXIncr figY figWidth figHeight];
    title('Hotel Energy')
    if(i == 1)
        startDT = 3;
    else
        startDT = 2;
    end
    
    clear x;
    for j=1:length(profile(i).hotelJoulesDT)
        x(j) = profile(i).hotelJoulesDT(startDT);
    end
        
    plot3(x(startDT:end), profile(i).hotelJoulesDT(startDT:end) - profile(i).hotelJoulesDT(startDT), profile(i).hotelJoules(startDT:end))
    set(gca, 'YDir', 'reverse')
    xlabel('Profile Start time');
    ylabel('Time from Profile Start')
    zlabel('Joules')
    grid
    view(270,0)
end

fig = figure('Name','Pump Power','NumberTitle','off');
for i = 1:length(profile)
    hold on
    fig.Units = 'normalized';
    fig.Position = [figX figY + figYIncr, figWidth figHeight];
    title('Pump Power')
    if(i == 1)
        startDT = 3;
    else
        startDT = 2;
    end
    
    clear x;
    for j=1:length(profile(i).pumpWattsDT)
        x(j) = profile(i).pumpWattsDT(startDT);
    end
        
    plot3(x(startDT:end), profile(i).pumpWattsDT(startDT:end) - profile(i).pumpWattsDT(startDT), profile(i).pumpWatts(startDT:end))
    set(gca, 'YDir', 'reverse')
    xlabel('Profile Start time');
    ylabel('Time from Profile Start')
    zlabel('Watts')
    grid
    view(3)
end

fig = figure('Name','Pump Energy','NumberTitle','off');
for i = 1:length(profile)
    hold on
    fig.Units = 'normalized';
    fig.Position = [figX + figXIncr figY + figYIncr figWidth figHeight];
    title('Pump Energy')
    if(i == 1)
        startDT = 3;
    else
        startDT = 2;
    end
    
    clear x;
    for j=1:length(profile(i).pumpJoulesDT)
        x(j) = profile(i).pumpJoulesDT(startDT);
    end
        
    plot3(x(startDT:end), profile(i).pumpJoulesDT(startDT:end) - profile(i).pumpJoulesDT(startDT), profile(i).pumpJoules(startDT:end))
    set(gca, 'YDir', 'reverse')
    xlabel('Profile Start time');
    ylabel('Time from Profile Start')
    zlabel('Joules')
    grid
    view(270,0)
end

fig = figure('Name','Total Energy','NumberTitle','off');
for i = 1:length(profile)
    hold on
    fig.Units = 'normalized';
    %fig.Position = [figX + figXIncr figY + figYIncr figWidth figHeight];
    title('Total Energy')
    if(i == 1)
        startDT = 3;
    else
        startDT = 2;
    end
    
    clear x;
    for j=1:length(profile(i).pumpJoulesDT)
        x(j) = profile(i).totalJoulesDT(startDT);
    end
        
    plot3(x(startDT:end), profile(i).totalJoulesDT(startDT:end) - profile(i).totalJoulesDT(startDT), profile(i).totalJoules(startDT:end))
    set(gca, 'YDir', 'reverse')
    xlabel('Profile Start time');
    ylabel('Time from Profile Start')
    zlabel('Joules')
    grid
    view(270,0)
end

