suggestions on how to do this

chris cf_1957 at hotmail.com
Wed Apr 27 07:34:53 EDT 2005


The problem I have is as follows:

I have a recursive function b(k)

b(k) = -(A/k**2)*(b(k-2) - b(k-5))
k<0, b(k)=0
k=0, b(k)=1
k=1, b(k)=0

eg. b(2) = -A/4
      b(3) = 0
      b(4) = A**2/64

note that as k increases b(k) can itself be a sum of terms in powers of A
rather than a single power of A in the examples above.

Summing all terms and equating to zero gives:

F= sum b(k) = 0 for all k = 0, infinity

When this is expanded I get a polynomial F(A). I want to determine the
coefficients of the polynomial so that I can find the roots of the function
F up to a specified order of A.


I have yet to code this but I was hoping for some ideas on how to do this
reasonably.

I figure I can compute each b(k) and store the numeric value(s) and
associated powers of A. Then collect coefficients for like powers of A.
Finally I have a set of polynomial coefficients in A which I can pass to
scipy.base.roots()

Any suggestions on how I might do this efficiently? I have no doubt I can
get this done with brute force, but I would prefer to explore more elegant
means which I look to the masters for.

tia






More information about the Python-list mailing list