0

I am quite confused, I need to do an optimization of a warehouse filling that depends on prices.

That is, when it is cheap I fill it and when it is expensive I take it out to sell, two types of restrictions must be met: Have a minimum and maximum filling on specific dates and the maximum and minimum value that the variable can take in injection or extraction: Xi<0 extraction, Xi>0 injection.

The fact is that Xi has limits:

Xi<H

Where H is the maximum injection that can occur in one day and is calculated as:

MINIMUM between a constant and a function that depends on the filling the previous day:

Xi < H, where H= MIN (Constant, f(Vi-1)).

To eliminate functions like the Minimum, binary variables can be used, but for it to choose the minimum, I have to introduce non-linear conditions in the objetive function that the solver does not accept.

Do you know how I can solve this problem with some other software?

All the best,

ADM.

ADMGYP
  • 1

1 Answers1

2

I would encourage you to have a look into Operations Research which is a discipline that deals with such problems. There is a dedicated stack exchange for this. Assuming you have predictions (or at least uncertainty intervals) of future prices Gurobi is a commercial solver which is really good at solving MILP formulations of problems similar to yours.

About your particular confusion: This non linear term can be easily be linearized $$X_i \leq H, \text{where } H= \min (\text{Constant }, f(Vi-1))$$ Becomes two inequalities (assuming you have a maximization problem)

\begin{equation} X_i \leq \text{Constant } \\ X_i \leq f(V_{i-1}) \end{equation}

There is no need to resort to binary variables in this particular case. For a repeater how to use binary variables to impose $\min$ or $\max$ take a look at the Big-M method.