I have an optimization problem that I'd like to solve in python. The objective function is NOT convex everywhere. I thought I'd use CVXPY, but any other package in python is welcome. Here is the problem:
Minimize p(x_1) + p(x_2) + ... + p(x_n)
Subject to:
i. 0 <= x_i <= 1 for all i
ii. x_1 + ... + x_n = 1
Where p(x) is a polynomial penalty function. My current function is p(x) = x^3(1-x)^2(x+2).
Remarks:
a. The minimum is obtained whenever one of the variables equals 1, and the others equal zero
b. I am interested in the optimizer correctly identifying such a minimum. I am NOT interested in identifying all minimums. I am just seeking an optimizer capable of identifying one minimum.
c. As you can see here (https://www.wolframalpha.com/input?i=x%5E3%281-x%29%5E2%28x%2B2%29+second+derivative), the function p(x) is convex in the intervals [0, 0.37] and [0.85, 1] and concave between [0.37, 0.85] .
d. I plan to code this project in python.
e. Many thanks for your help!