stop fmincon if encounter warning about rank

조회 수: 1 (최근 30일)
JD
JD 2014년 2월 6일
댓글: Matt J 2014년 2월 8일
Hi,
I'm running fmincon using the sqp algorithm to run a montecarlo.
Sometimes (a couple out of a hundred) it encounters a matrix close to singluar and gets caught.
Is there a way to stop the optimizer and move on to the next with an exitflag that will let me know it did so?
I tried interior point, but after 10000 maxiter it didn't get close to the minimum that sqp was finding, so seems like sqp is better for this problem if I can find a way to cancel the optimization and move on if it encounters the warning.
Thanks for any tips.

답변 (1개)

Matt J
Matt J 2014년 2월 6일
편집: Matt J 2014년 2월 6일
You can define your own stopping conditions using the OutputFcn option, see here
I don't think it offers a way to control the native exitflag output argument, but you can send the flag to a global variable, or use nested functions that share variables.
  댓글 수: 9
JD
JD 2014년 2월 8일
Thank you, I did not know the strcmp command, so came with with some ad hoc way to do this. This is helpful.
Do you have a suggestion for how to check elapsed time in the OutputFcn?
Thanks again.
Matt J
Matt J 2014년 2월 8일
Like I said, the way you are doing it now seems fine, except that tstart would have to be made persistent, and reset to 0 at an appropriate 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