astro.Function.mainSequenceLifetime - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / astro / mainSequenceLifetime
mainSequenceLifetime(
body):number|null
Defined in: src/astro/star-physics.ts:162
How long a star of a given mass spends on the main sequence, in millions of years.
The star. Needs StellarMass.
number | null
The lifetime in millions of years, or null when no usable stellar mass is
written — which is the case for every planet, and for a scan that resolved nothing.
The standard scaling t ≈ 10 Gyr · (M/M☉)^−2.5, anchored so that the Sun reads 10 Gyr.
Mass is what sets a star's whole life: doubling it cuts the lifetime more than fivefold,
because the star burns its larger fuel supply very much faster.
Compare it against Age_MY to judge a generated star. An ordinary star older than its own main-sequence lifetime should already have left it, and a giant younger than one should not yet have arrived.
If body is not an object.
import { mainSequenceLifetime } from '@elite-dangerous-almanac/core/astro/star-physics';
mainSequenceLifetime({ StellarMass: 1 }); // -> 10000
// A heavy blue star lives a few million years.
mainSequenceLifetime({ StellarMass: 20 }); // -> 5.5…
// A red dwarf outlives the universe many times over.
mainSequenceLifetime({ StellarMass: 0.2 }); // -> 559016.9…
mainSequenceLifetime({ MassEM: 1 }); // -> null