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

Nonlinear model

回答済み

コメント

2件のコメント

  • 正式なコメント
    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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    You can use the quicksum function to model your sums. An example for inequality (2) would be

    for k in K:
    model.addConstr(gp.quicksum(i[r,t,i,j,k] * ccap[t] * F[r,t,i,j] * C[r,t,i,j]
    for r in range(1,rmax)
    for t in T
    for i in range(1,smax)
    for j in range(i+1,smax)) >= n[k])

    Note that I am just guessing your data structures in the above code example. All other terms can be constructed in a similar way. You can find an introduction into gurobipy modelling in our Python webinar and our Python examples.

    0

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