orthovec.tst 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. %===========================================
  2. %test file for ORTHOVEC version 2, June 1990
  3. %===========================================
  4. showtime;
  5. %example 1: vector identity
  6. a:=svec(a1,a2,a3);
  7. b:=svec(b1,b2,b3);
  8. c:=svec(c1,c2,c3);
  9. d:=svec(d1,d2,d3);
  10. a><b*c><d - (a*c)*(b*d) + (a*d)*(b*c);
  11. %showtime;
  12. %example 2: Equation of Motion in cylindricals
  13. vstart$
  14. 2
  15. v:=svec(vr,vt,vz)$b:=svec(br,bt,bz)$
  16. depend v,r,th,z$
  17. depend b,r,th,z$
  18. depend p,r,th,z$
  19. eom:=vout( vdf(v,tt) + v dotgrad v + grad(p) - curl(b) >< b )$
  20. %showtime;
  21. %example 3: Taylor expansions
  22. on div;
  23. on revpri;
  24. vtaylor(sin(x)*cos(y)+e**z,svec(x,y,z),svec(0,0,0),svec(3,4,5));
  25. vtaylor(sin(x)/x,x,0,5);
  26. te:=vtaylor(svec(x/sin(x),(e**y-1)/y,(1+z)**10),svec(x,y,z),
  27. svec(0,0,0),5);
  28. %showtime;
  29. %example 4: extract components
  30. eom _2;
  31. te _1;
  32. off div;
  33. off revpri;
  34. %showtime;
  35. %example 5: Line Integral
  36. vstart$
  37. 1
  38. dlineint(svec(3*x**2+5*y,-12*y*z,2*x*y*z**2),svec(s,s**2,s**3),s,1,2);
  39. %showtime;
  40. %example 6: Volume Integral
  41. ub:=sqrt(r**2-x**2)$
  42. 8 * dvolint(1,svec(0,0,0),svec(r,ub,ub),6);
  43. %===========================================
  44. % end of test
  45. %===========================================
  46. showtime;
  47. ;end;