Third Kepler's LawĀ¶
In the case of eccentric orbits, the compact object travels at different velocities throughout the orbit, moving faster at periastron (the closest point to the star) and slower at apoastron (the farthest point from the star).
This function uses the principle of constant areolar velocity, which states that a line segment joining a compact object and the donnor star sweeps out equal areas during equal intervals of time. This principle provides a good and easy approximation for translating orbital phase to time and vice versa.
InĀ [1]:
Copied!
import xraybinaryorbit
from xraybinaryorbit import *
import xraybinaryorbit
from xraybinaryorbit import *
HELLO, nice to see you! :) PLEASE READ THIS, IT'S VERY IMPORTANT: These are the units that must be used within this package: - Rstar: Solar radius - Mstar: Solar masses - Inclination: Sexagesimal degrees - Periapsis: Sexagesimal degrees - Semimajor: Stellar radius - Periods: Days (Periods in the case of the period_sliding_window function will support any units) - Iphase: Radians A list of the functions contained in this package will be displayed by runing the function list_functions(). As these functions use a lot of parameters, which can sometimes be difficult to handle, we have implemented a user-friendly method for parameter input: A form will be displayed, and the parameters will be saved in the directory for further interactions. These saved parameters will be used if new parameters are not provided. For the function to work, the submit button must be pressed. If the parameters are already saved within the working directory, setting "load_directly=True" no form will be displayed and that parameters will be used within the function. Alternatively, the input parameters or bounds can be provided as lists, by providing a "parameter_list" or "bound_list" as imputs. Please, take into account that fits in general will take A LOT of time to complete. If you need help, contact graciela.sanjurjo@ua.es.
InĀ [2]:
Copied!
ph=np.arange(0,1,0.1)
phase,time,W= orbital_phase_to_time(ph,precision=0.01, load_directly=True)
plt.plot(time, phase)
plt.xlabel("Time (s)")
plt.ylabel("Orbital phase")
ph=np.arange(0,1,0.1)
phase,time,W= orbital_phase_to_time(ph,precision=0.01, load_directly=True)
plt.plot(time, phase)
plt.xlabel("Time (s)")
plt.ylabel("Orbital phase")
Loaded parameters from file: iphase: 0.0 semimajor: 1.5 orbitalperiod: 2.0 eccentricity: 0.2 periapsis: 200.0 Rstar: 12.0 Mstar1: 22.0 Mstar2: 1.4
Out[2]:
Text(0, 0.5, 'Orbital phase')
InĀ [3]:
Copied!
t = np.arange(0,4*24*60*60)
phase,time,W= orbital_time_to_phase(t ,precision=0.01,load_directly=True)
plt.plot(time, phase)
t = np.arange(0,4*24*60*60)
phase,time,W= orbital_time_to_phase(t ,precision=0.01,load_directly=True)
plt.plot(time, phase)
Loaded parameters from file: iphase: 0.0 semimajor: 2.0 orbitalperiod: 2.0 eccentricity: 0.4 periapsis: 200.0 Rstar: 12.0 Mstar1: 22.0 Mstar2: 1.4
Out[3]:
[<matplotlib.lines.Line2D at 0x17f34cd30>]