File: itensor8.dem

package info (click to toggle)
maxima 5.21.1-2squeeze
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 94,928 kB
  • ctags: 43,849
  • sloc: lisp: 298,974; fortran: 14,666; perl: 14,325; tcl: 10,494; sh: 4,052; makefile: 2,975; ansic: 471; awk: 24; sed: 7
file content (43 lines) | stat: -rw-r--r-- 1,330 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * Demonstrating ic_convert()
 */
if get('itensor,'version)=false then load(itensor);
if get('ctensor,'version)=false then load(ctensor);
("The RHS of the heat transport equation")$
dim:3;
remcomps(g);
imetric(g);
eqn:ishow(td = canform(rename(expand(covdiff(
     -k([],[])*covdiff(t([],[]),i),j)*g([],[i,j]))))+ source)$

("Convert it to a CTENSOR program")$
heat:ic_convert(eqn);

("Next, write the equation in Cartesian coordinates:")$
ct_coords:[x,y,z];
lg:ident(3);
ug:invert(lg);
christof(mcs);
depends([t,k],ct_coords);
ev(heat);

("Now get the equation in spherical coordinates.")$
ct_coords:[r,th,ph];
lg:matrix([1,0,0],[0,r^2,0],[0,0,r^2*sin(th)^2])$
ug:invert(lg)$
christof(all);
remove([t,k],dependency);
depends(t,ct_coords);
ev(heat);

/* End of demo -- comment line needed by MAXIMA to resume demo menu */