@@ -59,6 +59,14 @@ def __init__(self, model : object) -> None:
5959 model .hour , model .month , model .year , model .zone , model .zone ,
6060 rule = self .trans_up_bound_rule
6161 )
62+ model .trans_capacity_up_bound_cons = poi .make_tupledict (
63+ model .year , model .zone , model .zone ,
64+ rule = self .trans_capacity_up_bound_rule
65+ )
66+ model .trans_capacity_low_bound_cons = poi .make_tupledict (
67+ model .year , model .zone , model .zone ,
68+ rule = self .trans_capacity_low_bound_rule
69+ )
6270
6371 def trans_physical_rule (
6472 self , y : int , z : str , z1 : str
@@ -174,3 +182,61 @@ def trans_up_bound_rule(
174182 lhs = model .trans_export [h , m , y , z , z1 ] \
175183 - model .cap_lines_existing [y , z , z1 ]
176184 return model .add_linear_constraint (lhs , poi .Leq , 0 )
185+
186+ def trans_capacity_up_bound_rule (
187+ self , y : int , z : str , z1 : str
188+ ) -> poi .ConstraintIndex :
189+ """Transmission line capacity is less than or equal to the
190+ prescribed upper bound.
191+
192+ Parameters
193+ ----------
194+ h : int
195+ Hour.
196+ m : int
197+ Month.
198+ y : int
199+ Year.
200+ z : str
201+ Zone.
202+ z1 : str
203+ Zone.
204+
205+ Returns
206+ -------
207+ poi.ConstraintIndex
208+ The constraint of the model.
209+ """
210+ model = self .model
211+ lhs = model .cap_lines_existing [y , z , z1 ] \
212+ - model .params ['transmission_line_capacity_upper_bound' ][z , z1 ]
213+ return model .add_linear_constraint (lhs , poi .Leq , 0 )
214+
215+ def trans_capacity_low_bound_rule (
216+ self , y : int , z : str , z1 : str
217+ ) -> poi .ConstraintIndex :
218+ """Transmission line capacity is greater than or equal to the
219+ prescribed lower bound.
220+
221+ Parameters
222+ ----------
223+ h : int
224+ Hour.
225+ m : int
226+ Month.
227+ y : int
228+ Year.
229+ z : str
230+ Zone.
231+ z1 : str
232+ Zone.
233+
234+ Returns
235+ -------
236+ poi.ConstraintIndex
237+ The constraint of the model.
238+ """
239+ model = self .model
240+ lhs = model .cap_lines_existing [y , z , z1 ] \
241+ - model .params ['transmission_line_capacity_lower_bound' ][z , z1 ]
242+ return model .add_linear_constraint (lhs , poi .Geq , 0 )
0 commit comments