Calculates the numerical derivative of an array y wrt. x using central differences at the interior points and forward/backward differences at the exterior points. All three approaches yield two-point approximations of the derivatives, thus the mesh spacing does not have to be uniform.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x |
Variable x |
|
real(kind=wp), | intent(in), | dimension(size(x)) | :: | y |
Function y(x) |
Derivative dy/dx