Kepplers2ndLaw = class Kepplers2ndLaw(builtins.object) |
|
Class for calculating Kepplers second law for planetary motion.
The projection of the orbit on the sky is not included in this class.
.
The algorithm was taken from
Cory Boule etal. (2017) J. of Double Star Observations Vol 13 p.189.
http://www.jdso.org/volume13/number2/Harfenist_189-199.pdf
p_0 : e eccentricity of the elliptic orbit (0<e<1; 0 = circular orbit)
p_1 : a semi major axis (>0)
p_2 : P period of the orbit (>0)
p_3 : T phase since periastron passage (0<p_3<2 pi)
The parameters are initialized at [0.0, 1.0, 1.0, 0.0]. |
|
Constructor:
- dEdM( xdata, params, cosE)
- Return derivatives of E (eccentric anomaly) to mean anomaly
Returns
-------
dEdM : array_like
derivatives of E to M (mean anomaly)
Methods defined here:
- dEdpar( xdata, params, cosE, sinE)
- Return derivatives of E (eccentric anomaly) to relevant parameters.
Returns
-------
dEde : array_like
derivatives of E to e (eccentricity)
dEdP : array_like
derivatives of E to P (period)
dEdp : array_like
derivatives of E to p (phase of periastron)
- dEdx( xdata, params, cosE)
- Return derivatives of E (eccentric anomaly) to xdata
Returns
-------
dEdx : array_like
derivatives of E to x (xdata)
- dMdpar( xdata, params )
- Return derivatives of M (mean anomaly) to relevant parameters.
Returns
-------
dMdP : array_like
derivatives of M to P (period)
dMdp : array_like
derivatives of M to p (phase of periastron)
- dMdx( xdata, params )
- Return derivatives of M (mean anomaly) to xdata
Returns
-------
dMdx : array_like
derivatives of M to x (xdata)
- drvdE( xdata, params, cosE, sinE)
- Return derivatives of r (radius) and v (true anomaly) to eccentric anomaly
Parameters
----------
xdata : array_like
times in the orbit
params : array_like
parameters: eccentr, semimajor, period, ppass
cosE : array_like
cosine of E
sinE : array_like
sine of E
Returns
-------
drdE : array_like
derivatives of r to E (eccentric anomaly)
dvdE : array_like
derivatives of v to E (eccentric anomaly)
- drvdpar( xdata, params, E, cosE, sinE)
- Return derivatives of r (radius) and v (true anomaly) to relevant parameters.
Returns
-------
drde : array_like
derivatives of r to e (eccentricity)
drda : array_like
derivatives of r to a (semimajor axis)
drdP : array_like
derivatives of r to P (period)
drdp : array_like
derivatives of r to p (phase of periastron)
dvde : array_like
derivatives of v to e (eccentricity)
dvdP : array_like
derivatives of v to P (period)
dvdp : array_like
derivatives of v to p (phase of periastron)
- drvdx( xdata, params, cosE, sinE)
- Return derivatives of r (radius) and v (true anomaly) to xdata
Returns
-------
drdx : array_like
derivatives of r to x (xdata)
dvdx : array_like
derivatives of v to x (xdata)
- eccentricAnomaly( xdata, params, Estart=None )
- Take the best one : Halleys method
It converges in a few iterations for e <= 0.999999999
- eccentricAnomaly0( xdata, params )
- Return the eccentric anomaly, i.e. the solution for E of
Standard method by Jean Meuss :
Astronomical Algorithms, 2nd ed.,
Willmann-Bell, Inc, Virginia, 193-196, 397-399
e = params[0] = eccentricity
M = mean anomaly
E = M + e * sin( E )
Parameters
----------
xdata : array_like
times in the orbit
params : array_like
parameters: eccentr, semimajor, period, ppass
- eccentricAnomaly1( xdata, params )
- Newtons method.
Return the eccentric anomaly, i.e. the solution for E of
e = params[0] = eccentricity
M = mean anomaly
E = M + e * sin( E )
Parameters
----------
xdata : array_like
times in the orbit
params : array_like
parameters: eccentr, semimajor, period, ppass
- eccentricAnomaly2( xdata, params, Estart=None )
- Halleys method.
Return the eccentric anomaly, i.e. the solution for E of
e = params[0] = eccentricity
M = mean anomaly
E = M + e * sin( E )
Parameters
----------
xdata : array_like
times in the orbit
params : array_like
parameters: eccentr, semimajor, period, phase
Estart : array_like
starting values for E
- getMsini( stellarmass )
- Return the mass of the exoplanet in Jupiter masses.
Parameters
----------
stellarmass : float
mass of the host star in solar masses.
- meanAnomaly( xdata, params )
- Return the mean anomaly.
P = params[2] = period
p = params[3] = periastron passage
M = 2 * pi * xdata / P - p
Parameters
----------
xdata : array_like
times in the orbit
params : array_like
parameters: eccentr, semimajor, period, ppass
- radiusAndTrueAnomaly( xdata, params )
- Return the radius and the true anomaly.
e = params[0] = eccentricity
a = params[1] = semimajor axis
E = eccentric anomaly
r = a * ( 1 - e * cos( E ) )
v = 2 * arctan( sqrt( (1+e)/(1-e) ) * tan( E / 2 ) )
from Wikepedia => Trigoniometic Identities :
tan( E / 2 ) = sqrt( ( 1 - cos( E ) ) / ( 1 + cos( E ) ) )
= sqrt( ( 1 - c ) * ( 1 + c ) / ( 1 + c )^2 )
= sqrt( s^2 / ( 1 + c )^2 )
= s / ( 1 + c )
= sin( E ) / ( 1 + cos( E ) )
Avoid cases where cos( E ) is too close to -1
Parameters
----------
xdata : array_like
times in the orbit
params : array_like
parameters: eccentr, semimajor, inclin, ascpos, asclon,
period, ppass
Returns
-------
r : array_like
radius
v : array_like
true anomaly
|
|