I have a problem where I have to minimize a certain quantity $Z$ subject to the following constraints:-

  1. $w_1 + w_2 + w_3 = 1$
  2. $\frac{f_1(w_1*Z) + f_2(w_2 * Z) + f_3(w_3 * Z)}{Z} >= k$

where $k$ is a known constant. $f_1$, $f_2$ and $f_3$ are non-linear functions that we have empirical curves for. (These curves are approximately logarithmic if that helps with the solution). $w_1$, $w_2$ and $w_3$ are weights whose optimal values are to be arrived at. I am aware of basic linear programming techniques. However, I was unable to reduce constraint #2 into a linear constraint.

Any help is welcome. Please let me know if any further details are required.

PS:- Solutions that use Python would be ideal. However, I'm more interested in the approach rather than language/package used.

Update (in response to comments):-

  1. $Z$ does not depend on the values of $w_1, w_2, w_3$

This is just an NLP (Non-Linear Programming) model. You can rewrite it as:

$$\begin{align}\min \>& Z \\ & \sum_i w_i = 1 \\ & \sum_i f_i(w_i\cdot Z)\ge k\cdot Z \\ & w_i \in [0,1] \end{align}$$

Getting rid of a division is always a good idea. If we can assume $Z\gt0$, then a slightly different formulation can look like:

$$\begin{align}\min \>& Z \\ & \sum_i w'_i = Z \\ & \sum_i f_i(w'_i)\ge k\cdot Z \\ & w'_i \ge 0 \end{align}$$

You can recover $w_i$ by $w_i := w'_i/Z$ (using the optimal values for $w'_i$ and $Z$).

Choosing appropriate solvers depends much on the details (e.g. are you looking for global or local solutions). I often try to solve using a few different solvers as predicting the best solver is not that easy. If you can express the model in AMPL or GAMS, you can try different solvers at NEOS.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.