Package com.inductiveautomation.rm.base
Class RMMath.RMFunc
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMMath.RMFunc
-
- Direct Known Subclasses:
RMCurveFit.InverseFunc
,RMCurveFit.NevilleFunc
,RMCurveFit.ScaledFunc
- Enclosing class:
- RMMath
public abstract static class RMMath.RMFunc extends java.lang.Object
A class used to specify an arbitrary mathematical function.
-
-
Constructor Summary
Constructors Constructor Description RMFunc()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract double
f(double x)
double
fprime(double x, int order)
nth derivative of function at x.double
integrate(double start, double end, int npts)
Numerical integration of a function in the interval [start, end].double
solve(double a)
Uses Newton's method to find numerical solution to f(x)=a.
-
-
-
Method Detail
-
f
public abstract double f(double x)
-
fprime
public double fprime(double x, int order)
nth derivative of function at x. Base class calculates it numerically, but you could override this if you know the exact form. order=1 for first derivative, 2 for second derivative, etc.
-
integrate
public double integrate(double start, double end, int npts)
Numerical integration of a function in the interval [start, end]. Uses composite Simpson's method. (override if you know the exact form)
-
solve
public double solve(double a)
Uses Newton's method to find numerical solution to f(x)=a. (override if you know the exact solution)
-
-