Question

Linear program getting converted into Non-linear when using max function in variable

  • 23 November 2021
  • 2 replies
  • 30 views

Badge

Hello!

 

I am facing an issue with my model. I have a variable

A(index1,index2,index3,index4)

and I am defining another variable

B(index2,index3,index4) as max(index1, A(index1,index2,index3,index4))

However, while running the model, it gives an error that the the model become non linear. Is there a way to work around this?

 

Regards,

Vishwesh Patil


2 replies

Userlevel 4
Badge +2

Hi @vishweshpatil,

could you not add a new constraint ensure_B_larger_than_A  with index domain (index1, index2, index3, index4) and as definition

B(index2, index3, index4) >= A(index1, index2, index3, index4)

Assuming that the goal for the model is to drive the value of B down, this would ensure that B will always be greater or equal than the largest value of A.

Userlevel 4
Badge +1

Hi @vishweshpatil , and if the model does not have the intention to make B as low as possible then you can use reformulation 2.3 from this document.

Reply


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

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