On Wed, Feb 4, 2009 at 4:27 PM, Friedrich Hagedorn <friedric...@gmx.de>wrote:
> > On Wed, Feb 04, 2009 at 07:12:54AM -0800, chu-ching huang wrote: > > > > Hi, > > > > Maybe this had been discussed: > > > > how to define a sequence of variables (by symbols), {x_1,x_2,---,x_n} > > in case n is also a variable? > > Do you want this: > > In [1]: var('x_1 x_2 x_n') > Out[1]: (x_1, x_2, x_n) > > In [2]: x_1 + x_2 + x_n > Out[2]: x_1 + x_2 + x_n You can also use DeferredVector: In [1]: a = DeferredVector('a') In [2]: a[1] + a[2] + a[3] + a[4] + a[54653656] Out[2]: a[1] + a[2] + a[3] + a[4] + a[54653656] just that the class lacks documentation, see http://code.google.com/p/sympy/issues/detail?id=1268 > > > > By, > > Friedrich > > > > -- Fabian, http://fseoane.net/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---