how to force fmincon to run in real numbers?
이전 댓글 표시
Hi:
I'm using fmincon with user-defined fun and nonlcon. All values are real. But I found that sometimes fmincon tries to search in complex numbers, and appears dead. How can I force fmincon to run in real numbers, if it can't find optimal value in real numbers, just exit with an error, don't run into complex numbers. Or is there any matlab function can meet my requirement (search in real)? Thank you.
채택된 답변
추가 답변 (1개)
Matt J
2012년 11월 18일
0 개 추천
If you write your function to return NaN or Inf in the regions where it would normally be complex-valued, the SQP algorithm in FMINCON will try to take smaller steps when it encounters those regions and hopefully maneuver around them.
카테고리
도움말 센터 및 File Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!