How can I use lsqnonlin in an optimization procedure where it is possible that the evaluation of the objective function might return NaN?
7 views (last 30 days)
Show older comments
I have read that lsqnonlin optimization solver can work even if the objective function returns NaN or Inf at some point within the design space. I understood that lsqnonlin would not take this solution into account and continue the optimization procedure with valid points.
However, I am getting the following error:
??? Error using ==> eig Input to EIG must not contain NaN or Inf.
Error in ==> trust at 28 [V,D] = eig(H);
Error in ==> trdog at 110 [st,qpval,po,fcnt,lambda] = trust(rhs,MM,delta);
Error in ==> snls at 365 [sx,snod,qp,posdef,pcgit,Z] = trdog(x,g,A,D,delta,dv,...
Error in ==> lsqncommon at 149 [xC,FVAL,LAMBDA,JACOB,EXITFLAG,OUTPUT,msgData]=...
Error in ==> lsqnonlin at 241 [xCurrent,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
Error in ==> main at 53 [x,resnorm,residual,exitflag,output,lambda,jacobian] = lsqnonlin(@CostFuncLsqnonlin,x0,lb,ub,options);
I have tried a lot of possible solutions but haven't been able to solve the issue. I would really appreciate some assistance.
Thanks a lot.
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!