Clear Filters
Clear Filters

Nonlinear constraint function is undefined at initial point. Fmincon cannot continue.

2 views (last 30 days)
"Nonlinear constraint function is undefined at initial point. Fmincon cannot continue." This is my error. But i've tried to run my nonlinear constraint function at x0. Nothing wrong happened. How could it be???
  3 Comments
Torsten
Torsten on 18 Oct 2023
Edited: Torsten on 18 Oct 2023
how did you solve the problem?
I guess by avoiding that the constraint function returns NaN values for the initial guess x0 you provide.
Before calling "fmincon", test what the constraint function returns for your x0 vector by calling it:
[c,ceq] = constraint_function(x0)
where "constraint_function" stands for the name of your constraint function ("nonlcon" in the documentation).

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!