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

  • 23 November 2021
  • 3 replies
  • 84 views

Badge +2

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


3 replies

Userlevel 5
Badge +7

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 5
Badge +4

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.

Hi @vishweshpatil

 

Did @gdiepen ‘s answer help you with your question?

 

Best 

Reply


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

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