125 Reputation

4 Badges

3 years, 339 days

MaplePrimes Activity

These are questions asked by DarkMath


I defined a vector (in cartesian coordinates) with Physics[Vectors] as

q_:=3 _i + 5 _j + 2 _k

Then I wanted do a transformation on this vector by multiplying it with matrix


However, I am getting a result where every element of the matrix is multiplied by the vector.

If I define q as <3,5,2> then matrix multiplication works as one would expect.

So, my question is how can I have a matrix multiplication with a vector defined with Physics[Vectors] package?


When I create a vector in spherical coordinates and map it to cartesian coordinates with Physics[Vectors] package as follows,

q_:=a _r + b _theta + c _phi

I get the answer:

(a*cos(phi)*sin(theta)+b*cos(phi)*cos(theta)-c*sin(phi)) i + (a*sin(theta)*sin(phi)+b*cos(theta)*sin(phi)+c*cos(phi)) j + (-b*sin(theta)+a*cos(theta)) k

which is what I would expect.

But if I try to do that with VectorCalculus package as follows,

q := SetCoordinates(<a, b, c>, spherical)
MapToBasis(q, cartesian)

This gives 

(a*sin(b)*cos(c)) ex + (a*sin(b)*sin(c)) ey + (a*cos(b)) ez

I am confused about this!

The SetCoordinates(<a, b, c>, spherical) command outputs

q:=(a) er  + (b) ephi + (c) etheta

here, a,b, and c are  depicted as the components of the vector q in spherical coordinates, but when I map to cartesian coordinates, a,b, and c are treated as if they were the coordinates in spherical coordinates rather than components-- unlike ChangeBasis in Physics[Vectors] package.

Why are these two different?


I would like to define two vectors in spherical coordinates (preferably using Physics[Vectors] package) such that these two vectors have the magnitudes of r1 and r2, resepctively, but pointing in different directions.

In Physics[Vectors] package, basis vectors _r,_theta,_phi are predefined. So, I cannot define the vectors as r1_:=r1*_r1 and r2_:=r2*_r2 and use all the cool features of physics package.

I will eventually be needing the norm of the difference of these vectors at a later calculation, but this representation turned out to be a problem.

I am avoiding to define these vectors  in cartesian basis with spherical coordinates such as r1_=r1*(sin(theta1)*cos(phi1) i + sin(theta1)*sin(phi1) j + cos(theta1) k), etc. which is a work around. 

How can I do this in Maple?

Thank you.





How one can plot a vector (field) defined in Physics[Vectors] package ?

F_:=r _r + phi^2 _phi

I could normally use fieldplot/fieldplot3d from plots package to plot vector fields from VectorCalculus package, but with Physics[Vectors] package, I am not sure how to plot these. Can you show me a way to plot Physics[Vector] vectors?



I was wondering if it is possible to write a 1st order differential equation in differential form?


Instead of writing the diff eq in 


is it possible to to write something like

ode: -(x^2+x*y(x))*D(x)+ (1)*D(y(x))=0


1 2 3 Page 2 of 3