Class MappedExpander

java.lang.Object
com.github.gbenroscience.math.numericalmethods.MappedExpander

public class MappedExpander extends Object
How to use these in your Platform When you want the derivative of a badly behaved function at a point : Map x to u using toChebyshev(x). Compute the derivative of the Chebyshev series at (standard algorithm). Multiply that result by map.derivativeFactor(u). When you want the integral: Sample f(x) at mapped nodes. Multiply by map.dx_du(u). Sum using Clenshaw-Curtis weights. Pro-Tip for Precision In the SemiInfiniteMap, as * , * . In your code, you should clamp to something like 0.9999999999 if you hit a NaN in the physical domain to prevent the platform from crashing on a hard infinity. Would you like the Clenshaw-Curtis weight generator to ensure your integration reaches full 16-digit precision?
Author:
GBEMIRO
  • Field Details

  • Constructor Details

    • MappedExpander

      public MappedExpander(Function function, MappedExpander.DomainMap map, int N)
      Uses Chebyshev Extrema nodes: u_k = cos(k * PI / N) for k = 0...N. This matches Clenshaw-Curtis weights perfectly.
  • Method Details

    • getTailError

      public double getTailError()
    • evaluate

      public double evaluate(double x)
    • integrate

      public double integrate()
    • integrateSeamless

      public double integrateSeamless()
    • integrateFinal

      public double integrateFinal(double[] ccWeights)
      O(N) Integration: Direct sum using pre-sampled values and CC weights.
    • integrateAdaptive

      public double integrateAdaptive(Function f, MappedExpander.DomainMap map, double tol, int depth)
    • isAliasing

      public boolean isAliasing()
    • autoSelectMap

      public MappedExpander.DomainMap autoSelectMap(Function f, double a, double b)
      Detection heuristic
      Parameters:
      f -
      a -
      b -
      Returns:
    • main

      public static void main(String[] args)