Skip to content

Commit e6c5e31

Browse files
committed
Latest update of 2024; multi-year simulation
added a multi-year version that simulates 2024 up to 2030 in order to see day-ahead price formation change quantified by how much more installed capacity of Offshore Wind and Solar PV
1 parent be29177 commit e6c5e31

30 files changed

+623282
-8783
lines changed

.DS_Store

2 KB
Binary file not shown.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
Onbalans_passief/NREL_baseline_2019.csv
3+
Onbalans_passief/NREL_baseline_2019.xlsx
4+
Onbalans_passief/NREL_visitor_parking.csv
-4.83 KB
Binary file not shown.
-151 Bytes
Binary file not shown.

Excess_energy_depth_v1 kopie.png

156 KB
Loading

Lipton_MultiYear_v1.pdf

-144 KB
Binary file not shown.

Lipton_v4_5_Feb2023.pdf

-2.24 KB
Binary file not shown.

Lipton_v4_5_Link_Axes.m

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,16 @@
200200
%price_electricity(residual_fossil_production==0) = 0; % set price to 0 for moments of excess electricity
201201

202202
% v5 price based on gas and CO2 price
203-
gas = [55; 80]; % €/MWh thermal for low and high scenario
204-
plant_eff = 0.49; % [-] thermal to elec eff
203+
gas = [22; 28]; % €/MWh thermal for 2022 and 2030 scenario
204+
plant_eff = 0.56; % [-] thermal to elec eff
205205
gasplant_fuel_cost = gas./plant_eff;
206206
CO2_price = [85; 150]; % €/tCO2 emitted in 2022 and in 2030
207207
CO2_emit_gas_plant = 549; % gCO2/kWh = kgCO2/MWh thermal gas
208208
CO2_marginal_cost = CO2_price .* CO2_emit_gas_plant./1000; % €/MWh additional due to CO2 costs
209209
gasplant_marginal_cost = gasplant_fuel_cost + CO2_marginal_cost % €/MWh electricity delivered marginal costs
210210

211-
fossil_min_price = 59.8; % €/MWh
212-
gasplant_nom_cost_at_residual_load = 12; % GW
211+
fossil_min_price = 44; % €/MWh
212+
gasplant_nom_cost_at_residual_load = 15; % GW
213213
bid_incl_exponential = log(gasplant_marginal_cost/fossil_min_price)/(gasplant_nom_cost_at_residual_load*1000);
214214
% exponential price options:
215215
price_electricity(:,1) = fossil_min_price.*exp(residual_load_curves(:,1).*bid_incl_exponential(1)); % [€/MWh] and if residual < 0 than €0/MWh if 0 fossil production or negative residual = excess reneawble energly production
@@ -1092,7 +1092,34 @@
10921092

10931093

10941094

1095+
%% Save prices to xlsx
1096+
h8 = figure();
1097+
stairs(time_array(:,2),price_electricity(:,2))
1098+
hold on
1099+
stairs(time_array(:,2),price_electricity(:,1))
1100+
grid
1101+
legend('2030 Matlab','2022 reverse modelled')
1102+
ylabel('Hourly Day-Ahead market Electricity price €/MWh')
1103+
title(sprintf('Year: %.0f, Consumption: %.1f TWh, %.1f GW Wind, %.1f GWp PV, Wind gen: %.0f prct, PV gen: %.0f prct', jaren(jaar),Cons_annual(jaar)/1000, P_wind_installed_array(jaar)/1000 ,P_zon_installed_array(jaar)/1000, Prod_wind_perc(jaar)*100, Prod_solar_perc(jaar)*100) )
1104+
1105+
%%
1106+
save_fig(h8,'Matlab-Day-Ahead-prices-2022-2030');
1107+
10951108

1109+
%%
1110+
price_electricity_table = table;
1111+
1112+
price_electricity_table.time = time_array(:,2);
1113+
price_electricity_table.price_2022 = price_electricity(:,1);
1114+
price_electricity_table.price_2030 = price_electricity(:,2);
1115+
1116+
1117+
%%
10961118

1119+
writetable(price_electricity_table,'Matlab-Day-Ahead-prices-2022-2030_table.xlsx')
1120+
writetable(price_electricity_table,'Matlab-Day-Ahead-prices-2022-2030_table.csv')
10971121

1122+
%xlswrite('Matlab-Day-Ahead-prices-2022-2030_table.xlsx',price_electricity_table)
10981123

1124+
% writematrix(price_electricity,'M_tab.csv')
1125+
% csvwrite('price_electricity_upto1200.csv',price_electricity)

Lipton_v4_5_Link_Axes.asv renamed to Lipton_v4_6_export_xlsx.m

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,16 @@
200200
%price_electricity(residual_fossil_production==0) = 0; % set price to 0 for moments of excess electricity
201201

202202
% v5 price based on gas and CO2 price
203-
gas = [40; 80]; % €/MWh thermal for low and high scenario
204-
plant_eff = 0.55; % [-] thermal to elec eff
203+
gas = [22; 28]; % €/MWh thermal for 2022 and 2030 scenario
204+
plant_eff = 0.56; % [-] thermal to elec eff
205205
gasplant_fuel_cost = gas./plant_eff;
206-
CO2_price = [80; 150]; % €/tCO2 emitted in 2022 and in 2030
206+
CO2_price = [85; 150]; % €/tCO2 emitted in 2022 and in 2030
207207
CO2_emit_gas_plant = 549; % gCO2/kWh = kgCO2/MWh thermal gas
208208
CO2_marginal_cost = CO2_price .* CO2_emit_gas_plant./1000; % €/MWh additional due to CO2 costs
209209
gasplant_marginal_cost = gasplant_fuel_cost + CO2_marginal_cost % €/MWh electricity delivered marginal costs
210210

211-
fossil_min_price = 59.8; % €/MWh
212-
gasplant_nom_cost_at_residual_load = 20; % GW
211+
fossil_min_price = 44; % €/MWh
212+
gasplant_nom_cost_at_residual_load = 15; % GW
213213
bid_incl_exponential = log(gasplant_marginal_cost/fossil_min_price)/(gasplant_nom_cost_at_residual_load*1000);
214214
% exponential price options:
215215
price_electricity(:,1) = fossil_min_price.*exp(residual_load_curves(:,1).*bid_incl_exponential(1)); % [€/MWh] and if residual < 0 than €0/MWh if 0 fossil production or negative residual = excess reneawble energly production
@@ -428,11 +428,11 @@
428428
%% Daily price statistisc, 24h grouped histogram, and make difference for winter vs summer, hypothesis: summer daily low prices during day, winter: daily low prices during low load hours at night 00:00-05:00
429429

430430
% Jaar 2022:
431-
price_electricity_reshaped_2022 = reshape(price_electricity(:,1), [], 24);
432-
price_electricity_dayhouravg_2022 = sum(price_electricity_reshaped_2022)./365;
431+
price_electricity_reshaped_2022 = reshape(price_electricity(:,1), 24, 365);
432+
price_electricity_dayhouravg_2022 = sum(price_electricity_reshaped_2022')./365;
433433
% Jaar 2030:
434-
price_electricity_reshaped_2030 = reshape(price_electricity(:,2), [], 24);
435-
price_electricity_dayhouravg_2030 = sum(price_electricity_reshaped_2030)./365;
434+
price_electricity_reshaped_2030 = reshape(price_electricity(:,2), 24, 365);
435+
price_electricity_dayhouravg_2030 = sum(price_electricity_reshaped_2030')./365;
436436

437437

438438
if 1 == 1
@@ -459,8 +459,8 @@
459459
%hold on
460460

461461
% Jaar 2030:
462-
price_electricity_reshaped_2030_sunny = reshape(price_electricity(time_sunny_pv_start:time_sunny_pv_end-1,2), [], 24);
463-
price_electricity_dayhouravg_2030_sunny = sum(price_electricity_reshaped_2030_sunny)./time_sunny_diff_sunny;
462+
price_electricity_reshaped_2030_sunny = reshape(price_electricity(time_sunny_pv_start:time_sunny_pv_end-1,2), 24, []);
463+
price_electricity_dayhouravg_2030_sunny = sum(price_electricity_reshaped_2030_sunny')./time_sunny_diff_sunny;
464464

465465
stairs(price_electricity_dayhouravg_2030_sunny,'LineWidth',2)
466466

@@ -472,15 +472,15 @@
472472
price_electricity_windy_B = price_electricity(time_sunny_pv_end:end,2);
473473
price_electricity_windy = [price_electricity_windy_A; price_electricity_windy_B];
474474

475-
price_electricity_reshaped_2030_windy = reshape(price_electricity_windy, [], 24);
476-
price_electricity_dayhouravg_2030_windy = sum(price_electricity_reshaped_2030_windy)./time_sunny_diff_windy;
475+
price_electricity_reshaped_2030_windy = reshape(price_electricity_windy, 24, []);
476+
price_electricity_dayhouravg_2030_windy = sum(price_electricity_reshaped_2030_windy')./time_sunny_diff_windy;
477477
stairs(price_electricity_dayhouravg_2030_windy,'LineWidth',2)
478478

479479

480-
legend('2022','2030','2030 march to 1 oct','winter months')
480+
legend('regular 2019 year','2030 whole year','2030 sunny months: 1 march to 1 oct','2030 darker winter months')
481481

482482

483-
save_fig(h,'Lipton_v4_5_1_Dec');
483+
save_fig(h,'2030 daily hourly avg electricity price_v2');
484484
end
485485
% TODO: check if 24 hours are aligned and are not mismatched one hour per day. well issue would be not too big, since it will only shift the histogram an hour, not more than that.
486486

@@ -896,8 +896,8 @@
896896
rx1 = nexttile;
897897

898898
%start_point = 3100 = 11 May
899-
strtPt = 3200; %
900-
days = 14;
899+
strtPt = 3200; %3200
900+
days = 10;
901901
endPt = strtPt+days*24;
902902

903903
% V2G discharge
@@ -1073,7 +1073,7 @@
10731073

10741074
%% Save figure as png
10751075

1076-
save_fig(h0,'Lipton_v4_5_1_Dec');
1076+
save_fig(h0,'Lipton_v4_5_Feb2023');
10771077

10781078
% print -dpng -r300 Lipton_v4_5_28_Juli
10791079

@@ -1092,7 +1092,34 @@
10921092

10931093

10941094

1095+
%% Save prices to xlsx
1096+
h8 = figure();
1097+
stairs(time_array(:,2),price_electricity(:,2))
1098+
hold on
1099+
stairs(time_array(:,2),price_electricity(:,1))
1100+
grid
1101+
legend('2030 Matlab','2022 reverse modelled')
1102+
ylabel('Hourly Day-Ahead market Electricity price €/MWh')
1103+
title(sprintf('Year: %.0f, Consumption: %.1f TWh, %.1f GW Wind, %.1f GWp PV, Wind gen: %.0f prct, PV gen: %.0f prct', jaren(jaar),Cons_annual(jaar)/1000, P_wind_installed_array(jaar)/1000 ,P_zon_installed_array(jaar)/1000, Prod_wind_perc(jaar)*100, Prod_solar_perc(jaar)*100) )
1104+
1105+
%%
1106+
save_fig(h8,'Matlab-Day-Ahead-prices-2022-2030');
1107+
10951108

1109+
%%
1110+
price_electricity_table = table;
1111+
1112+
price_electricity_table.time = time_array(:,2);
1113+
price_electricity_table.price_2022 = price_electricity(:,1);
1114+
price_electricity_table.price_2030 = price_electricity(:,2);
1115+
1116+
1117+
%%
10961118

1119+
writetable(price_electricity_table,'Matlab-Day-Ahead-prices-2022-2030_table.xlsx')
1120+
writetable(price_electricity_table,'Matlab-Day-Ahead-prices-2022-2030_table.csv')
10971121

1122+
%xlswrite('Matlab-Day-Ahead-prices-2022-2030_table.xlsx',price_electricity_table)
10981123

1124+
% writematrix(price_electricity,'M_tab.csv')
1125+
% csvwrite('price_electricity_upto1200.csv',price_electricity)

0 commit comments

Comments
 (0)