octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53991] Octave crashes using fsolve when x0 is


From: Rik
Subject: [Octave-bug-tracker] [bug #53991] Octave crashes using fsolve when x0 is a stationary point
Date: Wed, 20 Jun 2018 14:35:33 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #7, bug #53991 (project octave):

I checked in a change to avoid the crash at a stationary point
(http://hg.savannah.gnu.org/hgweb/octave/rev/dffd9f6ee85c).  I used this test


+        if (norm (fjac, 1) < macheps * rows (fjac))
+          info = -2;
+          break;
+        endif


Since norm (x,1) is an absolute column sum I needed to scale macheps by the
number of rows in the matrix.

I will probably backport this to stable, but not before the other issue is
solved.  You are correct that if the user happens to specify a solution as the
initial starting point then fsolve returns info=-3.  A simple test is just a
line,


[x, fvec, info] = fsolve (@(x) 5*x, 0)
x = 0
fvec = 0
info = -3


The simplest thing would just be to copy the test for success to be at the top
of the file just outside the start of the outer loop.


      ## FIXME: Why tolf*n*xn? If abs (e) ~ abs(x) * eps is a vector
      ## of perturbations of x, then norm (fjac*e) <= eps*n*xn, i.e., by
      ## tolf ~ eps we demand as much accuracy as we can expect.
      if (fn <= tolf*n*xn)
        info = 1;


However, we don't have xn available at that time.  Maybe someone can work out
what xn should be for the first case of iteration.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53991>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]