diff --git a/src/dispatch/PyomoRuleLibrary.py b/src/dispatch/PyomoRuleLibrary.py index c6e64f44..1c7c687a 100644 --- a/src/dispatch/PyomoRuleLibrary.py +++ b/src/dispatch/PyomoRuleLibrary.py @@ -140,7 +140,10 @@ def ramp_rule_down(prod_name, r, limit, neg_cap, t, m, bins=None) -> bool: # dq is negative, - limit is negative return delta >= - limit else: - eps = 1.0 # aux parameter to force binaries to behave, TODO needed? + # special treatment if we have frequency-limiting binaries available + # eps is an aux parameter (small number) to ensure that binary vars for ramp-up and ramp- + # down events behave correctly (e.g., are zero when activity remains constant) + eps = 1e-6*limit down = bins[0][t] up = bins[1][t] # NOTE we're following the convention that "less negative" is ramping "down" @@ -181,7 +184,9 @@ def ramp_rule_up(prod_name, r, limit, neg_cap, t, m, bins=None) -> bool: return delta <= limit else: # special treatment if we have frequency-limiting binaries available - eps = 1.0 # aux parameter to force binaries to behave, TODO needed? + # eps is an aux parameter (small number) to ensure that binary vars for ramp-up and ramp- + # down events behave correctly (e.g., are zero when activity remains constant) + eps = 1e-6*limit down = bins[0][t] up = bins[1][t] # NOTE we're following the convention that "more negative" is ramping "up" diff --git a/tests/integration_tests/mechanics/ramp_freq/analytic.xlsx b/tests/integration_tests/mechanics/ramp_freq/analytic.xlsx new file mode 100644 index 00000000..a1308833 Binary files /dev/null and b/tests/integration_tests/mechanics/ramp_freq/analytic.xlsx differ