8000 fix IMF from Eggleton book by savchenkoyana · Pull Request #181 · teuben/nemo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix IMF from Eggleton book #181

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

savchenkoyana
Copy link

There is an option in Nbody4 to generate masses according to Eggleton book. As I understood, they imply this one: Peter Eggleton, "Evolutionary Processes in Binary and Multiple Stars", https://doi.org/10.1017/CBO9780511536205

In this book, section 1.6, there is a slightly different expression: 0.3 (u / (1-u))**0.5 instead of 0.3 u / (1-u)**0.5.

I made a small script to demonstrate the difference:

import numpy as np
import matplotlib.pyplot as plt

u = np.random.uniform(size=5000)

def f_nbody(u):
    return 0.3 * u / (1 - u)**0.55

def f_book(u):
    return 0.3 * (u / (1 - u))**0.55

bins = np.logspace(-5, 1)

m_nbody = f_nbody(u)
m_book = f_book(u)

plt.hist(m_nbody, bins=bins, color='r');
plt.hist(m_book, bins=bins, color='b');
plt.xscale('log')

plt.show()

print(np.max(m_nbody), np.min(m_nbody))
print(np.max(m_book), np.min(m_book))

изображение

If masses in formula are given in Solar masses, we get too small mass from the current IMF, right?

Is this a bug? idk maybe it's not that important, but I decided to make a PR.
Also it is not fixed in Nbody6 (both versions from Aarseth site and GPU repo)

@teuben
Copy link
Owner
teuben commented Apr 15, 2025

Another option would be to invent a new value of KZ(20) to make the "old/bad" implementation still work and allow a new value. E.g.

         IF(KZ(20).EQ.3)THEN
            ZM = 0.3D0*XX/(1.D0 - XX)**0.55
         ELIF(KZ(20).EQ.33)THEN
	    ZM = 0.3D0*(XX/(1.D0 - XX))**0.55

I'm also noting the exponent being 0.55 vs. 0.5. who is right there???

@savchenkoyana
Copy link
Author
savchenkoyana commented Apr 15, 2025

I'm also noting the exponent being 0.55 vs. 0.5. who is right there???

Oops, it's 0.55 in both versions (Aarseth and Eggleton), I messed up in the text of issue (In the example code and illustration everything is given right)
The typo that I'm repotring (if there is a typo) is: u**0.55 vs u in the numerator.

This is the screen from the original book:

{D2F199F6-439B-43E2-8B8D-F627D6FAA79A}

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
0