org.apache.commons.math3.analysis.solvers
Class PegasusSolver

java.lang.Object
  extended by org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver<UnivariateFunction>
      extended by org.apache.commons.math3.analysis.solvers.AbstractUnivariateSolver
          extended by org.apache.commons.math3.analysis.solvers.BaseSecantSolver
              extended by org.apache.commons.math3.analysis.solvers.PegasusSolver
All Implemented Interfaces:
BaseUnivariateSolver<UnivariateFunction>, BracketedUnivariateSolver<UnivariateFunction>, UnivariateSolver

public class PegasusSolver
extends BaseSecantSolver

Implements the Pegasus method for root-finding (approximating a zero of a univariate real function). It is a modified Regula Falsi method.

Like the Regula Falsi method, convergence is guaranteed by maintaining a bracketed solution. The Pegasus method however, should converge much faster than the original Regula Falsi method. Furthermore, this implementation of the Pegasus method should not suffer from the same implementation issues as the Regula Falsi method, which may fail to convergence in certain cases. Also, the Pegasus method should converge faster than the Illinois method, another Regula Falsi-based method.

The Pegasus method assumes that the function is continuous, but not necessarily smooth.

Implementation 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.

Since:
3.0
Version:
$Id: PegasusSolver.java 1364387 2012-07-22 18:14:11Z tn $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.math3.analysis.solvers.BaseSecantSolver
BaseSecantSolver.Method
 
Field Summary
 
Fields inherited from class org.apache.commons.math3.analysis.solvers.BaseSecantSolver
DEFAULT_ABSOLUTE_ACCURACY
 
Constructor Summary
PegasusSolver()
          Construct a solver with default accuracy (1e-6).
PegasusSolver(double absoluteAccuracy)
          Construct a solver.
PegasusSolver(double relativeAccuracy, double absoluteAccuracy)
          Construct a solver.
PegasusSolver(double relativeAccuracy, double absoluteAccuracy, double functionValueAccuracy)
          Construct a solver.
 
Method Summary
 
Methods inherited from class org.apache.commons.math3.analysis.solvers.BaseSecantSolver
doSolve, solve, solve, solve
 
Methods inherited from class org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver
computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMax, getMaxEvaluations, getMin, getRelativeAccuracy, getStartValue, incrementEvaluationCount, isBracketing, isSequence, setup, solve, solve, verifyBracketing, verifyInterval, verifySequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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
 

Constructor Detail

PegasusSolver

public PegasusSolver()
Construct a solver with default accuracy (1e-6).


PegasusSolver

public PegasusSolver(double absoluteAccuracy)
Construct a solver.

Parameters:
absoluteAccuracy - Absolute accuracy.

PegasusSolver

public PegasusSolver(double relativeAccuracy,
                     double absoluteAccuracy)
Construct a solver.

Parameters:
relativeAccuracy - Relative accuracy.
absoluteAccuracy - Absolute accuracy.

PegasusSolver

public PegasusSolver(double relativeAccuracy,
                     double absoluteAccuracy,
                     double functionValueAccuracy)
Construct a solver.

Parameters:
relativeAccuracy - Relative accuracy.
absoluteAccuracy - Absolute accuracy.
functionValueAccuracy - Maximum function value error.


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.