Repository: Segmented-Spacetime-Mass-Projection-Unified-Results
This API/Function overview documents all key computational routines and helper functions provided in the main scripts of the repository.
It is aimed at users wishing to integrate, extend, or systematically test the segment-density and mass-reconstruction machinery.
Theoretical background and derivations: See the published preprints and documentation in /docs/ and /papers/.
Description:
Returns the segment density σ(r) at radius r, between the Schwarzschild radius r_s and the segment radius r_φ.
Parameters:
r: float, radius at which to evaluate segment densityr_phi: float, segment radius r_φ (outer boundary)r_s: float, Schwarzschild radius r_s (inner boundary)sigma_c:float, critical segment density (default 1.0)eps: float, numerical offset to avoid log(0) (default 1e-15)
Returns:
float: segment density at radius r. Returnsnanif r is outside (r_s, r_φ).
Example:
sigma_val = sigma(r=1.5, r_phi=2.0, r_s=1.0)Description:
Computes the segment radius r_φ for a given mass M.
Parameters:
M: float, mass (kg)phi: float, Golden Ratio (default: calculated from (1+sqrt(5))/2)
Returns:
float: segment radius r_φ
Description:
Computes the Schwarzschild radius r_s for mass M.
Parameters:
M: float, mass (kg)
Returns:
float: Schwarzschild radius r_s
Description:
Computes the segment radius for a Kerr (rotating) object.
Parameters:
M: float, mass (kg)a: float, dimensionless spin/Kerr parameter |a|<1phi: float, Golden Ratio (optional)
Returns:
float: segment radius r_φ for Kerr metric
Description:
Calculates the relative error of reconstructed mass M as a function of uncertainties in segment radius, G, c, and phi.
Parameters:
dr_phi: float, absolute error in segment radiusr_phi: float, segment radiusdG: float, absolute error in gravitational constant GG: float, gravitational constant Gdphi: float, absolute error in phiphi: float, value of phidc: float, absolute error in cc: float, value of c
Returns:
float: relative error in M (as a fraction)
Example:
err = rel_mass_error(0.01*r_phi, r_phi, 0.0001*G, G, 0.00001*phi, phi, 0.0, c)- Use the core functions above to generate a table of σ(r) for a range of r between r_s and r_φ (logarithmic spacing recommended).
- For visualization, use
matplotlib:
import numpy as np, matplotlib.pyplot as plt
r_vals = np.geomspace(r_s, r_phi, 100)
sigma_vals = [sigma(r, r_phi, r_s) for r in r_vals]
plt.plot(r_vals, sigma_vals)
plt.xlabel('r')
plt.ylabel('σ(r)')
plt.title('Segment Density Profile')
plt.show()- Combines both demo and physics modes.
- Produces tabular output and (if matplotlib installed) segment-density plot.
- Recommended entry point for new users.
- All scripts use SI units.
- Numerical stability at the interval boundaries is enforced via eps.
- See code comments for edge-case handling and special features (e.g., Kerr/rotation).
For bug reports, feature requests, or contributions, please open an Issue or contact the maintainers via GitHub or ResearchGate (see main README).
Last update: 2025-08-07
Maintainers: Lino Casu & Carmen Wrede
License: Anti-Capitalist Software License v1.4