On Dec 1, 2012, at 6:31 AM, Shriramana Sharma <samj...@gmail.com> wrote:

On Sat, Dec 1, 2012 at 6:46 PM, Chris Smith <smi...@gmail.com> wrote:


that's what symbols does for you; just store the result in an array if you

want:


a=symbols('a:11')

a[1]

a1

a

(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)


But I already said that I can't use a Python list because I can't then
use something like a[i] as part of an expression where i is a symbol.
For example summation(a[i],(i,0,n)) would throw an IndexError or
something saying that the index of a list has to be an integer. The
SymList or something that I visualize should be able to handle the
above.

Have you looked at Indexed?


Hey nice, but still I have this problem:

from sympy import IndexedBase
A=IndexedBase('A')
solve([A[0] + 5*A[1] - 2, -3*A[0]+ 6*A[1] - 15])

produces at the end of the source trace:

AttributeError: 'int' object has no attribute 'free_symbols'


That is a bug that I believe was fixed in the git master recently. The
workaround is to use A[S(1)] instead of A[1].

The bigger issue with Indexed is that it is noncommutative. See
http://code.google.com/p/sympy/issues/detail?id=2659. I think this is the
right class for you, but it is in need of some cleaning up.

Aaron Meurer



The subscriptable symbol which I expect should be able to handle the
above solve command. Or if I have to alter my usage slightly (i.e.
without using all that atoms etc) for IndexedBase itself (or some
existing subclass thereof) to be able to handle the above solve,
please indicate it. Thanks!

-- 
Shriramana Sharma

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

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

Reply via email to