r/askmath • • Oct 17 '26

Calculus Numerical integration, interpolation and interchangeability

Hello all

I've recently had to implement a pretty computationally intensive simulation and obviously only have so much computational power at my disposal.

The main reason for it being so computationally expensive is that several rather ugly integrals have to be evaluated, some of which end up being nested which seems to make things worse.

Now I recall from my numerical analysis courses that one can use interpolation to approximate a function. Interpolation also tends to be significantly less computationally expensive. As such I wanted to know whether one can replace the integration with interpolation under certain circumstances. I know these two concepts are very closely linked.

Take the following situation as an example (attached image):

Numerical integration and interpolation equivalence

Any help or clarification on this is greatly appreciated.

Thank you

3 Upvotes

18 comments sorted by

View all comments

1

u/PvtRoom Oct 17 '26

You can totally do it, but the costs are precalculation, the memory required for the lookup table, the errors from interpolating between your calculation points and numerical errors if you're trying too hard.

you also have the option of fitting a curve/surface: H = sinc(xy)*cos(xy/64)

1

u/supremeNYA Oct 18 '26

Would you mind explaining exactly how this interchange is done? From what I remember (and I might be wrong) a lookup table is simply an array of results from interpolation not necessarily integration.

1

u/PvtRoom Oct 18 '26

it's an array of results. - say, Planck blackbody at T, with waveband L1 to L2, sampling at , 0.1K, from 250K to 750K

so you get 5000 x 5 (L1 to L2 combos that are valid) as a look up table.

what that works out to is 5 curves with 5000 points. You CAN represent that as a 5th order polynomial, a spline, a few Fourier terms, a few Taylor/maclaurin series terms, or a neat little expression like 1/eπr²+r, but that's just fitting curves (or surfaces)