Re: Re: coordinate transformation

*To*: mathgroup at smc.vnet.net*Subject*: [mg13316] Re: [mg13169] Re: [mg13117] coordinate transformation*From*: David Withoff <withoff>*Date*: Mon, 20 Jul 1998 02:49:31 -0400*Sender*: owner-wri-mathgroup at wolfram.com

In comments about the Calculus`VectorAnalysis` package, Sean Ross wrote: > This whole issue becomes painfully clear with the following exercise: > Take two cartesian vectors and their cross product. Transform the > vectors into cylindrical or spherical coordinates using the transforms > like those in the mathematica package and take their cross product in > cylindrical/spherical coordinates and transform the result back to > cartesian and compare the two. My hat off to anyone who gets the > correct answer the first two or three times trying. Here is (what appears to me to be) a straightforward way to do this. Load the Calculus`VectorAnalysis` package. In[1]:= << Calculus`VectorAnalysis` Pick two random vectors. In[2]:= v1 = {Random[], Random[], Random[]} Out[2]= {0.024333, 0.508814, 0.453102} In[3]:= v2 = {Random[], Random[], Random[]} Out[3]= {0.223088, 0.775283, 0.603609} Compute the cross product. By default, the vectors are assumed to be given in cartesian coordinates, and the result is given in cartesian coordinates. In[4]:= CrossProduct[v1, v2] Out[4]= {-0.0441579, 0.0863939, -0.0946451} Now do the computation in spherical coordinates. Convert the vectors to spherical coordinates. In[5]:= sv1 = CoordinatesFromCartesian[v1, Spherical] Out[5]= {0.681751, 0.843818, 1.52301} In[6]:= sv2 = CoordinatesFromCartesian[v2, Spherical] Out[6]= {1.00756, 0.928444, 1.29062} Compute the cross product, treating the vectors as vectors in spherical coordinates, and giving the result in spherical coordinates. In[7]:= sprod = CrossProduct[sv1, sv2, Spherical] Out[7]= {0.135542, 2.34378, 2.0433} Convert this result from spherical coordinates back to cartesian coordinates. In[8]:= CoordinatesToCartesian[sprod, Spherical] Out[8]= {-0.0441579, 0.0863939, -0.0946451} Observe that Out[4] and Out[8] are the same. Is there some *specific* way that the functions in that example, or anything else about the Calculus`VectorAnalysis` package, could be changed so as to address your concerns? You have distributed various broad warnings about disagreements between Mathematica and "physical mathematics", but you haven't offered any specific proposals for what Mathematica should do instead, or any specific Mathematica examples or other information sufficient to illustrate what it is that we are being warned about. I'd like to be able to help, but I can't tell what, if anything, could be changed in Mathematica to make it more appropriate for your work, or if there is an error in your understanding of the underlying physics and mathematics. Specific examples, or better yet, specific proposals for how you think Mathematica should behave, are desperately needed here. Dave Withoff Wolfram Research