Can pattern search consider the poll successful if it finds a point with the same objective function as the current one?
Show older comments
I have an optimization problem that is multidimensional and rather complex. My nonlinear constraints aren't continuous and the objective function is continuous and differentiable. However, I'm first trying to just find a feasible solution and I'm using patternsearch to do this:
opts = optimoptions('patternsearch','Algorithm','classic' , 'Display', 'iter', 'UseParallel', true, 'UseCompletePoll',true,'PollMethod','MADSPositiveBasis2N');
x0 = patternsearch(@(x)J_constraints(x, lowerLimit, upperLimit, z_des, angleBounds) , x0, [],[],[],[],lb,ub,[],opts);
The thing is that my J_constraints function (representing the nonlinear constraints from earlier) needs to be negative and has significant regions in which it is constant. Therefore often when I run patternsearch it stays at the same point since all of the mesh points have actually the same value as the current point:
Iter Func-count f(x) MeshSize Method
95 4034 2270 6.985e-10 Refine Mesh
96 4034 2270 3.492e-10 Refine Mesh
97 4034 2270 1.746e-10 Refine Mesh
98 4034 2270 8.731e-11 Refine Mesh
99 4034 2270 4.366e-11 Refine Mesh
100 4034 2270 2.183e-11 Refine Mesh
101 4034 2270 1.091e-11 Refine Mesh
102 4034 2270 5.457e-12 Refine Mesh
103 4034 2270 2.728e-12 Refine Mesh
104 4034 2270 1.364e-12 Refine Mesh
105 4034 2270 6.821e-13 Refine Mesh
What I would like it to do is to change the point even if the objective function is the same in the best point from the mesh and of course effectively increase the mesh size (consider the poll successful even though the objective function stays the same). Is there a way to do this? I don't care that much about other parameters (whether I use the "classic" version or the "nups" one, whether it's MADS, GPS or GSS etc.)
Essentially, I would like to change the PollMethod. Is there any way to do this?
I've also tried using the SearchFcn option, but wasn't quite successful because I the mesh points are not available within the function.
Thank you in advance for any help!
Answers (1)
Umar
on 4 Jul 2024
1 vote
Hi Aleksa,
The cause of the issue is that the patternsearch algorithm considers the objective function value as the criterion for updating the current point. If all the mesh points have the same value as the current point, the algorithm assumes that it has reached a local optimum and does not update the point. So, to overcome this issue and allow the patternsearch algorithm to update the current point even if the objective function value is the same, you can modify the PollMethod option. The PollMethod determines how the algorithm explores the search space. By default, the 'MADSPositiveBasis2N' method is used, which may not be suitable for your problem. Try changing the PollMethod to a different value, such as 'GPSPositiveBasis2N' or 'GSSPositiveBasis2N', to see if it improves the algorithm's behavior. These methods use different strategies for exploring the search space and may help in situations where the objective function value remains constant.Here's an updated version of the code with the PollMethod option changed to 'GPSPositiveBasis2N':
opts = optimoptions('patternsearch', 'Algorithm', 'classic', 'Display', 'iter', 'UseParallel', true, 'UseCompletePoll', true, 'PollMethod', 'GPSPositiveBasis2N');
x0 = patternsearch(@(x)J_constraints(x, lowerLimit, upperLimit, z_des, angleBounds), x0, [], [], [], [], lb, ub, [], opts);
You can experiment with different PollMethod options to find the one that works best for your problem. Additionally, you can also try adjusting other parameters, such as the mesh size or the algorithm type ('classic' or 'nups'), to further improve the performance of the patternsearch algorithm.
1 Comment
Categories
Find more on Direct Search in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!