|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.numerics.Derivative
public class Derivative
Derivative defines various derivative algorithms. This class cannot be subclassed or instantiated because all methods are static.
| Method Summary | |
|---|---|
static double |
backward(Function f,
double x,
double h)
Calculates the first derivative of a function using the finite difference approximation toward decreasing x. |
static double |
centered(Function f,
double x,
double h)
Calculates the first derivative of a function using the centered finite difference approximation. |
static double |
first(Function f,
double x,
double h)
Calculates the first derivative of a function at the given point. |
static double |
firstPartial(MultiVarFunction f,
double[] x,
int n,
double h)
Gets the partial derivate of a multivariable function using the centered finite difference approximation. |
static double |
forward(Function f,
double x,
double h)
Calculates the first derivative of a function using the finite difference approximation toward increasing x. |
static Function |
getFirst(Function f,
double h)
Gets a derivative function using the centered difference approximation. |
static Function |
getSecond(Function f,
double h)
Gets a second derivative function using a second order finite difference approximation. |
static double |
romberg(Function f,
double x0,
double h,
double tol)
Calculates the derivative using the Romberg scheme for Richardson extrapolation. |
static double |
second(Function f,
double x,
double h)
Computes the second derivate using the centered finite difference approximation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Function getFirst(Function f,
double h)
f - Function f(x)h - double change in x
public static Function getSecond(Function f,
double h)
f - Function f(x)h - double change in x
public static double romberg(Function f,
double x0,
double h,
double tol)
f - the functionx0 - where derivative is to be calculatedh - initial step sizetol - desired accuracy
public static double first(Function f,
double x,
double h)
f - the functionx - the x valueh -
public static double centered(Function f,
double x,
double h)
f - the functionx - the x valueh -
public static double backward(Function f,
double x,
double h)
f - the functionx - the x valueh -
public static double forward(Function f,
double x,
double h)
f - the functionx - the x valueh -
public static double firstPartial(MultiVarFunction f,
double[] x,
int n,
double h)
f - MultiVarFunctionx - double[] variablesn - int indexh - double change in the varible with index i
public static double second(Function f,
double x,
double h)
f - Functionx - doubleh - double
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||