[General] Definition of the variables inside an interval
Quick question: can we define a variable on a given interval instead of R?
For example:
a \in [0, 1], variable
If I impose
a \in R, variable
and
a >= 0
and
1 - a >= 0
as constraints, the optimizer can still pick a outside of [0,1] even though it doesn't satisfy the constraint. The problem is that there are some functions in my model which are not defined for an a outside of [0,1], what makes the optimizer crash.
@alesiagr currently not. if this is implemented some day (check this), the interval will still be translated into the same constraint as before, which will not change anything.
an optimisation solver might indeed try points outside constraints during its iterations. can't you extend the domain of definition of your function to ensure it still makes sense and does not crash? it is typically what is done here with asqrt(x; ε=1e-9) = sqrt(sqrt(x^2+ε^2))
Thanks @jbcaillau . I did extend my function definition (which is polynomial interpolation), but it seems like the solver picks very random values which are too far away from the domain. It means that I need to prolongate the interpolation on the left and right sides of the domain pretty far away. @
Thanks! :)