필터 지우기
필터 지우기

I need an error message if fmincon converges out of constraints

조회 수: 2 (최근 30일)
Michael Käufl
Michael Käufl 2020년 3월 30일
답변: Walter Roberson 2020년 3월 30일
Hey Guys,
I am using the solver fmincon to find a local minimum of my systems of equations.
My input is some measured data. Some of the data is not good enough, so my script cannot handle it. Therefore i need an error message if the solver fmincon cannot converge within my given constraints. I dont want to change my whole code, I just have no clue about including a error message if the constraints are not fulfilled. :)
Please help me including an error message!
Thanks community! :-)

답변 (1개)

Walter Roberson
Walter Roberson 2020년 3월 30일
Exit flag -2 "No feasible point was found." implies that your constraints are so tight that fmincon could not find even one point that satisfied them.
If fmincon is able to find even one point that satisfies the constraints, then by definition it has located a minima (the best of the points it finds that satisfy constraints.) The only time you would talk about converging would be for
Exit flag 0 "Number of iterations exceeded options.MaxIterations or number of function evaluations exceeded options.MaxFunctionEvaluations."
That exit code is not entirely clear about the possibility that mathematically it still had places it was willing to look for feasible points but had not yet found any, compared to the possibility that it had found at least one feasible point but ran out of iterations before converging. In practice, exit flag 0 is reserved for having found at least one feasible point.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by