Cylindrical Vector Field Equation Convsersion to Cartesian

AI Thread Summary
The discussion focuses on converting a magnetic field expressed in cylindrical coordinates to Cartesian coordinates. The original magnetic field equation includes components dependent on the cylindrical basis vectors, which complicates the conversion. Participants express confusion over how to correctly substitute the cylindrical coordinates and basis vectors into Cartesian form, particularly regarding the treatment of the angle θ. It is emphasized that the θ term should not be included in the final expression, as it complicates the representation and can lead to inaccuracies. Ultimately, the conversation highlights the importance of correctly understanding the relationships between cylindrical and Cartesian coordinates to achieve a simplified and accurate expression for the magnetic field.
sittingOnTheFloor
Messages
9
Reaction score
0

Homework Statement


I have been given a changing magnetic field in cylindrical coordinates. The equation is:
\begin{equation}
B(r,\phi,z) = - \frac {B_1} {2} r \hat{r} + (B_0 + B_1z)\hat{z}
\end{equation}
I need to be able to find the magnetic field as a function of x, y, and z.

Homework Equations


From wikipedia,
080195ea9dbea67f1abb54c83fc2fb22ac4bebb1

cf553bbb290f2b6ad76c9cce12f8807d43ab09ee


The Attempt at a Solution


I am really feeling kinda dumb here I can convert cylindrical coordinates to cartesian just fine I just don't know how to do it with a vector field. I am really struggling with how to turn the rhat term into x and y hats. I know that the theta term is zero so the field doesn't depend on theta, and the z term is easy cause its just z. I know that jacobians are sometimes useful when dealing with changing coordinate systems but i don't know how to use them
 
Physics news on Phys.org
sittingOnTheFloor said:
I know that the theta term is zero so the field doesn't depend on theta
This is not true. The cylindric basis vectors ##\hat r## and ##\hat \theta## both depend on ##\theta## and so (since it contains ##\hat r##) will your field. However, that is not the question. The question is how your field is expressed in Cartesian coordinates. What is the problem with just inserting the expression for the basis vectors and coordinates in terms of Cartesian coordinates?
 
Orodruin said:
This is not true. The cylindric basis vectors ##\hat r## and ##\hat \theta## both depend on ##\theta## and so (since it contains ##\hat r##) will your field. However, that is not the question. The question is how your field is expressed in Cartesian coordinates. What is the problem with just inserting the expression for the basis vectors and coordinates in terms of Cartesian coordinates?

okay this is maybe stemming from my misunderstanding of the ##\theta## term. Are you saying it would be

\begin{equation}
B(x,y,z) = - \frac {B_1} {2} {\sqrt{(x^2 + y ^ 2}} \hat{x} - {\sin{\theta}} {\cos{\theta}} \hat{y} + (B_0 + B_1z)\hat{z}
\end{equation}

because this doesn't feel right to me, I don't feel good about the ##\theta## term
 
No, you have not inserted the correct expressions for ##r## and ##\hat r##.
 
shoot didn't properly copy what I had written out

\begin{equation}
B(x,y,z) = - \frac {B_1} {2} {\sqrt{x^2 + y ^ 2}} {\cos{\theta}} {\sin{\theta}}\hat{x} - {\sin{\theta}} {\cos{\theta}} \hat{y} + (B_0 + B_1z)\hat{z}
\end{equation}

You said the r term was wrong though too did you just mean that extra parentheses I forgot to delete or do I have deeper flaws with how I am reading the pictures from the initial thread post?

And if this is correct now, I would be able to just switch out all of the ##\theta##'s for tan^-1(x/y), right?
 
Deeper flaws. Please write out explicitly gow you think ##\hat r## and ##r## are expressed in Cartesian coordinates.
 
I am considering ##r## to be equal to ##\sqrt{x^2 + y^2}## and ##\hat r## to be ##\cos{\theta}\sin{\theta}\hat x## which doesn't sit well with me but that is my (knowingly wrong) reading of the attached pictures
 
Do you know how matrix multiplication works or how to derive the form of the basis vectors?
 
Well I am pretty sure the matrix multiplication for this
cf553bbb290f2b6ad76c9cce12f8807d43ab09ee

looks like
\begin{bmatrix}
\cos{\theta} \hat x + \sin{\theta} \hat y + 0\hat z \\
-\sin{\theta} \hat x+ \cos{\theta} \hat y + 0 \hat z \\
0 \hat x + 0 \hat y + 1 \hat z
\end{bmatrix}

so does that mean that each row of that matrix is what I should be replacing for ##\hat r##, ##\hat \theta##, and ##\hat z##, respectively?
I think that this would give
\begin{equation}
B(x,y,z) = (- \frac {B_1} {2} {\sqrt{x^2 + y ^ 2}}) ({\cos{\theta} \hat x + \sin{\theta} \hat y + 0\hat z}) + ({\arctan{\frac {y}{x}}})({-\sin{\theta} + \cos{\theta} \hat y + 0 \hat z}) + ({B_0 + B_1z})({0 \hat x + 0 \hat y + 1 \hat z})
\end{equation}

and then I would just need to multiply all of those out and do some like terms matching? I still don't feel good about how I am treating the theta term though
 
  • #10
Where did the second term come from? You have no corresponding term in your original expression.
 
  • #11
By second term do you mean the arctan? That is what I am most unsure about, because you had said that I do need to take theta into account but from the original equation it is 0, so instead of the arctan should it be 0?
 
  • #12
Yes, there is no term proportional to ##\hat\theta##. You also need to clean up your expression to get rid of the angle ##\theta## since you were asked to express it in Cartesian coordinates.
 
  • #13
okay, that makes more sense. I can just replace ##\theta## with ##\arctan{\frac {y} {x}}## right, leaving me with
\begin{equation}
B(x,y,z) = (- \frac {B_1} {2} {\sqrt{x^2 + y ^ 2}}) ({\cos({{\arctan{\frac {y}{x}}}}) \hat x + \sin({{\arctan{\frac {y}{x}}}}) \hat y + 0\hat z}) + ({B_0 + B_1z})({0 \hat x + 0 \hat y + 1 \hat z})
\end{equation}

Is that right? It feels a lot better
 
  • #14
That looks quite horrible to be honest. I suggest you try to simplify it. Expressing x and y in terms of the cylinder coordinates should help.
 
  • #15
Ah right well here's where the context of the problems comes in cause this is actually for a program I have to write so as long as it is right it doesn't matter, and it is necessitated that I do keep it in terms of x, y, and z. But if that is right then I would like to thank you a whole whole lot for helping me with this and putting up with my mild incompetent-ness.
 
  • #16
sittingOnTheFloor said:
Ah right well here's where the context of the problems comes in cause this is actually for a program I have to write so as long as it is right it doesn't matter
To be honest, this is neither true nor a very constructive attitude to take. Furthermore, your use of the trigonometric functions result in your expressions not being completely general. If instead you would put some effort in you might learn something and end up with a more useful (and simple) expression. Otherwise this was certainly the last time I help you. I am here to help people who actually want to learn.

sittingOnTheFloor said:
and it is necessitated that I do keep it in terms of x, y, and z.
I never said to put anything else in the end. I said your expression is far messier than it needs to be.
 
  • #17
I guess I misunderstood what you meant by expressing x and y in terms of cylinder coordinates then. Could you explain more what you meant by that? And also how do the trig functions make it not completely general?
 
  • #18
sittingOnTheFloor said:
I guess I misunderstood what you meant by expressing x and y in terms of cylinder coordinates then
I meant exactly that, but seeing their expression in terms of the cylinder coordinates will make it simpler to identify the Cartesian coordinates in an expression with cylinder coordinates.

sittingOnTheFloor said:
And also how do the trig functions make it not completely general?

The inverse trigonometric functions are dubious. In particular, you can change the sign of both x and y and still have the same quotient x/y so the arctan function you have will actually only be correct for half of the combinations of x and y.
 
Back
Top