|
From: | Fausto Arinos de A. Barbuto |
Subject: | Re: fsolve shows repeated results |
Date: | Fri, 16 Oct 2015 20:28:47 -0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 16-10-2015 19:04, Nicholas Jankowski wrote:
ok, I was curious: >> xf = [0.1:0.5:5]; >> yf = xf.*tan(xf) - 42; >> x = linspace(0,10,1000); >> plot(x,x.*tan(x) - 42.0,xf,yf,'r*') seems to make sense now why one skipped over to the 7.6 value. it's on a very low slope section of the graph. something in the algorithm made it jump far to the right, and it found itself on a new section to find a new zero.
Like the Newton-Raphson formula, whose 1st derivative f'(x) might intercept f(x) at a point far away from the actual root, right? Makes total sense. Examining your plot I observed though that there are other points on the same low-slope section of f(x). And none 'misbehaved'. There's more in this case than meets the eye, I guess. Fausto
[Prev in Thread] | Current Thread | [Next in Thread] |