Skip to content

Commit

Permalink
Added NFW_Utility::NFW_M()
Browse files Browse the repository at this point in the history
  • Loading branch information
rbmetcalf committed Jun 4, 2016
1 parent e94e7b0 commit 103b081
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/cosmo.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ class NFW_Utility {
double NFW_V200(double M200,double R200);
double NFW_Vmax(double cons,double M200,double R200);
double NFW_Vr(double x,double cons,double M200,double R200);
double NFW_M(double x,double cons,double M200,double R200);
double NFW_deltac(double cons);
double NFW_Concentration(double Vmax,double M200,double R200);
double NFW_rho(double cons,double x);
Expand Down
11 changes: 11 additions & 0 deletions nfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ double NFW_Utility::NFW_Vr(

return sqrt( (log(1+cons*x) -cons*x/(1+cons*x) ) /f/x)*NFW_V200(M200,R200);
}
/// Mass within a radius x in Msun
double NFW_Utility::NFW_M(
double x /// radius , r/R_200
,double cons /// concentration = R_200/R_s
,double M200 /// Mass
,double R200 /// Radius
){
double f = log(1+cons) - cons/(1+cons);

return M200*(log(1+cons*x) -cons*x/(1+cons*x) )/f;
}
/// central over-density of nfw halo
double NFW_Utility::NFW_deltac(
double cons /// concentration = R_200/R_s
Expand Down

0 comments on commit 103b081

Please sign in to comment.