Convergence problems of fmincon (interior-point) with a nonlinear constraint

조회 수: 2 (최근 30일)
Dear users of Matlab Central,
First, let me introduce the context. I am working on a memetic optimizer that will use the fmincon's interior-point as its local-search component. For this reason, I have to limit the movement of fmincon depending on a given radius from its starting point. In other words, fmincon will be able to freely move without exceeding a given Euclidean distance from the starting point. What I do after that is to detect if fmincon stopped on that border and, if so, restart it from there (which also moves the radius). For instance, I tested with f(x) = x^2 from -10 and radius 1.0. FMincon started from -10 and stopped at -9, Ok. Then, it started at -9 and stopped at -8... and so on, the starting point was successfully moving towards 0.0 in steps of radius = 1.0. I only had a problem, how to detect that fmincon stopped at the border. I mainly did abs(norm(x0-finalX) - radius) <= 1e-6 to relaunch from finalX as the new x0. The threshold of 1e-6 seemed too strict at some points (steps), and I opted for 1e-5 in the end.
Unfortunately, I could not solve the following problem: When my method does not detect that fmincon stopped constrained by the radius, randomly restarts it near the final solution found (within the radius). And if your new starting point is slightly "good", fmincon will not move. But it would without the non-linear constraint. Let me show you an example. I will start from -0.3 without the 1.0 radius constraint:
>> fun = @(x) x^2;
>> [sol, val, flag, output] = fmincon(fun, -0.3, [], [], [], [], -10, 10);
>> sol = 2.3446e-10
>> val = 5.4970e-20
Ok, I would be very happy with this result. However, this is what I get when adding the non-linear constraint of the radius and starting from the same point, it does not move even though the global minimum is reachable within the radius:
>> fun = @(x) x^2;
>> [sol, val] = fmincon(@(x) x^2, -0.3, [], [], [], [], -10, 10, @(x) NLConstraint(x, -0.3, 1.0));
>> sol = -0.3000
>> val = 0.0900
>> isequal(sol, -0.3)
ans = logical
1
With:
function [c,ceq] = NLConstraint(x, myStartPoint, radius) % See: https://www.mathworks.com/help/optim/ug/nonlinear-constraints.html
c = norm(x-myStartPoint) - radius;
ceq = [];
end
That problem does not seem to occur if I start farther:
>> fun = @(x) x^2;
>> [sol, val] = fmincon(@(x) x^2, -0.7, [], [], [], [], -10, 10, @(x) NLConstraint(x, -0.7, 1.0));
>> sol = -2.5933e-08
>> val = 6.7253e-16
Now, it moved. In fact, as I said, if I start from -10, I will reach -9, from -9 I will reach -8...
>> [sol, val] = fmincon(@(x) x^2, -8, [], [], [], [], -10, 10, @(x) NLConstraint(x, -8, 1.0));
>> sol = -7.0000
>> val = 49.0000
Thus, I am a little bit confused with the behavior that I got from -0.3 (only with the non-linear constraint active). I would highly appreciate your help to understand why fmincon does not move from -0.3 when it could reach the optimum while also meeting the requirements.
Thank you very much in advance for your help!
PS: I am using Matlab 2018b and Optimization Toolbox 8.2.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver-Based Nonlinear Optimization에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by