diff2 Interface

public interface diff2

Approximate the second derivative of a function using finite differences


Module Procedures

private pure function diff2_at_point_i(y, x, i) result(d2y)

Returns the second derivative of y with respect to x at point x(i) using a second order finite difference scheme x: array of x values y: array of y values i: index of the point at which the derivative is computed (must be between 1 and size(x)) returns: the second derivative of y with respect to x at point x(i)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: y(:)
real(kind=real64), intent(in) :: x(:)
integer, intent(in) :: i

Return Value real(kind=real64)

private pure function diff2_at_all_points(y, x) result(d2y)

Returns the second derivative of y with respect to x at all points using a second order finite difference scheme x: array of x values y: array of y values returns: the second derivative of y with respect to x at all points

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: y(:)
real(kind=real64), intent(in) :: x(:)

Return Value real(kind=real64), (size(x))