avector.log 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. Sat Jun 29 14:16:00 PDT 1991
  2. REDUCE 3.4, 15-Jul-91 ...
  3. 1: 1:
  4. 2: 2:
  5. *** ^ redefined
  6. 3: 3: % Vector test routine
  7. % Author: David Harper (algebra@liverpool.ac.uk)
  8. % Computer Algebra Support Officer
  9. % University of Liverpool Computer Laboratory.
  10. % Please compare carefully the output from running this test file with the
  11. % log file provided to make sure your implementation is correct.
  12. linelength 72;
  13. 80
  14. off allfac;
  15. on div;
  16. vec a,b,c;
  17. matrix q;
  18. a := avec(ax,ay,az);
  19. VEC(X) := AX
  20. VEC(Y) := AY
  21. VEC(Z) := AZ
  22. b := avec(bx,by,bz);
  23. VEC(X) := BX
  24. VEC(Y) := BY
  25. VEC(Z) := BZ
  26. q := mat((q11,q12,q13),(q21,q22,q23),(q31,q32,q33));
  27. [Q11 Q12 Q13]
  28. [ ]
  29. Q := [Q21 Q22 Q23]
  30. [ ]
  31. [Q31 Q32 Q33]
  32. c := a+b;
  33. VEC(X) := AX + BX
  34. VEC(Y) := AY + BY
  35. VEC(Z) := AZ + BZ
  36. c := a-b;
  37. VEC(X) := AX - BX
  38. VEC(Y) := AY - BY
  39. VEC(Z) := AZ - BZ
  40. c := a cross b;
  41. VEC(X) := AY*BZ - AZ*BY
  42. VEC(Y) := - AX*BZ + AZ*BX
  43. VEC(Z) := AX*BY - AY*BX
  44. d := a dot b;
  45. D := AX*BX + AY*BY + AZ*BZ
  46. a dot c;
  47. 0
  48. b dot c;
  49. 0
  50. q*a;
  51. VEC(X) := AX*Q11 + AY*Q12 + AZ*Q13
  52. VEC(Y) := AX*Q21 + AY*Q22 + AZ*Q23
  53. VEC(Z) := AX*Q31 + AY*Q32 + AZ*Q33
  54. c:=2*f*a - b/7;
  55. 1
  56. VEC(X) := 2*F*AX - ---*BX
  57. 7
  58. 1
  59. VEC(Y) := 2*F*AY - ---*BY
  60. 7
  61. 1
  62. VEC(Z) := 2*F*AZ - ---*BZ
  63. 7
  64. c(0);
  65. 1
  66. 2*F*AX - ---*BX
  67. 7
  68. c(1);
  69. 1
  70. 2*F*AY - ---*BY
  71. 7
  72. c(2);
  73. 1
  74. 2*F*AZ - ---*BZ
  75. 7
  76. 1/vmod(a);
  77. 2 2 2 - 1/2
  78. (AX + AY + AZ )
  79. b/vmod(a);
  80. 2 2 2 - 1/2
  81. VEC(X) := (AX + AY + AZ ) *BX
  82. 2 2 2 - 1/2
  83. VEC(Y) := (AX + AY + AZ ) *BY
  84. 2 2 2 - 1/2
  85. VEC(Z) := (AX + AY + AZ ) *BZ
  86. (a cross b)/(a dot b);
  87. AY*BZ - AZ*BY
  88. VEC(X) := -----------------------
  89. AX*BX + AY*BY + AZ*BZ
  90. - AX*BZ + AZ*BX
  91. VEC(Y) := -----------------------
  92. AX*BX + AY*BY + AZ*BZ
  93. AX*BY - AY*BX
  94. VEC(Z) := -----------------------
  95. AX*BX + AY*BY + AZ*BZ
  96. 2/3*vmod(a)*a*(a dot c)/(vmod(a cross c));
  97. 28 2 2 2 2
  98. VEC(X) := ----*(AX *BY + AX *BZ - 2*AX*AY*BX*BY
  99. 3
  100. 2 2 2 2
  101. - 2*AX*AZ*BX*BZ + AY *BX + AY *BZ
  102. 2 2 2 2 - 1
  103. - 2*AY*AZ*BY*BZ + AZ *BX + AZ *BY )**------
  104. 2
  105. 2 2 2 3 28 2 2
  106. *SQRT(AX + AY + AZ )*F*AX + ----*(AX *BY
  107. 3
  108. 2 2
  109. + AX *BZ - 2*AX*AY*BX*BY - 2*AX*AZ*BX*BZ
  110. 2 2 2 2 2 2
  111. + AY *BX + AY *BZ - 2*AY*AZ*BY*BZ + AZ *BX
  112. 2 2 - 1 2 2 2
  113. + AZ *BY )**------*SQRT(AX + AY + AZ )*F*AX
  114. 2
  115. 2 28 2 2 2 2
  116. *AY + ----*(AX *BY + AX *BZ - 2*AX*AY*BX*BY
  117. 3
  118. 2 2 2 2
  119. - 2*AX*AZ*BX*BZ + AY *BX + AY *BZ
  120. 2 2 2 2 - 1
  121. - 2*AY*AZ*BY*BZ + AZ *BX + AZ *BY )**------
  122. 2
  123. 2 2 2 2 2 2 2
  124. *SQRT(AX + AY + AZ )*F*AX*AZ - ---*(AX *BY
  125. 3
  126. 2 2
  127. + AX *BZ - 2*AX*AY*BX*BY - 2*AX*AZ*BX*BZ
  128. 2 2 2 2 2 2
  129. + AY *BX + AY *BZ - 2*AY*AZ*BY*BZ + AZ *BX
  130. 2 2 - 1 2 2 2 2
  131. + AZ *BY )**------*SQRT(AX + AY + AZ )*AX *BX
  132. 2
  133. 2 2 2 2 2
  134. - ---*(AX *BY + AX *BZ - 2*AX*AY*BX*BY
  135. 3
  136. 2 2 2 2
  137. - 2*AX*AZ*BX*BZ + AY *BX + AY *BZ
  138. 2 2 2 2 - 1
  139. - 2*AY*AZ*BY*BZ + AZ *BX + AZ *BY )**------
  140. 2
  141. 2 2 2 2 2 2
  142. *SQRT(AX + AY + AZ )*AX*AY*BY - ---*(AX *BY
  143. 3
  144. 2 2
  145. + AX *BZ - 2*AX*AY*BX*BY - 2*AX*AZ*BX*BZ
  146. 2 2 2 2 2 2
  147. + AY *BX + AY *BZ - 2*AY*AZ*BY*BZ + AZ *BX
  148. 2 2 - 1 2 2 2
  149. + AZ *BY )**------*SQRT(AX + AY + AZ )*AX*AZ
  150. 2
  151. *BZ
  152. 28 2 2 2 2
  153. VEC(Y) := ----*(AX *BY + AX *BZ - 2*AX*AY*BX*BY
  154. 3
  155. 2 2 2 2
  156. - 2*AX*AZ*BX*BZ + AY *BX + AY *BZ
  157. 2 2 2 2 - 1
  158. - 2*AY*AZ*BY*BZ + AZ *BX + AZ *BY )**------
  159. 2
  160. 2 2 2 2 28 2 2
  161. *SQRT(AX + AY + AZ )*F*AX *AY + ----*(AX *BY
  162. 3
  163. 2 2
  164. + AX *BZ - 2*AX*AY*BX*BY - 2*AX*AZ*BX*BZ
  165. 2 2 2 2 2 2
  166. + AY *BX + AY *BZ - 2*AY*AZ*BY*BZ + AZ *BX
  167. 2 2 - 1 2 2 2 3
  168. + AZ *BY )**------*SQRT(AX + AY + AZ )*F*AY
  169. 2
  170. 28 2 2 2 2
  171. + ----*(AX *BY + AX *BZ - 2*AX*AY*BX*BY
  172. 3
  173. 2 2 2 2
  174. - 2*AX*AZ*BX*BZ + AY *BX + AY *BZ
  175. 2 2 2 2 - 1
  176. - 2*AY*AZ*BY*BZ + AZ *BX + AZ *BY )**------
  177. 2
  178. 2 2 2 2 2 2 2
  179. *SQRT(AX + AY + AZ )*F*AY*AZ - ---*(AX *BY
  180. 3
  181. 2 2
  182. + AX *BZ - 2*AX*AY*BX*BY - 2*AX*AZ*BX*BZ
  183. 2 2 2 2 2 2
  184. + AY *BX + AY *BZ - 2*AY*AZ*BY*BZ + AZ *BX
  185. 2 2 - 1 2 2 2
  186. + AZ *BY )**------*SQRT(AX + AY + AZ )*AX*AY
  187. 2
  188. 2 2 2 2 2
  189. *BX - ---*(AX *BY + AX *BZ - 2*AX*AY*BX*BY
  190. 3
  191. 2 2 2 2
  192. - 2*AX*AZ*BX*BZ + AY *BX + AY *BZ
  193. 2 2 2 2 - 1
  194. - 2*AY*AZ*BY*BZ + AZ *BX + AZ *BY )**------
  195. 2
  196. 2 2 2 2 2 2 2
  197. *SQRT(AX + AY + AZ )*AY *BY - ---*(AX *BY
  198. 3
  199. 2 2
  200. + AX *BZ - 2*AX*AY*BX*BY - 2*AX*AZ*BX*BZ
  201. 2 2 2 2 2 2
  202. + AY *BX + AY *BZ - 2*AY*AZ*BY*BZ + AZ *BX
  203. 2 2 - 1 2 2 2
  204. + AZ *BY )**------*SQRT(AX + AY + AZ )*AY*AZ
  205. 2
  206. *BZ
  207. 28 2 2 2 2
  208. VEC(Z) := ----*(AX *BY + AX *BZ - 2*AX*AY*BX*BY
  209. 3
  210. 2 2 2 2
  211. - 2*AX*AZ*BX*BZ + AY *BX + AY *BZ
  212. 2 2 2 2 - 1
  213. - 2*AY*AZ*BY*BZ + AZ *BX + AZ *BY )**------
  214. 2
  215. 2 2 2 2 28 2 2
  216. *SQRT(AX + AY + AZ )*F*AX *AZ + ----*(AX *BY
  217. 3
  218. 2 2
  219. + AX *BZ - 2*AX*AY*BX*BY - 2*AX*AZ*BX*BZ
  220. 2 2 2 2 2 2
  221. + AY *BX + AY *BZ - 2*AY*AZ*BY*BZ + AZ *BX
  222. 2 2 - 1 2 2 2 2
  223. + AZ *BY )**------*SQRT(AX + AY + AZ )*F*AY
  224. 2
  225. 28 2 2 2 2
  226. *AZ + ----*(AX *BY + AX *BZ - 2*AX*AY*BX*BY
  227. 3
  228. 2 2 2 2
  229. - 2*AX*AZ*BX*BZ + AY *BX + AY *BZ
  230. 2 2 2 2 - 1
  231. - 2*AY*AZ*BY*BZ + AZ *BX + AZ *BY )**------
  232. 2
  233. 2 2 2 3 2 2 2
  234. *SQRT(AX + AY + AZ )*F*AZ - ---*(AX *BY
  235. 3
  236. 2 2
  237. + AX *BZ - 2*AX*AY*BX*BY - 2*AX*AZ*BX*BZ
  238. 2 2 2 2 2 2
  239. + AY *BX + AY *BZ - 2*AY*AZ*BY*BZ + AZ *BX
  240. 2 2 - 1 2 2 2
  241. + AZ *BY )**------*SQRT(AX + AY + AZ )*AX*AZ
  242. 2
  243. 2 2 2 2 2
  244. *BX - ---*(AX *BY + AX *BZ - 2*AX*AY*BX*BY
  245. 3
  246. 2 2 2 2
  247. - 2*AX*AZ*BX*BZ + AY *BX + AY *BZ
  248. 2 2 2 2 - 1
  249. - 2*AY*AZ*BY*BZ + AZ *BX + AZ *BY )**------
  250. 2
  251. 2 2 2 2 2 2
  252. *SQRT(AX + AY + AZ )*AY*AZ*BY - ---*(AX *BY
  253. 3
  254. 2 2
  255. + AX *BZ - 2*AX*AY*BX*BY - 2*AX*AZ*BX*BZ
  256. 2 2 2 2 2 2
  257. + AY *BX + AY *BZ - 2*AY*AZ*BY*BZ + AZ *BX
  258. 2 2 - 1 2 2 2 2
  259. + AZ *BY )**------*SQRT(AX + AY + AZ )*AZ *BZ
  260. 2
  261. a := avec(x**2*y**3,log(z+x),13*z-y);
  262. 2 3
  263. VEC(X) := X *Y
  264. VEC(Y) := LOG(X + Z)
  265. VEC(Z) := - Y + 13*Z
  266. df(a,x);
  267. 3
  268. VEC(X) := 2*X*Y
  269. 1
  270. VEC(Y) := -------
  271. X + Z
  272. VEC(Z) := 0
  273. df(a,x,y);
  274. 2
  275. VEC(X) := 6*X*Y
  276. VEC(Y) := 0
  277. VEC(Z) := 0
  278. int(a,x);
  279. 1 3 3
  280. VEC(X) := ---*X *Y
  281. 3
  282. VEC(Y) := LOG(X + Z)*X + LOG(X + Z)*Z - X
  283. VEC(Z) := - X*Y + 13*X*Z
  284. exp(a);
  285. 2 3
  286. X *Y
  287. VEC(X) := E
  288. VEC(Y) := X + Z
  289. - Y + 13*Z
  290. VEC(Z) := E
  291. log sin b;
  292. VEC(X) := LOG(SIN(BX))
  293. VEC(Y) := LOG(SIN(BY))
  294. VEC(Z) := LOG(SIN(BZ))
  295. a := avec(ax,ay,az);
  296. VEC(X) := AX
  297. VEC(Y) := AY
  298. VEC(Z) := AZ
  299. depend ax,x,y,z;
  300. depend ay,x,y,z;
  301. depend az,x,y,z;
  302. depend p,x,y,z;
  303. c := grad p;
  304. VEC(X) := DF(P,X)
  305. VEC(Y) := DF(P,Y)
  306. VEC(Z) := DF(P,Z)
  307. div c;
  308. DF(P,X,2) + DF(P,Y,2) + DF(P,Z,2)
  309. delsq p;
  310. DF(P,X,2) + DF(P,Y,2) + DF(P,Z,2)
  311. div a;
  312. DF(AX,X) + DF(AY,Y) + DF(AZ,Z)
  313. curl a;
  314. VEC(X) := - DF(AY,Z) + DF(AZ,Y)
  315. VEC(Y) := DF(AX,Z) - DF(AZ,X)
  316. VEC(Z) := - DF(AX,Y) + DF(AY,X)
  317. delsq a;
  318. VEC(X) := DF(AX,X,2) + DF(AX,Y,2) + DF(AX,Z,2)
  319. VEC(Y) := DF(AY,X,2) + DF(AY,Y,2) + DF(AY,Z,2)
  320. VEC(Z) := DF(AZ,X,2) + DF(AZ,Y,2) + DF(AZ,Z,2)
  321. depend h1,x,y,z;
  322. depend h2,x,y,z;
  323. depend h3,x,y,z;
  324. scalefactors(h1,h2,h3);
  325. grad p;
  326. -1
  327. VEC(X) := DF(P,X)*H1
  328. -1
  329. VEC(Y) := DF(P,Y)*H2
  330. -1
  331. VEC(Z) := DF(P,Z)*H3
  332. div a;
  333. -1 -1 -1
  334. DF(AX,X)*H1 + DF(AY,Y)*H2 + DF(AZ,Z)*H3
  335. -1 -1 -1 -1
  336. + DF(H1,Y)*AY*H1 *H2 + DF(H1,Z)*AZ*H1 *H3
  337. -1 -1 -1 -1
  338. + DF(H2,X)*AX*H1 *H2 + DF(H2,Z)*AZ*H2 *H3
  339. -1 -1 -1 -1
  340. + DF(H3,X)*AX*H1 *H3 + DF(H3,Y)*AY*H2 *H3
  341. curl a;
  342. -1 -1
  343. VEC(X) := - DF(AY,Z)*H3 + DF(AZ,Y)*H2
  344. -1 -1 -1 -1
  345. - DF(H2,Z)*AY*H2 *H3 + DF(H3,Y)*AZ*H2 *H3
  346. -1 -1
  347. VEC(Y) := DF(AX,Z)*H3 - DF(AZ,X)*H1
  348. -1 -1 -1 -1
  349. + DF(H1,Z)*AX*H1 *H3 - DF(H3,X)*AZ*H1 *H3
  350. -1 -1
  351. VEC(Z) := - DF(AX,Y)*H2 + DF(AY,X)*H1
  352. -1 -1 -1 -1
  353. - DF(H1,Y)*AX*H1 *H2 + DF(H2,X)*AY*H1 *H2
  354. dp1 := delsq p;
  355. -2 -3
  356. DP1 := DF(P,X,2)*H1 - DF(P,X)*DF(H1,X)*H1
  357. -2 -1
  358. + DF(P,X)*DF(H2,X)*H1 *H2
  359. -2 -1 -2
  360. + DF(P,X)*DF(H3,X)*H1 *H3 + DF(P,Y,2)*H2
  361. -1 -2 -3
  362. + DF(P,Y)*DF(H1,Y)*H1 *H2 - DF(P,Y)*DF(H2,Y)*H2
  363. -2 -1 -2
  364. + DF(P,Y)*DF(H3,Y)*H2 *H3 + DF(P,Z,2)*H3
  365. -1 -2
  366. + DF(P,Z)*DF(H1,Z)*H1 *H3
  367. -1 -2 -3
  368. + DF(P,Z)*DF(H2,Z)*H2 *H3 - DF(P,Z)*DF(H3,Z)*H3
  369. dp2 := div grad p;
  370. -2 -3
  371. DP2 := DF(P,X,2)*H1 - DF(P,X)*DF(H1,X)*H1
  372. -2 -1
  373. + DF(P,X)*DF(H2,X)*H1 *H2
  374. -2 -1 -2
  375. + DF(P,X)*DF(H3,X)*H1 *H3 + DF(P,Y,2)*H2
  376. -1 -2 -3
  377. + DF(P,Y)*DF(H1,Y)*H1 *H2 - DF(P,Y)*DF(H2,Y)*H2
  378. -2 -1 -2
  379. + DF(P,Y)*DF(H3,Y)*H2 *H3 + DF(P,Z,2)*H3
  380. -1 -2
  381. + DF(P,Z)*DF(H1,Z)*H1 *H3
  382. -1 -2 -3
  383. + DF(P,Z)*DF(H2,Z)*H2 *H3 - DF(P,Z)*DF(H3,Z)*H3
  384. dp1-dp2;
  385. 0
  386. delsq a;
  387. -2 -3
  388. VEC(X) := DF(AX,X,2)*H1 - DF(AX,X)*DF(H1,X)*H1
  389. -2 -1
  390. + DF(AX,X)*DF(H2,X)*H1 *H2
  391. -2 -1 -2
  392. + DF(AX,X)*DF(H3,X)*H1 *H3 + DF(AX,Y,2)*H2
  393. -1 -2
  394. + DF(AX,Y)*DF(H1,Y)*H1 *H2
  395. -3
  396. - DF(AX,Y)*DF(H2,Y)*H2
  397. -2 -1 -2
  398. + DF(AX,Y)*DF(H3,Y)*H2 *H3 + DF(AX,Z,2)*H3
  399. -1 -2
  400. + DF(AX,Z)*DF(H1,Z)*H1 *H3
  401. -1 -2
  402. + DF(AX,Z)*DF(H2,Z)*H2 *H3
  403. -3
  404. - DF(AX,Z)*DF(H3,Z)*H3
  405. -2 -1
  406. + 2*DF(AY,X)*DF(H1,Y)*H1 *H2
  407. -1 -2
  408. - 2*DF(AY,Y)*DF(H2,X)*H1 *H2
  409. -2 -1
  410. + 2*DF(AZ,X)*DF(H1,Z)*H1 *H3
  411. -1 -2
  412. - 2*DF(AZ,Z)*DF(H3,X)*H1 *H3
  413. -2 -1
  414. + DF(H1,X,Y)*AY*H1 *H2
  415. -2 -1
  416. + DF(H1,X,Z)*AZ*H1 *H3
  417. -3 -1
  418. - DF(H1,X)*DF(H1,Y)*AY*H1 *H2
  419. -3 -1
  420. - DF(H1,X)*DF(H1,Z)*AZ*H1 *H3
  421. -3 -1
  422. - DF(H1,X)*DF(H2,X)*AX*H1 *H2
  423. -3 -1
  424. - DF(H1,X)*DF(H3,X)*AX*H1 *H3
  425. -1 -2 2 -2 -2
  426. + DF(H1,Y,2)*AX*H1 *H2 - DF(H1,Y) *AX*H1 *H2
  427. -1 -3
  428. - DF(H1,Y)*DF(H2,Y)*AX*H1 *H2
  429. -1 -2 -1
  430. + DF(H1,Y)*DF(H3,Y)*AX*H1 *H2 *H3
  431. -1 -2 2 -2 -2
  432. + DF(H1,Z,2)*AX*H1 *H3 - DF(H1,Z) *AX*H1 *H3
  433. -1 -1 -2
  434. + DF(H1,Z)*DF(H2,Z)*AX*H1 *H2 *H3
  435. -1 -3
  436. - DF(H1,Z)*DF(H3,Z)*AX*H1 *H3
  437. -1 -2
  438. - DF(H2,X,Y)*AY*H1 *H2
  439. -1 -1 -1
  440. + DF(H2,X,Z)*AZ*H1 *H2 *H3
  441. -2 -1 2 -2 -2
  442. + DF(H2,X,2)*AX*H1 *H2 - DF(H2,X) *AX*H1 *H2
  443. -1 -3
  444. + DF(H2,X)*DF(H2,Y)*AY*H1 *H2
  445. -1 -2 -1
  446. - DF(H2,X)*DF(H2,Z)*AZ*H1 *H2 *H3
  447. -1 -2 -1
  448. - 2*DF(H2,X)*DF(H3,Y)*AY*H1 *H2 *H3
  449. -1 -1 -2
  450. - 2*DF(H2,Z)*DF(H3,X)*AZ*H1 *H2 *H3
  451. -1 -1 -1
  452. + DF(H3,X,Y)*AY*H1 *H2 *H3
  453. -1 -2
  454. - DF(H3,X,Z)*AZ*H1 *H3
  455. -2 -1 2 -2 -2
  456. + DF(H3,X,2)*AX*H1 *H3 - DF(H3,X) *AX*H1 *H3
  457. -1 -1 -2
  458. - DF(H3,X)*DF(H3,Y)*AY*H1 *H2 *H3
  459. -1 -3
  460. + DF(H3,X)*DF(H3,Z)*AZ*H1 *H3
  461. -2 -1
  462. VEC(Y) := - 2*DF(AX,X)*DF(H1,Y)*H1 *H2
  463. -1 -2 -2
  464. + 2*DF(AX,Y)*DF(H2,X)*H1 *H2 + DF(AY,X,2)*H1
  465. -3
  466. - DF(AY,X)*DF(H1,X)*H1
  467. -2 -1
  468. + DF(AY,X)*DF(H2,X)*H1 *H2
  469. -2 -1 -2
  470. + DF(AY,X)*DF(H3,X)*H1 *H3 + DF(AY,Y,2)*H2
  471. -1 -2
  472. + DF(AY,Y)*DF(H1,Y)*H1 *H2
  473. -3
  474. - DF(AY,Y)*DF(H2,Y)*H2
  475. -2 -1 -2
  476. + DF(AY,Y)*DF(H3,Y)*H2 *H3 + DF(AY,Z,2)*H3
  477. -1 -2
  478. + DF(AY,Z)*DF(H1,Z)*H1 *H3
  479. -1 -2
  480. + DF(AY,Z)*DF(H2,Z)*H2 *H3
  481. -3
  482. - DF(AY,Z)*DF(H3,Z)*H3
  483. -2 -1
  484. + 2*DF(AZ,Y)*DF(H2,Z)*H2 *H3
  485. -1 -2
  486. - 2*DF(AZ,Z)*DF(H3,Y)*H2 *H3
  487. -2 -1
  488. - DF(H1,X,Y)*AX*H1 *H2
  489. -3 -1
  490. + DF(H1,X)*DF(H1,Y)*AX*H1 *H2
  491. -3 -1
  492. - DF(H1,X)*DF(H2,X)*AY*H1 *H2
  493. -1 -1 -1
  494. + DF(H1,Y,Z)*AZ*H1 *H2 *H3
  495. -1 -2 2 -2 -2
  496. + DF(H1,Y,2)*AY*H1 *H2 - DF(H1,Y) *AY*H1 *H2
  497. -2 -1 -1
  498. - DF(H1,Y)*DF(H1,Z)*AZ*H1 *H2 *H3
  499. -1 -3
  500. - DF(H1,Y)*DF(H2,Y)*AY*H1 *H2
  501. -2 -1 -1
  502. - 2*DF(H1,Y)*DF(H3,X)*AX*H1 *H2 *H3
  503. -1 -1 -2
  504. + DF(H1,Z)*DF(H2,Z)*AY*H1 *H2 *H3
  505. -1 -1 -2
  506. - 2*DF(H1,Z)*DF(H3,Y)*AZ*H1 *H2 *H3
  507. -1 -2
  508. + DF(H2,X,Y)*AX*H1 *H2
  509. -2 -1 2 -2 -2
  510. + DF(H2,X,2)*AY*H1 *H2 - DF(H2,X) *AY*H1 *H2
  511. -1 -3
  512. - DF(H2,X)*DF(H2,Y)*AX*H1 *H2
  513. -2 -1 -1
  514. + DF(H2,X)*DF(H3,X)*AY*H1 *H2 *H3
  515. -2 -1
  516. + DF(H2,Y,Z)*AZ*H2 *H3
  517. -3 -1
  518. - DF(H2,Y)*DF(H2,Z)*AZ*H2 *H3
  519. -3 -1
  520. - DF(H2,Y)*DF(H3,Y)*AY*H2 *H3
  521. -1 -2 2 -2 -2
  522. + DF(H2,Z,2)*AY*H2 *H3 - DF(H2,Z) *AY*H2 *H3
  523. -1 -3
  524. - DF(H2,Z)*DF(H3,Z)*AY*H2 *H3
  525. -1 -1 -1
  526. + DF(H3,X,Y)*AX*H1 *H2 *H3
  527. -1 -1 -2
  528. - DF(H3,X)*DF(H3,Y)*AX*H1 *H2 *H3
  529. -1 -2
  530. - DF(H3,Y,Z)*AZ*H2 *H3
  531. -2 -1 2 -2 -2
  532. + DF(H3,Y,2)*AY*H2 *H3 - DF(H3,Y) *AY*H2 *H3
  533. -1 -3
  534. + DF(H3,Y)*DF(H3,Z)*AZ*H2 *H3
  535. -2 -1
  536. VEC(Z) := - 2*DF(AX,X)*DF(H1,Z)*H1 *H3
  537. -1 -2
  538. + 2*DF(AX,Z)*DF(H3,X)*H1 *H3
  539. -2 -1
  540. - 2*DF(AY,Y)*DF(H2,Z)*H2 *H3
  541. -1 -2 -2
  542. + 2*DF(AY,Z)*DF(H3,Y)*H2 *H3 + DF(AZ,X,2)*H1
  543. -3
  544. - DF(AZ,X)*DF(H1,X)*H1
  545. -2 -1
  546. + DF(AZ,X)*DF(H2,X)*H1 *H2
  547. -2 -1 -2
  548. + DF(AZ,X)*DF(H3,X)*H1 *H3 + DF(AZ,Y,2)*H2
  549. -1 -2
  550. + DF(AZ,Y)*DF(H1,Y)*H1 *H2
  551. -3
  552. - DF(AZ,Y)*DF(H2,Y)*H2
  553. -2 -1 -2
  554. + DF(AZ,Y)*DF(H3,Y)*H2 *H3 + DF(AZ,Z,2)*H3
  555. -1 -2
  556. + DF(AZ,Z)*DF(H1,Z)*H1 *H3
  557. -1 -2
  558. + DF(AZ,Z)*DF(H2,Z)*H2 *H3
  559. -3 -2 -1
  560. - DF(AZ,Z)*DF(H3,Z)*H3 - DF(H1,X,Z)*AX*H1 *H3
  561. -3 -1
  562. + DF(H1,X)*DF(H1,Z)*AX*H1 *H3
  563. -3 -1
  564. - DF(H1,X)*DF(H3,X)*AZ*H1 *H3
  565. -1 -1 -1
  566. + DF(H1,Y,Z)*AY*H1 *H2 *H3
  567. -2 -1 -1
  568. - DF(H1,Y)*DF(H1,Z)*AY*H1 *H2 *H3
  569. -1 -2 -1
  570. - 2*DF(H1,Y)*DF(H2,Z)*AY*H1 *H2 *H3
  571. -1 -2 -1
  572. + DF(H1,Y)*DF(H3,Y)*AZ*H1 *H2 *H3
  573. -1 -2 2 -2 -2
  574. + DF(H1,Z,2)*AZ*H1 *H3 - DF(H1,Z) *AZ*H1 *H3
  575. -2 -1 -1
  576. - 2*DF(H1,Z)*DF(H2,X)*AX*H1 *H2 *H3
  577. -1 -3
  578. - DF(H1,Z)*DF(H3,Z)*AZ*H1 *H3
  579. -1 -1 -1
  580. + DF(H2,X,Z)*AX*H1 *H2 *H3
  581. -1 -2 -1
  582. - DF(H2,X)*DF(H2,Z)*AX*H1 *H2 *H3
  583. -2 -1 -1
  584. + DF(H2,X)*DF(H3,X)*AZ*H1 *H2 *H3
  585. -2 -1
  586. - DF(H2,Y,Z)*AY*H2 *H3
  587. -3 -1
  588. + DF(H2,Y)*DF(H2,Z)*AY*H2 *H3
  589. -3 -1
  590. - DF(H2,Y)*DF(H3,Y)*AZ*H2 *H3
  591. -1 -2 2 -2 -2
  592. + DF(H2,Z,2)*AZ*H2 *H3 - DF(H2,Z) *AZ*H2 *H3
  593. -1 -3
  594. - DF(H2,Z)*DF(H3,Z)*AZ*H2 *H3
  595. -1 -2
  596. + DF(H3,X,Z)*AX*H1 *H3
  597. -2 -1 2 -2 -2
  598. + DF(H3,X,2)*AZ*H1 *H3 - DF(H3,X) *AZ*H1 *H3
  599. -1 -3
  600. - DF(H3,X)*DF(H3,Z)*AX*H1 *H3
  601. -1 -2
  602. + DF(H3,Y,Z)*AY*H2 *H3
  603. -2 -1 2 -2 -2
  604. + DF(H3,Y,2)*AZ*H2 *H3 - DF(H3,Y) *AZ*H2 *H3
  605. -1 -3
  606. - DF(H3,Y)*DF(H3,Z)*AY*H2 *H3
  607. curl grad p;
  608. VEC(X) := 0
  609. VEC(Y) := 0
  610. VEC(Z) := 0
  611. grad div a;
  612. -2 -3
  613. VEC(X) := DF(AX,X,2)*H1 - DF(AX,X)*DF(H1,X)*H1
  614. -2 -1
  615. + DF(AX,X)*DF(H2,X)*H1 *H2
  616. -2 -1
  617. + DF(AX,X)*DF(H3,X)*H1 *H3
  618. -1 -1
  619. + DF(AY,X,Y)*H1 *H2
  620. -2 -1
  621. + DF(AY,X)*DF(H1,Y)*H1 *H2
  622. -1 -1 -1
  623. + DF(AY,X)*DF(H3,Y)*H1 *H2 *H3
  624. -1 -2
  625. - DF(AY,Y)*DF(H2,X)*H1 *H2
  626. -1 -1
  627. + DF(AZ,X,Z)*H1 *H3
  628. -2 -1
  629. + DF(AZ,X)*DF(H1,Z)*H1 *H3
  630. -1 -1 -1
  631. + DF(AZ,X)*DF(H2,Z)*H1 *H2 *H3
  632. -1 -2
  633. - DF(AZ,Z)*DF(H3,X)*H1 *H3
  634. -2 -1
  635. + DF(H1,X,Y)*AY*H1 *H2
  636. -2 -1
  637. + DF(H1,X,Z)*AZ*H1 *H3
  638. -3 -1
  639. - DF(H1,X)*DF(H1,Y)*AY*H1 *H2
  640. -3 -1
  641. - DF(H1,X)*DF(H1,Z)*AZ*H1 *H3
  642. -3 -1
  643. - DF(H1,X)*DF(H2,X)*AX*H1 *H2
  644. -3 -1
  645. - DF(H1,X)*DF(H3,X)*AX*H1 *H3
  646. -2 -2
  647. - DF(H1,Y)*DF(H2,X)*AY*H1 *H2
  648. -2 -2
  649. - DF(H1,Z)*DF(H3,X)*AZ*H1 *H3
  650. -1 -1 -1
  651. + DF(H2,X,Z)*AZ*H1 *H2 *H3
  652. -2 -1 2 -2 -2
  653. + DF(H2,X,2)*AX*H1 *H2 - DF(H2,X) *AX*H1 *H2
  654. -1 -2 -1
  655. - DF(H2,X)*DF(H2,Z)*AZ*H1 *H2 *H3
  656. -1 -2 -1
  657. - DF(H2,X)*DF(H3,Y)*AY*H1 *H2 *H3
  658. -1 -1 -2
  659. - DF(H2,Z)*DF(H3,X)*AZ*H1 *H2 *H3
  660. -1 -1 -1
  661. + DF(H3,X,Y)*AY*H1 *H2 *H3
  662. -2 -1 2 -2 -2
  663. + DF(H3,X,2)*AX*H1 *H3 - DF(H3,X) *AX*H1 *H3
  664. -1 -1 -2
  665. - DF(H3,X)*DF(H3,Y)*AY*H1 *H2 *H3
  666. -1 -1 -2 -1
  667. VEC(Y) := DF(AX,X,Y)*H1 *H2 - DF(AX,X)*DF(H1,Y)*H1 *H2
  668. -1 -2
  669. + DF(AX,Y)*DF(H2,X)*H1 *H2
  670. -1 -1 -1
  671. + DF(AX,Y)*DF(H3,X)*H1 *H2 *H3
  672. -2 -1 -2
  673. + DF(AY,Y,2)*H2 + DF(AY,Y)*DF(H1,Y)*H1 *H2
  674. -3
  675. - DF(AY,Y)*DF(H2,Y)*H2
  676. -2 -1
  677. + DF(AY,Y)*DF(H3,Y)*H2 *H3
  678. -1 -1
  679. + DF(AZ,Y,Z)*H2 *H3
  680. -1 -1 -1
  681. + DF(AZ,Y)*DF(H1,Z)*H1 *H2 *H3
  682. -2 -1
  683. + DF(AZ,Y)*DF(H2,Z)*H2 *H3
  684. -1 -2
  685. - DF(AZ,Z)*DF(H3,Y)*H2 *H3
  686. -1 -1 -1
  687. + DF(H1,Y,Z)*AZ*H1 *H2 *H3
  688. -1 -2 2 -2 -2
  689. + DF(H1,Y,2)*AY*H1 *H2 - DF(H1,Y) *AY*H1 *H2
  690. -2 -1 -1
  691. - DF(H1,Y)*DF(H1,Z)*AZ*H1 *H2 *H3
  692. -2 -2
  693. - DF(H1,Y)*DF(H2,X)*AX*H1 *H2
  694. -1 -3
  695. - DF(H1,Y)*DF(H2,Y)*AY*H1 *H2
  696. -2 -1 -1
  697. - DF(H1,Y)*DF(H3,X)*AX*H1 *H2 *H3
  698. -1 -1 -2
  699. - DF(H1,Z)*DF(H3,Y)*AZ*H1 *H2 *H3
  700. -1 -2
  701. + DF(H2,X,Y)*AX*H1 *H2
  702. -1 -3
  703. - DF(H2,X)*DF(H2,Y)*AX*H1 *H2
  704. -2 -1
  705. + DF(H2,Y,Z)*AZ*H2 *H3
  706. -3 -1
  707. - DF(H2,Y)*DF(H2,Z)*AZ*H2 *H3
  708. -3 -1
  709. - DF(H2,Y)*DF(H3,Y)*AY*H2 *H3
  710. -2 -2
  711. - DF(H2,Z)*DF(H3,Y)*AZ*H2 *H3
  712. -1 -1 -1
  713. + DF(H3,X,Y)*AX*H1 *H2 *H3
  714. -1 -1 -2
  715. - DF(H3,X)*DF(H3,Y)*AX*H1 *H2 *H3
  716. -2 -1 2 -2 -2
  717. + DF(H3,Y,2)*AY*H2 *H3 - DF(H3,Y) *AY*H2 *H3
  718. -1 -1 -2 -1
  719. VEC(Z) := DF(AX,X,Z)*H1 *H3 - DF(AX,X)*DF(H1,Z)*H1 *H3
  720. -1 -1 -1
  721. + DF(AX,Z)*DF(H2,X)*H1 *H2 *H3
  722. -1 -2
  723. + DF(AX,Z)*DF(H3,X)*H1 *H3
  724. -1 -1
  725. + DF(AY,Y,Z)*H2 *H3
  726. -2 -1
  727. - DF(AY,Y)*DF(H2,Z)*H2 *H3
  728. -1 -1 -1
  729. + DF(AY,Z)*DF(H1,Y)*H1 *H2 *H3
  730. -1 -2 -2
  731. + DF(AY,Z)*DF(H3,Y)*H2 *H3 + DF(AZ,Z,2)*H3
  732. -1 -2
  733. + DF(AZ,Z)*DF(H1,Z)*H1 *H3
  734. -1 -2
  735. + DF(AZ,Z)*DF(H2,Z)*H2 *H3
  736. -3
  737. - DF(AZ,Z)*DF(H3,Z)*H3
  738. -1 -1 -1
  739. + DF(H1,Y,Z)*AY*H1 *H2 *H3
  740. -2 -1 -1
  741. - DF(H1,Y)*DF(H1,Z)*AY*H1 *H2 *H3
  742. -1 -2 -1
  743. - DF(H1,Y)*DF(H2,Z)*AY*H1 *H2 *H3
  744. -1 -2 2 -2 -2
  745. + DF(H1,Z,2)*AZ*H1 *H3 - DF(H1,Z) *AZ*H1 *H3
  746. -2 -1 -1
  747. - DF(H1,Z)*DF(H2,X)*AX*H1 *H2 *H3
  748. -2 -2
  749. - DF(H1,Z)*DF(H3,X)*AX*H1 *H3
  750. -1 -3
  751. - DF(H1,Z)*DF(H3,Z)*AZ*H1 *H3
  752. -1 -1 -1
  753. + DF(H2,X,Z)*AX*H1 *H2 *H3
  754. -1 -2 -1
  755. - DF(H2,X)*DF(H2,Z)*AX*H1 *H2 *H3
  756. -1 -2 2 -2 -2
  757. + DF(H2,Z,2)*AZ*H2 *H3 - DF(H2,Z) *AZ*H2 *H3
  758. -2 -2
  759. - DF(H2,Z)*DF(H3,Y)*AY*H2 *H3
  760. -1 -3
  761. - DF(H2,Z)*DF(H3,Z)*AZ*H2 *H3
  762. -1 -2
  763. + DF(H3,X,Z)*AX*H1 *H3
  764. -1 -3
  765. - DF(H3,X)*DF(H3,Z)*AX*H1 *H3
  766. -1 -2
  767. + DF(H3,Y,Z)*AY*H2 *H3
  768. -1 -3
  769. - DF(H3,Y)*DF(H3,Z)*AY*H2 *H3
  770. div curl a;
  771. 0
  772. % Examples of integration : (1) Volume integrals
  773. getcsystem 'spherical;
  774. (R THETA PHI)
  775. % Example 1 : integration of r**n over a sphere
  776. origin := avec(0,0,0);
  777. VEC(R) := 0
  778. VEC(THETA) := 0
  779. VEC(PHI) := 0
  780. upperbound := avec(rr,pi,2*pi);
  781. VEC(R) := RR
  782. VEC(THETA) := PI
  783. VEC(PHI) := 2*PI
  784. volintegral(r**n,origin,upperbound);
  785. N 3
  786. 4*RR *PI*RR
  787. --------------
  788. N + 3
  789. % Substitute n=0 to get the volume of a sphere
  790. sub(n=0,ws);
  791. 4 3
  792. ---*PI*RR
  793. 3
  794. % Example 2 : volume of a right-circular cone
  795. getcsystem 'cylindrical;
  796. (R Z PHI)
  797. upperbound := avec(pp*z,h,2*pi);
  798. VEC(R) := Z*PP
  799. VEC(Z) := H
  800. VEC(PHI) := 2*PI
  801. volintorder := avec(2,0,1);
  802. VEC(R) := 2
  803. VEC(Z) := 0
  804. VEC(PHI) := 1
  805. % Integrate in the order : phi, r, z
  806. cone := volintegral(1,origin,upperbound);
  807. 1 3 2
  808. CONE := ---*H *PP *PI
  809. 3
  810. % Now we replace P*Z by RR to get the result in the familiar form
  811. let pp*h=rr;
  812. cone := cone;
  813. 1 2
  814. CONE := ---*H*PI*RR
  815. 3
  816. % This is the familiar form
  817. clear pp*h;
  818. % Example 3 : line integral to obtain the length of a line of latitude
  819. % on a sphere
  820. getcsystem 'spherical;
  821. (R THETA PHI)
  822. a := avec(0,0,1);
  823. VEC(R) := 0
  824. VEC(THETA) := 0
  825. VEC(PHI) := 1
  826. % Function vector is the tangent to the
  827. % line of latitude
  828. curve := avec(rr,latitude,phi);
  829. VEC(R) := RR
  830. VEC(THETA) := LATITUDE
  831. VEC(PHI) := PHI
  832. % Path is round a line of latitude
  833. deflineint(a,curve,phi,0,2*pi);
  834. 2*SIN(LATITUDE)*PI*RR
  835. end;
  836. 4: 4:
  837. Quitting
  838. Sat Jun 29 14:16:18 PDT 1991