Package jahuwaldt.tools.math
Interface Evaluatable1D
-
- All Known Implementing Classes:
AbstractEvaluatable1D
public interface Evaluatable1D
An interface that defines a 1D function y = fn(x) (named "function") that can be called by math tools such as root finders. Also defines the derivative of the function. dy/dx = d fn(x)/dx (oddly enough, named "derivative").Modified by: Joseph A. Huwaldt
- Version:
- February 23, 2025
- Author:
- Joseph A. Huwaldt Date: October 7, 1998
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
derivative(double x)
Calculates the derivative of the functiondy/dx = d fn(x)/dx
.double
function(double x)
User supplied method that calculates the function y = fn(x).
-
-
-
Method Detail
-
function
double function(double x) throws RootException
User supplied method that calculates the function y = fn(x). Classes implementing this interface must define this function.- Parameters:
x
- Independent parameter to the function.- Returns:
- The function value at x.
- Throws:
RootException
- if there is a problem computing the function.
-
derivative
double derivative(double x) throws RootException
Calculates the derivative of the functiondy/dx = d fn(x)/dx
. Classes wanting to return the derivative of the function at x should override this function. If the method using this class doesn't require the derivative, do nothing and Double.NaN is returned.- Parameters:
x
- Independent parameter to the function.- Returns:
- The function value at x or Double.NaN if the derivative is not defined.
- Throws:
RootException
- if there is a problem computing the derivative.
-
-