Gradient, Divergence, Curl, Laplacian
We give here as an example, the method to calculate the operators gradient, divergence, curl and laplacian in curvilinear coordinates.
We apply the method to the case of spherical coodinates, but the procedure is general.
Initialization
The flavors allow to distinguish between various basis.
The change of flavor is given by ToFlavor[new, old]. ToFlavor[bar] is equivalent to ToFlavor[bar, Identity].
Curvilinear Coordinates
We considera general basis with a red flavor :
where is a canonical orthonormal basis
This red basis is completely determined by its metric tensor
Example : Spherical coordinates
The red basis is generally not normalized (or even sometimes not orthonormal, and we must then first diagonalize g).
So we choose to define an orthonormal "hat" basis ( is the identity matrix) as follows :
and we have the relation, where is chosen the identity matrix,
this allows to calculate as the square root of
We verify that this is correct :
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
and we can check here that the hat basis is orthonormal and ==
,
Gradient of a potential
Gradient of a potential U in curvilinear coordinates :
Curl of a vector
Curl of a vector V in curvilinear coordinates :
Let,
Divergence of a vector
Divergence of a vector in spherical coordinates :
Derivative of the determinant of the metric tensor :
Volume element :
Laplacian of a scalar field
Laplacian of a scalar field in spherical coordinates :
Or also from the expression (A 11) of the divergence,
Which can also be written in a more compact form :
Created by Mathematica (November 27, 2007) | ![]() |