Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Public Member Functions | List of all members
srfm::tensor::GeodesicSolverN Class Reference

RK4 integrator for geodesics on an NAssetManifold. More...

#include <geodesic_n.hpp>

Public Member Functions

 GeodesicSolverN (const NAssetManifold &manifold, const ChristoffelN &christoffel) noexcept
 Construct from manifold and Christoffel symbol provider.
 
std::optional< GeodesicState > step (const GeodesicState &s, double dtau) const noexcept
 Advance the geodesic by one RK4 step of proper-time dtau.
 
std::optional< std::vector< GeodesicState > > integrate (GeodesicState initial, double dtau, int n_steps) const noexcept
 Integrate the geodesic for n_steps steps of size dtau.
 
std::optional< double > geodesic_deviation (const std::vector< GeodesicState > &traj) const noexcept
 Measure the maximum deviation of a trajectory from a straight line.
 
int dim () const noexcept
 Return the manifold dimension.
 

Detailed Description

RK4 integrator for geodesics on an NAssetManifold.

Definition at line 57 of file geodesic_n.hpp.

Constructor & Destructor Documentation

◆ GeodesicSolverN()

srfm::tensor::GeodesicSolverN::GeodesicSolverN ( const NAssetManifold &  manifold,
const ChristoffelN &  christoffel 
)
noexcept

Construct from manifold and Christoffel symbol provider.

Both objects must outlive this solver.

Parameters
manifoldThe underlying NAssetManifold.
christoffelChristoffel symbol computation object.

Definition at line 28 of file geodesic_n.cpp.

Member Function Documentation

◆ dim()

int srfm::tensor::GeodesicSolverN::dim ( ) const
inlinenoexcept

Return the manifold dimension.

Returns
manifold_.dim().

Definition at line 164 of file geodesic_n.hpp.

◆ geodesic_deviation()

std::optional< double > srfm::tensor::GeodesicSolverN::geodesic_deviation ( const std::vector< GeodesicState > &  traj) const
noexcept

Measure the maximum deviation of a trajectory from a straight line.

Computes the straight line from traj.front() to traj.back() and returns the maximum Euclidean distance in the spatial (price) components from any intermediate point to the corresponding point on that line.

This provides a measure of how non-geodesic the trajectory is in flat space.

Parameters
trajTrajectory of geodesic states.
Returns
Max deviation, or std::nullopt if fewer than 2 states.

Definition at line 134 of file geodesic_n.cpp.

◆ integrate()

std::optional< std::vector< GeodesicState > > srfm::tensor::GeodesicSolverN::integrate ( GeodesicState  initial,
double  dtau,
int  n_steps 
) const
noexcept

Integrate the geodesic for n_steps steps of size dtau.

Returns a vector of n_steps states (not including the initial state).

Parameters
initialStarting state.
dtauProper-time step size.
n_stepsNumber of steps to take.
Returns
Vector of states, or std::nullopt if any step fails.

Definition at line 114 of file geodesic_n.cpp.

◆ step()

std::optional< GeodesicState > srfm::tensor::GeodesicSolverN::step ( const GeodesicState &  s,
double  dtau 
) const
noexcept

Advance the geodesic by one RK4 step of proper-time dtau.

Computes k1..k4 for both position and velocity, then combines: s_new = s + (dtau/6)(k1 + 2k2 + 2k3 + k4)

Parameters
sCurrent state (position + velocity).
dtauProper-time step size (may be negative for backward integration).
Returns
Updated state, or std::nullopt if Christoffel evaluation fails.

Definition at line 81 of file geodesic_n.cpp.


The documentation for this class was generated from the following files: