1

Possible Duplicate:
SymPy - Arbitrary number of Symbols

I am trying to create a system of equations which is formed through iteration. Each equation is generated with:

summation(binomial(n,i) * (1-t) ** (n-i) * t ** i * P[i]) - V[j]

where all V[j] are given as input. The idea is to use the system of equations created around P[i] to then solve for every P[i] but to do so, they must be sympy symbol objects, and I'm not sure how to generate such a list.

Is it possible to have a nameless list or generate a list of symbols?

Please let me know if the question begs for clarification, I had a hard time putting it into words.

Thanks in advance :)

Community
  • 1
  • 1
hedgehogrider
  • 917
  • 2
  • 11
  • 19
  • 1
    Do the answers [here](http://stackoverflow.com/questions/9492944/sympy-arbitrary-number-of-symbols), in particular the `sympy.symbols` and `symnpy.numbered_symbols` answers, help? – DSM Dec 28 '12 at 02:46
  • This is EXACTLY what I'm looking for! However, my isympy does not follow the behavior of the documentation. In the docs, symbols('a0:10') should yield a tuple of numbered Symbols. When I run this, I get symbols with the names 'a', '0', ':', and so forth. What's wrong here? – hedgehogrider Dec 28 '12 at 05:11
  • 1
    Works for me, so at a guess, maybe you're using an old version of `sympy`? (`print sympy.__version__` will tell you. If you're pre-0.7.2, then upgrade; I can't remember when symbol numbering was introduced.) – DSM Dec 28 '12 at 05:18
  • 1
    That is the behavior of a rather old version of SymPy (I think 0.6.7 and earlier). – asmeurer Dec 28 '12 at 10:04
  • Early version in apt-get. I installed 0.7.2 from source and it works now. Thanks so much! – hedgehogrider Dec 29 '12 at 03:55

0 Answers0