In my current work I integrate numericaly some function over [0, \infty) using NumPy calling of Fortran libraries. I want to try do my problem using Julia, but I can’t find out-of-the-box library computing integrals.
Can someone tell my how numerical integration look now in Julia? Do I need call Fortran code directly? I try google something, but find almost nothing.
Hi, There are several packages for numerical integration in Julia.
More explicitly, do
using Pkg; Pkg.add("QuadGK") to install the QuadGK package, and then do
quadgk(f, 0, Inf, rtol=1e-3)
to compute \int_0^\infty f(x)dx (along with an error estimate) for a function
f, to about 3–4 digits.
Does anyone know how to perfom numerical integration on a gpu?
Use https://github.com/ajt60gaibb/FastGaussQuadrature.jl to get the quadrature rates, use a CUArray and broadcast your function across the array, and then accumulate according to the quadrature weights.