[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug in fsolve() affecting convergence depending on the returned args
From: |
Christophe Prud'homme |
Subject: |
Re: bug in fsolve() affecting convergence depending on the returned args |
Date: |
Wed, 26 Apr 2006 07:53:03 +0200 |
User-agent: |
KMail/1.9.1 |
| Yes, but I think there is a simple reason for it. When you call
| fsolve like this:
|
| w = fsolve (f, x0);
|
| error messages are printed so you won't miss them. But when you call
| fsolve like this:
|
| [w, info] = fsolve (f, x0);
|
| or
|
| [w, info, msg] = fsolve (f, x0);
|
| the messages are suppressed because you asked for the status in info
| (or info and msg). Check the value of info (and msg) in the case that
| you think is good. I suspect info is 3 and msg is "iteration is not
| making good progress".
John,
I just checked info/msg and they are ok all along when I retrieve them in
the "good" case, and the testcase goes all the way through without problems.
here is the log in the good case
===============
% cranknic_test2
get w and info
info = 1
msg = solution converged within specified tolerance
get w and info OK
N = 4
get w and info
info = 1
msg = solution converged within specified tolerance
get w and info OK
N = 8
get w and info
info = 1
msg = solution converged within specified tolerance
get w and info OK
N = 16
get w and info
info = 1
msg = solution converged within specified tolerance
get w and info OK
N = 32
get w and info
info = 1
msg = solution converged within specified tolerance
get w and info OK
N = 64
==================
However in the "bad", it _breaks_ for N=32
here is the log
===================
octave:3> cranknic_test2
get only w
get only w OK
N = 4
get only w
get only w OK
N = 8
get only w
get only w OK
N = 16
get only w
get only w OK
N = 32
get only w
error: fsolve: iteration is not making good progress
error: evaluating assignment expression near line 24, column 7
error: evaluating for command near line 22, column 1
error: called from `cranknic_bad' in file `/tmp/cranknic_bad.m'
error: evaluating for command near line 8, column 1
error: near line 27 of file `/tmp/cranknic_test2.m'
======================
PS: this code appears in the chapter on ordinary differential equations
Best regards
C.
--
Christophe Prud'homme
EPFL SB IACS CMCS
MA B2 534 (Bâtiment MA)
Station 8
CH-1015 Lausanne
Tel: +41 (0)21 693 25 47
Fax: +41 (0)21 693 43 03