Skip to main content

Dependent variables

Answered

Comments

3 comments

  • Official comment
    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.
  • Maliheh Aramon
    • Gurobi Staff

    Hi Sander, 

    • You need to define both \(X\) and \(S\) as decision variables using the Model.addVars() method.
    • You can then enforce the relationship between \(X\) and \(S\) variables by adding the constraints \(S_{t+1} = S_t - X_t\) using the Model.addConstrs() method.

    Best regards,

    Maliheh

    0
  • Sander Mertens
    • Gurobi-versary
    • Curious
    • Conversationalist

    Thank you!

    0

Post is closed for comments.