MVT API

math.numerics
Class FindRoot

java.lang.Object
  |
  +--math.numerics.FindRoot

public class FindRoot
extends java.lang.Object

The class FindRoot is used to solve a system of equations for a root nearby a user-supplied initial guess. This uses simple newton's method. Future releases will couple newton's method with line searches and allow for n-dimensional systems.

Since:
JDK1.1
Author:
Eric Wright
, for the Mathematical Visualization project for the Department of Applied Mathematics, University of Colorado at Boulder

Constructor Summary
FindRoot(FunctionList f, VariableSet v, double[] ig)
           
FindRoot(FunctionList f, VariableSet v, double[] ig, int maxIts, double eps)
           
FindRoot(Function f, Variable var, double init)
           
 
Method Summary
 int getDimension()
          Get the value of dimension.
 double[] getInitGuesses()
          Get the value of initGuesses.
 double[][] newton()
          This method performins the Newton iteration.
 void setDimension(int v)
          Set the value of dimension.
 void setFunctions(FunctionList f)
           
 void setInitGuesses(double[] v)
          Set the value of initGuesses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindRoot

public FindRoot(FunctionList f,
                VariableSet v,
                double[] ig,
                int maxIts,
                double eps)

FindRoot

public FindRoot(FunctionList f,
                VariableSet v,
                double[] ig)

FindRoot

public FindRoot(Function f,
                Variable var,
                double init)
Method Detail

newton

public double[][] newton()
                  throws VariableUndefinedException,
                         UnacceptableVariableException,
                         SingularJacobianException,
                         ExcessiveIterationsException
This method performins the Newton iteration.

Returns:
double[][] array containing the coordinates of the root found by newton's method.
Throws:
VariableUndefinedException - for undefined variables
UnacceptableVariableException - for variables using illegal characers
SingularJacobianException - is thrown whenever jacobian determinant of system vanishes.
ExcessiveIterationException - is thrown whenever a specified number of iterations occur before newton converges to a root within the prescribed level of tolerance.
ExcessiveIterationsException

setFunctions

public void setFunctions(FunctionList f)

getDimension

public int getDimension()
Get the value of dimension.

Returns:
Value of dimension.

setDimension

public void setDimension(int v)
Set the value of dimension.

Parameters:
v - Value to assign to dimension.

getInitGuesses

public double[] getInitGuesses()
Get the value of initGuesses.

Returns:
Value of initGuesses.

setInitGuesses

public void setInitGuesses(double[] v)
Set the value of initGuesses.

Parameters:
v - Value to assign to initGuesses.

MVT API

mvt.icons