use darkmatter::constants::physical::{G, KPC, SOLAR_MASS};
use darkmatter::halos::profiles;
use darkmatter::solar_system::local_density;
use std::f64::consts::PI;
pub const MW_RHO_S: f64 = 4.88e6 * SOLAR_MASS / (KPC * KPC * KPC);
pub const MW_RS: f64 = 21.5 * KPC;
pub const MW_VIRIAL_MASS: f64 = 1.3e12 * SOLAR_MASS;
pub const MW_CONCENTRATION: f64 = 13.3;
pub const SUN_GALACTIC_RADIUS: f64 = 8.0 * KPC;
pub fn local_dm_density() -> f64 {
local_density::RHO_LOCAL_KG_M3
}
pub fn nfw_density_at(r: f64) -> f64 {
profiles::nfw(r, MW_RHO_S, MW_RS)
}
pub fn nfw_enclosed_mass_at(r: f64) -> f64 {
profiles::nfw_enclosed_mass(r, MW_RHO_S, MW_RS)
}
pub fn dm_enclosed_mass_uniform(rho_dm: f64, radius: f64) -> f64 {
4.0 / 3.0 * PI * rho_dm * radius.powi(3)
}
pub fn dm_gravitational_acceleration(rho_dm: f64, r: f64) -> f64 {
let m_enc = dm_enclosed_mass_uniform(rho_dm, r);
G * m_enc / (r * r)
}
pub fn dm_velocity_correction(rho_dm: f64, r: f64, m_central: f64) -> f64 {
darkmatter::solar_system::perturbations::orbital_velocity_correction(rho_dm, r, m_central)
}
pub fn dm_circular_velocity_nfw(r: f64) -> f64 {
darkmatter::halos::rotation_curves::nfw_rotation_velocity(MW_RHO_S, MW_RS, r)
}
pub fn velocity_distribution(v: f64) -> f64 {
local_density::maxwell_boltzmann_speed(v, local_density::V0_M_S)
}
pub fn velocity_in_lab(v_galactic: f64, phase_days: f64) -> f64 {
local_density::velocity_in_lab_frame(
v_galactic,
local_density::V_SUN_KM_S * 1e3,
local_density::V_EARTH_ORBITAL_KM_S * 1e3,
phase_days,
)
}