I have the following dataset:
SetDirectory[NotebookDirectory[]];
TableSpectrum = Import["spectrum.dat", "Table"];
I want to make the interpolation. However, when simply using
Interpolation[TableSpectrum, InterpolationOrder -> 1]
it writes that the quality of the underlying mesh is too low. The solution is to change the data in the following way:
Spectrum1[mS_, ES_] =
Interpolation[{Log[#[[1]]], #[[2]], #[[3]]} & /@ TableSpectrum,
InterpolationOrder -> 1][Log[mS], ES]
Spectrum2[mS_, ES_] =
Interpolation[{#[[1]], Log[#[[2]]], #[[3]]} & /@ TableSpectrum,
InterpolationOrder -> 1][mS, Log[ES]]
However, they each have different problems. Spectrum1 is very bad interpolation:
PlotmS[mS_] := LogLogPlot[{Spectrum1[mS, ES]}, {ES, mS, 5000}]
PlotmS[20]
While Spectrum2 is integrated much more slowly:
Timing[NIntegrate[Spectrum1[20, ES], {ES, 20, 5000},Method->"AdaptiveMonteCarlo"]]
Timing[NIntegrate[Spectrum2[20, ES], {ES, 20, 5000},Method->"AdaptiveMonteCarlo"]]]
Is there any way to make the interpolation including the best properties of Spectrum2 (smooth interpolation between grid) and Spectrum1 (fast integration)?




Timing[]? – Michael E2 Jul 29 '19 at 14:55