Skip to main content

Module numerical_integration

Module numerical_integration 

Source
Expand description

Numerical integration methods.

Provides composite trapezoid, composite Simpson, Romberg integration, Gauss-Legendre quadrature (5-point and variable-point), adaptive Simpson, Monte Carlo integration, Clenshaw-Curtis, double-exponential (tanh-sinh), and multidimensional trapezoid rules.

Structs§

QuadratureRule
A generic quadrature rule defined by nodes and weights on a reference interval.

Functions§

adaptive_simpson
Approximate ∫ f(x) dx on [a, b] using recursive adaptive Simpson’s rule.
clenshaw_curtis
Approximate ∫_{-1}^{1} f(x) dx using Clenshaw-Curtis quadrature with n+1 points.
double_exponential
Approximate ∫ f(x) dx on [a, b] using the tanh-sinh (double exponential) transform.
gauss_legendre_5pt
Approximate ∫ f(x) dx on [a, b] using the 5-point Gauss-Legendre formula.
gauss_legendre_nodes_weights
Return the Gauss-Legendre nodes and weights for n points on [-1, 1].
monte_carlo_integrate
Approximate ∫ f(x) dx on [a, b] using Monte Carlo sampling with n_samples points.
multidimensional_trap
Approximate ∫ f(x) dx over a hyperrectangle using the composite trapezoid rule.
romberg_integration
Approximate ∫ f(x) dx on [a, b] using Romberg integration (Richardson extrapolation).
simpson_rule
Approximate ∫ f(x) dx on [a, b] using composite Simpson’s rule with n subintervals.
trapezoid_rule
Approximate ∫ f(x) dx on [a, b] using the composite trapezoid rule with n subintervals.