@@ -31,31 +31,35 @@ public protocol Manifold {
3131 // classical mechanics. However, SourceKitService crashes when such type is extended to conform to
3232 // Differentiable as of Swift 6.2-snapshot-2025-08-21.
3333
34- /// Calculates the Lagrangian over the given coordinate and moment in time.
34+ /// Calculates the Lagrangian *L* over the given coordinate and moment in time.
3535 ///
36- /// The Lagrangian *L* is a smooth, scalar function on the tangent bundle (the union of every
37- /// tangent space at all coordinates in which lies the velocity associated to each of them; i.e.,
38- /// a bundle whose coordinates are (qₙ, q̇ₙ)) of this ``Manifold``. It is the density with which `q`
39- /// moves over `t`, part of the formula for an action *S* (the path of such coordinate):
36+ /// The Lagrangian is a smooth, scalar function on the tangent bundle (the union of every tangent
37+ /// space at all coordinates in which lies the velocity associated to each of them; i.e., a bundle
38+ /// whose coordinates are (qₙ, q̇ₙ)) of this ``Manifold``. It is the density with which `q` moves
39+ /// over `t`, part of the formula for an action *S* (the path of such coordinate):
4040 ///
4141 /// **S[q] = ∫ᵗ²ₜ₁ *L*(q, q̇, t) × ∂*t***; or simply **S = ∫ᵗ²ₜ₁ *L* × ∂*t***.
4242 ///
4343 /// - Parameters:
44- /// - q : Coordinate *q* at which the configuration is located.
45- /// - q̇ : Rate of change of `q` over `t`, *q*’(*t*); its velocity.
46- /// - t : Time at which the configuration is.
44+ /// - coordinate : Coordinate *q* at which the configuration is located.
45+ /// - velocity : Rate of change of `q` over `t`, *q*’(*t*); its velocity.
46+ /// - time : Time at which the configuration is.
4747 /// - Returns: A scalar in a Lagrangian density 𝐿, determined by the type of coordinate of this
4848 /// ``Manifold``.
49- @differentiable ( reverse, wrt: ( q, q̇) )
50- func L( q: Coordinate , q̇: Coordinate . TangentVector , t: Double ) -> Double
49+ @differentiable ( reverse, wrt: ( coordinate, velocity) )
50+ func lagrangian(
51+ coordinate: Coordinate ,
52+ velocity: Coordinate . TangentVector ,
53+ time: Double
54+ ) -> Double
5155
5256 /// Calculates the potential energy *V* = E - E₀, scalar whose gradient outputs a force, in this
5357 /// ``Manifold`` at a given coordinate and a specified time.
5458 ///
5559 /// - Parameters:
56- /// - q : Coordinate *q* at which the configuration is located.
57- /// - t : Time at which the configuration is.
60+ /// - coordinate : Coordinate *q* at which the configuration is located.
61+ /// - time : Time at which the configuration is.
5862 /// - Returns: The potential energy *V* in eV.
5963 /// - SeeAlso: ``Foundation/UnitEnergy/electronvolts``
60- func V ( q : Double , t : Double ) -> Double
64+ func potentialEnergy ( coordinate : Double , time : Double ) -> Double
6165}
0 commit comments