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

Nonlinear global optimization in pyomo (calling gurobi)

回答済み

コメント

3件のコメント

  • 正式なコメント
    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.
  • Riley Clement
    • Gurobi Staff

    Hi Yingkai,

    It sounds like Pyomo wants to write the model to file, then invoke Gurobi via the command line.  It seems to be running into an error when writing the file.  If this is occurring with the latest version of Pyomo I would open up an issue at https://github.com/Pyomo/pyomo/issues

    As a workaround, can you try and use the "persistent" interface, which builds the model in Gurobi directly:

    solver = pyo.SolverFactory('gurobi_persistent')

    Of course you could also use gurobipy to solve the issue.  I'm sure ChatGPT could do a quick conversion between your Pyomo code to gurobipy code.

    - Riley

    0
  • Yingkai Song
    • Gurobi-versary
    • Curious
    • First Comment

    Hi Riley,

     

    Thanks for your reply! 

    Even though I could not find the source again, several days ago, I found a post from Gurobi saying that to use nonlinear term such as sin in Gurobi, I have to use Model.addGenContrSin() in gurobipy. This function of Gurobi is just incompatible with Pyomo's modeling language. 

    Thanks,

    Yingkai

    0

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