Implement Critical and Non-Critical Loads
@adnanalakori2020 is interested in implementing a new feature for Offgridders about critical and non-critical loads. Here is the description:
Thus, a new feature is required for the Off-gridders to enable the model to satisfy the energy consumption behavior of hospitals as follows: first, the model must distinguish between two types of loads: critical and non-critical loads. Second, when a dispatch optimization occurs the model must prioritize the critical load. While the non-critical load is still important for assessing and limiting the cost of a backup power system. Thus, we must be able to execute load scenarios on non-critical loads (e.g., 0%, 50%, etc.)
https://github.com/adnanalakori/Offgridders_poweringhealth/issues/2
-
[X] Choose how to split demand into 2 parts: Critical Load and Non-Critical Load
- a) Two explicit demand profiles with 8760 values?
- b) Define critical load as a share of the total demand? ->
CL = D * factor,D = CL + C,shortage = (1-factor) D-> In this case, critical load and non-critical load might also be possible in Offgridders? - [x] Check if
shortage_max_timestep(variable:SHORTAGE_MAX_TIMESTEP) is implemented correctly, as it could also be used to define the share of non-critical loads. SHORTAGE_MAX_TIMESTEPshould be introduced as constraint in: https://github.com/rl-institut/offgridders/blob/dev/src/G2b_constraints_custom.py#L959- :X: Check if constraint is integrated into code -> Function is never called in Offgridders, ie.
shortage_max_timestepcan not be used currently (also #163) - [x] Check impact of a) or b) on representation of c/nc loads: Calculation-Critical-Non-Critical.xlsx -> We think that a ratio could still lead in critical loads being not supplied. b) seems like a bad choice, will go for a)
-
[x] How can we define a critical and a non-critical demand in the excel input file? Current:
Proposal: Add title_demand_ac_criticalandtitle_demand_dc_critical--- todos now --- -
[x] implement
title_demand_ac_criticalandtitle_demand_dc_criticalin the excel, and define constants in https://github.com/rl-institut/offgridders/blob/a8fa6f1a6b8319962e65505320f9b47267fbef0a/src/constants.py#L45 -
[ ] Run simulation, check that new parameters are in
simulation_experiments.csv(output) -
[ ] If not, needs to be implemented in
D0https://github.com/rl-institut/offgridders/blob/dev/src/D0_process_input.py -
[ ] Check that timeseries was parsed correctly, add
DEMAND_PROFILE_AC_CRITICALandDEMAND_PROFILE_DC_CRITICAL -
[ ] Add
generate_demandfor new critical demands, see https://github.com/rl-institut/offgridders/blob/a8fa6f1a6b8319962e65505320f9b47267fbef0a/src/G1_oemof_create_model.py#L96 --- For later --- -
[ ] Run a simulation with demands split into normal and critical demand to compare if KPI like
demand_totalstay the same (do not use shortage here), and also which do not. We might have to adapt KPI definitions accordingly (G3,G3a, G3b`) -
[ ] Add a constraint that allows shortage to replace non-critical demands (
G2b) -
[ ] Think of KPI that represents how much non-critical demand is not covered. Should this be in
total_shortageetc? -
[ ] Add plausability tests, ie. is critical demand always supplied, and is the shortage activated ADDITIONALLY? (
G3a) -
[ ] Define benchmark test, ie. scenarios where you already can estimate some results and with which we can test that the new feature works.
Hi @smartie2076 , please find my feedback:
-
The demand critical DC/AC to the timeseries has been added --- > not sure if we shall leave their values empty

-
Adding generate_demand for new critical demands -- > seems it needs to be defined as its reference in G2a?
sink_demand_ac_critical = generate.demand_ac_critical(
micro_grid_system, bus_electricity_ac, experiment[DEMAND_PROFILE_AC_CRITICAL]
)

Hi @adnanalakori! To make it very clear, it is best to "quote reply" or "quote" the things that you are commenting on, so that it is clearer what you are referring to (see my style below)
* The demand critical DC/AC to the timeseries has been added --- > not sure if we shall leave their values empty
We should not leave those values open, because then there is nothing that can be parsed by Offgridders. I can not say if you can tick the first box - you should commit your changes in a meaningful way (in small chunks with commit messages) and create a pull request. Then I can check your code.
* Adding generate_demand for new critical demands -- > seems it needs to be defined as its reference in G2a?
I see, I tought that the function generate.demand() was generalized, but it is actually generate.demand_ac() and generate.demand_dc(). My goal would be to add the new demand like this:
sink_demand_ac_critical = generate.demand(
micro_grid_system, bus_electricity_ac, experiment[DEMAND_PROFILE_AC_CRITICAL], demand_name=DEMAND_AC_CRITICAL
)
For that, we need to merge the functions generate.demand_ac and generate.demand_dc to function generate.demand.
https://github.com/rl-institut/offgridders/blob/a8fa6f1a6b8319962e65505320f9b47267fbef0a/src/G2a_oemof_busses_and_componets.py#L704
https://github.com/rl-institut/offgridders/blob/a8fa6f1a6b8319962e65505320f9b47267fbef0a/src/G2a_oemof_busses_and_componets.py#L719
The only difference is, that we have to add a term demand_name to the function variables.
I think it would be best if you checked the first boxes first, created a pull request, and then we go into these manipulations.