Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating mutable penalty params #252

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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