Class RMMath.RMFunc

    • 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.
      • Methods inherited from class java.lang.Object

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

      • RMFunc

        public RMFunc()
    • 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)