Question

# upper bound for variable 1 = value of variable 2

• Explorer
• 2 replies

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?

Seb

### 5 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 3
+1

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

both are integer variables.

Userlevel 3
+1

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

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.