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

Constraints not satisfied for the generated optimal solutions

回答済み

コメント

5件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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 why not try our AI Gurobot?.
  • Alison Cozad
    • Gurobi Staff

    Hi Sen,

    Could you show me which values of 'ApparantPowerLimitEV' are violated?

    Also, it often helps to use the Model.printQuality() to check the feasibility of the most violated bound, constraint, or integrality if there are any violated.  It will give you output like the following:

    Solution quality statistics for model Unnamed : 
    Maximum violation:
    Bound : 0.00000000e+00
    Constraint : 0.00000000e+00
    Integrality : 0.00000000e+00

    Can you run m.printQuality() after you call m.optimize() and show us the results?  We would expect the values for your 'ApparantPowerLimitEV' constraint to be less than the FeasibilityTol (default 1e-6).

    1
  • Sen Zhan
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Alison,

    Element-wise, p_ev[i]^2 + q_ev[i]^2 should be less than (1.2333E-3)^2, while in the optimized results, p_ev[i] is 1.2333E-3, q_ev = 0.4E-3, so the constraints are not satisfied. Please also find below output from printQuality function. Could you share any insight on this? Thanks!

    Solution quality statistics for model GEC :
    Maximum violation (unscaled/scaled):
    Bound : 0.00000000e+00 / 0.00000000e+00
    Constraint : 1.64329481e-07 / 1.64329481e-07 (ApparantPowerLimitEV109)
    0
  • Sen Zhan
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Alison,

    The problem is solved for me. I understand from the printQuality() output that my optimization problem has a violation of 1.64E-7, which is not acceptable for me while being acceptable for Gurobi under default setting. So I can either change the Gurobi default setting to a smaller value like 1E-9 or enlarge the violation by multiplying a large number on both sides of the inequality constraints.

    Best regards,

    Sen

     

    0
  • Alison Cozad
    • Gurobi Staff

    Sen, that's exactly right. 

    You can always tighten the FeasibilityTol (default 1e-6) or, if you simply want to tighten that single constraint, scale the constraint.

    Good find!

    0

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