6
$\begingroup$

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?

$\endgroup$

1 Answer 1

4
$\begingroup$

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"].

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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