Astro-Cosmology

 view release on metacpan or  search on metacpan

t/cosmology.t  view on Meta::CPAN

check0( $dl_opn - lum_dist($opn,$z)  );
check0( $dl_eds - luminosity_distance($eds,$z) );
check0( $dl_sn  - luminosity_distance($sn,$z)  );
check0( $dl_opn - luminosity_distance($opn,$z)  );

# not really a fair check, as calculated these using this module
my $dl_eds_ans = pdl( [3300.7765, 7024.5742, 15204.864] );
my $dl_sn_ans  = pdl( [2832.9381, 6607.6576, 15539.587] );
my $dl_opn_ans = pdl( [2565.1861, 5872.2944, 14242.634] );

# going for a percentage check here
check0( 100.0 * ($dl_eds - $dl_eds_ans) / $dl_eds_ans );
check0( 100.0 * ($dl_sn  - $dl_sn_ans) / $dl_sn_ans  );
check0( 100.0 * ($dl_opn - $dl_opn_ans) / $dl_opn_ans  );

my $zp1_sq = (1.0 + $z) * (1.0 + $z);
check0( 100.0 * ($dl_eds/$zp1_sq - $eds->angular_diameter_distance($z)) / $eds->adiam_dist($z) );
check0( 100.0 * ($dl_sn/$zp1_sq  - $sn->angular_diameter_distance($z))  / $sn->adiam_dist($z)  );
check0( 100.0 * ($dl_opn/$zp1_sq - $opn->angular_diameter_distance($z))  / $opn->adiam_dist($z)  );

my $dt_eds = $eds->lookback_time( $z );



( run in 0.397 second using v1.01-cache-2.11-cpan-05162d3a2b1 )