Skip to content

Commit

Permalink
Add to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Nov 25, 2024
1 parent 97de11c commit aad6081
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ In all cases, `u` an `AbstractVector` of values and `t` is an `AbstractVector` o
corresponding to `(u,t)` pairs.

- `ConstantInterpolation(u,t)` - A piecewise constant interpolation.

- `SmoothedConstantInterpolation(u,t)` - An integral preserving continuously differentiable approximation of constant interpolation.
- `LinearInterpolation(u,t)` - A linear interpolation.
- `QuadraticInterpolation(u,t)` - A quadratic interpolation.
- `LagrangeInterpolation(u,t,n)` - A Lagrange interpolation of order `n`.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In all cases, `u` an `AbstractVector` of values and `t` is an `AbstractVector` o
corresponding to `(u,t)` pairs.

- `ConstantInterpolation(u,t)` - A piecewise constant interpolation.

- `SmoothedConstantInterpolation(u,t)` - An integral preserving continuously differentiable approximation of constant interpolation.
- `LinearInterpolation(u,t)` - A linear interpolation.
- `QuadraticInterpolation(u,t)` - A quadratic interpolation.
- `LagrangeInterpolation(u,t,n)` - A Lagrange interpolation of order `n`.
Expand Down
1 change: 1 addition & 0 deletions docs/src/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ QuadraticInterpolation
LagrangeInterpolation
AkimaInterpolation
ConstantInterpolation
SmoothedConstantInterpolation
QuadraticSpline
CubicSpline
BSplineInterpolation
Expand Down
18 changes: 18 additions & 0 deletions docs/src/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@ A = ConstantInterpolation(u, t, dir = :right)
plot(A)
```

## Smoothed Constant Interpolation

This function is much like the constant interpolation above, but the transition
between consecutive values is smoothed out so that the function is continuously
differentiable. The smoothing is done in such a way that the integral of this function
is never much off from the same integral of constant interpolation without smoothing (because of the symmetry of the smoothing sections).
The maximum smoothing distance in the `t` direction from the data points can be set
with the keyword argument `d_max`.

```@example tutorial
A = ConstantInterpolation(u, t)
plot(A)
A = SmoothedConstantInterpolation(u, t; d_max = 10)
plot!(A)
```

Note that `u[end]` is ignored.

## Quadratic Spline

This is the quadratic spline. It is a continuously differentiable interpolation
Expand Down
4 changes: 2 additions & 2 deletions src/interpolation_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ end
cache_parameters = false, assume_linear_t = 1e-2)
It is a method for interpolating constantly with forward fill, with smoothing around the
value transitions to make the curve C1 smooth while the integral never drifts far from
the integral of constant interpolation.
value transitions to make the curve continuously differentiable while the integral never
drifts far from the integral of constant interpolation. In this interpolation type u[end] is ignored.
## Arguments
Expand Down

0 comments on commit aad6081

Please sign in to comment.