Computational physics tools for modeling compact binary systems orbiting supermassive black holes. Computes Keplerian orbits, Schwarzschild geodesics, effective gravitational potentials, and gravitational waveforms.
| Module | Description |
|---|---|
Orbit.c |
Solves Kepler's equation (bisection method) for elliptical orbit positions |
Effective_Potential.c |
Newtonian + Schwarzschild-corrected gravitational potential, energy, angular momentum |
Geodesic_Orbit.c |
Integrates geodesic equations in Schwarzschild spacetime using GSL (RKF45) |
Gravitational_waveform.c |
Computes h+ and hx gravitational wave polarizations via harmonic expansion |
g1.m |
MATLAB reference implementation for geodesic orbits |
- GCC
- GNU Scientific Library (GSL)
# macOS brew install gsl # Ubuntu/Debian sudo apt install libgsl-dev
make# Run with default parameters (10^6 + 10^5 solar mass binary, e=0.7)
make run
# Custom parameters
./blackhole_sim [M_BH] [m_companion] [eccentricity] [semi_major_axis_AU] [dt_seconds] [total_time_years] [distance_parsecs]
# Example: equal-mass binary, circular orbit
./blackhole_sim 1e6 1e6 0.1 0.05 30 0.01 8000| File | Contents |
|---|---|
gravitational_waveform.csv |
h_cross and h_plus polarizations |
Newtonian.csv |
Newtonian effective potential vs radius |
Relativistic.csv |
Schwarzschild-corrected potential vs radius |
xgeodesic.csv, ygeodesic.csv |
Cartesian geodesic trajectory |
geodesic_polar.csv |
Polar coordinates (r, phi) of geodesic |
energy.csv, angular_momentum.csv |
Orbital constants |
time_vector.csv |
Time steps |
pos1.csv |
Orbital positions |
The simulation progresses through four layers:
- Keplerian Orbits - Classical two-body problem via Kepler's equation E - e sin(E) = M
- Effective Potential - V_eff = L^2/(2ur^2) - GMm/r with Schwarzschild correction term -GML^2/(c^2 r^3)
- Schwarzschild Geodesics - Full GR trajectories: dr/dT and dphi/dT from the Schwarzschild metric
- Gravitational Waveforms - Quadrupole formula with harmonic expansion in eccentricity
MIT