Matlab - debugging Fmincon
이전 댓글 표시
Hello,
I am trying to use fmincon. For some reason the variables provided to the routine that calculates the goal function are the same as the inititial values in all iterations.
I check to see if the initial values are different forn the lb and ub vectors and they are.
I understand the without seeing the coede would be difficult to advise but the code is very complex and I don't want to impose, still, any ideas?
Spent like a full day trying to debug this. I could really use a 'step back' debugging option, but I understand that's not possible in Matlab.
Thank you
댓글 수: 3
Torsten
2022년 2월 15일
Did you check the value returned by the objective function for the initial values you provided ? ?
John D'Errico
2022년 2월 15일
You really need to show the actual problem for use to help more.
NAFTALI HERSCOVICI
2022년 2월 15일
채택된 답변
추가 답변 (2개)
Steven Lord
2022년 2월 15일
0 개 추천
Are the points provided to your function exactly the same as the initial guess or do they differ by a very small amount, small enough that the difference doesn't change how the points are displayed?
NAFTALI HERSCOVICI
2022년 2월 16일
0 개 추천
댓글 수: 2
John D'Errico
2022년 2월 16일
편집: John D'Errico
2022년 2월 16일
Please don't ask a question by using an answer.
As Torsten says though, there is nothing stopping you from setting a breakpoint in your objective function itself. Then you know exactly what got passed in.
There will be multiple lines in fmincon where the objective function is called, so looking for ONE line in fmincon is wrong. Anyway, you can find each of those lines yourself with a search.
카테고리
도움말 센터 및 File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!