1 /* Original version of this file copyright 1999 by Michael Wester,
2 * and retrieved from http://www.math.unm.edu/~wester/demos/TensorAnalysis/problems.macsyma
5 * Released under the terms of the GNU General Public License, version 2,
6 * per message dated 2007-06-03 from Michael Wester to Robert Dodier
7 * (contained in the file wester-gpl-permission-message.txt).
9 * See: "A Critique of the Mathematical Abilities of CA Systems"
10 * by Michael Wester, pp 25--60 in
11 * "Computer Algebra Systems: A Practical Guide", edited by Michael J. Wester
12 * and published by John Wiley and Sons, Chichester, United Kingdom, 1999.
14 /* ----------[ M a c s y m a ]---------- */
15 /* ---------- Initialization ---------- */
18 /* ---------- Tensor Analysis ---------- */
20 /* Generalized Kronecker delta: delta([j, h], [i, k]) =
21 delta(j, i) delta(h, k) - delta(j, k) delta(h, i). See David Lovelock and
22 Hanno Rund, _Tensors, Differential Forms, & Variational Principles_, John
23 Wiley & Sons, Inc., 1975, p. 109. */
24 ishow(kdelta([i, k, @j, @h]));
25 /* Levi-Civita symbol: [epsilon(2,1,3), epsilon(1,3,1)] => [-1, 0] */
26 [levi_civita([2, 1, 3]), levi_civita([1, 3, 1])];
27 /* Tensor outer product: [[ 5 6] [-10 -12]]
28 [1 -2] [ 5 6] [[ -7 8] [ 14 -16]]
29 ij ij [3 4] X [-7 8] = [ ]
30 c = a b [[ 15 18] [ 20 24]]
31 kl kl [[-21 24] [-28 32]] */
32 a: matrix([1, -2], [3, 4])$
33 b: matrix([5, 6], [-7, 8])$
36 /* Definition of the Christoffel symbol of the first kind (a is the metric
37 tensor) [Lovelock and Rund, p. 81]
40 Chr1 = - (----- + ----- - -----)
44 ishow(ichr1([l, h, k]));
45 /* Partial covariant derivative of a type (1, 1) tensor field (Chr2 is the
46 Christoffel symbol of the second kind) [Lovelock and Rund, p. 77]
48 T = ---- T + Chr2 T - Chr2 T
53 /* Verify the Bianchi identity for a symmetric connection (K is the Riemann
54 curvature tensor) [Lovelock and Rund, p. 94]
57 i jk|l i kl|j i lj|k */
58 ishow(covdiff(icurvature([@h, i, j, k]), l) +
59 covdiff(icurvature([@h, i, k, l]), j) +
60 covdiff(icurvature([@h, i, l, j]), k));