|
TOMLAB OPTIMIZATION ENVIRONMENT: Tfzero |
![]() |
Tfzero
Purpose
MEX interface for Tfzero, TOMLAB fzero
routine
Find a zero for f(x) in an interval
Syntax
[xLow, xUpp, ExitFlag] = Tfzero(xLow, xUpp, Prob, x_0, RelErr, AbsErr)
Description
Tfzero searches for a zero of a function f(X)
between the given values xLow and xUpp until the width
of the interval (xLow,xUpp) has collapsed to within a tolerance
specified by the stopping criterion,
abs(xLow-xUpp) <= 2.*(RelErr*abs(xLow)+AbsErr).
The method used is an efficient combination of bisection and the secant rule and is due to T. J. Dekker.
Input Parameters
xLow A lower bound on the zero x to f(x)
xUpp An upper limit on the zero x to f(x)
Prob Structure, sent to matlab routine ZeroFunc
x0 An initial guess on the zero to f(x).
If empty, x0 is set as the middle point in [xLow,xUpp]
RelErr Relative error tolerance, default 1E-7
AbsErr Absolute error tolerance, default 1E-14
Output Parameters
xLow A lower limit on the zero x to f(x)
xUpp An upper limit on the zero x to f(x)
ExitFlag A 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 tol-
erance and the function changes sign in (xLow,xUpp), but
F(X) increased in magnitude as (xLow,xUpp) collapsed, i.e.
abs(F(xLow)) .GT. 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.
![]() |
Tfmin | Tlsqr | ![]() |