Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
cspice_chbigr

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_CHBIGR evaluates an indefinite integral of a Chebyshev expansion
   at a specified point `x' and returns the value of the input expansion at
   `x' as well. The constant of integration is selected to make the integral
   zero when `x' equals the abscissa value x2s[0].

I/O


   Given:

      degp     the degree of the input Chebyshev expansion.

               help, degp
                  LONG = Scalar

      cp       an array containing the coefficients of the input Chebyshev
               expansion.

               help, cp
                  DOUBLE = Array[degp+1]

               The coefficient of the I'th Chebyshev polynomial is contained
               in element cp[i], for i = 0 : degp.

      x2s      an array containing the "transformation parameters" of the
               domain of the expansion.

               help, x2s
                  DOUBLE = Array[2]

               Element x2s[0] contains the midpoint of the interval on which
               the input expansion is defined; x2s[1] is one-half of the
               length of this interval; this value is called the interval's
               "radius."

               The input expansion defines a function f(x) on the
               interval

                  [ x2s[0]-x2s[1],  x2s[0]+x2s[1] ]

               as follows:

                  Define s = ( x - x2s[0] ) / x2s[1]


                                    degp
                                    __
                                    \
                     f(x) = g(s)  = /  cp[k]  T (s)
                                    --         k
                                    k=0


      x        the abscissa value at which the function defined by the input
               expansion and its integral are to be evaluated.

               help, x
                  DOUBLE = Scalar

               Normally `x' should lie in the closed interval

                  [ x2s[0]-x2s[1],  x2s[0]+x2s[1] ]

               See the -Restrictions section below.

   the call:

      cspice_chbigr, degp, cp, x2s, x, p, itgrlp

   returns:

      p,
      itgrlp   Define `s' and f(x) as above in the description of the input
               argument `x2s'.

               help, p
                  DOUBLE = Scalar
               help, itgrlp
                  DOUBLE = Scalar

               Then `p' is f(x), and `itgrlp' is an indefinite integral of
               f(x), evaluated at `x'.

               The indefinite integral satisfies

                  d(itgrlp)/dx     = f(x)

               and

                  itgrlp( x2s[0] ) = 0

Parameters


   None.

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   1) Let the domain of a polynomial to be evaluated be the
      closed interval

         [20, 30]

      Let the input expansion represent the polynomial

                           6
         f(x)  = g(s) = 5*s

      where

         s     = (x - 20)/10

      Let F(x) be an indefinite integral of f(x) such that

         F(20) = 0

      Evaluate

         f(30) and F(30)


      Example code begins here.


      PRO chbigr_ex1

         ;;
         ;; Let our domain be the interval [10, 30].
         ;;
         x2s  = [ 20.D0, 10.D0 ]

         ;;
         ;; Assign the expansion coefficients.
         ;;
         degp = 5L

         cp   = [ 0.D0, 3.75D0, 0.D0, 1.875D0, 0.D0, 0.375D0 ]

         ;;
         ;; Evaluate the function and its integral at x = 30.
         ;;
         x    = 30.D0

         cspice_chbigr, degp, cp, x2s, x, p, itgrlp

         ;;
         ;; We make the change of variables
         ;;
         ;;    S(x) = (1/10) * ( x - 20 )
         ;;
         ;; The expansion represents the polynomial
         ;;
         ;;                     5
         ;;    f(x) = g(s) = 6*s
         ;;
         ;; An indefinite integral of the expansion is
         ;;
         ;;                                6
         ;;    F(x) = G(s) * dX/ds = 10 * s
         ;;
         ;; where `G' is defined on the interval [-1, 1]. The result
         ;; should be (due to the change of variables)
         ;;
         ;;      (G(1)  - G(0) ) * dx/ds
         ;;
         ;;    = (F(30) - F(20)) * 10
         ;;
         ;;    = 10
         ;;
         ;; The value of the expansion at `x' should be
         ;;
         ;;    f(30) = g(1) = 6
         ;;
         print, 'ITGRLP = ', itgrlp
         print, 'P      = ', p

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      ITGRLP =        10.000000
      P      =        6.0000000


Particulars


   Let

      T ,  n = 0, ...
       n

   represent the nth Chebyshev polynomial of the first kind:

      T (x) = cos( n*arccos(x) )
       n

   The input coefficients represent the Chebyshev expansion

                     degp
                     __
                     \
      f(x) = g(s)  = /  cp[k]  T (s)
                     --         k
                     k=0

   where

      s = ( x - x2s[0] ) / x2s[1]

   This routine evaluates and returns the value at `x' of an
   indefinite integral F(x), where

      dF(x)/dx    = f(x)  for all `x' in
                          [x2s[0]-x2s[0], x2s[0]+x2s[1]]

      F( x2s[0] ) = 0

   The value at `x' of the input expansion

      f(x)

   is returned as well.

   Note that numerical problems may result from applying this
   routine to abscissa values outside of the interval defined
   by the input parameters x2s[*]. See the -Restrictions section.

   To evaluate Chebyshev expansions and their derivatives, use the
   Icy routines cspice_chbint or cspice_chbder.

   This routine supports the SPICELIB SPK type 20 and PCK type 20
   evaluators SPKE20 and PCKE20.

Exceptions


   1)  If the input degree is negative, the error SPICE(INVALDDEGREE)
       is signaled by a routine in the call tree of this routine.

   2)  If the input interval radius is non-positive, the error
       SPICE(INVALIDRADIUS) is signaled by a routine in the call tree
       of this routine.

   3)  If any of the input arguments, `degp', `cp', `x2s' or `x', is
       undefined, an error is signaled by the IDL error handling
       system.

   4)  If any of the input arguments, `degp', `cp', `x2s' or `x', is
       not of the expected type, or it does not have the expected
       dimensions and size, an error is signaled by the Icy
       interface.

   5)  If any of the output arguments, `p' or `itgrlp', is not a
       named variable, an error is signaled by the Icy interface.

   6)  If the number of elements in `cp' is less than degp+1, an error
       is signaled by the Icy interface.

Files


   None.

Restrictions


   1)  The value (x-x2s[0]) / x2s[1] normally should lie within the
       interval -1:1 inclusive, that is, the closed interval
       [-1, 1]. Chebyshev polynomials increase rapidly in magnitude
       as a function of distance of abscissa values from this
       interval.

       In typical SPICE applications, where the input expansion
       represents position, velocity, or orientation, abscissa
       values that map to points outside of [-1, 1] due to round-off
       error will not cause numeric exceptions.

   2)  No checks for floating point overflow are performed.

   3)  Significant accumulated round-off error can occur for input
       expansions of excessively high degree. This routine imposes
       no limits on the degree of the input expansion; users must
       verify that the requested computation provides appropriate
       accuracy.

Required_Reading


   ICY.REQ

Literature_References


   [1]  W. Press, B. Flannery, S. Teukolsky and W. Vetterling,
        "Numerical Recipes -- The Art of Scientific Computing,"
        chapter 5.4, "Recurrence Relations and Clenshaw's Recurrence
        Formula," p 161, Cambridge University Press, 1986.

   [2]  "Chebyshev polynomials," Wikipedia, The Free Encyclopedia.
        Retrieved 01:23, November 23, 2013, from
        http://en.wikipedia.org/w/index.php?title=
        Chebyshev_polynomials&oldid=574881046

Author_and_Institution


   J. Diaz del Rio     (ODC Space)

Version


   -Icy Version 1.0.0, 19-JUL-2021 (JDR)

Index_Entries


   integral of chebyshev_polynomial_expansion
   integrate chebyshev_polynomial_expansion



Fri Dec 31 18:43:02 2021