MATLAB Gurobi model.A
AnsweredHi everyone, in creating model.A in MATLAB, how do I model x(t-1) in the constraint below?
x(t) - x(t-1) = scalar value
where
x(t) - value of x at time t
x(t-1) - value of x at time t-1
Thank you.
0
-
Official comment
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. -
Hi Elvin,
For these particular constraints, you have to define your matrix to have T columns and T-1 rows, where T is the number of x variables. Then set the diagonal marix entries to -1 and the upper off-diagonal entries to 1. For an example of how to define the A matrix, please refer to our MATLAB examples. In particular, you could have a look at the facility.m example.
Best regards,
Jaromił1 -
Hi Jaromił,
Thank you very much for these information! Highly appreciated
0
Post is closed for comments.
Comments
3 comments