Skip to content

astro.Function.mainSequenceLifetime

github-actions[bot] edited this page Aug 28, 2026 · 1 revision

@elite-dangerous-almanac/core / astro / mainSequenceLifetime

Function: 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.

Parameters

body

BodyProperties

The star. Needs StellarMass.

Returns

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.

Remarks

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.

Throws

If body is not an object.

Example

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

API

Guides
astro
Classes (1)
ProceduralSystem

Properties

Accessors

Methods

Interfaces (28)
Type Aliases (6)
Variables (22)
Functions (57)
Subpath modules (3)
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
Functions (9)
ships
Classes (3)
BuildMetrics

Methods

LoadoutEditError

Constructors

Properties

Methods

ShipLoadout

Accessors

Methods

Interfaces (125)
Type Aliases (44)
Variables (10)
Functions (85)
Subpath modules (8)

Clone this wiki locally