Skip to main content

Non-Convex Objective Function

Answered

Comments

1 comment

  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Hi Saeed,

    It is possible to directly write the function by using the addGenConstrNL method. You would have to define an auxiliary variable \(Z'\) as you already do and then the code would look similar to

    objconstr = model.addGenConstrNL(Zprime, gp.quicksum(h[j]*c[j]*z[alpha]*sigma[j]*gp.nlfunc.sqrt(SI[j]+T[j]-S[j]) for j in N ), name="obj1")

    Please note that you need Gurobi version 12 to use the above method.

    Also consider that it might actually be better to formulate the model via quadratic constraints only. However, this can only be said once both formulations are tested.

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.