Add "ru" entry for the hashtable *index-file-name*
[maxima.git] / share / diff_form / surface_example.txt
blob23103f8a8ce046320538381c591174e35787b45c
1 Maxima 5.9.3 http://maxima.sourceforge.net
2 Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL)
3 Distributed under the GNU Public License. See the file COPYING.
4 Dedicated to the memory of William Schelter.
5 This is a development version of Maxima. The function bug_report()
6 provides bug reporting information.
7 (%i1) batch("new_cartan_test4.bat");
9 batching #p/home/furuya/sagyo/new_cartan_test4.bat
10 (%i2)                        load(cartan_new.lisp)
11 (%i3)                              infix(@)
12 (%i4)                              infix(&)
13 (%i5)                              infix(|)
14 (%i6)                 coords : read(Input new coordinate)
15 Input new coordinate
16 [a,b];
17 (%i7)                    dim : extdim : length(coords)
18 (%i8)                basis : VR : extsub  : extsubb  : []
19                                         1          1
20 (%i9)    for i thru dim do basis : endcons(concat(D, coords ), basis)
21                                                            i
22 (%i10) for i thru dim do (extsub      : cons(basis  = - basis , extsub ),
23                                 1 + i             i          i        i
24  extsubb  : cons(basis  = 0, extsub ), ci : concat(v, i), VR : endcons(ci, VR))
25         i             i            i
26 (%i11)                               basis
27 (%o11)                             [Da, Db]
28 (%i12) cliffordtype : read(please input metric type,for example [1,1,1],if E3)
29 please input metric type,for example [1,1,1],if E3
30 [1,1];
31 (%o12)                              [1, 1]
32 (%i13) translist : read(represent the standard coordinates with new one)
33 represent the standard coordinates with new one
34 [(2+cos(a))*cos(b),(2+cos(a))*sin(b),sin(a)];
35 (%o13)        [(cos(a) + 2) cos(b), (cos(a) + 2) sin(b), sin(a)]
36 (%i14)                          norm_table : []
37 (%i15)                         scale_factor : []
38 (%i16)                              _l : []
39 (%i17) for i thru dim do (_l : map(lambda([x], diff(x, coords )), translist),
40                                                              i
41                       2
42 _l : map(lambda([x], x ), _l), _p : ratsimp(trigsimp(apply(+, _l))),
43                      cliffordtype
44                                  i
45 norm_table : endcons(-------------, norm_table))
46                           _p
47 (%i18)                            norm_table
48                                         1
49 (%o18)                    [1, ----------------------]
50                                  2
51                               cos (a) + 4 cos(a) + 4
52                                                    norm_table
53                                                              i
54 (%i19) for i thru dim do extsubb2  : cons(basis  = -----------, extsub )
55                                  i             i     basis            i
56                                                           i
57                                        2        1
58 (%i20) for i thru dim do (a_ : solve(x_  - -----------, [x_]),
59                                            norm_table
60                                                      i
61                                    scale_factor : cons(rhs(a_ ), scale_factor))
62                                                              2
63 (%i21)               scale_factor : reverse(scale_factor)
64 (%i22)                           scale_factor
65 (%o22)                          [1, cos(a) + 2]
66 (%i23) nest2(_f, _x) := block([_a : [_x], i],
67 if listp(_f) then (_f : reverse(_f), for i thru length(_f)
68 do _a : map(_f , _a)) else _a : map(_f, _a), _a )
69               i                                1
70 (%i24) nest3(_f, _x, _n) := block([_a, i], _a : [_x],
71                                          for i thru _n do _a : map(_f, _a), _a)
72                                2
73 (%i25)           aa_ : solve(x_  - apply(*, norm_table), [x_])
74 (%i26)                        volume : rhs(aa_ )
75                                               2
76                                            1
77 (%i27)                          volume : ------
78                                          volume
79 (%i28)            matrix_element_mult : lambda([x, y], x @ y)
80 (%i29)                       load(hodge_test3.mac)
81 (%i30)                      load(f_star_test4.mac)
82 (%i31)                        load(helpfunc.mac)
83 (%i32)                        load(coeflist.lisp)
84 (%i33)                         load(format.lisp)
85 (%i34)                            load(diag)
86 (%i35)                         load(poisson.mac)
87 (%i36)                        load(frobenius.mac)
88 (%i37)                        load(curvture2.mac)
89 (%o38)                       new_cartan_test4.bat
91 /*[x,y,z]=translist,this case parametrized torous by [a,b] */
93 (%i38) d(translist);
94 (%o38) [- cos(a) sin(b) Db - 2 sin(b) Db - sin(a) cos(b) Da,
95                   cos(a) cos(b) Db + 2 cos(b) Db - sin(a) sin(b) Da, cos(a) Da]
96 (%i39) m:coefmatrix(%,basis);
97                   [ - sin(a) cos(b)  (- cos(a) - 2) sin(b) ]
98                   [                                        ]
99 (%o39)            [ - sin(a) sin(b)   (cos(a) + 2) cos(b)  ]
100                   [                                        ]
101                   [     cos(a)                 0           ]
102 (%i40) trigsimp(m.diag([1,1/(cos(a)+2)]));
103                          [ - sin(a) cos(b)  - sin(b) ]
104                          [                           ]
105 (%o40)                   [ - sin(a) sin(b)   cos(b)  ]
106                          [                           ]
107                          [     cos(a)          0     ]
108 (%i41) trigsimp(add_tan(%));
109                 [ - sin(a) cos(b)  - sin(b)  - cos(a) cos(b) ]
110                 [                                            ]
111 (%o41)          [ - sin(a) sin(b)   cos(b)   - cos(a) sin(b) ]
112                 [                                            ]
113                 [     cos(a)          0         - sin(a)     ]
114 (%i42) transpose(%).d(%)$
115        
116 (%i43) trigsimp(%);
117 /*this is ¦¸ in Flanders P41 but transposed */
118                     [      0       sin(a) Db     - Da     ]
119                     [                                     ]
120 (%o43)              [ - sin(a) Db      0      - cos(a) Db ]
121                     [                                     ]
122                     [     Da       cos(a) Db       0      ]
123 (%i44) map("*",scale_factor,basis);
124 /*this is [sigma1,sigma2] in Flanders P41 but transposed */
125 (%o44)                   [Da, (cos(a) + 2) Db]
126 (%i45) basis;
127 (%o45)                             [Da, Db]
128 (%i46) scale_factor;
129 (%o46)                          [1, cos(a) + 2]
131 /*Gaussian curvature K is K*sigma1@aigma2=w1@w2
132 now w1=-Da,w2=-cos(a)*Db,and %o44 so K=cos(a)/(2+cos(a))
133 0<=a<2%pi,0<=b<2%pi,integrate K on this torous,
134 cos(a)/(2+cos(a)) *(2+cos(a))*Da@Db is equal cos(a)Da@Db
135 on 0<=a<2%pi,0<=b<2%pi ,apparently this is 0.
136 Theory says integrate K on total surface is 2*%pi*¦Ö 
137 ¦Ö is euler character,torous's character is 0 */
140 /* d(¦¸)=-¦¸.¦¸ ,this style is Darling,Flanderse style is transpose
141 transpose(d(omega))=d(transpose(omega))=-(transpose(omega).transpose(omega))
142 obviously AL:transpose(omega)=-omega,d(AL)=AL.AL */
144 (%i47) d(%o43)+%o43.%o43;
145                                   [ 0  0  0 ]
146                                   [         ]
147 (%o47)                            [ 0  0  0 ]
148                                   [         ]
149                                   [ 0  0  0 ]