Message Boards Message Boards

0
|
6376 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Transforming vector field polar to cartesian using TransformedField

Posted 11 years ago
Hi,
I just tried the command TransformedField in Mathematica 9 because I want to convert vector fields between cartesian coordinates in 2D and polar coordinates. But I do not get the output I expect:
I want to convert the ODE $\dot{r} = 0, \dot{\theta} = 1$ into cartesian coordinates. I think it should work like this:
In[2]:=TransformedField[
  "Polar" -> "Cartesian",
  {0, 1},
  {r, \[Theta]} -> {x, y}
  ]

Out[2]= {-(y/Sqrt[x^2 + y^2]), x/Sqrt[x^2 + y^2]}
I would expect { -y, x } as the output.
Because this is what I get when deriving $x(t) = r(t) \cos ( \theta(t) )$ with respect to t by hand -- the same for $y(t) = r(t) \sin ( \theta(t) ) ).

My question: Did I misunderstood the functionality of TransformedField? Or is this some kind of bug (I run Mathematica 9.0.1.0 on a 64-bit Linux).

I hope someone can resolve my confusion.

Frank
POSTED BY: Frank Weilandt
2 Replies
Posted 11 years ago
Ah, thank you, Frank. After reading your explanation and doing some research online, I noticed that I did not understand correctly what TransformedField is supposed to do. It does not transform my ordinary differential equation, but the vector field. I assumed that was exactly the same thing, but it is not.
POSTED BY: Frank Weilandt
If the field has a value of 1 in the direction of increasing theta, then its magnitude is independent of the distance from the origin, which is true of the answer Mathematica provided.  Your expected answer of {-y, x} increases in magnitude as the distance from the origin increases.  To see this, I suggest you do
VectorPlot[{-(y/Sqrt[x^2 + y^2]), x/Sqrt[x^2 + y^2]}, {x, -1,
  1}, {y, -1, 1}]
and
VectorPlot[{-y, x}, {x, -1, 1}, {y, -1, 1}]
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract