Skip to content

Commit

Permalink
Building on Toomre calcs to make a fuller disk model
Browse files Browse the repository at this point in the history
  • Loading branch information
clairekope committed Feb 13, 2023
1 parent 6696ec3 commit 576e48a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions plot_grav_profs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# coding: utf-8
import unyt as u
import numpy as np
import matplotlib.pyplot as plt
from calc_toomre import DiskModel

r = np.linspace(1,201) * u.kpc

dsk = DiskModel()

g_nfw_mn = dsk.g(r)
g_modnfw = dsk.g_modNFW(r)

fig, ax = plt.subplots(ncols=2)

ax[0].plot(r, np.sqrt(r*g_nfw_mn).to('km/s'), label='NFW+MN')
ax[0].plot(r, np.sqrt(r*g_modnfw).to('km/s'), label='modNFW')

ax[1].plot(r, g_nfw_mn.to('km/s**2'))
ax[1].plot(r, g_modnfw.to('km/s**2'))

ax[0].set_xlabel("r [kpc]")
ax[1].set_xlabel("r [kpc]")

ax[0].set_ylabel(r"$v_\mathrm{circ}$ [km/s]")
ax[1].set_ylabel(r"g [$\mathrm{km/s^2}$]")

ax[0].legend()
plt.show()
File renamed without changes.

0 comments on commit 576e48a

Please sign in to comment.