# Questions tagged [integration]

The tag has no usage guidance.

151 questions
Filter by
Sorted by
Tagged with
6k views

### What does “symplectic” mean in reference to numerical integrators, and does SciPy's odeint use them?

In this comment I wrote: ...default SciPy integrator, which I'm assuming only uses symplectic methods. in which I am refering to SciPy's odeint, which uses ...
410 views

206 views

### Numerical integration of a hypergeometric function

The Task Let $z_1, z_2, z_3$ be positive real numbers and define $$r(\mathbf{z}):= \int_0 ^\infty (t+z_1)^{-3/2}(t+z_2)^{-3/2}(t+z_3)^{-1/2}\text{d}t.$$ The task is to compute $r$ numerically in ...
609 views

### Numerical integration using RKF7(8) - different results

For my thesis, I look in trajectories of vehicles through an atmosphere at very high velocities. I have a set of equations of motion, which I propagate using a Runge-Kutta-Fehlberg (RKF) 7(8) ...
2k views

### Evaluating the surface integral in an FEM (Finite Elements Method) procedure

I want to evaluate the Surface force integral in an FEM procedure. The basic reference tet is shown in the figure. The faces are numbered corresponding to the node opposite to them. For example the ...
162 views

### What is the best numerical method for a six dimensional spherical integral?

I am trying to do integrals of the type $$\int d^3\vec{p} \int d^3\vec{p}' e^{-p^2} e^{-{p'}^2}f(\vec{p}, \vec{p}')$$ where $\vec{p}$ and $\vec{p}'$ are three dimensional vectors represented using ...
1k views

### 2D numerical integration with infinite limit (C++)

In order to integrate a two dimensional function of the form $$\int_{1}^\infty \int_{-\sqrt{x^2-1}}^{\sqrt{x^2-1}} e^{-x} \rm{d}y \rm{d}x,$$ I have been attempting to use the following code (written ...
299 views

### Numerical quadrature in Discontinuous Galerkin

I would like to know which is the best way to integrate numerically Legendre polynomials. I am building up a Discontinuous Galerkin CFD code for which Legendre polynomials are used as basis functions ...
919 views

### Convergence of Monte Carlo integration

In my research, one of the steps is to choose a numerical method to estimate $\int_a^b f(t)dt$, where $f$ is Lipschitz continuous but not differentiable. For simplicity, I used midpoint rule but the ...
121 views

### Why does this integral converge faster than normal rectangle or trapz integration?

I was looking for the fastest converging method to integrate a family of functions. After some tries, an old-school colleague suggested me a method that he used to use in excel to perform such task. ...
118 views

272 views

89 views

### Can I make this numerical integration continuously differentiable?

Suppose I have the discrete values $f(x_i)$ for every discrete value $x_i$ greater than some $\varepsilon$, and I want to numerically calculate the following integral: \begin{equation} n = \int_\...
825 views

### Trapezoid rule vs Gaussian quadrature: what am I missing?

I'm reading a paper right now which criticizes a method because it uses trapezoid rule, rather than "more advanced quadrature rules like the Gauss quadrature"... The Gaussian quadrature rule requires,...
295 views

### CUDA & Python for numerical integration and solving differential equations

Can anyone please suggest some libraries which allow use CUDA in Python for numerical integration and/or solving of differential equations? My goal is to solve large (~1000 equations) of coupled non-...
999 views

### Numerical integration in Python with unknown constant

I’d like to solve the below equation for the unknown $T$: $$\int_0^\infty \frac{x^2}{\exp\left(\frac{x}{T}\right)-1}\kappa_x \mathrm{d}x = C,$$ where $C$ is a known constant and $\kappa_x$ is some ...
2k views

### Integration of the Fermi distribution using Python

I want to calculate the carrier concentration of my semiconductor using this equation: $$n(x) = \frac{m^*}{\pi\hbar^2}\int_{E_k}^{\infty}\frac{1}{1+\exp\left(\frac{E-E_f}{k_BT}\right)} \mathrm{d}E$$...
243 views

### Solving ODE with “Jumpy” Coefficients

I'm numerically solving a linear coupled ODE of the form $$y^{\prime}(t) = \hat{M}(t)y(t)=\left[\begin{array}{cc}0& A(t)\\ B(t)& 0\end{array}\right]y(t),$$ and the difficulty I'm running into ...
62 views

### Hankel transform with high accuracy

Short version I'm computing the zero-order Hankel transform of a function $f(r)$, $$F(k) = \int_0^\infty f(r)J_0(kr)r\,\mathrm{d}r$$ I know $f(r_n)$ at selected $r_n$ but it is impractical to compute ...
498 views

### General heuristics for making a choice “dopri5”, and “lsoda”?

With scipy, I have the choice of using "lsoda": Real-valued Variable-coefficient Ordinary Differential Equation solver, with fixed-leading-coefficient ...
210 views

### How to use numerical integration to calculate the surface area of a superellipsoid?

I am working in an application in which I need to calculate the surface area of a superellipsoid. I have read that there is no closed form solution (see here), so I am trying to compute it using ...
67 views

### Time independent Runge Kutta integration of SDE

I am trying to compare the result of numerical integration of time independent Runge_Kutta, github page for stochastic differential equations with the analytical solution. True answer match the ...
1k views

### integral including a vector

I need to calculate the integral of this function def f(z): return ((1-2*z)*np.exp(-d/z))/(((1-z)**(2+d))*(z**(2-d))) Here d is a constant. I am using this ...
574 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} \...
67 views

### Choosing an appropriate time step for a discrete & continuous dynamics simulation

I have inherited of a flight dynamics simulation in C++ which represents a small drone with it's autopilot, actuator dynamics and a solid state IMU. Hence, it is composed of a few models, some ...
129 views

### Numerical computation of $\log \int_a ^b f(x) \mathrm{d}x$ from $\log f(x)$?

I want a numerical method to evaluate: $$\log \int_a ^b f(x) \mathrm{d}x$$ when what I have is a numerical routine to evaluate $\log f(x)$. The problem is that if $f(x)$ takes very large or very ...
75 views

### Numerical integration with singularity term

In https://www.johndcook.com/blog/2012/02/21/care-and-treatment-of-singularities, the author explains the subtraction method to get rid of singularities when performing numerical integration. The ...
48 views

### Book Suggestion for Approximating Integrals using Random Partitions

Suppose I want to approximate the integral $\int_0^1 x^2\,dx$ using Riemann Sums or Darboux sums over random partitions of the interval $[0,1]$, Like in the image below: Here, A "random" partition of ...
263 views

### Comparison of integrals with a function:

Consider the following integral: $$S(q)=\int_{x=2}^q\sin^2\left(\frac{π\Gamma(x)}{2x}\right)dx$$ And consider the functions : $$R(q)=\frac{q}{\log(q)}$$ $$T(q)=\int_2^q\frac{1}{\log(x)}dx$$ I ...
237 views

### How to estimate the error of trapezoidal rule using discrete data?

How can I estimate the error of a result obtained by using the trapezoidal rule if I don't have the function that describes my problem? The only thing I have is discrete points.
212 views

### Weak form of the Navier-Cauchy equation

I am trying to obtain the weak form of the Navier-Cauchy equation, which is $$- \rho \omega ^2 \textbf{U} - \mu \nabla ^2 \textbf{U} - (\mu + \lambda) \nabla (\nabla \cdot \textbf{U}) = \textbf{F}$$ ...
437 views

### Integration of a diverge function in c++ GSL Library

I am trying to perform an Integral of Hypergeometric function 2F1(a,b,c,x) from -1 to 1 for some good values of $a,b,c$ (lets say $a=1,b=2,c=3$) . I did it in ...