Skip to content

Instantly share code, notes, and snippets.

@yalla
Created February 12, 2012 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yalla/c72224039a5ed1c2a265 to your computer and use it in GitHub Desktop.
Save yalla/c72224039a5ed1c2a265 to your computer and use it in GitHub Desktop.
Spaghettification code for M87
function force=newtons_law(d, b_mass) # d[m], b[kg]
G=6.67384e-11; # Nm^2/kg^2, Newtonian grav. constant
sun_mass=1.9884e+30; # kg
bh_factor=6.7e+9; # M87 black hole multiplication factor
force=(G.*bh_factor.*sun_mass.*b_mass)./(d.*d);
endfunction
AU=149597870700;
x=130:10:2000;
plot(x, newtons_law(x*AU+2, 10)-newtons_law(x*AU, 2.5))
semilogy(x, newtons_law(x*AU+2, 10)-newtons_law(x*AU, 2.5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment