An Automated Repertoire Method for solving linear recurrence relations Requires MatLab and the Symbolic Math Toolbox Add-On.
result = repertoire(functions, @substitute, nonHomogeneous, precision, start, rec_degree, poly_degree, optional_flags)
[C, N] = repertoire(functions, @substitute, nonHomogeneous, precision, start, rec_degree, poly_degree)
[__] = repertoire(functions, @substitute, nonHomogeneous, precision, start, rec_degree, poly_degree, "verbose")
[__] = repertoire(functions, @substitute, nonHomogeneous, precision, start, rec_degree, poly_degree, "quitSearch")
[__] = repertoire(functions, @substitute, nonHomogeneous, precision, start, rec_degree, poly_degree, "addMul")
result = repertoire(functions, @substitute, nonHomogeneous, precision, start, rec_degree, poly_degree) returns the solutions to the recurrence relation implied by substitute and nonHomogeneous which are present in the span of functions
[C, N] = repertoire(functions, @substitute, nonHomogeneous, precision, start, rec_degree, poly_degree) saves the coefficients of the solutions in the matrix C and the names of the functions in N
The flag "verbose" gives verbose information during the execution. The flag "quitSearch" quits searching for solutions if the probability of further solutions is low. The flag "addMul" adds pairwise products to the guesses.
For detailed examples, refer to the directory examples_commented
A list of symbolic functions that the user suspects as solutions. If the flag "addMul" is set, products are also checked (e.g. if f and g are in functions, f * g will be added to functions). The program can find solutions within the span of functions. Be sure to use the symbolic variable x.
The function implies the homogeneous part of the linear recurrence relation. E.g. if
function ret = substitute(n, func_val)
ret = func_val(:,1) - sym(n) * func_val(:,2) + 2^sym(n) * func_val(:,3);
end
The non-homogeneous part of the recurrence relation. E.g. if
precision specifies the precision of all calculations (in significant decimal figures). Usually, a precision of ~400 yields good results.
start is the first integer at which all functions in functions are evaluated. Subsequent points are the consecutive integers starting from start.
In the example
poly_degree specifies how many polynomials are guessed. For example, if poly_degree is
If the flag "addMul" is set, the program also guesses