org.simBio.util.numerical.methods
Class SecantMethod

java.lang.Object
  extended by org.simBio.util.numerical.methods.SecantMethod

public final class SecantMethod
extends java.lang.Object

This class provides Secant method to solve a nonlinear equation. Secant method is a difference Newton method.

Version:
$Revision: 1.1 $
Author:
SHIMAYOSHI Takao

Field Summary
static double DEFAULT_EPSILON
          A tiny value as tolerance.
 
Method Summary
static double solve(MathFunction function, Node node)
          Solve the specified nonlinear equation.
static double solve(MathFunction function, Node node, double epsilon)
          Solve the specified nonlinear equation.
static double solve(MathUnivariableFunction function, Node node)
          Solve the specified nonlinear equation.
static double solve(MathUnivariableFunction function, Node node, double epsilon)
          Solve the specified nonlinear equation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EPSILON

public static final double DEFAULT_EPSILON
A tiny value as tolerance.

See Also:
Constant Field Values
Method Detail

solve

public static double solve(MathFunction function,
                           Node node)
Solve the specified nonlinear equation. In this implementation of Secant method, the second initial value is calculated by numerical differentiation, and damping is used on iterative computation.

Parameters:
function - The function to be solved. Its calculate method is repeatedly called.
node - The variable to be solved. Its value is setted to the solution.
Returns:
The function value on the aproximate solution.

solve

public static double solve(MathFunction function,
                           Node node,
                           double epsilon)
Solve the specified nonlinear equation. In this implementation of Secant method, the second initial value is calculated by numerical differentiation, and damping is used on iterative computation.

Parameters:
function - The function to be solved. Its calculate method is repeated called.
node - The variable to be solved. Its value is set to the solution.
epsilon - The accuracy. The iteration is repeated until the function value gets lower than this value.
Returns:
The function value on the aproximate solution.

solve

public static double solve(MathUnivariableFunction function,
                           Node node)
Solve the specified nonlinear equation. In this implementation of Secant method, the second initial value is calculated by numerical differentiation, and damping is used on iterative computation.

Parameters:
function - The function to be solved. Its calculate method is repeated called.
node - The variable to be solved. Its value is setted to the solution.
Returns:
The function value on the aproximate solution.

solve

public static double solve(MathUnivariableFunction function,
                           Node node,
                           double epsilon)
Solve the specified nonlinear equation. In this implementation of Secant method, the second initial value is calculated by numerical differentiation, and damping is used on iterative computation.

Parameters:
function - The function to be solved. Its calculate method is repeated called.
node - The variable to be solved. Its value is setted to the solution.
epsilon - The accuracy. The iteration is repeated until the function value gets lower than this value.
Returns:
The function value on the aproximate solution.


Copyright © 2002-2008 Cell/Biodinamics simulation project. All Rights Reserved.