NuMFor 9f2ab49 (2024-04-08)
Numerical (Modern) Fortran. Library for Simple Numerical computing
trapz Interface Reference

Routine for integration of sampled values or functions by using the trapezoid rule. More...

Detailed Description

Routine for integration of sampled values or functions by using the trapezoid rule.

For integration of a real-valued and complex-valued function f the following calls are valid

call trapz(f) ! Using 100 equispaced points between 0 and 1
call trapz(f, a, b) ! Using 100 equispaced points between a and b
call trapz(f, a, b, N) ! Using N equispaced points between 0 an 1
call trapz(f, x) ! Using evaluations on values of array x

Here:

Parameters
[in]fis a real or complex function
[in]a(real) Lower limit of integration
[in]b(real) Upper limit of integration
[in]N(integer) Number of equally-spaced points to use
[in]x(real, array) Points where the function will be evaluated

For sampled values it accepts several input formats,

call trapz(y) ! Using values in array y, corresponding to x ∈ [0,1]
call trapz(y, a, b) ! Using values in array y, corresponding to x ∈ [a,b]
call trapz(y, dh) ! Using values in y, for x values equispaced in dh
call trapz(y, x) ! Using values in y, corresponding to x

Here:

Parameters
[in]yis a real or complex array
[in]a(real) Lower limit of integration
[in]b(real) Upper limit of integration
[in]dh(real) Space between points in the x-axis
[in]x(real, array) Points where the function is evaluated

The documentation for this interface was generated from the following file: