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 Object
A class used to specify an arbitrary mathematical function.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RMFunc

      public RMFunc()
  • Method Details

    • 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)