zemogle / chemevol

Chemical evolution python package
3 stars 3 forks source link

need midpoint mass in mass integral #9

Closed haleygomez closed 8 years ago

haleygomez commented 8 years ago

integral mass is not the midpoint for any of the mass integrals gas_metals_dust_mass or sn_rate

zemogle commented 8 years ago

I don't have a good idea how to implement this where we have a variable dM size.

haleygomez commented 8 years ago

i have a bit of code from my f90 if that helps? ` mmid=0. dlogm=0. logmnew=0. logmnew=log10(m)+dlogm dm=10.**(logmnew)-m

  dlogm=(log10(100.0)-log10(m_min))/100

logmnew=log10(m)+dlogm dm=10.(logmnew)-m mmid=10.0((logmnew+log10(m))/2.0)`

-- UPDATE MASS mnew=10**(logmnew) m=mnew

haleygomez commented 8 years ago

Simon did this in his branch mass_dm_log - added functionality for log m step in functions.py mass_integral. Tests on the number of steps shows gas fraction and dust mass same for 100 - 1000. Set to 500 to ensure runs not blocky within mass integral