[globalsearch] nonlinear constraint violation
조회 수: 23 (최근 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
댓글 수: 0
답변 (6개)
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;
댓글 수: 0
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
댓글 수: 0
Laura Proctor
2011년 10월 6일
Are you receiving a message that the optimal solution has been found? What is the final message saying?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Global or Multiple Starting Point Search에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!