astro.Function.assessMassStability - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

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

Function: assessMassStability()

assessMassStability(body): MassStabilityAssessment | null

Defined in: src/astro/star-physics.ts:277

Whether a degenerate star's mass exceeds what its kind can hold up.

Parameters

body

BodyProperties

The star. Needs StarType and StellarMass.

Returns

MassStabilityAssessment | null

The limit passed and how far outside expectation that puts the star, or null when the star is within its limits, is not a degenerate object, or carries no mass.

Remarks

A white dwarf is supported by electron degeneracy pressure and a neutron star by neutron degeneracy pressure, and each gives out at a mass: past the Chandrasekhar limit a white dwarf should collapse or detonate, past the TOV limit a neutron star should become a black hole. Elite Dangerous generates stars that sometimes sit beyond both, and this is what says so.

The kind is read from StarType, which the journal writes as "N" for a neutron star and "D"-prefixed for the white-dwarf classes ("D", "DA", "DAB", …). Black holes are outside this: "H" has already collapsed, so no ceiling is left for it to breach.

Throws

If body is not an object.

Example

import { assessMassStability } from '@elite-dangerous-almanac/core/astro/star-physics';

// An ordinary neutron star is unremarkable.
assessMassStability({ StarType: 'N', StellarMass: 1.8 }); // -> null

// Past the theoretical ceiling, but in the range the game generates freely.
assessMassStability({ StarType: 'N', StellarMass: 2.3 })?.severity; // -> 'warning'

// A white dwarf this heavy should not be a white dwarf.
assessMassStability({ StarType: 'DA', StellarMass: 1.6 })?.limit; // -> 'chandrasekhar'
⚠️ **GitHub.com Fallback** ⚠️