Question

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

 


5 replies

Userlevel 3
Badge +1

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

Badge

both are integer variables.

Userlevel 3
Badge +1

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. 

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.

Reply


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

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