It is known that vector calculus in 3D takes quite a simple form when one uses orthonormal curvilinear coordinates (check out, for example, here, in section "Differentiation"). Is there any possibility to easily use this approach in Mathematica currently (giving just metric tensor $g$ and using some kind of "Laplacian($f$, $g$)" and "Gradient($f$, $g$)", for instance)?


If you are satisfied with the metrics defined in CoordinateChartData[]:

CoordinateChartData[] //Short


then you can do things like:

Grad[f[r, θ, z], {r, θ, z}, "Cylindrical"] //TeXForm

$\left\{f^{(1,0,0)}(r,\theta ,z),\frac{f^{(0,1,0)}(r,\theta ,z)}{r},f^{(0,0,1)}(r,\theta ,z)\right\}$


Laplacian[g[r, θ, ϕ], {r, θ, ϕ}, "Spherical"] //TeXForm

$\frac{\frac{g^{(0,2,0)}(r,\theta ,\phi )}{r}+g^{(1,0,0)}(r,\theta ,\phi )}{r}+g^{(2,0,0)}(r,\theta ,\phi )+\frac{\csc (\theta ) \left(\sin (\theta ) g^{(1,0,0)}(r,\theta ,\phi )+\frac{\cos (\theta ) g^{(0,1,0)}(r,\theta ,\phi )}{r}+\frac{\csc (\theta ) g^{(0,0,2)}(r,\theta ,\phi )}{r}\right)}{r}$


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.