clear; data = xlsread('Hourly_electricity_data_2016.xlsx', 'H2:N8785'); consumption = data(:, 7 ); production = data(:, 1:6); % Duration curve ___________________________________________________________________________________________________________________________ sortedProduction = ; % TODO: sort the data to descending order figure(1); plot(sortedProduction, 'LineWidth', 1.5); colormap jet(6) xlabel('Hours (h)'); ylabel('Power (MW)'); title('Duration curve'); legend('Nuclear power', 'Hydropower', 'Wind power', 'CHP', 'Separate thermal production', 'Imports'); axis([0 9000 0 5000]); grid on; print(figure(1), '-dpng', '-r400', '1_duration'); % Variability histogram ____________________________________________________________________________________________________________________ timestep = 1; % 1 hour ramps = zeros(length(production) - 1, 6); for i = 1 : length(ramps) ramps(i, :) = ; % TODO: insert formula for calculating ramps end minBin = 100 * floor(min(min(ramps)) / 100); maxBin = 100 * ceil (max(max(ramps)) / 100); rampBins = minBin : 20 : maxBin; frequencies = hist(ramps, rampBins); figure(2); plot(rampBins, frequencies, 'LineWidth', 1.5); xlabel('Ramp-up/down (MW/h)'); ylabel('Frequency (number of 1 h timeslots)'); title('Variability histogram'); legend('Nuclear power', 'Hydropower', 'Wind power', 'CHP', 'Separate thermal production', 'Imports'); grid on; print(figure(2), '-dpng', '-r400', '1_variability');