GithubHelp home page GithubHelp logo

Comments (3)

oscarbenjamin avatar oscarbenjamin commented on June 24, 2024

It looks like the given form comes from here:

result = _rsolve_hypergeometric(f, x, P, Q, k, m)
if result is None:
return None
sol_list, ind, mp = result
sol_dict = defaultdict(lambda: S.Zero)
for res, cond in sol_list:
j, mk = cond.as_coeff_Add()
c = mk.coeff(k)
if j.is_integer is False:
res *= x**frac(j)
j = floor(j)
res = res.subs(k, (k - j) / c)
cond = Eq(k % c, j % c)
sol_dict[cond] += res # Group together formula for same conditions
sol = []
for cond, res in sol_dict.items():
sol.append((res, cond))
sol.append((S.Zero, True))
sol = Piecewise(*sol)

Maybe that code or some other code could be a bit smarter about recognising a Piecewise where the expression is zero in one of the cases.

from sympy.

pierre-haessig avatar pierre-haessig commented on June 24, 2024

Thanks for identifying the region. For now I don't have a development setup for SymPy and I guess that understanding the code would be really helped by using a step-by-step debugger.

By the way, is it just me or there are missing doc in rsolve_hypergeometric(f, x, P, Q, k, m): f and x are not documented? Is f(x) the function such that its power series coefficients are the a(n) coefficients mentioned in the docstring?

from sympy.

oscarbenjamin avatar oscarbenjamin commented on June 24, 2024

f and x are not documented?

Ideally they would be documented but this is an internal function and not all internal functions have docs.

from sympy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.