Related Topics: | ||
Description: Returns a root of a function f(x), within the interval specified by a given minimum value and a given maximum value.
Syntax: bisection(f(x), x_min, x_max, accuracy, iterations)
f(x) is an equation in terms of x.
x_min is the lower bound of the solution space.
x_max is the upper bound of the solution space.
accuracy is the numerical convergence criteria.
iterations is the maximum n number of iterations that should be used. If a convergence is not achieved within these iterations, an error results.
Remarks:
If the interval happens to contain two or more roots, bisection will find one of them. If the interval contains no roots and merely straddles a singularity, it will converge on the singularity.
All parameter values can include:
Numerical values
Standard operands (+, -, *, /)
Predefined mathematical functions (exp, log, sin, etc.)
References to any analysis workbooks
Example:
bisection(x^2-4, 0, 3, 0.01, 1000)
Returns:
1.998047
© 1992-2015. ReliaSoft Corporation. ALL RIGHTS RESERVED.