[globalsearch] nonlinear constraint violation

4 次查看(过去 30 天)
Hi,
I am using globalsearch with 'fmincon' solver for an optimization problem with one nonlinear constraint and two boundary constraints. However, the optimal solutions from Matlab violates the nonlinear constraint. I tried 'Interior-point', 'sqp' and 'active-set' algorithms. But none of them returns an answer that is feasible. Is there a way to require absolute obedience of the constraint? Thank you very much.
Jie

回答(6 个)

Laura Proctor
Laura Proctor 2011-10-6
How are you defining the nonlinear constraint function?
If you only have an equality nonlinear constraint, you still need the first output of your nonlinear constraint function to be the inequality constraint. If you don't have an inequality constraint, set that variable to the empty set, i.e.
function [c,ceq] = nlc(x)
c = [];
ceq = x.^2 - 2;

Jie Ning
Jie Ning 2011-10-6
I did that. I have one nonlinear inequality constraint and no equality constraint. I defined the inequality constraint, say, f(x), then used
nonlcon = @(x) deal(f(x), []);

Laura Proctor
Laura Proctor 2011-10-6
The next thing I would check is to be sure that the nonlinear inequality constraint function is evaluated such that it should be less than or equal to zero. For the example above, the constraint would translate to:
x.^2 <= 2

Jie Ning
Jie Ning 2011-10-6
Yes. It is. I wanted the constraint to be f(x)<=0. My initial point x0 is feasible as well. However, the optimal solution x* from Matlab gives f(x*)>0. This f(x*) is ~10^(-3) while the tolerance is 10^(-6)...

Laura Proctor
Laura Proctor 2011-10-6
Are you receiving a message that the optimal solution has been found? What is the final message saying?

Jie Ning
Jie Ning 2011-10-6
The exitflag is 1 or 2. I think that means at least 1 local minimum is found and some converge, right?

类别

Help CenterFile Exchange 中查找有关 Nonlinear Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by