i solving system of equations using fsolve. fsolve warns me objective functions return nan , tries new point. want figure out how equations deliver nan particular guess fsolve puts in when generates warning. there way stop fsolve @ point , obtain value of guess?
i tried dbstop if naninf, doesn't since there few places in function generates intermediate variables equal nan or inf. puzzled why equations return nan in end.
it's not optimal if have large number of iterations, can set display option of fsolve display parameters after every iteration:
options = optimoptions('fsolve','display','iter'); [x,fval] = fsolve(@fun,x0,options)
Comments
Post a Comment