How this calculation works
Integrate a local geodesic initial value problem in a two-dimensional polynomial Riemannian metric, with trajectory and conserved-energy diagnostics.
Gamma^k_ij = (1/2) g^{kl}(partial_i g_jl + partial_j g_il - partial_l g_ij); xddot^k = -Gamma^k_ij xdot^i xdot^j.A worked example
For the identity metric and initial state (0,0,1,0.5), the time-one state is (1,0.5,1,0.5). The squared metric speed remains 1.25 and the traversed length is sqrt(1.25).
Good to know
Two-dimensional polynomial metric components of degree at most4, declared coordinate box, initial point/tangent and duration(0,20]. Symbolic metric derivatives and Christoffel symbols; RK4 with global step doubling to12800steps, energy and endpoint-refinement checks. Positive definiteness is checked on the evaluated trajectory, not certified on the whole box. Local geodesic only; no globally shortest route claim.
Reference: Primary method or official documentation (opens in a new tab) ↗
A geodesic specified by its initial motion
A Riemannian metric assigns a squared length to every tangent vector at every point in a coordinate region. A geodesic follows the corresponding notion of locally straight motion. Supplying an initial point and velocity determines an initial value problem, so the calculator follows that trajectory for a requested affine time rather than choosing a destination and searching routes.
The distinction matters even on familiar surfaces. A geodesic can continue beyond the portion that is shortest between its endpoints. Its local differential equation remains valid while its global shortest-path interpretation may fail. This page therefore reports an integrated local geodesic and diagnostics, without promising a globally minimizing connection between the final and initial locations.
Compare this with the Geodesic distance calculator on triangular surface mesh. Integrate the geodesic equation of a supplied smooth metric with position and velocity data; the mesh-distance page finds shortest routes along fixed mesh edges.
Entering a positive definite metric
Supply the symmetric metric through g11, g12 and g22 as polynomial functions of the two coordinate variables. The off-diagonal component appears twice in a squared-length expression. Declare a coordinate box in which the expressions are meaningful and enter the initial position followed by its two velocity components. Coordinate units and velocity units must be mutually consistent.
At every evaluated trajectory point, g11 must be positive and the determinant g11 times g22 minus g12 squared must be positive. These are local checks of positive definiteness in two dimensions. Passing them along the computed path does not establish positive definiteness throughout every point of the declared box. A failed check stops the supported integration instead of continuing with an indefinite metric.
From metric derivatives to acceleration
The metric derivatives determine the Christoffel symbols of the Levi-Civita connection. These symbols combine the inverse metric with first coordinate derivatives. They convert the entered velocity into the acceleration required by the geodesic equation. For a constant Euclidean metric every derivative vanishes, so the equation reduces to constant velocity along a straight coordinate line.
The polynomial input permits analytic differentiation before numerical integration, avoiding finite-difference choices for the metric derivatives. The state contains two position and two velocity components. A small time step by itself is not an accuracy certificate; the solver must monitor its integration error and compare an appropriately refined trajectory before reporting a settled result.
Affine time, speed and traversed length
The integration parameter is affine time. For a correctly integrated geodesic, squared metric speed g evaluated on the velocity twice is constant. Its value is set by the initial velocity and need not equal one. If the initial squared speed is E, the traversed length over positive duration T is T times the square root of E.
Changing the magnitude of the initial velocity changes how quickly the same geometric direction is traversed. It is therefore incorrect to assume that the time interval itself equals length unless unit-speed initialization was used. The returned coordinate speed may vary even while the metric speed stays constant, because the coordinate representation can stretch or contract distance from place to place.
The identity-metric worked example
The default uses g11 and g22 equal to one, with g12 equal to zero. The initial point is the origin and the initial velocity is (1,0.5). All Christoffel symbols are zero. At affine time one, the position is (1,0.5) and the velocity remains (1,0.5), giving an exact independent reference trajectory.
The constant squared speed is 1.25, so the length traversed by time one is the square root of 1.25, approximately 1.118033989. A plotted line should connect the origin to that endpoint. This elementary example is intentional: it checks the ordering of the four state entries, the metric convention and the interpretation of length before a curved metric is entered.
Diagnostics and early termination
Energy drift compares the squared metric speed along the trajectory with its initial value. A refinement comparison tests whether reducing the numerical error target changes the endpoint materially. These checks complement each other; a method can conserve one quantity while following an inaccurate trajectory, or approximate a short trajectory while showing unacceptable drift over longer integration times.
The path must remain inside the declared coordinate box. Reaching its edge is a domain exit, not evidence that the geodesic itself terminates in the underlying manifold. Likewise, an inverse metric that becomes too ill-conditioned makes the supported arithmetic unresolved. The result should distinguish the requested final time from the last safely established trajectory point if integration stops early.
Interpreting curved coordinate plots
The plotted path lives in the entered coordinate chart. A curve in those coordinates can represent intrinsically straight geodesic motion, while a straight coordinate line need not be a geodesic for a variable metric. The visual shape alone therefore cannot verify the differential equation or establish that the trajectory is the shortest available route.
This page does not solve a boundary value problem, cross multiple charts automatically or compare competing geodesics. It also does not add an embedding surface in three-dimensional space unless that geometry is separately supplied. Use it to explore a specified local metric and initial state, with the returned derivative, energy, domain and refinement information kept alongside the coordinates.
A few questions, answered
Does the endpoint path have minimum length?
The calculation follows a local geodesic initial value problem. It does not prove global shortest-path optimality.
Is affine time the same as distance?
Only for unit-speed initialization. In general distance equals duration times the conserved metric speed.
Is the metric checked throughout the whole box?
Positive definiteness is checked along the evaluated trajectory; that is not a global certificate for the full box.
What does a domain exit mean?
The trajectory reached the declared coordinate boundary. Continuing requires a valid extended metric or a new chart.