(12C Platinum) Zero of Function
|
02-03-2019, 05:57 PM
(This post was last modified: 02-03-2019 06:31 PM by Dieter.)
Post: #3
|
|||
|
|||
RE: (12C Platinum) Secant Method
(02-03-2019 01:31 PM)Albert Chan Wrote: I thought Secant's method required 2 points, thus 4 variables: (x0, f0), (x1,f1) Take a look at the code and see what it does:
The choice of a is crucial as it decides whether the iteration will converge at all. It doesn't matter if a is greater or less than b (which can be shown easily). The iteration may converge, diverge or oscillate between different values. As a rough rule the value of a should be close to the slope (!) of the function near the root, and b should be close to the root itself. Again: only b is a guess for the root, but a isn't. Consider the first example x³+x²+x–2 = 0. There is a root at ≈0,81. At this root the slope (derivative) is ≈4,6. At the initial guess b=1 the derivative is 6. So values for a in this range, say 4...6, will make the iteration converge well, similar to Newton's method. Now try a=2 and b=1. The iteration does not converge and will finally oscillate between approx. 0,3 and 1,09. Then try a=–1 and b=1. The iteration will diverge towards infinity (eventually causing an overflow error). So this method only works under some exactly defined conditions. Or, as Gamo put it: (02-03-2019 10:34 AM)Gamo Wrote: This is not a perfect program, use at your own risk. ;-) Edit: here is another version of Gamo's program that might be more clear: Code: 001 STO 0 Dieter |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(12C Platinum) Zero of Function - Gamo - 02-03-2019, 10:34 AM
RE: (12C Platinum) Secant Method - Albert Chan - 02-03-2019, 01:31 PM
RE: (12C Platinum) Secant Method - Dieter - 02-03-2019 05:57 PM
RE: (12C Platinum) Secant Method - Gamo - 02-04-2019, 01:00 AM
RE: (12C Platinum) Zero of Function - Dieter - 02-04-2019, 05:19 PM
|
User(s) browsing this thread: 1 Guest(s)