Raising to the power of a variable
AnsweredHello,
I have a question regarding modeling a constraint. I have x = a ^ n, where a is a given parameter and n is a decision variable. How should I model this as a constraint? I tried model.addGenConstrPow(a, x, n), but this does not seem to work.
I would appreciate any help.
Thanks
0
-
Hi Mina,
model.addGenConstrPow is used to create constraints \(x = n^a \) (x, n: variable, a: constant). You can use model.addGenConstrExpA to create constraints \(x = a^n \):
model.addGenConstrExpA(n, x, a)
Thanks,
Ryuta0
Please sign in to leave a comment.
Comments
1 comment