Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Numerically integrate a function using the Padua points
ResourceFunction["PaduaIntegrate"][f,{x,xmin,xmax},{y,ymin,ymax}] gives a numerical approximation to the multiple integral by evaluating f at the Padua points. |
InterpolationOrder | 15 | order of the interpolating polynomial generated |
"PaduaType" | 1 | type of Padua points to use |
WorkingPrecision | MachinePrecision | the precision used in internal computations |
Numerically integrate the function Exp[-x2-y2]:
In[1]:= |
|
Out[1]= |
|
Compare with the exact answer:
In[2]:= |
|
Out[2]= |
|
A test function due to Franke:
In[3]:= |
|
Integrate the function over a rectangular domain:
In[4]:= |
|
Out[4]= |
|
Compare with the result of NIntegrate:
In[5]:= |
|
Out[5]= |
|
Use a degree 25 interpolant for integrating the Dixon–Szegö function:
In[6]:= |
|
Out[6]= |
|
Use type-3 Padua points in integrating the Dixon–Szegö function:
In[7]:= |
|
Out[7]= |
|
Use 25-digit precision for the numerical integration:
In[8]:= |
|
Out[8]= |
|
If the input function is a polynomial of degree k, PaduaIntegrate gives the exact answer provided k is less than or equal to the setting for InterpolationOrder:
In[9]:= |
|
Out[9]= |
|
In[10]:= |
|
Out[10]= |
|
A test function due to Franke:
In[11]:= |
|
Integrate the function by integrating the interpolant obtained from the resource function PaduaInterpolation:
In[12]:= |
|
Out[13]= |
|
The result of directly using PaduaIntegrate is more accurate:
In[14]:= |
|
Out[14]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License