NFW potential: missing term
In the NFW potential, an option is provided to assume that a fraction of the NFW mass is in a self-gravitating disk or bulge (potential->diskfraction
, potential->bulgefraction
). These parameters are used to reduce the potential including only the contribution due to the static mass and are included in the
potential->pre_factor
variable: potential->pre_factor = potential->M_200 * (1 - potential->bulgefraction - potential->diskfraction) / (4 * M_PI * potential->log_c200_term);
. So far so good.
The problem occurs for the acceleration which uses the enclosed mass defined trough the variable
potential->M_200_times_log_c200_term_inv = potential->M_200 / potential->log_c200_term;
To be consistent, we should remove the disk and bulge contribution and write:
potential->M_200_times_log_c200_term_inv = potential->M_200*(1 - potential->bulgefraction - potential->diskfraction) / potential->log_c200_term;
If you agree with this change, I will create a merge request.