6

You all may have seen something like this:

U = Laplacian[Phi, {r, theta, phi}, "Spherical"]

What I want is to add my own Chart with its own coordinates, metric and so on. Is it possible?

Kuba
  • 136,707
  • 13
  • 279
  • 740
tajimura
  • 61
  • 1

1 Answers1

4

It is not documented, but the functionality does exis, assuming you only want to do all your computations in the given patch. I have a more detailed answer here focusing on how to compute covariant derivatives. You can the use this patch anywhere a would use a single, named coordinate system, for example:

vars = {r, \[Theta], \[Phi]};
patch = SymbolicTensors`ScaleFactorGeometryPatch[{1, a r, a r Sin[\[Theta]]}, vars];
Laplacian[u @@ vars, vars, patch] // Simplify

If you want a non-diagonal metric, you need to use the full tensor language:

patch = SymbolicTensors`RiemannianGeometryPatch[
   SymbolicTensors`Tensor[
       {{1, a, 0}, {a, r^2, 0}, {0, 0, r^2 Sin[\[Theta]]}}, 
       {SymbolicTensors`CotangentBasis[vars],  SymbolicTensors`CotangentBasis[vars]}
   ], 
   vars
];

If you're just computing scalar Laplacians, this won't matter, but it will automatically compute an orthonormal basis to use if you compute, say, the Grad of a scalar or list. This basis can be extracted using patch["OrthonormalBasis"]. All properties can be extracted using patch["Properties"].

Itai Seggev
  • 14,113
  • 60
  • 84