Solution (source code)

= Solution

The most direct <stellar mass determination> uses orbital dynamics in a <binary star>. A resolved orbit and an independent distance give the relative semimajor axis $a$ from its angular size; measuring the period then gives the total mass by <Kepler's third law>:
$$
\boxed{M_1+M_2=\frac{4\pi^2a^3}{GP^2}.}
$$
Individual barycentric orbital sizes, or the ratio of the two radial-velocity amplitudes, give $M_1/M_2=a_2/a_1=K_2/K_1$. A photocenter orbit alone needs the luminosity ratio to infer the barycentric orbit.

For a double-lined spectroscopic orbit, the line-of-sight amplitudes determine $a_i\sin i=K_iP\sqrt{1-e^2}/(2\pi)$. Combining them gives
$$
(M_1+M_2)\sin^3i=\frac{P(K_1+K_2)^3(1-e^2)^{3/2}}{2\pi G}.
$$
An <eclipsing binary> light curve constrains the inclination and relative radii, turning these projected quantities into individual masses. Eclipse and orbit modeling must allow for eccentricity, surface brightness, limb darkening and possible tidal distortion.

If only one spectrum is measured, the <binary mass function> is
$$
\boxed{f(M)=\frac{PK_1^3(1-e^2)^{3/2}}{2\pi G}=\frac{M_2^3\sin^3i}{(M_1+M_2)^2}.}
$$
Without an inclination and an estimate of the visible star's mass it does not fix the unseen mass uniquely, but it provides useful constraints and lower limits.

Less direct estimates combine a spectroscopic surface gravity with a radius inferred from distance, bolometric flux and effective temperature: $R^2=L/(4\pi\sigma_{\rm SB}T_{\rm eff}^4)$ and $M=gR^2/G$. These depend on atmosphere modeling. Locating a star on an evolutionary track or using a calibrated main-sequence mass-luminosity relation also estimates mass, but assumes composition and evolutionary state; giants and mass-transfer products need not obey a single main-sequence relation. Dynamical binary masses provide the empirical calibration against which such model-dependent methods are tested.