src/core/rv.js
text
Radial velocity of the star from the reflex motion of its planets.
Same orbit as the transit model (kepler.js): u = omega + nu, mid-transit at u = pi/2,
+Z toward the observer. The planet's line-of-sight velocity is
dZ/dt = (n a sin i / sqrt(1 - e^2)) [cos u + e cos omega]
and the star moves the other way scaled by m_p / (M* + m_p). With velocities positive
when the star recedes (the spectroscopic convention):
RV(t) = K [cos(omega + nu(t)) + e cos omega]
K = (2 pi G / P)^(1/3) m_p sin i / ((M* + m_p)^(2/3) sqrt(1 - e^2))
so the star recedes before mid-transit and approaches after it.
EXOTIC gets the same curve by differencing the planet's position numerically and scaling
by mu = m_p / M* (not m_p / (M* + m_p)), with a/R* from the total mass: its amplitude is
larger than the two-body value here by the factor 1 + m_p/M*.Import: import { … } from './src/core/rv.js' — no DOM, runs in Node and the browser.
semiAmplitude
js
function semiAmplitude(per, ecc, inc, mplanet, mstar)Semi-amplitude K in m/s. per [d], inc [deg], mplanet [M Jup], mstar [M Sun].
massFromK
js
function massFromK(K, per, ecc, inc, mstar)Planet mass [M Jup] that gives semi-amplitude K [m/s] (inverse of semiAmplitude, by fixed-point iteration).
arsFromKepler
js
function arsFromKepler(per, mstar, mplanet, rstar)a/R* from Kepler's third law with the total mass. per [d], mstar [M Sun], mplanet [M Jup], rstar [R Sun].
makeRV
js
function makeRV(p)text
Compile one planet's contribution: p = { per, tmid, ecc, omega (deg), K (m/s) }.
Returns rv(t) in m/s, without any zero point or trend.