Fortran Program For Secant Method Of Solving
Secant method is considered to be the most effective approach to find the root of a non-linear function. It is a generalized from the Newton-Raphson method and does not require obtaining the derivatives of the function. So, this method is generally used as an alternative to Newton Raphson method.
Secant Method On Youtube
Program 12.3: Module examples in Fortran 90 (appeared in the book). Program 12.4: HPF code for 2D Poisson equation with the relaxation scheme (appeared in the book). Program 12.5: An example of communication in MPI environment (appeared in the book).
Secant method falls under open bracket type. The programming effort may be a tedious to some extent, but the secant method algorithm and flowchart is easy to understand and use for coding in any high level programming language.
This method uses two initial guesses and finds the root of a function through interpolation approach. Here, at each successive iteration, two of the most recent guesses are used. That means, two most recent fresh values are used to find out the next approximation.
Features of Secant Method:
- No. of initial guesses – 2
- Type – open bracket
- Rate of convergence – faster
- Convergence – super linear
- Accuracy – good
- Approach – interpolation
- Programming effort – tedious
Secant Method Algorithm:
- Start
- Get values of x0, x1 and e
*Here x0 and x1 are the two initial guesses
e is the stopping criteria, absolute error or the desired degree of accuracy* - Compute f(x0) and f(x1)
- Compute x2 = [x0*f(x1) – x1*f(x0)] / [f(x1) – f(x0)]
- Test for accuracy of x2
If [ (x2 – x1)/x2 ] > e, *Here [ ] is used as modulus sign*
then assign x0 = x1 and x1 = x2
goto step 4
Else,
goto step 6 - Display the required root as x2.
- Stop
Secant Method Flowchart:
Secant Method Program
Also see,
Secant Method C Program
Secant Method MATLAB Program
Secant method is an improvement over the Regula-Falsi method, as successive approximations are done using a secant line passing through the points during each iteration. Following the secant method algorithm and flowchart given above, it is not compulsory that the approximated interval should contain the root.
See More On Stackoverflow
Secant method is faster than other numerical methods, except the Newton Raphson method. Its rate of convergence is 1.62, which is quite fast and high. However, convergence is not always guaranteed in this method. But, overall, this method proves to be the most economical one to find the root of a function.