Skip to main content

Infeasibility Issues / Optimal Control of Mixed Logical Dynamical Systems / MIQP

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.
  • Jaromił Najman
    • Gurobi Staff

    Hi Johannes,

    You could write the model you construct to a human-readable LP file via the write method.

    [...]
    m.update()

    m.write("myModel.lp")

    m.optimize()
    m.printStats()
    [...]

    You can open the file \(\texttt{myModel.lp}\) in any standard Text Editor and analyze whether the model looks as expected.

    One thing that comes to mind is that the default lower bound value for optimization variables in Gurobi is \(0\). If your variables are allowed to take negative values, then you have to explicitly state so when constructing the variables.

    V = m.addMVar(shape=(N*(nu + nd + nz), 1), lb=-GRB.INFINITY, vtype = GRB.CONTINUOUS, name='V')

    You could also share the content of the LP file here if further help is needed.

    Best regards, 
    Jaromił

     

    0
  • Johannes Randenborgh
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Jaromił,

    thanks for the immediate reply.

    **Solution**: I forgot so set lb= - GRB.INFINITY. The system dynamics force the state to alternate between positive and negative values.

    Bests,

    Johannes

    0

Post is closed for comments.