Apply ratchets to per kw charges#637
Conversation
…nergy and demand charges
…through exception
…hets_to_per_kw_charges
…ails because it doesn't apply ratchets to tou rates. Fix bug so that monthly data gets propigated all year, instead of just repeating yr 1 billing demand values
…g demand calc to use new inputs and look at only relevant tou periods. test failure is stil expected
…harges. Some edge cases still to test at this point
…hets_to_per_kw_charges
…nds as specified in the tou billing demand table
…hets_to_per_kw_charges
…hets_to_per_kw_charges
…this as needed in price signal dispatch's utility rate calculator
…hets_to_per_kw_charges
sjanzou
left a comment
There was a problem hiding this comment.
Some comments, but looks good!
| double billing_demand = ec_bd_minimum; | ||
| int prev_yr_lookback = 11 - (ec_bd_lookback_months - month); // What month do we stop looking back in the prev yr? | ||
| double billing_demand = bd_minimum; | ||
| int prev_yr_lookback = 11 - (bd_lookback_months - month); // What month do we stop looking back in the prev yr? |
There was a problem hiding this comment.
How does this work across year boundaries - especially for year 1?
| double flat_peak = m_month[m].dc_flat_peak; | ||
| if (en_billing_demand_lookback) { | ||
| // If ratchets are present the peak used here might be the actual peak, or something based on a previous month. | ||
| flat_peak = get_billing_demand(m); |
There was a problem hiding this comment.
Is there a reference for this? i.e. are all flat demand charges to be based on the billing demand lookback? Seems like that overwrites the flat demand charge...
There was a problem hiding this comment.
Okay, you are not overwriting the ds_flat_peak - please disregard above comment.
| { SSC_INPUT, SSC_NUMBER, "ur_billing_demand_lookback_period", "Billing demand lookback period", "mn", "", "Electricity Rates", "ur_enable_billing_demand=1", "INTEGER,MIN=0,MAX=12", "" }, | ||
| { SSC_INPUT, SSC_MATRIX, "ur_billing_demand_lookback_percentages", "Billing demand lookback percentages by month and consider actual peak demand", "", "12x2", "Electricity Rates", "ur_enable_billing_demand=1", "", "" }, | ||
| { SSC_INPUT, SSC_MATRIX, "ur_dc_billing_demand_periods", "Billing demand applicability to a given demand charge time of use period", "", "", "Electricity Rates", "ur_enable_billing_demand=1", "", "" }, | ||
| { SSC_INPUT, SSC_ARRAY, "ur_yearzero_usage_peaks", "Peak usage by month for year zero", "", "12", "Electricity Rates", "ur_enable_billing_demand=1", "", "" }, |
There was a problem hiding this comment.
So, this takes care of the lookback across year 1 boundary. Should this be a user input or constucted from year 1 values? Maybe a questions for @cpaulgilman
| ssc_data_set_number(data, "ur_ec_billing_demand_lookback_period", 11); | ||
| ssc_data_set_number(data, "ur_enable_billing_demand", 1); | ||
| ssc_data_set_number(data, "ur_billing_demand_minimum", 100); | ||
| ssc_data_set_number(data, "ur_billing_demand_lookback_period", 11); |
There was a problem hiding this comment.
Do you have a min, max for lookback months? (Should be taken care of in the compute module precheck.

Pairs with SAM PR NatLabRockies/SAM#728
Fixes NatLabRockies/SAM#71