1 /* Copyright (C) 2004 Viktor T. Toth <http://www.vttoth.com/>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be
9 * useful, but WITHOUT ANY WARRANTY; without even the implied
10 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
13 * The main MAXIMA tensor demo
20 print("This is the main demonstration program for MAXIMA tensors."),
21 print("The following demos are available:"),
22 while sel#x and sel#X do
24 /* This block of code restores trigonometric
25 simplification properties that are removed
26 when a kill(all) is executed. */
28 put('sin,'cos,'complement_function),
29 put('cos,'sin,'complement_function),
30 put('sinh,'cosh,'complement_function),
31 put('cosh,'sinh,'complement_function),
34 put('cosh,1,'unitcof),
35 put('sinh,-1,'unitcof),
36 put('cos,-1,'complement_cof),
37 put('sin,-1,'complement_cof),
38 put('cosh,1,'complement_cof),
39 put('sinh,1,'complement_cof),
40 put('sin,'trigonometric,'type),
41 put('cos,'trigonometric,'type),
42 put('sinh,'hyper_trigonometric,'type),
43 put('cosh,'hyper_trigonometric,'type),
45 print("INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION"),
46 print("1. Basics 11. Initialization"),
47 print("2. Index contraction 12. Differential geometry"),
48 print("3. Simplification and symmetries 13. Gravitational theory"),
49 print("4. Special tensors 14. Frame fields"),
50 print("5. Coordinate differentiation 15. Torsion and nonmetricity"),
51 print("6. Covariant derivatives, curvature 16. Algebraic classification"),
52 print("7. Exterior algebra 17. Differential equations"),
53 print("8. Generating CTENSOR programs 18. Using Taylor series"),
54 print("9. Frames, torsion, nonmetricity"),
56 print("A. Algebraic tensor manipulation"),
57 print("E. Complete examples"),
58 print("X. Exit this demo"),
60 sel:read("Select an option by its number followed by a semicolon (;)"),
61 if sel=1 then demo(itensor1)
62 else if sel=2 then demo(itensor2)
63 else if sel=3 then demo(itensor3)
64 else if sel=4 then demo(itensor4)
65 else if sel=5 then demo(itensor5)
66 else if sel=6 then demo(itensor6)
67 else if sel=7 then demo(ex_calc)
68 else if sel=8 then demo(itensor8)
69 else if sel=9 then demo(itensor9)
70 else if sel=11 then demo(ctensor1)
71 else if sel=12 then demo(ctensor2)
72 else if sel=13 then demo(ctensor3)
73 else if sel=14 then demo(ctensor4)
74 else if sel=15 then demo(ctensor5)
75 else if sel=16 then demo(ctensor6)
76 else if sel=17 then demo(ctensor7)
77 else if sel=18 then demo(ctensor8)
78 else if sel=a then demo(atensor)
79 else if sel=E or sel=e then
81 print("The following specific examples demonstrate practical applications:"),
83 print("INDICIAL TENSOR MANIPULATION COMPONENT TENSOR MANIPULATION"),
84 print("1. Proving the Bianchi-identities 11. Deriving Schwarzschild's metric"),
85 print("2. Proving Cartan's identities 12. Verifying Reissner-Nordstrom"),
86 print("3. The Kaluza-Klein metric 13. Petrov classification of metrics"),
87 print("4. The double divergence of R 14. Using a tetrad base"),
88 print("5. Helicity in hydrodynamics 15. The Friedmann equations"),
89 print("6. Magnetic field in plasma 16. Papapetrou's nonsymmetric metric"),
90 print("7. Spinor algebra 17. The Kruskal extension"),
91 print("8. The EM field tensor 18. Hydrostatic equilibrium"),
92 print("9. The Hodge star operator 19. The Killing equations"),
93 print("A. The Riemann and Weyl tensors"),
94 print("B. The Rainich conditions"),
95 print("C. The Einstein-Hilbert action"),
96 print("D. Brans-Dicke cosmology"),
97 print("E. The Laplacian of a scalar"),
99 print("X. Return to main menu"),
101 sel:read("Select an option by its number followed by a semicolon (;)"),
102 if sel=1 then demo(bianchi)
103 else if sel=2 then demo(car_iden)
104 else if sel=3 then demo(kaluza)
105 else if sel=4 then demo(ademo)
106 else if sel=5 then demo(helicity)
107 else if sel=6 then demo(plasma)
108 else if sel=7 then demo(spinor)
109 else if sel=8 then demo(maxwell)
110 else if sel=9 then demo(hodge)
111 else if sel=a or sel=A then demo(weyl)
112 else if sel=b or sel=B then demo(rainich)
113 else if sel=c or sel=C then demo(einhil)
114 else if sel=d or sel=D then demo(bradic)
115 else if sel=e or sel=E then demo(laplacian)
116 else if sel=11 then demo(schwarz)
117 else if sel=12 then demo(reissner)
120 print("Choose from the following metrics"),
122 print("1. The Schwarschild metric (type D)"),
123 print("2. The Kerr metric (type D)"),
124 print("3. The anti-deSitter metric (type 0)"),
125 print("4. Godel's universe (type D)"),
126 print("5. Taub-Nut plane vacuum (type D)"),
127 print("6. Allnutt's perfect fluid metric (type III)"),
129 print("X. Return to main menu"),
131 sel:read("Select an option by its number followed by a semicolon (;)"),
132 if sel=1 then demo("ctensor6")
133 else if sel=2 then demo("petrov")
134 else if sel=3 then demo("adsitter")
135 else if sel=4 then demo("godel")
136 else if sel=5 then demo("taubnut")
137 else if sel=6 then demo("allnutt")
138 else if sel#X and sel#x then print("*** Invalid entry, please try again")
141 else if sel=14 then demo(tetrad)
142 else if sel=15 then demo(friedmann)
143 else if sel=16 then demo(papapetrou)
144 else if sel=17 then demo(kruskal)
145 else if sel=18 then demo(hydro)
146 else if sel=19 then demo(killing)
147 else if sel#X and sel#x then print("*** Invalid entry, please try again")
150 else if sel#X and sel#x then print("*** Invalid entry, please try again")