How can i add a variable which is a function of some decision variables- parameters to my model?
AnsweredI have a situation which i can not properly added to my model in gurobi python.
I have a decision variable set lets say x[i] for i = 1 to I
and i have a parameter set which is c[i] for i = 1 to I
I want to add my model a new variable which is composed of mentioned 2 above.Lets say;
D[i] = max(0,x[i] - c[i]) for i = 1 to I
I tried to construct D[i] by using addMVars function and than equating it to max(0,x[i] - c[i])
in constraint part yet i am having type error while adding such constraint. How can i add such variable in general which is function of other variables-parameters.
Thanks in advance...
-
Hi Murat,
Please see this post by Jaromił for an explanation https://support.gurobi.com/hc/en-us/community/posts/4418546803857/comments/4419116068753
- Riley
0
Please sign in to leave a comment.
Comments
1 comment