Skip to content

Commit

Permalink
Merge pull request #252 from bknueven/mutable_penalties
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven authored Nov 16, 2021
2 parents 2828eb7 + b4e751d commit 3ddc971
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion egret/common/lazy_ptdf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ def _add_contingency_violations(lazy_violations, flows, mb, md, solver, ptdf_opt
contingencies_monitored.append((cn, i_b))
if new_slacks:
m = model
obj_coef = pyo.value(m.TimePeriodLengthHours*m.SystemContingencyLimitPenalty)
obj_coef = m.TimePeriodLengthHours*m.SystemContingencyLimitPenalty

if persistent_solver:
m_model = m.model()
Expand Down
15 changes: 10 additions & 5 deletions egret/model_library/unit_commitment/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,23 +275,28 @@ def _check_for_requirement( requirement ):
default_reg_pen = value(model.LoadMismatchPenalty+model.ReserveShortfallPenalty)/2.
## set these penalties in relation to each other, from higher quality service to lower
model.RegulationPenalty = Param(within=NonNegativeReals,
initialize=system.get('regulation_penalty_price', default_reg_pen))
initialize=system.get('regulation_penalty_price', default_reg_pen),
mutable=True)

default_spin_pen = value(model.RegulationPenalty+model.ReserveShortfallPenalty)/2.
model.SpinningReservePenalty = Param(within=NonNegativeReals,
initialize=system.get('spinning_reserve_penalty_price', default_spin_pen))
initialize=system.get('spinning_reserve_penalty_price', default_spin_pen),
mutable=True)

default_nspin_pen = value(model.SpinningReservePenalty+model.ReserveShortfallPenalty)/2.
model.NonSpinningReservePenalty = Param(within=NonNegativeReals,
initialize=system.get('non_spinning_reserve_penalty_price', default_nspin_pen))
initialize=system.get('non_spinning_reserve_penalty_price', default_nspin_pen),
mutable=True)

default_supp_pen = value(model.NonSpinningReservePenalty+model.ReserveShortfallPenalty)/2.
model.SupplementalReservePenalty = Param(within=NonNegativeReals,
initialize=system.get('supplemental_reserve_penalty_price', default_supp_pen))
initialize=system.get('supplemental_reserve_penalty_price', default_supp_pen),
mutable=True)

default_flex_pen = value(model.NonSpinningReservePenalty+model.SpinningReservePenalty)/2.
model.FlexRampPenalty = Param(within=NonNegativeReals,
initialize=system.get('flexible_ramp_penalty_price', default_flex_pen))
initialize=system.get('flexible_ramp_penalty_price', default_flex_pen),
mutable=True)

thermal_gen_attrs = md.attributes(element_type='generator', generator_type='thermal')

Expand Down

0 comments on commit 3ddc971

Please sign in to comment.