return a procedure to compute the nth coefficient of a power series expansion of the given function (one of the four Appell functions) around the origin
GenerateRecurrence(F, simplifier = ..., parameters = ...)
any of the 4 Appell functions.
simplifier = ...
(optional) simplifier to be applied to the recurrence formula before constructing the procedure to be returned; default value is none
parameters = ...
(optional) list with parameters of type name, to be used as parameters of the procedure to be returned, in addition to the recurrence index i; default value is 
The GenerateRecurrence command accepts one of the Appell functions and returns a procedure to compute the nth coefficient of a power series expansion of the given function F around the origin as a function of the n−1 previous coefficients. The recurrence is derived from the linear ODE underlying the function by assuming the existence of a power series solution for it. This means that only the first coefficients (initial conditions of the ODE) involve mathematical functions - all the other ones only involve arithmetic operations involving the value of those first coefficients, thus resulting in an efficient way of numerically computing the value of the function.
Within the context of that linear ODE, the value of the last argument of F is always ignored, taken to be a symbol, say z, and the linear ODE is constructed with z as independent variable. To evaluate the function, the recurrence-procedure returned - say u- is used to generate the coefficient of a power series in z, as in ∑n=0∞⁡u⁡n⁢zn.
Depending on the value of the function's parameters (for example if they imply on a singular function, or the hypergeometric functions entering the initial conditions of the recurrence are divergent) it is not possible to construct a recurrence. In these cases GenerateRecurrence returns FAIL.
This approach, which within the Evalf package is referred as the series/recurrence approach, is one of the main methods for numerically evaluating mathematical functions and expressions where one or both of the following situations happen:
The underlying differential equation has singularities, as it is the case of most special functions of the mathematical language.
There is no closed form series expansion formula known (e.g. the Heun functions).
The recurrence returned by GenerateRecurrence can effectively compute the value of the given function provided that the following conditions are met:
The evaluation point z where the function is to be numerically evaluated (the last argument of F) is not a singularity of the linear ODE underlying the given function F. To see the location of these singularities, use the Evalf:-Singularities command.
The evaluation point z is within the radius of convergence of an expansion around the origin, i.e.: the distance from the origin to z is smaller than the distance from the origin to the singularity closer to it.
The recurrence depends on N initial conditions, N≤d where d is the order of the differential equation behind the function, that should be numerically computable by other means. These initial conditions are mainly the value of F and its first or also higher derivatives at the origin.
Generally speaking, when the recurrence can be used to evaluate a function at some (any) point z0, by using a sequence of concatenated Taylor series expansions (that in turn requires knowing the recurrence formula for an expansion around an arbitrary z0, that can also be derived from the underlying differential equation), the function can be computed over the whole complex plane.
When there are symbolic parameters (i.e.: not numbers) in the recurrence formula returned, it is frequently desired to simplify the result. For that purpose, use the option simplifier = ... where the right-hand side is the simplifier you want to be used. This simplification will be applied to the formula before constructing the procedure to be returned. Note however that this simplification is not applied to each coefficient each time the returned procedure is applied.
By default, the returned procedure is a function of the recursion index. If the given function F contains symbolic (i.e not a number) parameters, you may prefer to have the returned procedure being a function of these symbolic parameters as well. For that purpose, use the option parameters = [...], where the right-hand side is a list with the parameters to appear after the recursion index in the parameters of the returned procedure.
Initialization: Load the package and set the display of special functions in output to typeset mathematical notation (textbook notation):
Consider the AppellF2 function for some values of its parameters, for instance
Check the singularities of this function, that is the values of z2 for which the underlying ODE has singularities
We see that the singularity closer to the origin is located at z2=1. So, we can generate a recurrence to evaluate this function in the interval 0≤z2 <1. Assign the result to u
u≔procioptionhfloat,cache;if⁡i::nonnegint,4/5*i^2 − 4*thisproc⁡i − 1/i+4*i+1/5*i^3 − i^2 − 10*i − 8*thisproc⁡i − 2/i*i+4*i+3,'procname⁡args'end proc
Note also that, then the only parameter of the procedure returned is the recurrence index, this procedure always has a cache with the first coefficients - the higher coefficients depend on them - and there are four cached coefficients, because AppellF2 satisfies a fourth order linear ODE:
Since the higher coefficients only depend on the lower coefficients, the above means that all the coefficients of a series expansion around the origin can be expressed in terms of only these four hypergeometric functions.
When n is a non-positive integer (nonposint), the procedure works recursively down until the lowest cached coefficients, caching each intermediate result. For example, the sixth coefficient is
Check the cache of u
When the recurrence index is not a non-positive integer, the procedure u returns unevaluated, just echoing the input
To have these coefficients numerically evaluated, for instance the lower order coefficients with hypergeometric functions with which the higher ones are constructed, apply evalf
Alternatively, if you pass the function F with floating-point arguments, evalf will automatically be applied each time you call the returned procedure. In these cases, to avoid a premature automatic evaluation of the function F itself in the presence of floating-point arguments, either use delay-evaluation quotes (see unevaluated) or use the InertForm of the function, %AppellF2. This is displayed as AppellF2 but in gray.
u≔procioptionhfloat,cache;if⁡i::nonnegint,0.8*i^2 − 3.2*thisproc⁡i − 1/i+4.*i+0.2*i^3 − 0.2*i^2 − 2.*i − 1.6*thisproc⁡i − 2/i*i^2+7.*i+12.,'procname⁡args'end proc
Check the cache of the - now all-numeric - coefficients
A routine for the numerical evaluation of the AppellF2 function
Provided that the evaluation point is within the radius of convergence of the series expansion, this approach can be used to produce a procedure to evaluate the AppellF2 function for arbitrary values of its parameters. For example, start with the general form of AppellF2
Generate now a recurrence-procedure to evaluate the coefficients (of a power series expansion around the origin) for generic values of the function's parameters, and make this procedure also be a function of the parameters of F2. Assign the result to U
U≔proci,a,b1,b2,c1,c2,z1,z2optioncache;if⁡i::nonnegint,if⁡i<4,T[i]⁡i,a,b1,b2,c1,c2,z1,z2,i+b2 − 1*a+i − b1 − 1*z1 − 2*a − 2*i+c1+2*thisproc⁡i − 1,a,b1,b2,c1,c2,z1,z2/z1 − 1*i+c2 − 1*i+i+b2 − 1*i+b2 − 2*a+i − 2*a+i − c1 − 1*thisproc⁡i − 2,a,b1,b2,c1,c2,z1,z2/i*i − 1*i+c2 − 1*i+c2 − 2*z1 − 1,'procname⁡args'end proc
Check it out for some values of the parameters a,b1,b2,c1,c2,z1,z2 - recall that the first argument indicates the coefficient to be computed
This general procedure U is used now to construct another procedure, following the steps indicated in Evalf:-Add, to numerically evaluate AppellF2 when the evaluation point z2 is within the radius of convergence of the expansion. This is the sum form for AppellF2 using U computed above
Get the summand
Construct with it a general formula that can be passed to Evalf:-Add
Use the extension mechanism of evalf to construct a numerical evaluation procedure as indicated in the help page of Evalf:-Add (recall the relevance of the use of `:-` in this step). Call AF2 this representation of AppellF2
`evalf/AF2` ≔ a,b1,b2,c1,c2,z1,z2→Add⁡subs⁡:-a=a,:-b1=b1,:-b2=b2,:-c1=c1,:-c2=c2,:-z1=z1,:-z2=z2,eval⁡general_formula
So this is the AF2 function
Check whether the evaluation point, z2=12, is within the radius of convergence; i.e.: whether the distance between the origin and the singularity closer to the origin is larger than 12:
So 12 is within the radius of convergence that is equal to 1. Hence this is the numerical evaluation of AF2⁡1,2,3,4,5,6,12
Compare with the numerical evaluation of the Maple standard AppellF2 function
Finally, note that the general procedure U that works with arbitrary values of the parameters of an AppellF2 function, has, for instance, z1−1 in the denominator of each coefficient of the series expansion. These factors that could-be-zero in the denominator frequently indicate a special case, for which the general formula is not valid. To generate the recurrence procedure for these cases, pass the function with the special case applied. In this example that would be the function at z1=1
F2z1 ≔ %AppellF2a, b1, b2, c1, c2, 1, z2
Generate a recurrence procedure for this special case, call it U1
U1≔proci,a,b1,b2,c1,c2,z1,z2optioncache;if⁡i::nonnegint,if⁡i<4,T[i]⁡i,a,b1,b2,c1,c2,z1,z2,a+i − 1*a+i − c1*i+b2 − 1*thisproc⁡i − 1,a,b1,b2,c1,c2,z1,z2/i*i+c2 − 1*i+a+b1 − c1,'procname⁡args'end proc
Note that in this particular case of z1=1, the coefficients of order 0 to 3 all involve hypergeometric functions at z1=1
The recurrence in this case thus only exists if these four hypergeometric functions are convergent, which in turn will only happen if 0<ℜ⁡c−a−b1,0<ℜ⁡c−a−1−b1,0<ℜ⁡c−2−a−b1, and 0<ℜ⁡c−a−3−b1, so that if you passed values such that any of these condition is not met, for example c1=1,a=2,b=3, the recurrence cannot be constructed and GenerateRecurrence returns FAIL
GenerateRecurrence⁡%AppellF22, 3, b2, 1, c2, 1, z2,parameters=op⁡F2
The MathematicalFunctions[Evalf][GenerateRecurrence] command was introduced in Maple 2017.
For more information on Maple 2017 changes, see Updates in Maple 2017.
Download Help Document