diff --git a/src/interpolation_caches.jl b/src/interpolation_caches.jl index e2e544e5..4ebd70cd 100644 --- a/src/interpolation_caches.jl +++ b/src/interpolation_caches.jl @@ -136,7 +136,7 @@ end """ AkimaInterpolation(u, t; extrapolate = false, safetycopy = true) -It is a spline interpolation built from cubic polynomials. It forms a continuously differentiable function. For more details, refer: . +It is a spline interpolation built from cubic polynomials. It forms a continuously differentiable function. For more details, refer: [https://en.wikipedia.org/wiki/Akima_spline](https://en.wikipedia.org/wiki/Akima_spline). Extrapolation extends the last cubic polynomial on each side. ## Arguments @@ -420,7 +420,7 @@ end """ BSplineInterpolation(u, t, d, pVecType, knotVecType; extrapolate = false, safetycopy = true) -It is a curve defined by the linear combination of `n` basis functions of degree `d` where `n` is the number of data points. For more information, refer . +It is a curve defined by the linear combination of `n` basis functions of degree `d` where `n` is the number of data points. For more information, refer [https://pages.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/bspline-curve.html](https://pages.mtu.edu/%7Eshene/COURSES/cs3621/NOTES/spline/B-spline/bspline-curve.html). Extrapolation is a constant polynomial of the end points on each side. ## Arguments @@ -550,7 +550,7 @@ end BSplineApprox(u, t, d, h, pVecType, knotVecType; extrapolate = false, safetycopy = true) It is a regression based B-spline. The argument choices are the same as the `BSplineInterpolation`, with the additional parameter `h < length(t)` which is the number of control points to use, with smaller `h` indicating more smoothing. -For more information, refer . +For more information, refer [http://www.cad.zju.edu.cn/home/zhx/GM/009/00-bsia.pdf](http://www.cad.zju.edu.cn/home/zhx/GM/009/00-bsia.pdf). Extrapolation is a constant polynomial of the end points on each side. ## Arguments @@ -745,7 +745,7 @@ end PCHIPInterpolation(u, t; extrapolate = false, safetycopy = true) It is a PCHIP Interpolation, which is a type of `CubicHermiteSpline` where -the derivative values `du` are derived from the input data in such a way that +the derivative values `du` are derived from the input data in such a way that the interpolation never overshoots the data. See also [here](https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/moler/interp.pdf), section 3.4. diff --git a/src/interpolation_utils.jl b/src/interpolation_utils.jl index 61b4d51d..0f749316 100644 --- a/src/interpolation_utils.jl +++ b/src/interpolation_utils.jl @@ -142,7 +142,7 @@ function du_PCHIP(u, t) elseif k == lastindex(t) s[end - 1], s[end] else - s[k - 1], s[k] + s[k - 1], s[k] end if sₖ₋₁ == 0 && sₖ == 0 @@ -152,7 +152,7 @@ function du_PCHIP(u, t) ((2 * h[1] + h[2]) * δ[1] - h[1] * δ[2]) / (h[1] + h[2]) elseif k == lastindex(t) ((2 * h[end] + h[end - 1]) * δ[end] - h[end] * δ[end - 1]) / - (h[end] + h[end - 1]) + (h[end] + h[end - 1]) else w₁ = 2h[k] + h[k - 1] w₂ = h[k] + 2h[k - 1]