// lcdm/examples/simple_usage.rs

use lcdm::prelude::*;

fn main() {
    // 1) Build a flat ΛCDM cosmology with common parameter choices.
    let cosmo = CosmoBuilder::new()
        .flat()
        .h(0.7)
        .Omega_b(0.05)
        .Omega_m(0.3)
        .neutrino_effective(3.046, vec![0.0])
        .build()
        .unwrap();

    // Wrap the built cosmology in the high-level model type.
    let model = Cosmology::new(cosmo);

    // 2) Compute the dimensionless expansion rate E(z) at z = 1.
    let z = Redshift(1.0);
    let ez = model.e_z(z);
    println!("E(z=1) = {}", ez);

    // 3) Compute the comoving radial distance out to z = 1 (in Mpc).
    let dist = model.comoving_radial_distance(z).unwrap();
    println!("Comoving Distance at z=1: {} Mpc", dist.0);
}
