Question: vanishing parentheses

Hi,

I am trying to construct a vector field based on a large expression. Although I put cos(phi) at the end of the expression, written in 2-D Math, the expression gets automatically simplified to cos phi, without parentheses. That causes the command VectorField not to understand the end of the expression and fail building the vector field.

If instead I define the expression in 1-D math, it works perfectly. Like this:

with(VectorCalculus):with(plots):SetCoordinates('polar'[r, phi]):mu := 4*Pi*1e10:epsilon := 8.854187817*1e-12:M:=1:N:=1:A:=0.3:nu:=2e9:

hphi2:=(-1)*epsilon*2*Pi*nu*(BesselJZeros(M,N)/A)*diff(BesselJ(M,(BesselJZeros(M,N)/A)*r),r)*cos(M*phi);

hfld:=VectorField(<r^2,hphi2>,'polar'[r,phi]);

Now if I convert this 1-D expression to 2-D math, it would look exactly like the one I wrote, but this time it works, since it knows there are parentheses there, although they have always been there.

Is there a way to get the 2-D expression working in this case?

All the best,
 

Please Wait...