Computational Science Asked by Green Noob on August 9, 2021
I have a problem where I have to minimize a certain quantity $Z$ subject to the following constraints:-
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):-
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_icdot Z)ge kcdot Z & w_i in [0,1] end{align}$$
Getting rid of a division is always a good idea. If we can assume $Zgt0$, then a slightly different formulation can look like:
$$begin{align}min >& Z & sum_i w'_i = Z & sum_i f_i(w'_i)ge kcdot 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.
Answered by Erwin Kalvelagen on August 9, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP