I have the following (simple) system of ODE's that I wish to express in Cartesian coordinates:

\begin{align*} r' &= r(1-r)\\ \theta' &= 1 \end{align*}

Working it out by hand, by differentiating $x = r\cos\theta$, $y = r\sin\theta$, I find

\begin{align*} x' &= r' \cos\theta - r \sin\theta \theta' \\ &= r(1-r)\cos\theta - r\sin\theta \\ &= x(1 - \sqrt{x^2 + y^2}) - y\\ \\ y' &= r' \sin\theta + r \cos\theta \theta' \\ &= r(1-r)\sin\theta + r\cos\theta \\ &= y(1 - \sqrt{x^2 + y^2}) + x \end{align*}

However, using TransformedField like so:

TransformedField["Polar" -> "Cartesian", {r (1 - r), 1}, {r, \[Theta]} -> {x, y}]

the result is:

$$\left\{x \left(1-\sqrt{x^2+y^2}\right)-\frac{y}{\sqrt{x^2+y^2}},\frac{x}{\sqrt{x^2+y^2}}+y \left(1-\sqrt{x^2+y^2}\right)\right\}$$

So does the disagreement come from an error in my calculation (which I have been unable to find), or a misuse/misunderstanding of TransformedField?

  • $\begingroup$ Please, avoid using $\LaTeX$ as it is impossible to copy-paste the results you have provided. $\endgroup$ – Sektor Apr 20 '15 at 12:47

When applied to a List, TransformedField assumes that the elements are components along the unit vectors of the original coordinate system. That's not the case in your equations, because they are derivatives of the coordinates themselves.

So you're using TransformedField where it shouldn't be used. Instead, you can use the chain rule directly as follows:

  j = CoordinateTransformData["Cartesian" -> "Polar", 
    "InverseMappingJacobian", {x, y}],
  mapping = 
   Thread[{r, θ} -> 
     CoordinateTransformData["Cartesian" -> "Polar", 
      "Mapping", {x, y}]]},
 j.{r (1 - r), 1} /. mapping]

(* ==> {-y + x (1 - Sqrt[x^2 + y^2]), x + y (1 - Sqrt[x^2 + y^2])} *)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.