I started working on the support for additional symbolic parameters in the module. So I added an extra argument in the method
expr_to_holonomic for using custom domains. This will be helpful in integrations. For instance:
In : expr_to_holonomic(sin(x*y), x=x, domain=QQ[y]).integrate(x).to_expr() Out: -cos(x⋅y) + 1 ───────────── y In : expr_to_holonomic(log(x*y), x=x, domain=QQ[y]).integrate((x, 1, x)).to_expr() Out: x⋅log(x) + x⋅log(y) - x - log(y) + 1
Code upto here was merged at #11330.
After that I implemented the
Frobenius method to support functions where the series may have negative or fractional exponents. Although there are limitations in the algorithm. First one being that we don’t have an algorithm to compute the general solution. There doesn’t seem to be a direct algorithm if roots of the
indicial equation differ by an integer. Second one is the initial conditions. Initial conditions of the function (most of the times they won’t even exist) can’t be used if the exponents are fractional or negative.
In : expr_to_holonomic(sqrt(x**2-x)).series() Out: 3/2 5/2 7/2 9/2 11/2 C₀⋅x C₀⋅x C₀⋅x 5⋅C₀⋅x 7⋅C₀⋅x ⎛ 6⎞ C₀⋅√x - ─────── - ─────── - ─────── - ───────── - ────────── + O⎝x ⎠ 2 8 16 128 256 In : expr_to_holonomic(cos(x)**2/x**2, initcond=False).series() Out: 2 4 3 5 C₂⋅x 2⋅C₂⋅x C₁ 2⋅C₁⋅x 2⋅C₁⋅x 4⋅C₁⋅x C₀ ⎛ 6⎞ C₂ - ───── + ─────── + ── - ────── + ─────── - ─────── + ── + O⎝x ⎠ 3 45 x 3 15 315 2 x
I will be working more on this and hope to add more functionality in this method.
Right now I am working on an algorithm to convert a given Holonomic Function to Meijer G-function. This also doesn’t look so straightforward. Kalevi helped me with the theory and we wrote a basic that works for some cases. We hope to add more things in it.
In : hyperexpand(expr_to_holonomic(exp(x)).to_meijerg()) Out: x ℯ In : hyperexpand(expr_to_holonomic(log(x)).to_meijerg()).simplify() Out: log(x)
These are at #11360.