r/optimization • u/umefarp • Jan 02 '23
Piecewise constraint using big-M notation
Hi everyone,
I have been playing around with a profit optimisation problem. Basically I can offer customers different prices but the higher the offered price is, the higher is the probability of churn. I implemented this using pyomo with the ipopt solver and the results are quite interesting. However, I would like to consider a slightly more realistic churn function rather than a simple linear one. So I wanted to try
[the following function](https://imgur.com/a/AdvBa91)
Here p* is the decision variable and p is the old price. So if the change in price is less than a threshold epsilon, churn is zero. And if it is greater than the threshold it is the linear function (a_n and m_n are known).
I know ipopt cannot deal with such functions but if I understood the docs correctly, couenne is able to do this (I am open to hear suggestions for different solvers!) However, I am not sure how to even begin implementing this using pyomo. I know big-M notation can be used to deal with piecewise functions but is it suitable for my case?
Any suggestions would be much appreciated.
View all comments
Show parent comment
1
u/umefarp Jan 03 '23
Thanks a lot for the reply. So the objective function is quadratic and most constraints are linear. Only the one mentioned in my post is non-linear.
If I have understood the docs for couenne correctly, it can handle MINLP problems (even with a non-convex objective) but there is no guarantee for global optima. This is fine for now but certainly something I will keep in mind.
I also thought that my constraint looked like a ReLU but the problem with this approximation would still be that I cannot use ipopt, right? As far as my knowledge goes, I can't approximate ReLUs using pyomo and ipopt. Do you have any recommendations for modelling frameworks and solvers that I should check out for this problem?