What does this other Fmincon error mean?

조회 수: 11 (최근 30일)
Amir Patel
Amir Patel 2013년 6월 18일
댓글: Nayan Rawat 2019년 9월 9일
Hi there
I'm doing a constrained optimization problem where I first generate a few random intial points, I then only keep the feasible ones. I do this by running the objective function to see if it returns a NaN. NaN is returned when the
Then I use the feasible set of initial values and I call fmincon in a FOR loop. I am not using parallel computing toolbox.
However, I sometimes receive an error after fmincon begins from a feasible point.
Here is the output:
Error using barrier (line 143)
Finite difference derivatives undefined at initial point. Fmincon cannot continue.
Error in fmincon (line 841)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
Error in FreeTailObjConstr (line 74)
[x,fval,exitflag] = fmincon(fun,x0,Aineq,Bineq,Aeq,Beq,Lwr,Upr,cfun,options,param);
Error in multiStartFreeTail (line 120)
[x,fval,exitflag] = FreeTailObjConstr(x0, UB, LB, muVal);
end
What does this mean? Is it happening because even though the first point is feasible, the next point fmincon attempts returns is NaN?
Any help would be appreciated.
Cheers
Amir
  댓글 수: 1
Nayan Rawat
Nayan Rawat 2019년 9월 9일
I have a similar problem. Any solutions?

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

채택된 답변

Alan Weiss
Alan Weiss 2013년 6월 18일
fmincon estimates derivatives by taking finite difference steps. Your initial point was feasible, but once fmincon took a tiny step to estimate a derivative, the objective was no longer feasible. fmincon cannot recover from this sort of error at the initial point, though it can recover if the error occurs during subsequent iterations.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Amir Patel
Amir Patel 2013년 6월 18일
Thanks for clearing that up Alan.
To get around the NaN error, I tried setting a cost to a large value before the Simulink integrator's break.
But now, fmincon is struggling to converge...
Any advice on how to tackle this sort of problem?

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by