Skip to content

Commit

Permalink
Added calculation of guaranteed power based on exceedance probability
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiansterl committed Oct 27, 2023
1 parent 369398c commit 0d7ad9a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions code/A_REVUB_initialise_minimum_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@
# [set by user] number of turbines per hydropower plant (used for turbine use statistics in script C)
no_turbines = parameters_hydropower_values[np.where(parameters_hydropower_list == 'no_turbines', True, False)][0].astype(int)

# [set by user] percentile value used to calculate exceedance probability of delivered power
p_exceedance = parameters_hydropower_values[np.where(parameters_hydropower_list == 'p_exceedance', True, False)][0].astype(int)


# %% pre.4) Time series

Expand Down
21 changes: 19 additions & 2 deletions code/B_REVUB_main_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@
L_unmet_BAL_frac_bymonth = np.zeros(shape = (months_yr, len(simulation_years), HPP_number))
L_unmet_STOR_frac_bymonth = np.zeros(shape = (months_yr, len(simulation_years), HPP_number))


##### MISCELLANEOUS PARAMETERS #####


# [precallocate] Failure rate (fraction of time) of operation in case of prolonged dry periods
fraction_outage_CONV = np.zeros(shape = HPP_number)
fraction_outage_BAL = np.zeros(shape = HPP_number)
Expand All @@ -362,6 +366,11 @@
fraction_overflow_BAL = np.zeros(shape = HPP_number)
fraction_overflow_STOR = np.zeros(shape = HPP_number)

# [preallocate] Guaranteed power (MW) per hydropower plant
P_CONV_total_guaranteed = np.full(HPP_number,np.nan)
P_BAL_total_guaranteed = np.full(HPP_number,np.nan)
P_STOR_total_guaranteed = np.full(HPP_number,np.nan)


# %% REVUB.3) Classify HPPs

Expand Down Expand Up @@ -1930,7 +1939,8 @@

# %% REVUB.5) Post-processing

# [initialise] use STOR equal to BAL for reservoirs where STOR not modelled
# [initialise] use STOR equal to BAL for reservoirs where STOR not modelled (except RoR component).
# This step has no physical meaning and is purely meant to avoid plotting errors in script C_multiple if users want to plot scenarios where certain dams have STOR scenarios and others only BAL.
for HPP in range(HPP_number):
if STOR_break[HPP] == 1:
P_STOR_hydro_stable_hourly[:,:,HPP] = P_BAL_hydro_stable_hourly[:,:,HPP]
Expand Down Expand Up @@ -2044,7 +2054,14 @@

# [calculate] ELCC by year in MWh/year (eq. S23)
ELCC_STOR_yearly[y,HPP] = np.sum(L_followed_STOR_hourly[hrs_year,y,HPP])



# [calculate] statistics of power generation under user-defined p_exceedance criterion
P_CONV_total_guaranteed[HPP] = np.nanpercentile(P_CONV_hydro_stable_hourly[:,:,HPP] + P_CONV_hydro_RoR_hourly[:,:,HPP], 100 - p_exceedance[HPP])
P_BAL_total_guaranteed[HPP] = np.nanpercentile(P_BAL_hydro_stable_hourly[:,:,HPP] + P_BAL_hydro_flexible_hourly[:,:,HPP] + P_BAL_hydro_RoR_hourly[:,:,HPP] + P_BAL_solar_hourly[:,:,HPP] + P_BAL_wind_hourly[:,:,HPP], 100 - p_exceedance[HPP])

if STOR_break[HPP] == 0 and option_storage == 1:
P_STOR_total_guaranteed[HPP] = np.nanpercentile(P_STOR_hydro_stable_hourly[:,:,HPP] + P_STOR_hydro_flexible_hourly[:,:,HPP] + P_STOR_solar_hourly[:,:,HPP] + P_STOR_wind_hourly[:,:,HPP], 100 - p_exceedance[HPP])


# [display] signal simulation end
Expand Down
Binary file modified data/parameters_simulation.xlsx
Binary file not shown.
Binary file modified manual/REVUB_manual.pdf
Binary file not shown.

0 comments on commit 0d7ad9a

Please sign in to comment.