Converting other representations to holonomic¶
Converting hypergeometric functions¶
- sympy.holonomic.holonomic.from_hyper(func, x0=0, evalf=False)[source]¶
Converts a hypergeometric function to holonomic.
func
is the Hypergeometric Function andx0
is the point at which initial conditions are required.Examples
>>> from sympy.holonomic.holonomic import from_hyper >>> from sympy import symbols, hyper, S >>> x = symbols('x') >>> from_hyper(hyper([], [S(3)/2], x**2/4)) HolonomicFunction((-x) + (2)*Dx + (x)*Dx**2, x, 1, [sinh(1), -sinh(1) + cosh(1)])
Converting Meijer G-functions¶
- sympy.holonomic.holonomic.from_meijerg(
- func,
- x0=0,
- evalf=False,
- initcond=True,
- domain=QQ,
Converts a Meijer G-function to Holonomic.
func
is the G-Function andx0
is the point at which initial conditions are required.Examples
>>> from sympy.holonomic.holonomic import from_meijerg >>> from sympy import symbols, meijerg, S >>> x = symbols('x') >>> from_meijerg(meijerg(([], []), ([S(1)/2], [0]), x**2/4)) HolonomicFunction((1) + (1)*Dx**2, x, 0, [0, 1/sqrt(pi)])
Converting symbolic expressions¶
- sympy.holonomic.holonomic.expr_to_holonomic(
- func,
- x=None,
- x0=0,
- y0=None,
- lenics=None,
- domain=None,
- initcond=True,
Converts a function or an expression to a holonomic function.
- Parameters:
func:
The expression to be converted.
x:
variable for the function.
x0:
point at which initial condition must be computed.
y0:
One can optionally provide initial condition if the method is not able to do it automatically.
lenics:
Number of terms in the initial condition. By default it is equal to the order of the annihilator.
domain:
Ground domain for the polynomials in
x
appearing as coefficients in the annihilator.initcond:
Set it false if you do not want the initial conditions to be computed.
Examples
>>> from sympy.holonomic.holonomic import expr_to_holonomic >>> from sympy import sin, exp, symbols >>> x = symbols('x') >>> expr_to_holonomic(sin(x)) HolonomicFunction((1) + (1)*Dx**2, x, 0, [0, 1]) >>> expr_to_holonomic(exp(x)) HolonomicFunction((-1) + (1)*Dx, x, 0, [1])