JuliaMath / Interpolations.jl

Fast, continuous interpolation of discrete datasets in Julia
http://juliamath.github.io/Interpolations.jl/
Other
523 stars 110 forks source link

Possibly missing documentation for boundary conditions #503

Closed DanielVandH closed 1 year ago

DanielVandH commented 2 years ago

At http://juliamath.github.io/Interpolations.jl/latest/control/, it is said

The following boundary conditions are implemented: Flat, Line (alternatively, Natural), Free, Periodic and Reflect; their mathematical implications are described in detail in their docstrings.

I'm not sure where these docstrings are that are mentioned. If I try and look at them, I get:

help?> Flat
search: Flat float Float64 Float32 Float16 floatmin floatmax Cfloat BigFloat prevfloat nextfloat maxintfloat RFLUFactorization AbstractFloat findlast      

  Flat(gt) sets the extrapolation slope to zero

help?> Line
search: Line Lines lines Linear lines! LinearTicks LineElement LinearSolve LineSegments LinearIndices linesegments LinearProblem LinearAlgebra

  Line(gt) uses a constant slope for extrapolation

help?> Natural
search: Natural UnivariateMixture

  No documentation found.

  Summary
  ≡≡≡≡≡≡≡≡≡

  struct Line{GT<:Union{Nothing, Interpolations.GridType}}

  Fields
  ≡≡≡≡≡≡≡≡

  gt :: GT<:Union{Nothing, Interpolations.GridType}

  Supertype Hierarchy
  ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

  Line{GT<:Union{Nothing, Interpolations.GridType}} <: Interpolations.BoundaryCondition <: Interpolations.Flag <: Any

help?> Free
search: Free Frechet UndefRefError DifferentialEquations FiniteDifferenceMonotonicInterpolation StochasticDiffEqRODEAdaptiveAlgorithm

  No documentation found.

  Summary
  ≡≡≡≡≡≡≡≡≡

  struct Free{GT<:Union{Nothing, Interpolations.GridType}}

  Fields
  ≡≡≡≡≡≡≡≡

  gt :: GT<:Union{Nothing, Interpolations.GridType}

  Supertype Hierarchy
  ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

  Free{GT<:Union{Nothing, Interpolations.GridType}} <: Interpolations.BoundaryCondition <: Interpolations.Flag <: Any

help?> Periodic
search: Periodic PeriodicCallback MultipleLinearRegressionBounded

  Periodic(gt) applies periodic boundary conditions

help?> Reflect
search: Reflect reflect! ProcessFailedException dropped_files

  Reflect(gt) applies reflective boundary conditions

Of course, the mathematical implication of the boundary conditions is somewhat clear, but the "in detail" part of the quote above makes me think that maybe this is a mistake and should be more documentation here?

mkitti commented 2 years ago

Yes it looks like the doc string is missing: https://github.com/JuliaMath/Interpolations.jl/blob/4c29ad6cf21e426acc4e1e4a2963aaa20ae64d61/src/Interpolations.jl#L97-L108

Are you interested in writing them?

mkitti commented 2 years ago

Free:

The free boundary condition makes sure the interpoland has a continuous \ third derivative at the second-to-outermost cell boundary

https://cs.github.com/JuliaMath/Interpolations.jl/blob/4c29ad6cf21e426acc4e1e4a2963aaa20ae64d61/doc/Interpolations_algebra.nb#L927