org.apache.commons.math3.analysis.solvers
Class BaseSecantSolver
- java.lang.Object
-
- org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver<UnivariateFunction>
-
- org.apache.commons.math3.analysis.solvers.AbstractUnivariateSolver
-
- org.apache.commons.math3.analysis.solvers.BaseSecantSolver
-
- All Implemented Interfaces:
- BaseUnivariateSolver<UnivariateFunction>, BracketedUnivariateSolver<UnivariateFunction>, UnivariateSolver
- Direct Known Subclasses:
- IllinoisSolver, PegasusSolver, RegulaFalsiSolver
public abstract class BaseSecantSolver extends AbstractUnivariateSolver implements BracketedUnivariateSolver<UnivariateFunction>
Base class for all bracketing Secant-based methods for root-finding (approximating a zero of a univariate real function).Implementation of the
Regula FalsiandIllinoismethods is based on the following article: M. Dowell and P. Jarratt, A modified regula falsi method for computing the root of an equation, BIT Numerical Mathematics, volume 11, number 2, pages 168-174, Springer, 1971.Implementation of the
Pegasusmethod is based on the following article: M. Dowell and P. Jarratt, The "Pegasus" method for computing the root of an equation, BIT Numerical Mathematics, volume 12, number 4, pages 503-508, Springer, 1972.The
Secantmethod is not a bracketing method, so it is not implemented here. It has a separate implementation.- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublesolve(int maxEval, UnivariateFunction f, double min, double max, AllowedSolution allowedSolution)Solve for a zero in the given interval.doublesolve(int maxEval, UnivariateFunction f, double min, double max, double startValue)Solve for a zero in the given interval, start atstartValue.doublesolve(int maxEval, UnivariateFunction f, double min, double max, double startValue, AllowedSolution allowedSolution)Solve for a zero in the given interval, start atstartValue.-
Methods inherited from class org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver
getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMax, getMaxEvaluations, getMin, getRelativeAccuracy, getStartValue, solve, solve
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.math3.analysis.solvers.BaseUnivariateSolver
getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMaxEvaluations, getRelativeAccuracy, solve, solve
-
-
-
-
Method Detail
-
solve
public double solve(int maxEval, UnivariateFunction f, double min, double max, AllowedSolution allowedSolution)Solve for a zero in the given interval. A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.- Specified by:
solvein interfaceBracketedUnivariateSolver<UnivariateFunction>- Parameters:
maxEval- Maximum number of evaluations.f- Function to solve.min- Lower bound for the interval.max- Upper bound for the interval.allowedSolution- The kind of solutions that the root-finding algorithm may accept as solutions.- Returns:
- A value where the function is zero.
-
solve
public double solve(int maxEval, UnivariateFunction f, double min, double max, double startValue, AllowedSolution allowedSolution)Solve for a zero in the given interval, start atstartValue. A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.- Specified by:
solvein interfaceBracketedUnivariateSolver<UnivariateFunction>- Parameters:
maxEval- Maximum number of evaluations.f- Function to solve.min- Lower bound for the interval.max- Upper bound for the interval.startValue- Start value to use.allowedSolution- The kind of solutions that the root-finding algorithm may accept as solutions.- Returns:
- A value where the function is zero.
-
solve
public double solve(int maxEval, UnivariateFunction f, double min, double max, double startValue)Solve for a zero in the given interval, start atstartValue. A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.- Specified by:
solvein interfaceBaseUnivariateSolver<UnivariateFunction>- Overrides:
solvein classBaseAbstractUnivariateSolver<UnivariateFunction>- Parameters:
maxEval- Maximum number of evaluations.f- Function to solve.min- Lower bound for the interval.max- Upper bound for the interval.startValue- Start value to use.- Returns:
- a value where the function is zero.
-
-
DMelt 3.0 © DataMelt by jWork.ORG