メインコンテンツへスキップ

Infeasibility due to modelling the constraints

回答済み

コメント

4件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • Simranjit Kaur
    • Gurobi Staff

    Hi Priya,

    Variables in Gurobi, by default, take a lower bound of zero. If you expect a variable to take a negative value, please set its lower bound to an appropriate negative value.

    Best regards,
    Simran

    0
  • V priya
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you for the response.I uncommented the following also :

    mdl.addConstrs( U_a1[i,j]  >= U_lower_bar_a1[i,j] for i in range(0,n) for j in range(0,n))

     But I am getting an infeasible model. Could you please help?

    0
  • Simranjit Kaur
    • Gurobi Staff

    Hi Priya,

    Uncommenting the following constraint will not help since the variable lower bound is still set to 0 by default.

    mdl.addConstrs( U_a1[i,j]  >= U_lower_bar_a1[i,j] for i in range(0,n) for j in range(0,n))

    You can define the lower bound and upper bound of your MVar variable U_a1 to the arrays U_lower_bar_a1 and U_upper_bar_a1 as follows:

    U_a1 = mdl.addMVar((n, n), lb=U_lower_bar_a1, ub=U_upper_bar_a1,  vtype=GRB.CONTINUOUS, name='U_a1')
    I hope this helps.
     
    Cheers,
    Simran
     
     
    0

投稿コメントは受け付けていません。