Status: Accepted
Owner: fabian.seoane
Labels: Type-Defect Priority-Medium Milestone-Release0.6.4

New issue 1270 by fabian.seoane: documentation for RSolve
http://code.google.com/p/sympy/issues/detail?id=1270

Put this mail from Mateusz into the docs:


rsolve_X functions were meant as a low level interface for rsolve()
which would use Mathematica's syntax. Anyway it's true that docstrings
for rsolve_X aren't much helpful, so here is a brief guide.

Given a recurrence relation:

    a_{k}(n) y(n+k) + a_{k-1}(n) y(n+k-1) + ... + a_{0}(n) y(n) = f(n)

where k > 0 and a_{i}(n) are polynomials in n. To use rsolve_X we need
to put all coefficients in to a list L of k+1 elements the following
way:

    L = [ a_{0}(n), ..., a_{k-1}(n), a_{k}(n) ]

where L[i], for i=0..k, maps to a_{i}(n) y(n+i) (y(n+i) is implicit).

For example if we would like to compute m-th Bernoulli polynomial up to
a constant (example was taken from rsolve_poly docstring), then we would
use b(n+1) - b(n) == m*n**(m-1) recurrence, which has solution b(n) = B_m +  
C.

Then L = [-1, 1] and f(n) = m*n**(m-1) and finally for m=4:

  >>> from sympy.core import Symbol
  >>> n = Symbol('n', integer=True)

  >>> rsolve_poly([-1, 1], 4*n**3, n)
  C0 + n**2 - 2*n**3 + n**4

  >>> bernoulli(4, n)
  -1/30 + n**2 - 2*n**3 + n**4

For the sake of completeness, f(n) can be:

  [1] a polynomial              -> rsolve_poly
  [2] a rational function       -> rsolve_ratio
  [3] a hypegeometric function  -> rsolve_hyper

I hope now it's much clearer and I hope someone will consider writing
rsolve() as an easy to fix task. It might be also beneficial to put this
guide into rsolve_X docstrings.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to