Relativity-Simulator

Specification & System Description

1. Global Vision, Philosophy & Core Objectives

The engine is a scientific computing and interactive simulation software for Special Relativity, General Relativity, and alternative gravitational models. The platform implements analytical metrics, post-Newtonian dynamics, relativistic hydrodynamics, and polarized radiative transfer derived from standard relativistic physics formulations.

The platform operates across two complementary runtime paradigms:

The architectural foundation relies on modularity: spacetimes, numerical integrators, equations of state, radiative transfer models, observer kinematics, & uncertainty quantification engines are interchangeable components adhering to uniform concepts. All computational paths prioritize performance through shared-memory multithreading, explicit SIMD register vectorization, persistent memory arenas, & GPU compute pipelines.

Uncertainty quantification & formal error propagation are native primitives within the system, allowing the rigorous qualification of truncation errors, initial condition perturbations, & numerical discretization artifacts alongside physical signals.


2. System Modularity & Component Selection Matrix

The engine provides configuration flexibility across all layers of the physical simulation stack. Each simulation scenario explicitly defines the active theoretical framework, numerical approximation order, & observation pipeline.

2.1. Permutable Component Matrix


3. Relativistic Phenomenology & Physical Modeling

The simulation platform models the manifestations of Einstein’s field equations, relativistic kinematics, & spacetime curvature:

3.1. Relativistic Kinematics & Optical Effects

3.2. Strong Gravity & Curved Spacetime Phenomena


4. Spacetime Catalog & Coordinate Representations

The engine includes exact analytical solutions, modified metrics, cosmological models, & numerical relativity grids:

4.1. Analytical Vacuum & Electrovacuum Solutions

4.2. Coordinate Systems & Gauges

Metrics are formulated in multiple coordinate systems to manage gauge regularity & numerical convergence:

4.3. Cosmological & Exotic Spacetimes

The image renderer traces the Schwarzschild-de Sitter, FLRW, Morris-Thorne and Alcubierre selections with the Schwarzschild null tracer, and does not evaluate $\Lambda$, $b_0$ or $v_s$. The metric classes implement the corresponding geometries (TECHNICAL_MANUAL.md).

4.4. 3+1 Numerical Relativity Grids (BSSN)

4.5. Metric Invariants & Curvature Tensors


5. Post-Newtonian Dynamics & Gravitational Theories

5.1. Post-Newtonian Multi-Body Dynamics

Relative gravitational accelerations among compact & extended bodies incorporate corrections up to order 3.5PN:

The terms are selected by PNOrderConfig (include/relativistic/dynamics/pn_orders.hpp). PostNewtonianSystem::update_accelerations (include/relativistic/dynamics/pn_nbody_system.hpp) applies:

The quadrupole radiation quantities of Section 5.1 are recomputed at every acceleration update.

5.2. Spherical Harmonics & High-Degree Geodesy

5.3. Dark Matter Halos & Alternative Gravitational Theories

5.4. Body Interactions & Spacetime-Source Bodies

InteractionConfig (include/relativistic/dynamics/interaction_config.hpp) and InteractionSolver (include/relativistic/dynamics/interaction_solver.hpp) provide the following optional interactions, all disabled by default:

The electromagnetic accelerations are added to PostNewtonianBody::acceleration after each integration sub-step; PostNewtonianSystem::update_accelerations recomputes this field from the gravitational terms at the start of the next integrator stage. The warnings displayed for inconsistent settings are produced by include/relativistic/dynamics/interaction_compatibility.hpp.

A body with is_spacetime_source set carries a Kerr outer horizon derived from its mass and spin (clamped to $0.999$ in dimensionless units). Such bodies are integrated like other bodies, absorb ordinary bodies crossing their horizon, and merge with each other or with the central object; the merging rules are listed in ARCHITECTURE.md. The primary source stays fixed at the origin and alone defines the background metric. Secondary sources act on rays only in the scalar CPU tracer (deflection, horizon absorption, disk crossing, rim emission; TECHNICAL_MANUAL.md).

Each body can carry up to four procedural surface layers (10 patterns, 5 blend modes, 7 region masks; include/relativistic/dynamics/body_surface_layers.hpp).


6. Relativistic Hydrodynamics (GRHD/GRMHD) & Accretion Systems

6.1. Curved Spacetime Hydrodynamics

6.2. Multi-Regime Equations of State (EOS)

6.3. Relativistic Accretion Disks & Tori

6.4. Radiative Processes & Local Emission


7. Uncertainty Quantification & Error Propagation

The engine provides a unified framework to quantify truncation errors, parametric sensitivity, & stochastic dispersion across all dynamical variables:

7.1. Target Quantities Subject to Uncertainty

7.2. Uncertainty Propagation Frameworks

7.3. Metrology & Visual Representation


8. Observer Kinematics & Coordinate Transport

8.1. Observer Definition & Comobile Orthonormal Tetrads

An observer is defined by a 4-position $x^\mu(\tau)$, a normalized timelike 4-velocity $u^\mu = dx^\mu / d\tau$ ($u_\mu u^\mu = -c^2$), & an orthonormal comobile tetrad ${e^\mu_{(0)}, e^\mu_{(1)}, e^\mu_{(2)}, e^\mu_{(3)}}$ where $e^\mu_{(0)} = u^\mu / c$ & $e^\mu_{(a)} e_{\mu (b)} = \eta_{ab}$.

The observer operates in two distinct dynamical modes:

The interactive Rocket Thrust mode (InteractiveCameraController::update_rocket_mode, include/relativistic/ui/interactive_camera_controller.hpp) implements a reduced model: thrust accelerations along the camera axes with a magnitude cap of max_proper_acceleration, a Newtonian gravitational deceleration $M/r^2$ toward the origin, and explicit Euler integration of velocity and position while the simulation clock runs. Fuel consumption, inertia and curvature gradients are not modeled.

8.2. Tetrad Transport Formulations

The interactive camera does not transport a tetrad: its orientation is stored as pitch, yaw and roll angles, and the tetrad passed to the renderer is rebuilt from these angles at every frame (SimulationOrchestrator::build_gpu_push_constants). The exact tracer builds a ZAMO tetrad of the selected metric at the observer position.

8.3. Optical Projections & Field of View

To accommodate optical aberration and wide-angle observation, the engine implements eight projection geometries:


9. Polarized Radiative Transfer & Spectral Pipeline

9.1. Backward Null Geodesic Raytracing

9.2. Polarized Transport Integration (Delano Method)

Transport of the Stokes vector $\mathbf{S} = (I, Q, U, V)^T$ is integrated along ray segments via Delano’s analytical matrix exponential method, ensuring stable solutions in the presence of extreme optical depths, Faraday rotation ($\rho_V$), & Faraday conversion ($\rho_Q$).

9.3. Continuous Spectral Pipeline & CIE 1931 Integration

The renderer implements a subset of this pipeline: the disk color is the blackbody spectrum at the Doppler-shifted temperature integrated against the CIE 1931 functions with 24 samples between 380 and 780 nm, Stokes transport is not evaluated, and four tone mapping operators (linear, ACES approximation, logarithmic, extended Reinhard) are followed by CPU color grading (MATHEMATICAL_FORMULATION.md).

9.4. Celestial Bodies, Sky & Execution Paths


10. Data Interchange & Ephemeris Ingestion

10.1. Astronomical Ephemerides & Coordinate Frames

10.2. Scientific Data Export

10.3. Capture, Sequence Rendering & Telemetry Recording

The Capture Studio (include/relativistic/ui/capture_studio_window.hpp) and CaptureCoordinator (include/relativistic/capture/capture_coordinator.hpp) provide:

The behavior of these components is specified in ARCHITECTURE.md and the files they write in FILE_FORMATS.md.


11. Determinism, Replay Architecture & Scenarios

11.1. Bit-Level Determinism & Random Number Generation

11.2. Synchronous Command Journal & Replay

11.3. Standard Simulation Scenarios


12. Verification Criteria & Benchmark Protocols

The engine incorporates automated analytical test suites verifying numerical convergence & physical conservation laws:

Benchmark Case Physical Target Theoretical Reference Validation Criteria
Solar Light Deflection Null geodesic solar limb grazing $\Delta\theta = \frac{4GM_\odot}{c^2 R_\odot} \approx 1.7512’’$ Relative error $\epsilon < 10^{-3}$
Mercury Perihelion Advance 1PN secular orbital precession $\Delta\phi = \frac{6\pi GM_\odot}{c^2 a(1-e^2)} \approx 42.98’’/\text{century}$ Precession error $\epsilon < 5\%$
Shapiro Time Delay Signal round-trip through solar field $\Delta t = \frac{4GM}{c^3}\left[\ln\left(\frac{4r_1 r_2}{r_0^2}\right)+1\right]$ Double-precision identity
Kerr Shadow Boundary Critical null orbits & Bardeen shadow Analytical Carter constant integrals Boundary overlap $> 99.99\%$
Hulse-Taylor Decay 2.5PN radiation reaction energy loss Peters-Mathews $\dot{P}_b \approx -2.423 \times 10^{-12} \, \text{s/s}$ Discrepancy $< 1.0\%$
Hydro Shock Tube Relativistic Sod / Balsara-1 shocks Rankine-Hugoniot jump conditions Monotonic profile at $t = 0.35$
TOV Stellar Maximum Mass Relativistic hydrostatic equilibrium Tabulated nuclear EoS maximum $M_{\text{max}}$ Convergence to mass peak
Geodetic Precession Gyroscope spin transport along orbit Fokker-de Sitter precession rate Agreement with $\Omega_{\text{geodetic}}$