From: nooj on
<anonymous> wrote:
> Hi,
> you should explain what you exactly mean by "tensorial derivative".
>
> If you really mean the covariant derivative then you did not give enough
> information.
>
> But maybe you mean the ordinary derivative. E.g.: D[ W[C[x,y,z]], x].
> Here we have the problem that Mathematica has no general rules for
> the derivative of Det. Therefore, either you specify these rules or you
> give the components of C explicitely as functions of x,y,z, so that
> Det can be evaluated.
>
> Further, note that capital C is a reversed symbol, I changed it to lower
> case. Custom names should always begin with lowercase, system
> names always begin with a capital.
>
> For simplicity I make a 2D example:
>
> c[x_,y_]:= {{x+0.5 x^2,x},{x,1+2 x }};
> Wiso[c_] := a Exp[ b(I1[c]-3)^2 ] - a;
> Wdil[c_] := k ( Det[c]^2 - 1 - Log[ Det[c] ] );
> W[c_] := Wiso[c] + Wdil[c];
>
> Now we can get our derivatives as usual. E.g.:
> D[W[c[x, y]], x]
> D[W[c[x, y]], {x,2}] e.t.c

Hi,

I mean this derivative:
http://en.wikipedia.org/wiki/Tensor_derivative_(continuum_mechanics)

So the first derivative of W(C) with respect to C would be this kind
of derivative:

http://en.wikipedia.org/wiki/Tensor_derivative_(continuum_mechanics)#Derivatives_of_scalar_valued_functions_of_second-order_tensors

And the first derivative of that would be

http://en.wikipedia.org/wiki/Tensor_derivative_(continuum_mechanics)#Derivatives_of_tensor_valued_functions_of_second-order_tensors

Good catch on the "C"; I was typing that in from memory. I'll use "A"
from now on. I'll also ignore the part about how I was taking the
difference
with respect to a symmetric tensor; I can handle that distinction
(See http://en.wikipedia.org/wiki/Tensor_derivative_(continuum_mechanics)#Derivative_of_a_second-order_tensor_with_respect_to_itself).

The derivative of Det[A] can be easily stated (though it's not
straightforward to compute):
partial Det[A] / partial A = Det[A] A^(-T).
(See http://en.wikipedia.org/wiki/Tensor_derivative_(continuum_mechanics)#Derivative_of_a_second-order_tensor_with_respect_to_itself)


This is what I tried:

/* components of the matrices */
Clear[a, b, c, d, e, f, g, h, i]

/* nonsymmetric tensor */
A = ( {
{a, b, c},
{d, e, f},
{g, h, i}
} )

/* a constant symmetric tensor */
C0 = ( {
{1, 0, 1},
{0, 2, 0},
{1, 0, 3}
} )

/* this works, gives the identity tensor */
D[Tr[A], {A, 1}] // MatrixForm

/* multiplier to build Cbar */
Jmod[A] := Det[A]^(-1/3)

/* Cbar is like Ct but has determinant 1 */
Cbar[A_] := Jmod[A] A

/* make sure Cbar looks okay */
Cbar[A] // MatrixForm

/* This is my strain energy function. */
W[A_] := \[Alpha] / (2 \[Gamma])
( Exp[\[Gamma] (Tr[Cbar[A]] - 3)^2] - 1 )

/* Is this what I want? How do I evaluate it at C0? */
D[W[A], {A, 1}]

/* Is this what I want? It's fourth rank. How do I evaluate it? */
D[W[A], {A, 2}]

- Nooj

From: Jeff on
You might want to look at NCAlgebra, a package for non-commutative
algebra that expands on the vector and matrix commands in Mathematica.

http://math.ucsd.edu/~ncalg/

From: magma on

If you are seriously working with tensors and you know what you are
doing with them (meaning: you know differential geometry), you should
try xAct (free package suite) or Tensorial (low-cost-high quality
David Park's package with examples from continuous mechanics too) or
TContinuumMechanics2 (a package by Jean-Fran=E7ois Gouyet that adds
additional commands to Tensorial 4.0 for working in continuum
mechanics)
Worth mentioning is also the book: Continuum-Mechanics-using-
Mathematica

Links:
XAct
http://metric.iem.csic.es/Martin-Garcia/xAct/index.html

Tensorial/TContinuumMechanics2
http://home.comcast.net/~djmpark/TensorialPage.html

Continuum-Mechanics-using-Mathematica
http://www.amazon.com/Continuum-Mechanics-using-Mathematica%C2%AE-Fundament=
als/dp/0817632409