Skip to main content

logistics function

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Currently, the way you describe is the only way to model that kind of nonconvex function in Gurobi, i.e., you have to model

    \[\begin{align*}
    w_1 &= L(z)\\
    w_2 &= \exp(w_1)\\
    w_3 &= 1 + w_2\\
    w_4 &= \log(w_3)
    \end{align*}\]

    where \(w_i\) are auxiliary variables and the functions \(\exp, \log\) are implemented via the general constraints feature. Note that it is of high importance to provide tight variable bounds for variable \(w_1\) because it is the argument variable for the \(\exp\) function which already for very small input values achieves huge output. For \(w_3\), it is important to make sure that it is not too close to \(0\) to avoid the very steep part of \(\log\).

    Your title states "logistic function". Note that Gurobi has a general constraint describing the logistic function. However, it is different from the one you use but maybe you can still make use of it.

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.