Class NumericalDerivative
java.lang.Object
com.github.gbenroscience.math.numericalmethods.NumericalDerivative
- Author:
- JIBOYE Oluwagbemiro Olaoluwa
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionNumericalDerivative(Function function, double xPoint) NumericalDerivative(String expression) -
Method Summary
Modifier and TypeMethodDescriptionstatic Object[]extractFunctionStringFromExpression(String expression) Analyzes the expression and extracts the Function string from it.doubledoublestatic voidvoidsetFunction(Function function) voidsetxPoint(double xPoint)
-
Constructor Details
-
NumericalDerivative
public NumericalDerivative() -
NumericalDerivative
- Parameters:
expression- An expression containing information about the function whose derivative is to be evaluated and the point at which the derivative is to be evaluated. For example: function,4....means find the derivative of the function at the point where x=4 on the curve. Direct examples would be: diff(@(x)sin(x+1),4) diff(F,5.32) and so on.
-
NumericalDerivative
-
-
Method Details
-
setFunction
-
getFunction
-
setxPoint
public void setxPoint(double xPoint) -
getxPoint
public double getxPoint() -
findDerivativeChebyshev
public double findDerivativeChebyshev()- Returns:
- the numerical value of the derivative very near the given point.
-
extractFunctionStringFromExpression
Analyzes the expression and extracts the Function string from it.- Parameters:
expression- The expression to be analyzed. Direct examples would be: diff(@sin(x+1),4) diff(F,5.32) where F is a function that has been defined before in the workspace.. and so on.- Returns:
- an Object array containing at index 0, the function string,which may or may not be anonymous, and in index 1, the horizontal coordinate of type double where the derivative is needed.
-
main
-
getVariable
- Returns:
- the independent variable in a 2D function e.g. f(x)=sin(x). If the function is more than 2D then it returns the first independent variable alone.
-