Curvilinear Coordinate Systems#
In the Pisces Project, every physical model you can generate is backed up by a specific coordinate system defined here in PyMetric. These coordinate systems play a critical role in determining the behavior of various operations and are a necessary step towards doing physics in these exotic coordinate systems. In this guide, we’ll introduce the theory of coordinate systems in a manner akin to that seen in the study of differential geometry.
What is a Curvilinear Coordinate System?#
A curvilinear coordinate system is a system of coordinates in which the coordinate lines may be curved rather than straight. These systems generalize Cartesian coordinates to accommodate more complex geometries and symmetries, making them especially useful in physics, engineering, and geometry.
Unlike Cartesian coordinates where each basis direction is constant and orthonormal, in a curvilinear system:
The basis vectors change direction and magnitude as you move through space.
The coordinate curves (the paths traced out by holding all but one coordinate constant) are generally curved.
The metric tensor varies spatially and encodes the local geometry of the space.
Mathematically, we describe a curvilinear system by a coordinate map:
This map transforms from curvilinear coordinates \((q^1, q^2, \dots, q^n)\) to Cartesian space \(\mathbf{x} \in \mathbb{R}^n\). The coordinate curves are traced by holding all but one \(q^i\) constant and letting \(q^i\) vary.
The tangent vectors to these curves form the coordinate basis:
These basis vectors vary across space and are generally not unit vectors and not orthogonal. Their inner products define the components of the metric tensor:
This tensor captures how distances, angles, and volumes behave locally in the curvilinear space.
Defining a Coordinate System#
A coordinate system in PyMetric is defined by a smooth, invertible mapping from a set of curvilinear coordinates to Cartesian space:
This coordinate map takes a point in the curvilinear domain, expressed in coordinates \((q^1, q^2, \dots, q^n)\), and assigns it a position vector \(\mathbf{x} \in \mathbb{R}^n\).
From this mapping, we define the coordinate basis vectors (also called the tangent basis) by taking partial derivatives of \(\mathbf{x}\) with respect to each coordinate:
These vectors span the tangent space at each point and vary smoothly across the domain. They are generally neither orthogonal nor normalized.
Note
More formally, we state that for any point \(p \in \mathbb{R}^N\), there is a tangent space \(T_p \mathbb{R}^N\) which is a vector space composed of all of the tangent vectors to all of the curves passing through \(p\). This can be made more rigorous in the context of differentiable manifolds (see Tangent Spaces) and leads to the notion of the Tangent Bundle.
As is the case for all vector spaces, the space of all linear maps \(f: T_p \mathbb{R}^N \to \mathbb{R}\) also forms a vector space called the dual space denoted \(T^\star_p \mathbb{R}^N\). It is a special result that for Euclidean space, the dual space is equivalent to the Euclidean space itself (seen as a vector space). We therefore inherit two Euclidean vector spaces at each point in space:
The tangent space (\(T_p\mathbb{R}^N\)) which contains contravariant vectors \(V \in T_p M\) which are expressed in terms of a contravariant basis:
\[\forall V \in T_p \mathbb{R}^N, \exists V^\mu \; \text{s.t.}\; V = V^\mu {\bf e}_\mu.\]The cotangent space (\(T_p^\star \mathbb{R}^N\)) which contains covariant vectors \(V \in T_p^\star M\) which are expressed in terms of a covariant basis:
\[\forall V \in T^\star_p \mathbb{R}^N, \exists V_\mu \; \text{s.t.}\; V = V_\mu {\bf e}^\mu.\]where \({\bf e}^\mu\) are the induced dual basis such that \({\bf e}^\mu ({\bf e}_\nu) = \delta_\nu^\mu\).
To relate the tangent and cotangent spaces, we define the metric tensor: a symmetric, bilinear form that provides an inner product on the tangent space. At each point \(p \in \mathbb{R}^N\), the metric is a map:
which satisfies:
Symmetry: \(g_p(\mathbf{u}, \mathbf{v}) = g_p(\mathbf{v}, \mathbf{u})\)
Bilinearity: linear in each argument
Positive-definiteness (in Euclidean space): \(g_p(\mathbf{v}, \mathbf{v}) > 0\) for all non-zero \(\mathbf{v}\)
In a coordinate basis \(\{ \mathbf{e}_\mu \}\), the metric components are given by:
These components form the metric tensor \(g_{\mu\nu}\), which plays a central role in geometry and analysis.
The metric allows us to map vectors to covectors (and vice versa), effectively bridging the tangent and cotangent spaces. This process is known as raising and lowering indices.
Given a contravariant vector \(V^\mu\), we define its covariant form as:
Similarly, given a covariant vector \(\omega_\mu\), its contravariant form is:
where \(g^{\mu\nu}\) is the inverse metric tensor, satisfying:
These operations allow for seamless transformation between the vector and dual-vector representations and are central to defining geometric operations like gradients, divergences, and Laplacians in curvilinear coordinates.
Note
In PyMetric, the metric is represented as a tensor field defined by the coordinate system. This enables differential operators and field transformations to be expressed in a coordinate-aware and mathematically rigorous way.
Vectors, Tensors, and Beyond#
What is a field on the coordinate system? What is a tensor as a map from the dual and tangent spaces, etc.
Calculations in Curvilinear Coordinates#
Why does calculus differ between coordinate systems?
What coordinate agnostic operations matter in physics?
Displacements, Areas, and Volumes#
Define the volume, area, and line infinitesmals.
Basic Operations#
Gradient
Divergence
Curl
Laplacian