Skip to content

Hui-Hong HW1#15

Open
Hui-Hong wants to merge 1 commit into
sbird:masterfrom
Hui-Hong:master
Open

Hui-Hong HW1#15
Hui-Hong wants to merge 1 commit into
sbird:masterfrom
Hui-Hong:master

Conversation

@Hui-Hong

@Hui-Hong Hui-Hong commented Oct 2, 2024

Copy link
Copy Markdown

Assignment 1 by Hui Hong

const_solarmass=const.M_sun.value*units.kilogram
const_sol=const.c.value*units.meter/units.second

return 2*const_G*const_solarmass*m_in_solarms/const_sol**2

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make it do the work for you easier with:
const_G = units.newtonian_constant_of_gravitation
and const_c = units.speed_of_light
then it will convert automatically if you use R_s = ().to('m')

Comment thread pbhmergers.py
plt.xlabel(r"$M_\mathrm{vir}$ ($M_\odot/h$)")
plt.ylabel(r"Concentration")
plt.ylim(1e-8, 1)
plt.ylim(1,1e2)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unintentional bug :)

@sbird

sbird commented Oct 3, 2024

Copy link
Copy Markdown
Owner

Looks good, thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants