mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Bumps when loading custom rates

Open rjfarmer opened this issue 3 years ago • 11 comments

Interpolating over the rate table seems to be adding bumps in the rate (this is the issue reported by Francisco De Geronimo)

For the attached triple alpha rate see the plot for what happens at low T. Sure the rate has only 23 points so is under-sampled but I would have expected a smoother curve from MESA.

cache_rate

Input rate r_he4_he4_he4_to_c12.txt

MESA's cached rate

r_he4_he4_he4_to_c12_0.txt

Maybe its an issue with having only a few points near the boundary? As at higher T's the curve is smooth.

rjfarmer avatar Jun 09 '22 11:06 rjfarmer

Is this not just an issue of the interpolation happening in the rate's linear, not logarithmic, value? Here's a linear plot. image

warrickball avatar Jun 09 '22 11:06 warrickball

Note the bumps are in the first 4 points (so below logT8 <=3)

rjfarmer avatar Jun 09 '22 15:06 rjfarmer

Sorry, the x-axis label should be T8, not logT. Here's a better attempt but the point stands. image

warrickball avatar Jun 09 '22 15:06 warrickball

6 orders of magnitude in the rate between the first two temperature points, followed by 2-3 orders of magnitude for the next few temperature points. what are the expectations for such a poorly resolved tabulated rate?!

fxt44 avatar Jun 09 '22 15:06 fxt44

Again @warrickball , you need to look at the first 4 data points ie log T8 < 8.5.

@fxt Here is a version where i defined the rate to be the values 1 to 24 (add one for each temperature point)

24 1.00 1 1.50 2 2.00 3 3.00 4 4.00 5 5.00 6 6.00 7 7.00 8 8.00 9 9.00 10 10.0 11 15.0 12 20.0 13 25.0 14 30.0 15 35.0 16 40.0 17 45.0 18 50.0 19 60.0 20 70.0 21 80.0 22 90.0 24 100.0 25

rate_integers

Still wiggly for the first few points. Besides even if it was just due to an under sampled rate, all rate tables are horribly under sampled so we need to do the best we can with what we have.

Or maybe we just refuse to work if people don't give us enough data points in the rate tables?

rjfarmer avatar Jun 10 '22 11:06 rjfarmer

i smell a spline boundary condition at play.

fxt44 avatar Jun 10 '22 11:06 fxt44

We are using interp_pm for the rates but that doesn't specify boundary conditions. Only the 2d interp routines specify boundary conditions

rjfarmer avatar Jun 10 '22 11:06 rjfarmer

Okay, last stab at explaining what I mean. Here's the raw rate data plotted first, as I think you did, in Matplotlib's '.-' style, as well as a line where I interpolated linearly in the rate as a function of logT. The bumps are there. image At this point, I don't think the "bumps" are a problem, they're just an artefact of how the data is plotted/interpolated. If you want log(rate) to be smoother, why not interpolate in log(rate)? Maybe the question is why MESA's interpolant is so similar to linear? (I may well be missing something here!)

warrickball avatar Jun 10 '22 11:06 warrickball

My collaborators and I also found this issue when trying to interpolate the r_c12_ag_o16 using this table: deboer_median_old.txt

We reproduced the Steffen Interpolation routine that MESA uses (https://ui.adsabs.harvard.edu/abs/1990A&A...239..443S) in Mathematica and saw the bumps (thought not as extreme as in the triple alpha plot above) so I think it's a feature of the interpolation routine and not a bug:

image

When we tried using Steffen Interpolation in log space the bumps went away so this seems more stable:

image

jeremysakstein avatar Jun 17 '22 21:06 jeremysakstein

I think we should close this issue, as it isn't clear there is any actual bug that needs resolution. Any objection?

evbauer avatar Feb 23 '23 20:02 evbauer

second.

fxt44 avatar Feb 23 '23 22:02 fxt44