Skip to content
UPEEC

Numerical Integration

Approximate definite integrals with the trapezoid rule, Simpson's rule or adaptive quadrature.

Intermediate
Comments 0
from scipy import integrate
integrate.quad(lambda t: t**2, 0, 3)        # (9.0, error)
integrate.trapezoid(power_samples, t)        # energy from sampled power

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.