I am trying to convert the following equation in polar form to the cartesian coordinates using Mathematica (Phys. Rev. A 78, 013810 (2008), https://journals.aps.org/pra/abstract/10.1103/PhysRevA.78.013810). I am new in Mathematica, so if somebody can help me it would be great. \begin{eqnarray} \partial_{\tau} W(\tau, r, \varphi) &=& \left\{ (r^2-1)\partial_{\varphi} - \frac{1}{16}\left(\frac{1}{r}\partial_r\partial_{\varphi} + \partial^2_r\partial_{\varphi} + \frac{1}{r^2}\partial^3_{\varphi} \right) \right. \nonumber\\ &+& \left. \xi + \frac{\xi}{2} \left(r +\frac{1}{2}\left(\frac{1}{2} + N\right) \frac{1}{r}\right) \partial_r \right. \nonumber\\ &+& \left.\frac{\xi}{4}\left(\frac{1}{2} + N\right) \left(\partial^2_r + \frac{1}{r^2}\partial^2_{\varphi}\right) \right\}W(\tau, r, \varphi), \end{eqnarray}

where $\gamma = re^{i\varphi}$, $\tau = -\kappa t$ with initial condition $W(0, \gamma) = \frac{2}{\pi} e^{-2|\alpha-\gamma|^2}$.

  • $\begingroup$ polar coordinates uses $r,\theta$ only. But you have 3 coordinates. Spherical uses $r,\theta,\phi$. Is this what you meant? and what does $\partial_r^{2}$ mean? Is this $w_{rr}$ or $w_r^2$? Or may be you mean cylinderical? Who knows. Notation is very confusing to reader. Try to enter the pde in Mathematica code, that will help clear things. $\endgroup$ – Nasser Jul 12 at 13:31
  • $\begingroup$ @Nasser The notation is standard. $\partial^2_r W$ means $W_{rr}$. (But I understand your confusion.) The first coordinate is "time" and the second and third are "spatial". It is the second and third OP wants to transform. $\endgroup$ – Natas Jul 12 at 13:43
  • 1
    $\begingroup$ Kuba wrote a function that allows you to perform a change in coordinates of differential equations. You can find it here: SE Answer (Github) $\endgroup$ – Natas Jul 12 at 13:44
  • 1
    $\begingroup$ @Natas I never like this notation and it is not used much. I prefer $w_r$ and $w_{rr}$ notation instead as I find it much more clear. The notation used in the post seems more common in European eastern block countries. $\endgroup$ – Nasser Jul 12 at 13:53
  • $\begingroup$ @Nasser The notation used in the post is prevalent in the mathematical/theoretical physics community. (And indeed many confusions arise because people don't appreciate that the derivative maps a function to another function.) $\endgroup$ – Natas Jul 12 at 15:19
pde = D[w[t, r, phi], r] == (r^2 - 1)*D[w[t, r, phi], phi] - 
   1/16 (1/r*D[D[w[t, r, phi], r], phi] + 
      D[D[w[t, r, phi], {r, 2}], phi] + 
      1/r^2*D[w[t, r, phi], {phi, 3}]) + zeta + 
   zeta/2*(r + 1/2 (1/2*n)*1/r)*D[w[t, r, phi], r] + 
   zeta/4*(1/2 + n)*(D[w[t, r, phi], {r, 2}] + 
      1/r^2*D[w[t, r, phi], {phi, 2}]);

$$ w^{(0,1,0)}(t,r,\phi )=\frac{1}{4} \left(n+\frac{1}{2}\right) \zeta \left(\frac{w^{(0,0,2)}(t,r,\phi )}{r^2}+w^{(0,2,0)}(t,r,\phi )\right)+\frac{1}{2} \zeta \left(\frac{n}{4 r}+r\right) w^{(0,1,0)}(t,r,\phi )+\left(r^2-1\right) w^{(0,0,1)}(t,r,\phi )+\frac{1}{16} \left(-\frac{w^{(0,0,3)}(t,r,\phi )}{r^2}-\frac{w^{(0,1,1)}(t,r,\phi )}{r}-w^{(0,2,1)}(t,r,\phi )\right)+\zeta $$

 << MoreCalculus`

DChange[pde, "Polar" -> "Cartesian", {r, phi}, {x, y}, w[t, r, phi], 
 Assumptions -> {r > 0 && -Pi < phi <= Pi}]


{-((y*Derivative[0, 0, 1][w][t, x, y] + 
       x*Derivative[0, 1, 0][w][t, x, y])/Sqrt[x^2 + y^2]) == 
     (1/(16*(x^2 + y^2)))*(16*x^2*zeta + 16*y^2*zeta + 
     2*(8*x^5 + 8*x*y^2*(-1 + y^2) + 8*x^3*(-1 + 2*y^2) + 
        4*x^2*y*zeta + 
               y*(-1 - n + 4*y^2)*zeta)*
      Derivative[0, 0, 1][w][t, x, y] + 
     2*(1 + 2*n)*(x^2 + y^2)*zeta*Derivative[0, 0, 2][w][t, x, y] - 
          x^3*Derivative[0, 0, 3][w][t, x, y] - 
     x*y^2*Derivative[0, 0, 3][w][t, x, y] + 
     16*x^2*y*Derivative[0, 1, 0][w][t, x, y] - 
          16*x^4*y*Derivative[0, 1, 0][w][t, x, y] + 
     16*y^3*Derivative[0, 1, 0][w][t, x, y] - 
     32*x^2*y^3*Derivative[0, 1, 0][w][t, x, y] - 
          16*y^5*Derivative[0, 1, 0][w][t, x, y] - 
     2*x*zeta*Derivative[0, 1, 0][w][t, x, y] - 
     2*n*x*zeta*Derivative[0, 1, 0][w][t, x, y] + 
          8*x^3*zeta*Derivative[0, 1, 0][w][t, x, y] + 
     8*x*y^2*zeta*Derivative[0, 1, 0][w][t, x, y] + 
     x^2*y*Derivative[0, 1, 2][w][t, x, y] + 
          y^3*Derivative[0, 1, 2][w][t, x, y] + 
     2*x^2*zeta*Derivative[0, 2, 0][w][t, x, y] + 
     4*n*x^2*zeta*Derivative[0, 2, 0][w][t, x, y] + 
          2*y^2*zeta*Derivative[0, 2, 0][w][t, x, y] + 
     4*n*y^2*zeta*Derivative[0, 2, 0][w][t, x, y] - 
     x^3*Derivative[0, 2, 1][w][t, x, y] - 
          x*y^2*Derivative[0, 2, 1][w][t, x, y] + 
     x^2*y*Derivative[0, 3, 0][w][t, x, y] + 
     y^3*Derivative[0, 3, 0][w][t, x, y]), 
   Association["Mapping" -> {x == r*Cos[phi], y == r*Sin[phi]}, 
  "Assumptions" -> {}]}

But DChange complained about Transformation rule is ambiguous which I am not sure why.

You can download DChange from Analogue for Maple's dchange - change of variables in differential expressions written by Kubba.

| improve this answer | |
  • $\begingroup$ Thanks. The same can be achieved by using the TransformedField module. However, the problem is that the derivatives are still in the form of polar coordinates and not in Cartesian. $\endgroup$ – iknownothing Jul 13 at 8:29

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.