Solved

Inventory costs

  • 11 June 2019
  • 1 reply
  • 123 views

We have a stock that can be negative as well as positive. If it is positive then there are inventory costs and if it is negative then there are backordering costs. We wanted to model this in aimms with different methods. On the one hand we got the error that it was not linear, If we wanted to only have the stock if it is positive and otherwise return the value 0. If we tried to use other methods, such as a binary value that would return the value 0 if the stock was smaller than 0 and 1 if the stock was bigger than 0 we got the following error
"The mathematical program "CostMinimization" is not linear, look for bracketed numbers in the constraint listing, for example in the constraint Inventory_definition(4,12)."

How can we best model this situation, so that it is still a linear model?
icon

Best answer by wiet 11 June 2019, 20:26

View original

1 reply

Userlevel 1
=st= means smaller than
=gt= means greater than

pars
max_pos_stock (=gt= 0)
max_neg_stock (=gt= 0)
costs_pos_stock
costs_neg_stock

vars
stock
is_pos (binary)
is_neg (binary)

constraint
stock - max_pos_stock * is_pos =st= 0
stock + max_neg_stock * is_neg =gt= 0
is_pos + is_neg =st= 1

cost function
costs_pos_stock * is_pos + costs_neg_stock + is_neg

Reply


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

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