EXCALC.LOG 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. *** ^ redefined
  3. % Problem: Calculate the PDE's for the isovector of the heat equation.
  4. % --------
  5. % (c.f. B.K. Harrison, f.B. Estabrook, "Geometric Approach...",
  6. % J. Math. Phys. 12, 653, 1971)
  7. % The heat equation @ psi = @ psi is equivalent to the set of exterior
  8. % xx t
  9. % equations (with u=@ psi, y=@ psi):
  10. % T x
  11. pform {psi,u,x,y,t}=0,a=1,{da,b}=2;
  12. a := d psi - u*d t - y*d x;
  13. a := d psi - d t*u - d x*y
  14. da := - d u^d t - d y^d x;
  15. da := d t^d u + d x^d y
  16. b := u*d x^d t - d y^d t;
  17. b := - d t^d x*u + d t^d y
  18. % Now calculate the PDE's for the isovector.
  19. tvector v;
  20. pform {vpsi,vt,vu,vx,vy}=0;
  21. fdomain vpsi=vpsi(psi,t,u,x,y),vt=vt(psi,t,u,x,y),vu=vu(psi,t,u,x,y),
  22. vx=vx(psi,t,u,x,y),vy=vy(psi,t,u,x,y);
  23. v := vpsi*@ psi + vt*@ t + vu*@ u + vx*@ x + vy*@ y;
  24. v := @ *vpsi + @ *vt + @ *vu + @ *vx + @ *vy
  25. psi t u x y
  26. factor d;
  27. on rat;
  28. i1 := v |_ a - l*a;
  29. i1 := d psi*(@ vpsi - @ vt*u - @ vx*y - l)
  30. psi psi psi
  31. + d t*(@ vpsi - @ vt*u - @ vx*y + l*u - vu)
  32. t t t
  33. + d u*(@ vpsi - @ vt*u - @ vx*y)
  34. u u u
  35. + d x*(@ vpsi - @ vt*u - @ vx*y + l*y - vy)
  36. x x x
  37. + d y*(@ vpsi - @ vt*u - @ vx*y)
  38. y y y
  39. pform o=1;
  40. o := ot*d t + ox*d x + ou*d u + oy*d y;
  41. o := d t*ot + d u*ou + d x*ox + d y*oy
  42. fdomain f=f(psi,t,u,x,y);
  43. i11 := v _| d a - l*a + d f;
  44. i11 := - d psi*l + d t*(l*u - vu) + d u*vt + d x*(l*y - vy) + d y*vx
  45. let vx=-@(f,y),vt=-@(f,u),vu=@(f,t)+u*@(f,psi),vy=@(f,x)+y*@(f,psi),
  46. vpsi=f-u*@(f,u)-y*@(f,y);
  47. factor ^;
  48. i2 := v |_ b - xi*b - o^a + zeta*da;
  49. i2 := d psi^d t*( - @ f*y - @ f - @ f*u + ot) + d psi^d u*ou
  50. psi psi psi x psi y
  51. + d psi^d x*(@ f*u + ox) + d psi^d y*( - @ f + oy)
  52. psi u psi u
  53. + d t^d u*(@ f*y + @ f + @ f*u - ou*u + zeta) + d t^d x*(
  54. psi u u x u y
  55. @ f*y - @ f*u + @ f*u - @ f + @ f + @ f*u + ot*y - ox*u
  56. psi x psi t u t x x x y
  57. + u*xi)
  58. + d t^d y*(@ f*y + @ f - @ f + @ f + @ f*u - oy*u - xi)
  59. psi y psi t u x y y y
  60. + d u^d x*(@ f*u + ou*y) - d u^d y*@ f
  61. u u u u
  62. + d x^d y*( - @ f - @ f*u - oy*y + zeta)
  63. u x u y
  64. let ou=0,oy=@(f,u,psi),ox=-u*@(f,u,psi),
  65. ot=@(f,x,psi)+u*@(f,y,psi)+y*@(f,psi,psi);
  66. i2;
  67. 2
  68. d t^d u*(@ f*y + @ f + @ f*u + zeta) + d t^d x*(@ f*y
  69. psi u u x u y psi psi
  70. 2
  71. + @ f*u + 2*@ f*y + @ f*u*y - @ f*u + @ f*u - @ f + @ f
  72. psi u psi x psi y psi t u t x x
  73. + @ f*u + u*xi)
  74. x y
  75. + d t^d y*( - @ f*u + @ f*y + @ f - @ f + @ f + @ f*u - xi)
  76. psi u psi y psi t u x y y y
  77. + d u^d x*@ f*u - d u^d y*@ f
  78. u u u u
  79. + d x^d y*( - @ f*y - @ f - @ f*u + zeta)
  80. psi u u x u y
  81. let zeta=-@(f,u,x)-@(f,u,y)*u-@(f,u,psi)*y;
  82. i2;
  83. 2 2
  84. d t^d x*(@ f*y + @ f*u + 2*@ f*y + @ f*u*y - @ f*u
  85. psi psi psi u psi x psi y psi
  86. + @ f*u - @ f + @ f + @ f*u + u*xi)
  87. t u t x x x y
  88. + d t^d y*( - @ f*u + @ f*y + @ f - @ f + @ f + @ f*u - xi)
  89. psi u psi y psi t u x y y y
  90. + d u^d x*@ f*u - d u^d y*@ f - 2*d x^d y*(@ f*y + @ f + @ f*u)
  91. u u u u psi u u x u y
  92. let xi=-@(f,t,u)-u*@(f,u,psi)+@(f,x,y)+u*@(f,y,y)+y*@(f,y,psi)+@(f,psi);
  93. i2;
  94. 2
  95. d t^d x*(@ f*y + 2*@ f*y + 2*@ f*u*y - @ f + @ f + 2*@ f*u
  96. psi psi psi x psi y t x x x y
  97. 2
  98. + @ f*u ) + d u^d x*@ f*u - d u^d y*@ f
  99. y y u u u u
  100. - 2*d x^d y*(@ f*y + @ f + @ f*u)
  101. psi u u x u y
  102. let @(f,u,u)=0;
  103. i2;
  104. 2
  105. d t^d x*(@ f*y + 2*@ f*y + 2*@ f*u*y - @ f + @ f + 2*@ f*u
  106. psi psi psi x psi y t x x x y
  107. 2
  108. + @ f*u ) - 2*d x^d y*(@ f*y + @ f + @ f*u)
  109. y y psi u u x u y
  110. % These PDE's have to be solved.
  111. clear a,da,b,v,i1,i11,o,i2,xi,t;
  112. remfdomain f,vpsi,vt,vu,vx,vy;
  113. clear @(f,u,u);
  114. % Problem:
  115. % --------
  116. % Calculate the integrability conditions for the system of PDE's:
  117. % (c.f. B.F. Schutz, "Geometrical Methods of Mathematical Physics"
  118. % Cambridge University Press, 1984, p. 156)
  119. % @ z /@ x + a1*z + b1*z = c1
  120. % 1 1 2
  121. % @ z /@ y + a2*z + b2*z = c2
  122. % 1 1 2
  123. % @ z /@ x + f1*z + g1*z = h1
  124. % 2 1 2
  125. % @ z /@ y + f2*z + g2*z = h2
  126. % 2 1 2 ;
  127. pform w(k)=1,integ(k)=4,{z(k),x,y}=0,{a,b,c,f,g,h}=1,
  128. {a1,a2,b1,b2,c1,c2,f1,f2,g1,g2,h1,h2}=0;
  129. fdomain a1=a1(x,y),a2=a2(x,y),b1=b1(x,y),b2=b2(x,y),
  130. c1=c1(x,y),c2=c2(x,y),f1=f1(x,y),f2=f2(x,y),
  131. g1=g1(x,y),g2=g2(x,y),h1=h1(x,y),h2=h2(x,y);
  132. a:=a1*d x+a2*d y$
  133. b:=b1*d x+b2*d y$
  134. c:=c1*d x+c2*d y$
  135. f:=f1*d x+f2*d y$
  136. g:=g1*d x+g2*d y$
  137. h:=h1*d x+h2*d y$
  138. % The equivalent exterior system:
  139. factor d;
  140. w(1) := d z(-1) + z(-1)*a + z(-2)*b - c;
  141. 1
  142. w := d z + d x*(z *a1 + z *b1 - c1) + d y*(z *a2 + z *b2 - c2)
  143. 1 1 2 1 2
  144. w(2) := d z(-2) + z(-1)*f + z(-2)*g - h;
  145. 2
  146. w := d z + d x*(z *f1 + z *g1 - h1) + d y*(z *f2 + z *g2 - h2)
  147. 2 1 2 1 2
  148. indexrange 1,2;
  149. factor z;
  150. % The integrability conditions:
  151. integ(k) := d w(k) ^ w(1) ^ w(2);
  152. 1
  153. integ := d z ^d z ^d x^d y*z *( - @ a1 + @ a2 + b1*f2 - b2*f1) +
  154. 1 2 1 y x
  155. d z ^d z ^d x^d y*z *( - @ b1 + @ b2 + a1*b2 - a2*b1 + b1*g2 - b2*g1)
  156. 1 2 2 y x
  157. + d z ^d z ^d x^d y*(@ c1 - @ c2 - a1*c2 + a2*c1 - b1*h2 + b2*h1)
  158. 1 2 y x
  159. 2
  160. integ := d z ^d z ^d x^d y*z *( - @ f1 + @ f2 - a1*f2 + a2*f1 - f1*g2 + f2*g1)
  161. 1 2 1 y x
  162. + d z ^d z ^d x^d y*z *( - @ g1 + @ g2 - b1*f2 + b2*f1)
  163. 1 2 2 y x
  164. + d z ^d z ^d x^d y*(@ h1 - @ h2 + c1*f2 - c2*f1 - g1*h2 + g2*h1)
  165. 1 2 y x
  166. clear a,b,c,f,g,h,x,y,w(k),integ(k),z(k);
  167. remfdomain a1,a2,b1,c1,c2,f1,f2,g1,g2,h1,h2;
  168. % Problem:
  169. % --------
  170. % Calculate the PDE's for the generators of the d-theta symmetries of
  171. % the Lagrangian system of the planar Kepler problem.
  172. % c.f. W.Sarlet, F.Cantrijn, Siam Review 23, 467, 1981
  173. % Verify that time translation is a d-theta symmetry and calculate the
  174. % corresponding integral.
  175. pform {t,q(k),v(k),lam(k),tau,xi(k),eta(k)}=0,theta=1,f=0,
  176. {l,glq(k),glv(k),glt}=0;
  177. tvector gam,y;
  178. indexrange 1,2;
  179. fdomain tau=tau(t,q(k),v(k)),xi=xi(t,q(k),v(k)),f=f(t,q(k),v(k));
  180. l := 1/2*(v(1)**2 + v(2)**2) + m/r$
  181. % The Lagrangian.
  182. pform r=0;
  183. fdomain r=r(q(k));
  184. let @(r,q 1)=q(1)/r,@(r,q 2)=q(2)/r,q(1)**2+q(2)**2=r**2;
  185. lam(k) := -m*q(k)/r;
  186. 1
  187. 1 - q *m
  188. lam := ---------
  189. r
  190. 2
  191. 2 - q *m
  192. lam := ---------
  193. r
  194. % The force.
  195. gam := @ t + v(k)*@(q(k)) + lam(k)*@(v(k))$
  196. eta(k) := gam _| d xi(k) - v(k)*gam _| d tau$
  197. y := tau*@ t + xi(k)*@(q(k)) + eta(k)*@(v(k))$
  198. % Symmetry generator.
  199. theta := l*d t + @(l,v(k))*(d q(k) - v(k)*d t)$
  200. factor @;
  201. s := y |_ theta - d f$
  202. glq(k) := @(q k) _| s;
  203. 1 1 1 2
  204. - @ (xi )*q *m - @ (xi )*q *m
  205. 1 2
  206. 1 1 1 1 2 v v
  207. glq := 2*@ (xi )*v + @ (xi )*v + ------------------ + ------------------
  208. 1 2 r r
  209. q q
  210. 1 2 2
  211. + @ (xi ) + @ (xi )*v - @ f
  212. t 1 1
  213. q q
  214. 1 2 2 2
  215. @ tau*( - 3*(v ) *r - (v ) *r + 2*m)
  216. 1
  217. q 1 2
  218. + --------------------------------------- - @ tau*v *v
  219. 2*r 2
  220. q
  221. 1 1 2 1
  222. @ tau*q *v *m @ tau*q *v *m
  223. 1 2
  224. v v 1
  225. + ---------------- + ---------------- - @ tau*v
  226. r r t
  227. 2 1
  228. - @ (xi )*q *m
  229. 1
  230. 2 1 1 2 1 2 2 v
  231. glq := @ (xi )*v + @ (xi )*v + 2*@ (xi )*v + ------------------
  232. 2 1 2 r
  233. q q q
  234. 2 2
  235. - @ (xi )*q *m
  236. 2
  237. v 2 1 2
  238. + ------------------ + @ (xi ) - @ f - @ tau*v *v
  239. r t 2 1
  240. q q
  241. 1 2 2 2 1 2
  242. @ tau*( - (v ) *r - 3*(v ) *r + 2*m) @ tau*q *v *m
  243. 2 1
  244. q v
  245. + --------------------------------------- + ----------------
  246. 2*r r
  247. 2 2
  248. @ tau*q *v *m
  249. 2
  250. v 2
  251. + ---------------- - @ tau*v
  252. r t
  253. glv(k) := @(v k) _| s;
  254. 1 2 2 2
  255. @ tau*( - (v ) *r - (v ) *r + 2*m)
  256. 1
  257. 1 1 1 2 2 v
  258. glv := @ (xi )*v + @ (xi )*v - @ f + -------------------------------------
  259. 1 1 1 2*r
  260. v v v
  261. 1 2 2 2
  262. @ tau*( - (v ) *r - (v ) *r + 2*m)
  263. 2
  264. 2 1 1 2 2 v
  265. glv := @ (xi )*v + @ (xi )*v - @ f + -------------------------------------
  266. 2 2 2 2*r
  267. v v v
  268. glt := @(t) _| s;
  269. 1 1 1
  270. @ (xi )*q *v *m
  271. 1
  272. 1 1 2 1 1 2 v
  273. glt := - @ (xi )*(v ) - @ (xi )*v *v + ------------------
  274. 1 2 r
  275. q q
  276. 1 2 1
  277. @ (xi )*q *v *m
  278. 2
  279. v 2 1 2 2 2 2
  280. + ------------------ - @ (xi )*v *v - @ (xi )*(v )
  281. r 1 2
  282. q q
  283. 2 1 2 2 2 2
  284. @ (xi )*q *v *m @ (xi )*q *v *m
  285. 1 2
  286. v v
  287. + ------------------ + ------------------ - @ f
  288. r r t
  289. 1 1 2 2 2 2 1 2 2 2
  290. + @ tau*v *((v ) + (v ) ) + @ tau*v *((v ) + (v ) )
  291. 1 2
  292. q q
  293. 1 1 2 2 2 2 1 2 2 2
  294. @ tau*q *m*((v ) + (v ) ) @ tau*q *m*((v ) + (v ) )
  295. 1 2
  296. v v
  297. - ----------------------------- - -----------------------------
  298. r r
  299. 1 2 2 2
  300. @ tau*((v ) *r + (v ) *r + 2*m) 1 1 2 2
  301. t m*(q *xi + q *xi )
  302. + --------------------------------- - ---------------------
  303. 2*r 3
  304. r
  305. % Translation in time must generate a symmetry.
  306. xi(k) := 0;
  307. k
  308. xi := 0
  309. tau := 1;
  310. tau := 1
  311. glq k := glq k;
  312. 1
  313. glq := - @ f
  314. 1
  315. q
  316. 2
  317. glq := - @ f
  318. 2
  319. q
  320. glv k := glv k;
  321. 1
  322. glv := - @ f
  323. 1
  324. v
  325. 2
  326. glv := - @ f
  327. 2
  328. v
  329. glt;
  330. - @ f
  331. t
  332. % The corresponding integral is of course the energy.
  333. integ := - y _| theta;
  334. 1 2 2 2
  335. (v ) *r + (v ) *r - 2*m
  336. integ := -------------------------
  337. 2*r
  338. clear l,lam k,gam,eta k,y,theta,s,glq k,glv k,glt,t,q k,v k,tau,xi k;
  339. remfdomain r,f,tau,xi;
  340. % Problem:
  341. % --------
  342. % Calculate the "gradient" and "Laplacian" of a function and the "curl"
  343. % and "divergence" of a one-form in elliptic coordinates.
  344. coframe e u = sqrt(cosh(v)**2 - sin(u)**2)*d u,
  345. e v = sqrt(cosh(v)**2 - sin(u)**2)*d v,
  346. e phi = cos u*sinh v*d phi;
  347. pform f=0;
  348. fdomain f=f(u,v,phi);
  349. factor e,^;
  350. on rat,gcd;
  351. order cosh v, sin u;
  352. % The gradient:
  353. d f;
  354. phi u v
  355. @ f*e @ f*e @ f*e
  356. phi u v
  357. ---------------- + -------------------------- + --------------------------
  358. cos(u)*sinh(v) 2 2 2 2
  359. sqrt(cosh(v) - sin(u) ) sqrt(cosh(v) - sin(u) )
  360. factor @;
  361. % The Laplacian:
  362. # d # d f;
  363. @ f @ f @ f*sin(u)
  364. phi phi u u u
  365. ------------------ + -------------------- - -----------------------------
  366. 2 2 2 2 2 2
  367. cos(u) *sinh(v) cosh(v) - sin(u) cos(u)*(cosh(v) - sin(u) )
  368. @ f @ f*cosh(v)
  369. v v v
  370. + -------------------- + ------------------------------
  371. 2 2 2 2
  372. cosh(v) - sin(u) sinh(v)*(cosh(v) - sin(u) )
  373. % Another way of calculating the Laplacian:
  374. -#vardf(1/2*d f^#d f,f);
  375. @ f @ f @ f*sin(u)
  376. phi phi u u u
  377. ------------------ + -------------------- - -----------------------------
  378. 2 2 2 2 2 2
  379. cos(u) *sinh(v) cosh(v) - sin(u) cos(u)*(cosh(v) - sin(u) )
  380. @ f @ f*cosh(v)
  381. v v v
  382. + -------------------- + ------------------------------
  383. 2 2 2 2
  384. cosh(v) - sin(u) sinh(v)*(cosh(v) - sin(u) )
  385. remfac @;
  386. % Now calculate the "curl" and the "divergence" of a one-form.
  387. pform w=1,a(k)=0;
  388. fdomain a=a(u,v,phi);
  389. w := a(-k)*e k;
  390. phi u v
  391. w := e *a + e *a + e *a
  392. phi u v
  393. % The curl:
  394. x := # d w;
  395. phi 2 2
  396. x := (e *( - cosh(v) *@ (a ) + cosh(v) *@ (a ) - cosh(v)*a *sinh(v)
  397. v u u v u
  398. 2 2
  399. + sin(u) *@ (a ) - sin(u) *@ (a ) - sin(u)*a *cos(u)))/(
  400. v u u v v
  401. 2 2 2 2 u
  402. sqrt(cosh(v) - sin(u) )*(cosh(v) - sin(u) )) + (e *(
  403. cosh(v)*a *cos(u) + cos(u)*@ (a )*sinh(v)
  404. phi v phi
  405. 2 2 2 2
  406. - sqrt(cosh(v) - sin(u) )*@ (a )))/(sqrt(cosh(v) - sin(u) )
  407. phi v
  408. v
  409. *cos(u)*sinh(v)) + (e *(sin(u)*a *sinh(v) - cos(u)*@ (a )*sinh(v)
  410. phi u phi
  411. 2 2 2 2
  412. + sqrt(cosh(v) - sin(u) )*@ (a )))/(sqrt(cosh(v) - sin(u) )
  413. phi u
  414. *cos(u)*sinh(v))
  415. factor @;
  416. % The divergence:
  417. y := # d # w;
  418. @ (a ) @ (a ) @ (a )
  419. phi phi u u v v
  420. y := ---------------- + -------------------------- + --------------------------
  421. cos(u)*sinh(v) 2 2 2 2
  422. sqrt(cosh(v) - sin(u) ) sqrt(cosh(v) - sin(u) )
  423. 3 2
  424. + (cosh(v) *a *cos(u) - cosh(v) *sin(u)*a *sinh(v)
  425. v u
  426. 2 2
  427. - cosh(v)*sin(u) *a *cos(u) + cosh(v)*a *cos(u)*sinh(v)
  428. v v
  429. 3 2
  430. + sin(u) *a *sinh(v) - sin(u)*a *cos(u) *sinh(v))/(
  431. u u
  432. 2 2 2 2
  433. sqrt(cosh(v) - sin(u) )*cos(u)*sinh(v)*(cosh(v) - sin(u) ))
  434. remfac @;
  435. clear x,y,w,u,v,phi,e k,a k;
  436. remfdomain a,f;
  437. % Problem:
  438. % --------
  439. % Calculate in a spherical coordinate system the Navier Stokes equations.
  440. coframe e r=d r, e theta =r*d theta, e phi = r*sin theta *d phi;
  441. frame x;
  442. fdomain v=v(t,r,theta,phi),p=p(r,theta,phi);
  443. pform v(k)=0,p=0,w=1;
  444. % We first calculate the convective derivative.
  445. w := v(-k)*e(k)$
  446. factor e;
  447. on rat;
  448. cdv := @(w,t) + (v(k)*x(-k)) |_ w - 1/2*d(v(k)*v(-k));
  449. phi
  450. cdv := (e *(cos(theta)*v *v + @ (v )*v
  451. phi theta phi phi phi
  452. + @ (v )*sin(theta)*v *r + @ (v )*sin(theta)*r
  453. r phi r t phi
  454. + @ (v )*sin(theta)*v + sin(theta)*v *v ))/(
  455. theta phi theta phi r
  456. r
  457. sin(theta)*r) + (e *(@ (v )*v + @ (v )*sin(theta)*v *r
  458. phi r phi r r r
  459. + @ (v )*sin(theta)*r + @ (v )*sin(theta)*v
  460. t r theta r theta
  461. 2 2
  462. - sin(theta)*(v ) - sin(theta)*(v ) ))/(sin(theta)*r) + (
  463. phi theta
  464. theta 2
  465. e *( - cos(theta)*(v ) + @ (v )*v
  466. phi phi theta phi
  467. + @ (v )*sin(theta)*v *r + @ (v )*sin(theta)*r
  468. r theta r t theta
  469. + @ (v )*sin(theta)*v + sin(theta)*v *v ))/(
  470. theta theta theta r theta
  471. sin(theta)*r)
  472. %next we calculate the viscous terms;
  473. visc := nu*(d#d# w - #d#d w) + mu*d#d# w;
  474. phi 2
  475. visc := (e *( - cos(theta) *v *nu + cos(theta)*@ (v )*sin(theta)*nu
  476. phi theta phi
  477. + cos(theta)*@ (v )*mu + 2*cos(theta)*@ (v )*nu
  478. phi theta phi theta
  479. + @ (v )*mu + @ (v )*nu
  480. phi phi phi phi phi phi
  481. 2 2 2
  482. + @ (v )*sin(theta) *nu*r + 2*@ (v )*sin(theta) *nu*r
  483. r r phi r phi
  484. 2
  485. + @ (v )*sin(theta) *nu + @ (v )*sin(theta)*mu*r
  486. theta theta phi phi r r
  487. + 2*@ (v )*sin(theta)*mu + 2*@ (v )*sin(theta)*nu
  488. phi r phi r
  489. 2
  490. + @ (v )*sin(theta)*mu - sin(theta) *v *nu))/(
  491. phi theta theta phi
  492. 2 2 r
  493. sin(theta) *r ) + (e *(cos(theta)*@ (v )*sin(theta)*nu
  494. theta r
  495. + cos(theta)*@ (v )*sin(theta)*mu*r
  496. r theta
  497. - cos(theta)*sin(theta)*v *mu
  498. theta
  499. - 2*cos(theta)*sin(theta)*v *nu
  500. theta
  501. + @ (v )*sin(theta)*mu*r - @ (v )*sin(theta)*mu
  502. phi r phi phi phi
  503. - 2*@ (v )*sin(theta)*nu + @ (v )*nu
  504. phi phi phi phi r
  505. 2 2 2 2
  506. + @ (v )*sin(theta) *mu*r + @ (v )*sin(theta) *nu*r
  507. r r r r r r
  508. 2 2
  509. + 2*@ (v )*sin(theta) *mu*r + 2*@ (v )*sin(theta) *nu*r
  510. r r r r
  511. 2
  512. + @ (v )*sin(theta) *nu
  513. theta theta r
  514. 2
  515. + @ (v )*sin(theta) *mu*r
  516. r theta theta
  517. 2 2
  518. - @ (v )*sin(theta) *mu - 2*@ (v )*sin(theta) *nu
  519. theta theta theta theta
  520. 2 2 2 2
  521. - 2*sin(theta) *v *mu - 2*sin(theta) *v *nu))/(sin(theta) *r ) +
  522. r r
  523. theta 2 2
  524. (e *( - cos(theta) *v *mu - cos(theta) *v *nu
  525. theta theta
  526. - cos(theta)*@ (v )*mu - 2*cos(theta)*@ (v )*nu
  527. phi phi phi phi
  528. + cos(theta)*@ (v )*sin(theta)*mu
  529. theta theta
  530. + cos(theta)*@ (v )*sin(theta)*nu
  531. theta theta
  532. + @ (v )*sin(theta)*mu
  533. phi theta phi
  534. 2 2
  535. + @ (v )*sin(theta) *mu*r + 2*@ (v )*sin(theta) *mu
  536. r theta r theta r
  537. 2
  538. + 2*@ (v )*sin(theta) *nu + @ (v )*nu
  539. theta r phi phi theta
  540. 2 2
  541. + @ (v )*sin(theta) *nu*r
  542. r r theta
  543. 2
  544. + 2*@ (v )*sin(theta) *nu*r
  545. r theta
  546. 2
  547. + @ (v )*sin(theta) *mu
  548. theta theta theta
  549. 2 2
  550. + @ (v )*sin(theta) *nu - sin(theta) *v *mu
  551. theta theta theta theta
  552. 2 2 2
  553. - sin(theta) *v *nu))/(sin(theta) *r )
  554. theta
  555. % Finally we add the pressure term and print the components of the
  556. % whole equation.
  557. pform nasteq=1,nast(k)=0;
  558. nasteq := cdv - visc + 1/rho*d p$
  559. factor @;
  560. nast(-k) := x(-k) _| nasteq;
  561. - @ (v )*mu @ (v )*(mu + 2*nu) - @ (v )*nu
  562. phi r phi phi phi phi phi r
  563. nast := -------------------- + ------------------------ + --------------------
  564. r sin(theta)*r 2 2 2
  565. sin(theta)*r sin(theta) *r
  566. @ (v )*v @ (v )*(v *r - 2*mu - 2*nu)
  567. phi r phi r r r
  568. + --------------- - @ (v )*(mu + nu) + -----------------------------
  569. sin(theta)*r r r r r
  570. - @ (v )*nu
  571. theta theta r
  572. + @ (v ) + ------------------------
  573. t r 2
  574. r
  575. @ (v )*( - cos(theta)*nu + sin(theta)*v *r)
  576. theta r theta
  577. + -----------------------------------------------------
  578. 2
  579. sin(theta)*r
  580. - @ (v )*mu - @ (v )*cos(theta)*mu
  581. r theta theta r theta
  582. + ------------------------ + -----------------------------
  583. r sin(theta)*r
  584. @ (v )*(mu + 2*nu) @ p
  585. theta theta r
  586. + ---------------------------- + ----- + (cos(theta)*v *mu
  587. 2 rho theta
  588. r
  589. 2
  590. + 2*cos(theta)*v *nu - sin(theta)*(v ) *r
  591. theta phi
  592. 2
  593. + 2*sin(theta)*v *mu + 2*sin(theta)*v *nu - sin(theta)*(v ) *r)
  594. r r theta
  595. 2
  596. /(sin(theta)*r )
  597. - @ (v )*mu @ (v )*cos(theta)*(mu + 2*nu)
  598. phi theta phi phi phi
  599. nast := ------------------------ + -----------------------------------
  600. theta 2 2 2
  601. sin(theta)*r sin(theta) *r
  602. - @ (v )*mu 2*@ (v )*(mu + nu)
  603. r theta r theta r
  604. + -------------------- - ------------------------
  605. r 2
  606. r
  607. - @ (v )*nu @ (v )*v
  608. phi phi theta phi theta phi
  609. + ------------------------ + ------------------- - @ (v )*nu
  610. 2 2 sin(theta)*r r r theta
  611. sin(theta) *r
  612. @ (v )*(v *r - 2*nu)
  613. r theta r
  614. + -------------------------- + @ (v )
  615. r t theta
  616. @ (v )*(mu + nu)
  617. theta theta theta
  618. - -------------------------------- + (@ (v )
  619. 2 theta theta
  620. r
  621. *( - cos(theta)*mu - cos(theta)*nu + sin(theta)*v *r))/(
  622. theta
  623. @ p
  624. 2 theta 2
  625. sin(theta)*r ) + --------- + (cos(theta) *v *mu
  626. r*rho theta
  627. 2 2
  628. + cos(theta) *v *nu - cos(theta)*sin(theta)*(v ) *r
  629. theta phi
  630. 2 2
  631. + sin(theta) *v *v *r + sin(theta) *v *mu
  632. r theta theta
  633. 2 2 2
  634. + sin(theta) *v *nu)/(sin(theta) *r )
  635. theta
  636. @ (v )*(mu + nu) @ (v )*v
  637. phi phi phi phi phi phi
  638. nast := - -------------------------- + ----------------- - @ (v )*nu
  639. phi 2 2 sin(theta)*r r r phi
  640. sin(theta) *r
  641. @ (v )*(v *r - 2*nu) - @ (v )*nu
  642. r phi r theta theta phi
  643. + ------------------------ + @ (v ) + --------------------------
  644. r t phi 2
  645. r
  646. @ (v )*( - cos(theta)*nu + sin(theta)*v *r)
  647. theta phi theta
  648. + -------------------------------------------------------
  649. 2
  650. sin(theta)*r
  651. - @ (v )*mu 2*@ (v )*(mu + nu)
  652. phi r r phi r
  653. + ------------------ - ----------------------
  654. sin(theta)*r 2
  655. sin(theta)*r
  656. - @ (v )*mu
  657. phi theta theta
  658. + --------------------------
  659. 2
  660. sin(theta)*r
  661. @ (v )*cos(theta)*( - mu - 2*nu) @ p
  662. phi theta phi
  663. + ---------------------------------------- + ------------------ + (
  664. 2 2 sin(theta)*r*rho
  665. sin(theta) *r
  666. 2
  667. v *(cos(theta) *nu + cos(theta)*sin(theta)*v *r
  668. phi theta
  669. 2 2 2 2
  670. + sin(theta) *v *r + sin(theta) *nu))/(sin(theta) *r )
  671. r
  672. remfac @,e;
  673. clear v k,x k,nast k,cdv,visc,p,w,nasteq,e k;
  674. remfdomain p,v;
  675. % Problem:
  676. % --------
  677. % Calculate from the Lagrangian of a vibrating rod the equation of
  678. % motion and show that the invariance under time translation leads
  679. % to a conserved current.
  680. pform {y,x,t,q,j}=0,lagr=2;
  681. fdomain y=y(x,t),q=q(x),j=j(x);
  682. factor ^;
  683. lagr := 1/2*(rho*q*@(y,t)**2 - e*j*@(y,x,x)**2)*d x^d t;
  684. 2 2
  685. d t^d x*( - @ y *q*rho + @ y *e*j)
  686. t x x
  687. lagr := --------------------------------------
  688. 2
  689. vardf(lagr,y);
  690. d t^d x*(@ j*@ y*e + 2*@ j*@ y*e + @ y*q*rho + @ y*e*j)
  691. x x x x x x x x t t x x x x
  692. % The Lagrangian does not explicitly depend on time; therefore the
  693. % vector field @ t generates a symmetry. The conserved current is
  694. pform c=1;
  695. factor d;
  696. c := noether(lagr,y,@ t);
  697. c := d t*e*(@ j*@ y*@ y - @ y*@ y*j + @ y*@ y*j)
  698. x t x x t x x x t x x x
  699. 2 2
  700. d x*(@ y *q*rho + @ y *e*j)
  701. t x x
  702. - -------------------------------
  703. 2
  704. % The exterior derivative of this must be zero or a multiple of the
  705. % equation of motion (weak conservation law) to be a conserved current.
  706. remfac d;
  707. d c;
  708. d t^d x*@ y*( - @ j*@ y*e - 2*@ j*@ y*e - @ y*q*rho - @ y*e*j)
  709. t x x x x x x x x t t x x x x
  710. % i.e. it is a multiple of the equation of motion.
  711. clear lagr,c,j,y,q;
  712. remfdomain y,q,j;
  713. % Problem:
  714. % --------
  715. % Show that the metric structure given by Eguchi and Hanson induces a
  716. % self-dual curvature.
  717. % c.f. T. Eguchi, P.B. Gilkey, A.J. Hanson, "Gravitation, Gauge Theories
  718. % and Differential Geometry", Physics Reports 66, 213, 1980
  719. for all x let cos(x)**2=1-sin(x)**2;
  720. pform f=0,g=0;
  721. fdomain f=f(r), g=g(r);
  722. coframe o(r) = f*d r,
  723. o(theta) = (r/2)*(sin(psi)*d theta - sin(theta)*cos(psi)*d phi),
  724. o(phi) = (r/2)*(-cos(psi)*d theta - sin(theta)*sin(psi)*d phi),
  725. o(psi) = (r/2)*g*(d psi + cos(theta)*d phi);
  726. frame e;
  727. pform gamma(a,b)=1,curv2(a,b)=2;
  728. index_symmetries gamma(a,b),curv2(a,b): antisymmetric;
  729. factor o;
  730. gamma(-a,-b) := -(1/2)*( e(-a) _| (e(-c) _| (d o(-b)))
  731. -e(-b) _| (e(-a) _| (d o(-c)))
  732. +e(-c) _| (e(-b) _| (d o(-a))) )*o(c)$
  733. curv2(-a,b) := d gamma(-a,b) + gamma(-c,b)^gamma(-a,c)$
  734. let f=1/g,g=sqrt(1-(a/r)**4);
  735. pform chck(k,l)=2;
  736. index_symmetries chck(k,l): antisymmetric;
  737. % The following has to be zero for a self-dual curvature.
  738. chck(k,l) := 1/2*eps(k,l,m,n)*curv2(-m,-n) + curv2(k,l);
  739. r theta
  740. chck := 0
  741. r phi
  742. chck := 0
  743. theta phi
  744. chck := 0
  745. r psi
  746. chck := 0
  747. theta psi
  748. chck := 0
  749. phi psi
  750. chck := 0
  751. clear gamma(a,b),curv2(a,b),f,g,chck(a,b),o(k),e(k),r,phi,psi;
  752. remfdomain f,g;
  753. % Example: 6-dimensional FRW model with quadratic curvature terms in
  754. % -------
  755. % the Lagrangian (Lanczos and Gauss-Bonnet terms).
  756. % cf. Henriques, Nuclear Physics, B277, 621 (1986)
  757. for all x let cos(x)**2+sin(x)**2=1;
  758. pform {r,s}=0;
  759. fdomain r=r(t),s=s(t);
  760. coframe o(t) = d t,
  761. o(1) = r*d u/(1 + k*(u**2)/4),
  762. o(2) = r*u*d theta/(1 + k*(u**2)/4),
  763. o(3) = r*u*sin(theta)*d phi/(1 + k*(u**2)/4),
  764. o(4) = s*d v1,
  765. o(5) = s*sin(v1)*d v2
  766. with metric g =-o(t)*o(t)+o(1)*o(1)+o(2)*o(2)+o(3)*o(3)
  767. +o(4)*o(4)+o(5)*o(5);
  768. frame e;
  769. on nero;
  770. factor o,^;
  771. riemannconx om;
  772. pform curv(k,l)=2,{riemann(a,b,c,d),ricci(a,b),riccisc}=0;
  773. index_symmetries curv(k,l): antisymmetric,
  774. riemann(k,l,m,n): antisymmetric in {k,l},{m,n}
  775. symmetric in {{k,l},{m,n}},
  776. ricci(k,l): symmetric;
  777. curv(k,l) := d om(k,l) + om(k,-m)^om(m,l);
  778. t 1
  779. o ^o *@ r
  780. t 1 t t
  781. curv := -------------
  782. r
  783. t 2
  784. o ^o *@ r
  785. t 2 t t
  786. curv := -------------
  787. r
  788. 1 2 2
  789. o ^o *(@ r + k)
  790. 1 2 t
  791. curv := ------------------
  792. 2
  793. r
  794. t 3
  795. o ^o *@ r
  796. t 3 t t
  797. curv := -------------
  798. r
  799. 1 3 2
  800. o ^o *(@ r + k)
  801. 1 3 t
  802. curv := ------------------
  803. 2
  804. r
  805. 2 3 2
  806. o ^o *(@ r + k)
  807. 2 3 t
  808. curv := ------------------
  809. 2
  810. r
  811. t 4
  812. o ^o *@ s
  813. t 4 t t
  814. curv := -------------
  815. s
  816. 1 4
  817. o ^o *@ r*@ s
  818. 1 4 t t
  819. curv := ---------------
  820. r*s
  821. 2 4
  822. o ^o *@ r*@ s
  823. 2 4 t t
  824. curv := ---------------
  825. r*s
  826. 3 4
  827. o ^o *@ r*@ s
  828. 3 4 t t
  829. curv := ---------------
  830. r*s
  831. t 5
  832. o ^o *@ s
  833. t 5 t t
  834. curv := -------------
  835. s
  836. 1 5
  837. o ^o *@ r*@ s
  838. 1 5 t t
  839. curv := ---------------
  840. r*s
  841. 2 5
  842. o ^o *@ r*@ s
  843. 2 5 t t
  844. curv := ---------------
  845. r*s
  846. 3 5
  847. o ^o *@ r*@ s
  848. 3 5 t t
  849. curv := ---------------
  850. r*s
  851. 4 5 2
  852. o ^o *(@ s + 1)
  853. 4 5 t
  854. curv := ------------------
  855. 2
  856. s
  857. riemann(a,b,c,d) := e(d) _| (e (c) _| curv(a,b));
  858. - @ r
  859. t 1 t 1 t t
  860. riemann := ----------
  861. r
  862. - @ r
  863. t 2 t 2 t t
  864. riemann := ----------
  865. r
  866. 2
  867. @ r + k
  868. 1 2 1 2 t
  869. riemann := ----------
  870. 2
  871. r
  872. - @ r
  873. t 3 t 3 t t
  874. riemann := ----------
  875. r
  876. 2
  877. @ r + k
  878. 1 3 1 3 t
  879. riemann := ----------
  880. 2
  881. r
  882. 2
  883. @ r + k
  884. 2 3 2 3 t
  885. riemann := ----------
  886. 2
  887. r
  888. - @ s
  889. t 4 t 4 t t
  890. riemann := ----------
  891. s
  892. @ r*@ s
  893. 1 4 1 4 t t
  894. riemann := ---------
  895. r*s
  896. @ r*@ s
  897. 2 4 2 4 t t
  898. riemann := ---------
  899. r*s
  900. @ r*@ s
  901. 3 4 3 4 t t
  902. riemann := ---------
  903. r*s
  904. - @ s
  905. t 5 t 5 t t
  906. riemann := ----------
  907. s
  908. @ r*@ s
  909. 1 5 1 5 t t
  910. riemann := ---------
  911. r*s
  912. @ r*@ s
  913. 2 5 2 5 t t
  914. riemann := ---------
  915. r*s
  916. @ r*@ s
  917. 3 5 3 5 t t
  918. riemann := ---------
  919. r*s
  920. 2
  921. @ s + 1
  922. 4 5 4 5 t
  923. riemann := ----------
  924. 2
  925. s
  926. % The rest is done in the Ricci calculus language,
  927. ricci(-a,-b) := riemann(c,-a,-d,-b)*g(-c,d);
  928. - 3*@ r*s - 2*@ s*r
  929. t t t t
  930. ricci := --------------------------
  931. t t r*s
  932. 2
  933. @ r*r*s + 2*@ r *s + 2*@ r*@ s*r + 2*k*s
  934. t t t t t
  935. ricci := --------------------------------------------
  936. 1 1 2
  937. r *s
  938. 2
  939. @ r*r*s + 2*@ r *s + 2*@ r*@ s*r + 2*k*s
  940. t t t t t
  941. ricci := --------------------------------------------
  942. 2 2 2
  943. r *s
  944. 2
  945. @ r*r*s + 2*@ r *s + 2*@ r*@ s*r + 2*k*s
  946. t t t t t
  947. ricci := --------------------------------------------
  948. 3 3 2
  949. r *s
  950. 2
  951. 3*@ r*@ s*s + @ s*r*s + @ s *r + r
  952. t t t t t
  953. ricci := --------------------------------------
  954. 4 4 2
  955. r*s
  956. 2
  957. 3*@ r*@ s*s + @ s*r*s + @ s *r + r
  958. t t t t t
  959. ricci := --------------------------------------
  960. 5 5 2
  961. r*s
  962. riccisc := ricci(-a,-b)*g(a,b);
  963. 2 2 2 2 2 2
  964. riccisc := (2*(3*@ r*r*s + 3*@ r *s + 6*@ r*@ s*r*s + 2*@ s*r *s + @ s *r
  965. t t t t t t t t
  966. 2 2 2 2
  967. + 3*k*s + r ))/(r *s )
  968. pform {laglanc,inv1,inv2} = 0;
  969. index_symmetries riemc3(k,l),riemri(k,l),
  970. hlang(k,l),einst(k,l): symmetric;
  971. pform {riemc3(i,j),riemri(i,j)}=0;
  972. riemc3(-i,-j) := riemann(-i,-k,-l,-m)*riemann(-j,k,l,m)$
  973. inv1 := riemc3(-i,-j)*g(i,j);
  974. 2 2 4 4 4 2 2 2 2 2 4
  975. inv1 := (4*(3*@ r *r *s + 3*@ r *s + 6*@ r *@ s *r *s + 6*@ r *k*s
  976. t t t t t t
  977. 2 4 2 4 4 2 4 2 4 4 4 4
  978. + 2*@ s *r *s + @ s *r + 2*@ s *r + 3*k *s + r ))/(r *s )
  979. t t t t
  980. riemri(-i,-j) := 2*riemann(-i,-k,-j,-l)*ricci(k,l)$
  981. inv2 := ricci(-a,-b)*ricci(a,b);
  982. 2 2 4 2 4 2 3
  983. inv2 := (2*(6*@ r *r *s + 6*@ r*@ r *r*s + 6*@ r*@ r*@ s*r *s
  984. t t t t t t t t t
  985. 3 3 4 4 4
  986. + 6*@ r*@ s*r *s + 6*@ r*k*r*s + 6*@ r *s
  987. t t t t t t t
  988. 3 3 2 2 2 2 2 4
  989. + 12*@ r *@ s*r*s + 15*@ r *@ s *r *s + 12*@ r *k*s
  990. t t t t t
  991. 3 2 3 3 3
  992. + 6*@ r*@ s*@ s*r *s + 6*@ r*@ s *r *s + 12*@ r*@ s*k*r*s
  993. t t t t t t t t
  994. 3 2 4 2 2 4
  995. + 6*@ r*@ s*r *s + 3*@ s *r *s + 2*@ s*@ s *r *s
  996. t t t t t t t
  997. 4 4 4 2 4 2 4 4 4 4
  998. + 2*@ s*r *s + @ s *r + 2*@ s *r + 6*k *s + r ))/(r *s )
  999. t t t t
  1000. laglanc := (1/2)*(inv1 - 4*inv2 + riccisc**2);
  1001. 2 2 2 2 2
  1002. laglanc := (12*(@ r*@ r *s + 4*@ r*@ r*@ s*r*s + @ r*@ s *r + @ r*k*s
  1003. t t t t t t t t t t t t
  1004. 2 3 2 2 2
  1005. + @ r*r + 2*@ r *@ s*s + 2*@ r *@ s*r*s + 3*@ r *@ s *r
  1006. t t t t t t t t t
  1007. 2 2
  1008. + @ r *r + 2*@ r*@ s*@ s*r + 2*@ r*@ s*k*s + 2*@ s*k*r*s
  1009. t t t t t t t t t
  1010. 2 3 2
  1011. + @ s *k*r + k*r))/(r *s )
  1012. t
  1013. pform {einst(a,b),hlang(a,b)}=0;
  1014. hlang(-i,-j) := 2*(riemc3(-i,-j) - riemri(-i,-j) -
  1015. 2*ricci(-i,-k)*ricci(-j,K) +
  1016. riccisc*ricci(-i,-j) - (1/2)*laglanc*g(-i,-j));
  1017. hlang :=
  1018. t t
  1019. 3 2 2 2 2
  1020. 12*(2*@ r *@ s*s + 3*@ r *@ s *r + @ r *r + 2*@ r*@ s*k*s + @ s *k*r + k*r)
  1021. t t t t t t t t
  1022. -----------------------------------------------------------------------------
  1023. 3 2
  1024. r *s
  1025. 2
  1026. hlang := (4*( - 4*@ r*@ r*@ s*s - 2*@ r*@ s *r - 2*@ r*r
  1027. 1 1 t t t t t t t t t
  1028. 2 2 2 2
  1029. - 2*@ r *@ s*s - 3*@ r *@ s - @ r - 4*@ r*@ s*@ s*r
  1030. t t t t t t t t t t
  1031. 2 2 2
  1032. - 2*@ s*k*s - @ s *k - k))/(r *s )
  1033. t t t
  1034. 2
  1035. hlang := (4*( - 4*@ r*@ r*@ s*s - 2*@ r*@ s *r - 2*@ r*r
  1036. 2 2 t t t t t t t t t
  1037. 2 2 2 2
  1038. - 2*@ r *@ s*s - 3*@ r *@ s - @ r - 4*@ r*@ s*@ s*r
  1039. t t t t t t t t t t
  1040. 2 2 2
  1041. - 2*@ s*k*s - @ s *k - k))/(r *s )
  1042. t t t
  1043. 2
  1044. hlang := (4*( - 4*@ r*@ r*@ s*s - 2*@ r*@ s *r - 2*@ r*r
  1045. 3 3 t t t t t t t t t
  1046. 2 2 2 2
  1047. - 2*@ r *@ s*s - 3*@ r *@ s - @ r - 4*@ r*@ s*@ s*r
  1048. t t t t t t t t t t
  1049. 2 2 2
  1050. - 2*@ s*k*s - @ s *k - k))/(r *s )
  1051. t t t
  1052. 2 3
  1053. hlang := (12*( - @ r*@ r *s - 2*@ r*@ r*@ s*r - @ r*k*s - @ r *@ s
  1054. 4 4 t t t t t t t t t t t
  1055. 2 3
  1056. - @ r *@ s*r - @ r*@ s*k - @ s*k*r))/(r *s)
  1057. t t t t t t t
  1058. 2 3
  1059. hlang := (12*( - @ r*@ r *s - 2*@ r*@ r*@ s*r - @ r*k*s - @ r *@ s
  1060. 5 5 t t t t t t t t t t t
  1061. 2 3
  1062. - @ r *@ s*r - @ r*@ s*k - @ s*k*r))/(r *s)
  1063. t t t t t t t
  1064. % The complete Einstein tensor:
  1065. einst(-i,-j) := (ricci(-i,-j) - (1/2)*riccisc*g(-i,-j))*alp1 +
  1066. hlang(-i,-j)*alp2$
  1067. alp1 := 1$
  1068. factor alp2;
  1069. einst(-i,-j) := einst(-i,-j);
  1070. 3 2 2 2
  1071. einst := (12*alp2*(2*@ r *@ s*s + 3*@ r *@ s *r + @ r *r + 2*@ r*@ s*k*s
  1072. t t t t t t t t t
  1073. 2 3 2
  1074. + @ s *k*r + k*r))/(r *s )
  1075. t
  1076. 2 2 2 2 2 2
  1077. 3*@ r *s + 6*@ r*@ s*r*s + @ s *r + 3*k*s + r
  1078. t t t t
  1079. + ---------------------------------------------------
  1080. 2 2
  1081. r *s
  1082. 2
  1083. einst := (4*alp2*( - 4*@ r*@ r*@ s*s - 2*@ r*@ s *r - 2*@ r*r
  1084. 1 1 t t t t t t t t t
  1085. 2 2 2 2
  1086. - 2*@ r *@ s*s - 3*@ r *@ s - @ r - 4*@ r*@ s*@ s*r
  1087. t t t t t t t t t t
  1088. 2 2 2 2
  1089. - 2*@ s*k*s - @ s *k - k))/(r *s ) + ( - 2*@ r*r*s
  1090. t t t t t
  1091. 2 2 2 2 2 2 2
  1092. - @ r *s - 4*@ r*@ s*r*s - 2*@ s*r *s - @ s *r - k*s - r )/
  1093. t t t t t t
  1094. 2 2
  1095. (r *s )
  1096. 2
  1097. einst := (4*alp2*( - 4*@ r*@ r*@ s*s - 2*@ r*@ s *r - 2*@ r*r
  1098. 2 2 t t t t t t t t t
  1099. 2 2 2 2
  1100. - 2*@ r *@ s*s - 3*@ r *@ s - @ r - 4*@ r*@ s*@ s*r
  1101. t t t t t t t t t t
  1102. 2 2 2 2
  1103. - 2*@ s*k*s - @ s *k - k))/(r *s ) + ( - 2*@ r*r*s
  1104. t t t t t
  1105. 2 2 2 2 2 2 2
  1106. - @ r *s - 4*@ r*@ s*r*s - 2*@ s*r *s - @ s *r - k*s - r )/
  1107. t t t t t t
  1108. 2 2
  1109. (r *s )
  1110. 2
  1111. einst := (4*alp2*( - 4*@ r*@ r*@ s*s - 2*@ r*@ s *r - 2*@ r*r
  1112. 3 3 t t t t t t t t t
  1113. 2 2 2 2
  1114. - 2*@ r *@ s*s - 3*@ r *@ s - @ r - 4*@ r*@ s*@ s*r
  1115. t t t t t t t t t t
  1116. 2 2 2 2
  1117. - 2*@ s*k*s - @ s *k - k))/(r *s ) + ( - 2*@ r*r*s
  1118. t t t t t
  1119. 2 2 2 2 2 2 2
  1120. - @ r *s - 4*@ r*@ s*r*s - 2*@ s*r *s - @ s *r - k*s - r )/
  1121. t t t t t t
  1122. 2 2
  1123. (r *s )
  1124. 2 3
  1125. einst := (12*alp2*( - @ r*@ r *s - 2*@ r*@ r*@ s*r - @ r*k*s - @ r *@ s
  1126. 4 4 t t t t t t t t t t t
  1127. 2 3
  1128. - @ r *@ s*r - @ r*@ s*k - @ s*k*r))/(r *s)
  1129. t t t t t t t
  1130. 2 2
  1131. - 3*@ r*r*s - 3*@ r *s - 3*@ r*@ s*r - @ s*r - 3*k*s
  1132. t t t t t t t
  1133. + ------------------------------------------------------------
  1134. 2
  1135. r *s
  1136. 2 3
  1137. einst := (12*alp2*( - @ r*@ r *s - 2*@ r*@ r*@ s*r - @ r*k*s - @ r *@ s
  1138. 5 5 t t t t t t t t t t t
  1139. 2 3
  1140. - @ r *@ s*r - @ r*@ s*k - @ s*k*r))/(r *s)
  1141. t t t t t t t
  1142. 2 2
  1143. - 3*@ r*r*s - 3*@ r *s - 3*@ r*@ s*r - @ s*r - 3*k*s
  1144. t t t t t t t
  1145. + ------------------------------------------------------------
  1146. 2
  1147. r *s
  1148. clear o(k),e(k),riemc3(i,j),riemri(i,j),curv(k,l),riemann(a,b,c,d),
  1149. ricci(a,b),riccisc,t,u,v1,v2,theta,phi,r,om(k,l),einst(a,b),
  1150. hlang(a,b);
  1151. remfdomain r,s;
  1152. % Problem:
  1153. % --------
  1154. % Calculate for a given coframe and given torsion the Riemannian part and
  1155. % the torsion induced part of the connection. Calculate the curvature.
  1156. % For a more elaborate example see E.Schruefer, F.W. Hehl, J.D. McCrea,
  1157. % "Application of the REDUCE package EXCALC to the Poincare gauge field
  1158. % theory of gravity", GRG Journal, vol. 19, (1988) 197--218
  1159. pform {ff, gg}=0;
  1160. fdomain ff=ff(r), gg=gg(r);
  1161. coframe o(4) = d u + 2*b0*cos(theta)*d phi,
  1162. o(1) = ff*(d u + 2*b0*cos(theta)*d phi) + d r,
  1163. o(2) = gg*d theta,
  1164. o(3) = gg*sin(theta)*d phi
  1165. with metric g = -o(4)*o(1)-o(4)*o(1)+o(2)*o(2)+o(3)*o(3);
  1166. frame e;
  1167. pform {tor(a),gwt(a)}=2,gamma(a,b)=1,
  1168. {u1,u3,u5}=0;
  1169. index_symmetries gamma(a,b): antisymmetric;
  1170. fdomain u1=u1(r),u3=u3(r),u5=u5(r);
  1171. tor(4) := 0$
  1172. tor(1) := -u5*o(4)^o(1) - 2*u3*o(2)^o(3)$
  1173. tor(2) := u1*o(4)^o(2) + u3*o(4)^o(3)$
  1174. tor(3) := u1*o(4)^o(3) - u3*o(4)^o(2)$
  1175. gwt(-a) := d o(-a) - tor(-a)$
  1176. % The following is the combined connection.
  1177. % The Riemannian part could have equally well been calculated by the
  1178. % RIEMANNCONX statement.
  1179. gamma(-a,-b) := (1/2)*( e(-b) _| (e(-c) _| gwt(-a))
  1180. +e(-c) _| (e(-a) _| gwt(-b))
  1181. -e(-a) _| (e(-b) _| gwt(-c)) )*o(c);
  1182. 4
  1183. gamma := o *(@ ff - u5)
  1184. 4 1 r
  1185. 2
  1186. o *(@ gg*ff + gg*u1) 3 2
  1187. r o *( - b0*ff + gg *u3)
  1188. gamma := - ---------------------- + ------------------------
  1189. 4 2 gg 2
  1190. gg
  1191. 2
  1192. o *@ gg 3
  1193. r - o *b0
  1194. gamma := --------- + ----------
  1195. 1 2 gg 2
  1196. gg
  1197. 3
  1198. 2 2 o *(@ gg*ff + gg*u1)
  1199. o *(b0*ff - gg *u3) r
  1200. gamma := --------------------- - ----------------------
  1201. 4 3 2 gg
  1202. gg
  1203. 3
  1204. 2 o *@ gg
  1205. o *b0 r
  1206. gamma := ------- + ---------
  1207. 1 3 2 gg
  1208. gg
  1209. 1 3 4 2
  1210. o *b0 o *cos(theta) o *(b0*ff - 2*gg *u3)
  1211. gamma := ------- + --------------- + -----------------------
  1212. 2 3 2 sin(theta)*gg 2
  1213. gg gg
  1214. pform curv(a,b)=2;
  1215. index_symmetries curv(a,b): antisymmetric;
  1216. factor ^;
  1217. curv(-a,b) := d gamma(-a,b) + gamma(-c,b)^gamma(-a,c);
  1218. 4 2 3
  1219. curv := (2*o ^o
  1220. 4
  1221. 2
  1222. *(@ ff*b0*gg - 2*@ gg*b0*ff + @ gg*gg *u3 - b0*gg*u1 - b0*gg*u5))/
  1223. r r r
  1224. 3 4 1
  1225. gg + o ^o *(@ ff - @ u5)
  1226. r r r
  1227. 1 2 3 2
  1228. o ^o *(@ gg*gg - b0 )
  1229. 4 r r 4 2 3 3
  1230. curv := -------------------------- + (o ^o *( - @ ff*@ gg*gg - @ gg*ff*gg
  1231. 2 4 r r r r
  1232. gg
  1233. 3 2 2 4
  1234. + @ gg*gg *u5 - b0 *ff + 2*b0*gg *u3))/gg
  1235. r
  1236. 4 3 2
  1237. o ^o *(@ ff*b0*gg - 2*@ gg*b0*ff + 2*@ gg*gg *u3 - b0*gg*u5)
  1238. r r r
  1239. + --------------------------------------------------------------
  1240. 3
  1241. gg
  1242. 1 3 3 2
  1243. o ^o *(@ gg*gg - b0 )
  1244. 4 r r
  1245. curv := --------------------------
  1246. 3 4
  1247. gg
  1248. 4 2 2
  1249. o ^o *( - @ ff*b0*gg + 2*@ gg*b0*ff - 2*@ gg*gg *u3 + b0*gg*u5)
  1250. r r r
  1251. + -----------------------------------------------------------------
  1252. 3
  1253. gg
  1254. 4 3 3 3 3 2
  1255. + (o ^o *( - @ ff*@ gg*gg - @ gg*ff*gg + @ gg*gg *u5 - b0 *ff
  1256. r r r r r
  1257. 2 4
  1258. + 2*b0*gg *u3))/gg
  1259. 1 2 3
  1260. curv := (2*o ^o
  1261. 1
  1262. 2
  1263. *( - @ ff*b0*gg + 2*@ gg*b0*ff - @ gg*gg *u3 + b0*gg*u1 + b0*gg*u5))
  1264. r r r
  1265. 3 4 1
  1266. /gg + o ^o *( - @ ff + @ u5)
  1267. r r r
  1268. 1 1 2 3 3 3 4
  1269. curv := (o ^o *( - @ ff*@ gg*gg - @ gg*ff*gg - @ gg*gg *u1 - @ u1*gg
  1270. 2 r r r r r r
  1271. 2 2 4 1 3
  1272. - b0 *ff + b0*gg *u3))/gg + (o ^o *( - @ ff*b0*gg
  1273. r
  1274. 2 3 3
  1275. + 2*@ gg*b0*ff + @ gg*gg *u3 + @ u3*gg + b0*gg*u1))/gg + (
  1276. r r r
  1277. 4 2 4 2 3 3
  1278. o ^o *( - @ ff*gg *u1 + @ gg*ff *gg + @ gg*ff*gg *u1
  1279. r r r r
  1280. 3 4 2 2 2
  1281. + @ gg*ff*gg *u5 + @ u1*ff*gg - b0 *ff + 3*b0*ff*gg *u3
  1282. r r
  1283. 4 4 2 4 4 3 2
  1284. + gg *u1*u5 - 2*gg *u3 ))/gg + (o ^o *(@ ff*gg *u3
  1285. r
  1286. 2
  1287. - 3*@ gg*ff*gg*u3 - @ u3*ff*gg + b0*ff*u1 + b0*ff*u5
  1288. r r
  1289. 2 2 2
  1290. - 2*gg *u1*u3 - gg *u3*u5))/gg
  1291. 1 1 2
  1292. curv := (o ^o
  1293. 3
  1294. 2 3
  1295. *(@ ff*b0*gg - 2*@ gg*b0*ff - @ gg*gg *u3 - @ u3*gg - b0*gg*u1))/
  1296. r r r r
  1297. 3 1 3 3 3 3
  1298. gg + (o ^o *( - @ ff*@ gg*gg - @ gg*ff*gg - @ gg*gg *u1
  1299. r r r r r
  1300. 4 2 2 4 4 2 2
  1301. - @ u1*gg - b0 *ff + b0*gg *u3))/gg + (o ^o *( - @ ff*gg *u3
  1302. r r
  1303. 2
  1304. + 3*@ gg*ff*gg*u3 + @ u3*ff*gg - b0*ff*u1 - b0*ff*u5
  1305. r r
  1306. 2 2 2 4 3 4
  1307. + 2*gg *u1*u3 + gg *u3*u5))/gg + (o ^o *( - @ ff*gg *u1
  1308. r
  1309. 2 3 3 3
  1310. + @ gg*ff *gg + @ gg*ff*gg *u1 + @ gg*ff*gg *u5
  1311. r r r r
  1312. 4 2 2 2 4
  1313. + @ u1*ff*gg - b0 *ff + 3*b0*ff*gg *u3 + gg *u1*u5
  1314. r
  1315. 4 2 4
  1316. - 2*gg *u3 ))/gg
  1317. 2 1 2 3 3 3 4
  1318. curv := (o ^o *( - @ ff*@ gg*gg - @ gg*ff*gg - @ gg*gg *u1 - @ u1*gg
  1319. 4 r r r r r r
  1320. 2 2 4 1 3
  1321. - b0 *ff + b0*gg *u3))/gg + (o ^o *( - @ ff*b0*gg
  1322. r
  1323. 2 3 3
  1324. + 2*@ gg*b0*ff + @ gg*gg *u3 + @ u3*gg + b0*gg*u1))/gg + (
  1325. r r r
  1326. 4 2 4 2 3 3
  1327. o ^o *( - @ ff*gg *u1 + @ gg*ff *gg + @ gg*ff*gg *u1
  1328. r r r r
  1329. 3 4 2 2 2
  1330. + @ gg*ff*gg *u5 + @ u1*ff*gg - b0 *ff + 3*b0*ff*gg *u3
  1331. r r
  1332. 4 4 2 4 4 3 2
  1333. + gg *u1*u5 - 2*gg *u3 ))/gg + (o ^o *(@ ff*gg *u3
  1334. r
  1335. 2
  1336. - 3*@ gg*ff*gg*u3 - @ u3*ff*gg + b0*ff*u1 + b0*ff*u5
  1337. r r
  1338. 2 2 2
  1339. - 2*gg *u1*u3 - gg *u3*u5))/gg
  1340. 1 2 3 2
  1341. o ^o *(@ gg*gg - b0 )
  1342. 2 r r 4 2 3 3
  1343. curv := -------------------------- + (o ^o *( - @ ff*@ gg*gg - @ gg*ff*gg
  1344. 1 4 r r r r
  1345. gg
  1346. 3 2 2 4
  1347. + @ gg*gg *u5 - b0 *ff + 2*b0*gg *u3))/gg
  1348. r
  1349. 4 3 2
  1350. o ^o *(@ ff*b0*gg - 2*@ gg*b0*ff + 2*@ gg*gg *u3 - b0*gg*u5)
  1351. r r r
  1352. + --------------------------------------------------------------
  1353. 3
  1354. gg
  1355. 2 2 3
  1356. curv := (o ^o
  1357. 3
  1358. 2 2 3 2 2 2
  1359. *( - 2*@ gg *ff*gg - 2*@ gg*gg *u1 + 6*b0 *ff - 6*b0*gg *u3 + gg ))
  1360. r r
  1361. 4 1 3
  1362. 2*o ^o *(@ ff*b0*gg - 2*@ gg*b0*ff - @ u3*gg )
  1363. 4 r r r
  1364. /gg + ------------------------------------------------
  1365. 3
  1366. gg
  1367. 3 1 2
  1368. curv := (o ^o
  1369. 4
  1370. 2 3
  1371. *(@ ff*b0*gg - 2*@ gg*b0*ff - @ gg*gg *u3 - @ u3*gg - b0*gg*u1))/
  1372. r r r r
  1373. 3 1 3 3 3 3
  1374. gg + (o ^o *( - @ ff*@ gg*gg - @ gg*ff*gg - @ gg*gg *u1
  1375. r r r r r
  1376. 4 2 2 4 4 2 2
  1377. - @ u1*gg - b0 *ff + b0*gg *u3))/gg + (o ^o *( - @ ff*gg *u3
  1378. r r
  1379. 2
  1380. + 3*@ gg*ff*gg*u3 + @ u3*ff*gg - b0*ff*u1 - b0*ff*u5
  1381. r r
  1382. 2 2 2 4 3 4
  1383. + 2*gg *u1*u3 + gg *u3*u5))/gg + (o ^o *( - @ ff*gg *u1
  1384. r
  1385. 2 3 3 3
  1386. + @ gg*ff *gg + @ gg*ff*gg *u1 + @ gg*ff*gg *u5
  1387. r r r r
  1388. 4 2 2 2 4
  1389. + @ u1*ff*gg - b0 *ff + 3*b0*ff*gg *u3 + gg *u1*u5
  1390. r
  1391. 4 2 4
  1392. - 2*gg *u3 ))/gg
  1393. 1 3 3 2
  1394. o ^o *(@ gg*gg - b0 )
  1395. 3 r r
  1396. curv := --------------------------
  1397. 1 4
  1398. gg
  1399. 4 2 2
  1400. o ^o *( - @ ff*b0*gg + 2*@ gg*b0*ff - 2*@ gg*gg *u3 + b0*gg*u5)
  1401. r r r
  1402. + -----------------------------------------------------------------
  1403. 3
  1404. gg
  1405. 4 3 3 3 3 2
  1406. + (o ^o *( - @ ff*@ gg*gg - @ gg*ff*gg + @ gg*gg *u5 - b0 *ff
  1407. r r r r r
  1408. 2 4
  1409. + 2*b0*gg *u3))/gg
  1410. 3 2 3
  1411. curv := (o ^o
  1412. 2
  1413. 2 2 3 2 2 2
  1414. *(2*@ gg *ff*gg + 2*@ gg*gg *u1 - 6*b0 *ff + 6*b0*gg *u3 - gg ))/
  1415. r r
  1416. 4 1 3
  1417. 2*o ^o *( - @ ff*b0*gg + 2*@ gg*b0*ff + @ u3*gg )
  1418. 4 r r r
  1419. gg + ---------------------------------------------------
  1420. 3
  1421. gg
  1422. clear o(k),e(k),curv(a,b),gamma(a,b),theta,phi,x,y,z,r,s,t,u,v,p,q,c,cs;
  1423. remfdomain u1,u3,u5,ff,gg;
  1424. showtime;
  1425. Time: 28540 ms plus GC time: 1791 ms
  1426. end;
  1427. (TIME: excalc 28560 30351)