M-Files software The M-Files document management software consists of the following components: M-Files Desktop, M-Files Admin, M-Files Desktop Settings, Show Status and M-Files Server. Secant Method Helps to sleve equations in MATLAB Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. Function c = secant(x0, x1, delta)%% Math 464 Autumn 06%%%% Remember that the function statement must be at the top of%% your m-file! Comments come after the function statement.%%%%%% secant.m%%%% Implements the secant method%%%% Input: x0 initial guess for the root of f%% x1 another initial guess for the root of f%% delta the. View THE SECANT METHOD.docx from COLLEGE OF at Mindanao University of Science and Technology. THE SECANT METHOD Use the secant method to estimate the root of f ( x )=e−x −5 x 3+2 x.

% secant method it=0; xb=startl(1); fb=f(xb); xc=startr(1); fc=f(xc); while abs(xc-xb)tol it=it+1; xa=xb; fa=fb; xb=xc; fb=fc; xc=xb-fb.(xb-xa)/(fb-fa); fc=f(xc);% print progress%fprintf(’ n =%i Computed Solution =%20.15e Cauchy Error =%e ’,it,xc,abs(xc-xb)); end; xs=xc;% print results fprintf(’ Computed Solution =%e ’,xs).

### Secant Method M File Download

Original file (SVG file, nominally 351 × 315 pixels, file size: 6 KB)

## Summary

Description | Illustration of the secant method. Created by Jitse Niesen using Xfig. |

Date | (original upload date) |

Source | No machine-readable source provided. Own work assumed (based on copyright claims). |

Author | No machine-readable author provided. Jitse Niesen assumed (based on copyright claims). |

## Licensing

I, the copyright holder of this work, release this work into the public domain. This applies worldwide.In some countries this may not be legally possible; if so: I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |

## Xfig source

## derivative works

Derivative works of this file: Secant method 2.svg

### Captions

## File history

Click on a date/time to view the file as it appeared at that time.

Date/Time | Thumbnail | Dimensions | User | Comment |
---|---|---|---|---|

current | 11:58, 19 June 2006 | 351 × 315 (6 KB) | Jitse Niesen | Illustration of the w:secant method. Created by ~~~ using Xfig. |

## File usage

## Global file usage

The following other wikis use this file:

### Matlab Secant Method M File

- Usage on ca.wikipedia.org
- Usage on cs.wikipedia.org
- Usage on en.wikibooks.org
- Usage on es.wikipedia.org
- Usage on fa.wikipedia.org
- Usage on fi.wikipedia.org
- Usage on fr.wikipedia.org
- Usage on he.wikipedia.org
- Usage on hu.wikipedia.org
- Usage on id.wikipedia.org
- Usage on it.wikipedia.org
- Usage on ko.wikipedia.org
- Usage on pt.wikipedia.org
- Usage on sl.wikipedia.org
- Usage on sr.wikipedia.org
- Usage on sv.wikipedia.org
- Usage on zh.wikipedia.org

## Secant Method

The secant method is an iterative procedure to estimate a root of an equation*f(x) = 0*where the user gives two initial estimates and a tolerance. One of the two initial estimates is regarded as being older than the other, the procedure then calculates a new estimate and discards the oldest estimate until the distance between the two estimates is less than the preassigned tolerance. If

*x*and

_{i-1}*x*are the two estimates with

_{i}*x*being older than

_{i-1}*x*, the new estimate

_{i}*x*is that point on the x-axis which is the intersection of the x-axis and the line joining the points

_{i+1}*( x*and

_{i-1}, f(x_{i-1}) )*( x*on the curve

_{i}, f(x_{i}) )*y = f(x)*

### Newton Secant Method

. The subsequent estimate then uses the points*( x*and

_{i}, f(x_{i}) )*( x*to estimate

_{i+1}, f(x_{i+1}) )*x*.

_{i+1}It is best to avoid using the secant method if there are local extrema near the root. The convergence of the secant method depends on the initial estimates. It is generally better if the two initial conditions are close so that the secant is approximately equal to the tangent.

### Function List

- double Secant_Method( double (*f)(double), double a, double b, double tolerance, int max_iteration_count, int *err)

Find a root of*f(x)*in near*a*and*b*. The procedure terminates when the absolute difference of the return value and the actual root is less than*tolerance*, where*tolerance*is a user specified number specifying the desired accuracy of the result. The input argument*max_iteration_count*allows the user to control the maximum number of iterations to attempt. The method returns an*err*of 0 if the iteration was successful, -1 if the number of iterations exceed the maximum allowable number of iterations as specified by the user, and -2 if an attempt was made to divide by zero, which is indicative of a local minimum or a local maximum. Even if the an err return of 0 occurs, it is possible that the result is erroneous, especially if there is a local minimum or local maximum near the root. For this reason, if it is not known whether there is a local extremum in a small neighborhood of the root, the result should be checked for its validity.

*C* Source Code

- The file, secant_method.c, contains the version of Secant_Method( ) written in
*C*.