Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create tests of Star classes #13

Merged
merged 12 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ If you adapt parts of this code, do not remove the attributions in the source.

If you borrow parts of this code, in addition to citing the above in publication, include attribution `borrowed from THRAIN, Reece Boston 2022` in your source code.

![image](https://github.com/rboston628/THRAIN/blob/main/documentation/thrain.png)
![image](https://github.com/rboston628/THRAIN/blob/main/documentation/thrain.png)
8 changes: 4 additions & 4 deletions lib/chandra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ double Chandrasekhar::factor_f(double x){
}

double Chandrasekhar::factor_g(double x){
return 8.*x*x*x*(sqrt(1.+x*x) - 1.0) - factor_f(x);
return 8.*x*x*x*(sqrt(1.+x*x) - 1.0) - factor_f(x);
}

// double factor_h(double x){
// return x*x*x + (A0/B0/C_CGS/C_CGS)*factor_g(x);
// }
double Chandrasekhar::factor_h(double x, double sigma, double mue=1.0){
return mue*x*x*x + sigma*factor_g(x);
}


//methods usign the weights and abscissae of Sagar 1991
Expand Down
11 changes: 8 additions & 3 deletions lib/chandra.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
#include "../src/constants.h"

namespace Chandrasekhar {
const double A0 = 6.0406e22;
const double B0 = 9.8848e5;
double const A0 = 6.0406e22;
double const B0 = 9.8848e5;

//these values taken from Chandrasekhar 1932, pg 416 in Dover reprint
double const A01939 = 6.01e22;
double const B01939 = 9.82e5;

double factor_f(double x);
double factor_g(double x);
// double factor_h(double x);
double factor_h(double x, double, double);
}

namespace FermiDirac {
const double m_pi = 3.141592653589793;
//Abscissae (x) and weights (w) for 24-point Gauss quadrature method due to Sagar 1991
static const double xFermiDirac1Half[] = {
1.065765457622244303e-01, 4.230728669515992804e-01, 9.419850084605768359e-01,
Expand Down
Loading