Solved

upper bound for variable 1 = value of variable 2


Badge

hello everyone,

i have a question about my aimms project:

i have two variables: x(t,k) and y(t,k)

now i want to determine, that

if x(t,k) < y(t,k) then y(t,k) = x(t,k)

i already know that this is not possible with an if-statement.

has anybody an idea?

 

Thanks in advance.

Seb

 

icon

Best answer by akumar 2 May 2021, 16:06

View original

6 replies

One way to approach this is to introduce an auxillary variable z(t,k) and solve for following 

Max z(t,k)

s.t 

z(t,k)  <=  x(t,k)

z(t,k) <= y(t,k)

 

Other way, you can try out is:

Write following constraints (introduce dummy binary variable delta(t,k) and build following relations)

x(t,k) <= y(t,k) + (big-M)*delta(t,k)

x(t,k) >= y(t,k) -(big-M) *(1-delta(t,k))

Write Indicator constraints in AIMMS as 

if delta(t,k)=0 then z(t,k) = x(t,k)

if delta(t,k)=1 then z(t,k) = y(t,k)

 

Best Wishes,
Kumar.

Userlevel 5
Badge +7

What type of variables are x and y? Binary, integer, or continuous? 

Badge

both are integer variables.

Userlevel 5
Badge +7

But kan x also be greater than y? That is not completely clear to me from what you write.

 

Badge

yes, that’s right. x can also be greater than y.

so in short i compare two variables and want both to adopt the lower value. 

Hi @Sebastian Schäfer  

Did @akumar ‘s answer help you with your solution?

 

 

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator