24 March 2021

A recent project involved fixing a Solver model. The model was intended to be a straightforward Linear Program to find the optimal mix of three chemicals, subject to the proportions of the chemicals being within specific bounds.

That is, the model had constraints like: $${a \over a+b+c} \le p_a$$

where $$a$$, $$b$$, and $$c$$ are variables for the quantity of each chemical, and $$p_a$$ is a constant representing the upper bound on the proportion for chemical $$a$$.

The problem was that this constraint is non-linear because a variable is divided by other variables. It may also cause a division by zero error. Solver's non-linear and evolutionary methods didn't always work well with this model.

Fortunately, we can rearrange the constraint to be in an equivalent linear form. That is: $${a \times (1 - p_a) \le p_a \times (b + c)}$$

With this reformulation, the model becomes linear while still achieving the desired intent. Consequently, the model now solves to optimality quickly and reliably using the Simplex method.