Skip to content

Instantly share code, notes, and snippets.

@BrianMartell
Created December 5, 2025 18:57
Show Gist options
  • Select an option

  • Save BrianMartell/3c17411053006966d16bd78b83887159 to your computer and use it in GitHub Desktop.

Select an option

Save BrianMartell/3c17411053006966d16bd78b83887159 to your computer and use it in GitHub Desktop.
PUH-BrianMartell PUH_v6_Density_Contrast_Sim.py- Updated New Py Code
import numpy as np
import matplotlib.pyplot as plt
M = np.logspace(50, 55, 500) # kg
r_S = 2* G * M / c**2
delta = ell_P / r_S
C_geom = 1e-5 / delta # amplification needed
plt.figure(figsize=(8,5))
plt.loglog(M, delta, 'b-', label=r'$\delta$')
plt.loglog(M, C_geom, 'r--', label=r'$C_{\rm geom}$')
plt.axhline(1e-5, color='k', ls=':', label=r'$\Delta\rho/\rho_{\rm CMB}$')
plt.xlabel('Collapsed mass M (kg)')
plt.legend()
plt.grid(True)
plt.savefig('puh_density_contrast.png', dpi=300)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment