How to debug lineSearch, or fminusub?

7 Ansichten (letzte 30 Tage)
Felix
Felix am 15 Jan. 2021
Hi there,
I'm trying to run multiple solvers and their algorithms to solve for 2-6 parameters. This is working fine for almost all initial points, solvers and algorithms that I use. However, for some reason the fminunc solver runs into a NaN or Inf during some iteration with one specific inital point. The NaN/Inf occurs in the roots function, which is called by lineSearch, which is in turn called by fminusub, again called by fminunc. I would like to set a break point in the lineSearch function and find out what is happening here, however I can't seem to find the lineSearch function.
This is my error:
Error using roots (line 27)
Input to ROOTS must not contain NaN or Inf.
Error in lineSearch
Error in lineSearch
Error in lineSearch
Error in lineSearch
Error in fminusub (line 186)
lineSearch(funfcn,x,dir,f,dirDerivative, ...
Error in fminunc (line 472)
[x,FVAL,GRAD,HESSIAN,EXITFLAG,OUTPUT] = fminusub(funfcn,x, ...
Typing:
help lineSearch
% or
open lineSearch
returns:
Error using open (line 86)
File 'linesearch' not found.
% or
lineSearch not found.
lineSearch is called on line 186 in fminusub.m but it seems I can't open it. I can put break points inside root.m but all I see here is nondescript numbers and the offending Inf. I don't know at which point root is called with an Inf and why. Do you have any ideas on how to debug this?
Thank you.

Antworten (0)

Kategorien

Mehr zu Mathematics and Optimization finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by