patternsearch returns result violates equality constraint

2 views (last 30 days)
Dear All,
I am using patternsearch to do my optimization problem. I find the results sometimes violate the equality constraint. Do you why does that happen?
I let A=[1,1,1] and b=1, which means that the sum of the parameters should be equal to 1. But occasionally there the sum is equal to 1.001 or 0.995.
Cheers, Xueqi

Answers (1)

Alan Weiss
Alan Weiss on 22 Sep 2014
It is not clear to me whether you are using the A, b arguments or the Aeq, beq arguments. The latter are for the equality constraints.
In any case, when you have linear constraints I suggest that you use the GSSPositiveBasis2N or GSSPositiveBasisNp1 poll methods. They are slightly more efficient and robust for linear constraints than the default GPSPositiveBasis2N.
You can also try lowering the value of the TolBind option. The default 1e-3 might be too high for your problem. Please do not lower this option too much, try 1e-6 or so, or you can make the algorithm slow.
Alan Weiss
MATLAB mathematical toolbox documentation

Community Treasure Hunt

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

Start Hunting!