Skip to main content

L1 space filling design

Answered

Comments

4 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.
  • David Walz
    • Gurobi-versary
    • First Comment
    • First Question

    Also, how do you properly format code in this forum?

    0
  • Jaromił Najman
    • Gurobi Staff

    Hi David,

    The logic of your model is correct. The issue is that default lower bounds for variables are 0 in Gurobi. However, your \(\texttt{(X{i1} - X{i2})_{j}}\) can take negative values. Setting the lower bound explicitly to be negative

    z1[i1, i2, j] = model.addVar(lb=-1,name=f"(X{i1}-X{i2})_{j}")

    solves the issue.

    In general, you should avoid having whitespaces in variable names. Gurobi does not care about the names internally and the whitespaces won't affect Gurobi's optimization algorithm, but when writing the model to a file or interacting with other software, whitespaces in names often lead to unexpected behavior.

    Also, how do you properly format code in this forum?

    Unfortunately, the forum editor does not support markdown. All features of the forum editor should be described in Posting to the Community Forum.

    Best regards, 
    Jaromił

     

    0
  • David Walz
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Jaromil,

    great thanks!

    David

    0

Post is closed for comments.