Also called numerical integration, quadrature refers to the approximation of an integral made by evaluating the integrand at a finite number of points.

learn more… | top users | synonyms

1
vote
2answers
80 views

(Fortran) Integrating/summing over complicated 3D domain

I have some function $F(k_x,k_y,k_z)$ that I wish to numerically integrate over a polygon domain - physically, I am integrating over the first Brillouin Zone (BZ) of the FCC lattice (a truncated ...
0
votes
0answers
58 views

Using scipy.quad to calculate difficult integral

When evaluating the integral below in python using scipy.quad I get the following warning: UserWarning: The maximum number of subdivisions (50) has been achieved. If increasing the limit yields no ...
2
votes
2answers
74 views

How to implement Gauss-Laguerre Quadrature in Python?

To get the hang of Gauss-Laguerre integration I have decided to calculate the following integral numerically, which can be compared to the known analytical solution: \begin{align} \int_0^{\infty} ...
2
votes
1answer
74 views

Is there a Gauss-Laguerre integration routine in Python?

I am reading the book "Numerical Recipes in Fortran 77: The Art of Scientific Computing" (Second Edition) and I came across some methods for numerical integration of 1D functions. More specifically ...
0
votes
1answer
76 views

Tanh-sinh quadrature numerical integration method converging to wrong value

I'm trying to write a Python program to use Tanh-sinh quadrature to compute the value of \begin{equation} \int_{-1}^1 \frac{dx}{\sqrt{1-x^2}} \end{equation} but although the program converges to a ...
3
votes
1answer
37 views

How do error estimates scale for multidimensional cubature?

Suppose I have a quadrature method with a theoretical error estimate that scales with the number of points as $e(N)$: $$\int_a^b f(x)\mathrm{d}x = \sum_{i=1}^N w_i f(x_i) + ...
3
votes
3answers
89 views

Surface integration over a portion of an ellipsoid

I would like to perform a surface integration over a portion $D$ of an ellipsoid. A plane arbitrarily intersects the ellipsoid forming two sections, of which one is $D$. I do not know how I can ...
1
vote
1answer
230 views

How do I integrate this function in python?

Essentially this is the problem: $\hat{F}(\omega) = \int_0^{\infty} f(s)e^{-i\omega s}ds$ The function $f$ is in general complex valued. I know this looks like the fourier transform but I don't want ...
5
votes
1answer
102 views

Solving the quadratic in the Fast Marching Method

The Fast Marching Method is a way of solving the Eikonal Equation on a discrete grid, essentially just computing a wavefront speading out from initial points, IE: The idea is that we want to ...
1
vote
3answers
91 views

Fast way to compute integral of type $\int dx f(x) \cos(n \pi x)$ in SciPy

I have an integral of the form $$ I(n) = \int_0^1 dx f(x) \cos(n \pi x) , $$ where $n$ is an integer. In other words, I calculate the cosine Fourier coefficients of function $f$, which is real and ...
4
votes
1answer
95 views

Numerical spherical integration

In a high-dimensional setting, say $d \gg 5$, what is a recommended way of evaluating a spherical integral of a smooth (non-symmetric) function $f(\mathbf{x})$? $ \int_\mathcal{S_r} f(\mathbf{x}) ...
4
votes
1answer
115 views

Numerical Integration with Convergence Factor with SciPy: Problem with Improper Integral

I would like to perform the numerical integration of an integral of the form $$ \int_{-\infty}^\infty e^{i \omega 0+} G(i \omega, \mathbf{v}) d \omega ,$$ or, using the symmetry $G(i\omega)^* = G(-i ...
3
votes
0answers
37 views

Radial integration of expensive function with Bessel weights

I need to calculate the integral $$I = \int_0^R f(r)J_n\left(\frac{z_{nm}r}{R}\right)rdr$$ where $J_n$ is the $n^{\mathrm{th}}$ order Bessel functions of the first kind, $z_{nm}$ is its ...
3
votes
0answers
58 views

Numerical Quadrature of Oscillating Integral With Non-oscillating part

As you will know there are different numerical integrals (I believe Levin's method is the most popular one) for the numerical quadrature of oscillating integrands which may roughly speaking be written ...
0
votes
0answers
53 views

Numerical integral with a weakly singular kernel with a satisfactory precision

I am working on numerical method for time fractional PDE. One problem is that I must compute numerical integral with the following form: \begin{equation} \int_0^{t_m} (t_m-s)^{-\beta}f(s)ds ...
4
votes
0answers
38 views

Methods for integrating black box functions on a non-uniform grid

If i have some function expressed as points on a non-uniform grid (I'm specifically interested in logarithmic grids, but general results are also interesting), and I want to integrate it, I believe ...
3
votes
1answer
111 views

Trapezoidal rule (linear Newton-Cotes integration) convergence for periodic functions on general non-uniform grids

For periodic functions on a regularly spaced grid, the trapezoidal rule is supposed to converge incredibly quickly ( the error estimate decreasing as $O(e^{-\eta/h})$ for step size $h$ ). However, I ...
5
votes
0answers
77 views

Integrating highly oscillatory functions

I have a logarithmic grid, upon which i have two functions that are similar to this one (this is only the last 100 points): These are essentially very similar to a Sin function at this point. I ...
3
votes
1answer
114 views

Reliable quadrature software

I would like to numerically integrate a smooth function (to be precise, I am computing differential entropies of Gaussian mixtures of the form $\int f(x) \log(1/f(x)) dx$). Is there any software ...
6
votes
2answers
265 views

adaptive Gauss-Kronrod quadrature with vector-valued integrand

So I'm trying to implement a Gauss-Kronrod adaptive quadrature. That is, I want to calculate $$\int_a^b f(x) dx = \sum_i f(x_i) w_i$$ where f(x) is evaluated at multiple points at once for ...
4
votes
1answer
169 views

How to integrate numerically over a radial domain

I want to integrate a function over a radial domain $D=\{r<r(\theta)\}$. The change to polar coordinates yields: $$ \int_D f = \int_0^{2\pi} \int_0^{r(\theta)}f(r,\theta)rdr d\theta $$ so I tried ...
4
votes
1answer
467 views

Integration of matrix-valued function using MATLAB

I need to compute the integral $\int_{\mathbb{R}^3}f(x)\, dx$, where $f$ is a matrix-valued function $f:\mathbb{R}^3\to\mathbb{R}^{3\times 3}$. How do I do that using MATLAB? The function $f$ is ...
1
vote
1answer
261 views

How can I get Octave to correctly compute a double integral of a piecewise function?

Computational Science People: The title is the question. I am trying to numerically compute a certain integral over a square in Octave (an open-source Matlab clone). I'm getting the wrong answer. ...
4
votes
2answers
247 views

FEniCS: custom quadrature rule

For the numerical integration of reaction terms in my PDE on a 2D triangular mesh, I would like to use the scheme $$ \int_T \Phi(x) \approx \frac{|T|}{3} (\Phi(x_0) + \Phi(x_1) + \Phi(x_2)) $$ where ...
5
votes
0answers
94 views

Finding quadrature weights for a given set of points? How to select points such that all weights are positive?

Currently, I fit a Finite Element solution of a PDE on a spectral basis. The matrices ($R^{25000\times 2000}$) of the corresponding system of linear equations are highly ill-conditioned ($\kappa ...
7
votes
1answer
168 views

Method selection for numeric quadrature

Several families of methods exist for numeric quadrature. If I have a specific class of integrands how do I select the ideal method? What are the relevant questions to ask both about the integrand ...
3
votes
2answers
934 views

In C++, how do you calculate the analytical value of $\int_a^b \left|\sin x \right|\,dx$?

How would I find the definite integral (between any 2 limits, say a and b) of the absolute value of sin(x)? I can calculate for the interval 0 to Pi, and from 0 to 2*Pi, but what if the user enters a ...
12
votes
3answers
362 views

Numeric Quadrature with Derivatives

Most numerical methods for quadrature treat the integrand as a black-box function. What if we have more information? In particular, what benefit, if any, can we derive from knowing the first few ...
9
votes
1answer
120 views

Integrating a harmonic function over a tetrahedron

Say I have a function $f : \mathbf{R}^3 \to \mathbf{R}$ that I wish to integrate over a tetrahedron $T \subset \mathbf{R}^3$. If $f$ was arbitrary, Gauss quadrature would be a good solution, but I ...
3
votes
1answer
761 views

Finite Element Method: 2-D Poisson's Equation in Matlab, Gaussian quadrature

I'm having trouble understanding how to code 2-D Poisson's Equation with Dirichlet boundary conditions. What I have thus far is Constructed square mesh with triangular elements Assembled stiffness ...
14
votes
1answer
221 views

Does transforming $J_0(x)\to\int\cos(x\sin\theta)$ help with numerical integration?

I've heard anecdotally that when one is trying to numerically do an integral of the form $$\int_0^\infty f(x) J_0(x)\,\mathrm{d}x$$ with $f(x)$ smooth and well-behaved (e.g. not itself highly ...
21
votes
4answers
2k views

Method for numerical integration of difficult oscillatory integral

I need to numerically evaluate the integral below: $$\int_0^\infty \mathrm{sinc}'(xr) r \sqrt{E(r)} dr$$ where $E(r) = r^4 (\lambda\sqrt{\kappa^2+r^2})^{-\nu-5/2} ...
12
votes
2answers
368 views

Numerical Integration - handling NaNs (C / Fortran)

I am dealing with a tricky integral that exhibits NaNs at certain values near zero and at the moment I am dealing with them quite crudely using an ISNAN statement which sets the integrand to zero when ...
11
votes
1answer
220 views

How to integrate polynomial expression over 3D 4-node element?

I want to integrate a polynomial expression over a 4-node element in 3D. Several books on FEA cover the case where integrating is performed over an arbitrary flat 4-noned element. The usual procedure ...
11
votes
3answers
664 views

Numeric integration of multi-dimensional integral with known boundaries

I have a (2-dimensional) improper integral $$I=\int_A \frac{W(x,y)}{F(x,y)}\,\mbox{d}x\mbox{d}y$$ where the domain of integration $A$ is smaller than $x=[-1,1]$, $y=[-1,1]$ but further restricted by ...
5
votes
2answers
452 views

Methods to solve a double integral

I want to solve the following expression (used to obtain an analytic solution to a current distribution inside a workpiece): $$a_{mn} = -\frac{\frac{4}{ab} \int_0^a \int_0^b ...
12
votes
5answers
1k views

How can I approximate an improper integral?

I have a function $f(x,y,z)$ such that $\int_{R^3} f(x,y,z)dV$ is finite, and I want to approximate this integral. I'm familiar with quadrature rules and monte carlo approximations of integrals, ...
8
votes
2answers
1k views

Higher-order numerical integration on a triangle/tetrahedron/simplex

Let $T$ be a triangle and let $f$ be a smooth function on $T$. We can use mid-point quadrature $\int f dx \approx |T|\cdot f(x_M)$, where $x_M$ is the middle-point of $T$. Can you provide me with (a ...
10
votes
3answers
263 views

Numerical integration of compactly supported function on a triangle

as the title suggests I'm trying to compute the integral of a compactly supported function (Wendland's quintic polynomial) on a triangle. Notice, that the center of the function is somewhere in 3-D ...
2
votes
1answer
557 views

Error calculation in trapezoidal rule

If we use the composite trapezoidal rule, then what is the least number of divisions $N$ for which the error of the integral $\int^1_0{e^{-x}}dx$ doesn't exceed $\frac{1}{12}\times10^{-2}$. My guess ...
6
votes
0answers
113 views

Suggestions for numerical integral over Pólya Distribution

This problem arises from a Bayesian statistical modeling project. In order to compute with my model, I need to perform an integration in which part of the integrand is the "Pólya" or ...
10
votes
1answer
181 views

Quadrature rules, methodologies, and references

There is at least one quite comprehensive encyclopaedia of quadrature rules that doesn't seem to have been updated in quite a while and has restricted access. This source refers to several classical ...
8
votes
1answer
335 views

What numerical quadrature to choose to integrate a function with singularities?

For example, I would like to numerically compute the $L^2$-norm of $\displaystyle u = \frac{1}{(x^2+y^2+z^2)^{1/3}}$ in some domain that includes zero, I tried Gauss quadrature and it fails, it is ...
7
votes
2answers
337 views

numerical integration with possible division by 'zero'

I am trying to integrate $$\int^1_0 t^{2n+2}\exp\left({\frac{\alpha r_0}{t}}\right)dt$$ which is a simple transformation of $$\int^{\infty}_1 x^{2n}\exp(-\alpha r_0 x)dx$$ using $t = \frac1{x}$ ...
18
votes
3answers
1k views

What's the state-of-the-art in highly oscillatory integral computation?

What's the state-of-the-art in the approximation of highly oscillatory integrals in both one dimension and higher dimensions to arbitrary precision?