Hi,

I tried python lists and every thing seems fine to me-

>>> ls=symbols('a:10')
>>> ls
(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)

Now I call a function Sum (it sums up a series in particular, infinite
series)-

>>> for i in range(10):
...  Sum(1/(ls[i]**ls[i]),(ls[i],1,oo)).evalf()
...
1.29128599706266
1.29128599706266
1.29128599706266
1.29128599706266
1.29128599706266
1.29128599706266
1.29128599706266
1.29128599706266
1.29128599706266
1.29128599706266

Also,

>>> solve([ls[0]+5*ls[1]-2,-3*ls[0]+6*ls[1]-15])
{a0: -3, a1: 1}


It might be that I have misunderstood your problem :(




On Sat, Dec 1, 2012 at 7:13 PM, Matthew Rocklin <mrock...@gmail.com> wrote:

> I ran into this problem in MatrixExprs.  We don't currently have a
> subscripted symbol.  It would be nice though.
>
> In the following example
> In [1]: X = MatrixSymbol('X', n, n)
>
> In [2]: X[1, 2]
> Out[2]: X₁₂
>
> Ideally X[1, 2] is a Symbol that contains separate information for its
> origin X and its indices, 1, and 2.  Alas, all it knows is the combined
> string "X_12".
>
>
>
>
> On Sat, Dec 1, 2012 at 7:30 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'
>>
>> 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.
>



-- 
Regards,
Rishabh Dixit
BITS Pilani

-- 
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