#[derive(Debug, Clone, Copy)]
pub enum MassHierarchy {
Normal,
Inverted,
Degenerate,
}
pub struct MassiveNeutrinos {
pub total_mass: f64, pub hierarchy: MassHierarchy,
pub n_species: usize,
}
impl MassiveNeutrinos {
pub fn new(total_mass: f64, hierarchy: MassHierarchy) -> Self {
MassiveNeutrinos {
total_mass,
hierarchy,
n_species: 3,
}
}
pub fn omega_nu(&self, h: f64) -> f64 {
self.total_mass / 93.14 / (h * h)
}
pub fn power_suppression(&self, k: f64, _z: f64) -> f64 {
let k_fs = 0.3 * (self.total_mass / 0.06); let alpha = 1.5; (-(k / k_fs).powf(alpha)).exp()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_neutrino_omega() {
let neutrinos = MassiveNeutrinos::new(0.06, MassHierarchy::Normal);
let omega_nu = neutrinos.omega_nu(0.7);
assert!(omega_nu < 0.01);
assert!(omega_nu > 0.0);
}
#[test]
fn test_power_suppression() {
let neutrinos = MassiveNeutrinos::new(0.06, MassHierarchy::Normal);
let s_small = neutrinos.power_suppression(0.01, 0.0);
assert!(s_small > 0.9);
let s_large = neutrinos.power_suppression(1.0, 0.0);
assert!(s_large < 0.5);
}
}