clear
clc
close all
%% Load
addpath('../Exogenous_information')
load('sample_path.mat')
plot_settings

%%
Elec_use = sample_path.D - 210; % Demand - Supply
Unsat_Demand = Elec_use > 0; % If Demand - Supply > 0, then 1, or 0.
Elec_use = Elec_use.*Unsat_Demand; % Required heat to satisfy the demand
spot_cost = Elec_use.*sample_path.P; %The cost to satisfy the demand on each time

operation_cost = sum(spot_cost,2); %The cost to satisfy the demand on each operation
Expected_cost = mean(operation_cost);

Accumu_mean = [];
for i = 1:size(operation_cost,2)
    AA = mean(operation_cost(1:i));
    Accumu_mean =[Accumu_mean; AA];
end

Save('P00_woTES')