Arbogast.cin

From TORI
Jump to navigation Jump to search

Arbogast.cin is the C++ implementation of the "Faà di Bruno's formula" [1] for evaluation of coefficients in the primary approximation of the Koenigs function and of the Abel function and at the Regular iteration.

The input parameters:

array "t" of derivatives of the transfer function at its fixed point,

array "a" of coefficients of the primary expansion of the Koenigs function that are already calculated,

positive integer "n" that is number of the text coefficient to be evaluated.

In such a way, the routine appears as double Arbogast(double *t, double *a, int n)

The routine returns the asymptotic expression for the numerator of the fraction for the next coefficient \(a_n\).

If \(\ {t_1}^n \!\ne\! t_1 \ \), then the \(a_n\) can be evaluated as follows:   a[n]= - Arbogast(t, a, n) / ( pow(t[1],n)-t[1] );

C++ code

//
#include <cmath>
#include <cstring>  // for memset

// double Arbogast(double lambda, double *t, double *a, int n)
double Arbogast(double *t, double *a, int n)
{
    // assumes:
    // a[1]=1 already set
    // a[2..n-1] already computed
    // t[2..n] given

    if(n < 2) return 1.0;

    // allocate temporary arrays (size n+1)
    double delta[n+1];
    double power[n+1];
    double next[n+1];

//update:
double lambda=t[1];

    // build delta
    delta[0] = 0.0;
//    delta[1] = lambda;
    for(int k=1; k<=n; k++)
        delta[k] = t[k];

    // initialize power = delta (for m=1)
    for(int k=0; k<=n; k++)
        power[k] = delta[k];

    double RHS = t[n];   // first term

    // compute for m = 2 .. n-1
    for(int m=2; m<n; m++)
    {
        // compute next = power * delta  (truncated at n)
        for(int k=0; k<=n; k++)
            next[k] = 0.0;

        for(int i=1; i<=n; i++)
            for(int j=1; j<=n; j++)
            {
                if(i+j > n) break;
                next[i+j] += power[i] * delta[j];
            }

        // copy next into power
        for(int k=0; k<=n; k++)
            power[k] = next[k];

        // C_{n,m} is coefficient of order n
        double Cnm = power[n];

        RHS += a[m] * Cnm;
    }

return RHS;
//    double denom = lambda - std::pow(lambda, n);
//    return -RHS / denom;
}

//

Description in terms of the superfunction

Let \(T\) be some growing real-holomorphic function with real fixed point \(Q\); \(\ T(Q)\!=\!Q \ \).

Let the asymptotic expansion of \(T\) at the fixed point be \[ T(z)=Q+\sum_{n=1}^N t_n (z\!-\!Q)^n + o \big((z\!-\!Q)^N\big) \] Preferably, \(T\) be holomorphic at \(Q\); then, the sum above can be treated as a Taylor expansion. (However, Editor keeps in mind the exotic cases too, including complex (\Q\) and even \(Q\) that happen to be at the edge of the range of holomophism, thinking about replacement of "double" to "complex double" in the specidications of the preamble.)

Function \(T\) is referred here as "Transfer function" because it transfers value of its superfunction \(F\) at some input \(z\) to its value at the displaced input: \[ T(F(z))=F(z\!+\!1) \] In TORI, the equation above is qualified as Transfer equation, although in other contest, term «Transfer equation» may have also the different meaning.

The Primary approximation for the superfunction \(F\) can be written as follows: \[ f(z)=Q+\sum_{n=1}^N c_n \varepsilon^n \] with \(\varepsilon=\exp(kz)\) for some appropriate increment \(k\) and coefficients \(c\).

It is convenient to set \(\ c_0 \!=\! Q \ \). It is assumed also that \(\ c_1 \!=\! 1 \ \).

Function \(f\) is treated as asymptotic of \(F\) at small values of \(\varepsilon\).

Substitution of \(f\) instead of \(F\) into the transfer equation and the asymptotic analysis at small \(\varepsilon\) gives \(\ k \!=\! \ln(t_1) \ \) and set of equations for coefficients \(a\) of the inverse function \(G=F^{-1}\), \[ G(z)=\frac{1}{k}\log\left(\sum_{n=1}^N a_n (z-Q)^n + o((z\!-\!Q)^N) \right) \] The routine Arbogast is tool for the the numerical evaluation of the coefficients \(a\); then, coefficients \(c\) appear as PowerSeriesInversion of coefficients \(a\) given with the routine.

Each \(a_n\) is evaluated assuming that \(a_m\) for \(\ m \!<\! n \ \) are already evaluated and stored in array "a"; - however, if the division of the returned value by the denominator \(\ {t_1}^n \!-\! t_1 \ \) is allowed.

Description in terms of the Koenigs function

Deduction

Example 1

Example 2

#include <cmath>
#include <cstring>  // for memset
#include <stdio.h>
#include "Arbogast.cin"
double B=sqrt(2.); // 1.4142135623730951 
double Q=4.;
double S=log(B);
int main() { int n;
int N=20; int N1=N+1;
double t[N1], a[N1];
t[0]=4.;
for(n=1;n<N1;n++) t[n]=t[n-1]*S/n;

a[0]=0.;
a[1]=1.;;
for(n=2;n<N1;n++) a[n] = - Arbogast(t, a, n)/( pow(t[1],n)-t[1] );

for(n=0;n<N1;n++) printf("%02d %20.16lf\n",n,a[n]);
}

does:

00   0.0000000000000000
01   1.0000000000000000
02  -0.4485874311952611
03   0.2120891200549195
04  -0.1021843675069716
05   0.0496986830373718
06  -0.0243075903261195
07   0.0119330883965108
08  -0.0058736976420089
09   0.0028968672871058
10  -0.0014309081060793
11   0.0007076637148566
12  -0.0003503296158730
13   0.0001735756004664
14  -0.0000860610119292
15   0.0000426959089013
16  -0.0000211930290684
17   0.0000105244225997
18  -0.0000052285174362
19   0.0000025984499950
20  -0.0000012917821009

This output agrees with the last column of table 9.1 at page 107 of book «Superfunctions»[2]; the only last numbers deviates for few last digits; in the book, the last three coefficients are

18  −0.0000052285174354
19   0.0000025984499916 
20  −0.0000012917821121

These deviations can be attributed to the rounding errors.

The first 6 values \( a_1, .. a_6 \) also agree with coefficients evaluated in the description of figure SuExp6termsTestQ2mapT.png
(There, as in the Book, these coefficients are denoted with letter \(U\))

The Table above is used at the "Example 2" in article «PowerSeriesInversion».

Attribution and notes

The routine Arbogast.cin is designed by ChatGPT.

The routine Arbogast.cin is still under testing.

This article is under construction; some sections are not yet written.

References

  1. https://en.wikipedia.org/wiki/Fa%C3%A0_di_Bruno%27s_formula Faà di Bruno's formula is an identity in mathematics generalizing the chain rule to higher derivatives. It is named after Francesco Faà di Bruno (1855, 1857), although he was not the first to state or prove the formula. In 1800, more than 50 years before Faà di Bruno, the French mathematician Louis François Antoine Arbogast had stated the formula in a calculus textbook,[1] which is considered to be the first published reference on the subject.[2] ..
  2. https://mizugadro.mydns.jp/BOOK/468.pdf D.Kouznetsov. Superfunctions. Lambert Academic Publishing, 2020.