trapz Function

public function trapz(x, y) result(Int)

Aproximates the integral of the function given a set of points: using the trapezoidal rule. The points do not need to be linearly spaced along the integration domain.

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: x(0:)

Array containing the abscissas of the points

real, intent(in) :: y(0:)

Array containing the ordinates of the points

Return Value real

Numerical aproximation to the integral