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

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

[Octave-bug-tracker] [bug #41146] Different results for fsolve in versio


From: Rik
Subject: [Octave-bug-tracker] [bug #41146] Different results for fsolve in version 3.4.3 vs. 3.2.4
Date: Thu, 09 Jan 2014 05:26:57 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0

Update of bug #41146 (project octave):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #3:

First, versions 3.2 and 3.4 are absolutely ancient and are no longer
supported.  You want to upgrade to 3.8 which is the latest stable release. 
See the downloads page (http://www.gnu.org/software/octave/download.html).

Have a look at the documentation for fsolve by using


help fsolve


from within Octave.

The INFO code from fsolve tells whether the algorithm succeeded or not.  From
the documentation


On return, FVAL contains the value of the function FCN evaluated
    at X, and INFO may be one of the following values:

   1
         Converged to a solution point.  Relative residual error is
         less than specified by TolFun.

   2
         Last relative step size was less that TolX.

   3
         Last relative decrease in residual was less than TolF.

   0
         Iteration limit exceeded.

   -3
         The trust region radius became excessively small.


So for 3.2.4 the return code was 0 which means that the algorithm did not
converge because the iteration limit was exceeded.  The fact that the answer
looks better is not meaningful since the return code says that the algorithm
failed.  For version 3.4.3 the return code was 3 which is also a failure.

Like most optimization algorithms, the solver is sensitive to the initial
point where you begin searching from.  I got the algorithm to converge by
changing the initial point and allowing it to run a bit longer with more
iterations.


[x, fval, info] = fsolve (@f, [1; 0; 0], optimset ("MaxIter", 1e3))
x =

    8.1103
    8.2196
  -76.6589

fval =

   2.8548e-10
   3.0565e-09
   7.3383e-06

info =  1


This isn't a bug in Octave, just normal variation with respect to convergence
for a non-linear solver.


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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