False position method
|
In numerical analysis, the false position method or regula falsi method is a root-finding algorithm that combines features from the bisection method and the secant method.
Contents |
The method
Like the bisection method, the false position method starts two points a0 and b0 such that f(a0) and f(b0) are of opposite signs, which implies by the intermediate value theorem that the function f has a root in the interval [a0, b0]. The method proceeds by producing a sequence of shrinking intervals [ak, bk] that all contain a root of f.
At iteration number k, the number
- <math> c_k = a_k - \frac{a_k-b_k}{f(a_k)-f(b_k)} f(a_k) <math>
is computed. As explained below, ck is the root of the secant line through (ak, f(ak)) and (bk, f(bk)). If f(ak) and f(ck) have the same sign, then we set ak+1 = ck and bk+1 = bk, otherwise we set ak+1 = ak and bk+1 = ck. This process is repeated until the root is approximated sufficiently well.
The above formula is also used in the secant method, but the secant method always retains the last two computed points, while the false position method retains two points which certainly bracket a root. On the other hand, the only difference between the false position method and the bisection method is that the latter uses ck = (ak + bk) / 2.
Secant_method.png
Finding the root of the secant
Given a and b, we construct the line through the points (a, f(a)) and (b, f(b)), as demonstrated in the picture on the right. Note that this line is a secant or chord of the graph of the function f. In point-slope form, it can be defined as
- <math> y - f(b) = \frac{f(b)-f(a)}{b-a} (x-b). <math>
We now choose c to be the root of this line, so c is chosen such that
- <math> f(b) + \frac{f(b)-f(a)}{b-a} (c-b) = 0. <math>
Solving this equation gives the above equation for ck.
Analysis
If the initial values a0 and b0 are chosen such that f(a0) and f(b0) are of opposite signs, then the false position method will converge to a root of f. The speed of convergence will typically be superlinear, thus faster than the bisection method, but slower that the secant method.
Example code
The following C code was written for clarity instead of efficiency. It was designed to solve the same problem as solved by the Newton's method and secant method code: to find the positive number x where cos(x) = x3. This problem is transformed into a root-finding problem of the form f(x) = cos(x) - x3 = 0.
#include <stdio.h> #include <math.h> double f(double x) { return cos(x) - x*x*x; } double FalsiMethod(double s, double t, double e, double m) { int n; double r; for (n = 1; n <= m; n++) { r = t - f(t) * (s - t) / (f(s) - f(t)); if (f(r) < e) return r; if (f(s) * f(r) < 0) t = r; else if (f(r) * f(t) < 0) s = r; } return r; } int main(void) { printf("%0.15f\n", FalsiMethod(0, 1, 5E-11, 100)); return 0; }
After running this code, the final answer is approximately 0.865474032979005.
History
The oldest surviving documents demonstrating knowledge and proficiency in the false position method date from between 200 BC and 100 CE in the ancient Chinese text called The Nine Chapters on the Mathematical Art (九章算術). In this text, however, the example problems posed apply the false position method to linear equations only, and the solutions reached are arrived at in only one step.
References
Richard L. Burden, J. Douglas Faires (2000), "Numerical Analysis, (7th Ed)", Brooks/Cole. ISBN 0534382169it:Metodo di falsa posizione in Fibonacci