Variant of the Secant Method
|
12-11-2023, 03:25 PM
(This post was last modified: 11-12-2024 04:38 PM by Albert Chan.)
Post: #12
|
|||
|
|||
RE: Variant of the Secant Method
(12-11-2020 04:34 PM)Albert Chan Wrote: Quadratic interpolation is simply 2 linear interpolations, followed by linear interpolation. It may seems we need 3 secant root steps for 3-points fit, in a loop, we only need 2 x2 y2 x3 y3 y23 x1 y1 y12 y123 Next iteration y23 → y12, can be reused. Secant setup code Code: function newx(a,fa, b,fb) return b - fb/(fb-fa)*(b-a) end Code: function S.secant2(f,a,b,eps,verbal,c) -- 3 pt fit lua> f = fn'x: x^3 - 8' lua> x = S.secant2(f, 5, 4, 1e-9, true) 5 4 3.081967213114754 2.3945608933295457 2.0980163342039635 2.0088865345029276 2.0001129292461193 2.0000000388749792 2.0000000000000164 2 Result matched post #8 For completeness, here is S.secant3 (OP "improved" secant) Code: function S.secant3(f,a,b,eps,verbal,c) -- slope extrapolated lua> x = S.secant3(f, 5, 4, 1e-9, true) 5 4 3.081967213114754 2.2862188297178117 2.010344209437878 1.99979593345267 2.0000000722313933 2.000000000000015 2 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Variant of the Secant Method - ttw - 12-09-2020, 04:33 AM
RE: Variant of the Second Method - Valentin Albillo - 12-09-2020, 05:40 AM
RE: Variant of the Second Method - Albert Chan - 12-09-2020, 04:38 PM
RE: Variant of the Secant Method - Albert Chan - 12-09-2020, 11:51 PM
RE: Variant of the Secant Method - Namir - 12-10-2020, 01:54 PM
RE: Variant of the Secant Method - Namir - 12-10-2020, 02:56 PM
RE: Variant of the Secant Method - Albert Chan - 12-11-2020, 04:34 PM
RE: Variant of the Secant Method - Albert Chan - 12-11-2023 03:25 PM
RE: Variant of the Secant Method - Albert Chan - 12-11-2020, 04:46 PM
RE: Variant of the Secant Method - Namir - 12-12-2020, 04:22 AM
RE: Variant of the Secant Method - ttw - 12-12-2020, 02:41 PM
RE: Variant of the Secant Method - Albert Chan - 12-12-2020, 04:27 PM
RE: Variant of the Secant Method - Thomas Klemm - 12-16-2023, 08:11 PM
|
User(s) browsing this thread: 1 Guest(s)