Skip to content

Instantly share code, notes, and snippets.

@johnarban
Last active July 18, 2021 09:44
Show Gist options
  • Save johnarban/154f4f71dfeff605c468937fcd0c1686 to your computer and use it in GitHub Desktop.
Save johnarban/154f4f71dfeff605c468937fcd0c1686 to your computer and use it in GitHub Desktop.
Time to fall from 1 meter to surface of 100 kg iron ball (CodysLab question)
#this should work with a vanilla python install
from math import sqrt, acos
#equation from https://aapt.scitation.org/doi/pdf/10.1119/1.2344089
# derivation is included in their appendix. it is not openly available
# let's work in kg - m - s, SI units
G = 6.674e-11 # 6.674e-11 in SI units
M = 100 # kg
dens = 7847 # kg/m^3
Rsphere = (3 * M / (4 * np.pi * dens))**(1/3) # meters
m = 0.001 # 1 gram in kg
ri = 1 # start 1 meter from center
rf = 1 - Rsphere # fall to surface of the sphere
rfori = rf/ri # this fraction is needed a lot
term1 = (ri**(2/3))/sqrt(2*G*(M+m))
term2 = (sqrt(rfori) * sqrt(1-rfori)) + acos(sqrt(rf/ri))
print(f'{term1*term2:3.1f} seconds') # 6426.7 seconds
print(f'{term1*term2/3600:0.3} hours') # 1.79 hours
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment