enclosed_mass_numeric#

jeanspy.model_jax.NFWModel.enclosed_mass_numeric

Class and construction: NFWModel.

NFWModel.enclosed_mass_numeric(r_pc, *, params, n_steps=256, t_min=1e-06)#

Numerically compute enclosed mass via 4π∫ρ(r)r²dr.

This default path is AD-friendly and avoids special-function gradient issues. If r_t_pc exists in params, radius is truncated at that value.

Notes

Inputs and units. r_pc is scalar/array in pc; params is the physical dictionary. n_steps is an integer >= 2 giving the trapezoidal grid size. t_min is the lower radial fraction, strictly between 0 and 1; density is integrated from t_min * min(r_pc, r_t_pc) to that outer radius. Out-of-range grid settings raise ValueError. To select a different mass method, call enclosed_mass instead.

Returns and shape. Mass in Msun within min(r_pc, r_t_pc), matching radius shape. Invalid dynamic proposals yield NaN.

Parameters:
Return type:

jax.Array