Skip to content

Commit

Permalink
Merge pull request grid-parity-exchange#199 from michaelbynum/soc
Browse files Browse the repository at this point in the history
basic soc relaxation should not need coramin
  • Loading branch information
carldlaird authored Feb 11, 2021
2 parents 2bbb971 + f6e5909 commit 6782c52
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion egret/models/ac_relaxations.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ def _relaxation_helper(model, md, include_soc, use_linear_relaxation):

def create_soc_relaxation(model_data, use_linear_relaxation=True, include_feasibility_slack=False):
model, md = _create_base_power_ac_model(model_data, include_feasibility_slack=include_feasibility_slack)
_relaxation_helper(model=model, md=md, include_soc=True, use_linear_relaxation=use_linear_relaxation)
if use_linear_relaxation:
_relaxation_helper(model=model, md=md, include_soc=True, use_linear_relaxation=use_linear_relaxation)
else:
branch_attrs = md.attributes(element_type='branch')
bus_pairs = zip_items(branch_attrs['from_bus'], branch_attrs['to_bus'])
unique_bus_pairs = list(OrderedDict((val, None) for idx, val in bus_pairs.items()).keys())
libbranch.declare_ineq_soc(model=model, index_set=unique_bus_pairs,
use_outer_approximation=use_linear_relaxation)
return model, md


Expand Down

0 comments on commit 6782c52

Please sign in to comment.