Skip to content

Latest commit

 

History

History
45 lines (38 loc) · 2.3 KB

README.md

File metadata and controls

45 lines (38 loc) · 2.3 KB

pyDilation

A script for calculating the temporal dilation caused by an object in the universe considering metric of Schwarzschild

Preview

Wolfram Alpha code

The WolframAlpha code is available to check the calculations

Based on

The script is based on these tests :

Example for VY CANIS MAJORIS :
Mass : 3,381 × 10^31 kg
RS = 2GM/c²
= 2 * 6.6743 * 10^-11 * 3.381 * 10^31 / 300000000^2
= 50146.24066666666666666666666666666666666666666666666666666m
= sqrt((1 - 50146.24 / (7 * 10^8)) * 1^2 - (1 - 50146.24 / 7 * 10^8)^-1*0^2 - (7 * 10^8)^2 (0 + sin^2 (0) * 0^2)))
= 0.99996418062
365*24*3600-365*24*3600*0.99996418062
= 1129.59996768s

Example for Mars:
Mass = 6,39 × 10^23 kg
RS = 2GM/c²
= 2 * 6.6743 * 10^-11 * 6.39 * 10^23 / 300000000^2
= 0.0009477506m
ds² = (1-Rs/r) dt² - (1-Rs/r)^-1 dr²- r²(dθ² + sin² θ dφ²)
= (1 - 0.0009477506m / 7 × 10^8) × 1² - (1 - 0.0009477506m / 7 × 10^8)^-1× 0² - (7 × 10^8)² (0 + sin² (0) × 0²)
= sqrt((1 - 0.0009477506 / (7 * 10^8)) * 1^2 - (1 - 0.0009477506 / 7 * 10^8)^-1× 0^2 - (7 × 10^8)^2 (0 + sin^2 (0) × 0^2)))
= 0.999999999999323035
365 * 24 * 3600 - 365 * 24 * 3600 * 0.999999999999323035
= 0.00002134876824s

Module

You can use PyDilation as a module by putting dilation.py it the same folder as your script.
dilation.Schwarzschild() or Schwarzschild() is used to calculate the Schwarzschild Radius
dilation.time_Space() or time_Space() is used to calculate the distance of time space at the surface of the object
dilation.Shift() or Shift() is used to calculate the Shift between the object and a distant observer.

dilation.Schwarzschild() two arguments : mass which is the solar mass of your object and details* dilation.time_Space() two arguments : SR which is the Schwarzschild Radius of your object and details* dilation.Shift() two arguments : time_space which is the distance of time space at the surface of the object and details*

*details is an additional parameter to print (or not) more informations about the calculation.