mirror of
https://asciireactor.com/otho/as-500.git
synced 2024-11-22 13:35:06 +00:00
24 lines
646 B
C++
24 lines
646 B
C++
#include <iostream>
|
|
#include <iomanip>
|
|
#include <math.h>
|
|
|
|
int main(int argc, char const *argv[])
|
|
{
|
|
double hnu = 4.138e-10; // ergs
|
|
for (double logn_e = -10; logn_e <= 10; logn_e = logn_e + 0.0625) {
|
|
double n_e = pow(10,logn_e);
|
|
double net_cooling = hnu *
|
|
(1e-13)*pow(n_e,2) *
|
|
(
|
|
(2.19)*pow(1.47e-7*n_e+1,-1) -
|
|
(3.95)*pow(1-(1.47e-7*(n_e)),-1)
|
|
);
|
|
std::cout << std::setprecision(4) << std::fixed
|
|
<< std::scientific
|
|
<< std::setw(10) << n_e << '\t'
|
|
<< std::setw(10) << net_cooling << '\n';
|
|
}
|
|
|
|
|
|
return 0;
|
|
} |