Approximate the derivative of a function using finite differences
Returns the 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 derivative of y with respect to x at point x(i)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | y(:) | |||
| real(kind=real64), | intent(in) | :: | x(:) | |||
| integer, | intent(in) | :: | i |
Returns the 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 derivative of y with respect to x at all points
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | y(:) | |||
| real(kind=real64), | intent(in) | :: | x(:) |