10.01.2012 13:26, John B пишет:
> On Jan 9, 6:42 am, Matthew <[email protected]> wrote:
>> You could do the above by explicitly making a scalar symbol for each
>> of x[0], x[1], ...
>>
> Hello Matthew.  I realize I could use a scalar for each x[i], but I
> was looking for a way to use only the vector symbol x[i].  It makes
> the results of differentiation much more tidy, especially when f has
> many terms.  You can do this in Mathematica and it is a nice feature.
> In my example, f = Sum(5*x[i]**2, (i,0,n)), x[i] is a vector.  In
> Mathematica you can also symbolically differentiate with matrices.
> For example, you can take the derivative of  f = Sum(5*x[i,j]**2, (i,
> 0,n)) and obtain the symbolic result:
> df/dx = Sum(10*x[i,j], (i,0,n))
> John
> 

I think this must be added to the issue tracker (may be separated
issues), for the enhancement of SymPy.

Notes:

As I understand, the 'x[i]' in your example is a separated symbolic
notation which have own sense. It can be related with matrices
(vectors), indexes or with sequences.

1) About Matrices:

I try to explain the current situation about Matrices (and Vectors).

There was (and is) the Matrix class in SymPy, which is the only matrix
of other sympy's symbolic expression.

So we havn't matrix's like expressions themselves, (except indexes).

Only recently, the expressions of matrices was introduced, the
expressions which deals with symbols. It made by Matthew, btw.

Unfortunatly it not documented yet, the documentation it is not created
in the docs.sympy.org, so I point out only development code:
https://github.com/sympy/sympy/pull/532/

    >>> A = MatrixSymbol('A', n, n)
    >>> B = MatrixSymbol('B', n, n)
    >>> (A*B)**(-1)
    B^-1⋅A^-1
    >>> Transpose(A*B)
    B'⋅A'

But it is impossible yet now to use the expressions like the 'x[i]'. It
is a separated expressions.

I think, that the functionality of what you written about will be in the
future, so the  issue must be created for it in the issue tracker. And
the implementation may be connected with the next paragraph:

2) The symbolic notation of 'x[i]' can be related with indexes objects,
or sequences. Unfortunately I can't estimate exactly the current
situation for  those topics.

3) The issue about differentiation of sequences (of any nature of aboves
notation) and about differentiation of sum of sequences.

Should be implemented in the future too. But firstly the one of the
above issues must be resolved.

But before to adding this in issue tracker, let's discuss.

And you can expand another desired use-cases on this topics.
Additionally we might create the special wiki page, (if it is necessary
or convenient), e.g. https://github.com/sympy/sympy/wiki/UD-diff-sum-of-seq



-- 
Alexey U.

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

Reply via email to