orthovec.log 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. Sat Jun 29 14:15:50 PDT 1991
  2. REDUCE 3.4, 15-Jul-91 ...
  3. 1: 1:
  4. 2: 2:
  5. *** + redefined
  6. *** - redefined
  7. *** * redefined
  8. *** / redefined
  9. *** ^ redefined
  10. 3: 3: %===========================================
  11. %test file for ORTHOVEC version 2, June 1990
  12. %===========================================
  13. showtime;
  14. Time: 17 ms
  15. %example 1: vector identity
  16. a:=svec(a1,a2,a3);
  17. A := [A1,A2,A3]
  18. b:=svec(b1,b2,b3);
  19. B := [B1,B2,B3]
  20. c:=svec(c1,c2,c3);
  21. C := [C1,C2,C3]
  22. d:=svec(d1,d2,d3);
  23. D := [D1,D2,D3]
  24. a><b*c><d - (a*c)*(b*d) + (a*d)*(b*c);
  25. 0
  26. %showtime;
  27. %example 2: Equation of Motion in cylindricals
  28. vstart$
  29. Select Coordinate System by number
  30. 1] cartesian
  31. 2] cylindrical
  32. 3] spherical
  33. 4] general
  34. 5] others
  35. 2
  36. coordinate type = 2
  37. coordinates = R,TH,Z
  38. scale factors = 1,R,1
  39. v:=svec(vr,vt,vz)$
  40. b:=svec(br,bt,bz)$
  41. depend v,r,th,z$
  42. depend b,r,th,z$
  43. depend p,r,th,z$
  44. eom:=vout( vdf(v,tt) + v dotgrad v + grad(p) - curl(b) >< b )$
  45. [1] (DF(P,R)*R + DF(VR,R)*R*VR + DF(VR,Z)*R*VZ + DF(VR,TH)*VT
  46. - DF(BR,Z)*R*BZ - DF(BR,TH)*BT + DF(BT,R)*R*BT + DF(BZ,R)*R*BZ
  47. 2 2
  48. - VT + BT )/R
  49. [2] (DF(P,TH) + DF(VT,R)*R*VR + DF(VT,Z)*R*VZ + DF(VT,TH)*VT
  50. + DF(BR,TH)*BR - DF(BT,R)*R*BR - DF(BT,Z)*R*BZ + DF(BZ,TH)*BZ
  51. + VR*VT - BR*BT)/R
  52. [3] (DF(P,Z)*R + DF(VZ,R)*R*VR + DF(VZ,Z)*R*VZ + DF(VZ,TH)*VT
  53. + DF(BR,Z)*R*BR + DF(BT,Z)*R*BT - DF(BZ,R)*R*BR - DF(BZ,TH)*BT)
  54. /R
  55. %showtime;
  56. %example 3: Taylor expansions
  57. on div;
  58. on revpri;
  59. vtaylor(sin(x)*cos(y)+e**z,svec(x,y,z),svec(0,0,0),svec(3,4,5));
  60. 1 2 1 3 1 4 1 5 1 2
  61. 1 + Z + ---*Z + ---*Z + ----*Z + -----*Z + X - ---*X*Y
  62. 2 6 24 120 2
  63. 1 4 1 3 1 3 2 1 3 4
  64. + ----*X*Y - ---*X + ----*X *Y - -----*X *Y
  65. 24 6 12 144
  66. vtaylor(sin(x)/x,x,0,5);
  67. 1 2 1 4
  68. 1 - ---*X + -----*X
  69. 6 120
  70. te:=vtaylor(svec(x/sin(x),(e**y-1)/y,(1+z)**10),svec(x,y,z),
  71. svec(0,0,0),5);
  72. 2 4
  73. 360 + 60*X + 7*X
  74. TE := [--------------------,
  75. 360
  76. 2 3 4 5
  77. 720 + 360*Y + 120*Y + 30*Y + 6*Y + Y 2
  78. ------------------------------------------,1 + 10*Z + 45*Z
  79. 720
  80. 3 4 5
  81. + 120*Z + 210*Z + 252*Z ]
  82. %showtime;
  83. %example 4: extract components
  84. eom _2;
  85. -1 -1 -1
  86. - R *BR*BT + R *VR*VT + DF(BZ,TH)*R *BZ - DF(BT,Z)*BZ
  87. -1 -1
  88. - DF(BT,R)*BR + DF(BR,TH)*R *BR + DF(VT,TH)*R *VT + DF(VT,Z)*VZ
  89. -1
  90. + DF(VT,R)*VR + DF(P,TH)*R
  91. te _1;
  92. 1 2 7 4
  93. 1 + ---*X + -----*X
  94. 6 360
  95. off div;
  96. off revpri;
  97. %showtime;
  98. %example 5: Line Integral
  99. vstart$
  100. Select Coordinate System by number
  101. 1] cartesian
  102. 2] cylindrical
  103. 3] spherical
  104. 4] general
  105. 5] others
  106. 1
  107. coordinate type = 1
  108. coordinates = X,Y,Z
  109. scale factors = 1,1,1
  110. dlineint(svec(3*x**2+5*y,-12*y*z,2*x*y*z**2),svec(s,s**2,s**3),s,1,2);
  111. 68491
  112. -------
  113. 42
  114. %showtime;
  115. %example 6: Volume Integral
  116. ub:=sqrt(r**2-x**2)$
  117. 8 * dvolint(1,svec(0,0,0),svec(r,ub,ub),6);
  118. 3
  119. 16*R
  120. -------
  121. 3
  122. %===========================================
  123. % end of test
  124. %===========================================
  125. showtime;
  126. Time: 7684 ms
  127. ;
  128. end;
  129. 4: 4:
  130. Quitting
  131. Sat Jun 29 14:15:59 PDT 1991