Skip to content

Trapezoid

trapezoid

Log-trapezoidal integrator.

Functions

log_trapezoidal_integrand_dx

log_trapezoidal_integrand_dx(log_y: Array, x: Array) -> Array

Compute the log integrand dx of the following integral using the trapezoidal rule.

\[ \log z = \log \int \exp(\log y(x)) \mathrm{d}x \]

Parameters:

Name Type Description Default
log_y Array

Log of y(x).

required
x Array

Argument of the function y.

required
Return

Log of the integrand dx.

log_trapezoidal_integrate

log_trapezoidal_integrate(log_y: Array, x: Array) -> Array

Compute the following integral using the trapezoidal rule.

\[ \log z = \log \int \exp(\log y(x)) \mathrm{d}x \]

Parameters:

Name Type Description Default
log_y Array

Log of y(x).

required
x Array

Argument of the function y.

required
Return

Log of the integral.

log_trapezoidal_cumsum

log_trapezoidal_cumsum(log_y: Array, x: Array) -> Array

Compute the log of the cumulative sum of the following integral using the trapezoidal rule.

\[ \log z(x) = \log \int^{x} \exp(\log y(x')) \mathrm{d}x' \]

Parameters:

Name Type Description Default
log_y Array

Log of y(x).

required
x Array

Argument of the function y.

required
Return

Log of the cumulative sum.