Class InverseRealPolynomial

java.lang.Object
xal.tools.math.fnc.poly.RealUnivariatePolynomial
xal.extension.jels.tools.math.InverseRealPolynomial
All Implemented Interfaces:
IRealFunction, ISmoothRealFunction
Direct Known Subclasses:
MeanFieldPolynomial

public class InverseRealPolynomial extends RealUnivariatePolynomial

Represents a model function of the form: ( x1 + x2(x0/x-1) + x3/2(x0/x-1)^2 + ... + xn/(n-1)!(x0/x-1)^(n-1) ) / x1 where x0,x1,...,xn are parameters.

This is an encapsulation of a TTF function as is used in TraceWin. The class is extended from UnivariateRealPolynomial just so it can be easily switched with it.

Author:
Ivo List, Juan F. Esteban Müller <juanf.estebanmuller@esss.se>
  • Constructor Details

    • InverseRealPolynomial

      public InverseRealPolynomial()
      Creates an empty polynomial object, the zero polynomial.
    • InverseRealPolynomial

      public InverseRealPolynomial(double[] arrCoef)
      Creates and initializes a polynomial to the specified coefficients.
      Parameters:
      arrCoef -
  • Method Details

    • setCoefArray

      public void setCoefArray(double[] arrCoef)
      Set the entire coefficient array. The coefficient array is arranged in order of ascending indeterminate order.
      Overrides:
      setCoefArray in class RealUnivariatePolynomial
      Parameters:
      arrCoef - double array of coefficients.
    • getDegree

      public int getDegree()
      Description copied from class: RealUnivariatePolynomial
      Return the degree of the polynomial. That is, the highest indeterminant order for all the nonzero coefficients.
      Overrides:
      getDegree in class RealUnivariatePolynomial
      Returns:
      the degree of the polynomial. That is, the highest indeterminant order for all the nonzero coefficients.
    • getCoef

      public double getCoef(int iOrder)
      Get the specified coefficient value. If the value of iOrder is larger than the size of the coefficient array then the coefficient is assumed to have value zero.
      Overrides:
      getCoef in class RealUnivariatePolynomial
      Parameters:
      iOrder - index of coefficient
      Returns:
      coefficient
    • getCoefs

      public double[] getCoefs()
      Return the entire array of coefficients.
      Overrides:
      getCoefs in class RealUnivariatePolynomial
      Returns:
      the entire coefficient array
    • evaluateAt

      public double evaluateAt(double dblVal)
      Evaluate the model function for the specified value: (x1 + x2(x0/x-1) + x3/2(x0/x-1)^2 + ... + xn/(n-1)!(x0/x-1)^(n-1)) / x1 where x0,x1,...,xn are coefficients.
      Specified by:
      evaluateAt in interface IRealFunction
      Overrides:
      evaluateAt in class RealUnivariatePolynomial
      Parameters:
      dblVal - indeterminate value to evaluate the model function at
      Returns:
    • derivativeAt

      public double derivativeAt(double dblVal)
      Evaluate derivative of the model function for the specified value of the indeterminate. If the coefficient vector has not been specified, it return 0. (-x2(x0 x^-2) - x3(x0/x-1)(x0 x^-2) - ... - xn/(n-2)!(x0/x-1)^(n-2)(x0 x^-2)) / x1 where x0,x1,...,xn are coefficients.
      Specified by:
      derivativeAt in interface ISmoothRealFunction
      Overrides:
      derivativeAt in class RealUnivariatePolynomial
      Parameters:
      dblVal - indeterminate value to evaluate the model function derivative
      Returns:
      the derivative f'(x) of the function f
    • plus

      public InverseRealPolynomial plus(InverseRealPolynomial polyAddend)
    • times

    • toString

      public String toString()
      Construct and return a textual representation of the contents of this model function as a String object.
      Overrides:
      toString in class RealUnivariatePolynomial
      Returns:
      a String representation of the model function contents
      See Also: