Tfzero

From TomWiki
Jump to navigationJump to search


Purpose

Find a zero for in the interval . Tfzero searches for a zero of a function between the given scalar values and until the width of the interval (xLow, xUpp) has collapsed to within a tolerance specified by the stopping criterion, . The method used is an efficient combination of bisection and the secant rule and is due to T. J. Dekker.

Calling Syntax

[xLow, xUpp, ExitFlag] = Tfzero(x_L, x_U, Prob, x_0, RelErr, AbsErr)

Description of Inputs

Variable Description
x_L Lower limit on the zero x to f(x).
x_U Upper limit on the zero x to f(x).
Prob Structure, sent to Matlab routine ZeroFunc. The function name should be set in Prob.FUNCS.f0. Only the function will be used, not the gradient.
x_0 An initial guess on the zero to f(x). If empty, x 0 is set as the middle point in [x_L, x_U].
RelErr Relative error tolerance, default 1E-7.
AbsErr Absolute error tolerance, default 1E-14.

Outputs

Variable Description
xLow Lower limit on the zero x to f(x).
xUpp Upper limit on the zero x to f(x).
ExitFlag Status flag 1,2,3,4,5.

1: xLow is within the requested tolerance of a zero. The interval (xLow, xUpp) collapsed to the requested tolerance, the function changes sign in (xLow, xUpp), and f(x) decreased in magnitude as (xLow, xUpp) collapsed.

2: f(xLow) = 0. However, the interval (xLow, xUpp) may not have collapsed to the requested tolerance.

3: xLow may be near a singular point of f(x). The interval (xLow, xUpp) collapsed to the requested tolerance and the function changes sign in (xLow, xUpp), but f(x) increased in magnitude as (xLow, xUpp) collapsed, i.e. abs(f(xLow)) > max(abs(f(xLow - IN )), abs(f(xUpp - IN ))).

4: No change in sign of f(x) was found although the interval (xLow, xUpp) collapsed to the requested tolerance. The user must examine this case and decide whether xLow is near a local minimum of f(x), or xLow is near a zero of even multiplicity, or neither of these.

5: Too many (> 500) function evaluations used.