bugGNU Octave - Bugs: bug #61310, Please document fsolve...

 
 

bug #61310: Please document fsolve "info" output -2

Submitter:  Daniel Hatton <danhatton>
Submitted:  Fri 08 Oct 2021 10:22:10 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Daniel Hatton Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 09 Oct 2021 07:48:25 PM UTC, comment #4: 

Thanks, Arun.  Looks good.  "The search stalled" is one implication I hadn't spotted.  Are there others?

Daniel Hatton <danhatton>
Sat 09 Oct 2021 12:47:17 PM UTC, comment #3: 

Thanks for the diff.
I pushed it with you as the author to the stable branch here:
http://hg.savannah.gnu.org/hgweb/octave/rev/3dfe97a06ba9

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Fri 08 Oct 2021 11:12:30 PM UTC, comment #2: 

Copy-pasted one extra line than I intended. Please review this patch instead:


diff -r a2936935c7c8 scripts/optimization/fsolve.m
--- a/scripts/optimization/fsolve.m     Thu Oct 07 17:08:44 2021 -0400
+++ b/scripts/optimization/fsolve.m     Fri Oct 08 19:11:23 2021 -0400
@@ -107,6 +107,9 @@
 ## @item -1
 ## Stopped by @code{OutputFcn}.
 ##
+## @item -2
+## The Jacobian became excessively small and the search stalled.
+##
 ## @item -3
 ## The trust region radius became excessively small.
 ## @end table


Arun Giridhar <arungiridhar>
Group Member
Fri 08 Oct 2021 11:07:21 PM UTC, comment #1: 

Searching for "info = " with grep on fsolve.m indicates the other values of info are indeed documented, so info = -2 may have been simply overlooked in the docs. The part with info = -2 pertains to the Jacobian becoming small and the search stalling; the Jacobian norm can be computed with or without QR decomposition.

A doc patch is here. Please review and edit as needed:


diff -r a2936935c7c8 scripts/optimization/fsolve.m
--- a/scripts/optimization/fsolve.m     Thu Oct 07 17:08:44 2021 -0400
+++ b/scripts/optimization/fsolve.m     Fri Oct 08 19:04:47 2021 -0400
@@ -107,6 +107,10 @@
 ## @item -1
 ## Stopped by @code{OutputFcn}.
 ##
+## @item -2
+## The Jacobian became excessively small and the search stalled.
+## @end table
+
 ## @item -3
 ## The trust region radius became excessively small.
 ## @end table


Arun Giridhar <arungiridhar>
Group Member
Fri 08 Oct 2021 10:22:10 AM UTC, original submission:  

Lines 349-364 of scripts/optimization/fsolve.m (current default branch) make it possible for the "info" output of fsolve to take the value -2.  However, this is not among the values of the "info" output whose meanings are documented in the fsolve function reference.  From inspection of the source code, it looks like its meaning is something to do with the largest element of the Jacobian being too small for the relevant floating-point number implementation to tell it apart from zero, but I suspect I haven't understood all the details or implications.  Can someone document the -2 output, please?

Daniel Hatton <danhatton>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by danhatton (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-09 mmuetzel StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code