Error estimate for integral of interpolated function

Click For Summary
SUMMARY

The forum discussion centers on estimating the error in the integral of an interpolated function derived from simulation results on a 101x101 grid. The user employs Python's SciPy library, specifically the interp2d function for spline interpolation. To assess the error due to interpolation, the user considers using the midpoint method as a straightforward approach. The discussion also touches on the potential for running interpolation on a reduced grid (51x51) and the limitations of obtaining additional simulation data points.

PREREQUISITES
  • Understanding of numerical integration techniques
  • Familiarity with Python programming
  • Knowledge of interpolation methods, particularly spline interpolation
  • Experience with the SciPy library, specifically the interp2d function
NEXT STEPS
  • Research the midpoint method for numerical integration
  • Explore alternative interpolation algorithms in SciPy, such as griddata or Rbf
  • Learn about error analysis techniques in numerical integration
  • Investigate methods for increasing the resolution of simulation data
USEFUL FOR

Students and researchers in computational science, particularly those working on numerical methods for integration and interpolation in Python.

maka89
Messages
66
Reaction score
4
Hi,
I have a project at uni where I am making an approximate analytical expression for a parameter and comparing the result with more rigorous simulations. The thing is: the parameter I am comparing is the 2d-integral of the results from the simulations over some area, and the simulation results comes out on a regular grid.

I have made a script in python and my procedure is:

1. Aquire a function by interpolating the output of the simulation ( which is on a 101x101 grid ).
2. Integrate this function over the integration area using an adaptive integration routine.
3. Compare result with the analytical expression.

Now, I would like to find out how much error there is in the integral due to the interpolation. Is there any way to do this?

Will happily clarify or give more info if needed.

Thanks =)
 
Physics news on Phys.org
Do you have different interpolation algorithms available?
Can you run the interpolation on a subset (like 51x51, taking every second entry in each dimension)?
Is it possible to run the simulation with more data points (at least once or twice)?

As an upper limit on the error, a simple "add all 101*101 values" should give an approximation that is worse than all interpolations but not completely wrong.
 
I use this python function at the moment(it uses spline interpolation):
http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.interp2d.html

Yes, I can run the interpolation on a subset, but can't get new simulations with more points atm.

So basically using the midpoint method and use the difference as an error estimate? Guess that should give some estimate to the error. That was indeed a simple, yet good idea that I hadn't considered. Thanks =)
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K