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

0
votes
0answers
18 views

Adaptiv numerical integration of a univariate vector integrand

Background & Problem formulation I'm trying to write a simple program in C++ that performs adaptiv numerical integration of vector valued integrands (in one variable), i.e. $$\int_a^b \bar{f}(x)...
5
votes
0answers
54 views

Numerical computation of two-sided (bilateral) Laplace transform

I need to compute the two-sided (bilateral) Laplace transform of a numerically given function $F$, $$ I(t) = \int_{-\infty}^{+\infty} {dx} \, e^{-x} \, F(x + t) ~, $$ where $F(x)$ has some sharp ...
0
votes
2answers
40 views

Calculating integrals for a function approximated by Chebyshev polynomials

Setup (complete, but all very standard): My problem is how to best calculate the cumulative integral of a function which comes out of Spectral Collocation with a chebyshev basis. Take some function $...
8
votes
1answer
160 views

When is it advantageous to iterate integrals numerically?

If there is an $(n+1)$-dimensional integral of the form $$ \int_{[0,1]^{n+1}} f(x, y)\,\mathrm{d}^n x \,\mathrm{d}y,$$ normally one would evaluate this using a multi-dimensional integration library ...
3
votes
1answer
64 views

Efficient Quadrature Methods for Indicator Functions?

I am looking to numerically solve many different integrals where the integrand is simply the indicator function for a region (i.e. 1 on the region, 0 outside. This is for measuring areas). The ...
4
votes
2answers
511 views

Plot integral function with scipy and matplotlib

I want to plot a numerical integral function of some function $f$ using scipy and matplotlib. How can I do this? I tried the ...
3
votes
1answer
134 views

Using Gauss quadrature for a discontinuous integrand

Suppose I have the following integral: $$\int_{-1}^1 \int_{-1}^1 C_if(x,y)dxdy$$ where \begin{equation} C_i= \begin{cases} C_1 \quad \text{in }\Omega_1\\ C_2 \quad \text{in } \Omega_2\\ \end{cases} \...
3
votes
0answers
39 views

Not sure if sparse quadrature routine is working correctly?

I have written a sparse quadrature routine to integrate multidimensional Gaussian integrals. I'm trying to show convergence plots in my thesis and demonstrate that the code works correctly. I am in ...
2
votes
0answers
198 views

C++ library for numerical intergration (quadrature)

I have my own little subroutine for numerical integration (quadrature), which is a C++ adaptation of an ALGOL program published by Bulirsch & Stoer in 1967 (Numerische Mathematik, 9, 271-278). I ...
3
votes
1answer
88 views

Numerical integration with singularities

I need to compute some integrals numerically. The integrand is this: $$f(x,y) = \left ( \sum_{mn=-j}^{j}A(m,n)\dfrac{\tan^{2j+m+n}(x/2)}{(1+\tan^2(x/2))^{2j}}e^{iy(n-m)} \right )^{N}$$ Note: sums ...
1
vote
1answer
113 views

Quadrature order for finite elements and time dependent discontinuous Galerkin

When setting up a finite element system you have to use quadrature to calculate the integrals. I'm having trouble understanding what order rule to use. I know of some rules of thumb, for example with ...
2
votes
1answer
140 views

Monte Carlo Double Integration Implementation

Am implementing a monte carlo integration routine to compute this double integral in eqn 0.3 of page 2 of this paper 'Mobius energy of knots and unknots', Annals of Mathematics, http://www.math.ucsb....
1
vote
1answer
82 views

Numerical quadrature when locations of singularities are approximate

I'd like to numerically integrate $\frac{1}{\sqrt{f(x)}}$ on an interval between two consecutive zeros of the function $f(x)$, which makes the integrand singular at two endpoints. Standard practice ...
1
vote
3answers
70 views

Numerical integration of a multivariate function whose expression is unknown

This question is related to the previous one, but I believe the extension to several variables is a problem in itself. I have a collection of points $(x_j,y_k,f(x_j,y_k))$ for $x_j=\frac{j}{n}$ and $...
2
votes
0answers
136 views

Calculate Integral Using Gauss Jacobi Quadrature or otherwise

I need to integrate the following integral: \begin{align} I = \int^z\frac{1-\zeta^2}{(1+\zeta^2)(\zeta-\zeta_l)(1-\zeta_l\zeta)}\prod_{k=2}^{n-1}\left ( \frac{\zeta-z_k}{1-\zeta z_k} \right )^{-\...
3
votes
3answers
154 views

Integration over a complicated domain

Consider points $(x,y)$ in a domain $\mathcal{D}$ that is bounded above by a curve $C$ that is multivalued (i.e. I have points defining it that are of the form $(x_n,y_n)$, $n=1,2,..,N$), and looks ...
2
votes
1answer
164 views

How to determine the order of accuracy of a quadrature rule

A bit of a simple question here. Recently, I was evaluating some line integrals using a Gaussian quadrature rule on $[-1,1]$ where the abscissae $x_{i}$ are just the roots of the Legendre polynomial $...
3
votes
1answer
138 views

Approximate $h$ in $F(\theta)=\sin \theta \int_{-L}^{+L}h(z)e^{-ikz\cos \theta} \,dz$

Consider $$F(\theta)=\sin \theta \int_{-L}^{+L}h(z)e^{-ikz\cos \theta} \,dz$$ $$|z|\le L$$ $$0 \le \theta \le \pi$$ By having knowledge of $F(\theta)$, how can one approximate $h(z)$? In addition, I ...
3
votes
1answer
170 views

How to integrate numerically a function with error bars?

Typically, the function that one wants to integrate numerically, $f$, is given, i.e. its values for various points $\{x_i\}$ are known precisely. The resulting error is due to the fact that we chose a ...
1
vote
1answer
88 views

Computing expectations

I want to compute the following conditional expectation $E_{t}[\phi(A_{t+1}, \eta_{t+1})| A_t]$ where $\log A_{t}=\rho \log A_{t-1} + e_{t}$ and $e_{t}$ is IID $N~(0,\sigma_e)$ and $\eta_{t}$ is ...
9
votes
2answers
116 views

Evaluating oscillatory integrals with many independent periods and no closed forms

Most methods for oscillatory integrals I know about deal with integrals of the form $$ \int f(x)e^{i\omega x}\,dx $$ where $\omega$ is large. If I have an integral of the form $$ \int f(x)g_1(x)\...
6
votes
1answer
690 views

Numerical evaluation of an elliptic integral in python

Goal: I need to evaluate numerically an integral of the following form: $$ \int_0^\infty \frac{dx}{(a^2+x)\sqrt{(a^2+x)(b^2+x)(c^2+x)}} $$ where $a,b,c \in \mathbb{R}$ are in the interval $(1,1000)$....
5
votes
0answers
829 views

Why does Matlab's integral outperform integrate.quad in Scipy?

I am experiencing some frustration over the way matlab handles numerical integration vs. Scipy. I observe the following differences in my test code below: Matlab's version runs on average 24 times ...
3
votes
1answer
261 views

Numerical Principal Value Integration - Hilbert like

I'ld like to calculate the PV of an integral with the form $$ \tilde{G}_l(\omega) = -\frac{2\omega}{\pi} PV\int_0^\infty \frac{\tilde{G}_d(\omega^\prime)}{\omega^2 - {\omega^\prime}^2}d\omega^\prime$$ ...
4
votes
0answers
136 views

Comparison between Voronoi and Delaunay 2D quadrature methods

This question is a search for further answers from a question on maths.stackexchange.com. I've inherited some numerical quadrature code that is designed to integrate sparse 2D data. The quadrature is ...
2
votes
2answers
346 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
2k 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
367 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} s^...
3
votes
1answer
1k 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
259 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
218 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) + \mathcal{O}\bigl(e(N)\bigr)...
3
votes
3answers
305 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
377 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 ...
6
votes
1answer
521 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
147 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
117 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}) \...
5
votes
2answers
624 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 \...
4
votes
0answers
45 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 $m^{\mathrm{...
3
votes
0answers
72 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
155 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 \end{...
4
votes
0answers
69 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
256 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
132 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 ...
4
votes
1answer
127 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 ...
7
votes
2answers
665 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
404 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 ...
5
votes
2answers
1k 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 ...
2
votes
1answer
672 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
503 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
129 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 \...