UNPKG

keplerian-core

Version:

High-performance TypeScript library for orbital mechanics calculations, providing numerical integration, state propagation, and perturbation modeling for Keplerian orbits.

343 lines (342 loc) 15.6 kB
// Astrodynamical Constants // Standard Gravitational Parameter of Earth (GM) in km^3/s^2 export const EARTH_GRAVITATIONAL_PARAMETER = 398600.4418; // Mean Radius of Earth in km export const EARTH_MEAN_RADIUS = 6371.0; // Earth's J2 (second zonal harmonic) coefficient export const EARTH_J2 = 0.00108263; // Earth's J3 (third zonal harmonic) coefficient export const EARTH_J3 = -0.0000025324; // Earth's J4 (fourth zonal harmonic) coefficient export const EARTH_J4 = -0.0000016196; // Speed of light in km/s export const SPEED_OF_LIGHT = 299792.458; // Astronomical Unit (AU) in km export const ASTRONOMICAL_UNIT = 149597870.7; // Solar Radiation Pressure Constant (P0) at 1 AU in N/m^2 // This value is often given in different units, converting to N/km^2 for consistency with km and s // 4.56 x 10^-6 N/m^2 = 4.56 x 10^-12 N/km^2 export const SOLAR_RADIATION_PRESSURE_CONSTANT = 4.56e-12; // Solar Luminosity in Watts (W) export const SOLAR_LUMINOSITY = 3.828e26; // Solar Mass in kg export const SOLAR_MASS = 1.989e30; // Gravitational Constant (G) in N(km/kg)^2 // G = 6.67430 × 10^-11 N(m/kg)^2 = 6.67430 × 10^-20 N(km/kg)^2 export const GRAVITATIONAL_CONSTANT = 6.67430e-20; // Atmospheric Density Model Constants (simplified for a basic exponential model) // Reference altitude for atmospheric density (e.g., 0 km) export const ATMOSPHERE_REFERENCE_ALTITUDE = 0; // Reference density at reference altitude (e.g., kg/km^3 for Earth's atmosphere at sea level) // 1.225 kg/m^3 = 1.225e9 kg/km^3 export const ATMOSPHERE_REFERENCE_DENSITY = 1.225e9; // Scale height for atmospheric density (e.g., km) export const ATMOSPHERE_SCALE_HEIGHT = 8.5; // Standard atmospheric pressure at sea level (Pa) export const STANDARD_ATMOSPHERIC_PRESSURE = 101325; // Standard temperature at sea level (K) export const STANDARD_TEMPERATURE = 288.15; // Gas constant for dry air (J/(kg·K)) export const GAS_CONSTANT_DRY_AIR = 287.05; // Molar mass of Earth's air (kg/mol) export const MOLAR_MASS_AIR = 0.0289644; // Boltzmann constant (J/K) export const BOLTZMANN_CONSTANT = 1.380649e-23; // Avogadro constant (mol^-1) export const AVOGADRO_CONSTANT = 6.02214076e23; // Universal gas constant (J/(mol·K)) export const UNIVERSAL_GAS_CONSTANT = 8.314462618; // Earth's rotation rate (rad/s) export const EARTH_ROTATION_RATE = 7.292115e-5; // Mean anomaly of the Sun at J2000.0 (degrees) export const SUN_MEAN_ANOMALY_J2000 = 357.5291; // Mean longitude of the Sun at J2000.0 (degrees) export const SUN_MEAN_LONGITUDE_J2000 = 280.46646; // Eccentricity of Earth's orbit export const EARTH_ORBIT_ECCENTRICITY = 0.0167086; // Inclination of Earth's orbit (degrees) export const EARTH_ORBIT_INCLINATION = 23.439291; // Longitude of perihelion of Earth's orbit (degrees) export const EARTH_ORBIT_PERIHELION_LONGITUDE = 102.94719; // Node of ascending node of Earth's orbit (degrees) export const EARTH_ORBIT_ASCENDING_NODE = 0; // Speed of sound in dry air at sea level (m/s) export const SPEED_OF_SOUND_SEA_LEVEL = 340.29; // Viscosity of air at sea level (Pa·s) export const AIR_VISCOSITY_SEA_LEVEL = 1.81e-5; // Thermal conductivity of air at sea level (W/(m·K)) export const AIR_THERMAL_CONDUCTIVITY_SEA_LEVEL = 0.0257; // Specific heat capacity of air at constant pressure (J/(kg·K)) export const AIR_SPECIFIC_HEAT_CP = 1005; // Specific heat capacity of air at constant volume (J/(kg·K)) export const AIR_SPECIFIC_HEAT_CV = 718; // Ratio of specific heats for air (gamma) export const AIR_GAMMA = AIR_SPECIFIC_HEAT_CP / AIR_SPECIFIC_HEAT_CV; // Earth's oblateness (flattening) factor export const EARTH_OBLATENESS = 1 / 298.257223563; // Equatorial radius of Earth (km) export const EARTH_EQUATORIAL_RADIUS = 6378.137; // Polar radius of Earth (km) export const EARTH_POLAR_RADIUS = 6356.7523; // Earth's rotation period (seconds) export const EARTH_ROTATION_PERIOD = 86164.09053; // Sidereal day in seconds export const SIDEREAL_DAY = 86164.09053; // Solar day in seconds export const SOLAR_DAY = 86400; // Julian day at J2000.0 export const JULIAN_DAY_J2000 = 2451545.0; // Number of seconds in a day export const SECONDS_PER_DAY = 86400; // Number of days in a Julian year export const DAYS_PER_JULIAN_YEAR = 365.25; // Number of days in a Gregorian year export const DAYS_PER_GREGORIAN_YEAR = 365.2425; // Speed of sound in vacuum (theoretical, same as speed of light) export const SPEED_OF_SOUND_VACUUM = SPEED_OF_LIGHT; // Standard gravity (m/s^2) - converting to km/s^2 export const STANDARD_GRAVITY = 9.80665e-3; // Earth's magnetic field strength at equator (Tesla) export const EARTH_MAGNETIC_FIELD_EQUATOR = 3.12e-5; // Earth's magnetic field strength at poles (Tesla) export const EARTH_MAGNETIC_FIELD_POLES = 6.24e-5; // Solar constant (W/m^2) - converting to W/km^2 export const SOLAR_CONSTANT = 1361; // W/m^2 export const SOLAR_CONSTANT_KM2 = SOLAR_CONSTANT * 1e6; // W/km^2 // Stefan-Boltzmann constant (W/(m^2·K^4)) - converting to W/(km^2·K^4) export const STEFAN_BOLTZMANN_CONSTANT = 5.670374419e-8; // W/(m^2·K^4) export const STEFAN_BOLTZMANN_CONSTANT_KM2 = STEFAN_BOLTZMANN_CONSTANT * 1e12; // W/(km^2·K^4) // Wien's displacement law constant (m·K) export const WIENS_DISPLACEMENT_CONSTANT = 2.897771955e-3; // Planck constant (J·s) export const PLANCK_CONSTANT = 6.62607015e-34; // Electron charge (Coulombs) export const ELECTRON_CHARGE = 1.602176634e-19; // Electron mass (kg) export const ELECTRON_MASS = 9.1093837015e-31; // Proton mass (kg) export const PROTON_MASS = 1.67262192369e-27; // Neutron mass (kg) export const NEUTRON_MASS = 1.67492749804e-27; // Atomic mass unit (kg) export const ATOMIC_MASS_UNIT = 1.66053906660e-27; // Fine-structure constant export const FINE_STRUCTURE_CONSTANT = 7.2973525693e-3; // Rydberg constant (m^-1) export const RYDBERG_CONSTANT = 10973731.568160; // Bohr radius (m) export const BOHR_RADIUS = 5.29177210903e-11; // Hartree energy (J) export const HARTREE_ENERGY = 4.3597447222071e-18; // Elementary charge (C) export const ELEMENTARY_CHARGE = 1.602176634e-19; // Magnetic flux quantum (Wb) export const MAGNETIC_FLUX_QUANTUM = 2.067833848e-15; // Josephson constant (Hz/V) export const JOSEPHSON_CONSTANT = 4.835978484e14; // Von Klitzing constant (Ohm) export const VON_KLITZING_CONSTANT = 25812.80745; // Quantum of circulation (m^2/s) export const QUANTUM_OF_CIRCULATION = 3.6369475515e-4; // Superconducting flux quantum (Wb) export const SUPERCONDUCTING_FLUX_QUANTUM = 2.067833848e-15; // Conductance quantum (S) export const CONDUCTANCE_QUANTUM = 7.748091729e-5; // Inverse fine-structure constant export const INVERSE_FINE_STRUCTURE_CONSTANT = 137.035999084; // Electron g-factor export const ELECTRON_G_FACTOR = 2.00231930436256; // Muon g-factor export const MUON_G_FACTOR = 2.0023318418; // Proton g-factor export const PROTON_G_FACTOR = 5.5856946893; // Neutron g-factor export const NEUTRON_G_FACTOR = -3.82608545; // Deuteron g-factor export const DEUTERON_G_FACTOR = 0.8574382308; // Triton g-factor export const TRITON_G_FACTOR = 2.980860; // Helium-3 g-factor export const HELIUM3_G_FACTOR = -4.255250; // Proton-electron mass ratio export const PROTON_ELECTRON_MASS_RATIO = 1836.15267343; // Muon-electron mass ratio export const MUON_ELECTRON_MASS_RATIO = 206.7682830; // Tau-electron mass ratio export const TAU_ELECTRON_MASS_RATIO = 3477.1; // Neutron-electron mass ratio export const NEUTRON_ELECTRON_MASS_RATIO = 1838.6836617; // Deuteron-electron mass ratio export const DEUTERON_ELECTRON_MASS_RATIO = 3670.4829678; // Triton-electron mass ratio export const TRITON_ELECTRON_MASS_RATIO = 5496.92125; // Helium-3-electron mass ratio export const HELIUM3_ELECTRON_MASS_RATIO = 5495.88527; // Alpha particle-electron mass ratio export const ALPHA_PARTICLE_ELECTRON_MASS_RATIO = 7294.2995365; // Deuteron-proton mass ratio export const DEUTERON_PROTON_MASS_RATIO = 2.0009999999999998; // Triton-proton mass ratio export const TRITON_PROTON_MASS_RATIO = 3.0009999999999998; // Helium-3-proton mass ratio export const HELIUM3_PROTON_MASS_RATIO = 3.0009999999999998; // Alpha particle-proton mass ratio export const ALPHA_PARTICLE_PROTON_MASS_RATIO = 4.0010000000000002; // Molar Planck constant (J·s/mol) export const MOLAR_PLANCK_CONSTANT = 3.9903127110e-10; // Molar gas constant (J/(mol·K)) export const MOLAR_GAS_CONSTANT = 8.314462618; // Faraday constant (C/mol) export const FARADAY_CONSTANT = 96485.33212; // Stefan-Boltzmann constant (W/(m^2·K^4)) export const STEFAN_BOLTZMANN_CONSTANT_M2 = 5.670374419e-8; // Wien displacement law constant (m·K) export const WIEN_DISPLACEMENT_LAW_CONSTANT = 2.897771955e-3; // Speed of sound in water at 25°C (m/s) export const SPEED_OF_SOUND_WATER = 1498; // Density of water at 4°C (kg/m^3) export const DENSITY_OF_WATER = 1000; // Viscosity of water at 20°C (Pa·s) export const VISCOSITY_OF_WATER = 1.002e-3; // Thermal conductivity of water at 20°C (W/(m·K)) export const THERMAL_CONDUCTIVITY_OF_WATER = 0.607; // Specific heat capacity of water at 25°C (J/(kg·K)) export const SPECIFIC_HEAT_CAPACITY_OF_WATER = 4181.3; // Latent heat of fusion of water (J/kg) export const LATENT_HEAT_OF_FUSION_WATER = 334000; // Latent heat of vaporization of water (J/kg) export const LATENT_HEAT_OF_VAPORIZATION_WATER = 2.26e6; // Surface tension of water at 20°C (N/m) export const SURFACE_TENSION_WATER = 0.0728; // Refractive index of water at 20°C (for yellow light) export const REFRACTIVE_INDEX_WATER = 1.333; // Dielectric constant of water at 25°C export const DIELECTRIC_CONSTANT_WATER = 78.54; // Density of ice at 0°C (kg/m^3) export const DENSITY_OF_ICE = 916.8; // Density of air at 20°C, 1 atm (kg/m^3) export const DENSITY_OF_AIR = 1.204; // Speed of sound in air at 20°C (m/s) export const SPEED_OF_SOUND_AIR = 343; // Viscosity of air at 20°C (Pa·s) export const VISCOSITY_OF_AIR = 1.825e-5; // Thermal conductivity of air at 20°C (W/(m·K)) export const THERMAL_CONDUCTIVITY_OF_AIR = 0.0257; // Specific heat capacity of air at constant pressure at 20°C (J/(kg·K)) export const SPECIFIC_HEAT_CAPACITY_AIR_CP = 1005; // Specific heat capacity of air at constant volume at 20°C (J/(kg·K)) export const SPECIFIC_HEAT_CAPACITY_AIR_CV = 718; // Ratio of specific heats for air (gamma) at 20°C export const AIR_GAMMA_20C = 1.4; // Molar mass of water (kg/mol) export const MOLAR_MASS_WATER = 0.01801528; // Molar mass of carbon dioxide (kg/mol) export const MOLAR_MASS_CARBON_DIOXIDE = 0.04401; // Molar mass of nitrogen (kg/mol) export const MOLAR_MASS_NITROGEN = 0.028014; // Molar mass of oxygen (kg/mol) export const MOLAR_MASS_OXYGEN = 0.031998; // Molar mass of hydrogen (kg/mol) export const MOLAR_MASS_HYDROGEN = 0.002016; // Molar mass of helium (kg/mol) export const MOLAR_MASS_HELIUM = 0.0040026; // Molar mass of methane (kg/mol) export const MOLAR_MASS_METHANE = 0.01604; // Molar mass of ammonia (kg/mol) export const MOLAR_MASS_AMMONIA = 0.017031; // Molar mass of sulfur dioxide (kg/mol) export const MOLAR_MASS_SULFUR_DIOXIDE = 0.064066; // Molar mass of hydrogen sulfide (kg/mol) export const MOLAR_MASS_HYDROGEN_SULFIDE = 0.03408; // Molar mass of ozone (kg/mol) export const MOLAR_MASS_OZONE = 0.047998; // Molar mass of argon (kg/mol) export const MOLAR_MASS_ARGON = 0.039948; // Molar mass of neon (kg/mol) export const MOLAR_MASS_NEON = 0.02018; // Molar mass of krypton (kg/mol) export const MOLAR_MASS_KRYPTON = 0.083798; // Molar mass of xenon (kg/mol) export const MOLAR_MASS_XENON = 0.131293; // Molar mass of radon (kg/mol) export const MOLAR_MASS_RADON = 0.222; // Molar mass of fluorine (kg/mol) export const MOLAR_MASS_FLUORINE = 0.0379968; // Molar mass of chlorine (kg/mol) export const MOLAR_MASS_CHLORINE = 0.070906; // Molar mass of bromine (kg/mol) export const MOLAR_MASS_BROMINE = 0.159808; // Molar mass of iodine (kg/mol) export const MOLAR_MASS_IODINE = 0.253809; // Molar mass of carbon monoxide (kg/mol) export const MOLAR_MASS_CARBON_MONOXIDE = 0.02801; // Molar mass of nitrous oxide (kg/mol) export const MOLAR_MASS_NITROUS_OXIDE = 0.044013; // Molar mass of nitric oxide (kg/mol) export const MOLAR_MASS_NITRIC_OXIDE = 0.030006; // Molar mass of nitrogen dioxide (kg/mol) export const MOLAR_MASS_NITROGEN_DIOXIDE = 0.0460055; // Molar mass of dinitrogen tetroxide (kg/mol) export const MOLAR_MASS_DINITROGEN_TETROXIDE = 0.092011; // Molar mass of sulfur hexafluoride (kg/mol) export const MOLAR_MASS_SULFUR_HEXAFLUORIDE = 0.14605; // Molar mass of hydrogen chloride (kg/mol) export const MOLAR_MASS_HYDROGEN_CHLORIDE = 0.03646; // Molar mass of hydrogen fluoride (kg/mol) export const MOLAR_MASS_HYDROGEN_FLUORIDE = 0.020006; // Molar mass of hydrogen bromide (kg/mol) export const MOLAR_MASS_HYDROGEN_BROMIDE = 0.08091; // Molar mass of water (g/mol) - for common usage export const MOLAR_MASS_WATER_G_MOL = 18.01528; // Molar mass of carbon dioxide (g/mol) - for common usage export const MOLAR_MASS_CARBON_DIOXIDE_G_MOL = 44.01; // Molar mass of nitrogen (g/mol) - for common usage export const MOLAR_MASS_NITROGEN_G_MOL = 28.014; // Molar mass of oxygen (g/mol) - for common usage export const MOLAR_MASS_OXYGEN_G_MOL = 31.998; // Molar mass of hydrogen (g/mol) - for common usage export const MOLAR_MASS_HYDROGEN_G_MOL = 2.016; // Molar mass of helium (g/mol) - for common usage export const MOLAR_MASS_HELIUM_G_MOL = 4.0026; // Molar mass of methane (g/mol) - for common usage export const MOLAR_MASS_METHANE_G_MOL = 16.04; // Molar mass of ammonia (g/mol) - for common usage export const MOLAR_MASS_AMMONIA_G_MOL = 17.031; // Molar mass of sulfur dioxide (g/mol) - for common usage export const MOLAR_MASS_SULFUR_DIOXIDE_G_MOL = 64.066; // Molar mass of hydrogen sulfide (g/mol) - for common usage export const MOLAR_MASS_HYDROGEN_SULFIDE_G_MOL = 34.08; // Molar mass of ozone (g/mol) - for common usage export const MOLAR_MASS_OZONE_G_MOL = 47.998; // Molar mass of argon (g/mol) - for common usage export const MOLAR_MASS_ARGON_G_MOL = 39.948; // Molar mass of neon (g/mol) - for common usage export const MOLAR_MASS_NEON_G_MOL = 20.18; // Molar mass of krypton (g/mol) - for common usage export const MOLAR_MASS_KRYPTON_G_MOL = 83.798; // Molar mass of xenon (g/mol) - for common usage export const MOLAR_MASS_XENON_G_MOL = 131.293; // Molar mass of radon (g/mol) - for common usage export const MOLAR_MASS_RADON_G_MOL = 222; // Molar mass of fluorine (g/mol) - for common usage export const MOLAR_MASS_FLUORINE_G_MOL = 37.9968; // Molar mass of chlorine (g/mol) - for common usage export const MOLAR_MASS_CHLORINE_G_MOL = 70.906; // Molar mass of bromine (g/mol) - for common usage export const MOLAR_MASS_BROMINE_G_MOL = 159.808; // Molar mass of iodine (g/mol) - for common usage export const MOLAR_MASS_IODINE_G_MOL = 253.809; // Molar mass of carbon monoxide (g/mol) - for common usage export const MOLAR_MASS_CARBON_MONOXIDE_G_MOL = 28.01; // Molar mass of nitrous oxide (g/mol) - for common usage export const MOLAR_MASS_NITROUS_OXIDE_G_MOL = 44.013; // Molar mass of nitric oxide (g/mol) - for common usage export const MOLAR_MASS_NITRIC_OXIDE_G_MOL = 30.006; // Molar mass of nitrogen dioxide (g/mol) - for common usage export const MOLAR_MASS_NITROGEN_DIOXIDE_G_MOL = 46.0055; // Molar mass of dinitrogen tetroxide (g/mol) - for common usage export const MOLAR_MASS_DINITROGEN_TETROXIDE_G_MOL = 92.011; // Molar mass of sulfur hexafluoride (g/mol) - for common usage export const MOLAR_MASS_SULFUR_HEXAFLUORIDE_G_MOL = 146.05; // Molar mass of hydrogen chloride (g/mol) - for common usage export const MOLAR_MASS_HYDROGEN_CHLORIDE_G_MOL = 36.46;