Mubeen,
I don't believe any of Maxima's tensor packages work in a way that would be
directly applicable to the types of problems you describe.
Maxima has two major tensor packages, ctensor and itensor. The ctensor
package is really a collection of common functions from Riemannian geometry;
e.g., after providing a metric (in the form of a matrix) you can use ctensor
to compute the corresponding Christoffel symbols, Riemann tensor, Weyl
tensor, etc. The itensor package, on the other hand, deals with "indexed
objects", essentially implementing the algebraic rules of the tensor
formalism using the usual index notation and the Einstein summation
convention.
The itensor package does have a limited capability to differentiate with
respect to a tensor. However, tensor-valued functions are not directly
supported. That said, one can use dependency declarations in certain
scenarios.
In your case, assuming that P is a scalar and A is a rank-two tensor that is
a function of P, perhaps something like this might actually do the trick:
(%i1) load(itensor)$
(%i2) depends(A,P)$
(%i3) EXP:ishow(P^T*A([i,j],[])*P)$
T + 1
(%t3) A P
i j
(%i4) ishow(diff(EXP,P))$
T d T + 1
(%t4) A P (T + 1) + (-- (A )) P
i j dP i j
However, if P itself is a tensor, this won't do; you can't just raise a
tensor to an arbitrary exponent T in itensor, as the package expects to know
exactly which indices are being contracted. However, if you know what T is,
e.g., T = 2, you may be able to write your expression in a form similar to
this one (depending on exactly which indices are to be contracted in your
case):
(%i5) EXP:ishow(P([i],[j])*P([j],[k])*A([k],[l])*P([l],[i]))$
j k l i
(%t5) P P A P
i j k l
(%i6) ishow(contract(diff(EXP,P([a],[b]))))$
j k d l i l a i k l a j k a
(%t6) P P (--- (A )) P + A P P + P A P + P P A
i j b k l b i l b k l b j k
dP
a
However, I am pretty sure that this is not what you were looking for.
Viktor
-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Mubeen Shahid
Sent: Wednesday, February 13, 2013 8:31 AM
To: maxima at math.utexas.edu
Subject: Tensor calculus - derivatives of tensors
Hi all,
As far as Maxima skills are concerned, I am an absolute beginner.
I have some equations invloving 2nd rank tensors, and I need the derivative
of the tensorial equation with respect to a tensor.
After spending many hours with pen-paper, I though of directly getting the
results via Maxima.
As a simple example, I need the derivate of expression P^{T}?A?P with
respect to the tensor P, where A is a tensor function of P.
I throughly searched the documentation , but I wasn't able to find the right
set of commands for this purpose.
I will be very thankful if someone can guide me about the usage of tensor
calculus for this purpose.
Best regards,
Mubeen.
P.S: my apologies for any mathematical mistakes; being an engineering
student, my knwoeldge about tensor is just introductory.