1. Introduction
Geodesic trajectories represent the paths on a curved surface, whose acceleration has no component on the local tangent plane to the surface. In many common scenarios, a geodesic represents the straightest path between two points. In particular, in a Riemannian manifold, geodesics are characterized by the property of having no geodesic curvature [
1,
2].
Most of the general studies on geodesics’ trajectories are provided as initial value problems, while most of the boundary value problems are related to the biaxial and triaxial ellipsoid. In [
3], the boundary value problem on an ellipsoid with boundary (Dirichlet) conditions is replaced by an initial value problem with Dirichlet and Neumann conditions. In particular, the Neumann condition is obtained iteratively by numerically integrating a system of four first-order differential equations. Triaxial ellipsoids are considered in [
4,
5], while [
6] has provided an analytical approach to solve this boundary value problem with symmetry. Reference [
7] contains, because of its importance to terrestrial geodesy, a rich literature survey on the geodesic equations for low eccentric ellipsoid in both Cartesian and polar coordinates. Since the problem of fitting ellipsoid is important in geodesy (all geodetic calculations are performed on a reference ellipsoid), Refs. [
5,
8] analyzes the computational differences in the fitting ellipsoid using biaxial ellipsoid instead of triaxial ellipsoid and by performing least-squares ellipsoid fitting. Noteworthy, Reference [
7] has improved (in terms of computational time) the existing solutions using differential equations in Cartesian coordinates and Taylor series expansions by simplifying previous formulations.
In this study, the geodesic boundary value problem is numerically investigated for
any curved surface using the general geodesic equations from differential geometry. These geodesic equations are then solved by nonlinear least-squares using the method that the Theory of Functional Connections [
9] (TFC) has introduced to solve differential equations [
10,
11]. The existence of a solution for the geodesic boundary value problem (boundary value problems, in general, may have a unique solution, no solution, or infinite solutions) is guaranteed by the Hopf–Rinow theorem [
12,
13]:
If a length-metric space is complete and compact then any two points, , can be connected by a minimizing geodesic.
In this theorem, M indicates a manifold and d the metric distance. Roughly speaking, complete indicates a space where there are no “points missing” from it (inside or at the boundary), while compact indicates a space that is closed (space bounds included) and bounded (distance between any two points limited).
Motivated by this theorem, this study proposes a general numerical and accurate approach to solve boundary value geodesic problems in curved surfaces. First, this study briefly provides the geodesic equations for the general Riemannian spaces, followed by a short background on TFC. Then, it shows how to apply TFC to solve boundary value geodesic problems by nonlinear least-squares. In particular, an ad hoc algorithm to avoid local minima is presented.
The proposed approach is then numerically tested on various quadric surfaces, such as triaxial ellipsoid, elliptic hyperboloid, elliptic paraboloid, hyperbolic paraboloid, torus, one-sheeted hyperboloid, Moëbius strip, and on a generic surface. In all these tests, machine error estimation of the geodesic trajectory is obtained along with the indirect numerical proof that the associated parametric velocity is constant.
2. Background on Geodesics Equations on Riemannian Manifold
A Riemannian manifold is a smooth curved space in which the infinitesimal distance,
, satisfies
where
is the covariant metric tensor of the space and where Einstein’s notation has been used in Equation (
1).
The metric tensor is the fundamental tool used in differential geometry to study curved spaces. Specifically, for Euclidean spaces, the metric tensor is diagonal (
if
) and, in particular, is the identity,
, for the Cartesian metric tensor. The metric tensor,
, is the matrix composed by all inner products between all partials of the vector defining the Riemannian surface,
In Riemannian geometry, geodesics are not the same as “shortest curves” between two points, though the two concepts are closely related. The difference is that geodesics are only locally the shortest distance between points. Going the “long way round” on a great circle between two points on a sphere is a geodesic but not the shortest path between the points. In addition, geodesic paths need not be unique.
On a curved surface, the length of a parametric trajectory, defined by the coordinates
and connecting the position vectors,
and
, respectively, is,
This parametric trajectory has no normal acceleration if it satisfies the following
n differential equations [
1,
2,
14],
These
n second-order ordinary differential equations are the
geodesic equations. They define the geodesic trajectories on a manifold with metric tensor,
. In Equation (
3), the
terms are the Christoffel symbols of second kind, defined as,
where
is the controvariant inverse of the covariant metric tensor (or conjugate or dual metric),
Note that the Christoffel symbols satisfy the relationship, and are related to the Christoffel symbols of the first kind, , by the relationship, .
Geodetic (Parametric) Velocity
A curve on a surface is called geodesic if, at every point, the acceleration is either zero or parallel to the normal. A geodesic trajectory,
, on a curved surface has constant parametric speed. The proof is immediate,
The word “velocity,” here, is not the instantaneous ratio between distance and time, but the instantaneous ratio between distance and the parameter
t selected to describe the trajectory (which can also be the time).
Let us consider a two-dimensional surface in a three-dimensional space. Let the surface be described by the parametic equations,
then, by computing,
the velocity in a trajectory defined by
, is provided by
.
To give a trivial example, the parametric description of a unit-radius sphere is provided by,
where
and
. The covariant metric tensor and the geodesic equations for the sphere are,
respectively, and the geodetic parametric velocity on the sphere is,
Note that
and
make singular the
matrix and, consequently, make singular the geodesic equations. This singularity changes location if another set of polar coordinates is selected to describe a sphere.
3. Background on the Theory of Functional Connections
The Theory of Functional Connections (TFC) is a mathematical framework to perform
functional interpolation [
9,
15]. This is performed by analytically deriving some functionals, called
constrained expressions, representing
all functions satisfying a set of linear constraints in
n-dimensional space. This way, constrained optimization problems subject to linear constraints, such as differential equations, are transformed into unconstrained problems. The optimization problem consists then of deriving the expression of an unconstrained
free function,
(Note that
can be discontinuous, partially defined, and even the Dirac delta function, as long as it is defined on where the constraints are defined.).
In general, for a univariate function,
, subject to
n linear constraints (e.g., points, derivatives, integrals, and any linear combination of them), two equivalent definitions of constrained expressions can be introduced [
15,
16,
17],
In the formal definition of Equation (
5), the
are
functional coefficients whose expressions are derived by imposing the
n constraints on (
5), and the
are a set of
n user-defined linearly independent
support functions. In Equation (6), the
are
switching functions which imply changing between the constraints, and the
are
projection functionals, which project the free function
to the
kth constraint. See Ref. [
9] for a complete and detailed explanation of these terms.
For example, consider a function
subject to the constraints
Using the form given in Equation (
5) with
and
the constraints in Equation (
7) can be expressed as
where the two constants
and
are computed from Equations (
7) and (
8) as follows:
from which,
Substituting the
and
expressions into Equation (
8), the following
constrained expression,
is obtained for the constraints given in Equation (
7). Equation (
9) satisfies the constraints (
7),
no matter what the free function is. Moreover, Equation (
9) indicates the expressions of the switching functions,
, and the projection functionals,
. Here, the meaning of the switching functions becomes more clear: when the first constraint,
, holds then
and
when the second constraint,
, holds then
and
. The projection functionals are scalars in this univariate case, but they become functionals in the multivariate case (see [
9] for full explanation).
The multivariate TFC [
9,
16] extends the original univariate theory [
15] to
n dimensions and to any linear (boundary and/or internal) constraints. This extension can be summarized by the expression,
where
is the vector of
n coordinates,
is a function specifying the linear constraints,
is
any interpolating function satisfying the linear constraints, and
is the free function. Several examples on how to derive constrained expressions can be found in [
9,
17,
18].
The Theory of Functional Connections has been developed for points, derivatives, integrals, infinite, component constraints, and any linear combination of them for univariate functions [
15] as well as multivariate functions [
16] in rectangular domains, while in generic domains some initial results have been obtained via domain mapping [
19]. The main feature of these functionals (constrained expressions) is that they allow for restricting the whole function space of a constrained optimization problems to just the space of its feasible solutions, fully satisfying the constraints. This way, a large number of constrained optimization problems can be transformed into unconstrained ones, which can be solved by more simple, efficient, robust, reliable, fast, and accurate methods.
The first application of TFC was in solving linear [
10] and nonlinear [
11] ODEs. This has been conducted by expanding the free function
in terms of a set of basis functions (e.g., orthogonal polynomials, Fourier, neural networks, etc.). Linear or nonlinear least-squares method is then used to find the coefficients of the expansion. This TFC approach for solving ODEs has many advantages over traditional methods: (1) it consists of a unified framework to solve IVP, BVP, or multi-valued problems, (2) it provides an analytically approximated solution that can be used for subsequent manipulation (derivatives, integrals), (3) the solution is usually obtained in millisecond and at machine error accuracy, (4) the procedure is numerically robust (small condition number), and (5) it can solve differential equations subject to a variety of different constraint types. Additionally, TFC has been also applied to solve other mathematical optimization problems [
20] such as in: homotopy continuation for control problems [
21], epidemiological models [
22], radiative transfer problems [
23], rarefied-gas dynamics [
24], Timoshenko-Ehrenfest beam [
25], hybrid systems [
26], machine learning [
27,
28,
29,
30], quadratic and nonlinear programming problems subject to linear equality constraints [
31], orbit transfer and propagation [
18,
32,
33], optimal control problems via indirect methods, relative motion [
34], landing on small and large planetary bodies [
35], and intercept problems [
30].
4. Solving the Geodesic Equations Using the Theory of Functional Connections
Any trajectory on a two-dimensional surface in three-dimensional space can always be described by two coordinates, , depending on a parameter t. Specifically, let us consider a trajectory from an initial point to a final point , while the parameter range is .
All possible trajectories,
, connecting
to
, can be represented by the following two functionals (constrained expressions) [
9]
where
and
are two free functions and where it has been set
,
,
, and
.
No matter what the functions, and are, the Equation (
10) always generate trajectories moving from
to
, as
t increases from
to
.
The parametric derivatives of Equation (
10) are,
Let us express the free functions,
and
, as a linear combination of linearly independent basis functions,
, (e.g., orthogonal polynomials). Then,
The geodesic equations provided in Equation (
3) can be solved using the expressions given in Equations (
10) and (
11), with the free functions expanded as in Equation (
12), and by discretizing the parameter
t from
to
. (When expressing the free functions in terms orthogonal polynomial, the best discretization of
t for the least-squares problem is obtained by the Chebyshev–Gauss–Lobatto points distribution.) The resulting equations are two nonlinear algebraic equations in the unknown coefficient vectors,
and
, that can be solved by nonlinear least-squares,
is the Jacobian of the system.
Note that, the constrained expressions given in Equation (
10) are derived using constant and linear terms of support functions. This implies that the set of basis functions adopted in the least-squares process for the free functions,
and
, cannot include both the constant and the linear terms. For instance, if Chebyshev orthogonal polynomials are selected as support functions, then
and
must be excluded, otherwise the matrix to invert in the least-squares process becomes singular. This is because a least-squares process of a linear combination of functions is singular if not all the functions are linearly independent.
Initial Guess and the Local Minima Problem
Since the constrained expressions provide trajectories always satisfying the constraints (for any expression of the free functions), then the most natural (and simplest) initial guess is to start the iterative least-squares solving Equation (
13) by setting
. This is equivalent to initially select
and, consequently—see Equation (
10)—, selecting an initial linear variation of the parametric variables,
u and
v, from the initials (
) to the final values (
).
Nonlinear least-squares applied to find the geodesic trajectory is, unfortunately, a process affected by local minima. Typically, when an iterative procedure enters into the convergence phase, then each following step is smaller than the previous,
This convergence criteria has two interesting aspects: (1) it can be used to push the convergence to the maximum accuracy and (2) no tolerance is needed to stop the iterations. In fact, when the convergence reaches the maximum accuracy, the procedure cannot anymore improve the estimation of
and the inequality,
, happens because of numerical errors (convergence saturation).
Figure 1 shows the flowchart of the algorithm adopted to avoid local minima. Starting with
, the least-squares iterations continue until Equation (
14) is verified for
N consecutive times (initial convergence loop). During this sequence, if the least-squares diverges, then the algorithm restarts with a new random initial guess. If Equation (
14) is verified for
N consecutive times, then the algorithm enters into the convergence loop and exits when
is experienced. Then, the
norm of the residuals is computed. The
norm of the residuals allows one to discriminate local minima and global minima (associated with the geodesic trajectory) using a small tolerance, such as
. If
then the algorithm restarts with a new random initial guess.
5. Numerical Validations
In this section, some boundary value geodesic problems are numerically solved to validate the proposed methodology on 2-dimensional surfaces, for visualization purposes. The proposed approach has been tested on eight different kind of surfaces: triaxial ellipsoid, elliptic hyperboloid, elliptic paraboloid, hyperbolic paraboloid, one-sheeted hyperboloid, torus, Moëbius strip, and a generic surface. Six of them are shown in
Figure 2.
5.1. Triaxial Ellipsoid
A (non-oriented) triaxial ellipsoid is described by,
where
and
, and
are the three ellipsoid semi-major axes. The covariant metric tensor for the ellipsoid is,
Since the ellipsoid is an affine image of the unit sphere, it is affected by the same singularity problem, occurring for
and
.
By setting
,
, and
, the geodesic equations for this ellipsoid are [
36],
To solve these differential equations using nonlinear least-squares, the following partials must be evaluated to compute the Jacobian of the system,
Figure 3 shows the numerical results using 40 basis functions (Legendre orthogonal polynomials) to describe the free functions and 200 discretization points. This test validates the approach in terms of fast convergence (just six iterations using a noisy initial guess) and in terms of finding constant the parametric velocity.
The geodetic velocity on a generic triaxial ellipsoid has components,
5.2. Elliptic Paraboloid
For the elliptic paraboloid, the geodesic equations and the TFC solution procedure are provided. The parametric equations of the elliptic paraboloid,
, can be described by the vector,
where
and
. The partials of the generic point,
, are
from which the metric tensor,
and its inverse,
are derived. The non-null Christoffel symbols are derived using Equation (
4),
The geodesic equations, given in Equation (
3), become
After substituting the Christoffel symbols and rearranging the equations, the geodesic equations for the elliptic paraboloid become,
To solve these differential equations using nonlinear least-squares, the same structure of partials provided in Equation (
15) must be evaluated to compute the Jacobian of the system, where
Note that, the elliptic paraboloid can also be expressed by,
, where
u and
v are angles. In this case, the geodesic equations provided in Equation (
16) can be rewritten as,
and the following partials must be computed to solve the boundary value problem,
where,
and,
This second parametrization of the elliptic paraboloid is provided because a particular attention must be given to the boundary value of angles to avoid discontinuous angle evolution. For example, if the absolute difference between the two angles is
, then the value of the smallest of these two angles is increased by
. This avoids the discontinuity at
while unchanging the problem. For instance, if
and
, then the value of
is set as
.
Geodesic (Parametric) Velocity on an Elliptic Paraboloid
The derivative of the position vector is,
Therefore, the velocity is provided by,
Since the velocity on a geodesic is constant, then the (instantaneous) value
for a geodesic is not a function of
t and, therefore, the expression of
must coincide with the average value of the velocity which, in turn, can be computed using Equation (
2),
therefore, for a geodesic trajectory on the elliptic paraboloid, we have a closed form expression for the integral,
5.3. Elliptic Hyperboloid
The parametric description of the elliptic hyperboloid is,
and his covariant metric tensor is,
By setting
,
, and
, the geodesic equations are,
The geodesic velocity components on the elliptic hyperboloid are,
Figure 4 provides detailed information of the test results using 40 basis functions (for the free functions) and 300 points discretization. In this case, a very noisy initial guess is selected (black trajectory on the left/top figure), instead of the simple,
. The right/top figure shows, for subsequent iterations, the
norm of the error. The procedure entered into the convergence phase after about 35 iterations. The convergence loop pushed the accuracy to the limit, when
occurred. The final solution residuals are shown in the left/bottom figure, while the central/bottom figure shows the initial and final solutions for
and
. Finally, the right/bottom figure gives the parametric velocity of the initial guess (black) and of the final (red) solution (geodesic trajectory). This validates the parametric velocity with a constant value. For this example, no local minima were ever experienced (convex problem).
5.4. Hyperbolic Paraboloid
The parametric description of the hyperbolic paraboloid is,
the covariant metric tensor for the hyperbolic paraboloid is
and the Christoffel symbols are,
,
,
, and
, while the geodesic equations are,
The expression of the geodesic velocity on hyperbolic paraboloid is,
Figure 5 contains the results obtained on hyperbolic paraboloid (same meaning than those provided for the elliptic paraboloid), while
Table 1 shows the
norm of the error step,
, and the associated
norm of the differential equations residuals,
, for the first 8 iterations.
5.5. Generic Surface
Let us consider the surface identified by,
in the range
. By setting,
and
, the metric tensor and its inverse for this surface are,
and the nonzero Christoffel symbols are,
The geodesic equations can be written in the compact form,
where,
The partials forming the Jacobian matrix in the least-squares process are,
where,
and,
and,
Figure 6 gives the results obtained for this specific generic surface. The convergence is obtained in just 8 iterations, using 30 basis functions for the free functions and a 300 point discretization. The constancy of the parametric velocity is an alternative way validating the solution as a geodesic trajectory.
5.6. One-Sheeted Hyperboloid
This surface is described by the parametric vector,
The covariant and the contravariant associated metric tensors are,
and the nonzero Christoffel symbols are,
This implies the geodesic equations for one-sheeted hyperboloid,
To apply the nonlinear least-squares, the following partials must be computed,
The expressions of these partials are,
The parametric velocity is given by
The results of the test conducted on the one-sheeted hyperboloid are reported in
Figure 7 where the sub-figures provide full information of the least-squares process. The free functions were expanded by 40 basis functions (Legendre orthogonal polynomials) and the discretization was conducted by 300 points.
5.7. Torus
The implicit and parametric equation of the torus are,
where
R and
r are the two torus radii. The covariant metric tensor for the torus is,
while the geodesic equations are,
The partials needed to populate the Jacobian are,
and the nonlinear least-squares can be performed using Equation (
13). The geodetic parametric velocity on the torus is,
The sub-figures given in
Figure 8 show the details of the least-squares process to estimate the geodesic trajectory on the torus surface. The number of basis functions were 40 and the number of discretization points were 300. The constancy of the velocity as well as the machine-level
norm of the differential equations residuals validate the estimated geodesic trajectory (in red).
5.8. Moëbius Strip
The last test of the proposed least-squares approach is performed on the Moëbius strip, which can be described by,
where
and
. The metric tensor and its inverse for this surface can be given in a compact form by setting,
,
while the nonzero Christoffel symbols are,
Hence, the geodesic equations of the Moëbius strip are,
which can be written as,
where
Figure 9 provide all information about this last test validation case.
Table 2 details the iterative results: the
norm of the accuracy gain and the
norm of the differential equation at each iteration. The iterative process ended because
, due to numerical convergence saturation.
5.9. Discussions
In this article, a new general method to numerical solve boundary value geodesic problems in curved surfaces is presented. The approach takes advantage of the ability to derive special functionals, called constrained expressions, which always satisfy assigned boundary conditions. The proposed approach has been validated by performing numerical tests on several two-dimensional surfaces. In theory, this approach can be extended to manifolds in higher Riemannian spaces. This will require more computational capability than that used for this article and, most likely, optimized and compiled code, instead of the MATLAB interpreter adopted.
The problem of finding the geodesic by least-squares introduces the risk of getting stuck on some local minima. A simple algorithm has been developed to mitigate this problem. Thanks to this algorithm, all boundary geodesic problems considered were quickly solved with machine-error level accuracy, which is an acceptable definition of an exact solution by engineers.
This article restricts the research on finding geodesic trajectories on surfaces that are continuous and differentiable. The problem of finding geodesic-type trajectories on discretized surfaces, which is solved by combinatorial/computational algorithms and methods, is not taken here into consideration. The performed tests have the only purpose to validate the least-squares approach. A complete analysis quantifying the responses of this methodology to various surface shapes, boundary conditions (e.g., singular boundary points for the Ellipsoid), as well as comparisons with competing approaches, will be the subject of future studies.
As for future research directions, it should be natural to derive the real velocity (instead of the parametric velocity) in geodesic problems of a mass particle, and to use the constancy of the velocity—in addition to or instead of—the geodesic equations. Another future research activity is to investigate what the optimal range of basis functions for the free functions is and to investigate the optimal number of discretization points. These two analyses will help the proposed least-squares solution approach to provide optimal performances. Topics more interesting in physics, such as using the Schwarzschild metric (uncharged, non-rotating black holes) or more general space metrics are welcome to be investigated by researchers with good knowledge on general relativity.