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

Make Egret aware of APPSI #265

Open
bknueven opened this issue Feb 7, 2022 · 2 comments
Open

Make Egret aware of APPSI #265

bknueven opened this issue Feb 7, 2022 · 2 comments

Comments

@bknueven
Copy link
Collaborator

bknueven commented Feb 7, 2022

We have some special logic in the unit commitment and DC/SC OPF methods for Persistent solvers. We should make this same code aware of APPSI solvers. This would especially improve performance for CBC.

@bknueven
Copy link
Collaborator Author

bknueven commented Feb 7, 2022

Now I remember the hold-up on this: @michaelbynum how amendable would you be to adding a add_column method for the APPSI solvers similar to that for PersistentSolver? Here's an example of how lazy transmission constraints are currently handled:

constr[bn], new_slacks = _generate_branch_thermal_bounds(mb, bn, thermal_limit)
viol_in_mb.append(i)
if new_slacks:
m = model
obj_coef = m.TimePeriodLengthHours*m.BranchLimitPenalty[bn]
if persistent_solver:
m_model = m.model()
if m is not m_model and obj_multi is None:
raise RuntimeError("Cannot add lazy var for branch slacks if part of a larger model")
if obj_multi is not None:
obj_coef = obj_multi*obj_coef
## update the objective through the add_column method
solver.add_column(m_model, mb.pf_slack_pos[bn], obj_coef, [], [])
solver.add_column(m_model, mb.pf_slack_neg[bn], obj_coef, [], [])
else:
m.BranchViolationCost[time].expr += ( obj_coef*mb.pf_slack_pos[bn] + \
obj_coef*mb.pf_slack_neg[bn] )
if persistent_solver:
solver.add_constraint(constr[bn])

@michaelbynum
Copy link
Collaborator

Ahh, yes. Definitely. Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants