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

Optimization of adiabatically-contracted dark matter halo density profiles #575

Open
abensonca opened this issue Mar 7, 2024 · 0 comments

Comments

@abensonca
Copy link
Collaborator

In solving for the density profile of adiabatically-contracted dark matter halos we have to solve the equation for the initial radius:

$$M_\mathrm{total,0}(\bar{r}_\mathrm{i}) [ f_\mathrm{i} r_\mathrm{i} - f_\mathrm{f} r_\mathrm{f} ] - V^2_\mathrm{b}(\bar{r}_\mathrm{f}) \bar{r}_\mathrm{f} r_\mathrm{f}/ \mathrm{G} = 0$$

It might be faster to find the root using a gradient-aware method. The gradient in the above is easy enough to compute - the only complicated term is:

$$\frac{\mathrm{d}M_\mathrm{total,0}(\bar{r}_\mathrm{i})}{\mathrm{d}r_\mathrm{i}} = 4 \pi \bar{r}_\mathrm{i}^2 \rho_\mathrm{total,0}(\bar{r}_\mathrm{i}) \frac{\mathrm{d}\bar{r}_\mathrm{i}}{\mathrm{d} r_\mathrm{i}}$$

and

$$\frac{\mathrm{d}\bar{r}_\mathrm{i}}{\mathrm{d} r_\mathrm{i}} = \omega \frac{\bar{r}_\mathrm{i}}{r_\mathrm{i}}$$

It would be useful to benchmark this in cases where we have a good initial guess for the solution, and for cases where we do not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant