MWE:
using Interpolations
itp1 = LinearInterpolation([1,8600],[1,8600]; extrapolation_bc=Line())
convert(Float64, itp1(8700)) #-1421.6002606281033
itp2 = LinearInterpolation([1,3200,8600],[1,3200,8600]; extrapolation_bc=Line())
convert(Float64, itp2(8700)) #8700.0
itp3 = LinearInterpolation([1,2150,4300,6450,8600],[1,2150,4300,6450,8600]; extrapolation_bc=Line())
convert(Float64, itp3(8700)) #8700.0
The linear extrapolation between 2 points is wrong. Is that a limitation of the scheme?
Julia and package versions:
julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
(jl_QhuT0L) pkg> st
Status `/tmp/jl_QhuT0L/Project.toml`
[a98d9a8b] Interpolations v0.13.4