how to force fmincon to run in real numbers?
Show older comments
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.
Accepted Answer
More Answers (1)
Matt J
on 18 Nov 2012
0 votes
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.
Categories
Find more on Systems of Nonlinear Equations 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!