How to store nonlcon value at solution using fmincon?

조회 수: 1 (최근 30일)
Hi everyone,
Pretty much the question on the title. I am using fmincon to solve an optmization problem with several non linear constraints. I would like to know which constraint was active at the solution point, and its value if possible.
I know it's possible to use OutputFcn to call a function in each iteration, but I would prefer not to, as I only want the value at the solution point.
Many thanks,
Vinicius Almeida.

채택된 답변

Walter Roberson
Walter Roberson 2021년 8월 4일
편집: Walter Roberson 2021년 8월 4일
fmincon() is permitted to evaluate at locations without passing that exact location through the nonlinear constraints before or after the evaluation. Therefore recording the results of the nonlinear constraint is not certain to give you the correct answer.
Instead, after you are given the location at the end, pass the location into the nonlinear constraint function yourself, and look at the results.
  댓글 수: 1
Vinicius Belarmino Almeida
Vinicius Belarmino Almeida 2021년 8월 4일
That makes sense, hadn't thought of that, thanks!
Still, I think a display of the active restrictions would be helpful in some situations 😂

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by