mmc
Class FindRoot

java.lang.Object
  extended by mmc.MathModel
      extended by mmc.FindRoot

public class FindRoot
extends MathModel

This class provides routines for calculating roots by the combination of the Newton-Raphson method and bisection. Include the function to be integrated in a class that implements the interface FunctionOfx (defined below). Methods contained here are based on the Numerical Recipes (W. H. Press et al.).

 interface DFunctionOfx extends FunctionOfx{
     double dFunction(double x);
 }
 
For the definition of interface FunctionOfx see the manual page for class Integral.


Field Summary
 
Fields inherited from class mmc.MathModel
computerPrecision
 
Constructor Summary
FindRoot()
          initializes class - this constructor uses default settings
FindRoot(int maxSteps, double precision)
          initializes class - this is the main constructor
 
Method Summary
 double findRoot(double min, double max, double startX, DFunctionOfx function2use, double rightSide)
          returns the value of the root bracketed between min and max.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindRoot

public FindRoot()
initializes class - this constructor uses default settings


FindRoot

public FindRoot(int maxSteps,
                double precision)
initializes class - this is the main constructor

Method Detail

findRoot

public double findRoot(double min,
                       double max,
                       double startX,
                       DFunctionOfx function2use,
                       double rightSide)
returns the value of the root bracketed between min and max. Starting value of x is determined by 0<=startX<=1