4 /* until translated and compiled, use .MC file in DOE MACSYMA */
5 if get('vect,'version)=false then load("vect")$
7 /* First, we establish p, q, f, and g as vector entities:*/
9 declare([p, q, f, g], nonscalar) $
10 /* To attempt to prove the following vector identity:*/
11 (p~q).(f~g) + (q~f).(p~g) + (f~p).(q~g) = 0;
12 /* Evidently default simplifications are not drastic
13 enough, so let us try: */
14 vectorsimp(%), expandall;
15 /* Now, to determine the expansion of: */
16 example: laplacian(%pi*(s+h)) = div(3*s*p);
17 vectorsimp(example), expandall:true;
18 /* Now, suppose we wish to find the specific representation of this
19 equation in parabolic coordinates. On MC, LOAD("SHARE;VECT ORTH");
20 gives access to numerous orthogonal curvilinear coordinate definitions.
21 On UNIX and VMS systems, load('vect_orth);. One of
22 these is for parabolic coordinates:
25 parabolic: [[(u^2-v^2)/2, u*v], u, v];
27 /*First, we use the function scalefactors to derive a set of global
28 scale factors, then we use the function express to express its
29 argument in the corresponding coordinate system:*/
31 scalefactors(parabolic) $
32 example:express(example);
34 /*Suppose that s is dependent upon both u and v, h is dependent upon
35 only u, and p is dependent only upon v. To expand the above
36 derivatives, taking advantage of these simplifications:*/
38 depends([s,h],u, [s,p],v) $
41 /* Now, suppose that we are given the following gradient, in parabolic
43 example: [(2*u*v**3+3*u**3*v)/(v**2+u**2),
44 (2*u**2*v**2+u**4)/(u**2+v**2)];
46 /*To determine the corresponding scalar potential, relative to the
47 potential at point [0,0]:*/
51 /*There is an analogous function named VECTORPOTENTIAL that computes the
52 vector potential associated with a given curl vector.*/