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